$(document).ready(function() {
  var countThumbs = $('.thumbs-1 > *').length;
  var thumbWidth = 0;
  var maxThumbTop = 0;
  var thumbPos;
  var count=1;
  var imageWidth;
  var imageHeight;
  var topPosition =0;
  var imagePosition = 0;
  var thumbArray = new Array(countThumbs);
  var prevlargeName = 'Large-1';
  var prevY;
  var topPos;
  var y;
  var distance;
  var yExp;
  var blobPos;
  var divHeight = -$('#scroller-images').height() + 600;
  
	$("#scroller").mousemove(function(e){
		y = e.pageY - this.offsetTop;
		if(y > 400) {
			yExp = (y-400) / 80;
			distance = Math.exp(yExp);
			distance = Math.round(distance);
			distance = distance /2;
		} else if(y <200) {
			yExp = (0-y) / 150;
			yExp = yExp + 2.5;
			distance = Math.exp(yExp);
			distance = Math.round(distance);
			distance = distance /2;
		}
   });
	
	setInterval(movePosition,40);

	function movePosition() {
		topPos = $('#scroller-images').css('top').replace('px','');
		if (y < 200 || y > 400) {
			if (y <200 && topPos <0) {
					$('#scroller-images').css({
								  top: (topPos - -distance) + 'px'
								  });
			}
			if (y >400 && topPos > divHeight) {
					$('#scroller-images').css({
										  top: (topPos - distance) + 'px'
										  });
			}
		}
		prevY = y;
	}

});

