var options={fadingDuration:40,fadingStep:0.2,slideDuration:2500};var guidePlace;var objCaption;var objButtons;var slideshow;function Slide(T){this.timerFading=null;this.fadingPreviousObj=null;this.caption="<a href=\"/"+T.url+"\">"+T.text+"</a>";this.element=document.createElement("div");this.element.innerHTML="<a href=\"/"+T.url+"\"><img src=\"/photos/"+pad(T.id,"0",-5)+".0.jpg\" border=\"0\"/></a>";this.element.className="container";document.body.appendChild(this.element);this.hide();return this;}Slide.prototype.show=function(T){if(this.timerFading){return ;}this.placeElement(true);this.element.style.opacity=0;this.element.style.filter="alpha(opacity=0)";window.clearTimeout(this.timerFading);this.fadingPreviousObj=T;this.timerFading=window.setTimeout("slideshow.currentSlide.doShow(0)",options.fadingDuration);};Slide.prototype.doShow=function(T){if(T>=1){this.endShow();}else{this.element.style.opacity=T;this.element.style.filter="alpha(opacity="+parseInt(T*100)+")";this.timerFading=window.setTimeout("slideshow.currentSlide.doShow("+(T+options.fadingStep)+")",options.fadingDuration);}};Slide.prototype.endShow=function(){this.timerFading=null;if(this.fadingPreviousObj){this.fadingPreviousObj.hide();}this.fadingPreviousObj=null;this.element.style.opacity=0.999;this.element.style.filter="alpha(opacity=100)";objCaption.innerHTML=this.caption;};Slide.prototype.hide=function(){window.clearTimeout(this.timerFading);this.timerFading=null;this.fadingPreviousObj=null;this.unPlaceElement();};Slide.prototype.placeElement=function(T){this.element.style.left=guidePlace.left+"px";this.element.style.top=guidePlace.top+"px";this.element.style.width=guidePlace.width+"px";this.element.style.height=guidePlace.height+"px";if(T){this.element.style.visibility="visible";}};Slide.prototype.unPlaceElement=function unPlaceElement(){this.element.style.left=0;this.element.style.top=0;this.element.style.width=0;this.element.style.height=0;this.element.style.visibility="hidden";};function SlideShow(V){this.slides=[];this.currentRank=null;this.currentSlide=null;this.olderSlide=null;this.timerSlide=null;for(var G=0;G<V.length;++G){var T=V[G];if(T&&T.id){this.slides.push(new Slide(T));}}return this;}SlideShow.prototype.show=function(){this.currentRank=0;this.currentSlide=this.slides[0];this.olderSlide=null;this.currentSlide.show();if(this.slides.length>1){objButtons.style.visibility="visible";this.timerSlide=window.setTimeout("slideshow.nextSlide(true)",options.slideDuration);}};SlideShow.prototype.hide=function(){this.stopSlideShow();this.currentSlide.hide();if(this.olderSlide){this.olderSlide.hide();}};SlideShow.prototype.changeSlide=function(G,T){if(this.currentSlide.timerFading){return ;}window.clearTimeout(this.timerSlide);this.currentSlide.element.style.zIndex=1;this.olderSlide=this.currentSlide;if(G>0){this.currentRank=this.currentRank+1>=this.slides.length?0:this.currentRank+1;}else{this.currentRank=this.currentRank-1<0?this.slides.length-1:this.currentRank-1;}this.currentSlide=this.slides[this.currentRank];this.currentSlide.show(this.olderSlide);this.currentSlide.element.style.zIndex=2;if(T){this.timerSlide=window.setTimeout("slideshow.nextSlide(true)",options.slideDuration);}else{this.stopSlideShow();}};SlideShow.prototype.nextSlide=function(T){this.changeSlide(1,T);};SlideShow.prototype.previousSlide=function(T){this.changeSlide(-1,T);};SlideShow.prototype.startSlideShow=function(){if(!this.timerSlide){this.nextSlide(true);}};SlideShow.prototype.stopSlideShow=function(){window.clearTimeout(this.timerSlide);this.timerSlide=null;};SlideShow.prototype.placeElement=function(T){this.currentSlide.placeElement(T);};function Place(T){if(T){this.left=findPosX(T);this.top=findPosY(T);this.width=T.offsetWidth;this.height=T.offsetHeight;}return this;}function getObj(T){if(document.getElementById){return document.getElementById(T);}else{if(document.all){return document.all[T];}else{if(document.layers){var G=document.layers[T];G.style=document.layers[T];return G;}}}}function findPosX(T){var G=0;if(T.offsetParent){while(T.offsetParent){G+=T.offsetLeft;T=T.offsetParent;}}else{if(T.x){G+=T.x;}}return G;}function findPosY(G){var T=0;if(G.offsetParent){while(G.offsetParent){T+=G.offsetTop;G=G.offsetParent;}}else{if(G.y){T+=G.y;}}return T;}function pad(h,V,T){var s="";for(var G=0;G<(Math.abs(T)-h.toString().length);G++){s+=V;}return T>0?h+s:s+h;}function initGlobals(){objCaption=getObj("caption");objButtons=getObj("buttons");guidePlace=new Place(getObj("guide"));slideshow=new SlideShow(source);}function resize(){guidePlace=new Place(getObj("guide"));slideshow.placeElement(false);}function initSlideShow(){initGlobals();slideshow.show();window.onresize=resize;}