function openWindow (targetURL, WinW, WinH, windowstyle, iTarget)
{
	WinW = (WinW ? parseFloat(WinW) : 750);
	WinH = (WinH ? parseFloat(WinH) : 550);

	if (WinH < 1 && WinH > 0) { WinH = Math.round((screen.height * WinH), 0); };

	if (WinW < 1 && WinW > 0) { WinW = Math.round((screen.width * WinW), 0); };

	var screenW = 800
	var screenH = 600;
	var posTop = 5
	var posLeft = 5

	if (parseInt(navigator.appVersion) >= 4)
	{
		screenW = screen.width;
		screenH = screen.height;

/*		if (WinH > 600 && screenH - WinH > 0)
			posTop = Math.round((screenH - WinH) * 0.1, 0)
		else if (screenH - WinH > 0)
			posTop = Math.round((screenH - WinH) * 0.4, 0)
*/

		posTop = 25


		if (screenW - WinW > 0)
			posLeft = Math.round((screenW - WinW) * 0.5, 0)
	};

	var param = 'width=' + WinW + ',height=' + WinH + ',left=' + posLeft + ',screenX=' + posLeft + ',top=' + posTop + ',screenY=' + posTop + ',resizable=1,scrollbars=1'

	if (!iTarget) { iTarget = rand_name(); }

	if (windowstyle)
		param += ',' + windowstyle

	if (document.WR)
	{
		document.WR.close();
// 		document.WR.moveTo(posLeft, posTop);
// 		document.WR.resizeTo(WinW, WinH);
// 		document.WR.location.replace( targetURL);
	}

	document.WR = window.open(targetURL, iTarget, param);
	if (window.focus && document.WR)document.WR.focus();

	return false;
}






function rand_name ()
{
	var foo = Math.round(Math.random() * 1000000);
	return "cnfrm" + foo
}

