var a;
TLightBox=function(b,d,j,k){var g=true,e=null,h=lightBoxes.lightBoxes.length,i=100,f=50,l=false,m=1001+h,n=k;if(typeof k=="undefined")n=true;if(typeof d!="undefined")m=parseInt(d);if(typeof j!="undefined")f=parseInt(j);lightBoxes.lightBoxes[h]=this;this.pAllHidden=function(){for(var c=0;c<lightBoxes.lightBoxes.length;c++){var o=lightBoxes.lightBoxes[c];if(o.pVisible()&&o.pWithImage())return false}return true};this.pAutoMove=function(c){if(typeof c=="undefined")return g;else g=Boolean(c)};this.pDoFrame=function(){if(this.iframe){this.iframe.style.left=
e.offsetLeft+"px";this.iframe.style.width=e.offsetWidth+"px";this.iframe.style.height=e.offsetHeight+"px";if(g)positionElement(this.iframe,f);else this.iframe.style.top=e.offsetTop+"px"}};this.pElement=function(c){if(typeof c=="undefined")return e;else e=c};this.pGetRef=function(){return"lightBoxes.lightBoxes["+h+"]"};this.pIndex=function(){return h};this.pLeft=function(c){if(typeof c=="undefined")return i;else{i=parseInt(c);e.style.left=i+"px";this.pDoFrame()}};this.pName=function(){return b};this.pSize=
function(){if(e==null)return null;return new Size(e.offsetWidth,e.offsetHeight)};this.pTop=function(c){if(typeof c=="undefined")return f;else{f=parseInt(c);if(g)positionElement(e,f);else e.style.top=f+"px";this.pDoFrame()}};this.pVisible=function(c){if(typeof c=="undefined")return l;else l=c};this.pWithImage=function(){return n};this.pZIndex=function(){return m};bodyLoaded&&this.init()};a=TLightBox.prototype;a.autoMove=function(b){return this.pAutoMove(b)};
a.element=function(){this.pElement()||this.init();return this.pElement()};a.getHtml=function(b){if(this.pElement())return getHtml(this.pElement(),b);else if(this.init())return this.getHtml(b);return false};a.height=function(b){if(this.pElement())if(typeof b!="undefined"){this.pElement().style.height=parseInt(b)+"px";this.pDoFrame()}else return this.pElement().offsetHeight};
a.hide=function(){if(this.pElement()){if(this.pVisible()){this.pVisible(false);if(this.iframe)this.iframe.style.display="none";this.pElement().style.display="none";if(this.pAllHidden())Html.get("imgBack").style.display="none"}}else this.init()&&this.hide()};
a.init=function(){if(this.pElement()==null){var b=Html.get(this.pName());if(b){document.body.appendChild(b);this.pElement(b);b.style.display="none";b.style.position="absolute";b.style.zIndex=this.pZIndex();if(isIE6){this.iframe=document.createElement("IFRAME");this.iframe.src="misc/empty.htm";this.iframe.style.display="none";this.iframe.style.position="absolute";this.iframe.style.zIndex=this.pZIndex()-1;document.body.appendChild(this.iframe)}else this.iframe=null;return true}return false}else return true};
a.initialized=function(){return this.pElement()!=null};a.left=function(b){return this.pLeft(b)};a.move=function(b,d){this.pLeft(b);this.pTop(d)};a.name=function(){return this.pName()};a.position=function(b){if(this.pAutoMove())if(this.pElement()&&this.pVisible()){if(typeof b=="undefined"||typeof b.width=="undefined")b=getSize(szPage);this.pElement().style.left=(b.width-this.pElement().offsetWidth)/2+"px";positionElement(this.pElement(),this.pTop());this.pDoFrame()}};
a.show=function(){if(this.pElement()){if(!this.pVisible()){this.pVisible(true);if(this.iframe)this.iframe.style.display="block";this.pElement().style.display="block";if(this.pWithImage())Html.get("imgBack").style.display="block";var b=getSize(szWindow);b=Math.floor((b.height-this.height())/2);this.top()>b&&this.top(Math.min(b,40));if(this.pAutoMove())this.position();else{this.left((winSize.width-this.pElement().offsetWidth)/2);this.top(this.pTop())}this.pElement().scrollIntoView()}}else this.init()&&
this.show()};a.size=function(){return this.pSize()};a.top=function(b){return this.pTop(b)};a.visible=function(){return this.pVisible()};a.width=function(b){if(this.pElement())if(typeof b!="undefined"){this.pElement().style.width=parseInt(b)+"px";this.pDoFrame()}else return this.pElement().offsetWidth};TLightBoxes=function(){this.lightBoxes=[]};TLightBoxes.prototype.anyVisible=function(){for(var b=0;b<this.lightBoxes.length;b++)if(this.lightBoxes[b].visible())return true;return false};
TLightBoxes.prototype.init=function(){for(var b=0;b<this.lightBoxes.length;b++)this.lightBoxes[b].init()};TLightBoxes.prototype.position=function(b){var d=Html.get("imgBack");if(d){if(!this.anyVisible())d.style.display="none";d.style.position="absolute";d.style.zIndex=1E3;d.style.left="0px";d.style.top="0px";d.style.width=b.width+"px";d.style.height=b.height+"px"}for(d=0;d<this.lightBoxes.length;d++)this.lightBoxes[d].position(b)};
