// JavaScript Document
var defaultContent = "<div style='text-align:center; margin-left:20px; width:300px; height:250px'>" +
					"<div class='borderBlue' style='padding:30px; background:url(/images/background/curBodyBG.png) repeat-x scroll 0 0'>" +
						"<div>Please Wait.....</div>" +
						"<img src='/images/display/loading2.gif'>" +
					"</div></div>"
var shtml="<div id='contentWin' style='z-index:2100;display:none;position:absolute;top:150px;left:200px; border:10px #000000 solid;background-color:white; width:400px; height:400px'>" +
					"<div style='text-align:right;background-color: #FFFFFF'><img src='/engine/images/closelabel.gif' style='cursor:pointer' onclick=\"hideShowPopFade('none');\" border=0 alt='Close'></div>" +
					"<div id='contentDiv'>" + defaultContent +	"</div>" +
		    "</div>"
document.write(shtml);


function popupURL(url,xw,xh,param,iframe){	
	//reset the old content
	hideShowPopFade('none');
	if(xh){
		document.getElementById("contentWin").style.height=xh + 'px';
		ixh=xh-30;
	}
	if(xw){
		document.getElementById("contentWin").style.width=xw + 'px';
		ixw=xw-30;
	}
	var myheight = getDScrollHeight() + 90;
	document.getElementById("contentWin").style.top = myheight + 'px';
	var divLeft=getWinWidth()/2-(xw/2);
	
	document.getElementById("contentWin").style.left = divLeft + 'px';
	if (iframe) {
		idiv = document.getElementById('contentDiv')
		idiv.innerHTML = "<iframe src='" + url + "' name='framepop'  width='" + ixw + "' height='" + ixh + "' frameborder='no'></iframe>";
	}
	else {
		if (param) {
			//alert('doAjxPost');
			doAjxPost(url, param, 'contentDiv', false)
		}else { 
			//alert('doAjx');
			doAjx(url, 'contentDiv', false);
		}
	}
	hideShowPopFade('');
}

function getWinWidth(){
	if(navigator.appName.indexOf("Microsoft")==-1){
		return window.innerWidth;	
	}else{
		return document.body.offsetWidth;
	}
}

function getDScrollWidth(){
   var w = window.pageXOffset ||
           document.body.scrollLeft ||
           document.documentElement.scrollLeft;
           
   return w ? w : 0;
} 

function getDScrollHeight()
{
   var h = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;
   return h ? h : 0;
}

function hideShowPopFade(opt){
		var pobj=document.getElementById("disableDiv");
		var pobj2=document.getElementById("contentWin");
		if (opt == "none") {
		document.getElementById("contentDiv").innerHTML = defaultContent;
		}
		pobj2.style.display=opt;
		pobj.style.display=opt;
}
