var loadingImage="loading.gif";
var closeButton="close.gif";
var currentPictureId=-1;
function getPageScroll(){
var _1;
if(self.pageYOffset){
_1=self.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
_1=document.documentElement.scrollTop;
}else{
if(document.body){
_1=document.body.scrollTop;
}
}
}
arrayPageScroll=new Array("",_1);
return arrayPageScroll;
}
function getPageSize(){
var _2,yScroll;
if(window.innerHeight&&window.scrollMaxY){
_2=document.body.scrollWidth;
yScroll=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_2=document.body.scrollWidth;
yScroll=document.body.scrollHeight;
}else{
_2=document.body.offsetWidth;
yScroll=document.body.offsetHeight;
}
}
var _3,windowHeight;
if(self.innerHeight){
_3=self.innerWidth;
windowHeight=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_3=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight;
}else{
if(document.body){
_3=document.body.clientWidth;
windowHeight=document.body.clientHeight;
}
}
}
if(yScroll<windowHeight){
pageHeight=windowHeight;
}else{
pageHeight=yScroll;
}
if(_2<_3){
pageWidth=_3;
}else{
pageWidth=_2;
}
arrayPageSize=new Array(pageWidth,pageHeight,_3,windowHeight);
return arrayPageSize;
}
function pause(_4){
var _5=new Date();
var _6=_5.getTime()+_4;
while(true){
_5=new Date();
if(_5.getTime()>_6){
return;
}
}
}
function showNextPicture(){
alert("current id = "+currentPictureId+". Going to show "+(currentPictureId+1));
}
function showPreviousPicture(){
}
function showLightbox(_7){
var _8=document.getElementById("overlay");
var _9=document.getElementById("lightbox");
var _a=document.getElementById("lightboxCaption");
var _b=document.getElementById("lightboxImage");
var _c=document.getElementById("loadingImage");
var _d=getPageSize();
var _e=getPageScroll();
if(_c){
_c.style.top=(_e[1]+((_d[3]-35-_c.height)/2)+"px");
_c.style.left=(((_d[0]-40-_c.width)/2)+"px");
}
_8.style.height=(_d[1]+"px");
_8.anim.custom(0,0.8);
imgPreload=new Image();
imgPreload.onload=function(){
_b.src=_7.href;
var _f=_e[1]+((_d[3]-35-imgPreload.height)/2);
var _10=((_d[0]-40-imgPreload.width)/2);
_9.style.top=(_f<0)?"0px":_f+"px";
_9.style.left=(_10<0)?"0px":_10+"px";
if(_7.getAttribute("id")){
currentPictureId=parseFloat(_7.id);
}
if(_7.getAttribute("title")){
_a.style.display="block";
_a.style.width=imgPreload.width+"px";
_a.innerHTML=_7.getAttribute("title");
}else{
_a.style.display="none";
}
setTimeout(_9.anim.toggle.bind(_9.anim),500);
return false;
};
imgPreload.src=_7.href;
}
function hideLightbox(_11){
objOverlay=document.getElementById("overlay");
objLightbox=document.getElementById("lightbox");
objOverlay.anim.custom(0.8,0);
setTimeout(objLightbox.anim.toggle.bind(objLightbox.anim),200);
}
function initLightbox(){
if(!document.getElementsByTagName){
return;
}
var _12=document.getElementsByTagName("a");
for(var i=0;i<_12.length;i++){
var _14=_12[i];
if(_14.getAttribute("href")&&(_14.getAttribute("rel")=="lightbox")){
_14.onclick=function(){
showLightbox(this);
return false;
};
}
}
var _15=document.getElementsByTagName("body").item(0);
var _16=document.createElement("div");
_16.setAttribute("id","overlay");
_16.style.position="absolute";
_16.style.top="0";
_16.style.left="0";
_16.style.zIndex="90";
_16.style.width="100%";
_16.onclick=function(){
hideLightbox();
return false;
};
_15.appendChild(_16);
var _17=getPageSize();
var _18=getPageScroll();
_16.anim=new fx.Opacity(_16,{duration:400});
_16.anim.hide();
var _19=new Image();
_19.onload=function(){
var _1a=document.createElement("a");
_1a.setAttribute("href","Cancel picture load");
_1a.onclick=function(){
hideLightbox("objLoadingImageLink");
return false;
};
_16.appendChild(_1a);
var _1b=document.createElement("img");
_1b.src=loadingImage;
_1b.setAttribute("id","loadingImage");
_1b.style.position="absolute";
_1b.style.zIndex="150";
_1a.appendChild(_1b);
_19.onload=function(){
};
return false;
};
_19.src=loadingImage;
var _1c=document.createElement("div");
_1c.setAttribute("id","lightbox");
_1c.style.position="absolute";
_1c.style.zIndex="100";
_15.appendChild(_1c);
_1c.anim=new fx.Height(_1c,{duration:400});
_1c.anim.hide();
var _1d=document.createElement("div");
_1d.setAttribute("id","linkContainer");
_1d.style.left=0;
_1d.style.top=0;
_1d.style.zIndex=200;
var _1e=document.createElement("span");
_1e.innerHTML=" | ";
var _1f=document.createElement("a");
_1f.setAttribute("id","lnkNext");
_1f.setAttribute("href","#");
_1f.setAttribute("title","Show next picture");
_1f.onclick=function(){
showNextPicture();
return false;
};
_1f.innerHTML="Next";
var _20=document.createElement("a");
_20.setAttribute("id","lnkPrevious");
_20.setAttribute("href","#");
_20.setAttribute("title","Show Previous picture");
_20.onclick=function(){
showPreviousPicture();
return false;
};
_20.innerHTML="Previous";
_1d.appendChild(_20);
_1d.appendChild(_1e);
_1d.appendChild(_1f);
var _21=document.createElement("a");
_21.setAttribute("href","Close picture");
_21.setAttribute("id","lightboxPhoto");
_21.setAttribute("title","Click to close");
_21.onclick=function(){
hideLightbox("objLink");
return false;
};
_1c.appendChild(_21);
var _22=new Image();
_22.onload=function(){
var _23=document.createElement("img");
_23.src=closeButton;
_23.setAttribute("id","closeButton");
_23.style.position="absolute";
_23.style.top=0;
_23.style.right=0;
_23.style.zIndex="200";
_21.appendChild(_23);
return false;
};
_22.src=closeButton;
var _24=document.createElement("img");
_24.setAttribute("id","lightboxImage");
_21.appendChild(_24);
var _25=document.createElement("div");
_25.setAttribute("id","lightboxCaption");
_25.style.display="none";
_1c.appendChild(_25);
_25.onclick=function(){
doNothing();
return false;
};
}
function doNothing(e){
if(!e){
var e=window.event;
}
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}
}
function addLoadEvent(_27){
var _28=window.onload;
if(typeof window.onload!="function"){
window.onload=_27;
}else{
window.onload=function(){
_28();
_27();
};
}
}
addLoadEvent(initLightbox);

