// JavaScript Document
function openWindow(url, name, x, y, width, height, params)
{
var bName = navigator.appName;
var bVer = parseFloat(navigator.appVersion);
	var bNetscape = (bName.indexOf("Netscape") != -1 && bVer < 5) ? true : false;

	if (name != null) name = name.replace(/ /g,"");

	if (!isNaN(x) && x > 0) params += (bNetscape) ? ",screenX=" + x : ",left=" + x;
	if (!isNaN(y) && y > 0) params += (bNetscape) ? ",screenY=" + y : ",top=" + y;
	if (!isNaN(width) && width > 0) params += (bNetscape) ? ",innerWidth=" + width : ",width=" + width;
	if (!isNaN(height) && height > 0) params += (bNetscape) ? ",innerHeight=" + height : ",height=" + height;
	if (params != null && params.charAt(0) == ",") params = params.substring(1);

	var win = window.open(url, name, params);
	if (win) win.focus();
}
function handleWindow(destUrl, doOpener, doClose, doFocus, name, x, y, width, height, params)
{
	if (doOpener != null && doOpener == "1")
	{
		// URL in opener
		if ((top.opener != null) && (typeof top.opener.closed == 'boolean') && (top.opener.closed == false)) // at least IE does not set opener to null if closed
		{
			top.opener.location.href = destUrl;

			if (doFocus != null && doFocus == "1")
			{
				top.opener.focus();
			}

			if (doClose != null && doClose == "1")
			{
				top.close();
			}
		}
		else
		{
			openWindow(destUrl);
			// openWindow(destUrl, name, x, y, width, height, params);

			if (doClose != null && doClose == "1")
			{
				top.close();
			}

			// ignore doFocus
		}
	}
	else
	{
		// URL in this window or new window
		if (name != null || params != null)
		{
			openWindow(destUrl, name, x, y, width, height, params);

			if (doClose != null && doClose == "1")
			{
				top.close();
			}

			// ignore doFocus
		}
		else
		{
			window.location.href = destUrl;
			// ignore doClose
			// ignore doFocus
		}
	}
}