function OpenPopUp(sURL, sPopupTitle, bIsMenuBar, bIsScrollbars, bIsToolbar, bIsResizable, bIsCentered, iWindowLeft, iWindowTop, iWindowHeight, iWindowWidth)
{
	var oWindow;
	var sExt;
	var iTop;
	var iLeft;
	var iWidth;
	var iHeight;
	
	if (isEmpty(iWindowWidth)) {iWindowWidth = 800;}
	
	if (isEmpty(iWindowHeight)) {iWindowHeight = 600;}
	
	if (isEmpty(bIsCentered)) {bIsCentered = true;}
	
	if (isEmpty(bIsToolbar)) {bIsToolbar = false;}
	
	if (isEmpty(bIsScrollbars)) {bIsScrollbars = true;}
	
	if (isEmpty(bIsMenuBar)) {bIsMenuBar = false;}
	
	if (isEmpty(bIsResizable)) {bIsResizable = true;}
	
	if (bIsCentered)
	{
		iWidth = Math.round(iWindowWidth);
		iHeight = Math.round(iWindowHeight);				
		
		iLeft = Math.round((window.screen.width - iWindowWidth) / 2);
		iTop = Math.round((window.screen.height - iWindowHeight) / 2);
	}
	else
	{
		iWidth = iWindowWidth;
		iHeight = iWindowHeight;				
			
		iLeft = iWindowLeft;
		iTop = iWindowTop;
	}

	if (bIsToolbar) {sExt = "toolbar=yes,";}
	else {sExt = "toolbar=no,";}

	if (bIsScrollbars) {sExt = sExt + "scrollbars=yes,";}
	else {sExt = sExt + "scrollbars=no,";}

	if (bIsMenuBar) {sExt = sExt + "directories=yes,";}
	else {sExt = sExt + "directories=no,";}

	if (bIsMenuBar) {sExt = sExt + "menubar=yes,";}
	else {sExt = sExt + "menubar=no,";}
	
	if (bIsResizable) {sExt = sExt + "resizable=yes,";}
	else {sExt = sExt + "resizable=no,"}
	

	sExt = sExt + "width=" + iWidth + ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft;

	oWindow = window.open(sURL, sPopupTitle, sExt);

	if(oWindow != null)
	{
		oWindow.focus();
	}
}

function isEmpty(s)
{   return (s == null);
}