function XSJSImageGalleryLightBox(slideShowName,text1,text2,autoSliding,timeoutStanding,timeoutFading,timeoutBackground,showTimeoutGallery,backgroundMaxOpacity,scrollbarMaxLength,topOffset,waitForImageLoading){this.slideShowName=slideShowName;
this.text1=text1;this.text2=text2;this.autoSliding=autoSliding;this.timeoutStanding=timeoutStanding;
this.timeoutFading=timeoutFading;this.showTimeoutBackground=timeoutBackground;this.showTimeoutGallery=showTimeoutGallery;
this.visibilty="hidden";this.backgroundMaxOpacity=backgroundMaxOpacity;this.scrollbarMaxLength=scrollbarMaxLength;
this.topOffset=topOffset;this.waitForImageLoading=waitForImageLoading;this.currentIndex=0;
this.showInProgress=false;this.switchToInProgress=false;this.switchInProgress=false;
this.imageArray=new Array();
/*@cc_on
		/*@if (@_jscript)
			this.ie = (document.all && !window.opera) ? true : false;
		/*@else @*/
this.ie=false;
/*@end
	@*/
this.ie7=(this.ie&&window.XMLHttpRequest)}XSJSImageGalleryLightBox.prototype.createElements=function(){var J=document.getElementsByTagName("body").item(0);
var M=document.getElementById("xsjslightboxOverlay");if(M==null){M=document.createElement("div");
M.setAttribute("id","xsjslightboxOverlay");J.appendChild(M)}M.style.display="none";
if((this.ie&&!this.ie7)||(this.ie7&&document.compatMode=="BackCompat")){M.style.position="absolute"
}var I=document.getElementById("xsjslightboxWrapper");if(I==null){I=document.createElement("div");
I.setAttribute("id","xsjslightboxWrapper");J.appendChild(I)}I.style.display="none";
var E=document.getElementById("xsjslightboxContainer");if(E==null){E=document.createElement("div");
E.setAttribute("id","xsjslightboxContainer");I.appendChild(E)}var D=document.getElementById("xsjslightboxHeader");
if(D==null){D=document.createElement("div");D.setAttribute("id","xsjslightboxHeader");
E.appendChild(D)}var N=document.getElementById("xsjslightboxImage");if(N==null){N=document.createElement("div");
N.setAttribute("id","xsjslightboxImage");E.appendChild(N)}var K=document.getElementById("xsjslightboxFooter");
if(K==null){K=document.createElement("div");K.setAttribute("id","xsjslightboxFooter");
E.appendChild(K)}var A=document.getElementById("xsjslightboxPosition");if(A==null){A=document.createElement("div");
A.setAttribute("id","xsjslightboxPosition");K.appendChild(A)}var B=document.getElementById("xsjslightboxScrollbar");
if(B==null){B=document.createElement("div");B.setAttribute("id","xsjslightboxScrollbar");
K.appendChild(B)}var H=document.getElementById("xsjslightboxClose");if(H==null){H=document.createElement("div");
H.setAttribute("id","xsjslightboxClose");K.appendChild(H)}var F=document.getElementById("xsjslightboxCloseLink");
if(F==null){F=document.createElement("a");F.setAttribute("id","xsjslightboxCloseLink");
H.appendChild(F)}F.setAttribute("href","javascript:"+this.slideShowName+".hide();");
F.setAttribute("title",this.text2);F.innerHTML=this.text2;var G=document.getElementById("xsjslightboxPositionText");
if(G==null){G=document.createElement("p");G.setAttribute("id","xsjslightboxPositionText");
A.appendChild(G)}if(N.hasChildNodes()){while(N.childNodes.length>=1){N.removeChild(N.firstChild)
}}x=0;for(x=0;x<this.imageArray.length;x++){var L=this.getImgElement(x);var C=this.imageArray[x];
L.src=C.src;if(x==this.currentIndex&&!this.waitForImageLoading){this.changeOpacity(100,L.id)
}else{this.changeOpacity(0,L.id)}}};XSJSImageGalleryLightBox.prototype.show=function(D){if(this.showInProgress){return 
}if(this.visibilty=="visible"){return }this.visibilty="visible";this.currentIndex=D;
this.createElements();this.showInProgress=true;var A=this.getPageSize();if((this.ie&&!this.ie7)||(this.ie7&&document.compatMode=="BackCompat")){document.getElementById("xsjslightboxOverlay").style.height=A[1]+20+"px"
}else{document.getElementById("xsjslightboxOverlay").style.height=A[1]+"px"}var E=0;
if(document.body){E=Math.max(this.getTrueBodyElement().scrollTop,document.body.scrollTop)
}else{E=this.getTrueBodyElement().scrollTop}var B=document.getElementById("xsjslightboxWrapper");
B.style.top=this.topOffset+E+"px";this.changeOpacity(0,"xsjslightboxOverlay");var C=this.getImgElement(this.currentIndex);
this.updateDisplay();if(this.waitForImageLoading){if(this.ie){document.getElementById("xsjslightboxContainer").setAttribute("className","loading")
}else{document.getElementById("xsjslightboxContainer").setAttribute("class","loading")
}}else{var C=this.getImgElement(this.currentIndex);this.changeOpacity(100,C.id)}this.fadeOpacity(document.getElementById("xsjslightboxOverlay"),0,this.backgroundMaxOpacity,this.showTimeoutBackground);
this.fadeOpacity(document.getElementById("xsjslightboxWrapper"),0,100,this.showTimeoutGallery);
setTimeout(this.slideShowName+".showEnd()",Math.max(this.showTimeoutBackground,this.showTimeoutGallery))
};XSJSImageGalleryLightBox.prototype.showEnd=function(){if(this.waitForImageLoading){x=0;
for(x=0;x<this.imageArray.length;x++){var B=this.getImgElement(x);if(!B.complete){setTimeout(this.slideShowName+".showEnd()",500);
return }}if(this.ie){}else{document.getElementById("xsjslightboxContainer").setAttribute("class","")
}var A=this.getImgElement(this.currentIndex);this.changeOpacity(90,A.id);this.changeOpacity(100,A.id);
this.changeOpacity(80,A.id);this.changeOpacity(100,A.id);this.showInProgress=false
}else{this.showInProgress=false}setTimeout(this.slideShowName+".switchEnd()",this.timeoutFading+10)
};XSJSImageGalleryLightBox.prototype.hide=function(){if(this.showInProgress){return 
}if(this.visibilty=="hidden"){return }clearTimeout(this.autoInterval);clearTimeout(this.switchEndInterval);
this.visibilty="hidden";this.fadeOpacity(document.getElementById("xsjslightboxOverlay"),this.backgroundMaxOpacity,0,this.showTimeoutBackground);
this.fadeOpacity(document.getElementById("xsjslightboxWrapper"),100,0,this.showTimeoutGallery)
};XSJSImageGalleryLightBox.prototype.addImage=function(B,C){var A=new Object();A.src=unescape(B);
A.title=unescape(C);this.imageArray[this.imageArray.length]=A};XSJSImageGalleryLightBox.prototype.getImgContentContainerElement=function(C){var B=document.getElementById("xsjslightboxImage");
var A=this.slideShowName+"ImageContainer"+C;var D=document.getElementById(A);if(!D){D=document.createElement("div");
D.id=A;B.appendChild(D)}return D};XSJSImageGalleryLightBox.prototype.getImgElement=function(B){var D=this.getImgContentContainerElement(B);
var A=this.slideShowName+"Image"+B;var C=document.getElementById(A);if(!C){C=document.createElement("img");
C.id=A;D.appendChild(C)}return C};XSJSImageGalleryLightBox.prototype.switchToFirst=function(){this.switchTo(0,true)
};XSJSImageGalleryLightBox.prototype.switchToNext=function(){var A=(this.currentIndex+1)%this.imageArray.length;
this.switchTo(A,true)};XSJSImageGalleryLightBox.prototype.switchToPrevious=function(){var A=(this.currentIndex-1)%this.imageArray.length;
if(A<0){A+=this.imageArray.length}this.switchTo(A,true)};XSJSImageGalleryLightBox.prototype.switchTo=function(B,D){if(this.showInProgress||this.switchToInProgress){return 
}if(this.visibilty=="hidden"){return }if(B==this.currentIndex){return }clearTimeout(this.autoInterval);
this.switchToInProgress=true;var A=this.getImgElement(B);var C=this.getImgElement(this.currentIndex);
if(D){this.fadeOut(C);this.fadeIn(A);this.switchEndInterval=setTimeout(this.slideShowName+".switchEnd()",this.timeoutFading+10)
}else{this.changeOpacity(0,C.id);this.changeOpacity(100,A.id);this.switchEnd()}this.currentIndex=B;
this.updateDisplay()};XSJSImageGalleryLightBox.prototype.switchEnd=function(){this.switchToInProgress=false;
if(this.autoSliding){var A=this;this.autoInterval=setTimeout(this.slideShowName+".switchToNext()",this.timeoutStanding)
}};XSJSImageGalleryLightBox.prototype.updateDisplay=function(){var F=document.getElementById("xsjslightboxPositionText");
var C=this.text1;C=C.replace(/XXX/g,(this.currentIndex+1));C=C.replace(/YYY/g,(this.imageArray.length));
F.innerHTML=C;var G=document.getElementById("xsjslightboxHeader");G.innerHTML="<p>"+unescape(this.imageArray[this.currentIndex].title)+"</p>";
var E="<p>";E+='<a href="javascript:'+this.slideShowName+'.switchToPrevious();">&lt;</a>';
var B=Math.round(this.currentIndex-(this.scrollbarMaxLength/2));if(B<0){B=0}var D=B+this.scrollbarMaxLength-1;
if(D>=this.imageArray.length){D=this.imageArray.length-1;B=D-this.scrollbarMaxLength;
if(B<0){B=0}}for(x=B;x<=D;x++){E+='<a href="javascript:'+this.slideShowName+".switchTo("+x+', true);" class="'+(x==this.currentIndex?"selected":"")+'">'+(x+1)+"</a>"
}E+='<a href="javascript:'+this.slideShowName+'.switchToNext();">&gt;</a>';E+="</p>";
var A=document.getElementById("xsjslightboxScrollbar");A.innerHTML=E};XSJSImageGalleryLightBox.prototype.fadeOut=function(A){this.fadeOpacity(A,100,0,this.timeoutFading)
};XSJSImageGalleryLightBox.prototype.fadeIn=function(A){this.fadeOpacity(A,0,100,this.timeoutFading)
};XSJSImageGalleryLightBox.prototype.fadeOpacity=function(C,E,A,B){var D=Math.round(B/100);
var G=0;if(E>A){var F=this;for(i=E;i>=A;i--){setTimeout(this.slideShowName+".changeOpacity("+i+", '"+C.id+"')",(G*D));
G++}}else{if(E<A){for(i=E;i<=A;i++){setTimeout(this.slideShowName+".changeOpacity("+i+", '"+C.id+"')",(G*D));
G++}}}};XSJSImageGalleryLightBox.prototype.changeOpacity=function(B,C){var A=document.getElementById(C).style;
A.opacity=(B/100);A.MozOpacity=(B/100);A.KhtmlOpacity=(B/100);A.filter="alpha(opacity="+B+")";
if(B==0){A.display="none"}else{A.visibility="visible";A.display=""}};XSJSImageGalleryLightBox.prototype.getTrueBodyElement=function(){return(!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body
};XSJSImageGalleryLightBox.prototype.getPageSize=function(){var E,A,C,F;if(window.innerHeight&&window.scrollMaxY){E=document.scrollWidth;
A=(document.isFrame?parent.innerHeight:self.innerHeight)+(document.isFrame?parent.scrollMaxY:self.scrollMaxY)
}else{if(document.body.scrollHeight>document.body.offsetHeight){E=document.body.scrollWidth;
A=document.body.scrollHeight}else{E=document.getElementsByTagName("html").item(0).offsetWidth;
A=document.getElementsByTagName("html").item(0).offsetHeight;E=(E<document.body.offsetWidth)?document.body.offsetWidth:E;
A=(A<document.body.offsetHeight)?document.body.offsetHeight:A}}if(self.innerHeight){C=(this.isFrame)?parent.innerWidth:self.innerWidth;
F=(this.isFrame)?parent.innerHeight:self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){C=document.documentElement.clientWidth;
F=document.documentElement.clientHeight}else{if(document.body){C=document.getElementsByTagName("html").item(0).clientWidth;
F=document.getElementsByTagName("html").item(0).clientHeight;C=(C==0)?document.body.clientWidth:C;
F=(F==0)?document.body.clientHeight:F}}}var D=(A<F)?F:A;var B=(E<C)?C:E;return new Array(B,D,C,F)
};