/**
 *
 *
 */
var slider_timer;
var slider_width;

function Slider(options)
{

	slider_width = 0;

	$('.klanten-slide img').each(function()
	{
		slider_width = slider_width + $(this).width();
	});
	
	//alert(slider_width);

	var defaults =
	{
		//count  : $('.klanten-slide').length,
		count  : 2,
		current: 0,
		delay  : 500,
		speed  : 80000,
		width  : (slider_width - 0)
	};
	
	var options = $.extend(defaults, options);
	
	/**
	 *
	 */
	this.slide = function(c)
	{
		var _self = this;
		
		if(typeof c == "undefined")
			options.current++;
		else
		{
			clearTimeout(slider_timer);
			
			options.current = c;
		};
		
		if(options.current >= options.count)
		{
			options.current = 0;
			
			var m = 0;
		}
		else
			var m = options.width;
		
		$('.klanten-slide').animate({marginLeft: "-"+(m * options.current)+"px"}, options.speed, 'linear');
		
		slider_timer = setTimeout(function(){ _self.slide(); }, options.delay);
	};
	
};
