function display_div_popup(show,resize,url,url_params,height,width){
	if ( resize == true )
		resize_div_popup();
	var div_popup_bg = document.getElementById("div_popup_bg");
	var div_popup_msg = document.getElementById("div_popup_msg");
	if ( show == true ){
		div_popup_msg.innerHTML='<img src="/IMAGE/animated_gifs/loading.gif" border="0" />';
		div_popup_bg.style.visibility="visible";	
		div_popup_msg.style.visibility="visible";
		if (width!='')
			div_popup_msg.style.width=width+"px";
		if (height!='')
			div_popup_msg.style.height=height+"px";
		var left_pos=(parseInt(div_popup_bg.offsetWidth)-parseInt(div_popup_msg.offsetWidth))/2;
		left_pos = (left_pos + document.body.scrollLeft);
		div_popup_msg.style.left=left_pos+"px";
		ajax_get_html(url, "div_popup_msg", url_params);	
	}else{
		div_popup_bg.style.width="0px";
		div_popup_bg.style.height="0px";
		div_popup_bg.style.visibility="hidden";
		div_popup_msg.style.visibility="hidden";
		div_popup_msg.innerHTML='<img src="/IMAGE/animated_gifs/loading.gif" border="0" />';
	}
	div_popup_msg.style.top="60px";
}

function resize_div_popup(){
	var arrayWindowSize = getPageSize();
	var div_popup_bg = document.getElementById("div_popup_bg");
	var div_popup_msg = document.getElementById("div_popup_msg");
	div_popup_bg.style.width=arrayWindowSize[0]+"px";
	div_popup_bg.style.height=arrayWindowSize[1]+"px";
	var left_pos=(parseInt(div_popup_bg.offsetWidth)-parseInt(div_popup_msg.offsetWidth))/2;
	left_pos = (left_pos + document.body.scrollLeft);
	div_popup_msg.style.left=left_pos+"px";
}

// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.com
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

//	console.log("xScroll " + xScroll)
//	console.log("windowWidth " + windowWidth)

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
//	console.log("pageWidth " + pageWidth)

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
//	alert(pageWidth+", "+pageHeight+", "+windowWidth+", "+windowHeight);
	return arrayPageSize;
}