LITBox=Class.create();LITBox.prototype={initialize:function(b){this.mes=b;this.reload=false;this.options=Object.extend({width:600,height:500,type:"window",func:null,draggable:true,resizable:true,overlay:true,opacity:1,left:false,top:false},arguments[1]||{});this.setup()},setup:function(){this.rn=(Math.floor(Math.random()*100000000+1));this.getWindow();switch(this.options.type){case"window":this.d4.innerHTML=this.getAjax(this.mes);break;case"iframe":this.iframe=document.createElement("iframe");this.iframe.src=this.mes;this.iframe.className="LB_iframe";this.iframe.frameBorder="0";this.d4.appendChild(this.iframe);break;case"alert":x=document.createElement("div");x.className="alert_content";x.style.padding="40px 10px 10px 10px";x.style.fontSize="17px";x.style.color="#41090D";x.style.textAlign="center";x.appendChild(document.createTextNode(this.mes));this.d4.appendChild(x);break;case"confirm":this.d4.innerHTML="<p>"+this.mes+"</p>";this.button_y=document.createElement("input");this.button_y.type="button";this.button_y.value="Yes";this.d4.appendChild(this.button_y);this.button_y.d=this.d;this.button_y.d2=this.d2;this.button_y.temp=this.options.func;this.button_y.onclick=this.remove;this.button_n=document.createElement("input");this.button_n.type="button";this.button_n.value="No";this.d4.appendChild(this.button_n);this.button_n.d=this.d;this.button_n.d2=this.d2;this.button_n.onclick=this.remove}this.display()},getWindow:function(){this.over=null;if(this.options.overlay==true){this.d=document.createElement("div");document.body.appendChild(this.d);this.d.className="LB_overlay";this.d.id="LB_overlay_id";this.d.style.display="block"}this.d2=document.createElement("div");document.body.appendChild(this.d2);this.d2.className="LB_window";this.d2.style.height=parseInt(this.options.height)+"px";this.d3=document.createElement("div");this.d2.appendChild(this.d3);this.d3.className="LB_closeAjaxWindow";this.d3.d2=this.d2;this.d3.over=this.over;this.d3.options=this.options;this.close=document.createElement("a");this.d3.appendChild(this.close);this.close.d=this.d;this.close.d2=this.d2;this.close.onclick=this.remove;this.close.href="#";this.close.innerHTML="[x]";this.close.id="litebox_close_button";this.d4=document.createElement("div");this.d4.className="LB_content";this.d4.style.height=parseInt(this.options.height)-0+"px";this.d4.style.width=parseInt(this.options.width)+"px";this.d2.appendChild(this.d4);this.clear=document.createElement("div");this.d2.appendChild(this.clear);this.clear.style.clear="both";if(this.options.resizable){this.d5=document.createElement("div");this.d2.appendChild(this.d5);this.d5.className="LB_resize";this.d5.d2=this.d2;this.d5.d2.d4=this.d4;this.d5.over=this.over;this.d5.options=this.options}if(this.options.overlay==true){this.d.d=this.d;this.d.d2=this.d2}},display:function(){this.hideElements();Element.setOpacity(this.d2,0);this.position();new Effect.Opacity(this.d2,{from:0,to:this.options.opacity,duration:0.5})},hideElements:function(){$$("object, embed").each(function(a){a.addClassName("hidden-element")})},showElements:function(){$$("object.hidden-element, embed.hidden-element").each(function(a){a.removeClassName("hidden-element")})},position:function(){var h=document.documentElement;var g=self.innerWidth||(h&&h.clientWidth)||document.body.clientWidth;var i=self.innerHeight||(h&&h.clientHeight)||document.body.clientHeight;if(window.innerHeight&&window.scrollMaxY){yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){yScroll=document.body.scrollHeight}else{yScroll=document.body.offsetHeight}}this.d2.style.width=this.options.width+"px";this.d2.style.display="block";this.d2.style.left=((g-this.options.width)/2)+"px";var j=this.getPageSize();var f=this.getPageScrollTop();if(this.d2.offsetHeight>i-10){this.d2.style.height=i-20+"px";this.d2.style.top=(f[1]+((j[1]-this.d2.offsetHeight)/2))+"px";this.d2.style.overflowY="auto";this.d2.style.overflowX="hidden"}else{this.d2.style.top=(f[1]+((j[1]-this.d2.offsetHeight)/2))+"px"}if(this.d){this.d.style.height=yScroll+"px"}},remove:function(){if(this.temp){this.temp()}new Effect.Opacity(this.d2,{from:1,to:0,duration:0.5});if(this.d){new Effect.Opacity(this.d,{from:0.6,to:0,duration:0.5});Element.remove(this.d)}Element.remove(this.d2);if(this.reload){this.reload=false;window.location.reload()}else{if(typeof(personal_litbox)!="undefined"){if(personal_litbox.reload){personal_litbox.reload=false;window.location.reload()}}}showLBelements();return false},removeWithReload:function(){this.remove();window.location.reload()},parseQuery:function(m){var l=new Object();if(!m){return l}var i=m.split(/[;&]/);for(var n=0;n<i.length;n++){var j=i[n].split("=");if(!j||j.length!=2){continue}var h=unescape(j[0]);var k=unescape(j[1]);k=k.replace(/\+/g," ");l[h]=k}return l},getPageScrollTop:function(){var b;if(self.pageYOffset){b=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){b=document.documentElement.scrollTop}else{if(document.body){b=document.body.scrollTop}}}arrayPageScroll=new Array("",b);return arrayPageScroll},getPageSize:function(){var f=document.documentElement;var e=self.innerWidth||(f&&f.clientWidth)||document.body.clientWidth;var d=self.innerHeight||(f&&f.clientHeight)||document.body.clientHeight;arrayPageSize=new Array(e,d);return arrayPageSize},getAjax:function(url){var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
      // JScript gives us Conditional compilation, we can cope with old IE versions.
      // and security blocked creation of the objects.
        try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
         try {
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
         } catch (E) {
          xmlhttp = false;
         }
        }
      @end @*/
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){xmlhttp=new XMLHttpRequest()}if(xmlhttp.overrideMimeType){xmlhttp.overrideMimeType("text/xml")}if(url!=""){xmlhttp.open("GET",url,false);xmlhttp.send(null);return xmlhttp.responseText}},resize:function(c,d){this.d2.style.width=c+"px";this.d2.style.height=d+"px";this.d4.style.width=c+"px";this.d4.style.height=d+"px";this.options.width=c;this.options.height=d;this.position()}};function showLBelements(){$$("object.hidden-element, embed.hidden-element").each(function(a){a.removeClassName("hidden-element")})};