
//===========================================================================================
//                         Copyright © 2005-2003 Agate Software, Inc.
//===========================================================================================
// File: EnvironmentFunctions.js
//
// Description: Environment, browser, platform, etc. sniffing functions
//
//-------------------------------------------------------------------------------------------
// History                                                   By                    Date
//-------------------------------------------------------------------------------------------
// Created                                                   Sylvania Dye          12/01/2003
//===========================================================================================

//============================================================================================
//                         Copyright © 2005-2003 Agate Software, Inc.
//============================================================================================
// Procedure:    JavaScriptCustomFunctions.browser
//
// Description: Gets all browser/environment settings
//
// Input:       [none]
//
//--------------------------------------------------------------------------------------------
// History                                                   By                     Date
//--------------------------------------------------------------------------------------------
// Created (pieces from other sniffers, made enhancements)   Sylvania Dye          12/01/2003
//============================================================================================


function Browser() {

  // declare procedure scope variables
  var objUserAgent, strBrowser, intVersionPosition;

  // initialise attributes
  this.isIE       = false;
  this.isNetscape = false;
  this.version    = null;

  objUserAgent = navigator.userAgent;

  strBrowser = "MSIE";
  if ((intVersionPosition = objUserAgent.indexOf(strBrowser)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(objUserAgent.substr(intVersionPosition + strBrowser.length));
    return;
  }

  strBrowser = "Netscape6/";
  if ((intVersionPosition = objUserAgent.indexOf(strBrowser)) >= 0) {
    this.isNetscape = true;
    this.version = parseFloat(objUserAgent.substr(intVersionPosition + strBrowser.length));
    return;
  }

  // treat other Gecko browsers as netscape 6.1.
  strBrowser = "Gecko";
  if ((intVersionPosition = objUserAgent.indexOf(strBrowser)) >= 0) {
    this.isNetscape = true;
    this.version = 6.1;
    return;
  }
}
