function SetPosPopup() {
	div = document.getElementById('DIV_LOADING');
	tbl = document.getElementById('TBL_LOADING');
	span = document.getElementById('TBL_SPAN');
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		WinW = window.innerWidth;
		WinH = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		WinW = document.documentElement.clientWidth;
		WinH = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		WinW = document.body.clientWidth;
		WinH = document.body.clientHeight;
	}
	
	div.style.width = WinW+"px";
	div.style.height = WinH+"px";
	
	var WinT = document.body.scrollTop;
	if (WinT == 0) {
		if (window.pageYOffset)
			WinT = window.pageYOffset;
		else
			WinT = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	WinL = (document.body.offsetWidth / 2) - (span.offsetWidth / 2);;
//	WinT = 0;
	div.style.top = WinT + "px";
	tbl.style.left = WinL + "px";
}

function Popup() {
	document.body.style.overflow = "hidden"
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		WinW = window.innerWidth;
		WinH = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		WinW = document.documentElement.clientWidth;
		WinH = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		WinW = document.body.clientWidth;
		WinH = document.body.clientHeight;
	}
	
	var WinT = document.body.scrollTop;
	if (WinT == 0) {
		if (window.pageYOffset)
			WinT = window.pageYOffset;
		else
			WinT = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	
	div = document.getElementById('DIV_LOADING');
	tbl = document.getElementById('TBL_LOADING');
	span = document.getElementById('TBL_SPAN');
	
	div.style.width = WinW+"px";
	div.style.height = WinH+"px";
	div.style.top = WinT + "px";
	div.style.display = "";
	
	WinL = (document.body.offsetWidth / 2) - (span.offsetWidth / 2);;
	tbl.style.top = "25px";
	tbl.style.left = WinL + "px";
}

function HidePopup() {
	document.body.style.overflow = ""
	div = document.getElementById('DIV_LOADING');
	div.style.display = "none";
}

function PopupGoto(action, width, height) {
	span = document.getElementById('TBL_SPAN');
	var src="/index.php?action="+action;
	span.innerHTML = "<iframe class='IPopup' src='"+src+"' frameborder='0' scrolling='auto' id='IPopUp' height='"+height+"' width='"+width+"' style='background: #FFFFFF'></iframe>";
	Popup();
	
}
