function getscreenwidth()
{
	if (navigator.userAgent.indexOf("MSIE") > 0)
    	{
    		return(self.screen.width);
    	}
    else
        {
        		return(self.screen.width);
        	}
}

function getscreenheight()
{
	if (navigator.userAgent.indexOf("MSIE") > 0)
    	{
    		return(self.screen.height);
    	} 
    else
        {
        		return(self.screen.height);
       	}
}


function CenterPopup(windowname,URL, width, height)
{
	// get center of browser window
	var x = (getscreenwidth() / 2)-(width/2)
	var y = (getscreenheight() / 2)-(height/2)
	 //alert('getscreenwidth()='+getscreenwidth()+'\ngetscreenheight()='+getscreenheight()+'\nx='+x+'\ny='+y)
	//alert('x='+x+'\ny='+y)
	if (!(navigator.userAgent.indexOf("MSIE") > 0))
	{
	width=width+0
	height=height+7
	}
                    	
	popup = window.open(URL, windowname,'statusbar=no,scrollbars=yes,width=' + width +',height=' + height + ',top=' + x +',left='+y)
                    	
	popup.focus()
}

