(function($){$.fn.pointslide = function(){	var container = $(this);	var iw = 135; // item-width	var wmod = -31; // width modification (right now set to make up for the size of 1 left margin of a list element, since its removed on the first list-item)	var minpos = 0; // stores the minimum value the list can be moved to the left. (right is always 0)		/*	default space and time together sets the default scroll speed (speed while not hovered)	*/	var defaultSpace = 10; // default space to move during each iteration.	var defaultTime = 300; // default time it takes for each iteration.		/*	maxSpace and minTime together sets the maximum scroll speed (when hovered either fully to the left or the right side)	spaces in between have a calculated speed between this and the default.	*/	var maxSpace = 40; // maximum space to move during each iteration	var minTime = 100; // minimum time it takes for each iteration			var interval = null; // interval container	var direction = -1; // -1 -> naar rechts 1 || -> naar links	var eloffset = 0; // left offset of the animation	var leftrange = []; // position to hover to make the list move to the right (show elements on the left)	var clearrange = []; // not used might be used in the future | position to hover when the animation should stop	var rightrange = []; // position to hover to make the list move to the left (show elements on the right)	var mousePos = null; // stores the position of the mouse while hovering over the animation. (relative to document)	var hovered = false; // hover-state		this.init = function(){		var w = (container.find('> ul > li').length*iw)+wmod;		$(container).find('> ul').css({width: w+'px'});		minpos = parseInt($(container).width())-w;				var cw =  parseInt(container.outerWidth(false));		leftrange = [0, (cw/100)*40];		clearrange = [(cw/100)*40, (cw/100)*60];		rightrange = [(cw/100)*60, cw];				eloffset = container.offset().left;				container.mouseover(function(e){ switchState(true); });		container.mouseout(function(e){ switchState(false); });		container.mousemove(function(e){ if(mousePos != e.pageX){ mousePos = e.pageX;setEnterStateInterval(); } });		interval = clearInterval(interval);		interval = setInterval(function(){ move(defaultSpace, defaultTime, direction); }, defaultTime+1);		$(window).resize( function(){			eloffset = container.offset().left;		});			}			var move = function(space, time, dir){			var pos = Math.round(parseInt(container.find('ul').css('left')));						var l = space*dir;			switch(dir){				case -1:					l = (pos+l<minpos) ? (minpos-pos): l ; 				break;				case 1: 					l = pos+l > 0 ? 0-pos :l; 				break;			}			var n = Math.round(pos+l);			container.find('ul').stop(true).animate({				left: n+'px'			}, time, 'linear', function(){				container.find('ul').css({left: n+'px'});			});									if(n == minpos || n == 0) direction = direction*-1;			}		var setEnterStateInterval = function(){		if(hovered){			var t;			var s;			var d;			if(mousePos-eloffset >= leftrange[0] && mousePos-eloffset <= leftrange[1]){				d = 1;				direction = 1;				var pct = 100-(((mousePos-eloffset)/(leftrange[1]-leftrange[0]))*100); // reverse pcs more left means higher pct			}			else if(mousePos-eloffset >= rightrange[0] && mousePos-eloffset <= rightrange[1]){				d = -1;				direction = -1;				var pct = (((mousePos-rightrange[0])-eloffset)/(rightrange[1]-rightrange[0]))*100;			}			else{				return;			}			var t = defaultTime-(((defaultTime-minTime)/100)*pct);			var s = defaultSpace+(((maxSpace-defaultSpace)/100)*pct);			//alert(d+' '+s+' '+t)			interval = clearInterval(interval);			move(s, t, d);			interval = setInterval(function(){ move(s, t, d); }, t+1);								}	}	var switchState = function(hover){		if(hover == hovered) return;		hovered = hover;				interval = clearInterval(interval);		if(!hover)			interval = setInterval(function(){ move(defaultSpace, defaultTime, direction); }, defaultTime+1);	}			this.init();}})(jQuery);$(function(){	if($('.customer-div .inner-div').length > 0) $('.customer-div .inner-div').pointslide();});
