function centerPopUp( url, name, str ) {
	str += "scrollbars=1,";
	if ( window.screen ) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;

		var xc = ( aw - width ) / 2;
		var yc = ( ah - height ) / 2;

		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}
	window.open( url, name, str );
}

function getbrowserwidth(){
    if (navigator.userAgent.indexOf("MSIE") > 0)
        	{
        		return(document.body.clientWidth);
        	}
    else
            {
           		return window.outerWidth;
           	}
}

function getbrowserheight()
{
	if (navigator.userAgent.indexOf("MSIE") > 0)
      		{
           		return(document.body.clientHeight);
            }
    else
			{
                return(window.outerHeight);
            }
}

var popup = new Object()
function CenterPopup(URL, width, height)


    {
    	// get center of browser window
    	var X = getbrowserwidth() / 2
    	var Y = getbrowserheight() / 2

    	popup = window.open(URL, 'pressPopup',
    		'scrollbars=no' + ' ' +
    		'menubar=0,resizable=1' + ' ' +
    		'width=' + width + ' ' +
    		'height=' + height + ' ' +
    		'top=' + (window.screenTop + (Y - (height/2))) + ' ' +
    		'left=' + (window.screenLeft + (X - (width/2)))
    		)

    	popup.focus();
}


