var UA = new Browser();

function Browser()
{
    this.UAstr   = '' + navigator.userAgent;
    this.appVsn  = parseFloat(navigator.appVersion,10);

    this.isMac   =  (this.UAstr.indexOf("Mac")  != -1);

    this.isIE    =  (this.UAstr.indexOf("MSIE") != -1);
    this.isNC    =  (navigator.appName == "Netscape");
    this.isAOL   =  (this.UAstr.indexOf("AOL")  != -1);
    this.AOLvsn  =  (this.isAOL) ? parseFloat(this.UAstr.substring(this.UAstr.indexOf("AOL") + 3),10) : parseInt("X");

    this.isIE4   =  (this.isIE && this.appVsn >= 4);	/* *** NOTE *** These variables specify  */
    this.isIE5   =  (this.isIE && this.appVsn >= 5);	/*  is the UA is (eg) IE4 _or above_     */
    //block this piece of code as to detect NC4 and NC6 a different method for browser sensing will be used
    //this.isNC4   =  (this.isNC && this.appVsn >= 4);	/*  not _solely_ that version. To detect */
    this.isMoz   =  (this.isNC && this.appVsn >= 5);	/*  (eg) IE4 _alone_, then you must test */
    //this.isNC6   =  (this.isNC && this.appVsn >= 5);	/*  for (isIE4 && !isIE5)  Note no isNC5 */

    //Beginning of code to detect Mozilla and Netscape

    this.isNC4   =  (this.isNC && (document.layers)) ? true : false;
    this.isNC6   =  this.isNC && (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

    //this.NCVersn =  parseFloat(this.UAstr.substring(this.UAstr.indexOf("Netscape6") + 10),10);

    this.strtPos =  this.UAstr.indexOf("Netscape6") + 10;
    this.NCVersn =  parseFloat(this.UAstr.substring(this.strtPos,this.UAstr.length),10);

    this.isNC6v2 =  (this.isNC && this.NCVersn >= 6.2);

    this.isMozl  =  this.isNC && this.appVsn >= 5 && !this.isNC6;

    //end of code modification

    this.doesCSS =  (this.isIE4 || this.isNC4 || (this.isAOL && this.AOLvsn >= 4));
    this.doesDOM =  (this.isIE4 || this.isMoz);
    this.doesXML = ((this.isIE  || this.isNC) && this.appVsn >= 5);

    var forceAllow = (document.cookie.indexOf("Force_MSEC2_Access") != -1);
    // specifically don't allow version 3 of either browser
    if (this.appVsn > 3 ) {
	this.allow  =  (forceAllow || this.isIE4 || this.isNC6 || (this.isAOL && this.AOLvsn >= 4));
    }
}

function putwin(filename, width, height, winName, isScroll)
{
    var undefined;

    var features = "width=" + width + ",height=" + height;
    features += ",menubar=0,toolbar=0,location=0,directories=0,status=0,resizable=1,hotkeys=0";
    if ('' + isScroll == "true")
    {
	features += ",scrollbars=1";
    } else {
	features += ",scrollbars=0";
    }

    eval(winName + '= window.open("' + filename + '","' + winName + '","' + features + '")');

    eval(winName + '.resizeTo(width, height)');

    if (!(UA.isIE && UA.isMac))
    {
	// Try to focus it
	if (('' + window.focus) != "undefined" && ('' + window.focus) != '') 
	{
	    eval(winName + '.focus()');
	}
    }
}
