/*********************************************** * 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, movestate5='', actualwidth5='', cross_scroll, ns_scroll, statusdiv5, loadedyes5=0, lefttime, righttime; function creatediv5(){ statusdiv5=document.createElement("div") statusdiv5.setAttribute("id","statusdiv5") document.body.appendChild(statusdiv5) statusdiv5=document.getElementById("statusdiv5") statusdiv5.innerHTML=endofgallerymsg } function positiondiv5(){ var mainobjoffset5=getposOffset5(crossmain5, "left"), menuheight5=parseInt(crossmain5.offsetHeight), mainobjoffset5H=getposOffset5(crossmain5, "top"); statusdiv5.style.left=mainobjoffset5+(menuwidth5/2)-(statusdiv5.offsetWidth/2)+"px"; statusdiv5.style.top=menuheight5+mainobjoffset5H+"px"; } function showhidediv5(what){ if (endofgallerymsg!="") { positiondiv5(); statusdiv5.style.visibility=what; } } function getposOffset5(what, offsettype){ var totaloffset5=(offsettype=="left")? what.offsetLeft: what.offsetTop; var parentEl5=what.offsetParent; while (parentEl5!=null){ totaloffset5=(offsettype=="left")? totaloffset5+parentEl5.offsetLeft : totaloffset5+parentEl5.offsetTop; parentEl5=parentEl5.offsetParent; } return totaloffset5; } function moveleft5(){ if (loadedyes5){ movestate5="left"; if (iedom&&parseInt(cross_scroll5.style.left)>(menuwidth5-actualwidth5)){ cross_scroll5.style.left=parseInt(cross_scroll5.style.left)-scrollspeed+"px"; showhidediv5("hidden"); } else showhidediv5("visible"); } lefttime=setTimeout("moveleft5()",10); } function moveright5(){ if (loadedyes5){ movestate5="right"; if (iedom&&parseInt(cross_scroll5.style.left)<0){ cross_scroll5.style.left=parseInt(cross_scroll5.style.left)+scrollspeed+"px"; showhidediv5("hidden"); } else showhidediv5("visible"); } righttime=setTimeout("moveright5()",10); } function motionengine5(e){ var mainobjoffset5=getposOffset5(crossmain5, "left"), dsocx5=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft, dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop, curposy=window.event? event.clientX : e.clientX? e.clientX: ""; curposy-=mainobjoffset5-dsocx5; var leftbound5=(menuwidth5-restarea)/2; var rightbound5=(menuwidth5+restarea)/2; if (curposy>rightbound5){ scrollspeed=(curposy-rightbound5)/((menuwidth5-restarea)/2) * maxspeed; clearTimeout(righttime); if (movestate5!="left") moveleft5(); } else if (curposy