/***********************************************
* 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='<span style="font-size: 11px;">End of Gallery</span>';


 //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]='<a href="img/undisturbed/01poster.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/01poster_th.png" border="1"></a>';
gallery[1]='<a href="img/undisturbed/02.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/02_th.png" border="1"></a>';
gallery[2]='<a href="img/undisturbed/03.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/03_th.png" border="1"></a>';
gallery[3]='<a href="img/undisturbed/04.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/04_th.png" border="1"></a>';
gallery[4]='<a href="img/undisturbed/05.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/05_th.png" border="1"></a>';
gallery[5]='<a href="img/undisturbed/06.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/06_th.png" border="1"></a>';
gallery[6]='<a href="img/undisturbed/07.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/07_th.png" border="1"></a>';
gallery[7]='<a href="img/undisturbed/08.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/08_th.png" border="1"></a>';
gallery[8]='<a href="img/undisturbed/09.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/09_th.png" border="1"></a>';
gallery[9]='<a href="img/undisturbed/10.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/10_th.png" border="1"></a>';
gallery[10]='<a href="img/undisturbed/11.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/11_th.png" border="1"></a>';
gallery[11]='<a href="img/undisturbed/12.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/12_th.png" border="1"></a>';
gallery[12]='<a href="img/undisturbed/13.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/13_th.png" border="1"></a>';
gallery[13]='<a href="img/undisturbed/14.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/14_th.png" border="1"></a>';
gallery[14]='<a href="img/undisturbed/15.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/15_th.png" border="1"></a>';
gallery[15]='<a href="img/undisturbed/16.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/16_th.png" border="1"></a>';
gallery[16]='<a href="img/undisturbed/17.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/17_th.png" border="1"></a>';
gallery[17]='<a href="img/undisturbed/18.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/18_th.png" border="1"></a>';
gallery[18]='<a href="img/undisturbed/19.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/19_th.png" border="1"></a>';
gallery[19]='<a href="img/undisturbed/20.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/20_th.png" border="1"></a>';
gallery[20]='<a href="img/undisturbed/21.png" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/undisturbed/21_th.png" border="1"></a>';
gallery[21]='<a href="img/homemade/makingachat.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/homemade/makingachat_th.jpg" border="1"></a>';
gallery[22]='<a href="img/homemade/sayingno.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/homemade/sayingno_th.jpg" border="1"></a>';

//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=1;
 //define gallery's image train:
gallery2[0]='<a href="img/nicekid/01.png" rel="ibox" title="Folk Tina" onclick="return enlargeimage(this.href);"><img src="img/nicekid/01_th.png" border="1"></a>';
gallery2[1]='<a href="img/nicekid/02.png" rel="ibox" title="Harajuku 2" onclick="return enlargeimage(this.href);"><img src="img/nicekid/02_th.png" border="1"></a>';
gallery2[2]='<a href="img/nicekid/03.png" rel="ibox" title="Harajuku" onclick="return enlargeimage(this.href);"><img src="img/nicekid/03_th.png" border="1"></a>';
gallery2[3]='<a href="img/nicekid/04.png" rel="ibox" title="Lucia Spaghetti" onclick="return enlargeimage(this.href);"><img src="img/nicekid/04_th.png" border="1"></a>';
gallery2[4]='<a href="img/nicekid/05.png" rel="ibox" title="Sporty Drummer Chick" onclick="return enlargeimage(this.href);"><img src="img/nicekid/05_th.png" border="1"></a>';
gallery2[5]='<a href="img/nicekid/06.png" rel="ibox" title="Vernissage 2" onclick="return enlargeimage(this.href);"><img src="img/nicekid/06_th.png" border="1"></a>';
gallery2[6]='<a href="img/nicekid/07.png" rel="ibox" title="Vernissage" onclick="return enlargeimage(this.href);"><img src="img/nicekid/07_th.png" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery3=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery3.usespace=1;
 //define gallery's image train:
gallery3[0]='<a href="img/2d/doggiestent.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/2d/doggiestent_th.jpg" border="1"></a>';
gallery3[1]='<a href="img/2d/benefitatwm.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/2d/benefitatwm_th.jpg" border="1"></a>';
gallery3[2]='<a href="img/3d/undermyskin/dogs6.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/dogs6_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery4=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery4.usespace=1;
 //define gallery's image train:
gallery4[0]='<a href="img/2d/ambition.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/2d/ambition_th.jpg" border="1"></a>';
gallery4[1]='<a href="img/2d/ambitioninsitu.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/2d/ambitioninsitu_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery5=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery5.usespace=1;
 //define gallery's image train:
gallery5[0]='<a href="img/2d/blacklove.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/2d/blacklove_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery6=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery6.usespace=1;
 //define gallery's image train:
gallery6[0]='<a href="img/homemade/secretgarden.jpg" rel="ibox" onclick="return enlargeimage(this.href);"><img src="img/homemade/secretgarden_th.jpg" border="1"></a>';


//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery7=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery7.usespace=1;
 //define gallery's image train:
gallery7[0]='<a href="img/homemade/01.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/01_th.jpg" border="1"></a>';
gallery7[1]='<a href="img/homemade/apronandunderpants.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/apronandunderpants_th.jpg" border="1"></a>';
gallery7[2]='<a href="img/homemade/dog.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/dog_th.jpg" border="1"></a>';
gallery7[3]='<a href="img/homemade/lotte.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/lotte_th.jpg" border="1"></a>';
gallery7[4]='<a href="img/homemade/makingachat.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/makingachat_th.jpg" border="1"></a>';
gallery7[5]='<a href="img/homemade/paul.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/paul_th.jpg" border="1"></a>';
gallery7[6]='<a href="img/homemade/rabbit.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/rabbit_th.jpg" border="1"></a>';
gallery7[7]='<a href="img/homemade/sabine.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/sabine_th.jpg" border="1"></a>';
gallery7[8]='<a href="img/homemade/sayingno.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/sayingno_th.jpg" border="1"></a>';
gallery7[9]='<a href="img/homemade/secretgarden.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/secretgarden_th.jpg" border="1"></a>';
gallery7[10]='<a href="img/homemade/selfportrait.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/selfportrait_th.jpg" border="1"></a>';
gallery7[11]='<a href="img/homemade/tshirts.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/tshirts_th.jpg" border="1"></a>';
gallery7[12]='<a href="img/3d/dogchair.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/dogchair_th.jpg" border="1"></a>';
gallery7[13]='<a href="img/3d/aaaah.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/aaaah_th.jpg" border="1"></a>';


//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery8=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery8.usespace=1;
 //define gallery's image train:
gallery8[0]='<a href="img/3d/dogchair.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/dogchair_th.jpg" border="1"></a>';


//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery9=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery9.usespace=1;
 //define gallery's image train:
gallery9[2]='<a href="img/3d/undermyskin/3198.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/3198_th.jpg" border="1"></a>';
gallery9[4]='<a href="img/3d/undermyskin/3137.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/3137_th.jpg" border="1"></a>';
gallery9[0]='<a href="img/3d/undermyskin/3117.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/3117_th.jpg" border="1"></a>';
gallery9[5]='<a href="img/3d/undermyskin/reddogscurtains.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/reddogscurtains_th.jpg" border="1"></a>';
gallery9[1]='<a href="img/3d/undermyskin/dogs6.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/dogs6_th.jpg" border="1"></a>';
gallery9[3]='<a href="img/3d/undermyskin/dogscurtains.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/dogscurtains_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery10=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery10.usespace=1;
 //define gallery's image train:
gallery10[0]='<a href="img/3d/untitled.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/untitled_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery11=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery11.usespace=1;
 //define gallery's image train:
gallery11[0]='<a href="img/3d/doggystyle01.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/doggystyle01_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery12=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery12.usespace=1;
 //define gallery's image train:
gallery12[0]='<a href="img/3d/aaaah.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/aaaah_th.jpg" border="1"></a>';


//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery13=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery13.usespace=1;
 //define gallery's image train:
gallery13[0]='<a href="img/3d/innerworld/innerworld02.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/innerworld/innerworld02_th.jpg" border="1"></a>';
gallery13[1]='<a href="img/3d/innerworld/innerworld04.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/innerworld/innerworld04_th.jpg" border="1"></a>';
gallery13[2]='<a href="img/3d/innerworld/innerworld05.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/innerworld/innerworld05_th.jpg" border="1"></a>';


//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery14=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery14.usespace=1;
 //define gallery's image train:
gallery14[0]='<a href="img/3d/undermyskin/rabbit.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/rabbit_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery15=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery15.usespace=1;
 //define gallery's image train:
gallery15[0]='<a href="img/3d/foralex.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/foralex_th.jpg" border="1"></a>';



//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery16=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery16.usespace=1;
 //define gallery's image train:
gallery16[0]='<a href="img/3d/mementomori/mementomori02.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/mementomori/mementomori02_th.jpg" border="1"></a>';
gallery16[1]='<a href="img/3d/mementomori/mementomori.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/mementomori/mementomori_th.jpg" border="1"></a>';
gallery16[2]='<a href="img/3d/mementomori/mementomoriinsitu.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/mementomori/mementomoriinsitu_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery17=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery17.usespace=1;
 //define gallery's image train:
gallery17[0]='<a href="img/3d/garden.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/garden_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery18=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery18.usespace=1;
 //define gallery's image train:
gallery18[0]='<a href="img/3d/garden.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/garden_th.jpg" border="1"></a>';

//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery19=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery19.usespace=1;
 //define gallery's image train:
gallery19[0]='<a href="img/3d/undermyskin/strangefruits.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/3d/undermyskin/strangefruits_th.jpg" border="1"></a>';


//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery20=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery20.usespace=1;
 //define gallery's image train:

gallery20[0]='<a href="img/homemade/sayingno.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/sayingno_th.jpg" border="1"></a>';
gallery20[1]='<a href="img/shop/01.png" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/shop/01_th.png" border="1"></a>';
gallery20[2]='<a href="img/shop/02.png" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/shop/02_th.png" border="1"></a>';
gallery20[3]='<a href="img/homemade/makingachat.jpg" rel="ibox"  onclick="return enlargeimage(this.href);"><img src="img/homemade/makingachat_th.jpg" border="1"></a>';


//optional additional gallery names, image trains, and usespace properties may be used:
 //declare gallery's name:
var gallery21=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
gallery21.usespace=1;
 //define gallery's image train:
gallery21[0]='<a href="img/glebbeekand/oneminutes.html" onclick="return enlargeimage(this.href);"><img src="img/glebbeekand/oneminutes_th.jpg" border="1"></a>';


 //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('<div class="motioncontainer" id="motioncontainer'+this.galid+'" style="'+this.c+'width:'+this.width+';height:'+this.height+'px;position:relative;left:0;top:0;overflow:hidden;">\n'+
'<div id="motiongallery'+this.galid+'" style="position:absolute;left:0;top:0;white-space: nowrap;">\n'+
'\n'+
'<nobr id="trueContainer'+this.galid+'">'+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<this.leftbound){
this.scrollspeed=(this.leftbound-curposy)/((this.menuwidth-this.rest)/2) * this.maxs;
clearTimeout(this.lefttime);
if (this.movestate!="right") this.moveright();
}
else
this.scrollspeed=0;
}

function contains_ns6(a, b) {
if (b!==null)
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

cmotiongallery.prototype.stopmotion=function(e){
if (!window.opera||(window.opera&&e.relatedTarget!==null))
if ((window.event&&!this.crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
clearTimeout(this.lefttime);
clearTimeout(this.righttime);
this.movestate="";
}
}

cmotiongallery.prototype.fillup=function(){
if (iedom){
this.crossmain=document.getElementById? document.getElementById("motioncontainer"+this.galid) : document.all["motioncontainer"+this.galid];
if(typeof this.crossmain.style.maxWidth!=='undefined')
this.crossmain.style.maxWidth=this.maxw+'px';
this.menuwidth=this.crossmain.offsetWidth;
this.cross_scroll=document.getElementById? document.getElementById("motiongallery"+this.galid) : document.all["motiongallery"+this.galid];
this.loading=document.getElementsByTagName? document.getElementById('trueContainer'+this.galid).getElementsByTagName('img') : document.all['trueContainer'+this.galid].all.tags('img');
for (var i_tem = 0; i_tem < this.loading.length; i_tem++)
if(typeof this.loading[i_tem].complete=='boolean'&&this.loading[i_tem].complete==false){
setTimeout("cgals["+this.galid+"].fillup()", 500);
return;
}
this.actualwidth=document.getElementById? document.getElementById("trueContainer"+this.galid).offsetWidth : document.all['trueContainer'+this.galid].offsetWidth;
if (this.startpos)
this.cross_scroll.style.left=(this.menuwidth-this.actualwidth)/this.startpos+'px';
this.crossmain.onmousemove=new Function("e", "cgals["+this.galid+"].motionengine(e)");

this.crossmain.onmouseout=new Function("e", "cgals["+this.galid+"].stopmotion(e);cgals["+this.galid+"].showhidediv('hidden')");
}
this.loadedyes=1
if (endofgallerymsg!=""){
this.creatediv();
this.positiondiv();
}
}


function cmotionresize(){
for (var i_tem = 0; i_tem < cgals.length; i_tem++){
if (document.all&&document.all['motioncontainer'+i_tem]&&document.all['motioncontainer'+i_tem].filters){
document.all['motioncontainer'+i_tem].style.width="0";
document.all['motioncontainer'+i_tem].style.width=cgals[i_tem].width;
document.all['motioncontainer'+i_tem].style.width=Math.min(document.all['motioncontainer'+i_tem].offsetWidth, cgals[i_tem].maxw)+'px';
}
cgals[i_tem].menuwidth=cgals[i_tem].crossmain.offsetWidth;
cgals[i_tem].cross_scroll.style.left=cgals[i_tem].startpos? (cgals[i_tem].menuwidth-cgals[i_tem].actualwidth)/cgals[i_tem].startpos+'px' : 0;
}
}

if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "resize", cmotionresize, false );
else if ( typeof window.attachEvent != "undefined" )
    window.attachEvent( "onresize", cmotionresize );
else {
    if ( window.onresize != null ) {
        var oldOnresize = window.onresize;
        window.onresize = function ( e ) {
            oldOnresize( e );
            cmotionresize();
        };
    }
    else
        window.onresize = cmotionresize;
}
