CCI.Window={open:function(){var _1=document.getElementsByTagName("a");var _2=_1.length;for(var i=0;i<_2;i++){var _4=_1[i];if(String(_4.getAttribute("rel")).indexOf("external")==-1){return;}_4.setAttribute("target","_blank");}}};CCI.Lightbox={loadingImage:"/images/loading.gif",closeButton:"/images/close.gif",getPageScroll:function(){var _5;if(self.pageYOffset){_5=self.pageYOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){_5=document.documentElement.scrollTop;}else{if(document.body){_5=document.body.scrollTop;}}}arrayPageScroll=["",_5];return arrayPageScroll;},getPageSize:function(){var _6,yScroll;if(window.innerHeight&&window.scrollMaxY){_6=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else{if(document.body.scrollHeight>document.body.offsetHeight){_6=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{_6=document.body.offsetWidth;yScroll=document.body.offsetHeight;}}var _7,windowHeight;if(self.innerHeight){_7=self.innerWidth;windowHeight=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){_7=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else{if(document.body){_7=document.body.clientWidth;windowHeight=document.body.clientHeight;}}}if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}if(_6<_7){pageWidth=_7;}else{pageWidth=_6;}arrayPageSize=[pageWidth,pageHeight,_7,windowHeight];return arrayPageSize;},pause:function(_8){var _9=new Date();var _a=_9.getTime()+_8;while(true){_9=new Date();if(_9.getTime()>_a){return;}}},getKey:function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}key=String.fromCharCode(keycode).toLowerCase();if(key=="x"){CCI.Lightbox.hide();}},hide:function(){CCI.Lightbox.hideLightbox();return false;},show:function(){CCI.Lightbox.showLightbox(this);return false;},listenKey:function(){document.onkeypress=CCI.Lightbox.getKey;},showLightbox:function(_c){var _d=CCI.Dom.$("overlay");var _e=CCI.Dom.$("lightbox");var _f=CCI.Dom.$("lightboxCaption");var _10=CCI.Dom.$("lightboxImage");var _11=CCI.Dom.$("loadingImage");var _12=CCI.Dom.$("lightboxDetails");var _13=CCI.Lightbox.getPageSize();var _14=CCI.Lightbox.getPageScroll();if(_11){_11.style.top=(_14[1]+((_13[3]-35-_11.height)/2)+"px");_11.style.left=(((_13[0]-20-_11.width)/2)+"px");_11.style.display="block";}_d.style.height=(_13[1]+"px");_d.style.display="block";imgPreload=new Image();imgPreload.onload=function(){_10.src=_c.href;var _15=_14[1]+((_13[3]-35-imgPreload.height)/2);var _16=((_13[0]-20-imgPreload.width)/2);_e.style.top=(_15<0)?"0px":_15+"px";_e.style.left=(_16<0)?"0px":_16+"px";_12.style.width=imgPreload.width+"px";if(_c.getAttribute("title")){_f.style.display="block";_f.innerHTML=_c.getAttribute("title");}else{_f.style.display="none";}if(navigator.appVersion.indexOf("MSIE")!=-1){CCI.Lightbox.pause(250);}if(_11){_11.style.display="none";}CCI.Lightbox.hideElements();_e.style.display="block";_13=CCI.Lightbox.getPageSize();_d.style.height=(_13[1]+"px");CCI.Lightbox.listenKey();return false;};imgPreload.src=_c.href;},hideLightbox:function(){objOverlay=CCI.Dom.$("overlay");objLightbox=CCI.Dom.$("lightbox");objOverlay.style.display="none";objLightbox.style.display="none";CCI.Lightbox.showElements();document.onkeypress="";},init:function(){if(!document.getElementsByTagName){return;}var _17=document.getElementsByTagName("a");for(var i=0;i<_17.length;i++){var _19=_17[i];if(_19.getAttribute("href")&&(String(_19.getAttribute("rel")).indexOf("lightbox")!=-1)){_19.onclick=CCI.Lightbox.show;}}var _1a=document.getElementsByTagName("body")[0];var _1b=CCI.Dom.ce("div");_1b.setAttribute("id","overlay");_1b.onclick=CCI.Lightbox.hide;_1b.style.display="none";_1b.style.position="absolute";_1b.style.top="0";_1b.style.left="0";_1b.style.zIndex="90";_1b.style.width="100%";_1a.insertBefore(_1b,_1a.firstChild);var _1c=CCI.Lightbox.getPageSize();var _1d=CCI.Lightbox.getPageScroll();var _1e=new Image();_1e.onload=function(){var _1f=CCI.Dom.ce("a");_1f.setAttribute("href","#");_1f.onclick=CCI.Lightbox.hide;_1b.appendChild(_1f);var _20=CCI.Dom.ce("img");_20.src=CCI.Lightbox.loadingImage;_20.setAttribute("id","loadingImage");_20.style.position="absolute";_20.style.zIndex="150";_1f.appendChild(_20);_1e.onload=function(){};return false;};_1e.src=CCI.Lightbox.loadingImage;var _21=CCI.Dom.ce("div");_21.setAttribute("id","lightbox");_21.style.display="none";_21.style.position="absolute";_21.style.zIndex="100";_1a.insertBefore(_21,_1b.nextSibling);var _22=CCI.Dom.ce("a");_22.setAttribute("href","#");_22.setAttribute("title","Click to Close");_22.onclick=CCI.Lightbox.hide;_21.appendChild(_22);var _23=new Image();_23.onload=function(){var _24=CCI.Dom.ce("img");_24.src=CCI.Lightbox.closeButton;_24.setAttribute("id","closeButton");_24.style.position="absolute";_24.style.zIndex="200";_22.appendChild(_24);return false;};_23.src=CCI.Lightbox.closeButton;var _25=CCI.Dom.ce("img");_25.setAttribute("id","lightboxImage");_22.appendChild(_25);var _26=CCI.Dom.ce("div");_26.setAttribute("id","lightboxDetails");_21.appendChild(_26);var _27=CCI.Dom.ce("div");_27.setAttribute("id","lightboxCaption");_27.style.display="none";_26.appendChild(_27);var _28=CCI.Dom.ce("div");_28.setAttribute("id","keyboardMsg");var _29=CCI.Dom.ce("a");_29.setAttribute("href","#");_29.onclick=CCI.Lightbox.hide;var _2a=CCI.Dom.ce("kbd");var _2b=document.createTextNode("x");var _2c=document.createTextNode("press ");var _2d=document.createTextNode(" to close");_2a.appendChild(_2b);_29.appendChild(_2a);_28.appendChild(_2c);_28.appendChild(_29);_28.appendChild(_2d);_26.appendChild(_28);},showSelectBoxes:function(){CCI.Lightbox.elementVisibility("select","visible");},hideSelectBoxes:function(){CCI.Lightbox.elementVisibility("select","hidden");},hideFrames:function(){CCI.Lightbox.elementVisibility("iframe","hidden");},showFrames:function(){CCI.Lightbox.elementVisibility("iframe","visible");},hideElements:function(){CCI.Lightbox.hideSelectBoxes();CCI.Lightbox.hideFrames();},showElements:function(){CCI.Lightbox.showSelectBoxes();CCI.Lightbox.showFrames();},elementVisibility:function(el,v){var _30=document.getElementsByTagName(el);for(var i=0;i<_30.length;i++){_30[i].style.visibility=v;}}};CCI.Init.addEvent(window,"load",CCI.Window.open);CCI.Init.addEvent(window,"load",CCI.Lightbox.init);
