var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
var dialogWin = new Object();
function openDialog(url, width, height)
{
	if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) 
	{
		dialogWin.url = url;
		dialogWin.width = width;
		dialogWin.height = height;
		dialogWin.name = (new Date()).getSeconds().toString()
			
		if (Nav4) 
		{
			dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2)
			dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2)
			var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + ",resizable=no,width=" + dialogWin.width + ",height=" + dialogWin.height
		} 
		else 
		{
			dialogWin.left = (screen.width - dialogWin.width) / 2
			dialogWin.top = (screen.height - dialogWin.height) / 2
			var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",resizable=no,width=" + dialogWin.width + ", statusbar=true, height=" + dialogWin.height
		}
			
		dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr)
	}
	else
		dialogWin.win.focus();
}

function windowOpenCentered(url, popup_win_name, width, height, resizable, scrollbar)
{
	var leftMargin = getLeftMargin(width);
	var topMargin = getTopMargin(height);	
	var win_features = "top=" + topMargin + ",screenY=" + topMargin + ",left=" + leftMargin + ",screenX=" + leftMargin + ",width=" + width + ",height=" + height;
	if(scrollbar)
		win_features += ',scrollbars='+ scrollbar;
	if(resizable)
		win_features += ",resizable=" + resizable;
	window.open(url, popup_win_name, win_features);
}

function getLeftMargin(width)
{
	return (window.screen.availWidth - width)/2;
}

function getTopMargin(height)
{
	return (window.screen.availHeight - height)/2;
}

function popupSecuredSeal() 
{
	sealWin=window.open('https://digitalid.verisign.com/as2/46c6bfcedc27d3ad70699c45391566e9',"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin";
}
