/* ua.js 
 * Version 1.7 Revised 2002/09/24 15:46:52  ed
 */
/* ***** BEGIN LICENSE BLOCK *****
 * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
 * Full Terms at /evangelism/lib/js/license/mpl-tri-license.txt
 *
 * The Initial Developer of the Original Code is Netscape Corp.
 * Portions created by the Initial Developer are Copyright (C) 2001
 * the Initial Developer. All Rights Reserved.
 *
 * Contributors:
 *		Bob Clary <bclary@netscape.com>,
 *		Ed DeFinis <edefinis@earthlink.net>
 * ***** END LICENSE BLOCK ***** */
function xbDetectBrowser()
{
  var oldOnError = window.onerror;
  var element = null;

  window.onerror = null;
  
// work around bug in xpcdom Mozilla 0.9.1
  window.saveNavigator = window.navigator;
// GLOBAL VARS 
  navigator.usrOS = '';
  navigator.usrVersion = parseFloat(navigator.appVersion);
//  navigator.usrVersion  = parseInt(navigator.appVersion);
  navigator.usrOrg = '';
  navigator.usrFamily = '';
  navigator.usrW3Ccompliant = 'N'

// Get platform type
			theAgent=navigator.userAgent.toLowerCase();
   		osMac = (theAgent.indexOf("mac")!=-1);
			osWin = (navigator.platform == "Win32") || (theAgent.indexOf("windows")!=-1)
				|| (theAgent.indexOf("winnt")!=-1) || (theAgent.indexOf("winme")!=-1)
				|| (theAgent.indexOf("win9")!=-1) || (theAgent.indexOf("win16")!=-1) ;
// Get platform type
  var platform;
  if (typeof(window.navigator.platform) != 'undefined')
  {
    platform = window.navigator.platform.toLowerCase();
    if (platform.indexOf('win') != -1)
      navigator.usrOS = "win";
    else if (platform.indexOf('mac') != -1)
      navigator.usrOS = "mac";
    else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1)
      navigator.usrOS = "nix";
  }
  var i = 0;
  var ua = window.navigator.userAgent.toLowerCase();
  if (ua.indexOf('opera') != -1)
  {
    i = ua.indexOf('opera');
    navigator.usrFamily  = "opera";
    navigator.usrOrg    = "opera";
    navigator.usrVersion  = parseFloat('0' + ua.substr(i+6), 10);
    if(navigator.usrVersion >= 6)
			navigator.usrW3Ccompliant = 'Y';
	}
  else if ((i = ua.indexOf("msie")) != -1)
  {
    navigator.usrOrg    = "microsoft";
    navigator.usrVersion = parseFloat('0' + ua.substr(i+5), 10);
    if (navigator.usrVersion < 4)
      navigator.usrFamily = "ie3";
    else if (navigator.usrVersion < 5)
      navigator.usrFamily = "ie4";
    else if (navigator.usrVersion < 6)
      navigator.usrFamily = "ie5";
    else if (navigator.usrVersion < 7)
      navigator.usrFamily = "ie6";
    else if(navigator.usrVersion >= 7)
      navigator.usrFamily = "ie7";
      
    if(navigator.usrVersion >= 5)
			navigator.usrW3Ccompliant = 'Y';
  }
  else if (ua.indexOf('gecko') != -1)
  {
    navigator.usrFamily = "gecko";
    navigator.usrW3Ccompliant = 'Y';
    i = ua.lastIndexOf('/')
    navigator.usrVersion = ua.substr(i+1, ua.length);
// Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.6
// Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007    
// Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208
// Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
// Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    if (ua.indexOf('netscape') != -1)
      navigator.usrOrg = 'netscape';
    else if (ua.indexOf('compuserve') != -1)
      navigator.usrOrg = 'compuserve';
    else if (ua.indexOf('firefox') != -1)
      navigator.usrOrg = 'firefox';
    else if (ua.indexOf('safari') != -1)
      navigator.usrOrg = 'safari';
    else
      navigator.usrOrg = 'mozilla';
  }
  else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1))
  {
    var is_major = parseFloat(navigator.appVersion);
    
    if (is_major < 5)
      navigator.usrVersion = is_major;
    else
    {
      i = ua.lastIndexOf('/')
      navigator.usrVersion = parseFloat('0' + ua.substr(i+1), 10);
//	    navigator.usrVersion = parseFloat('0' + ua.substr(i+1), ua.length - i);
//			navigator.usrVersion = ua.substr('0' + i+1, ua.length);
    }
    navigator.usrOrg = "netscape";
    navigator.usrFamily = 'nn' + parseInt(navigator.appVersion);
    if (ua.indexOf("(win95") != -1)
    {
			navigator.usrOS = "win";
			if (typeof(window.navigator.platform) != 'undefined')
				navigator.platform = "win95";
		}
  }
  else if ((i = ua.indexOf("aol")) != -1 )
  {
    // aol
    navigator.usrFamily  = "aol";
    navigator.usrOrg    = "aol";
    navigator.usrVersion  = parseFloat('0' + ua.substr(i+4), 10);
  }
  else if ((i = ua.indexOf("hotjava")) != -1 )
  {
    // hotjava
    navigator.usrFamily  = "hotjava";
    navigator.usrOrg    = 'sun';
    navigator.usrVersion  = parseFloat(navigator.appVersion);
  }

  window.onerror = oldOnError;
}
xbDetectBrowser();
    navigator.usrCPUclass = window.navigator.cpuClass;
    navigator.usrPlatform = window.navigator.platform;
    navigator.usrScreenwidth = window.screen.width;
    navigator.usrScreenheight = window.screen.height;
    navigator.usrAvailwidth = window.screen.availWidth;
    navigator.usrAvailheight = window.screen.availHeight;
    navigator.usrColordepth = window.screen.colorDepth;

if(navigator.usrFamily == "nn2" || navigator.usrFamily == "nn3")
{
	window.location = g_BROWSERNG;
	self.home;
}