/*********************************************** * CMotion Image Gallery- c Dynamic Drive DHTML code library (www.dynamicdrive.com) * Visit http://www.dynamicDrive.com for source code * This copyright notice must stay intact for legal use * Modified for autowidth and optional starting positions in * http://www.dynamicdrive.com/forums/showthread.php?t=11839 by jschuer1 8/5/06 ***********************************************/ var iedom=document.all||document.getElementById, scrollspeed=0, movestate3='', actualwidth3='', cross_scroll, ns_scroll, statusdiv3, loadedyes3=0, lefttime, righttime; function creatediv3(){ statusdiv3=document.createElement("div") statusdiv3.setAttribute("id","statusdiv3") document.body.appendChild(statusdiv3) statusdiv3=document.getElementById("statusdiv3") statusdiv3.innerHTML=endofgallerymsg } function positiondiv3(){ var mainobjoffset3=getposOffset3(crossmain3, "left"), menuheight3=parseInt(crossmain3.offsetHeight), mainobjoffset3H=getposOffset3(crossmain3, "top"); statusdiv3.style.left=mainobjoffset3+(menuwidth3/2)-(statusdiv3.offsetWidth/2)+"px"; statusdiv3.style.top=menuheight3+mainobjoffset3H+"px"; } function showhidediv3(what){ if (endofgallerymsg!="") { positiondiv3(); statusdiv3.style.visibility=what; } } function getposOffset3(what, offsettype){ var totaloffset3=(offsettype=="left")? what.offsetLeft: what.offsetTop; var parentEl3=what.offsetParent; while (parentEl3!=null){ totaloffset3=(offsettype=="left")? totaloffset3+parentEl3.offsetLeft : totaloffset3+parentEl3.offsetTop; parentEl3=parentEl3.offsetParent; } return totaloffset3; } function moveleft3(){ if (loadedyes3){ movestate3="left"; if (iedom&&parseInt(cross_scroll3.style.left)>(menuwidth3-actualwidth3)){ cross_scroll3.style.left=parseInt(cross_scroll3.style.left)-scrollspeed+"px"; showhidediv3("hidden"); } else showhidediv3("visible"); } lefttime=setTimeout("moveleft3()",10); } function moveright3(){ if (loadedyes3){ movestate3="right"; if (iedom&&parseInt(cross_scroll3.style.left)<0){ cross_scroll3.style.left=parseInt(cross_scroll3.style.left)+scrollspeed+"px"; showhidediv3("hidden"); } else showhidediv3("visible"); } righttime=setTimeout("moveright3()",10); } function motionengine3(e){ var mainobjoffset3=getposOffset3(crossmain3, "left"), dsocx3=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft, dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop, curposy=window.event? event.clientX : e.clientX? e.clientX: ""; curposy-=mainobjoffset3-dsocx3; var leftbound3=(menuwidth3-restarea)/2; var rightbound3=(menuwidth3+restarea)/2; if (curposy>rightbound3){ scrollspeed=(curposy-rightbound3)/((menuwidth3-restarea)/2) * maxspeed; clearTimeout(righttime); if (movestate3!="left") moveleft3(); } else if (curposy