// Logon browser and date check routines
//
function fncCheckBrowser() {

    var str_userAgent=navigator.userAgent;
    var str_appName=navigator.appName;
    var str_appVersion=navigator.appVersion;

// setup test conditions  
//  str_userAgent="Safari "
//  str_appName="WebTV"
//  str_appVersion="4.06 (compatible; Windows NT)"
//  alert("userAgent=" + str_userAgent + "\n" + "appName=" + str_appName + "\n" + "appVersion=" + str_appVersion + "\n");

// bypass all browser checking
    	return "OK";

//  Check for webTV    
    if (str_appName.indexOf("WebTV") != -1) {
        return "OK";
    }

//  Check for Netscape6.1    
    if (str_userAgent.indexOf("Netscape6/6.1") != -1) {
        return "OK";
    }

//  Check for Netscape6.2    
    if (str_userAgent.indexOf("Netscape6/6.2") != -1) {
        return "OK";
    }

//  Check for Netscape7
    if (str_userAgent.indexOf("Netscape7") != -1) {
        return "OK";
    }

//  Check for Netscape7
    if (str_userAgent.indexOf("Netscape/7") != -1) {
        return "OK";
    }

//  Check for Safari, if found - bad browser
   if (str_userAgent.indexOf("Safari") != -1) {
      alert("Recommended browsers for Macintosh are: \n\n" + 
    			"   Firefox or \n" +
            "   Netscape 4.06 or greater but not Netscape 6.0 "); 
      return "OK";
    }

//  now, when Safari excluded - 5 anything is good
    if (str_appVersion.charAt(0) == '5') {
	     return "OK";
    }

//  first check if browser 4.0 or greater
    if (str_appVersion.charAt(0) < '4') {
        fncBadBrowser(str_appName, str_userAgent);
        return "BadBrowser";
    }

// cleck 3rd and 4th character of appVersion for subversion
    if (str_appVersion.charAt(2) >= '1') {
        return "OK";
    }

// now we are dealing with 4.0 something or greater
// check that netscape 4 is version 06 or greater
    if (str_appName == "Netscape") {
        if (str_appVersion.charAt(0) == '4') {
            if (str_appVersion.charAt(3) == ' ' || str_appVersion.charAt(3) < '6') {
                fncBadBrowser(str_appName, str_userAgent);
                return "BadBrowser";
            }
        }
    }

    return "OK";                
}
//
function fncBadBrowser(prm_appName, prm_userAgent) {

    alert("Invalid browser.  Browser requirements are: \n\n" + 
            "PC: \n" +
            "   Netscape 4.06 or greater but not Netscape 6.0, or \n" +
            "   Microsoft Internet Explorer 4.0 or greater \n\n" + 
            "Macintosh: \n" +
				"   Firefox or \n" +
            "   Netscape 4.06 or greater but not Netscape 6.0 \n\n" +
            "Please upgrade your browser.");

}




