﻿var d = document;
var isOpera = false;

var bufer_ifrm_obj={};

function gebi(id) {return d.getElementById(id);}

function iframe_popup(name,id,w,h,scr)
{
	var all_h, all_w;
	if (window.innerHeight) all_h=window.innerHeight;
	else all_h=window.document.body.clientHeight;
	if (window.innerWidth) all_w=window.innerWidth;
	else all_w=window.document.body.clientWidth;
	this.ifrm=d.createElement("DIV");
	this.ifrm.cssText = "position:absolute;display:none;z-index:255";
	this.ifrm.innerHTML="<iframe class=ifrm_popup src="+name+" id=id_"+id+" style=\"position: absolute;left:"+(all_w-w)/2+"px;top:"+(all_h-h)/2+"px;width:"+w+";height:"+h+";z-index:255;\" scrolling="+scr+" frameborder=0>";
	this.ifrm.style.display = "none";
	this.show=ifrm_show;
	this.hide=ifrm_hide;
	this.is_show=ifrm_is_show;
	this.place=window.document.body;
	this.place.appendChild(this.ifrm);
	this.ifrm.style.display = "";
}

function iframe_popup_html(name,id,w,h,scr)
 {
 var all_h, all_w;
 if (window.innerHeight) all_h=window.innerHeight;
 else all_h=window.document.body.clientHeight;
 if (window.innerWidth) all_w=window.innerWidth;
 else all_w=window.document.body.clientWidth;
 this.ifrm=d.createElement("DIV");
 this.ifrm.cssText = "position:absolute;display:none;z-index:255";
 this.ifrm.innerHTML="<iframe class=ifrm_popup id=id_"+id+" style=\"left:"+(all_w-w)/2+"px;top:"+(all_h-h)/2+"px;width:"+w+";height:"+h+";z-index:255;\" scrolling="+scr+" frameborder=0>";
 this.ifrm.style.display = "none";
 this.show=ifrm_show;
 this.hide=ifrm_hide;
 this.is_show=ifrm_is_show;
 this.place=window.document.body;
 this.place.appendChild(this.ifrm);
 frames["id_"+id].document.innerHTML = name;
 this.ifrm.style.display = "";
}

function ifrm_show(){this.ifrm.style.display="block";}
function ifrm_hide(){this.ifrm.style.display="none";}
function ifrm_is_show(){return (this.ifrm.style.display=="block") ? 1 : 0;}
function ifrm_get(name,id,w,h,scr)
{
	if(typeof(bufer_ifrm_obj[id])=='undefined') bufer_ifrm_obj[id]=new iframe_popup(name,id,w,h,scr);
	return bufer_ifrm_obj[id];
}

function ifrm_get_html(name,id,w,h,scr)
{
         if(typeof(bufer_ifrm_obj[id])=='undefined') bufer_ifrm_obj[id]=new iframe_popup(name,id,w,h,scr);
         return bufer_ifrm_obj[id];
}

function kill(id){
	delete(bufer_ifrm_obj[id]);
}
function summon_ifrm(id,name,w,h,scr)
{
	var area=ifrm_get(name,id,w,h,scr);
	if (area.is_show()) {area.hide();disable_page(false);}
	else {area.show();disable_page(true);}
}

function summon_ifrm_html(id,name,w,h,scr)
{
        var area=ifrm_get_html(name,id,w,h,scr);
        if (area.is_show()) {area.hide();disable_page(false);}
        else {area.show();disable_page(true);}
}

function disable_page(flag)
{
	if (window.innerHeight) all_h=window.innerHeight;
	else all_h=window.document.body.clientHeight;
	if(flag){
		if(!isOpera) gebi("desable_p").style.backgroundColor="#FFFFFF";
		gebi("desable_p").style.display="";
		gebi("desable_p").style.height=all_h;
	} else {
		gebi("desable_p").style.display="none";
		gebi("desable_p").style.height=0;
	}
}


if (typeof(incPointsLoaded) == "function") incPointsLoaded('summon_iframe_script');

// JScript File

