document.getElemetsByClassName=function(a,b){var d=[],e=null,c=RegExp(["(^|\\s)",a,"(\\s|$)"].join(""));if(b&&b.getElementsByTagName)e=b.getElementsByTagName("*");e||(e=document.getElementsByTagName?document.getElementsByTagName("*"):document.all);for(var g=0,h=e.length;g<h;g++)(e[g].getAttribute("class")||e[g].className).match(c)&&d.push(e[g]);return d};function WindowSize(){this.h=this.w=0;return this}
WindowSize.prototype.update=function(){var a=document,b=window.innerWidth?window.innerWidth:a.documentElement&&a.documentElement.clientWidth?a.documentElement.clientWidth:a.body.clientWidth;a=window.innerHeight?window.innerHeight:a.documentElement&&a.documentElement.clientHeight?a.documentElement.clientHeight:a.body.clientHeight;if(b!=this.w||a!=this.h){this.w=b;this.h=a;return true}return false};function PageSize(){this.win=new WindowSize;this.h=this.w=0;return this}
PageSize.prototype.update=function(){var a=document,b=window.innerWidth&&window.scrollMaxX?window.innerWidth+window.scrollMaxX:a.body.scrollWidth>a.body.offsetWidth?a.body.scrollWidth:a.body.offsetWidt;a=window.innerHeight&&window.scrollMaxY?window.innerHeight+window.scrollMaxY:a.body.scrollHeight>a.body.offsetHeight?a.body.scrollHeight:a.body.offsetHeight;var d=this.win.update();if(b<this.win.w)b=this.win.w;if(a<this.win.h)a=this.win.h;if(d||b!=this.w||a!=this.h){this.w=b;this.h=a;return true}return false};
function PagePos(){this.y=this.x=0;return this}PagePos.prototype.update=function(){var a=document,b=window.pageXOffset?window.pageXOffset:a.documentElement&&a.documentElement.scrollLeft?a.documentElement.scrollLeft:a.body?a.body.scrollLeft:0;a=window.pageYOffset?window.pageYOffset:a.documentElement&&a.documentElement.scrollTop?a.documentElement.scrollTop:a.body?a.body.scrollTop:0;if(b!=this.x||a!=this.y){this.x=b;this.y=a;return true}return false};
if(!window.Bw){var Bw={};Bw.Browser=new (function(){this.name=navigator.userAgent;this.isWinIE=this.isMacIE=false;this.isGecko=this.name.match(/Gecko\//);this.isSafari=this.name.match(/AppleWebKit/);this.isSafari3=this.name.match(/AppleWebKit\/(\d\d\d)/)&&parseInt(RegExp.$1)>500;this.isKHTML=this.isSafari||navigator.appVersion.match(/Konqueror|KHTML/);this.isOpera=window.opera;if(document.all&&!this.isGecko&&!this.isSafari&&!this.isOpera){this.isWinIE=this.name.match(/Win/);this.isMacIE=
this.name.match(/Mac/);this.isNewIE=this.name.match(/MSIE (\d\.\d)/)&&RegExp.$1>6.5}});Bw.Event={cache:false,getEvent:function(a){return a?a:window.event?window.event:null},getKey:function(a){if(a)return a.keyCode?a.keyCode:a.charCode},stop:function(a){if(a){try{a.stopPropagation()}catch(b){}a.cancelBubble=true;try{a.preventDefault()}catch(d){}return a.returnValue=false}},register:function(a,b,d){if(a){if(b=="keypress"&&!a.addEventListener)b="keydown";if(b=="mousewheel"&&Bw.Browser.isGecko)b=
"DOMMouseScroll";if(!this.cache)this.cache=[];if(a.addEventListener){this.cache.push([a,b,d]);a.addEventListener(b,d,false)}else if(a.attachEvent){this.cache.push([a,b,d]);a.attachEvent("on"+b,d)}else a["on"+b]=d}},deregister:function(a,b,d){if(a){if(b=="keypress"&&!a.addEventListener)b="keydown";if(b=="mousewheel"&&Bw.Browser.isGecko)b="DOMMouseScroll";if(a.removeEventListener)a.removeEventListener(b,d,false);else if(a.detachEvent)a.detachEvent("on"+b,d);else a["on"+b]=null}},deregisterAll:function(){if(Bw.Event.cache){for(var a=
0,b=Bw.Event.cache.length;a<b;a++){Bw.Event.deregister(Bw.Event.cache[a]);Bw.Event.cache[a][0]=null}Bw.Event.cache=false}},run:function(a){if(typeof a=="function")Bw.Browser.isGecko||Bw.Browser.isOpera?this.register(window,"DOMContentLoaded",a):this.register(window,"load",a)}};Bw.Event.register(window,"unload",Bw.Event.deregisterAll)}
function Lightbox(a){this._imgs=[];this._sets=[];this._img=this._box=this._wrap=null;this._open=-1;this._page=new PageSize;this._pos=new PagePos;this._zoomimg=null;this._expanded=this._expandable=false;this._funcs={move:null,up:null,drag:null,wheel:null,dbl:null};this._level=1;this._curpos={x:0,y:0};this._imgpos={x:0,y:0};this._minpos={x:0,y:0};this._blank=a.blankimg;this._timer=null;this._anim={step:0,w:50,h:50,a:0,t:0,f:a.animation};this._next=this._prev=this._openedset=this._overall=this._indicator=
null;this._hiding=[];this._changed=this._first=false;return this._init(a)}
Lightbox.prototype={refresh:function(a){a||(a=document);this._imgs.length=0;this._genListFromLinks(a)},_init:function(a){var b=document;if(b.getElementsByTagName){if(Bw.Browser.isMacIE)return this;var d=b.getElementsByTagName("body")[0];this._wrap=this._createWrapOn(d);this._box=this._createBoxOn(d,a);this._img=this._box.firstChild;this._zoomimg=b.getElementById("actionImage");a.skipInit||this._genListFromLinks(b);return this}},_genListFromLinks:function(a){a=a.getElementsByTagName("a");for(var b=
0;b<a.length;b++){var d=a[b],e=this._imgs.length,c=String(d.getAttribute("rel")).toLowerCase();if(d.getAttribute("href")&&c.match("lightbox")){this._imgs[e]={src:d.getAttribute("href"),w:-1,h:-1,title:"",cls:d.className,set:c};if(d.getAttribute("title"))this._imgs[e].title=d.getAttribute("title");else if(d.firstChild&&d.firstChild.getAttribute&&d.firstChild.getAttribute("title"))this._imgs[e].title=d.firstChild.getAttribute("title");d.onclick=this._genOpener(e);if(c!="lightbox"){this._sets[c]||(this._sets[c]=
[]);this._sets[c].push(e)}}}},_genOpener:function(a){var b=this;return function(){b._show(a);return false}},_createWrapOn:function(a){var b=this;if(!a)return null;var d=document.createElement("div");a.appendChild(d);d.id="overlay";d.style.display="none";d.style.position="fixed";d.style.top="0px";d.style.left="0px";d.style.zIndex="50";d.style.width="100%";d.style.height="100%";if(Bw.Browser.isWinIE)d.style.position="absolute";Bw.Event.register(d,"click",function(e){b._close(e)});return d},_createBoxOn:function(a,
b){var d=this;if(!a)return null;var e=document.createElement("div");a.appendChild(e);e.id="lightbox";e.style.display="none";e.style.position="absolute";e.style.zIndex="60";var c=document.createElement("img");e.appendChild(c);c.id="lightboxImage";c.width=200;c.height=200;d._set_cursor(c);Bw.Event.register(c,"mouseover",function(){d._show_action()});Bw.Event.register(c,"mouseout",function(){d._hide_action()});Bw.Event.register(c,"click",function(f){d._close(f)});var g=new Image;g.onload=function(){var f=
document.createElement("img");e.appendChild(f);f.id="loadingImage";f.src=g.src;f.style.position="absolute";f.style.zIndex="70";d._set_cursor(f);Bw.Event.register(f,"click",function(i){d._close(i)});g.onload=function(){}};if(b.loadingimg!="")g.src=b.loadingimg;if(b.previmg){c=document.createElement("img");e.appendChild(c);c.id="prevLink";c.style.display="none";c.style.position="absolute";c.style.left="9px";c.style.zIndex="70";c.src=b.previmg;d._prev=c;Bw.Event.register(c,"mouseover",function(){d._show_action()});
Bw.Event.register(c,"click",function(){d._show_next(-1)})}if(b.nextimg){c=document.createElement("img");e.appendChild(c);c.id="nextLink";c.style.display="none";c.style.position="absolute";c.style.right="9px";c.style.zIndex="70";c.src=b.nextimg;d._next=c;Bw.Event.register(c,"mouseover",function(){d._show_action()});Bw.Event.register(c,"click",function(){d._show_next(+1)})}c=document.createElement("img");e.appendChild(c);c.id="actionImage";c.style.display="none";c.style.position="absolute";
c.style.top="15px";c.style.left="15px";c.style.zIndex="70";d._set_cursor(c);c.src=d._expand;Bw.Event.register(c,"mouseover",function(){d._show_action()});Bw.Event.register(c,"click",function(){d._zoom()});if(b.closeimg){c=document.createElement("img");e.appendChild(c);c.id="closeButton";c.style.display="inline";c.style.position="absolute";c.style.right="9px";c.style.top="10px";c.style.zIndex="80";c.src=b.closeimg;d._set_cursor(c);Bw.Event.register(c,"click",function(f){d._close(f)})}c=document.createElement("span");
e.appendChild(c);c.id="lightboxCaption";c.style.display="none";c.style.position="absolute";c.style.zIndex="80";if(b.effectpos){if(b.effectpos.x=="")b.effectpos.x=0;if(b.effectpos.y=="")b.effectpos.y=0}else b.effectpos={x:0,y:0};var h=new Image;h.onload=function(){var f=document.createElement("img");e.appendChild(f);f.id="effectImage";f.src=h.src;if(b.effectclass)f.className=b.effectclass;f.style.position="absolute";f.style.display="none";f.style.left=[b.effectpos.x,"px"].join("");f.style.top=[b.effectpos.y,
"px"].join("");f.style.zIndex="90";d._set_cursor(f);Bw.Event.register(f,"click",function(){f.style.display="none"})};if(b.effectimg!="")h.src=b.effectimg;if(d._resizable){c=document.createElement("div");a.appendChild(c);c.id="lightboxOverallView";c.style.display="none";c.style.position="absolute";c.style.zIndex="70";d._overall=c;c=document.createElement("div");a.appendChild(c);c.id="lightboxIndicator";c.style.display="none";c.style.position="absolute";c.style.zIndex="80";d._indicator=c}return e},
_set_photo_size:function(){if(this._open!=-1){var a={w:this._page.win.w-30,h:this._page.win.h-30},b={x:15,y:15},d={p:9,n:9,y:0};if(this._expanded){var e=parseInt(this._imgs[this._open].w*this._level),c=parseInt(this._imgs[this._open].h*this._level);this._minpos.x=this._pos.x+a.w-this._img.width;this._minpos.y=this._pos.y+a.h-this._img.height;if(this._img.width<=a.w)this._imgpos.x=this._pos.x+(a.w-this._img.width)/2;else{if(this._imgpos.x>this._pos.x)this._imgpos.x=this._pos.x;else if(this._imgpos.x<
this._minpos.x)this._imgpos.x=this._minpos.x;b.x=15+this._pos.x-this._imgpos.x;d.p=this._pos.x-this._imgpos.x-5;d.n=this._img.width-this._page.win.w+this._imgpos.x+25;if(Bw.Browser.isWinIE)d.n-=10}if(this._img.height<=a.h){this._imgpos.y=this._pos.y+(a.h-this._img.height)/2;d.y=Math.floor(this._img.height/2)-10}else{if(this._imgpos.y>this._pos.y)this._imgpos.y=this._pos.y;else if(this._imgpos.y<this._minpos.y)this._imgpos.y=this._minpos.y;b.y=15+this._pos.y-this._imgpos.y;d.y=Math.floor(a.h/2)-
10+this._pos.y-this._imgpos.y}this._anim.w=e;this._anim.h=c;this._show_overall(true)}else{e={w:this._imgs[this._open].w,h:this._imgs[this._open].h};if(e.w<0)e.w=this._img.width;if(e.h<0)e.h=this._img.height;c=1;if((e.w>=a.w||e.h>=a.h)&&e.h&&e.w)c=a.w/e.w<a.h/e.h?a.w/e.w:a.h/e.h;this._expandable=c<1?true:false;this._anim.w=Math.floor(e.w*c);this._anim.h=Math.floor(e.h*c);if(this._resizable)this._expandable=true;if(Bw.Browser.isWinIE)this._box.style.display="block";this._imgpos.x=this._pos.x+(a.w-
this._img.width)/2;this._imgpos.y=this._pos.y+(a.h-this._img.height)/2;d.y=Math.floor(this._img.height/2)-10;this._show_overall(false);if(a=document.getElementById("loadingImage")){a.style.left=[(this._img.width-30)/2,"px"].join("");a.style.top=[(this._img.height-30)/2,"px"].join("")}}this._box.style.left=[this._imgpos.x,"px"].join("");this._box.style.top=[this._imgpos.y,"px"].join("");this._zoomimg.style.left=[b.x,"px"].join("");this._zoomimg.style.top=[b.y,"px"].join("");this._wrap.style.left=this._pos.x;
if(this._prev&&this._next){this._prev.style.left=[d.p,"px"].join("");this._next.style.right=[d.n,"px"].join("");this._prev.style.top=this._next.style.top=[d.y,"px"].join("")}this._changed=true}},_show_overall:function(a){if(this._overall!=null)if(a){if(this._open!=-1){a={w:0,h:0,x:0,y:0};var b={w:0,h:0,x:0,y:0},d={w:this._img.width,h:this._img.height},e={w:this._page.win.w-30,h:this._page.win.h-30},c=d.w;if(c<d.h)c=d.h;if(c<e.w)c=e.w;if(c<e.h)c=e.h;if(!(c<1)){a.w=parseInt(d.w/c*100);a.h=parseInt(d.h/
c*100);b.w=parseInt(e.w/c*100);b.h=parseInt(e.h/c*100);a.x=this._pos.x+e.w-100-20;a.y=this._pos.y+e.h-100-20;b.x=a.x-parseInt((this._imgpos.x-this._pos.x)/c*100);b.y=a.y-parseInt((this._imgpos.y-this._pos.y)/c*100);this._overall.style.left=[a.x,"px"].join("");this._overall.style.top=[a.y,"px"].join("");this._overall.style.width=[a.w,"px"].join("");this._overall.style.height=[a.h,"px"].join("");this._indicator.style.left=[b.x,"px"].join("");this._indicator.style.top=[b.y,"px"].join("");this._indicator.style.width=
[b.w,"px"].join("");this._indicator.style.height=[b.h,"px"].join("");this._overall.style.display="block";this._indicator.style.display="block"}}}else{this._overall.style.display="none";this._indicator.style.display="none"}},_set_size:function(a){if(this._open!=-1)if(!(!this._page.update()&&!this._pos.update()&&!this._changed)){if(Bw.Browser.isWinIE){this._wrap.style.width=[this._page.win.w,"px"].join("");this._wrap.style.height=[this._page.win.h,"px"].join("");this._wrap.style.top=[this._pos.y,
"px"].join("")}a&&this._set_photo_size()}},_set_cursor:function(a){if(!(Bw.Browser.isWinIE&&!Bw.Browser.isNewIE))a.style.cursor="pointer"},_current_setindex:function(){if(!this._openedset)return-1;for(var a=this._sets[this._openedset],b=0,d=a.length;b<d;b++)if(a[b]==this._open)return b;return-1},_get_setlength:function(){if(!this._openedset)return-1;return this._sets[this._openedset].length},_show_action:function(){if(this._open!=-1){var a=this._current_setindex();if(a>-1){if(a>0)this._prev.style.display=
"inline";if(a<this._get_setlength()-1)this._next.style.display="inline"}if(this._expandable&&this._zoomimg){this._zoomimg.src=this._expanded?this._shrink:this._expand;this._zoomimg.style.display="inline"}}},_hide_action:function(){if(this._zoomimg)this._zoomimg.style.display="none";this._open>-1&&this._expanded&&this._dragstop(null);if(this._prev)this._prev.style.display="none";if(this._next)this._next.style.display="none"},_zoom:function(){var a=this,b=document.getElementById("closeButton");if(a._expanded){a._reset_func();
a._expanded=false;if(b)b.style.display="inline"}else if(a._open>-1){a._level=1;a._imgpos.x=a._pos.x;a._imgpos.y=a._pos.y;a._expanded=true;a._funcs.drag=function(d){a._dragstart(d)};a._funcs.dbl=function(){a._close(null)};if(a._resizable){a._funcs.wheel=function(d){a._onwheel(d)};Bw.Event.register(a._box,"mousewheel",a._funcs.wheel)}Bw.Event.register(a._img,"mousedown",a._funcs.drag);Bw.Event.register(a._img,"dblclick",a._funcs.dbl);a._show_caption(false);if(b)b.style.display="none"}a._set_photo_size();
a._show_action()},_reset_func:function(){this._funcs.wheel!=null&&Bw.Event.deregister(this._box,"mousewheel",this._funcs.wheel);this._funcs.move!=null&&Bw.Event.deregister(this._img,"mousemove",this._funcs.move);this._funcs.up!=null&&Bw.Event.deregister(this._img,"mouseup",this._funcs.up);this._funcs.drag!=null&&Bw.Event.deregister(this._img,"mousedown",this._funcs.drag);this._funcs.dbl!=null&&Bw.Event.deregister(this._img,"dblclick",this._funcs.dbl);this._funcs={move:null,up:null,
drag:null,wheel:null,dbl:null}},_onwheel:function(a){var b=0;a=Bw.Event.getEvent(a);if(a.wheelDelta)b=event.wheelDelta/-120;else if(a.detail)b=a.detail/3;if(Bw.Browser.isOpera)b=-b;var d=this._level<1?0.1:this._level<2?0.25:this._level<4?0.5:1;this._level=b>0?this._level+d:this._level-d;if(this._level>8)this._level=8;else if(this._level<0.5)this._level=0.5;this._set_photo_size();return Bw.Event.stop(a)},_dragstart:function(a){var b=this;a=Bw.Event.getEvent(a);b._curpos.x=a.screenX;b._curpos.y=
a.screenY;b._funcs.move=function(d){b._dragging(d)};b._funcs.up=function(d){b._dragstop(d)};Bw.Event.register(b._img,"mousemove",b._funcs.move);Bw.Event.register(b._img,"mouseup",b._funcs.up);return Bw.Event.stop(a)},_dragging:function(a){a=Bw.Event.getEvent(a);this._imgpos.x+=a.screenX-this._curpos.x;this._imgpos.y+=a.screenY-this._curpos.y;this._curpos.x=a.screenX;this._curpos.y=a.screenY;this._set_photo_size();return Bw.Event.stop(a)},_dragstop:function(a){a=Bw.Event.getEvent(a);
this._funcs.move!=null&&Bw.Event.deregister(this._img,"mousemove",this._funcs.move);this._funcs.up!=null&&Bw.Event.deregister(this._img,"mouseup",this._funcs.up);this._funcs.move=null;this._funcs.up=null;this._set_photo_size();return a?Bw.Event.stop(a):false},_show_caption:function(a){var b=document.getElementById("lightboxCaption");if(b)if(b.innerHTML.length==0||!a)b.style.display="none";else{b.style.top=[this._img.height+10,"px"].join("");b.style.left="0px";b.style.width=[this._img.width+
8,"px"].join("");b.style.display="block"}},_toggle_wrap:function(a){this._wrap.style.display=a?"block":"none";if(this._hiding.length==0&&!this._first){for(var b=["select","embed","object"],d=0,e=b.length;d<e;d++)for(var c=document.getElementsByTagName(b[d]),g=0,h=c.length;g<h;g++){var f=c[g].style.visibility;if(!f)if(c[g].currentStyle)f=c[g].currentStyle.visibility;else if(document.defaultView)f=document.defaultView.getComputedStyle(c[g],"").getPropertyValue("visibility");f!="hidden"&&this._hiding.push(c[g])}this._first=
true}d=0;for(e=this._hiding.length;d<e;d++)this._hiding[d].style.visibility=a?"hidden":"visible";a&&this._setOpacity(this._wrap,5)},_prepare:function(){if(this._open!=-1){this._set_size(false);this._toggle_wrap(true);this._box.style.display="block";this._hide_action();this._img.src=this._blank;var a=document.getElementById("loadingImage");if(a)a.style.display="inline";a=["effectImage","closeButton","lightboxCaption"];for(var b in a){var d=document.getElementById(a[b]);if(d)d.style.display="none"}}},
_show:function(a){var b=this,d=new Image;if(!(a<0||a>=b._imgs.length)){b._open=a;b._prepare();b._set_photo_size();d.onload=function(){b._expanded=false;if(b._imgs[b._open].w==-1){b._imgs[b._open].w=d.width;b._imgs[b._open].h=d.height}var e=document.getElementById("lightboxCaption");if(e)try{e.innerHTML=b._imgs[b._open].title}catch(c){}b._anim.t=(new Date).getTime();b._timer=window.setInterval(function(){b._run()},20);b._img.setAttribute("title",b._imgs[b._open].title);b._anim.step=b._anim.f?0:2;b._set_photo_size();
b._anim.f||b._show_image();if(b._imgs[b._open].set!="lightbox"){e=b._imgs[b._open].set;if(b._sets[e].length>1)b._openedset=e;if(!b._prev||!b._next)b._openedset=null}};b._expandable=false;b._expanded=false;b._anim.step=-1;d.src=b._imgs[b._open].src}},_run:function(){var a=(new Date).getTime();if(!(a-this._anim.t<50)){this._anim.t=a;this._set_size(true);if(this._anim.step==0||this._anim.w!=this._img.width||this._anim.h!=this._img.height)this._doResizing();else if(this._anim.step==1)this._doFadeIn();
else this._anim.step==3&&this._doFadeOut()}},_show_image:function(){if(this._open!=-1){this._img.src=this._imgs[this._open].src;var a=document.getElementById("loadingImage");if(a)a.style.display="none";if((a=document.getElementById("effectImage"))&&(!a.className||this._imgs[this._open].cls==a.className))a.style.display="block";if(a=document.getElementById("closeButton"))a.style.display="inline";this._show_caption(true)}},_doResizing:function(){var a={x:this._anim.f?Math.floor((this._anim.w-this._img.width)/
3):0,y:this._anim.f?Math.floor((this._anim.h-this._img.height)/3):0};this._img.width+=a.x;this._img.height+=a.y;if(Math.abs(a.x)<1)this._img.width=this._anim.w;if(Math.abs(a.y)<1)this._img.height=this._anim.h;if(this._anim.w==this._img.width&&this._anim.h==this._img.height){this._changed=false;this._set_photo_size();if(this._anim.step==0){this._anim.step=1;this._anim.a=0;this._show_image();this._setOpacity(this._img,this._anim.a)}else this._anim.step==2&&!this._expanded&&this._show_caption(true)}},
_doFadeIn:function(){this._anim.a+=2;if(this._anim.a>10){this._anim.step=2;this._anim.a=9.9}this._setOpacity(this._img,this._anim.a)},_doFadeOut:function(){this._anim.a-=1;if(this._anim.a<1){this._anim.step=2;this._anim.a=0;if(this._timer!=null){window.clearInterval(this._timer);this._timer=null}this._toggle_wrap(false)}this._setOpacity(this._wrap,this._anim.a)},_setOpacity:function(a,b){if(Bw.Browser.isWinIE)a.style.filter="alpha(opacity="+b*10+")";else a.style.opacity=b/10},_close_box:function(){this._open=
-1;this._openedset=null;this._hide_action();this._reset_func();this._show_overall(false);this._box.style.display="none";if(!this._anim.f&&this._timer!=null){window.clearInterval(this._timer);this._timer=null}},_show_next:function(a){if(!this._openedset)return this._close(null);a=this._sets[this._openedset][this._current_setindex()+a];this._close_box();this._show(a)},_close:function(a){if(a!=null){a=Bw.Event.getEvent(a);if((a=a.target||a.srcElement)&&a.getAttribute("id")=="lightboxImage"&&this._expanded)return}this._close_box();
if(this._anim.f&&this._anim.step==2){this._anim.step=3;this._anim.a=5}else this._toggle_wrap(false)}};Bw.Event.run(function(){new Lightbox({loadingimg:"lightbox/loading.gif",expandimg:"lightbox/expand.gif",shrinkimg:"lightbox/shrink.gif",blankimg:"lightbox/blank.gif",previmg:"lightbox/prev.gif",nextimg:"lightbox/next.gif",closeimg:"lightbox/close.gif",effectimg:"lightbox/zzoop.gif",effectpos:{x:-40,y:-20},effectclass:"effectable",resizable:true,animation:true})});
