LITBox=Class.create();LITBox.prototype={
  initialize:function(a){
    this.mes=a;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(i){
      i.addClassName('hidden-element')
    })
  },
  showElements:function(){
    $$('object.hidden-element, embed.hidden-element').each(function(i){
      i.removeClassName('hidden-element')
    })
  },
  position:function(){
    var e=document.documentElement;var a=self.innerWidth||(e&&e.clientWidth)||document.body.clientWidth;var d=self.innerHeight||(e&&e.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=((a-this.options.width)/2)+"px";var c=this.getPageSize();var b=this.getPageScrollTop();if(this.d2.offsetHeight>d-10){
      this.d2.style.height=d-20+"px";this.d2.style.top=(b[1]+((c[1]-this.d2.offsetHeight)/2))+"px";this.d2.style.overflowY="auto";this.d2.style.overflowX="hidden"
      }else{
      this.d2.style.top=(b[1]+((c[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(d){
    var e=new Object();if(!d){
      return e
      }var a=d.split(/[;&]/);for(var c=0;c<a.length;c++){
      var g=a[c].split("=");if(!g||g.length!=2){
        continue
      }var b=unescape(g[0]);var f=unescape(g[1]);f=f.replace(/\+/g," ");e[b]=f
      }return e
    },
  getPageScrollTop:function(){
    var a;if(self.pageYOffset){
      a=self.pageYOffset
      }else{
      if(document.documentElement&&document.documentElement.scrollTop){
        a=document.documentElement.scrollTop
        }else{
        if(document.body){
          a=document.body.scrollTop
          }
        }
      }arrayPageScroll=new Array("",a);return arrayPageScroll
    },
  getPageSize:function(){
    var c=document.documentElement;var a=self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;var b=self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;arrayPageSize=new Array(a,b);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(b,a){
    this.d2.style.width=b+"px";this.d2.style.height=a+"px";this.d4.style.width=b+"px";this.d4.style.height=a+"px";this.options.width=b;this.options.height=a;this.position()
    }
  };

 function showLBelements(){
     $$('object.hidden-element, embed.hidden-element').each(function(i){
      i.removeClassName('hidden-element')
    })
 }