/*****************************
  * Author: Steve Hardie
  * Created:  2008-04-03
  * Description:
  *   The Browser object is a class that is used to determine wich browser 
  *   the client is using.
  *   
  *   Usage: 	var browser=new Browser();
  *   			if (browser.isIE) ....		// Browser Is IE
  *   			if (browser.isNS) ....		// Browser Is Netscape
  *
  *
  * CHANGE HISTORY:
  * Date       Changed By        Description
  * ---------- ----------------- -----------------------------------------------
  * 
  ******************************************************************************/

function Browser() {

      var ua, s, i;

      this.isIE    = false;
      this.isNS    = false;
      this.version = null;

      ua = navigator.userAgent;

      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();
