/* 
SlashC jQuery image slider plugin
hi@slashc.com, www.slashc.com
*/
(function($)
{	
	/* plugin methods */
	var methods =
	{
		/* intialization */
		init : function()
		{
			return this.each(function()
			{
				var $this = $(this), props = $this.data('props');				
				if(!props)
				{
					var thumbsList = $('div.slashc-thumbslist', $this).slashcThumbsList();
					var scrollBar = $('div.slashc-hscrollbar', $this).slashcScrollBar();
					scrollBar.slashcScrollBar('setProportion', thumbsList.slashcThumbsList('getProportion'));
					scrollBar.bind('scroll.slashcImageSlider', $.proxy(function(e)
					{
						this.slashcThumbsList('scrollTo', e.percentage);
					}, thumbsList));
				}
			});
		}
	};
	/* Image slider plugin */
	$.fn.slashcImageSlider = function(method)
	{
		if(methods[method])
		{
			return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
		}
		else if(!method)
		{
			return methods.init.call(this);
		}		
	};
})(jQuery);
