	
	//var imgcount = 12;  //8
	//var imgwidth = 74; //100
	//var distance = 430; //303
	//var startmove = 30; //37
	var ipr = 1; //images per row
	var factor = 0.99; //0.925
	var speed = 1.5; //2.2
	
	
	var imgleftpos = 0;
	var currimg = 1;
	var clipsize = 0;
	var steptimer;
	var stepsmoved = 0;
	var imgtempmove;
	var moving = 0;
	var arrowB = new Array("imgback","img/arrowLEFT.gif","img/arrowLEFTdim.gif"); //image name, active image ref, inactive image ref
	var arrowF = new Array("imgforward","img/arrowRIGHT.gif","img/arrowRIGHTdim.gif");
	
	function imgscrollforward()
	{	
		//if(moving==0&&parseInt(document.getElementById("divBoxGreenBottomScroller").style.left)>(parseInt((imgcount*imgwidth)-((parseInt(distance/imgwidth))*imgwidth))*-1))
		if(stepsmoved-3>(Math.floor(imgcount/ipr)*-1)&&imgcount!=ipr)
		{
			
			imgtempmove = startmove;
			stepsmoved -= 1;
			steptimer = setInterval("doImgscroll(0)", speed*10);
			moving = 1;
			//alert("forward");
		}
	}

	function togglebuttons()
	{
			//window.status=stepsmoved+"/"
			document.getElementById(arrowB[0]).src = (stepsmoved==0 ? arrowB[2] : arrowB[1]);
			document.getElementById(arrowB[0]).style.cursor = (stepsmoved==0 ? "none" : "pointer");
			//document.getElementById(arrowF[0]).src = (parseInt(document.getElementById("divBoxGreenBottomScroller").style.left)<=(parseInt((imgcount*imgwidth)-((parseInt(distance/imgwidth))*imgwidth)-(Math.round(parseInt(distance)/imgwidth)*imgwidth))*-1)-(startmove==32 ? 0 : 0) ? arrowF[2] : arrowF[1]);
			//document.getElementById(arrowF[0]).style.cursor = (parseInt(document.getElementById("divBoxGreenBottomScroller").style.left)<=(parseInt((imgcount*imgwidth)-((parseInt(distance/imgwidth))*imgwidth)-(Math.round(parseInt(distance)/imgwidth)*imgwidth))*-1)-0 ? "none" : "pointer");
			document.getElementById(arrowF[0]).src = (((stepsmoved-3<=(Math.floor(imgcount/ipr)*-1))||imgcount==ipr) ? arrowF[2] : arrowF[1]);
			document.getElementById(arrowF[0]).style.cursor = (((stepsmoved-3<=(Math.floor(imgcount/ipr)*-1))||imgcount==ipr) ? "none" : "pointer");
			//alert(stepsmoved + "_" + (Math.floor(imgcount/ipr)*-1));
	}	
	
	function imgscrollback()
	{ 
		if(moving==0&&parseInt(document.getElementById("divBoxGreenBottomScroller").style.left)<0)
		{
			imgtempmove = startmove;
			stepsmoved += 1;
			steptimer = setInterval("doImgscroll(1)", speed*10);
			moving = 1;
		}
	}
	
	function doImgscroll(dir)
	{  
		imgtempmove = parseInt(imgtempmove * factor);
		imgleftpos += (dir==0 ? - imgtempmove : + imgtempmove);
		document.getElementById("divBoxGreenBottomScroller").style.left = imgleftpos + "px";
		if(parseInt(imgtempmove)<=0)
		{
			clearInterval(steptimer);
			imgleftpos = (distance*stepsmoved);
			document.getElementById("divBoxGreenBottomScroller").style.left = imgleftpos + "px";
			moving = 0;
			togglebuttons()
		}
	}
	