/**
 * browser.js
 *
 * This javascript file contains an object that is created to provide browser information
 * to web application designers.  This file should typically be linked in to any jsp or
 * html page that needs any javascript stuff.
 *
 * Browsers Supported:  IE5.0, IE5.5, IE6.0, NS4.7x, NS6, NS7, Mozilla0.9, Mozilla 1.0
 *
 * Dependencies:  None
 */

var browser = new Object("browser");

// First determine exactly what browser & version we have
browser.isIE60 = (navigator.userAgent.indexOf("MSIE 6.0") >= 0);
browser.isIE55 = (navigator.userAgent.indexOf("MSIE 5.5") >= 0);
browser.isIE50 = (navigator.userAgent.indexOf("MSIE 5.0") >= 0);
browser.isMoz09 = ((navigator.userAgent.indexOf("Mozilla/5.0") >= 0) &&
                   (navigator.userAgent.indexOf("Netscape") < 0) &&
                   (navigator.userAgent.indexOf("rv:0.9") >= 0));
browser.isMoz10 = ((navigator.userAgent.indexOf("Mozilla/5.0") >= 0) &&
                   (navigator.userAgent.indexOf("Netscape") < 0) &&
                   (navigator.userAgent.indexOf("rv:1.0") >= 0));
browser.isNS6 = (navigator.userAgent.indexOf("Netscape6") >= 0);
browser.isNS7 = (navigator.userAgent.indexOf("Netscape/7.0") >= 0);
browser.isNS47x = document.layers;

// Next determine the functionality grouping.  For most DHTML methods, these are all you need to know.
browser.isDOM = (browser.isNS7 || browser.isNS6 || browser.isMoz09 || browser.isMoz10 || browser.isIE60) && document.getElementById;
browser.isOldNS = (browser.isNS47x);
browser.isOldIE = (browser.isIE55 || browser.isIE50) && document.all;

// Now sport a label for the browser name
browser.name = "Unknown";

if (browser.isIE60)
  browser.name = "Internet Explorer 6.0";
if (browser.isIE55)
  browser.name = "Internet Explorer 5.5";
if (browser.isIE50)
  browser.name = "Internet Explorer 5.0";
if (browser.isNS7)
  browser.name = "Netscape 7.0";
if (browser.isNS6)
  browser.name = "Netscape 6.0";
if (browser.isNS47x)
  browser.name = "Netscape Navigator 4.7x";
if (browser.isMoz09)
  browser.name = "Mozilla 0.9x";
if (browser.isMoz10)
  browser.name = "Mozilla 1.0x";
