/*********************************************** * 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, movestate1='', actualwidth1='', cross_scroll, ns_scroll, statusdiv1, loadedyes1=0, lefttime, righttime; function creatediv1(){ statusdiv1=document.createElement("div") statusdiv1.setAttribute("id","statusdiv1") document.body.appendChild(statusdiv1) statusdiv1=document.getElementById("statusdiv1") statusdiv1.innerHTML=endofgallerymsg } function positiondiv1(){ var mainobjoffset1=getposOffset1(crossmain1, "left"), menuheight1=parseInt(crossmain1.offsetHeight), mainobjoffset1H=getposOffset1(crossmain1, "top"); statusdiv1.style.left=mainobjoffset1+(menuwidth1/2)-(statusdiv1.offsetWidth/2)+"px"; statusdiv1.style.top=menuheight1+mainobjoffset1H+"px"; } function showhidediv1(what){ if (endofgallerymsg!="") { positiondiv1(); statusdiv1.style.visibility=what; } } function getposOffset1(what, offsettype){ var totaloffset1=(offsettype=="left")? what.offsetLeft: what.offsetTop; var parentEl1=what.offsetParent; while (parentEl1!=null){ totaloffset1=(offsettype=="left")? totaloffset1+parentEl1.offsetLeft : totaloffset1+parentEl1.offsetTop; parentEl1=parentEl1.offsetParent; } return totaloffset1; } function moveleft1(){ if (loadedyes1){ movestate1="left"; if (iedom&&parseInt(cross_scroll1.style.left)>(menuwidth1-actualwidth1)){ cross_scroll1.style.left=parseInt(cross_scroll1.style.left)-scrollspeed+"px"; showhidediv1("hidden"); } else showhidediv1("visible"); } lefttime=setTimeout("moveleft1()",10); } function moveright1(){ if (loadedyes1){ movestate1="right"; if (iedom&&parseInt(cross_scroll1.style.left)<0){ cross_scroll1.style.left=parseInt(cross_scroll1.style.left)+scrollspeed+"px"; showhidediv1("hidden"); } else showhidediv1("visible"); } righttime=setTimeout("moveright1()",10); } function motionengine1(e){ var mainobjoffset1=getposOffset1(crossmain1, "left"), dsocx1=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft, dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop, curposy=window.event? event.clientX : e.clientX? e.clientX: ""; curposy-=mainobjoffset1-dsocx1; var leftbound1=(menuwidth1-restarea)/2; var rightbound1=(menuwidth1+restarea)/2; if (curposy>rightbound1){ scrollspeed=(curposy-rightbound1)/((menuwidth1-restarea)/2) * maxspeed; clearTimeout(righttime); if (movestate1!="left") moveleft1(); } else if (curposy