// JavaScript Document

function Browser() {

  var ua, s, i, appVersion;

  this.isIE    = false;
  this.isNS    = false;
  this.isSafariBrowser = false;
  this.version = null;

  ua = navigator.userAgent;
  appVersion = navigator.appVersion;

  s = "Safari";
  
  if (appVersion.indexOf(s) != -1){
  this.isSafariBrowser = true;
  return;  
  }
  
  
  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();
