/*********************************************** * OO_CMotion Image Gallery- © 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 * Object Oriented update 9/19/06 ***********************************************/ // Set message to show at end of gallery(s). Enter "" to disable message. var endofgallerymsg=''; /* //declare gallery's name: var gallery=new Array(); // Use a space character between each image for this gallery? (use 1 for yes, 0 for no): gallery.usespace=1; //define gallery's image train: gallery[0]=''; gallery[1]=''; gallery[2]=''; gallery[3]=''; gallery[4]=''; gallery[5]=''; gallery[6]=''; gallery[7]=''; gallery[8]=''; //optional additional gallery names, image trains, and usespace properties may be used: //declare gallery's name: var gallery2=new Array(); // Use a space character between each image for this gallery? (use 1 for yes, 0 for no): gallery2.usespace=0; //define gallery's image train: gallery2[0]=''; gallery2[1]=''; gallery2[2]=''; gallery2[3]=''; gallery2[4]=''; gallery2[5]=''; gallery2[6]=''; gallery2[7]=''; gallery2[8]=''; */ //function used optionally to enlarge an image. Change as desired: function enlargeimage(path, optWidth, optHeight){ if(!document.body.filters) if(thewin&&thewin.name=='cwin'&&window==thewin.opener)thewin.close(); var actualWidth=typeof optWidth!="undefined" ? optWidth : 600; //set 600 to default width var actualHeight=typeof optHeight!="undefined" ? optHeight : 500; //set 500 to default height actualWidth+=window.opera? 0 : 20, actualHeight+=window.opera? 0 : 20; var winattributes="width="+actualWidth+",height="+actualHeight+",resizable,status"; thewin=window.open(path,"cwin", winattributes); if(document.body.filters) thewin.resizeTo(actualWidth+12, actualHeight+70); thewin.focus(); onunload=function(){if(thewin&&thewin.name=='cwin')thewin.close();}; return false; } ////NO NEED TO EDIT BELOW THIS LINE//////////// var iedom=document.all||document.getElementById, cgals=[], thewin=null; function cmotiongallery(gallery, rest, maxs, maxw, startp, width, height, c){ if(!iedom) return; this.gallery=gallery; this.usespace=this.gallery.usespace? ' ' : ''; this.width=/%/.test(width)? width : parseInt(width)+'px'; this.height=height; this.c=c? 'margin:0 auto;' : ''; this.loadedyes=0; this.movestate=''; this.scrollspeed=0; this.galid=cgals.length; cgals[cgals.length]=this; this.rest=rest; this.maxs=maxs; this.maxw=maxw; this.startpos=startp; for (var i_tem = 0; i_tem < this.gallery.length; i_tem++) this.gallery[i_tem]=!/on[cC]lick/.test(this.gallery[i_tem])? this.gallery[i_tem].replace(/href="#"/, 'href="#" onclick="return false;"') : this.gallery[i_tem]; document.write('
\n'+ '
\n'+ '\n'+ ''+this.gallery.join(this.usespace)+'<\/nobr>\n'+ '\n'+ '<\/div>\n'+ '<\/div>') this.fillup(); } function ietruebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body; } cmotiongallery.prototype.creatediv=function(){ this.statusdiv=document.createElement("div") this.statusdiv.setAttribute("id","statusdiv"+this.galid) this.statusdiv.className="statusdiv"; document.body.appendChild(this.statusdiv) this.statusdiv=document.getElementById("statusdiv"+this.galid) this.statusdiv.innerHTML=endofgallerymsg } cmotiongallery.prototype.positiondiv=function(){ this.mainobjoffset=getposOffset(this.crossmain, "left"), this.menuheight=parseInt(this.crossmain.offsetHeight), this.mainobjoffsetH=getposOffset(this.crossmain, "top"); this.statusdiv.style.left=this.mainobjoffset+(this.menuwidth/2)-(this.statusdiv.offsetWidth/2)+"px"; this.statusdiv.style.top=this.menuheight+this.mainobjoffsetH+"px"; } cmotiongallery.prototype.showhidediv=function(what){ if (endofgallerymsg!="") { this.positiondiv(); this.statusdiv.style.visibility=what; } } function getposOffset(what, offsettype){ var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null){ totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } cmotiongallery.prototype.moveleft=function(){ if (this.loadedyes){ this.movestate="left"; if (iedom&&parseInt(this.cross_scroll.style.left)>(this.menuwidth-this.actualwidth)){ this.cross_scroll.style.left=parseInt(this.cross_scroll.style.left)-this.scrollspeed+"px"; this.showhidediv("hidden"); } else this.showhidediv("visible"); } this.lefttime=setTimeout("cgals["+this.galid+"].moveleft()",10); } cmotiongallery.prototype.moveright=function(){ if (this.loadedyes){ this.movestate="right"; if (iedom&&parseInt(this.cross_scroll.style.left)<0){ this.cross_scroll.style.left=parseInt(this.cross_scroll.style.left)+this.scrollspeed+"px"; this.showhidediv("hidden"); } else this.showhidediv("visible"); } this.righttime=setTimeout("cgals["+this.galid+"].moveright()",10); } cmotiongallery.prototype.motionengine=function(e){ this.mainobjoffset=getposOffset(this.crossmain, "left"), dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft, dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop, curposy=window.event? event.clientX : e.clientX? e.clientX: ""; curposy-=this.mainobjoffset-dsocx; this.leftbound=(this.menuwidth-this.rest)/2; this.rightbound=(this.menuwidth+this.rest)/2; if (curposy>this.rightbound){ this.scrollspeed=(curposy-this.rightbound)/((this.menuwidth-this.rest)/2) * this.maxs; clearTimeout(this.righttime); if (this.movestate!="left") this.moveleft(); } else if (curposy