var restarea=6;var maxspeed=7;var endofgallerymsg="";var framewidth=600;var frameheight=67;function changeframewidth(){var b=600,a=0;if(typeof(window.innerWidth)=="number"){a=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){a=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){a=document.body.clientHeight}}}if(document.getElementById("motioncontainer")!=null&&document.getElementById("motioncontainer").style!=null){if(isIE6){document.getElementById("motioncontainer").style.width=b-32+"px"}else{document.getElementById("motioncontainer").style.width=b-20+"px"}}}var iedom=document.all||document.getElementById;var scrollspeed=0;var movestate="";var actualwidth="";var cross_scroll,ns_scroll;var loadedyes=0;function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}function creatediv(){statusdiv=document.createElement("div");statusdiv.setAttribute("id","statusdiv");document.body.appendChild(statusdiv);statusdiv=document.getElementById("statusdiv");statusdiv.innerHTML=endofgallerymsg}function positiondiv(){menuheight=parseInt(crossmain.offsetHeight);mainobjoffsetH=getposOffset(crossmain,"top");statusdiv.style.left=mainobjoffset+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px";statusdiv.style.top=menuheight+mainobjoffsetH+"px"}function showhidediv(a){if(endofgallerymsg!=""){statusdiv.style.visibility=a}}function getposOffset(d,c){var b=(c=="left")?d.offsetLeft:d.offsetTop;var a=d.offsetParent;while(a!=null){b=(c=="left")?b+a.offsetLeft:b+a.offsetTop;a=a.offsetParent}return b}function moveleft(){if(loadedyes){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{showhidediv("visible")}}lefttime=setTimeout("moveleft()",10)}function moveright(){if(loadedyes){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")}}righttime=setTimeout("moveright()",10)}function motionengine(f){var g=(window.pageXOffset)?pageXOffset:ietruebody().scrollLeft;var d=(window.pageYOffset)?pageYOffset:ietruebody().scrollTop;var b=window.event?event.clientX:f.clientX?f.clientX:"";b-=mainobjoffset-g;var a=(menuwidth-restarea)/2;var c=(menuwidth+restarea)/2;if(b>c){scrollspeed=(b-c)/((menuwidth-restarea)/2)*maxspeed;if(window.righttime){clearTimeout(righttime)}if(movestate!="left"){moveleft()}}else{if(b<a){scrollspeed=(a-b)/((menuwidth-restarea)/2)*maxspeed;if(window.lefttime){clearTimeout(lefttime)}if(movestate!="right"){moveright()}}else{scrollspeed=0}}}function contains_ns6(d,c){if(c!=null){while(c.parentNode){if((c=c.parentNode)==d){return true}}return false}else{return false}}function stopmotion(a){if((window.event&&!crossmain.contains(event.toElement))||(a&&a.currentTarget&&a.currentTarget!=a.relatedTarget&&!contains_ns6(a.currentTarget,a.relatedTarget))){if(window.lefttime){clearTimeout(lefttime)}if(window.righttime){clearTimeout(righttime)}movestate=""}}function fillup(){changeframewidth();document.getElementById("motioncontainer").style.height=frameheight+"px";if(iedom){crossmain=document.getElementById?document.getElementById("motioncontainer"):document.all.motioncontainer;menuwidth=parseInt(crossmain.style.width);mainobjoffset=getposOffset(crossmain,"left");cross_scroll=document.getElementById?document.getElementById("motiongallery"):document.all.motiongallery;cross_scroll.style.left="0px";actualwidth=document.all?cross_scroll.offsetWidth:document.getElementById("trueContainer").offsetWidth;crossmain.onmousemove=function(a){motionengine(a)};crossmain.onmouseout=function(a){stopmotion(a);showhidediv("hidden")}}loadedyes=1;if(endofgallerymsg!=""){creatediv();positiondiv()}}window.onload=fillup;window.onresize=fillup;
