

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById, scrollspeed2=0, movestate2='', actualwidth2='', cross_scroll2, ns_scroll2, statusdiv2, loadedyes2=0, lefttime2, righttime2;

function ietruebody2(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function creatediv2(){
/*statusdiv2=document.createElement("div")
statusdiv2.setAttribute("id","statusdiv2")
document.body.appendChild(statusdiv2)
statusdiv2=document.getElementById("statusdiv2")
statusdiv2.innerHTML=endofgallerymsg*/
}

function positiondiv2(){
var mainobjoffset2=getposOffset2(crossmain2, "left"),
menuheight2=parseInt(crossmain2.offsetHeight),
mainobjoffset2H=getposOffset2(crossmain2, "top");
statusdiv2.style.left=mainobjoffset2+(menuwidth2/2)-(statusdiv2.offsetWidth/2)+"px";
statusdiv2.style.top=menuheight2+mainobjoffset2H+"px";
}

function showhidediv2(what){
if (endofgallerymsg!="") {
positiondiv2();
statusdiv2.style.visibility=what;
}
}

function getposOffset2(what, offsettype){
var totaloffset2=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl2=what.offsetParent;
while (parentEl2!=null){
totaloffset2=(offsettype=="left")? totaloffset2+parentEl2.offsetLeft : totaloffset2+parentEl2.offsetTop;
parentEl2=parentEl2.offsetParent;
}
return totaloffset2;
}


function moveleft2(){
if (loadedyes2){
movestate2="left";
if (iedom&&parseInt(cross_scroll2.style.left)>(menuwidth2-actualwidth2)){
cross_scroll2.style.left=parseInt(cross_scroll2.style.left)-scrollspeed2+"px";
showhidediv2("hidden");
}
else
showhidediv2("visible");
}
lefttime2=setTimeout("moveleft2()",10);
}

function moveright2(){
if (loadedyes2){
movestate2="right";
if (iedom&&parseInt(cross_scroll2.style.left)<0){
cross_scroll2.style.left=parseInt(cross_scroll2.style.left)+scrollspeed2+"px";
showhidediv2("hidden");
}
else
showhidediv2("visible");
}
righttime2=setTimeout("moveright2()",10);
}

function motionengine2(et){
var mainobjoffset2=getposOffset2(crossmain2, "left"),
dsocx2=(window.pageXOffset)? pageXOffset: ietruebody2().scrollLeft,
dsocy2=(window.pageYOffset)? pageYOffset : ietruebody2().scrollTop,
curposy2=window.event? event.clientX : e.clientX? e.clientX: "";
curposy2-=mainobjoffset2-dsocx2;
var leftbound2=(menuwidth2-restarea)/2;
var rightbound2=(menuwidth2+restarea)/2;
if (curposy2>rightbound2){
scrollspeed2=(curposy2-rightbound2)/((menuwidth2-restarea)/2) * maxspeed;
clearTimeout(righttime2);
if (movestate2!="left") moveleft2();
}
else if (curposy2<leftbound2){
scrollspeed2=(leftbound2-curposy2)/((menuwidth2-restarea)/2) * maxspeed;
clearTimeout(lefttime2);
if (movestate2!="right") moveright2();
}
else
scrollspeed2=0;
}

function contains_ns62(a, b) {
if (b!==null)
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion2(et){
if (!window.opera||(window.opera&&e.relatedTarget!==null))
if ((window.event&&!crossmain2.contains(event.toElement)) || (et && et.currentTarget && et.currentTarget!= et.relatedTarget && !contains_ns62(et.currentTarget, et.relatedTarget))){
clearTimeout(lefttime2);
clearTimeout(righttime2);
movestate2="";
}
}

function fillup2(){

if (iedom){
crossmain2=document.getElementById? document.getElementById("motioncontainer2") : document.all.motioncontainer2;

if(typeof crossmain2.style.maxwidth!=='undefined')
crossmain2.style.maxwidth=maxwidth+'px';

menuwidth2=crossmain2.offsetWidth;
cross_scroll2=document.getElementById? document.getElementById("motiongallery2") : document.all.motiongallery2;
actualwidth2=document.getElementById? document.getElementById("trueContainer2").offsetWidth : document.all['trueContainer2'].offsetWidth;

if (startpos) 
cross_scroll2.style.left=(menuwidth2-actualwidth2)/startpos+'px';
crossmain2.onmousemove=function(et){
motionengine2(et);
}

crossmain2.onmouseout=function(et){
stopmotion2(et);
showhidediv2("hidden");
}
}
loadedyes2=1
if (endofgallerymsg!=""){
creatediv2();
positiondiv2();
}
if (document.body.filters)
onresize2()
}

onresize2=function(){
if (typeof motioncontainer2!=='undefined'&&motioncontainer2.filters){

motioncontainer2.style.width="0";
motioncontainer2.style.width="";
motioncontainer2.style.width=Math.min(motioncontainer2.offsetWidth, maxwidth)+'px';
}
menuwidth2=crossmain2.offsetWidth;

cross_scroll2.style.left=startpos? (menuwidth2-actualwidth2)/startpos+'px' : 0;
}