//version 1.0
//last modified 2002/02/19

function JG_Global() {

  //info about the script
  this.VERSION = 1.0;
  this.CREATED_BY = "Jeremy Grant";
  this.LAST_MODIFIED = "2002/02/18";

  //info about the client
  this.platform = JG_Global_getPlatform();

  // this one seperates all the different browsers
  this.browser = JG_Global_getBrowser();

  // this is for when you do want to include Opera in with IE
  this.browserFamily = JG_Global_getBrowserFamily();

  this.browserVersion = JG_Global_getBrowserVersion(this.browser);

  //the following would be useful for string validation
  //this.regExp = true;

}

function JG_Global_getPlatform() {
  if (navigator.platform.indexOf("Win") > -1)
    return "Win";
  else if (navigator.platform.indexOf("Mac") > -1)
    return "Mac";
}

function JG_Global_getBrowser() {
  if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Opera") <= -1)
    return "IE";
  else if (navigator.appVersion.indexOf("Opera") > -1)
    return "Opera"
  else if (navigator.appName == "Netscape")
    return "NS";
}

function JG_Global_getBrowserFamily() {
  if (navigator.appName == "Microsoft Internet Explorer")
    return "IE";
  else if (navigator.appName == "Netscape")
    return "NS";
}

function JG_Global_getBrowserVersion(browser) {
  if (browser == "IE")
    return navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE ")+5);
  else if (browser == "Opera")
    return navigator.appVersion.charAt(navigator.appVersion.indexOf("Opera ")+6);
  else if (browser == "NS")
    return parseInt(navigator.appVersion);
}

JG_global = new JG_Global();