function isMsie4orGreater() { 
  var ua = window.navigator.userAgent; var msie = ua.indexOf ("MSIE");
  if (msie > 0) {
    return (parseInt (ua.substring (msie+5, ua.indexOf (".", msie))) >= 4)   
      && (ua.indexOf ("MSIE 4.0b") <0); }
  else {return false; }}


function checkIE4(){
 var re = /.*(MSIE 4\.).*/;
 re.exec(navigator.userAgent);
 var ver = RegExp.$1;
 if (ver == "") {
  return false;
 } else {
  return true;
 }
}
function checkIE(inputData){
if (inputData == '4'){
 var re = /.*(MSIE 4\.).*/;
}
if (inputData == '5'){
 var re = /.*(MSIE 5\.0).*/;
}
 re.exec(navigator.userAgent);
 var ver = RegExp.$1;
 if (ver == "") {
  return false;
 } else {
  return true;
 }
}
function browserVersion() {
 var agt = navigator.userAgent.toLowerCase();
 this.major = parseInt(navigator.appVersion);
 this.minor = parseFloat(navigator.appVersion);
 this.nav    = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
 this.nav4up = this.nav && (this.major >= 4);
 this.navonly = (this.nav && (agt.indexOf(";nav") != -1));
 this.gecko = (agt.indexOf("gecko") != -1);
 this.ie     = (agt.indexOf("msie") != -1);
 this.ie4 = this.ie && (checkIE4() == true);
 this.ie4and5= this.ie && (checkIE('4') == true || checkIE('5') == true);
 this.ie4up  = this.ie  && (this.major >= 4);
 this.opera = (agt.indexOf("opera") != -1);
 this.ver4up = (this.ie4up || this.nav4up );
// os
 this.mac = (agt.indexOf("mac")!=-1);
    this.sun   = (agt.indexOf("sunos")!=-1);
    this.sun4  = (agt.indexOf("sunos 4")!=-1);
    this.sun5  = (agt.indexOf("sunos 5")!=-1);
    this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
    this.irix  = (agt.indexOf("irix") !=-1);    // SGI
    this.irix5 = (agt.indexOf("irix 5") !=-1);
    this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    this.hpux  = (agt.indexOf("hp-ux")!=-1);
    this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
    this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
    this.aix   = (agt.indexOf("aix") !=-1);      // IBM
    this.aix1  = (agt.indexOf("aix 1") !=-1);    
    this.aix2  = (agt.indexOf("aix 2") !=-1);    
    this.aix3  = (agt.indexOf("aix 3") !=-1);    
    this.aix4  = (agt.indexOf("aix 4") !=-1);    
    this.linux = (agt.indexOf("inux")!=-1);
    this.sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    this.unixware = (agt.indexOf("unix_system_v")!=-1); 
    this.mpras    = (agt.indexOf("ncr")!=-1); 
    this.reliant  = (agt.indexOf("reliantunix")!=-1);
    this.dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    this.sinix = (agt.indexOf("sinix")!=-1);
    this.freebsd = (agt.indexOf("freebsd")!=-1);
    this.bsd = (agt.indexOf("bsd")!=-1);
    this.unix  = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux || 
                 this.sco ||this.unixware || this.mpras || this.reliant || 
                 this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);
}
var bv = new browserVersion();
var browserVersion = bv;
var browser = bv;