var sAgent = navigator.userAgent.toLowerCase(); //user agent
var sAppName = navigator.appName; // application
var sAppVersion = navigator.appVersion.toLowerCase();
var iVersion; //version

var bIsIE = false;       /* IE*/
var bIsNS = false;       /* Netscape*/
var bIsIE5 = false;      /* IE 5.0*/
var bIsIE55UP = false;   /* IE 5.0 +*/
var bIsPC = false;       /* is not a mac*/
var bIsMZ = false;       /* Gekco family*/
var bIsMZ13UP = false;   /* Gekco family*/
var bIsOP = false;       /* Opera*/
var bIsSA = false;       /* Safari*/
var bIsSA13UP = false;   /* Safari 1.3*/
var bIsMAC = false;      /* is a mac*/
var bIsKonqueror = (sAgent.indexOf( "konqueror" ) != -1);

  
/*determine if is safari, if is test for version, return;*/
bIsSA = sAgent.indexOf("safari") != -1;
if (bIsSA) {

    var sProdSub = navigator.productSub;
    if (sProdSub>=20030107) bIsSA13UP = true;

} else {
  
    /* if is opera set var and return*/
    bIsOP = sAgent.indexOf("opera") != -1;
    if (!bIsOP) {
      
        /* determine if comp is mac or pc*/
        bIsMAC = sAgent.indexOf("mac")!= -1;
        bIsPC = sAgent.indexOf("win") != -1;

        /* new netscape says the same as IE for app name and the same for agent except
        // it says netscape at the end. check to see if netscape. It's only IE for sure
        // if we're positive its not NS*/
        if(sAgent.indexOf("netscape") > -1 || sAppName.indexOf("Netscape") > -1) bIsNS = true;
        if(!bIsNS && sAppName.indexOf( 'Microsoft' ) > -1) bIsIE = true;

        /* if IE*/
        if (bIsIE) {

            /* get version, test and set vars.*/
            iVersion = parseFloat(sAppVersion.substr(sAppVersion.indexOf('msie')+5,3));
            if (iVersion==5.0) bIsIE5=true;
            else if (iVersion>= 5.5) bIsIE55UP=true;

            /* final IE test. designMode exists in IE5.0 or above. if non existant, not ie*/
            if (bIsPC && !document.designMode) {

                  bIsIE = false;
                  bIsIE5 = false;
                  bIsIE55UP = false;
              
            }
        }

        /* is Netscape*/
        if (bIsNS) {

            /*determine if mozilla*/
            bIsMZ = sAgent.indexOf("gecko") != -1;
            /*Mozilla test for design mode*/
            bIsMZ13UP=(window.document.designMode)?true:false;

        }
        
    }
    
}

function CheckBrowser() { }
