/*nn4 = (document.layers) ? true : false;
ie4 = (document.all) ? true : false;
dom = (document.createTextNode)? true : false;

function popup(fileUrl, winW, winH, winN) {
	var winWidth = (winW)? winW : 540;
	var winHeight = (winH)? winH : 730;
	var winName = (winN)? winN : 'popupWin';
	if (nn4 || ie4 || dom) {
		posX = Math.round((screen.width - winWidth) / 2);
		posY = Math.round((screen.height - winHeight) / 2);
		posCode = (nn4 || dom)? "screenX="+posX+",screenY="+posY : "left="+posX+",top="+posY;
	} else {
		posCode = "";
	}
	var popupWin = window.open(fileUrl, winName,"menubar=no,toolbar=no,scrollbars=no,status=yes,width=" + winWidth + ",height=" + winHeight + "," + posCode);
	if (popupWin) popupWin.focus();
}*/

var bIsIE = (document.all && !window.opera) ? true : false;
function popup (sUrl, iWidth, iHeight, sTitle, sMenubar, sToolbar, sScrollbars, sStatus, sResizeable)
{
	var iWidth	= (iWidth	|| 540)	+ (bIsIE ? 18 : 0);
	var iHeight = iHeight || 730;
	var sTitle	=	sTitle	|| '';

	var sMenubar		= 'no';
	var sToolbar		= 'no';
	var sScrollbars = 'yes';
	var sStatus	= 'yes';
	var sResizeable = 'yes';

	var iLeft = Math.round ((screen.width - iWidth) / 2);
	var iTop = Math.round ((screen.height - iHeight) / 2);

	var oWindow = window.open
		(
			sUrl,
			'',
			'left='				+ iLeft + ', ' +
			'top='				+ iTop + ', ' +

			'width='			+ iWidth + ', ' +
			'height='			+ iHeight + ', ' +

			'menubar='		+ sMenubar + ', ' +
			'toolbar='		+ sToolbar + ', ' +
			'scrollbars=' + sScrollbars + ', ' +
			'status='			+ sStatus + ', ' +
			'resizable='	+ sResizeable
		);

	if (oWindow)
	{
		if (sUrl.match (/\.(gif|jpe?g|png)$/i))
		{
			oWindow.document.open ();
			oWindow.document.write ('<html><head><title>' + sTitle + '</title><style>body{background:#fff;margin:0;padding:0}table{width:100%;height:100%;border:0;border-collapse:collapse}td{padding:0}</style></head><body><table><tr><td align="center"><img src="' + sUrl + '" ' + (sTitle ? 'alt="' + sTitle + '" ' : '') + '/></td></tr></table></body></html>');
			oWindow.document.close ()
		}
		oWindow.focus ();
	}

	return false;
}

