// JavaScript Document
 //4) Set to 1 for left start, 0 for right, 2 for center.
var startpos=0;
var noMouse=1;
var scrollspeed=2;
//window.onload=fillup;
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer;
if(typeof crossmain.style.maxWidth!=='undefined')
crossmain.style.maxWidth=maxwidth+'px';
menuwidth=crossmain.offsetWidth;
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery;
actualwidth=document.getElementById? document.getElementById("trueContainer").offsetWidth : document.all['trueContainer'].offsetWidth;
if (startpos)
cross_scroll.style.left=(menuwidth-actualwidth)/startpos+'px';

function moveleft(){
	movestate="left";
	if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
		cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px";
		showhidediv("hidden");
	} else {
		cross_scroll.style.left='0px';
		// showhidediv("visible");
		// clearTimeout(lefttime);
		// moveright();
	}
	//document.debug.debugit.value="left="+parseInt(cross_scroll.style.left)+" speed="+scrollspeed;
	lefttime=setTimeout("moveleft()",15);
}
moveleft();

function moveright(){
	movestate="right";
	if (iedom&&parseInt(cross_scroll.style.left)<0){
		cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px";
		showhidediv("hidden");
	} else {
		// showhidediv("visible");
		clearTimeout(righttime);
		moveleft();
	}
	righttime=setTimeout("moveright()",15);
}
