text: function getPageScroll(){var e;return self.pageYOffset?e=self.pageYOffset:document.documentElement&&document.documentElement.scrollTop?e=document.documentElement.scrollTop:document.body&&(e=document.body.scrollTop),arrayPageScroll=new Array("",e),arrayPageScroll}function getPageSize(){var e,t;window.innerHeight&&window.scrollMaxY?(e=document.body.scrollWidth,t=window.innerHeight+window.scrollMaxY):document.body.scrollHeight>document.body.offsetHeight?(e=document.body.scrollWidth,t=document.body.scrollHeight):(e=document.body.offsetWidth,t=document.body.offsetHeight);var i,n;return self.innerHeight?(i=self.innerWidth,n=self.innerHeight):document.documentElement&&document.documentElement.clientHeight?(i=document.documentElement.clientWidth,n=document.documentElement.clientHeight):document.body&&(i=document.body.clientWidth,n=document.body.clientHeight),pageHeight=t<n?n:t,pageWidth=e<i?i:e,arrayPageSize=new Array(pageWidth,pageHeight,i,n),arrayPageSize}function getKey(e){keycode=null==e?event.keyCode:e.which,key=String.fromCharCode(keycode).toLowerCase(),key}function listenKey(){document.onkeypress=getKey}function showSelectBoxes(){for(selects=document.getElementsByTagName("select"),i=0;i!=selects.length;i++)selects[i].style.visibility="visible"}function hideSelectBoxes(){for(selects=document.getElementsByTagName("select"),i=0;i!=selects.length;i++)selects[i].style.visibility="hidden"}function pause(e){for(var t=new Date,i=t.getTime()+e;;)if(t=new Date,t.getTime()>i)return}function initLightbox(){myLightbox=new Lightbox}var fileLoadingImage=BaiRong.ScriptsUrl+"lightbox/images/loading.gif",fileBottomNavCloseImage=BaiRong.ScriptsUrl+"lightbox/images/closelabel.gif",resizeSpeed=7,borderSize=10,imageArray=new Array,activeImage;resizeSpeed>10&&(resizeSpeed=10),resizeSpeed<1&&(resizeSpeed=1),resizeDuration=.15*(11-resizeSpeed),Object.extend(Element,{getWidth:function(e){return e=$(e),e.offsetWidth},setWidth:function(e,t){e=$(e),e.style.width=t+"px"},setHeight:function(e,t){e=$(e),e.style.height=t+"px"},setTop:function(e,t){e=$(e),e.style.top=t+"px"},setSrc:function(e,t){e=$(e),e.src=t},setHref:function(e,t){e=$(e),e.href=t},setInnerHTML:function(e,t){e=$(e),e.innerHTML=t}}),Array.prototype.removeDuplicates=function(){for(i=1;i<this.length;i++)this[i][0]==this[i-1][0]&&this.splice(i,1)},Array.prototype.empty=function(){for(i=0;i<=this.length;i++)this.shift()};var Lightbox=Class.create();Lightbox.prototype={initialize:function(){if(document.getElementsByTagName){for(var e=document.getElementsByTagName("a"),t=0;t<e.length;t++){var i=e[t],n=String(i.getAttribute("rel"));i.getAttribute("href")&&n.toLowerCase().match("lightbox")&&(i.onclick=function(){return myLightbox.start(this),!1})}var a=document.getElementsByTagName("body").item(0),r=document.createElement("div");r.setAttribute("id","overlay"),r.style.display="none",r.onclick=function(){return myLightbox.end(),!1},a.appendChild(r);var o=document.createElement("div");o.setAttribute("id","lightbox"),o.style.display="none",a.appendChild(o);var m=document.createElement("div");m.setAttribute("id","outerImageContainer"),o.appendChild(m);var l=document.createElement("div");l.setAttribute("id","imageContainer"),m.appendChild(l);var d=document.createElement("img");d.setAttribute("id","lightboxImage"),l.appendChild(d);var c=document.createElement("div");c.setAttribute("id","hoverNav"),l.appendChild(c);var g=document.createElement("a");g.setAttribute("id","prevLink"),g.setAttribute("href","#"),c.appendChild(g);var s=document.createElement("a");s.setAttribute("id","nextLink"),s.setAttribute("href","#"),c.appendChild(s);var u=document.createElement("div");u.setAttribute("id","loading"),l.appendChild(u);var h=document.createElement("a");h.setAttribute("id","loadingLink"),h.setAttribute("href","#"),h.onclick=function(){return myLightbox.end(),!1},u.appendChild(h);var f=document.createElement("img");f.setAttribute("src",fileLoadingImage),h.appendChild(f);var y=document.createElement("div");y.setAttribute("id","imageDataContainer"),y.className="clearfix",o.appendChild(y);var b=document.createElement("div");b.setAttribute("id","imageData"),y.appendChild(b);var p=document.createElement("div");p.setAttribute("id","imageDetails"),b.appendChild(p);var v=document.createElement("span");v.setAttribute("id","caption"),p.appendChild(v);var E=document.createElement("span");E.setAttribute("id","numberDisplay"),p.appendChild(E);var A=document.createElement("div");A.setAttribute("id","bottomNav"),b.appendChild(A);var I=document.createElement("a");I.setAttribute("id","bottomNavClose"),I.setAttribute("href","#"),I.onclick=function(){return myLightbox.end(),!1},A.appendChild(I);var w=document.createElement("img");w.setAttribute("src",fileBottomNavCloseImage),I.appendChild(w)}},start:function(e){hideSelectBoxes();var t=getPageSize();if(Element.setHeight("overlay",t[1]),new Effect.Appear("overlay",{duration:.2,from:0,to:.8}),imageArray=[],imageNum=0,document.getElementsByTagName){var i=document.getElementsByTagName("a");if("lightbox"==e.getAttribute("rel"))imageArray.push(new Array(e.getAttribute("href"),e.getAttribute("title")));else{for(var n=0;n<i.length;n++){var a=i[n];a.getAttribute("href")&&a.getAttribute("rel")==e.getAttribute("rel")&&imageArray.push(new Array(a.getAttribute("href"),a.getAttribute("title")))}for(imageArray.removeDuplicates();imageArray[imageNum][0]!=e.getAttribute("href");)imageNum++}var t=getPageSize(),r=getPageScroll(),o=r[1]+t[3]/15;Element.setTop("lightbox",o),Element.show("lightbox"),this.changeImage(imageNum)}},changeImage:function(e){activeImage=e,Element.show("loading"),Element.hide("lightboxImage"),Element.hide("hoverNav"),Element.hide("prevLink"),Element.hide("nextLink"),Element.hide("imageDataContainer"),Element.hide("numberDisplay"),imgPreloader=new Image,imgPreloader.onload=function(){Element.setSrc("lightboxImage",imageArray[activeImage][0]),myLightbox.resizeImageContainer(imgPreloader.width,imgPreloader.height)},imgPreloader.src=imageArray[activeImage][0]},resizeImageContainer:function(e,t){this.wCur=Element.getWidth("outerImageContainer"),this.hCur=Element.getHeight("outerImageContainer"),this.xScale=(e+2*borderSize)/this.wCur*100,this.yScale=(t+2*borderSize)/this.hCur*100,wDiff=this.wCur-2*borderSize-e,hDiff=this.hCur-2*borderSize-t,0!=hDiff&&new Effect.Scale("outerImageContainer",this.yScale,{scaleX:!1,duration:resizeDuration,queue:"front"}),0!=wDiff&&new Effect.Scale("outerImageContainer",this.xScale,{scaleY:!1,delay:resizeDuration,duration:resizeDuration}),0==hDiff&&0==wDiff&&pause(-1!=navigator.appVersion.indexOf("MSIE")?250:100),Element.setHeight("prevLink",t),Element.setHeight("nextLink",t),Element.setWidth("imageDataContainer",e+2*borderSize),this.showImage()},showImage:function(){Element.hide("loading"),new Effect.Appear("lightboxImage",{duration:.5,queue:"end",afterFinish:function(){myLightbox.updateDetails()}}),this.preloadNeighborImages()},updateDetails:function(){Element.show("caption"),Element.setInnerHTML("caption",imageArray[activeImage][1]),imageArray.length>1&&(Element.show("numberDisplay"),Element.setInnerHTML("numberDisplay","Image "+eval(activeImage+1)+" of "+imageArray.length)),new Effect.Parallel([new Effect.SlideDown("imageDataContainer",{sync:!0,duration:resizeDuration+.25,from:0,to:1}),new Effect.Appear("imageDataContainer",{sync:!0,duration:1})],{duration:.65,afterFinish:function(){myLightbox.updateNav()}})},updateNav:function(){Element.show("hoverNav"),0!=activeImage&&(Element.show("prevLink"),document.getElementById("prevLink").onclick=function(){return myLightbox.changeImage(activeImage-1),!1}),activeImage!=imageArray.length-1&&(Element.show("nextLink"),document.getElementById("nextLink").onclick=function(){return myLightbox.changeImage(activeImage+1),!1}),this.enableKeyboardNav()},enableKeyboardNav:function(){document.onkeydown=this.keyboardAction},disableKeyboardNav:function(){document.onkeydown=""},keyboardAction:function(e){keycode=null==e?event.keyCode:e.which,key=String.fromCharCode(keycode).toLowerCase(),"x"==key||"o"==key||"c"==key?myLightbox.end():"p"==key?0!=activeImage&&(myLightbox.disableKeyboardNav(),myLightbox.changeImage(activeImage-1)):"n"==key&&activeImage!=imageArray.length-1&&(myLightbox.disableKeyboardNav(),myLightbox.changeImage(activeImage+1))},preloadNeighborImages:function(){imageArray.length-1>activeImage&&(preloadNextImage=new Image,preloadNextImage.src=imageArray[activeImage+1][0]),activeImage>0&&(preloadPrevImage=new Image,preloadPrevImage.src=imageArray[activeImage-1][0])},end:function(){this.disableKeyboardNav(),Element.hide("lightbox"),new Effect.Fade("overlay",{duration:.2}),showSelectBoxes()}},Event.observe(window,"load",initLightbox,!1);