var IDS_WIDTH_OFFSET = 30;
var IDS_HEIGHT_OFFSET = 30;
function WBC_isOpenerWindowClosed()
{
	// The implementation doesn't seem to work on all browsers!
	return !(window.top.opener.top && !window.top.opener.top.closed);
}
function WBC_openWindowOnFocus(strURL, strWinTarget, strWinFeatures) 
{

	var pWindow = window.top.open(strURL, strWinTarget, strWinFeatures);
	if (pWindow)
		pWindow.focus();
}
function WBC_refreshWindow()
{
	window.top.history.go(0);
}
function WBC_getPoppedUpWindowFeatures(strWindowFeature, pWindowBasedOn)
{
	var strFeature; 
	
	if (strWindowFeature == "")
	{
		strFeature = WBC_UseDefaultSizing(pWindowBasedOn);
	}
	else 
	{
		strFeature = strWindowFeature;
	}
	return strFeature;
}	
function WBC_UseDefaultSizing(pWindow)
{
	var	lWidth = WBC_getWindowWidth(pWindow);
	var lHeight = WBC_getWindowHeight(pWindow);
	var strFeature;
	var lLeft;
	var lTop;

	if (WBC_isIE())
	{
		// IE case
		lTop = pWindow.screenTop + IDS_HEIGHT_OFFSET;
		lLeft = pWindow.screenLeft + IDS_WIDTH_OFFSET;
		
		strFeature = "left=" + lLeft + ",top=" + lTop + ",width=" + lWidth + ",height=" + lHeight + ",resizable,scrollbars,status=yes";
	}
	else
	{
		// Netscape case	
		lTop = pWindow.screenY + IDS_HEIGHT_OFFSET;
		lLeft = pWindow.screenX + IDS_WIDTH_OFFSET;
		strFeature = "screenX=" + lLeft + ",screenY=" + lTop + ",outerWidth=" + lWidth + ",outerHeight=" + lHeight + ",resizable,scrollbars,status=yes";
	}

	return strFeature;
}
function WBC_getWindowWidth(pWin)
{
	if (WBC_isIE()) 
	{
		return pWin.document.body.clientWidth;
	} 
	else if (WBC_isNetscape()) 
	{
		return pWin.outerWidth;
	}
}
function WBC_getWindowHeight(pWin)
{
	if (WBC_isIE()) 
	{
		return pWin.document.body.clientHeight;
	} 
	else if (WBC_isNetscape()) 
	{
		return pWin.outerHeight;
	}
}