﻿if(Evt==null){
    var Evt={
        addEvent:function(o, evType, f, capture) {
		    if(o == null) { return false; }
		    if(o.addEventListener) {
			    o.addEventListener(evType, f, capture);
			    return true;
		    } else if (o.attachEvent) {
			    var r = o.attachEvent('on' + evType, f);
			    return r;
		    } else {
			    try{ o['on' + evType] = f; }catch(e){}
		    }
	    }
    };
}

var lightbox={
    show:function(url,w,h,fn){
//        this.bg.style.display='';
//        this.bg.style.width=document.documentElement.offsetWidth+'px';
//        this.bg.style.height=document.documentElement.offsetHeight+'px';
//        this.form.style.display='';
//        this.resizeForm(100,100);
//        this.form.firstChild.src='loading.htm?'+escape(url);
        w=w||520;
        h=h||460;
        fn=fn||'';
        Tant_Modal.Open('loading.htm?'+escape( url),w,h,fn);
    },

    hide:function(){
        this.bg.style.display='none';
        this.form.style.display='none';
        this.form.firstChild.src='about:blank';
    },

    resizeForm:function(w,h){
        var w1=w || this.lbform_width || 100;
        var h1=h || this.lbform_height || 100;
        this.form.style.left=Math.round(document.documentElement.offsetWidth/2-w1/2)+'px';
        this.form.style.top=Math.round(document.documentElement.offsetHeight/2-h1/2)+'px';
        this.form.firstChild.width=w1;
        this.form.firstChild.height=h1;
        this.lbform_width=w1;
        this.lbform_height=h1;
    },

    resize:function(){
        this.bg.style.width=document.documentElement.offsetWidth+'px';
        this.bg.style.height=document.documentElement.offsetHeight+'px';
        this.resizeForm();
    }
};

//Evt.addEvent(window,'load',function(){
//    lightbox.bg=document.body.appendChild(document.createElement('DIV'));
//    lightbox.bg.style.cssText='position:absolute;z-index:99;left:0px;top:0px;background-color:#000000;filter:alpha(opacity=30);opacity:0.3;display:none;';
//    lightbox.form=document.body.appendChild(document.createElement('DIV'));
//    lightbox.form.style.cssText='position:absolute;z-index:100;left:0px;top:0px;background-color:#FFFFFF;border:2px solid #999999;display:none;';
//    lightbox.form.innerHTML='<iframe frameborder="0" scrolling="no"></iframe>';
//    lightbox.resize();
    //lightbox._loaded=true;
//},false);

//Evt.addEvent(window,'resize',function(){if(lightbox._loaded)lightbox.resize();},false);
