var scrolldir="normal"
var scrollspeed=10
var lefttime,righttime;
var menuwidth=520;
var iedom=document.all||document.getElementById
var actualwidth=''
var cross_scroll
var loadedyes=0
var cntr=0;

function fillup(){
if(!document.getElementById("motiongallery") || !document.all.motiongallery)return;
if (iedom){
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery;
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("tablegallery").offsetWidth;
}else if (document.layers){
ns_scroll=document.ns_scrollmenu.document.ns_scrollmenu2
actualwidth=ns_scroll.document.width;
}
loadedyes=1;
}

function moveleft(){
cntr++;
if(cntr==parseInt(menuwidth/scrollspeed)-1){
cntr=0;
clearTimeout(lefttime);
return;
}
if (loadedyes){
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px"
}
else if (document.layers&&ns_scroll.left>(menuwidth-actualwidth))
ns_scroll.left-=scrollspeed
}
lefttime=setTimeout("moveleft()",10)
}

function moveright(){
cntr++;
if(cntr==parseInt(menuwidth/scrollspeed)-1){
cntr=0;
clearTimeout(lefttime);
return;
}
if (loadedyes){
if (iedom&&parseInt(cross_scroll.style.left)<0)
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px"
else if (document.layers&&ns_scroll.left<0)
ns_scroll.left+=scrollspeed
}
righttime=setTimeout("moveright()",10)
}

