function showCoverPane(b_detach_init) { 
	var cvr = document.getElementById("COVER");
	if(cvr.style.background == '') {
		cvr.style.left = 0;
		cvr.style.top = 0;
		if (navigator.appName == "Microsoft Internet Explorer") {
			cvr.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=55)";
			//document.body.scroll = "no";
			//window.scrolling = false;
		} else {
			//document.body.scroll = 'no';
			cvr.style.opacity = .55;
		}
		
	}
	cvr.style.position = "absolute";
	cvr.style.background = "#999999";
	if (!b_detach_init)
		document.onkeydown = function() { if(event.keyCode==13) return false; if(event.keyCode==9) return false;};				
	cvr.style.width = document.body.scrollWidth+"px";
	cvr.style.height = (document.body.scrollHeight * 4 )+"px";
	
	cvr.style.display = "block";
}

function hideCoverPane() { 
	var cvr = document.getElementById("COVER");
	cvr.style.display = "none";
	if (navigator.appName == "Microsoft Internet Explorer") {
		//document.body.style.overflow = "scroll";
		//document.body.scroll = 'yes';
	} else {
		//document.body.scroll = 'yes';		
	}
	//document.getElementById("main_popup_td").innerHTML = "";
	
}

function showPopup(div_id,pivot_id) {
	var obj = null;
	var pivot_obj = document.getElementById(pivot_id);
	var div_obj = document.getElementById(div_id);
	
	obj = pivot_obj;
	var left = null;
	var top = null;
	if (pivot_obj.offsetParent) {
		left = pivot_obj.offsetLeft;
		top = pivot_obj.offsetTop;
		while (obj = obj.offsetParent) {
			left += obj.offsetLeft;
			top += obj.offsetTop;
		}
		
	} else if (pivot_obj.x && pivot_obj.y){
		left = pivot_obj.x;
		top = pivot_obj.y;
	}

	div_obj.style.left = (screen.width/2)-300;
	div_obj.style.top = (screen.height/2) + (document.body.scrollTop) - 300;
	//div_obj.style.width = "760px";
	//div_obj.style.height = "200px";
	//div_obj.style.width = "300px";
	div_obj.style.display = 'block';
	showCoverPane(false);
}

function hidePopup(div_id) {
	var div_obj = document.getElementById(div_id);
	div_obj.style.display = 'none';
	hideCoverPane();
	
}
