/***********************************************
* 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: 13px;">End of gallery</span>';

 //declare gallery's name:
var liste3=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
liste3.usespace=1;
 //define gallery's image train:
 
liste3[0]='<a href="gallery_3/Glendalough_fellowship_001.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_001.jpg" border=1></a>'; 
liste3[1]='<a href="gallery_3/Glendalough_fellowship_002.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_002.jpg" border=1></a>';
liste3[2]='<a href="gallery_3/Glendalough_fellowship_003.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_003.jpg" border=1></a>';
liste3[3]='<a href="gallery_3/Glendalough_fellowship_004.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_004.jpg" border=1></a>';
liste3[4]='<a href="gallery_3/Glendalough_fellowship_005.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_005.jpg" border=1></a>';
liste3[5]='<a href="gallery_3/Glendalough_fellowship_006.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_006.jpg" border=1></a>';
liste3[6]='<a href="gallery_3/Glendalough_fellowship_007.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_007.jpg" border=1></a>';
liste3[7]='<a href="gallery_3/Glendalough_fellowship_008.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_008.jpg" border=1></a>';
liste3[8]='<a href="gallery_3/Glendalough_fellowship_009.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_009.jpg" border=1></a>';
liste3[9]='<a href="gallery_3/Glendalough_fellowship_010.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_010.jpg" border=1></a>';
liste3[10]='<a href="gallery_3/Glendalough_fellowship_011.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_011.jpg" border=1></a>';
liste3[11]='<a href="gallery_3/Glendalough_fellowship_012.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_012.jpg" border=1></a>';
liste3[12]='<a href="gallery_3/Glendalough_fellowship_013.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_013.jpg" border=1></a>';
liste3[13]='<a href="gallery_3/Glendalough_fellowship_014.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_014.jpg" border=1></a>';
liste3[14]='<a href="gallery_3/Glendalough_fellowship_015.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_015.jpg" border=1></a>';
liste3[15]='<a href="gallery_3/Glendalough_fellowship_016.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_016.jpg" border=1></a>';
liste3[16]='<a href="gallery_3/Glendalough_fellowship_017.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_017.jpg" border=1></a>';
liste3[17]='<a href="gallery_3/Glendalough_fellowship_018.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_018.jpg" border=1></a>';
liste3[18]='<a href="gallery_3/Glendalough_fellowship_019.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_019.jpg" border=1></a>';
liste3[19]='<a href="gallery_3/Glendalough_fellowship_020.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_020.jpg" border=1></a>';
liste3[20]='<a href="gallery_3/Glendalough_fellowship_021.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_021.jpg" border=1></a>';
liste3[21]='<a href="gallery_3/Glendalough_fellowship_022.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_022.jpg" border=1></a>';
liste3[22]='<a href="gallery_3/Glendalough_fellowship_023.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_023.jpg" border=1></a>';
liste3[23]='<a href="gallery_3/Glendalough_fellowship_024.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_024.jpg" border=1></a>';
liste3[24]='<a href="gallery_3/Glendalough_fellowship_025.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_025.jpg" border=1></a>';
liste3[25]='<a href="gallery_3/Glendalough_fellowship_026.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_026.jpg" border=1></a>';
liste3[26]='<a href="gallery_3/Glendalough_fellowship_027.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_027.jpg" border=1></a>';
liste3[27]='<a href="gallery_3/Glendalough_fellowship_028.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_028.jpg" border=1></a>';
liste3[28]='<a href="gallery_3/Glendalough_fellowship_029.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_029.jpg" border=1></a>';
liste3[29]='<a href="gallery_3/Glendalough_fellowship_030.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_030.jpg" border=1></a>';
liste3[30]='<a href="gallery_3/Glendalough_fellowship_031.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_031.jpg" border=1></a>';
liste3[31]='<a href="gallery_3/Glendalough_fellowship_032.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_032.jpg" border=1></a>';
liste3[32]='<a href="gallery_3/Glendalough_fellowship_033.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_033.jpg" border=1></a>';
liste3[33]='<a href="gallery_3/Glendalough_fellowship_034.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_034.jpg" border=1></a>';
liste3[34]='<a href="gallery_3/Glendalough_fellowship_035.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_035.jpg" border=1></a>';
liste3[35]='<a href="gallery_3/Glendalough_fellowship_036.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_036.jpg" border=1></a>';
liste3[36]='<a href="gallery_3/Glendalough_fellowship_037.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_037.jpg" border=1></a>';
liste3[37]='<a href="gallery_3/Glendalough_fellowship_038.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_038.jpg" border=1></a>';
liste3[38]='<a href="gallery_3/Glendalough_fellowship_039.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_039.jpg" border=1></a>';
liste3[39]='<a href="gallery_3/Glendalough_fellowship_040.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_040.jpg" border=1></a>';
liste3[40]='<a href="gallery_3/Glendalough_fellowship_041.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_041.jpg" border=1></a>';
liste3[41]='<a href="gallery_3/Glendalough_fellowship_042.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_042.jpg" border=1></a>';
liste3[42]='<a href="gallery_3/Glendalough_fellowship_043.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_043.jpg" border=1></a>';
liste3[43]='<a href="gallery_3/Glendalough_fellowship_044.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_044.jpg" border=1></a>';
liste3[44]='<a href="gallery_3/Glendalough_fellowship_045.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_045.jpg" border=1></a>';
liste3[45]='<a href="gallery_3/Glendalough_fellowship_046.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_046.jpg" border=1></a>';
liste3[46]='<a href="gallery_3/Glendalough_fellowship_047.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_047.jpg" border=1></a>';
liste3[47]='<a href="gallery_3/Glendalough_fellowship_048.jpg" rel="lightbox[liste3]" title="Glendalough: fellowship"><img src="gallery_3/mini/mini_Glendalough_fellowship_048.jpg" border=1></a>';



 //declare gallery's name:
var liste2=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
liste2.usespace=1;
 //define gallery's image train:
 
liste2[0]='<a href="gallery_2/Glendalough_place_001.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_001.jpg" border=1></a>'; 
liste2[1]='<a href="gallery_2/Glendalough_place_002.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_002.jpg" border=1></a>'; 
liste2[2]='<a href="gallery_2/Glendalough_place_003.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_003.jpg" border=1></a>'; 
liste2[3]='<a href="gallery_2/Glendalough_place_004.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_004.jpg" border=1></a>'; 
liste2[4]='<a href="gallery_2/Glendalough_place_005.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_005.jpg" border=1></a>'; 
liste2[5]='<a href="gallery_2/Glendalough_place_006.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_006.jpg" border=1></a>'; 
liste2[6]='<a href="gallery_2/Glendalough_place_007.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_007.jpg" border=1></a>'; 
liste2[7]='<a href="gallery_2/Glendalough_place_008.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_008.jpg" border=1></a>'; 
liste2[8]='<a href="gallery_2/Glendalough_place_009.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_009.jpg" border=1></a>'; 
liste2[9]='<a href="gallery_2/Glendalough_place_010.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_010.jpg" border=1></a>'; 
liste2[10]='<a href="gallery_2/Glendalough_place_011.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_011.jpg" border=1></a>'; 
liste2[11]='<a href="gallery_2/Glendalough_place_012.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_012.jpg" border=1></a>'; 
liste2[12]='<a href="gallery_2/Glendalough_place_013.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_013.jpg" border=1></a>'; 
liste2[13]='<a href="gallery_2/Glendalough_place_014.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_014.jpg" border=1></a>'; 
liste2[14]='<a href="gallery_2/Glendalough_place_015.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_015.jpg" border=1></a>'; 
liste2[15]='<a href="gallery_2/Glendalough_place_016.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_016.jpg" border=1></a>'; 
liste2[16]='<a href="gallery_2/Glendalough_place_017.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_017.jpg" border=1></a>'; 
liste2[17]='<a href="gallery_2/Glendalough_place_018.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_018.jpg" border=1></a>'; 
liste2[18]='<a href="gallery_2/Glendalough_place_019.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_019.jpg" border=1></a>'; 
liste2[19]='<a href="gallery_2/Glendalough_place_020.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_020.jpg" border=1></a>'; 
liste2[20]='<a href="gallery_2/Glendalough_place_021.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_021.jpg" border=1></a>'; 
liste2[21]='<a href="gallery_2/Glendalough_place_022.JPG" rel="lightbox[liste2]" title="Glendalough: the place"><img src="gallery_2/mini/mini_Glendalough_place_022.jpg" border=1></a>'; 




 //declare gallery's name:
var liste1=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
liste1.usespace=1;
 //define gallery's image train:
 
liste1[0]='<a href="gallery_1/0.jpg" rel="lightbox[liste1]" title="Sr Elisabeth Cotter, Vicar for religious of the diocese of Dublin"><img src="gallery_1/mini/mini_0.jpg" border=1></a>'; 
liste1[1]='<a href="gallery_1/01.jpg" rel="lightbox[liste1]"><img src="gallery_1/mini/mini_01.jpg" border=1></a>'; 
liste1[2]='<a href="gallery_1/02.jpg" rel="lightbox[liste1]"><img src="gallery_1/mini/mini_02.jpg" border=1></a>'; 
liste1[3]='<a href="gallery_1/03.jpg" rel="lightbox[liste1]"><img src="gallery_1/mini/mini_03.jpg" border=1></a>'; 
liste1[4]='<a href="gallery_1/04.jpg" rel="lightbox[liste1]"><img src="gallery_1/mini/mini_04.jpg" border=1></a>'; 
liste1[5]='<a href="gallery_1/05.jpg" rel="lightbox[liste1]"><img src="gallery_1/mini/mini_05.jpg" border=1></a>'; 
liste1[6]='<a href="gallery_1/06.jpg" rel="lightbox[liste1]"><img src="gallery_1/mini/mini_06.jpg" border=1></a>'; 
liste1[7]='<a href="gallery_1/07.jpg" rel="lightbox[liste1]"><img src="gallery_1/mini/mini_07.jpg" border=1></a>'; 
 


 //declare gallery's name:
/*var liste2=new Array();
 // Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
liste1.usespace=1;
 //define gallery's image train: 
liste2[0]='<a href="newgallery/000.JPG" rel="lightbox[liste2]" title="Glandloug"><img src="newgallery/mini/000.JPG" border=1></a>'; 
liste2[1]='<a href="newgallery/11.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/11.JPG" border=1></a>'; 
liste2[2]='<a href="newgallery/12.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/12.JPG" border=1></a>'; 
liste2[3]='<a href="newgallery/13.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/13.JPG" border=1></a>'; 
liste2[4]='<a href="newgallery/14.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/14.JPG" border=1></a>'; 
liste2[5]='<a href="newgallery/15.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/15.JPG" border=1></a>'; 
liste2[6]='<a href="newgallery/16.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/16.JPG" border=1></a>'; 
liste2[7]='<a href="newgallery/17.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/17.JPG" border=1></a>'; 
liste2[8]='<a href="newgallery/18.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/18.JPG" border=1></a>'; 
liste2[9]='<a href="newgallery/19.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/19.JPG" border=1></a>'; 
liste2[10]='<a href="newgallery/20.JPG" rel="lightbox[liste2]"><img src="newgallery/mini/20.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;
}