function  WWHelpSwitch_Object()
{
  var  Agent = "";
  var  MajorVersion = 0;


  // Determine browser
  //
  this.mBrowser = 0;  // Shorthand for Unknown

  Agent = navigator.userAgent.toLowerCase();
  if ((Agent.indexOf("mozilla") != -1) &&
      (Agent.indexOf("spoofer") == -1) &&
      (Agent.indexOf("compatible") == -1))
  {
    MajorVersion = parseInt(navigator.appVersion)
    if (MajorVersion >= 4)
    {
      this.mBrowser = 1;  // Shorthand for Netscape
    }
  }
  else if (Agent.indexOf("msie") != -1)
  {
    MajorVersion = parseInt(navigator.appVersion)
    if (MajorVersion >= 4)
    {
      this.mBrowser = 2;  // Shorthand for IE
    }
  }
  else if (Agent.indexOf("icab") != -1)
  {
    this.mBrowser = 3;  // Shorthand for iCab
  }

  // Determine platform
  //
  this.mPlatform = 0;  // Shorthand for Unknown

  if ((Agent.indexOf("win") != -1) ||
      (Agent.indexOf("16bit") != -1))
  {
    this.mPlatform = 1;  // Shorthand for Windows
  }
  else if (Agent.indexOf("mac") != -1)
  {
    this.mPlatform = 2;  // Shorthand for Macintosh
  }

  this.mbJavaEnabled = false;

  this.fForceJavaScript  = WWHelpSwitch_ForceJavaScript;
  this.fCheckJavaEnabled = WWHelpSwitch_CheckJavaEnabled;
  this.fGetFrameSet      = WWHelpSwitch_GetFrameSet;
  this.fSwitchFrameSet   = WWHelpSwitch_SwitchFrameSet;
}

function  WWHelpSwitch_CheckJavaEnabled()
{
  if (navigator != null)
  {
    this.mbJavaEnabled = navigator.javaEnabled();
  }
  else
  {
    this.mbJavaEnabled = false;
  }
}

function  WWHelpSwitch_GetFrameSet()
{
  var  WhichFrameSet = "wwhelp/js/html/frames.htm";


  // Detect current environment and use appropriate frameset
  // if JavaScript isn't forced on.
  //
  if (this.fForceJavaScript() == false)
  {
    // Check to see if Java is enabled
    //
    if (this.mbJavaEnabled)
    {
      // We'll try to run the Java version unless
      // a particular platform doesn't support it.
      //
      if (this.mBrowser == 1)  // Shorthand for Netscape
      {
        if (this.mPlatform == 1)  // Shorthand for Windows
        {
          WhichFrameSet = "wwhelp/java/html/wwhnsfs.htm";  // Java works on NS for Windows
        }
        else if (this.mPlatform == 2)  // Shorthand for Macintosh
        {
          WhichFrameSet = "wwhelp/js/html/frames.htm";  // Java doesn't work on NS for Macintosh
        }
        else
        {
          WhichFrameSet = "wwhelp/java/html/wwhnsfs.htm";  // Java works on NS for UNIX
        }
      }
      else  // Assume IE
      {
        if (this.mPlatform == 1)  // Shorthand for Windows
        {
          WhichFrameSet = "wwhelp/java/html/wwhiefs.htm";  // Java works on IE for Windows
        }
        else if (this.mPlatform == 2)  // Shorthand for Macintosh
        {
          WhichFrameSet = "wwhelp/java/html/wwhmacfs.htm";  // Java works on IE and iCab for Macintosh (no favorites)
        }
        else
        {
          WhichFrameSet = "wwhelp/js/html/frames.htm";  // Java doesn't work on IE for UNIX
        }
      }
    }
  }

  return WhichFrameSet;
}

function  WWHelpSwitch_SwitchFrameSet()
{
  var  NewLocation;


  NewLocation = this.fGetFrameSet();

  if (location.href.indexOf("?") != -1)
  {
    var  Parts;


    Parts = location.href.split("?");

    NewLocation += "?" + Parts[1];
  }

  location.href = NewLocation;
}

