/*********************************************** * 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, movestate2='', actualwidth2='', cross_scroll, ns_scroll, statusdiv2, loadedyes2=0, lefttime, righttime; 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)-scrollspeed+"px"; showhidediv2("hidden"); } else showhidediv2("visible"); } lefttime=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)+scrollspeed+"px"; showhidediv2("hidden"); } else showhidediv2("visible"); } righttime=setTimeout("moveright2()",10); } function motionengine2(e){ var mainobjoffset2=getposOffset2(crossmain2, "left"), dsocx2=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft, dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop, curposy=window.event? event.clientX : e.clientX? e.clientX: ""; curposy-=mainobjoffset2-dsocx2; var leftbound2=(menuwidth2-restarea)/2; var rightbound2=(menuwidth2+restarea)/2; if (curposy>rightbound2){ scrollspeed=(curposy-rightbound2)/((menuwidth2-restarea)/2) * maxspeed; clearTimeout(righttime); if (movestate2!="left") moveleft2(); } else if (curposy