function openWindow(theURL,winName,winWidth,winHeight) {
	var w = (screen.width - winWidth)/2;
	var h = (screen.height - winHeight)/2 - 30;
	var features = 'scrollbars=no,status=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
	exitstat = window.open(theURL,winName,features);
}

function showPopup(n,w,h) {
	var leftPos = 0, topPos = 0;
	var myWidth = 0, myHeight = 0;

	if ( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}

	if (myWidth - w < 0) {
		leftPos = 0;
	} else {
	    leftPos = parseInt((myWidth - w) / 2);
	}

	if (myHeight - h < 0) {
		topPos = 0;
	} else {
	    topPos = parseInt((myHeight - h) / 2);
	}
    
	document.getElementById(n).style.left = leftPos + 'px';
	document.getElementById(n).style.top = topPos + 'px';
	document.getElementById(n).style.width = w +'px';
	document.getElementById(n).style.display = 'block';
}
