IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

var agt=navigator.userAgent.toLowerCase();
var is_mac    = (agt.indexOf("mac")!=-1);

var newWin

function popup(loc, name, width, height) {
        var _params = "width="+width+",height="+height+",resizable=no,menubar=no,scrollbars=yes,status=no";

	if (typeof(newWin) != "undefined")
	{
		if (newWin.closed) openWindow = true;
		else newWin.focus();

	}	else openWindow = true;

	if (openWindow || NS) 	{

		// alert ('opening')

        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width) >>1 ) - width/2
                 _top = ( (screen.height/2) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;

        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        newWin = window.open(loc, name, _params);


	}
//        if ( newWin!=null && !(IE && bVer<5) )
//                newWin.focus();
//                // MSIE4 DOESN'T FOCUS WINDOWS
}
