// ****************************************************************************

//
// $Id: client-sniffer.js, v. 1.0 2002/05/03 3:32 PM aselimovic Exp $
//

// get information about the version of Navigator in use
function Is() {
   // convert all characters to lowercase to simplify testing 
   var agt = navigator.userAgent.toLowerCase();

   this.major = parseInt(navigator.appVersion);
   this.minor = parseFloat(navigator.appVersion);

   // allow spoofing here
   this.nav = ((agt.indexOf("mozilla") != -1) && (agt.indexOf("compatible") == -1));
   this.nav3 = (this.nav && (this.major == 3));
   this.nav4 = (this.nav && (this.major == 4));
   this.nav4up = (this.nav && (this.major >= 4));
   this.nav5 = (this.nav && (this.major == 5));
   this.nav5up = (this.nav && (this.major >= 5));

   this.ie = (agt.indexOf("msie") != -1);
   this.ie3 = (this.ie && (this.major < 4));
   // this code needs to be updated for newer browser versions 
   this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0") == -1));
   this.ie4up = (this.ie && (this.major >= 4));
   this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0") != -1));
   this.ie5up = (this.ie && !this.ie3 && !this.ie4);
   this.ie6 = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.0") != -1));
   this.ie6up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5);
   this.ie7 = (this.ie && (this.major == 4) && (agt.indexOf("msie 7.0") != -1));
   this.ie7up = (this.ie && (this.minor >= 7));

   if (this.nav3) { this.js = 1.1 }
   else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) { this.js = 1.2 }
   else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) { this.js = 1.3 }
   else if ((this.nav5)) { this.js = 1.5 }
   // this code needs to be updated for newer browser versions
   else if (this.nav && (this.major > 5)) { this.js = 1.5 }
   else if (this.ie && (this.major > 5)) { this.js = 1.3 }
   // no idea for other browsers; always check for JS version with > or >=
   else { this.js = 0.0 }

   this.win = ((agt.indexOf("win") != -1) || (agt.indexOf("16bit") != -1));
   this.linux = (agt.indexOf("inux") != -1);
   this.win95 = ((agt.indexOf("win95") != -1) || (agt.indexOf("windows 95") != -1));
   this.win98 = ((agt.indexOf("win98") != -1) || (agt.indexOf("windows 98") != -1));
   this.winnt = ((agt.indexOf("winnt") != -1) || (agt.indexOf("windows nt") != -1));
}

var is = new Is();