function showPopUp(title, body, width) {
	
	var doc = (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
	var e_popUp = document.getElementById("PopUp");
	e_popUp.innerHTML = body;
	
	if(width) e_popUp.style.width = width + 'px';

	var dimensions = getWindowDimensions();
	var width = dimensions[0];
	var height = dimensions[1];
	
	e_popUp.style.visibility="hidden";
	e_popUp.style.display="block";
	e_popUp.style.left = (width - e_popUp.offsetWidth)/2 + 'px';
	var top = (height - e_popUp.offsetHeight)/2 + doc.scrollTop;
	if(top < 15) top = 15;
	
	e_popUp.style.top = top + 'px';
	
	// Create and show the BodyCover
	if(!document.getElementById('BodyCover')) {
		var cover = document.createElement('div');
		cover.id = 'BodyCover';
		document.body.appendChild(cover);
	}
	else cover = document.getElementById('BodyCover');
	
	if(get("Page"))
		cover.style.height = get('Page').offsetHeight + 'px';
	else
		cover.style.height = '100%';
		
	e_popUp.style.visibility="visible";
	if(get("ToolTip")) get("ToolTip").style.display = "none";
}


function closePopUp() {
	if(get('PopUp') && get('PopUp').style.display == 'block') {	 
		get("PopUp").style.display="none";
		document.body.removeChild(get('BodyCover'));
	}
}

function getWindowDimensions() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return new Array(myWidth,myHeight);
}
