/*********************************************** * 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, movestate4='', actualwidth4='', cross_scroll, ns_scroll, statusdiv4, loadedyes4=0, lefttime, righttime; function creatediv4(){ statusdiv4=document.createElement("div") statusdiv4.setAttribute("id","statusdiv4") document.body.appendChild(statusdiv4) statusdiv4=document.getElementById("statusdiv4") statusdiv4.innerHTML=endofgallerymsg } function positiondiv4(){ var mainobjoffset4=getposOffset4(crossmain4, "left"), menuheight4=parseInt(crossmain4.offsetHeight), mainobjoffset4H=getposOffset4(crossmain4, "top"); statusdiv4.style.left=mainobjoffset4+(menuwidth4/2)-(statusdiv4.offsetWidth/2)+"px"; statusdiv4.style.top=menuheight4+mainobjoffset4H+"px"; } function showhidediv4(what){ if (endofgallerymsg!="") { positiondiv4(); statusdiv4.style.visibility=what; } } function getposOffset4(what, offsettype){ var totaloffset4=(offsettype=="left")? what.offsetLeft: what.offsetTop; var parentEl4=what.offsetParent; while (parentEl4!=null){ totaloffset4=(offsettype=="left")? totaloffset4+parentEl4.offsetLeft : totaloffset4+parentEl4.offsetTop; parentEl4=parentEl4.offsetParent; } return totaloffset4; } function moveleft4(){ if (loadedyes4){ movestate4="left"; if (iedom&&parseInt(cross_scroll4.style.left)>(menuwidth4-actualwidth4)){ cross_scroll4.style.left=parseInt(cross_scroll4.style.left)-scrollspeed+"px"; showhidediv4("hidden"); } else showhidediv4("visible"); } lefttime=setTimeout("moveleft4()",10); } function moveright4(){ if (loadedyes4){ movestate4="right"; if (iedom&&parseInt(cross_scroll4.style.left)<0){ cross_scroll4.style.left=parseInt(cross_scroll4.style.left)+scrollspeed+"px"; showhidediv4("hidden"); } else showhidediv4("visible"); } righttime=setTimeout("moveright4()",10); } function motionengine4(e){ var mainobjoffset4=getposOffset4(crossmain4, "left"), dsocx4=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft, dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop, curposy=window.event? event.clientX : e.clientX? e.clientX: ""; curposy-=mainobjoffset4-dsocx4; var leftbound4=(menuwidth4-restarea)/2; var rightbound4=(menuwidth4+restarea)/2; if (curposy>rightbound4){ scrollspeed=(curposy-rightbound4)/((menuwidth4-restarea)/2) * maxspeed; clearTimeout(righttime); if (movestate4!="left") moveleft4(); } else if (curposy