// JavaScript Document

function Browser() {
  this.AppUserAgent = (typeof(navigator.userAgent) != "undefined") ? navigator.userAgent : "Property not supported or blank!";
  
  var _detect = navigator.userAgent.toLowerCase();
  var _OS, _browser, _version, _thestring, _place, _rv;
  
  function checkIt(s) {
    _place = _detect.indexOf(s) + 1;
    _thestring = s;
    return _place;
  }

  if (checkIt('konqueror')) {
    _browser = "Konqueror";
    _OS = "Linux";
  } else if (checkIt('safari')) _browser = "Safari";
  else if (checkIt('omniweb')) _browser = "OmniWeb";
  else if (checkIt('k-meleon')) {
    _browser = "K-Meleon";
    _rv = _detect.match(/k-meleon ([\w.]+)/);
    if (_rv) {
    _rv = _rv[0];
    _version = _rv.substr(3);
  }
  }
  else if (checkIt('opera')) _browser = "Opera";
  else if (checkIt('webtv')) _browser = "WebTV";
  else if (checkIt('icab')) _browser = "iCab"
  else if (checkIt('msie')) _browser = "IE";
  else if (!checkIt('compatible')) {
    _browser = "Netscape"
    version = _detect.charAt(8);
    if (typeof(navigator.product) != "undefined") {
      _browser = "Mozilla";
      _rv = navigator.userAgent.match(/([Mozilla ]?Fire\w+)\/([\w|\+.]+)/);
      if (_rv) {
        _browser = _rv[1];
        _version = _rv[2];
      } else {
        _rv = navigator.userAgent.match(/rv:([\w|\+.]+)/);
        if (_rv) {
          _rv = _rv[0];
          _version = _rv.substr(3);
        }
      }
    }
  }else _browser = "An unknown _browser";
  if (!_version) {
    _version = _detect.charAt(_place + _thestring.length);
  }
  if (_browser)
    this.AppBrowser = _browser.trim();
  if (_version){
    this.AppBrowserVer = _version.trim();
  }
  
  var _i_win,_v_win;
  var _agt=navigator.userAgent.toLowerCase();
  if (_agt.indexOf("win")!=-1 || _agt.indexOf("16bit")!=-1)
  _i_win = true;
  if (_i_win) {
  if (_agt.indexOf("win95")!=-1 || _agt.indexOf("windows 95")!=-1)
  _v_win = "Windows 95";
  if (_agt.indexOf("win98")!=-1 || _agt.indexOf("windows 98")!=-1)
  _v_win = "Windows 98";
  if (_agt.indexOf("win 9x 4.90")!=-1)
  _v_win = "Windows ME";
  if (_agt.indexOf("winnt")!=-1 || _agt.indexOf("windows nt")!=-1)
  _v_win = "Windows NT";
  if (_agt.indexOf("windows nt 5.0")!=-1)
  _v_win = "Windows 2000";
  if (_agt.indexOf("windows nt 5.1")!=-1)
  _v_win = "Windows XP";
  if (!_v_win)
  _v_win = "Unknown Windows";
  }
  if (!_OS) {
    if (checkIt('linux')) _OS = "Linux";
    else if (checkIt('x11')) _OS = "Unix";
    else if (checkIt('mac')) _OS = "Mac"
    else if (checkIt('win')) _OS = "Windows"
    else _OS = "an unknown operating system";
  }
  this.AppOS = (typeof(navigator.oscpu) != "undefined" && navigator.oscpu != "") ? navigator.oscpu : _OS;
  if (_i_win)
    this.AppOS += " - " + _v_win;
}