// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHBookGroups_Object()
{
  this.mbShowBooks      = false;
  this.mbExpandAllAtTop = false;
  this.mChildren        = new Array();

  this.fAddGrouping  = WWHBookGroups_AddGrouping;
  this.fAddDirectory = WWHBookGroups_AddDirectory;
}

function  WWHBookGroups_AddGrouping(ParamTitle,
                                    bParamExpand,
                                    ParamIcon,
                                    ParamOpenIcon)
{
  var  bExpandBookGrouping;
  var  BookGrouping;


  // Set mbExpand to true if top entries are to be expanded
  //
  bExpandBookGrouping = false;
  if ((typeof(bParamExpand) != "undefined") &&
      (bParamExpand != null) &&
      (bParamExpand == true))
  {
    bExpandBookGrouping = true;
  }
  else
  {
    if (this.mbExpandAllAtTop)
    {
      bExpandBookGrouping = true;
    }
  }

  BookGrouping = new WWHBookGroups_Group_Object(ParamTitle, bExpandBookGrouping, ParamIcon, ParamOpenIcon);

  // Add to children list
  //
  this.mChildren[this.mChildren.length] = BookGrouping;

  return BookGrouping;
}

function  WWHBookGroups_AddDirectory(ParamDirectory,
                                     bParamShow,
                                     bParamExpand,
                                     ParamIcon,
                                     ParamOpenIcon)
{
  var  bExpandBookDirectory;
  var  BookDirectory;


  // Set mbExpand to true if top entries are to be expanded
  //
  bExpandBookDirectory = false;
  if ((typeof(bParamExpand) != "undefined") &&
      (bParamExpand != null) &&
      (bParamExpand == true))
  {
    bExpandBookDirectory = true;
  }
  else
  {
    if (this.mbExpandAllAtTop)
    {
      bExpandBookDirectory = true;
    }
  }

  BookDirectory = new WWHBookGroups_Directory_Object(ParamDirectory, bParamShow, bExpandBookDirectory, ParamIcon, ParamOpenIcon);

  // Set mbShow to default values if not defined
  //
  if ((typeof(bParamShow) == "undefined") ||
      (bParamShow == null))
  {
    BookDirectory.mbShow = this.mbShowBooks;
  }

  // Add to children list
  //
  this.mChildren[this.mChildren.length] = BookDirectory;
}

function  WWHBookGroups_Group_Object(ParamTitle,
                                     bParamExpand,
                                     ParamIcon,
                                     ParamOpenIcon)
{
  this.mbGrouping = true;
  this.mTitle     = ParamTitle;
  this.mbExpand   = false;
  this.mChildren  = new Array();

  this.fAddGrouping  = WWHBookGroups_Group_AddGrouping;
  this.fAddDirectory = WWHBookGroups_Group_AddDirectory;

  // Set mbExpand if override defined
  //
  if ((typeof(bParamExpand) != "undefined") &&
      (bParamExpand != null))
  {
    if (bParamExpand == true)
    {
      this.mbExpand = true;
    }
  }

  // Set mIcon if defined
  //
  if (typeof(ParamIcon) != "undefined")
  {
    this.mIcon = ParamIcon;
  }

  // Set mOpenIcon if defined
  //
  if (typeof(ParamOpenIcon) != "undefined")
  {
    this.mOpenIcon = ParamOpenIcon;
  }
}

function  WWHBookGroups_Group_AddGrouping(ParamTitle,
                                          bParamExpand,
                                          ParamIcon,
                                          ParamOpenIcon)
{
  var  BookGrouping;


  BookGrouping = new WWHBookGroups_Group_Object(ParamTitle, bParamExpand, ParamIcon, ParamOpenIcon);
  this.mChildren[this.mChildren.length] = BookGrouping;

  return BookGrouping;
}

function  WWHBookGroups_Group_AddDirectory(ParamDirectory,
                                           bParamShow,
                                           bParamExpand,
                                           ParamIcon,
                                           ParamOpenIcon)
{
  var  BookDirectory;


  BookDirectory = new WWHBookGroups_Directory_Object(ParamDirectory, bParamShow, bParamExpand, ParamIcon, ParamOpenIcon);
  this.mChildren[this.mChildren.length] = BookDirectory;
}

function  WWHBookGroups_Directory_Object(ParamDirectory,
                                         bParamShow,
                                         bParamExpand,
                                         ParamIcon,
                                         ParamOpenIcon)
{
  this.mbGrouping = false;
  this.mDirectory = ParamDirectory;
  this.mbShow     = true;
  this.mbExpand   = false;

  // Set mbShow if override defined
  //
  if ((typeof(bParamShow) == "undefined") ||
      (bParamShow == null))
  {
    this.mbShow = WWHFrame.WWHHelp.mBookGroups.mbShowBooks;
  }
  else
  {
    if (bParamShow == false)
    {
      this.mbShow = bParamShow;
    }
  }

  // Set mbExpand if override defined
  //
  if ((typeof(bParamExpand) != "undefined") &&
      (bParamExpand != null))
  {
    if (bParamExpand == true)
    {
      this.mbExpand = bParamExpand;
    }
  }

  // Set mIcon if defined
  //
  if (typeof(ParamIcon) != "undefined")
  {
    this.mIcon = ParamIcon;
  }

  // Set mOpenIcon if defined
  //
  if (typeof(ParamOpenIcon) != "undefined")
  {
    this.mOpenIcon = ParamOpenIcon;
  }

  // Add to book list
  //
  WWHFrame.WWHHelp.mBooks.fInit_AddBookDir(ParamDirectory);
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHBook_Object(ParamDirectory)
{
  // Set values from callbacks
  //
  this.mDirectory = null;
  this.mTitle     = null;
  this.mContext   = null;
  this.mFiles     = new WWHFileList_Object();

  // Fix up directory
  //
  if (ParamDirectory == ".")
  {
    this.mDirectory = "";
  }
  else
  {
    this.mDirectory = ParamDirectory + "/";
  }

  this.fInit = WWHBook_Init;
}

function  WWHBook_Init(ParamTitle,
                       ParamContext,
                       ParamFilesFunction,
                       ParamALinksFunction)
{
  this.mTitle   = ParamTitle;
  this.mContext = ParamContext;

  // Load files
  //
  ParamFilesFunction(this.mFiles);

  // Load alinks
  //
  ParamALinksFunction(WWHFrame.WWHALinks);
}

function  WWHBookList_Object()
{
  this.mInitIndex          = 0;
  this.mBookList           = new Array();
  this.mBookContextToIndex = new Object();

  this.fInit_AddBookDir                = WWHBookList_Init_AddBookDir;
  this.fInit_BookData_Script           = WWHBookList_Init_BookData_Script;
  this.fInit_AddBook                   = WWHBookList_Init_AddBook;
  this.fInit_IncrementIndex            = WWHBookList_Init_IncrementIndex;
  this.fGetBook                        = WWHBookList_GetBook;
  this.fGetBookTitle                   = WWHBookList_GetBookTitle;
  this.fHREFToFileIndex                = WWHBookList_HREFToFileIndex;
  this.fHREFToTitle                    = WWHBookList_HREFToTitle;
  this.fBookIndexFileIndexToTitle      = WWHBookList_BookIndexFileIndexToTitle;
  this.fGetBookIndexFileHREF           = WWHBookList_GetBookIndexFileHREF;
  this.fBookFileIndiciesToHREF         = WWHBookList_BookFileIndiciesToHREF;
  this.fHREFToBookIndexFileIndexAnchor = WWHBookList_HREFToBookIndexFileIndexAnchor;
  this.fGetSyncPrevNext                = WWHBookList_GetSyncPrevNext;
  this.fGetContextIndex                = WWHBookList_GetContextIndex;
  this.fGetContextBook                 = WWHBookList_GetContextBook;
}

function  WWHBookList_Init_AddBookDir(ParamBookDir)
{
  this.mBookList[this.mBookList.length] = new WWHBook_Object(ParamBookDir);
}

function  WWHBookList_Init_BookData_Script()
{
  var  Scripts  = new WWHStringBuffer_Object();
  var  VarParameters;
  var  BookDirectory;


  // Workaround Safari reload bug
  //
  VarParameters = "";
  if (WWHFrame.WWHBrowser.mBrowser == 5)  // Shorthhand for Safari
  {
    VarParameters = "?" + (new Date() * 1);
  }

  this.mInitIndex = 0;
  Scripts.fAppend("<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhbdata/common.js" + VarParameters + "\"></script>\n");

  return Scripts.fGetBuffer();
}

function  WWHBookList_Init_AddBook(ParamTitle,
                                   ParamContext,
                                   ParamFilesFunction,
                                   ParamALinksFunction)
{
  // Update book information
  //
  this.mBookList[this.mInitIndex].fInit(ParamTitle, ParamContext,
                                        ParamFilesFunction,
                                        ParamALinksFunction);
  this.mBookContextToIndex[ParamContext + "~"] = this.mInitIndex;
}

function  WWHBookList_Init_IncrementIndex()
{
  this.mInitIndex++;
}

function  WWHBookList_GetBook(ParamIndex)
{
  return this.mBookList[ParamIndex];
}

function  WWHBookList_GetBookTitle(ParamIndex)
{
  return this.mBookList[ParamIndex].mTitle;
}

function  WWHBookList_HREFToFileIndex(ParamIndex,
                                      ParamHREF)
{
  return this.mBookList[ParamIndex].mFiles.fHREFToIndex(ParamHREF);
}

function  WWHBookList_HREFToTitle(ParamIndex,
                                  ParamHREF)
{
  return this.mBookList[ParamIndex].mFiles.fHREFToTitle(ParamHREF);
}

function  WWHBookList_BookIndexFileIndexToTitle(ParamBookIndex,
                                                ParamFileIndex)
{
  return this.mBookList[ParamBookIndex].mFiles.fFileIndexToTitle(ParamFileIndex);
}

function  WWHBookList_GetBookIndexFileHREF(ParamHREF)
{
  var  ResultArray = new Array(-1, null);
  var  LongestMatchIndex;
  var  MaxIndex;
  var  Index;
  var  Parts;
  var  FileHREF;


  // Find the book directory
  //
  LongestMatchIndex = -1;
  for (MaxIndex = this.mBookList.length, Index = 0 ; Index < MaxIndex ; Index++)
  {
    if (ParamHREF.indexOf(this.mBookList[Index].mDirectory) == 0)
    {
      if (LongestMatchIndex == -1)
      {
        LongestMatchIndex = Index;
      }
      else if (this.mBookList[Index].mDirectory.length > this.mBookList[LongestMatchIndex].mDirectory.length)
      {
        LongestMatchIndex = Index;
      }
    }
  }

  // If LongestMatchIndex is valid, we found our book directory
  //
  if (LongestMatchIndex != -1)
  {
    // Set FileHREF to be just the file portion
    //
    if (this.mBookList[LongestMatchIndex].mDirectory.length > 0)
    {
      FileHREF = ParamHREF.substring(this.mBookList[LongestMatchIndex].mDirectory.length, ParamHREF.length);
    }
    else
    {
      FileHREF = ParamHREF;
    }

    ResultArray[0] = LongestMatchIndex;
    ResultArray[1] = FileHREF;
  }

  return ResultArray;
}

function  WWHBookList_BookFileIndiciesToHREF(ParamBookIndex,
                                             ParamFileIndex)
{
  return this.mBookList[ParamBookIndex].mDirectory + this.mBookList[ParamBookIndex].mFiles.fFileIndexToHREF(ParamFileIndex);
}

function  WWHBookList_HREFToBookIndexFileIndexAnchor(ParamHREF)
{
  var  ResultArray = new Array(-1, -1, "");
  var  Parts;
  var  TrimmedHREF;
  var  Anchor;
  var  BookIndex;
  var  FileIndex;


  // Record anchor
  //
  Parts = ParamHREF.split("#");
  TrimmedHREF = Parts[0];
  Anchor = "";
  if (Parts.length > 1)
  {
    if (Parts[1].length > 0)
    {
      Anchor = Parts[1];
    }
  }

  // Determine book index
  //
  Parts = this.fGetBookIndexFileHREF(TrimmedHREF);
  if (Parts[0] >= 0)
  {
    BookIndex = Parts[0];
    FileIndex = this.fHREFToFileIndex(BookIndex, Parts[1]);

    if (FileIndex >= 0)
    {
      ResultArray[0] = BookIndex;
      ResultArray[1] = FileIndex;
      ResultArray[2] = Anchor;
    }
  }

  return ResultArray;
}

function  WWHBookList_GetSyncPrevNext(ParamHREF)
{
  var  ResultArray = new Array(null, null, null);
  var  Parts;
  var  BookIndex;
  var  FileIndex;


  // Determine current book index and file index
  //
  Parts = this.fHREFToBookIndexFileIndexAnchor(ParamHREF);
  BookIndex = Parts[0];
  FileIndex = Parts[1];

  // Set return results
  //
  if ((BookIndex >= 0) &&
      (FileIndex >= 0))
  {
    // Set sync
    //
    ResultArray[0] = ParamHREF;  // Indicates file found, sync possible

    // Set previous
    //
    if (FileIndex > 0)
    {
      ResultArray[1] = this.fBookFileIndiciesToHREF(BookIndex, FileIndex - 1);
    }
    else
    {
      if (BookIndex > 0)
      {
        ResultArray[1] = this.fBookFileIndiciesToHREF(BookIndex - 1, this.mBookList[BookIndex - 1].mFiles.mFileList.length - 1);
      }
    }

    // Set next
    //
    if ((FileIndex + 1) < this.mBookList[BookIndex].mFiles.mFileList.length)
    {
      ResultArray[2] = this.fBookFileIndiciesToHREF(BookIndex, FileIndex + 1);
    }
    else
    {
      if (((BookIndex + 1) < this.mBookList.length) &&
          (this.mBookList[BookIndex + 1].mFiles.mFileList.length > 0))
      {
        ResultArray[2] = this.fBookFileIndiciesToHREF(BookIndex + 1, 0);
      }
    }
  }

  return ResultArray;
}

function  WWHBookList_GetContextIndex(ParamContext)
{
  var  RetIndex = -1;

  if (typeof(this.mBookContextToIndex[ParamContext + "~"]) == "number")
  {
    RetIndex = this.mBookContextToIndex[ParamContext + "~"];
  }

  return RetIndex;
}

function  WWHBookList_GetContextBook(ParamContext)
{
  var  ResultBook = null;
  var  MaxIndex;
  var  Index;


  for (MaxIndex = this.mBookList.length, Index = 0 ; Index < MaxIndex ; Index++)
  {
    if (this.mBookList[Index].mContext == ParamContext)
    {
      ResultBook = this.mBookList[Index];
    }
  }

  return ResultBook;
}
// Copyright (c) 2000-2005 Quadralay Corporation.  All rights reserved.
//

function  WWHBrowserUtilities_SearchReplace(ParamString,
                                            ParamSearchString,
                                            ParamReplaceString)
{
  var  ResultString;
  var  Index;


  ResultString = ParamString;

  if ((ParamSearchString.length > 0) &&
      (ResultString.length > 0))
  {
    Index = 0;
    while ((Index = ResultString.indexOf(ParamSearchString, Index)) != -1)
    {
      ResultString = ResultString.substring(0, Index) + ParamReplaceString + ResultString.substring(Index + ParamSearchString.length, ResultString.length);
      Index += ParamReplaceString.length;
    }
  }

  return ResultString;
}

function  WWHBrowserUtilities_EscapeURLForJavaScriptAnchor(ParamURL)
{
  var  EscapedURL = ParamURL;


  // Escape problematic characters
  // \ " ' < >
  //
  EscapedURL = WWHBrowserUtilities_SearchReplace(EscapedURL, "\\", "\\\\");
  EscapedURL = WWHBrowserUtilities_SearchReplace(EscapedURL, "\"", "\\u0022");
  EscapedURL = WWHBrowserUtilities_SearchReplace(EscapedURL, "'", "\\u0027");
  EscapedURL = WWHBrowserUtilities_SearchReplace(EscapedURL, "<", "\\u003c");
  EscapedURL = WWHBrowserUtilities_SearchReplace(EscapedURL, ">", "\\u003e");

  return EscapedURL;
}

function  WWHBrowser_Object()
{
  this.mLocale                 = "en";
  this.mPlatform               = 0;      // Shorthand for Unknown
  this.mBrowser                = 0;      // Shorthand for Unknown
  this.mCookiePath             = "/";
  this.mbCookiesEnabled        = null;
  this.mbSupportsFocus         = false;
  this.mbSupportsPopups        = true;
  this.mbSupportsIFrames       = false;
  this.mbSupportsFrameRenaming = true;
  this.mbWindowIE40            = false;  // Needed for special case handling
  this.mbMacIE45               = false;  // Needed for special case handling
  this.mbMacIE50               = false;  // Needed for special case handling
  this.mbWindowsIE60           = false;  // Needed for special case handling
  this.mbUnsupported           = false;

  this.fInitialize      = WWHBrowser_Initialize;
  this.fNormalizeURL    = WWHBrowser_NormalizeURL;
  this.fSetLocation     = WWHBrowser_SetLocation;
  this.fReplaceLocation = WWHBrowser_ReplaceLocation;
  this.fReloadLocation  = WWHBrowser_ReloadLocation;
  this.fSetCookiePath   = WWHBrowser_SetCookiePath;
  this.fCookiesEnabled  = WWHBrowser_CookiesEnabled;
  this.fSetCookie       = WWHBrowser_SetCookie;
  this.fGetCookie       = WWHBrowser_GetCookie;
  this.fDeleteCookie    = WWHBrowser_DeleteCookie;
  this.fFocus           = WWHBrowser_Focus;

  // Initialize object
  //
  this.fInitialize();
}

function  WWHBrowser_Initialize()
{
  var  Agent;
  var  MajorVersion = 0;
  var  VersionString;
  var  Version = 0.0;


  // Reset locale to correct language value
  //
  if ((typeof(navigator.language) != "undefined") &&
      (navigator.language != null))
  {
    this.mLocale = navigator.language;
  }
  else if ((typeof(navigator.userLanguage) != "undefined") &&
           (navigator.userLanguage != null))
  {
    this.mLocale = navigator.userLanguage;
  }

  // Convert everything to lowercase
  //
  this.mLocale = this.mLocale.toLowerCase();

  // Replace '-'s with '_'s
  //
  this.mLocale = WWHBrowserUtilities_SearchReplace(this.mLocale, "-", "_");

  // Get browser info
  //
  Agent = navigator.userAgent.toLowerCase();

  // Determine platform
  //
  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
  }

  // Determine browser
  //
  if ((Agent.indexOf("mozilla") != -1) &&
      (Agent.indexOf("spoofer") == -1) &&
      (Agent.indexOf("compatible") == -1))
  {
    MajorVersion = parseInt(navigator.appVersion)

    if (MajorVersion >= 5)
    {
      this.mBrowser = 4;  // Shorthand for Netscape 6.0
      this.mbSupportsIFrames = true;
      this.mbSupportsFocus = true;

      // Netscape 6.0 is unsupported
      //
      if (navigator.userAgent.indexOf("m18") != -1)
      {
        this.mbUnsupported = true;
      }
    }
    else if (MajorVersion >= 4)
    {
      this.mBrowser = 1;  // Shorthand for Netscape

      this.mbSupportsFrameRenaming = false;
    }
  }
  else if (Agent.indexOf("msie") != -1)
  {
    MajorVersion = parseInt(navigator.appVersion)
    if (MajorVersion >= 4)
    {
      this.mBrowser = 2;  // Shorthand for IE
      this.mbSupportsFocus = true;

      // Additional info needed for popups
      //
      VersionString = navigator.appVersion.toLowerCase();
      MSIEVersionString = VersionString.substring(VersionString.indexOf("msie") + 4);
      Version = parseFloat(MSIEVersionString);
      if ((Version >= 4.0) &&
          (Version < 4.1))
      {
        if (this.mPlatform == 1)  // Shorthand for Windows
        {
          this.mbWindowsIE40 = true;
        }
      }
      else if ((Version >= 4.5) &&
               (Version < 4.6))
      {
        if (this.mPlatform == 2)  // Shorthand for Macintosh
        {
          this.mbMacIE45 = true;
        }
      }
      else if ((Version >= 5.0) &&
               (Version < 5.1))
      {
        if (this.mPlatform == 2)  // Shorthand for Macintosh
        {
          this.mbMacIE50 = true;
        }
      }
      else if ((Version >= 5.5) &&
               (Version < 6.0))
      {
        this.mbSupportsIFrames = true;
      }
      else if (Version >= 6.0)
      {
        this.mbSupportsIFrames = true;
        this.mbWindowsIE60 = true;
      }
    }
  }
  else if (Agent.indexOf("icab") != -1)
  {
    this.mBrowser = 3;  // Shorthand for iCab

    this.mbSupportsPopups = false;
  }

  // Safari may spoof as just about anything
  //
  if (Agent.indexOf("applewebkit") != -1)
  {
    this.mBrowser = 5;  // Shorthand for Safari

    this.mbSupportsPopups = true;
    this.mbSupportsIFrames = true;
    this.mbSupportsFocus = false;
  }
}

function  WWHBrowser_NormalizeURL(ParamURL)
{
  var  URL = ParamURL;
  var  Parts;
  var  MaxIndex;
  var  Index;
  var  DrivePattern;
  var  DrivePatternMatch;


  // Standardize protocol case
  //
  if (URL.indexOf(":") != -1)
  {
    Parts = URL.split(":");

    URL = Parts[0].toLowerCase();
    for (MaxIndex = Parts.length, Index = 1 ; Index < MaxIndex ; Index++)
    {
      URL += ":" + Parts[Index];
    }
  }

  // Handle drive letters under Windows
  //
  if (this.mPlatform == 1)  // Shorthand for Windows
  {
    DrivePattern = new RegExp("^file:[/]+([a-zA-Z])[:\|][/](.*)$", "i");
    DrivePatternMatch = DrivePattern.exec(URL);
    if (DrivePatternMatch != null)
    {
      URL = "file:///" + DrivePatternMatch[1] + ":/" + DrivePatternMatch[2];
    }
  }

  // Deal with Safari stupidity
  //
  URL = WWHBrowserUtilities_SearchReplace(URL, " ", "%20");

  return URL;
}

function  WWHBrowser_SetLocation(ParamFrameReference,
                                 ParamURL)
{
  var  EscapedURL;


  EscapedURL = WWHBrowserUtilities_EscapeURLForJavaScriptAnchor(ParamURL);
  setTimeout(ParamFrameReference + ".location = \"" + EscapedURL + "\";", 1);
}

function  WWHBrowser_ReplaceLocation(ParamFrameReference,
                                     ParamURL)
{
  var  EscapedURL;


  EscapedURL = WWHBrowserUtilities_EscapeURLForJavaScriptAnchor(ParamURL);
  setTimeout(ParamFrameReference + ".location.replace(\"" + EscapedURL + "\");", 1);
}

function  WWHBrowser_ReloadLocation(ParamFrameReference)
{
  var  VarFrame;


  VarFrame = eval(ParamFrameReference);
  this.fReplaceLocation(ParamFrameReference, VarFrame.location.href);
}

function  WWHBrowser_SetCookiePath(ParamURL)
{
  var  Pathname;
  var  WorkingURL;
  var  Parts;
  var  Index;
  var  Protocol = "";


  // Initialize return value
  //
  Pathname = "/";

  // Remove URL parameters
  //
  WorkingURL = ParamURL;
  if (WorkingURL.indexOf("?") != -1)
  {
    Parts = WorkingURL.split("?");
    WorkingURL = Parts[0];
  }
  else if (WorkingURL.indexOf("#") != -1)
  {
    Parts = WorkingURL.split("#");
    WorkingURL = Parts[0];
  }

  // Remove last entry if path does not end with /
  //
  Index = WorkingURL.lastIndexOf("/");
  if ((Index + 1) < WorkingURL.length)
  {
    WorkingURL = WorkingURL.substring(0, Index);
  }

  // Remove protocol
  //
  Index = -1;
  if (WorkingURL.indexOf("http:/") == 0)
  {
    Index = WorkingURL.indexOf("/", 6);
    Protocol = "http";
  }
  else if (WorkingURL.indexOf("ftp:/") == 0)
  {
    Index = WorkingURL.indexOf("/", 5);
    Protocol = "ftp";
  }
  else if (WorkingURL.indexOf("file:///") == 0)
  {
    Index = 7;
    Protocol = "file";
  }

  // Set base URL pathname
  //
  if (Index != -1)
  {
    Pathname = WorkingURL.substring(Index, WorkingURL.length);

    // Clean up pathname
    //
    if (Protocol == "file")
    {
      if (this.mPlatform == 1)  // Shorthand for Windows
      {
        if (this.mBrowser == 2)  // Shorthand for IE
        {
          // file URLs must have slashes replaced with backslashes, except the first one
          //
          if (Pathname.length > 1)
          {
            Pathname = unescape(Pathname);
            Pathname = WWHBrowserUtilities_SearchReplace(Pathname, "/", "\\");
            if (Pathname.indexOf("\\") == 0)
            {
              Pathname = "/" + Pathname.substring(1, Pathname.length);
            }
          }
        }
      }
    }
    else
    {
      // Trim server info
      //
      Index = Pathname.indexOf("/", Index);
      if (Index != -1)
      {
        Pathname = Pathname.substring(Index, Pathname.length);
      }
      else
      {
        Pathname = "/";
      }
    }
  }

  // Set cookie path
  //
  this.mCookiePath = Pathname;
}

function  WWHBrowser_CookiesEnabled()
{
  // Cache result
  //
  if (this.mbCookiesEnabled == null)
  {
    // Default to disabled
    //
    this.mbCookiesEnabled = false;

    // Try setting a cookie
    //
    this.fSetCookie("WWHBrowser_CookiesEnabled", "True");

    // Retrieve the cookie
    //
    if (this.fGetCookie("WWHBrowser_CookiesEnabled") != null)
    {
      // Delete the test cookie
      //
      this.fDeleteCookie("WWHBrowser_CookiesEnabled");

      // Success!
      //
      this.mbCookiesEnabled = true;
    }
  }

  return this.mbCookiesEnabled;
}

function  WWHBrowser_SetCookie(ParamName,
                               ParamValue,
                               ParamExpiration)
{
  var  VarFormattedCookie;
  var  VarPath;
  var  VarExpirationDate;


  // Format the cookie
  //
  VarFormattedCookie = escape(ParamName) + "=" + escape(ParamValue);

  // Add path
  //
  VarFormattedCookie += "; path=" + this.mCookiePath;

  // Add expiration day, if specified
  //
  if ((typeof(ParamExpiration) != "undefined") &&
      (ParamExpiration != null) &&
      (ParamExpiration != 0))
  {
    VarExpirationDate = new Date();
    VarExpirationDate.setTime(VarExpirationDate.getTime() + (ParamExpiration * 1000 * 60 * 60 * 24));
    VarFormattedCookie += "; expires=" + VarExpirationDate.toGMTString();
  }

  // Set the cookie for the specified document
  //
  document.cookie = VarFormattedCookie
}

function  WWHBrowser_GetCookie(ParamName)
{
  var  VarValue;
  var  VarCookies;
  var  VarKey;
  var  VarStartIndex;
  var  VarEndIndex;


  // Initialize return value
  //
  VarValue = null;

  // Get document cookies
  //
  VarCookies = document.cookie;

  // Parse out requested cookie
  //

  // Try first position
  //
  VarKey = escape(ParamName) + "=";
  VarStartIndex = VarCookies.indexOf(VarKey);
  if (VarStartIndex != 0)
  {
    // Try any other position
    //
    VarKey = "; " + escape(ParamName) + "=";
    VarStartIndex = VarCookies.indexOf(VarKey);
  }

  // Match found?
  //
  if (VarStartIndex != -1)
  {
    // Advance past cookie key
    //
    VarStartIndex += VarKey.length;

    // Find end
    //
    VarEndIndex = VarCookies.indexOf(";", VarStartIndex);
    if (VarEndIndex == -1)
    {
      VarEndIndex = VarCookies.length;
    }
    VarValue = unescape(VarCookies.substring(VarStartIndex, VarEndIndex));
  }

  return VarValue;
}

function  WWHBrowser_DeleteCookie(ParamName)
{
  // Set cookie to expire yesterday
  //
  this.fSetCookie(ParamName, "", -1);
}

function  WWHBrowser_Focus(ParamFrameReference,
                           ParamAnchorName)
{
  var  VarFrame;
  var  VarAnchor;
  var  VarMaxIndex;
  var  VarIndex;


  if (this.mbSupportsFocus)
  {
    if (ParamFrameReference.length > 0)
    {
      // Access frame
      //
      VarFrame = eval(ParamFrameReference);

      // Focus frame
      //
      VarFrame.focus();

      // Focusing anchor?
      //
      if ((typeof(ParamAnchorName) != "undefined") &&
          (ParamAnchorName != null) &&
          (ParamAnchorName.length > 0))
      {
        // Focus anchor
        //
        VarAnchor = VarFrame.document.anchors[ParamAnchorName];
        if ((typeof(VarAnchor) != "undefined") &&
            (VarAnchor != null))
        {
          VarAnchor.focus();
        }
        else
        {
          VarAnchorArray = VarFrame.document.anchors;
          for (VarMaxIndex = VarFrame.document.anchors.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
          {
            if (VarFrame.document.anchors[VarIndex].name == ParamAnchorName)
            {
              VarFrame.document.anchors[VarIndex].focus();

              // Exit loop
              //
              VarIndex = VarMaxIndex;
            }
          }
        }
      }
    }
  }
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHControlEntry_Object(ParamControlName,
                                 bParamEnabled,
                                 bParamStatus,
                                 ParamLabel,
                                 ParamIconEnabled,
                                 ParamIconDisabled,
                                 ParamAnchorMethod,
                                 ParamFrameName)
{
  this.mControlName  = ParamControlName;
  this.mbEnabled     = bParamEnabled;
  this.mbStatus      = bParamStatus;
  this.mLabel        = ParamLabel;
  this.mIconEnabled  = ParamIconEnabled;
  this.mIconDisabled = ParamIconDisabled;
  this.mAnchorMethod = ParamAnchorMethod;
  this.mFrameName    = ParamFrameName;

  this.fSetStatus  = WWHControlEntry_SetStatus;
  this.fGetIconURL = WWHControlEntry_GetIconURL;
  this.fGetHTML    = WWHControlEntry_GetHTML;
  this.fGetLabel   = WWHControlEntry_GetLabel;
  this.fUpdateIcon = WWHControlEntry_UpdateIcon;
}

function  WWHControlEntry_SetStatus(bParamStatus)
{
  if (this.mbEnabled)
  {
    this.mbStatus = bParamStatus;
  }
  else
  {
    this.mbStatus = false;
  }
}

function  WWHControlEntry_GetIconURL()
{
  var  VarIconURL = "";


  if (this.mbEnabled)
  {
    // Create absolute path to icon
    //
    VarIconURL += WWHFrame.WWHHelp.mHelpURLPrefix;
    VarIconURL += "wwhelp/wwhimpl/common/images/";

    // Determine which icon to return
    //
    if (this.mbStatus)
    {
      VarIconURL += this.mIconEnabled;
    }
    else
    {
      VarIconURL += this.mIconDisabled;
    }
  }

  return VarIconURL;
}

function  WWHControlEntry_GetHTML()
{
  var  VarHTML = "";
  var  VarStyleAttribute;
  var  VarLabel;


  // Set style attribute to insure small image height
  //
  VarStyleAttribute = " style=\"font-size: 1px; line-height: 1px;\"";

  if (this.mbEnabled)
  {
    // Set label
    //
    VarLabel = this.mLabel;
    if (WWHFrame.WWHHelp.mbAccessible)
    {
      if ( ! this.mbStatus)
      {
        VarLabel = WWHStringUtilities_FormatMessage(WWHFrame.WWHHelp.mMessages.mAccessibilityDisabledNavigationButton, this.mLabel);
        VarLabel = WWHStringUtilities_EscapeHTML(VarLabel);
      }
    }
    VarLabel = WWHStringUtilities_EscapeHTML(VarLabel);

    // Display control
    //
    VarHTML += "  <td width=\"23\">";
    VarHTML += "<div" + VarStyleAttribute + ">";
    VarHTML += "<a name=\"" + this.mControlName + "\" href=\"javascript:WWHFrame.WWHControls." + this.mAnchorMethod + "();\" title=\"" + VarLabel + "\">";
    VarHTML += "<img name=\"" + this.mControlName + "\" alt=\"" + VarLabel + "\" border=\"0\" src=\"" + this.fGetIconURL() + "\" width=\"23\" height=\"21\">";
    VarHTML += "</a>";
    VarHTML +=" </div>";
    VarHTML += "</td>\n";
  }

  return VarHTML;
}

function  WWHControlEntry_GetLabel()
{
  var  VarLabel = "";


  if (this.mbEnabled)
  {
    // Set label
    //
    VarLabel = this.mLabel;
  }

  return VarLabel;
}

function  WWHControlEntry_UpdateIcon()
{
  var  VarControlDocument;


  if (this.mbEnabled)
  {
    // Access control document
    //
    VarControlDocument = eval(WWHFrame.WWHHelp.fGetFrameReference(this.mFrameName) + ".document");

    // Update icon
    //
    VarControlDocument.images[this.mControlName].src = this.fGetIconURL();
  }
}

function  WWHControlEntries_Object()
{
}

function  WWHControls_Object()
{
  this.mControls      = new WWHControlEntries_Object();
  this.mSyncPrevNext  = new Array(null, null, null);
  this.mFocusedFrame  = "";
  this.mFocusedAnchor = "";

  this.fReloadControls        = WWHControls_ReloadControls;
  this.fControlsLoaded        = WWHControls_ControlsLoaded;
  this.fAddControl            = WWHControls_AddControl;
  this.fGetControl            = WWHControls_GetControl;
  this.fInitialize            = WWHControls_Initialize;
  this.fSansNavigation        = WWHControls_SansNavigation;
  this.fCanSyncTOC            = WWHControls_CanSyncTOC;
  this.fTopSpacerHTML         = WWHControls_TopSpacerHTML;
  this.fLeftHTML              = WWHControls_LeftHTML;
  this.fRightHTML             = WWHControls_RightHTML;
  this.fLeftFrameTitle        = WWHControls_LeftFrameTitle;
  this.fRightFrameTitle       = WWHControls_RightFrameTitle;
  this.fUpdateHREF            = WWHControls_UpdateHREF;
  this.fRecordFocus           = WWHControls_RecordFocus;
  this.fRestoreFocus          = WWHControls_RestoreFocus;
  this.fSwitchToNavigation    = WWHControls_SwitchToNavigation;
  this.fHasPDFLink            = WWHControls_HasPDFLink;
  this.fClickedShowNavigation = WWHControls_ClickedShowNavigation;
  this.fClickedSyncTOC        = WWHControls_ClickedSyncTOC;
  this.fClickedPrevious       = WWHControls_ClickedPrevious;
  this.fClickedNext           = WWHControls_ClickedNext;
  this.fClickedPDF            = WWHControls_ClickedPDF;
  this.fClickedRelatedTopics  = WWHControls_ClickedRelatedTopics;
  this.fClickedEmail          = WWHControls_ClickedEmail;
  this.fClickedPrint          = WWHControls_ClickedPrint;
  this.fShowNavigation        = WWHControls_ShowNavigation;
  this.fSyncTOC               = WWHControls_SyncTOC;
  this.fPrevious              = WWHControls_Previous;
  this.fNext                  = WWHControls_Next;
  this.fPDF                   = WWHControls_PDF;
  this.fRelatedTopics         = WWHControls_RelatedTopics;
  this.fEmail                 = WWHControls_Email;
  this.fPrint                 = WWHControls_Print;
  this.fProcessAccessKey      = WWHControls_ProcessAccessKey;
}

function  WWHControls_ReloadControls()
{
  // Load the left frame it it will cascade and load the other frames
  //
  WWHFrame.WWHHelp.fReplaceLocation("WWHControlsLeftFrame", WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/controll.htm");
}

function  WWHControls_ControlsLoaded(ParamDescription)
{
  if (ParamDescription == "left")
  {
    WWHFrame.WWHHelp.fReplaceLocation("WWHControlsRightFrame", WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/controlr.htm");
  }
  else if (ParamDescription == "right")
  {
    WWHFrame.WWHHelp.fReplaceLocation("WWHTitleFrame", WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/title.htm");
  }
  else  // (ParamDescription == "title")
  {
    if ( ! WWHFrame.WWHHelp.mbInitialized)
    {
      // All control frames are now loaded
      //
      WWHFrame.WWHHelp.fInitStage(5);
    }
    else
    {
      // Restore previous focus
      //
      this.fRestoreFocus();
    }
  }
}

function  WWHControls_AddControl(ParamControlName,
                                 bParamEnabled,
                                 bParamStatus,
                                 ParamLabel,
                                 ParamIconEnabled,
                                 ParamIconDisabled,
                                 ParamAnchorMethod,
                                 ParamFrameName)
{
  var  VarControlEntry;


  VarControlEntry = new WWHControlEntry_Object(ParamControlName,
                                               bParamEnabled,
                                               bParamStatus,
                                               ParamLabel,
                                               ParamIconEnabled,
                                               ParamIconDisabled,
                                               ParamAnchorMethod,
                                               ParamFrameName);

  this.mControls[ParamControlName + "~"] = VarControlEntry;
}

function  WWHControls_GetControl(ParamControlName)
{
  var  VarControlEntry;


  VarControlEntry = this.mControls[ParamControlName + "~"];
  if (typeof(VarControlEntry) == "undefined")
  {
    VarControlEntry = null;
  }

  return VarControlEntry;
}

function  WWHControls_Initialize()
{
  var  VarSettings;
  var  VarDocumentFrame;


  // Access settings
  //
  VarSettings = WWHFrame.WWHHelp.mSettings;

  // Confirm Sync TOC can be enabled
  //
  if (this.fSansNavigation())
  {
    VarSettings.mbSyncContentsEnabled = false;
  }

  // Confirm E-mail can be enabled
  //
  if (VarSettings.mbEmailEnabled)
  {
    VarSettings.mbEmailEnabled = ((typeof(VarSettings.mEmailAddress) == "string") &&
                                  (VarSettings.mEmailAddress.length > 0));
  }

  // Confirm Print can be enabled
  //
  if (VarSettings.mbPrintEnabled)
  {
    VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHTitleFrame"));
    VarSettings.mbPrintEnabled = ((typeof(VarDocumentFrame.focus) != "undefined") &&
                                  (typeof(VarDocumentFrame.print) != "undefined"))
  }

  // Create control entries
  //
  this.fAddControl("WWHFrameSetIcon", this.fSansNavigation(), this.fSansNavigation(),
                   WWHFrame.WWHHelp.mMessages.mShowNavigationIconLabel,
                   "shownav.gif", "shownav.gif", "fClickedShowNavigation", "WWHControlsLeftFrame");
  this.fAddControl("WWHSyncTOCIcon", VarSettings.mbSyncContentsEnabled, false,
                   WWHFrame.WWHHelp.mMessages.mSyncIconLabel,
                   "sync.gif", "syncx.gif", "fClickedSyncTOC", "WWHControlsLeftFrame");
  this.fAddControl("WWHPrevIcon", VarSettings.mbPrevEnabled, false,
                   WWHFrame.WWHHelp.mMessages.mPrevIconLabel,
                   "prev.gif", "prevx.gif", "fClickedPrevious", "WWHControlsLeftFrame");
  this.fAddControl("WWHNextIcon", VarSettings.mbNextEnabled, false,
                   WWHFrame.WWHHelp.mMessages.mNextIconLabel,
                   "next.gif", "nextx.gif", "fClickedNext", "WWHControlsLeftFrame");
  this.fAddControl("WWHPDFIcon", VarSettings.mbPDFEnabled, false,
                   WWHFrame.WWHHelp.mMessages.mPDFIconLabel,
                   "pdf.gif", "pdfx.gif", "fClickedPDF", "WWHControlsRightFrame");
  this.fAddControl("WWHRelatedTopicsIcon", VarSettings.mbRelatedTopicsEnabled, false,
                   WWHFrame.WWHHelp.mMessages.mRelatedTopicsIconLabel,
                   "related.gif", "relatedx.gif", "fClickedRelatedTopics", "WWHControlsRightFrame");
  this.fAddControl("WWHEmailIcon", VarSettings.mbEmailEnabled, false,
                   WWHFrame.WWHHelp.mMessages.mEmailIconLabel,
                   "email.gif", "emailx.gif", "fClickedEmail", "WWHControlsRightFrame");
  this.fAddControl("WWHPrintIcon", VarSettings.mbPrintEnabled, false,
                   WWHFrame.WWHHelp.mMessages.mPrintIconLabel,
                   "print.gif", "printx.gif", "fClickedPrint", "WWHControlsRightFrame");

  // Load control frames
  //
  this.fReloadControls();
}

function  WWHControls_SansNavigation()
{
  var  bSansNavigation = false;


  if (WWHFrame.WWHHelp.fSingleTopic())
  {
    bSansNavigation = true;
  }

  return bSansNavigation;
}

function  WWHControls_CanSyncTOC()
{
  var  bVarCanSyncTOC = false;


  if (this.mSyncPrevNext[0] != null)
  {
    bVarCanSyncTOC = true;
  }

  return bVarCanSyncTOC;
}

function  WWHControls_TopSpacerHTML()
{
  var  VarHTML = "";
  var  VarStyleAttribute;

  // Set style attribute to insure small image height
  //
  VarStyleAttribute = " style=\"font-size: 1px; line-height: 1px;\"";

  VarHTML += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
  VarHTML += " <tr>\n";
  VarHTML += "  <td><div" + VarStyleAttribute + "><img src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images/spc_tb_t.gif" + "\" alt=\"\"></div></td>\n";
  VarHTML += " </tr>\n";
  VarHTML += "</table>\n";

  return VarHTML;
}

function  WWHControls_LeftHTML()
{
  var  VarHTML = "";
  var  VarEnabledControls;
  var  VarControl;
  var  VarMaxIndex;
  var  VarIndex;

  // Confirm user did not reload the frameset
  //
  if (this.fGetControl("WWHFrameSetIcon") != null)
  {
    // Determine active controls
    //
    VarEnabledControls = new Array();
    VarControl = this.fGetControl("WWHFrameSetIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }
    VarControl = this.fGetControl("WWHSyncTOCIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }
    VarControl = this.fGetControl("WWHPrevIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }
    VarControl = this.fGetControl("WWHNextIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }

    // Emit HTML for controls
    //
    VarHTML += this.fTopSpacerHTML();
    if (VarEnabledControls.length > 0)
    {
      VarHTML += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
      VarHTML += " <tr>\n";

      VarHTML += "  <td><div><img src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images/spc_tb_l.gif" + "\" alt=\"\"></div></td>\n";
      for (VarMaxIndex = VarEnabledControls.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
      {
        VarHTML += VarEnabledControls[VarIndex].fGetHTML();
        if ((VarIndex + 1) < VarMaxIndex)
        {
          VarHTML += "  <td><div><img src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images/spc_tb_m.gif" + "\" alt=\"\"></div></td>\n";
        }
      }

      VarHTML += " </tr>\n";
      VarHTML += "</table>\n";
    }
  }

  return VarHTML;
}

function  WWHControls_RightHTML()
{
  var  VarHTML = "";
  var  VarEnabledControls;
  var  VarControl;
  var  VarMaxIndex;
  var  VarIndex;

  // Confirm user did not reload the frameset
  //
  if (this.fGetControl("WWHRelatedTopicsIcon") != null)
  {
    // Determine active controls
    //
    VarEnabledControls = new Array();
    VarControl = this.fGetControl("WWHPDFIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }
    VarControl = this.fGetControl("WWHRelatedTopicsIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }
    VarControl = this.fGetControl("WWHEmailIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }
    VarControl = this.fGetControl("WWHPrintIcon");
    if (VarControl.mbEnabled)
    {
      VarEnabledControls[VarEnabledControls.length] = VarControl;
    }

    // Emit HTML for controls
    //
    VarHTML += this.fTopSpacerHTML();
    if (VarEnabledControls.length > 0)
    {
      VarHTML += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
      VarHTML += " <tr>\n";

      for (VarMaxIndex = VarEnabledControls.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
      {
        VarHTML += VarEnabledControls[VarIndex].fGetHTML();
        if ((VarIndex + 1) < VarMaxIndex)
        {
          VarHTML += "  <td><div><img src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images/spc_tb_m.gif" + "\" alt=\"\"></div></td>\n";
        }
      }
      VarHTML += "  <td><div><img src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images/spc_tb_r.gif" + "\" alt=\"\"></div></td>\n";

      VarHTML += " </tr>\n";
      VarHTML += "</table>\n";
    }
  }

  return VarHTML;
}

function  WWHControls_LeftFrameTitle()
{
  var  VarTitle = "";


  if (this.fGetControl("WWHFrameSetIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHFrameSetIcon").fGetLabel();
  }

  if (this.fGetControl("WWHSyncTOCIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHSyncTOCIcon").fGetLabel();
  }

  if (this.fGetControl("WWHPrevIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHPrevIcon").fGetLabel();
  }

  if (this.fGetControl("WWHNextIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHNextIcon").fGetLabel();
  }

  return VarTitle;
}

function  WWHControls_RightFrameTitle()
{
  var  VarTitle = "";


  if (this.fGetControl("WWHPDFIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHPDFIcon").fGetLabel();
  }

  if (this.fGetControl("WWHRelatedTopicsIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHRelatedTopicsIcon").fGetLabel();
  }

  if (this.fGetControl("WWHEmailIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHEmailIcon").fGetLabel();
  }

  if (this.fGetControl("WWHPrintIcon").fGetLabel().length > 0)
  {
    if (VarTitle.length > 0)
    {
      VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
    }
    VarTitle += this.fGetControl("WWHPrintIcon").fGetLabel();
  }

  return VarTitle;
}

function  WWHControls_UpdateHREF(ParamHREF)
{
  // Update sync/prev/next array
  //
  this.mSyncPrevNext = WWHFrame.WWHHelp.fGetSyncPrevNext(ParamHREF);

  // Update status
  //
  this.fGetControl("WWHFrameSetIcon").fSetStatus(this.fSansNavigation());
  this.fGetControl("WWHSyncTOCIcon").fSetStatus(this.fCanSyncTOC());
  this.fGetControl("WWHPrevIcon").fSetStatus(this.mSyncPrevNext[1] != null);
  this.fGetControl("WWHNextIcon").fSetStatus(this.mSyncPrevNext[2] != null);
  this.fGetControl("WWHPDFIcon").fSetStatus(this.fHasPDFLink());
  this.fGetControl("WWHRelatedTopicsIcon").fSetStatus(WWHFrame.WWHRelatedTopics.fHasRelatedTopics());
  this.fGetControl("WWHEmailIcon").fSetStatus(this.fCanSyncTOC());
  this.fGetControl("WWHPrintIcon").fSetStatus(this.fCanSyncTOC());

  // Update controls
  //
  if (WWHFrame.WWHHelp.mbAccessible)
  {
    // Reload control frames
    //
    this.fReloadControls();
  }
  else
  {
    // Update icons in place
    //
    this.fGetControl("WWHFrameSetIcon").fUpdateIcon();
    this.fGetControl("WWHSyncTOCIcon").fUpdateIcon();
    this.fGetControl("WWHPrevIcon").fUpdateIcon();
    this.fGetControl("WWHNextIcon").fUpdateIcon();
    this.fGetControl("WWHPDFIcon").fUpdateIcon();
    this.fGetControl("WWHRelatedTopicsIcon").fUpdateIcon();
    this.fGetControl("WWHEmailIcon").fUpdateIcon();
    this.fGetControl("WWHPrintIcon").fUpdateIcon();

    // Restore previous focus
    //
    this.fRestoreFocus();
  }
}

function  WWHControls_RecordFocus(ParamFrameName,
                                  ParamAnchorName)
{
  this.mFocusedFrame  = ParamFrameName;
  this.mFocusedAnchor = ParamAnchorName;
}

function  WWHControls_RestoreFocus()
{
  if ((this.mFocusedFrame.length > 0) &&
      (this.mFocusedAnchor.length > 0))
  {
    WWHFrame.WWHHelp.fFocus(this.mFocusedFrame, this.mFocusedAnchor);
  }

  this.mFocusedFrame  = "";
  this.mFocusedAnchor = "";
}

function  WWHControls_SwitchToNavigation(ParamTabName)
{
  var  VarDocumentFrame;
  var  VarDocumentURL;
  var  VarSwitchURL;


  // Switch to navigation
  //
  VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));
  VarDocumentURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
  VarDocumentURL = WWHFrame.WWHHelp.fGetBookFileHREF(VarDocumentURL);
  VarSwitchURL = WWHFrame.WWHHelp.mHelpURLPrefix + "/wwhelp/wwhimpl/common/html/switch.htm?href=" + VarDocumentURL;
  if (WWHFrame.WWHHelp.mbAccessible)
  {
    VarSwitchURL += "&accessible=true";
  }
  if ((typeof(ParamTabName) != "undefined") &&
      (ParamTabName != null))
  {
    VarSwitchURL += "&tab=" + ParamTabName;
  }
  WWHFrame.WWHSwitch.fExec(false, VarSwitchURL);
}

function  WWHControls_HasPDFLink()
{
  var  VarHasPDFLink = false;
  var  VarDocumentFrame;

  VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));
  VarHasPDFLink = ((typeof VarDocumentFrame.WWHPDFLink) == "function");

  return VarHasPDFLink;
}

function  WWHControls_ClickedShowNavigation()
{
  this.fShowNavigation();
}

function  WWHControls_ClickedSyncTOC()
{
  this.fSyncTOC(true);
}

function  WWHControls_ClickedPrevious()
{
  // Record focused icon
  //
  this.fRecordFocus("WWHControlsLeftFrame", "WWHPrevIcon");

  this.fPrevious();
}

function  WWHControls_ClickedNext()
{
  // Record focused icon
  //
  this.fRecordFocus("WWHControlsLeftFrame", "WWHNextIcon");

  this.fNext();
}

function  WWHControls_ClickedPDF()
{
  this.fPDF();
}

function  WWHControls_ClickedRelatedTopics()
{
  this.fRelatedTopics();
}

function  WWHControls_ClickedEmail()
{
  this.fEmail();
}

function  WWHControls_ClickedPrint()
{
  this.fPrint();
}

function  WWHControls_ShowNavigation()
{
  var  VarDocumentFrame;
  var  VarDocumentURL;


  if (WWHFrame.WWHHandler.fIsReady())
  {
    this.fSwitchToNavigation();
  }
}

function  WWHControls_SyncTOC(bParamReportError)
{
  if (this.fCanSyncTOC())
  {
    if (WWHFrame.WWHHandler.fIsReady())
    {
      WWHFrame.WWHHelp.fSyncTOC(this.mSyncPrevNext[0], bParamReportError);
    }
  }
}

function  WWHControls_Previous()
{
  if (this.mSyncPrevNext[1] != null)
  {
    WWHFrame.WWHHelp.fSetDocumentHREF(this.mSyncPrevNext[1], false);
  }
}

function  WWHControls_Next()
{
  if (this.mSyncPrevNext[2] != null)
  {
    WWHFrame.WWHHelp.fSetDocumentHREF(this.mSyncPrevNext[2], false);
  }
}

function  WWHControls_PDF()
{
  var  VarDocumentFrame;
  var  VarDocumentURL;
  var  VarDocumentParentURL;
  var  VarPDFLink;
  var  VarPDFURL;

  VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));
  if ((typeof VarDocumentFrame.WWHPDFLink) == "function")
  {
    VarIndex = VarDocumentFrame.location.href.lastIndexOf("/");
    VarDocumentParentURL = VarDocumentFrame.location.href.substring(0, VarIndex);
    VarPDFLink = VarDocumentFrame.WWHPDFLink();
    VarPDFURL = VarDocumentParentURL + "/" + VarPDFLink;

    WWHFrame.WWHHelp.fSetLocation("WWHDocumentFrame", VarPDFURL);
  }
}

function  WWHControls_RelatedTopics()
{
  var  VarDocumentFrame;
  var  VarDocumentURL;


  if (WWHFrame.WWHRelatedTopics.fHasRelatedTopics())
  {
    if (WWHFrame.WWHBrowser.mbSupportsPopups)
    {
      WWHFrame.WWHRelatedTopics.fShow();
    }
    else
    {
      VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));

      VarDocumentURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
      VarDocumentURL = WWHStringUtilities_GetURLFilePathOnly(VarDocumentURL);

      WWHFrame.WWHHelp.fSetLocation("WWHDocumentFrame", VarDocumentURL + "#WWHRelatedTopics");
    }
  }
}

function  WWHControls_Email()
{
  var  VarLocation;
  var  VarMessage;
  var  VarMailTo;


  if (this.fCanSyncTOC())
  {
    VarLocation = escape(this.mSyncPrevNext[0]);
    VarMessage = "Feedback: " + VarLocation;
    VarMailTo = "mailto:" + WWHFrame.WWHHelp.mSettings.mEmailAddress + "?subject=" + VarMessage + "&body=" + VarMessage;

    WWHFrame.WWHHelp.fSetLocation("WWHDocumentFrame", VarMailTo);
  }
}

function  WWHControls_Print()
{
  var  VarDocumentFrame;


  if (this.fCanSyncTOC())
  {
    VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));

    VarDocumentFrame.focus();
    VarDocumentFrame.print();
  }
}

function  WWHControls_ProcessAccessKey(ParamAccessKey)
{
  switch (ParamAccessKey)
  {
    case 4:
      this.fClickedPrevious();
      break;

    case 5:
      this.fClickedNext();
      break;

    case 6:
      this.fClickedRelatedTopics();
      break;

    case 7:
      this.fClickedEmail();
      break;

    case 8:
      this.fClickedPrint();
      break;
  }
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHFile_Object(ParamTitle,
                         ParamHREF)
{
  this.mTitle = ParamTitle;
  this.mHREF  = ParamHREF;
}

function  WWHFileList_Object()
{
  this.mFileList = new Array();
  this.mFileHash = new WWHFileHash_Object();

  this.fEntries          = WWHFileList_Entries;
  this.fAddFile          = WWHFileList_AddFile;
  this.fA                = WWHFileList_AddFile;
  this.fHREFToIndex      = WWHFileList_HREFToIndex;
  this.fHREFToTitle      = WWHFileList_HREFToTitle;
  this.fFileIndexToHREF  = WWHFileList_FileIndexToHREF;
  this.fFileIndexToTitle = WWHFileList_FileIndexToTitle;
}

function  WWHFileList_Entries()
{
  return this.mFileList.length;
}

function  WWHFileList_AddFile(ParamTitle,
                              ParamHREF)
{
  // Store unescaped to avoid browser specific auto-unescape behaviors
  //
  this.mFileHash[unescape(ParamHREF) + "~"] = this.mFileList.length;
  this.mFileList[this.mFileList.length] = new WWHFile_Object(ParamTitle, ParamHREF);
}

function  WWHFileList_HREFToIndex(ParamHREF)
{
  var  MatchIndex = -1;
  var  Match;


  // Query unescaped to avoid browser specific auto-unescape behaviors
  //
  Match = this.mFileHash[unescape(ParamHREF) + "~"];
  if (typeof(Match) != "undefined")
  {
    MatchIndex = Match;
  }

  return MatchIndex;
}

function  WWHFileList_HREFToTitle(ParamHREF)
{
  var  Title = "";
  var  MatchIndex;


  MatchIndex = this.fHREFToIndex(ParamHREF);
  if (MatchIndex != -1)
  {
    Title = this.mFileList[MatchIndex].mTitle;
  }
  else
  {
    Title = WWHStringUtilities_EscapeHTML(ParamHREF);
  }

  return Title;
}

function  WWHFileList_FileIndexToHREF(ParamIndex)
{
  return this.mFileList[ParamIndex].mHREF;
}

function  WWHFileList_FileIndexToTitle(ParamIndex)
{
  return this.mFileList[ParamIndex].mTitle;
}

function  WWHFileHash_Object()
{
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHHandler_Object()
{
  this.mbInitialized = false;

  this.fInit              = WWHHandler_Init;
  this.fFinalize          = WWHHandler_Finalize;
  this.fGetFrameReference = WWHHandler_GetFrameReference;
  this.fGetFrameName      = WWHHandler_GetFrameName;
  this.fIsReady           = WWHHandler_IsReady;
  this.fUpdate            = WWHHandler_Update;
  this.fSyncTOC           = WWHHandler_SyncTOC;
  this.fFavoritesCurrent  = WWHHandler_FavoritesCurrent;
  this.fProcessAccessKey  = WWHHandler_ProcessAccessKey;
  this.fGetCurrentTab     = WWHHandler_GetCurrentTab;
  this.fSetCurrentTab     = WWHHandler_SetCurrentTab;
}

function  WWHHandler_Init()
{
  this.mbInitialized = true;
  WWHFrame.WWHHelp.fHandlerInitialized();
}

function  WWHHandler_Finalize()
{
}

function  WWHHandler_GetFrameReference(ParamFrameName)
{
  var  VarFrameReference;


  // Nothing to do
  //

  return VarFrameReference;
}

function  WWHHandler_GetFrameName(ParamFrameName)
{
  var  VarName = null;


  // Nothing to do
  //

  return VarName;
}

function  WWHHandler_IsReady()
{
  var  bVarIsReady = true;


  return bVarIsReady;
}

function  WWHHandler_Update(ParamBookIndex,
                            ParamFileIndex)
{
}

function  WWHHandler_SyncTOC(ParamBookIndex,
                             ParamFileIndex,
                             ParamAnchor,
                             bParamReportError)
{
  setTimeout("WWHFrame.WWHControls.fSwitchToNavigation();", 1);
}

function  WWHHandler_FavoritesCurrent(ParamBookIndex,
                                      ParamFileIndex)
{
}

function  WWHHandler_ProcessAccessKey(ParamAccessKey)
{
  switch (ParamAccessKey)
  {
    case 1:
      WWHFrame.WWHControls.fSwitchToNavigation("contents");
      break;

    case 2:
      WWHFrame.WWHControls.fSwitchToNavigation("index");
      break;

    case 3:
      WWHFrame.WWHControls.fSwitchToNavigation("search");
      break;
  }
}

function  WWHHandler_GetCurrentTab()
{
  var  VarCurrentTab;


  // Initialize return value
  //
  VarCurrentTab = "";

  return VarCurrentTab;
}

function  WWHHandler_SetCurrentTab(ParamTabName)
{
}
// Copyright (c) 2000-2005 Quadralay Corporation.  All rights reserved.
//

function  WWHHelp_Object(ParamURL)
{
  var  URLParams;


  this.mbInitialized        = false;
  this.mbAccessible         = false;
  this.mInitialTabName      = null;
  this.mNewTabName          = null;
  this.mInitStage           = 0;
  this.mSettings            = new WWHCommonSettings_Object();
  this.mMessages            = new WWHCommonMessages_Object();
  this.mDocumentLoaded      = null;
  this.mLocationURL         = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);
  this.mBaseURL             = WWHStringUtilities_GetBaseURL(this.mLocationURL);
  this.mHelpURLPrefix       = this.mBaseURL;
  this.mContextDir          = null;
  this.mTopicTag            = null;
  this.mDocumentURL         = "";
  this.mPopup               = null;
  this.mPopupContext        = "";
  this.mPopupLink           = "";
  this.mPopupLoaded         = false;
  this.mPopupHideDisabled   = false;
  this.mBookGroups          = new WWHBookGroups_Object();
  this.mBooks               = new WWHBookList_Object();
  this.mFavoritesCookie     = "WWH" + this.mSettings.mCookiesID + "_Favs";
  this.mbIgnoreNextKeyPress = false;
  this.mbAltKeyDown         = false;
  this.mAccessKey           = -1;
  this.mbAutoSyncTOC        = false;
  this.mbAlwaysSyncTOC      = true;
  this.mCollapsingTOCEntry  = false;
  this.mImages              = new Array();

  this.fSingleTopic                    = WWHHelp_SingleTopic;
  this.fGetFrameReference              = WWHHelp_GetFrameReference;
  this.fSetLocation                    = WWHHelp_SetLocation;
  this.fReplaceLocation                = WWHHelp_ReplaceLocation;
  this.fReloadLocation                 = WWHHelp_ReloadLocation;
  this.fGetURLParameters               = WWHHelp_GetURLParameters;
  this.fCookiesEnabled                 = WWHHelp_CookiesEnabled;
  this.fInitStage                      = WWHHelp_InitStage;
  this.fHandlerInitialized             = WWHHelp_HandlerInitialized;
  this.fGetFrameName                   = WWHHelp_GetFrameName;
  this.fSetFrameName                   = WWHHelp_SetFrameName;
  this.fSetDocumentFrameWithURL        = WWHHelp_SetDocumentFrameWithURL;
  this.fSetDocumentFrame               = WWHHelp_SetDocumentFrame;
  this.fSetDocumentHREF                = WWHHelp_SetDocumentHREF;
  this.fGetBookIndexFileIndexURL       = WWHHelp_GetBookIndexFileIndexURL;
  this.fDetermineContextDocument       = WWHHelp_DetermineContextDocument;
  this.fLoadTopicData                  = WWHHelp_LoadTopicData;
  this.fProcessTopicResult             = WWHHelp_ProcessTopicResult;
  this.fDisplayContextDocument         = WWHHelp_DisplayContextDocument;
  this.fSetContextDocument             = WWHHelp_SetContextDocument;
  this.fGetBookFileHREF                = WWHHelp_GetBookFileHREF;
  this.fHREFToBookIndexFileIndexAnchor = WWHHelp_HREFToBookIndexFileIndexAnchor;
  this.fGetSyncPrevNext                = WWHHelp_GetSyncPrevNext;
  this.fHREFToTitle                    = WWHHelp_HREFToTitle;
  this.fEscapeHTML                     = WWHHelp_EscapeHTML;
  this.fPopupHTML                      = WWHHelp_PopupHTML;
  this.fShowPopup                      = WWHHelp_ShowPopup;
  this.fPopupAdjustSize                = WWHHelp_PopupAdjustSize;
  this.fPopupLoaded                    = WWHHelp_PopupLoaded;
  this.fRevealPopup                    = WWHHelp_RevealPopup;
  this.fResetPopupHideDisabled         = WWHHelp_ResetPopupHideDisabled;
  this.fHidePopup                      = WWHHelp_HidePopup;
  this.fClickedPopup                   = WWHHelp_ClickedPopup;
  this.fDisplayFile                    = WWHHelp_DisplayFile;
  this.fDisplayFirst                   = WWHHelp_DisplayFirst;
  this.fShowTopic                      = WWHHelp_ShowTopic;
  this.fUpdate                         = WWHHelp_Update;
  this.fUpdateHash                     = WWHHelp_UpdateHash;
  this.fSyncTOC                        = WWHHelp_SyncTOC;
  this.fFavoritesCurrent               = WWHHelp_FavoritesCurrent;
  this.fDocumentBookkeeping            = WWHHelp_DocumentBookkeeping;
  this.fAutoSyncTOC                    = WWHHelp_AutoSyncTOC;
  this.fUnload                         = WWHHelp_Unload;
  this.fIgnoreNextKeyPress             = WWHHelp_IgnoreNextKeyPress;
  this.fHandleKeyDown                  = WWHHelp_HandleKeyDown;
  this.fHandleKeyPress                 = WWHHelp_HandleKeyPress;
  this.fHandleKeyUp                    = WWHHelp_HandleKeyUp;
  this.fProcessAccessKey               = WWHHelp_ProcessAccessKey;
  this.fFocus                          = WWHHelp_Focus;

  // Load up messages
  //
  this.mMessages.fSetByLocale(WWHFrame.WWHBrowser.mLocale);

  // Set cookie path
  //
  WWHFrame.WWHBrowser.fSetCookiePath(WWHStringUtilities_GetBaseURL(ParamURL));

  // Check URL parameters
  //
  URLParams = this.fGetURLParameters(this.mLocationURL);

  // Set accessibility flag
  //
  if (this.mSettings.mAccessible == "true")
  {
    this.mbAccessible = true;
  }
  else
  {
    if (URLParams[4] != null)
    {
      if (URLParams[4] == "true")
      {
        this.mbAccessible = true;
      }
    }
  }

  // Determine initial tab
  //
  if (URLParams[5] != null)
  {
    this.mInitialTabName = URLParams[5];
  }

  // Set popup capabilities
  //
  if (this.mbAccessible)
  {
    WWHFrame.WWHBrowser.mbSupportsPopups = false;
    WWHFrame.WWHBrowser.mbSupportsIFrames = false;
  }

  // Create popup
  //
  this.mPopup = new WWHPopup_Object("WWHFrame.WWHHelp.mPopup",
                                    this.fGetFrameReference("WWHDocumentFrame"),
                                    WWHPopupFormat_Translate,
                                    WWHPopupFormat_Format,
                                    "WWHPopupDIV", "WWHPopupText", 500, 12, 20,
                                    this.mSettings.mPopup.mWidth);
}

function  WWHHelp_SingleTopic()
{
  var  bVarSingleTopic = false;


  if (this.mLocationURL.indexOf("wwhelp/wwhimpl/common/html/wwhelp.htm") != -1)
  {
    bVarSingleTopic = true;
  }

  return bVarSingleTopic;
}

function  WWHHelp_GetFrameReference(ParamFrameName)
{
  var  VarFrameReference;


  switch (ParamFrameName)
  {
    case "WWHFrame":
      // WWHFrame
      //
      VarFrameReference = "WWHFrame";
      break;

    case "WWHNavigationFrame":
      // WWHFrame.WWHNavigationFrame
      //
      VarFrameReference = "WWHFrame.frames[0]";
      break;

    case "WWHTabsFrame":
    case "WWHPanelFrame":
    case "WWHPanelNavigationFrame":
    case "WWHPanelViewFrame":
      // WWHFrame.WWHNavigationFrame.WWHTabsFrame
      //
      // WWHFrame.WWHNavigationFrame.WWHPanelFrame
      //
      // WWHFrame.WWHNavigationFrame.WWHPanelFrame.WWHPanelNavigationFrame
      //
      // WWHFrame.WWHNavigationFrame.WWHPanelFrame.WWHPanelViewFrame
      //
      VarFrameReference = WWHFrame.WWHHandler.fGetFrameReference(ParamFrameName);
      break;

    case "WWHContentFrame":
      // WWHFrame.WWHContentFrame
      //
      if (this.fSingleTopic())
      {
        VarFrameReference = "WWHFrame";
      }
      else
      {
        VarFrameReference = "WWHFrame.frames[1]";
      }
      break;

    case "WWHPageNavFrame":
      // WWHFrame.WWHContentFrame.WWHPageNavFrame
      //
      VarFrameReference = this.fGetFrameReference("WWHContentFrame") + ".frames[0]";
      break;

    case "WWHControlsLeftFrame":
      // WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsLeftFrame
      //
      VarFrameReference = this.fGetFrameReference("WWHPageNavFrame") + ".frames[0]";
      break;

    case "WWHTitleFrame":
      // WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHTitleFrame
      //
      VarFrameReference = this.fGetFrameReference("WWHPageNavFrame") + ".frames[1]";
      break;

    case "WWHControlsRightFrame":
      // WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsRightFrame
      //
      VarFrameReference = this.fGetFrameReference("WWHPageNavFrame") + ".frames[2]";
      break;

    case "WWHDocumentFrame":
      // WWHFrame.WWHContentFrame.WWHDocumentFrame
      //
      VarFrameReference = this.fGetFrameReference("WWHContentFrame") + ".frames[1]";
      break;

    default:
      VarFrameReference = null;
      break;
  }

  return VarFrameReference;
}

function  WWHHelp_SetLocation(ParamFrame,
                              ParamURL)
{
  var  VarFrameReference;


  VarFrameReference = this.fGetFrameReference(ParamFrame);
  WWHFrame.WWHBrowser.fSetLocation(VarFrameReference, ParamURL);
}

function  WWHHelp_ReplaceLocation(ParamFrame,
                                  ParamURL)
{
  var  VarFrameReference;


  VarFrameReference = this.fGetFrameReference(ParamFrame);
  WWHFrame.WWHBrowser.fReplaceLocation(VarFrameReference, ParamURL);
}

function  WWHHelp_ReloadLocation(ParamFrame)
{
  var  VarFrameReference;


  VarFrameReference = this.fGetFrameReference(ParamFrame);
  WWHFrame.WWHBrowser.fReloadLocation(VarFrameReference);
}

function  WWHHelp_GetURLParameters(ParamURL)
{
  var  URLParams = new Array(null, null, null, null, null, null);
  var  Parts;
  var  ContextMarker    = "context=";
  var  TopicMarker      = "topic=";
  var  FileMarker       = "file=";
  var  HREFMarker       = "href=";
  var  AccessibleMarker = "accessible=";
  var  TabMarker        = "tab=";
  var  MaxIndex;
  var  Index;

  // Using a closure for this function. It is copied in switch.js as well
  //
  function GetDelimitedArguments(ParamURL) 
  {
    var  Parts = [];
    var  Parameters;

    // Process URL parameters
    //
    if (ParamURL.indexOf("?") != -1)
    {
      Parts = ParamURL.split("?");
    }
    else if (ParamURL.indexOf("#") != -1)
    {
      Parts = ParamURL.split("#");
      Parameters = Parts.slice(1).join("#");
      Parts.length = 2;
      Parts[1] = Parameters;
    }

    return Parts;
  }

  // Check for possible context specification
  //
  Parts = GetDelimitedArguments(ParamURL);
  if (Parts.length > 1) 
  {
    // Get parameters
    //
    Parts[0] = Parts[1];
    Parts.length = 1;
    if (Parts[0].indexOf("&") != -1)
    {
      Parts = Parts[0].split("&");
    }

    // Process parameters
    //
    for (MaxIndex = Parts.length, Index = 0 ; Index < MaxIndex ; Index++)
    {
      if (Parts[Index].indexOf(ContextMarker) == 0)
      {
        URLParams[0] = Parts[Index].substring(ContextMarker.length, Parts[Index].length);
      }
      if (Parts[Index].indexOf(TopicMarker) == 0)
      {
        URLParams[1] = Parts[Index].substring(TopicMarker.length, Parts[Index].length);
      }
      if (Parts[Index].indexOf(FileMarker) == 0)
      {
        URLParams[2] = Parts[Index].substring(FileMarker.length, Parts[Index].length);
      }
      if (Parts[Index].indexOf(HREFMarker) == 0)
      {
        URLParams[3] = Parts[Index].substring(HREFMarker.length, Parts[Index].length);
      }
      if (Parts[Index].indexOf(AccessibleMarker) == 0)
      {
        URLParams[4] = Parts[Index].substring(AccessibleMarker.length, Parts[Index].length);
      }
      if (Parts[Index].indexOf(TabMarker) == 0)
      {
        URLParams[5] = Parts[Index].substring(TabMarker.length, Parts[Index].length);
      }
    }

    // Make certain we have both a ContextTag and either a TopicTag or FileTag
    // Otherwise, reset them
    //
    if ((URLParams[0] == null) ||
        ((URLParams[1] == null) &&
         (URLParams[2] == null)))
    {
      URLParams[0] = null;
      URLParams[1] = null;
      URLParams[2] = null;
    }
  }

  return URLParams;
}

function  WWHHelp_CookiesEnabled()
{
  var  bVarEnabled;


  bVarEnabled = false;
  if ((WWHFrame.WWHHelp.mSettings.mbCookies) &&
      (WWHFrame.WWHBrowser.fCookiesEnabled()))
  {
    bVarEnabled = true;
  }

  return bVarEnabled;
}

function  WWHHelp_InitStage(ParamStage)
{
  if (( ! this.mbInitialized) &&
      (ParamStage == this.mInitStage))
  {
    // Perform actions for current init stage
    //
    switch (this.mInitStage)
    {
      case 0:  // Start initialization process
        // Alert the user if this browser is unsupported
        //
        if (WWHFrame.WWHBrowser.mbUnsupported)
        {
          alert(WWHFrame.WWHHelp.mMessages.mBrowserNotSupported);
        }

        this.fReplaceLocation("WWHControlsLeftFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init0.htm");
        break;

      case 1:  // Prep book data
        this.fReplaceLocation("WWHControlsLeftFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init1.htm");
        break;

      case 2:  // Load book data
        this.fReplaceLocation("WWHControlsLeftFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init2.htm");
        break;

      case 3:  // Handler setup
        // Initialize handler
        //
        WWHFrame.WWHHandler.fInit();
        break;

      case 4:  // Display controls
        // Preload graphics
        //
        WWHHelpUtilities_PreloadGraphics();

        // Initialize controls
        //
        WWHFrame.WWHControls.fInitialize();
        break;

      case 5:  // Display document
        this.fSetDocumentFrame();
        this.mbInitialized = true;

        // Set frame names for accessibility
        //
        if (this.mbAccessible)
        {
          WWHFrame.WWHHelp.fSetFrameName("WWHControlsLeftFrame");
          WWHFrame.WWHHelp.fSetFrameName("WWHTitleFrame");
          WWHFrame.WWHHelp.fSetFrameName("WWHControlsRightFrame");
          WWHFrame.WWHHelp.fSetFrameName("WWHDocumentFrame");
        }

        // Finalize hander
        //
        WWHFrame.WWHHandler.fFinalize();
        break;
    }

    // Increment stage
    //
    this.mInitStage++;
  }

  return 0;
}

function  WWHHelp_HandlerInitialized()
{
  if (WWHFrame.WWHHelp.mInitStage > 0)
  {
    if (WWHFrame.WWHHandler.mbInitialized)
    {
      this.fReplaceLocation("WWHControlsRightFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init3.htm");
    }
  }
}

function  WWHHelp_GetFrameName(ParamFrameName)
{
  var  VarName;


  // Determine name for this frame
  //
  VarName = null;
  switch (ParamFrameName)
  {
    case "WWHFrame":
      // Nothing to do
      //
      break;

    case "WWHNavigationFrame":
      // Nothing to do
      //
      break;

    case "WWHTabsFrame":
    case "WWHPanelFrame":
    case "WWHPanelNavigationFrame":
    case "WWHPanelViewFrame":
      VarName = WWHFrame.WWHHandler.fGetFrameName(ParamFrameName);
      break;

    case "WWHContentFrame":
      // Nothing to do
      //
      break;

    case "WWHPageNavFrame":
      // Nothing to do
      //
      break;

    case "WWHControlsLeftFrame":
      VarName = WWHStringUtilities_EscapeHTML(WWHFrame.WWHControls.fLeftFrameTitle());
      break;

    case "WWHTitleFrame":
      VarName = "";
      break;

    case "WWHControlsRightFrame":
      VarName = WWHStringUtilities_EscapeHTML(WWHFrame.WWHControls.fRightFrameTitle());
      break;

    case "WWHDocumentFrame":
      VarName = WWHStringUtilities_EscapeHTML(WWHFrame.WWHHelp.mMessages.mAccessibilityDocumentFrameName);
      break;
  }
}

function  WWHHelp_SetFrameName(ParamFrameName)
{
  var  VarName;
  var  VarFrame;


  if (WWHFrame.WWHBrowser.mbSupportsFrameRenaming)
  {
    // Get frame name
    //
    VarName = this.fGetFrameName(ParamFrameName);
    if (VarName != null)
    {
      // Set frame name
      //
      VarFrame = eval(this.fGetFrameReference(ParamFrameName));
      VarFrame.name = VarName;
    }
  }
}

function  WWHHelp_SetDocumentFrameWithURL(ParamURL)
{
  var  VarURLParameters;
  var  VarParts;
  var  VarLocationURLNoParams;
  var  VarNewLocationURL;


  // Determine location URL
  //
  VarLocationURLNoParams = "";
  if (this.mLocationURL.indexOf("?") != -1)
  {
    VarParts = this.mLocationURL.split("?");
    VarLocationURLNoParams = VarParts[0];
  }
  else if (this.mLocationURL.indexOf("#") != -1)
  {
    VarParts = this.mLocationURL.split("#");
    VarLocationURLNoParams = VarParts[0];
  }
  if (VarLocationURLNoParams.length == 0)
  {
    VarLocationURLNoParams = this.mLocationURL;
  }

  // Preserve URL parameter info
  //
  VarURLParameters = "";
  if (ParamURL.indexOf("?") != -1)
  {
    VarParts = ParamURL.split("?");
    if ((VarParts.length > 1) &&
        (VarParts[1].length > 0))
    {
      VarURLParameters = VarParts[1];
    }
  }
  else if (ParamURL.indexOf("#") != -1)
  {
    VarParts = ParamURL.split("#");
    if ((VarParts.length > 1) &&
        (VarParts[1].length > 0))
    {
      // Ensure trailing anchor hashes are preserved
      //
      VarURLParameters = VarParts.slice(1).join("#");
    }
  }

  // Build new location URL
  //
  VarNewLocationURL = VarLocationURLNoParams + "?" + VarURLParameters;

  // Update location and redirect
  //
  this.mLocationURL = VarNewLocationURL;
  this.fSetDocumentFrame();
}

function  WWHHelp_SetDocumentFrame()
{
  var  DocumentLoaded;
  var  ContextDocumentURL;
  var  bVarReplace;
  var  VarDocumentFrame;


  // Preserve current document if user clicked forward or back to see it
  //
  if (this.mDocumentLoaded != null)
  {
    DocumentLoaded = this.mDocumentLoaded;

    this.mDocumentLoaded = null;
    this.fUpdate(DocumentLoaded);
  }
  else
  {
    // Replace document frame if "about:blank" or "blank.htm" currently displayed
    //
    bVarReplace = false;
    VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));
    if ((VarDocumentFrame.location.href.indexOf("about:blank") != -1) ||
        (VarDocumentFrame.location.href.indexOf("wwhelp/wwhimpl/common/html/blank.htm") != -1))
    {
      bVarReplace = true;
    }

    // Display document or determine correct document to display
    //
    ContextDocumentURL = this.fDetermineContextDocument();
    if (ContextDocumentURL != null)
    {
      this.fSetDocumentHREF(ContextDocumentURL, bVarReplace);
    }
    else  // Load topic data to determine document to display
    {
      this.fSetDocumentHREF(this.mBaseURL + "wwhelp/wwhimpl/common/html/document.htm", bVarReplace);
    }
  }
}

function  WWHHelp_SetDocumentHREF(ParamURL,
                                  bParamReplace)
{
  if (ParamURL.length > 0)
  {
    if (bParamReplace)
    {
      this.fReplaceLocation("WWHDocumentFrame", ParamURL);
    }
    else
    {
      this.fSetLocation("WWHDocumentFrame", ParamURL);
    }
  }
}

function  WWHHelp_GetBookIndexFileIndexURL(ParamBookIndex,
                                           ParamFileIndex,
                                           ParamAnchor)
{
  var  URL = "";
  var  BookListEntry;


  if ((ParamBookIndex >= 0) &&
      (ParamFileIndex >= 0))
  {
    BookListEntry = this.mBooks.mBookList[ParamBookIndex];

    URL = this.mBaseURL + BookListEntry.mDirectory + BookListEntry.mFiles.fFileIndexToHREF(ParamFileIndex);
    if ((typeof(ParamAnchor) != "undefined") &&
        (ParamAnchor != null) &&
        (ParamAnchor.length > 0))
    {
      URL += "#" + ParamAnchor;
    }
  }

  return URL;
}

function  WWHHelp_DetermineContextDocument()
{
  var  ContextDocumentURL = null;
  var  URLParams          = this.fGetURLParameters(this.mLocationURL);
  var  ContextBook;


  // Automatically synchronize TOC
  //
  this.mbAutoSyncTOC = true;

  // Check for context specification
  //
  if (URLParams[3] != null)  // href specified
  {
    ContextDocumentURL = this.mBaseURL + URLParams[3];
  }
  else if (URLParams[0] != null)  // context specified
  {
    // Determine book directory
    //
    ContextBook = this.mBooks.fGetContextBook(URLParams[0]);
    if (ContextBook != null)
    {
      if (URLParams[2] != null)  // file specified
      {
        ContextDocumentURL = this.mBaseURL + ContextBook.mDirectory + URLParams[2];
      }
      else if (URLParams[1] != null)  // topic specified
      {
        // Setup for a topic search
        //
        this.mContextDir = ContextBook.mDirectory;
        this.mTopicTag   = URLParams[1];

        this.mDocumentURL = "";
      }
    }
    else  // Display splash page if nothing else found
    {
      ContextDocumentURL = this.mBaseURL + "wwhelp/wwhimpl/common/html/default.htm";
    }
  }
  else  // Display splash page if nothing else found
  {
    ContextDocumentURL = this.mBaseURL + "wwhelp/wwhimpl/common/html/default.htm";
  }

  return ContextDocumentURL;
}

function  WWHHelp_LoadTopicData()
{
  var  LoadTopicDataHTML = "";
  var  VarParameters;


  // Workaround Safari reload bug
  //
  VarParameters = "";
  if (WWHFrame.WWHBrowser.mBrowser == 5)  // Shorthhand for Safari
  {
    VarParameters = "?" + (new Date() * 1);
  }

  LoadTopicDataHTML += "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"" + this.mHelpURLPrefix + this.mContextDir + "wwhdata/common/topics.js" + VarParameters + "\"></script>";
  LoadTopicDataHTML += "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"" + this.mHelpURLPrefix + "wwhelp/wwhimpl/common/scripts/documt1s.js" + VarParameters + "\"></script>";

  return LoadTopicDataHTML;
}

// This is WebWorks original code, but I edited it to redirect "Page Not Found" to splash page.
//
// function  WWHHelp_ProcessTopicResult(ParamTopicURL)
// {
//  if (ParamTopicURL != null)
// {
// this.mDocumentURL = this.mBaseURL + this.mContextDir + ParamTopicURL;
// }
// }

function WWHHelp_ProcessTopicResult(ParamTopicURL)
{
if (ParamTopicURL != null)
{
this.mDocumentURL = this.mBaseURL + this.mContextDir + ParamTopicURL;
}
else
{
this.mDocumentURL = this.mBaseURL + "Introduction/" + "Welcome.html";
}
}

function  WWHHelp_DisplayContextDocument()
{
  WWHFrame.WWHHelp.fSetDocumentHREF(this.mDocumentURL, true);
}

function  WWHHelp_GetURLPrefix(ParamURL)
{
  var  URLPrefix  = null;
  var  WorkingURL = "";
  var  Parts;
  var  Index;


  // Standardize URL for processing
  //
  WorkingURL = ParamURL;

  // Strip any URL parameters
  //
  if (WorkingURL.indexOf("?") != -1)
  {
    Parts = WorkingURL.split("?");
    WorkingURL = Parts[0];
  }
  else if (WorkingURL.indexOf("#") != -1)
  {
    Parts = WorkingURL.split("#");
    WorkingURL = Parts[0];
  }

  // Confirm URL in wwhelp hierarchy
  //
  if (((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/api.htm")) != -1) ||
      ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/common/html/switch.htm")) != -1) ||
      ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/common/html/wwhelp.htm")) != -1) ||
      ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/js/html/wwhelp.htm"))     != -1))
  {
    URLPrefix = WorkingURL.substring(0, Index);
  }
  else
  {
    // Look for match on top level "wwhelp.htm" file
    //
    Index = WorkingURL.lastIndexOf("/");
    if ((Index != -1) &&
       (Index == WorkingURL.indexOf("/wwhelp.htm")))
    {
      URLPrefix = WorkingURL.substring(0, Index);
    }
  }

  return URLPrefix;
}

function  WWHHelp_SetContextDocument(ParamURL)
{
  var  URL = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);
  var  CurrentURLPrefix;
  var  NewURLPrefix;
  var  VarDocumentFrame;
  var  VarDocumentURL;
  var  VarURLParameters;


  // Confirm URL under same hierarchy
  //
  CurrentURLPrefix = WWHHelp_GetURLPrefix(this.mLocationURL);
  NewURLPrefix     = WWHHelp_GetURLPrefix(URL);
  if ((CurrentURLPrefix != null) &&
      (NewURLPrefix     != null) &&
      (CurrentURLPrefix == NewURLPrefix))
  {
    // Automatically synchornize TOC
    //
    this.mbAutoSyncTOC = true;

    // Check if in single topic mode
    //
    if (this.fSingleTopic())
    {
      // Check for required switch to frameset with navigation
      //
      WWHFrame.WWHSwitch.fProcessURL(ParamURL);
      if (WWHFrame.WWHSwitch.mImplementation != "single")
      {
        // Switch to frameset with navigation
        //
        if (WWHFrame.WWHSwitch.mParameters.length > 0)
        {
          // Context and topic supplied, use them
          //
          this.fSetLocation("WWHFrame", ParamURL);
        }
        else
        {
          // Just switch to frameset with navigation and preserve the current document
          //
          VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));

          VarDocumentURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
          VarDocumentURL = WWHFrame.WWHHelp.fGetBookFileHREF(VarDocumentURL);
          WWHFrame.WWHSwitch.fExec(false, WWHFrame.WWHHelp.mHelpURLPrefix + "/wwhelp/wwhimpl/api.htm?href=" + VarDocumentURL);
        }
      }
      else
      {
        // Update document frame
        //
        this.fSetDocumentFrameWithURL(URL);
      }
    }
    else
    {
      VarURLParameters = this.fGetURLParameters(URL);

      // Specifies a document to display?
      //
      if ((VarURLParameters[0] != null) ||
          (VarURLParameters[1] != null) ||
          (VarURLParameters[2] != null) ||
          (VarURLParameters[3] != null))
      {
        // Update document frame
        //
        this.fSetDocumentFrameWithURL(URL);

        // Set navigation tab to display
        //
        this.mNewTabName = VarURLParameters[5];
      }
      else
      {
        // Switch tabs
        //
        WWHFrame.WWHHandler.fSetCurrentTab(VarURLParameters[5]);
      }
    }
  }
  else
  {
    // Some other help system requested, redirect to it
    //
    this.fSetLocation("WWHFrame", ParamURL);
  }
}

function  WWHHelp_GetBookFileHREF(ParamHREF)
{
  var  BookFileHREF = null;
  var  Prefix;
  var  Suffix;


  // Confirm HREF can be in same hierarchy as BaseURL
  //
  if ((this.mBaseURL.length > 0) &&
      (ParamHREF.length > this.mBaseURL.length))
  {
    Prefix = ParamHREF.substring(0, this.mBaseURL.length);
    Suffix = ParamHREF.substring(this.mBaseURL.length, ParamHREF.length);

    // Confirm HREF definitely is in same hierarchy as BaseURL
    //
    if (Prefix == this.mBaseURL)
    {
      BookFileHREF = Suffix;
    }
  }

  return BookFileHREF;
}

function  WWHHelp_HREFToBookIndexFileIndexAnchor(ParamHREF)
{
  var  ResultArray = new Array(-1, -1, "");
  var  BookFileHREF;


  BookFileHREF = this.fGetBookFileHREF(ParamHREF);
  if (BookFileHREF != null)
  {
    ResultArray = this.mBooks.fHREFToBookIndexFileIndexAnchor(BookFileHREF);
  }

  return ResultArray;
}

function  WWHHelp_GetSyncPrevNext(ParamHREF)
{
  var  ResultArray = new Array(null, null, null);
  var  Parts;
  var  AbsoluteHREF;
  var  VarAnchor;
  var  BookFileHREF;


  // Trim named anchor entries
  //
  Parts = ParamHREF.split("#");
  AbsoluteHREF = Parts[0];
  VarAnchor = "";
  if (Parts.length > 1)
  {
    if (Parts[1].length > 0)
    {
      VarAnchor = "#" + Parts[1];
    }
  }

  BookFileHREF = this.fGetBookFileHREF(AbsoluteHREF);
  if (BookFileHREF != null)
  {
    if (BookFileHREF == "wwhelp/wwhimpl/common/html/default.htm")
    {
      ResultArray[2] = this.mBooks.fBookFileIndiciesToHREF(0, 0);
    }
    else
    {
      ResultArray = this.mBooks.fGetSyncPrevNext(BookFileHREF);
    }

    // Prefix with BaseURL if defined
    //

    // Current
    //
    if (ResultArray[0] != null)
    {
      ResultArray[0] = this.mBaseURL + ResultArray[0] + VarAnchor;
    }

    // Previous
    //
    if (ResultArray[1] != null)
    {
      ResultArray[1] = this.mBaseURL + ResultArray[1];
    }

    // Next
    //
    if (ResultArray[2] != null)
    {
      ResultArray[2] = this.mBaseURL + ResultArray[2];
    }
  }
  else
  {
    // Unknown document, enable next button to go to first known page
    //
    ResultArray[2] = this.mBaseURL + this.mBooks.fBookFileIndiciesToHREF(0, 0);
  }

  return ResultArray;
}

function  WWHHelp_HREFToTitle(ParamHREF)
{
  var  Title;
  var  Parts;
  var  AbsoluteHREF;


  // Try to find book and file
  //
  Parts = this.fHREFToBookIndexFileIndexAnchor(ParamHREF);
  if ((Parts[0] >= 0) &&
      (Parts[1] >= 0))
  {
    Title = this.mBooks.fBookIndexFileIndexToTitle(Parts[0], Parts[1]);
  }
  else
  {
    // Use basename for title
    //
    Parts = ParamHREF.split("#");
    AbsoluteHREF = Parts[0];
    Parts = AbsoluteHREF.split("/");
    Title = Parts[Parts.length - 1];
  }

  return Title;
}

function  WWHHelp_EscapeHTML(ParamText)
{
  return WWHStringUtilities_EscapeHTML(ParamText);
}

function  WWHHelp_PopupHTML()
{
  var  VarHTML = "";


  if ((WWHFrame.WWHBrowser.mbSupportsPopups) &&
      (WWHFrame.WWHBrowser.mbSupportsIFrames))
  {
    VarHTML = this.mPopup.fDivTagText();
  }

  return VarHTML;
}

function  WWHHelp_ShowPopup(ParamContext,
                            ParamLink,
                            ParamEvent)
{
  var  Book;
  var  Link;
  var  Src;
  var  PopupHTML;

  if ((WWHFrame.WWHBrowser.mbSupportsPopups) &&
      (WWHFrame.WWHBrowser.mbSupportsIFrames))
  {
    Book = this.mBooks.fGetContextBook(ParamContext);
    if (Book != null)
    {
      Link = WWHFrame.WWHBrowser.fNormalizeURL(ParamLink);
      Src = this.mBaseURL + Book.mDirectory + Link;
      PopupHTML = "<div onmouseout=\"WWHHidePopup();\"><iframe id=\"WWHPopupIFrame\" frameborder=\"0\" scrolling=\"no\" width=\"" + this.mPopup.mWidth + "\" src=\"" + Src + "\" onload=\"javascript:WWHPopupLoaded()\"></iframe></div>";
      this.mPopup.fShow(PopupHTML, ParamEvent);

      // WORKAROUND: Need to size popup after IFrame has loaded
      //
      if (this.mPopup.mSetTimeoutID != null)
      {
        clearTimeout(this.mPopup.mSetTimeoutID);
        this.mPopup.mSetTimeoutID = null;

        this.mPopupLoaded = false;
        this.mPopup.mSetTimeoutID = setTimeout("WWHFrame.WWHHelp.fRevealPopup()", this.mPopup.mTimeout);
      }
    }
  }
}

function  WWHHelp_PopupAdjustSize()
{
  var  VarPopupWindow = eval(this.mPopup.mWindowRef);
  var  VarPopupDocument = VarPopupWindow.document;
  var  VarDocumentElement;
  var  VarMaxHeight;
  var  VarIFrame;
  var  VarElement;
  var  VarWidth;
  var  VarHeight;
  var  VarDistanceToRightEdge;

  // Access popup iframe
  //
  if (WWHFrame.WWHBrowser.mBrowser == 2)  // Shorthand for Internet Explorer
  {
    // Access popup iframe
    //
    VarIFrame = VarPopupDocument.all['WWHPopupIFrame'];

    // Access document elements
    //
    if ((typeof(VarPopupDocument.documentElement) != "undefined") &&
        (typeof(VarPopupDocument.documentElement.clientWidth) != "undefined") &&
        (typeof(VarPopupDocument.documentElement.clientHeight) != "undefined") &&
        ((VarPopupDocument.documentElement.clientWidth != 0) ||
         (VarPopupDocument.documentElement.clientHeight != 0)))
    {
      VarDocumentElement = VarPopupDocument.documentElement;
      VarElement = VarIFrame.contentWindow.document.documentElement;
    }
    else
    {
      VarDocumentElement = VarPopupDocument.body;
      VarElement = VarIFrame.contentWindow.document.body;
    }

    // Determine maximum height
    //
    VarMaxHeight = VarDocumentElement.clientHeight - 16;

    // Record width
    //
    VarWidth = (VarElement.scrollWidth > VarElement.offsetWidth) ? VarElement.scrollWidth : VarElement.offsetWidth;

    // Determine height
    //
    VarHeight = (VarElement.scrollHeight > VarElement.offsetHeight) ? VarElement.scrollHeight : VarElement.offsetHeight;
    VarHeight += 4;
    if (VarHeight > VarMaxHeight)
    {
      VarHeight = VarMaxHeight;

      // Find widest area to left or right of cursor position
      //
      VarDistanceToRightEdge = VarPopupDocument.documentElement.offsetWidth - this.mPopup.mPositionX;
      if (VarDistanceToRightEdge < this.mPopup.mPositionX)
      {
        VarWidth = this.mPopup.mPositionX;
      }
      else
      {
        VarWidth = VarDistanceToRightEdge;
      }
    }

    // Update IFrame width/height
    //
    if (VarWidth > VarIFrame.style.width)
    {
      VarIFrame.style.width = VarWidth;
    }
    if (VarHeight > VarIFrame.style.height)
    {
      VarIFrame.style.height = VarHeight;
    }
  }
  else
  {
    // Determine maximum height
    //
    VarMaxHeight = VarPopupWindow.innerHeight - 16;

    // Access popup iframe
    //
    VarIFrame = VarPopupDocument.getElementById('WWHPopupIFrame');

    // Record width
    //
    VarWidth = VarIFrame.contentDocument.body.offsetWidth + 16;

    // Determine height
    //
    VarHeight = VarIFrame.contentDocument.body.offsetHeight + 16;
    if (VarHeight > VarMaxHeight)
    {
      VarHeight = VarMaxHeight;

      // Find widest area to left or right of cursor position
      //
      VarDistanceToRightEdge = VarPopupWindow.innerWidth - this.mPopup.mPositionX;
      if (VarDistanceToRightEdge < this.mPopup.mPositionX)
      {
        VarWidth = this.mPopup.mPositionX - 16 - 16;
      }
      else
      {
        VarWidth = VarDistanceToRightEdge - 16;
      }
    }

    // Update IFrame width/height
    //
    if (VarWidth > VarIFrame.width)
    {
      VarIFrame.width = VarWidth;
    }
    if (VarHeight > VarIFrame.height)
    {
      VarIFrame.height = VarHeight;
    }
  }
}

function  WWHHelp_PopupLoaded()
{
  this.fPopupAdjustSize();

  this.mPopupLoaded = true;
}

function  WWHHelp_RevealPopup()
{
  var  VarPopupDocument;
  var  VarIFrame;
  var  VarElement;

  if ((this.mPopup.mSetTimeoutID != null) &&
      (this.mPopupLoaded))
  {
    // Disable hide capability temporarily
    //
    this.mPopupHideDisabled = true;

    // Reveal
    //
    this.mPopup.fReveal();

    // Reset IFrame content if necessary
    //
    if (WWHFrame.WWHBrowser.mBrowser == 2)  // Shorthand for Internet Explorer
    {
      // Access popup IFrame
      //
      VarPopupDocument = eval(this.mPopup.mWindowRef + ".document");
      VarIFrame = VarPopupDocument.all['WWHPopupIFrame'];
      VarElement = VarIFrame.contentWindow.document.body;

      // "Toggle" IFrame content
      //
      VarElement.innerHTML = VarElement.innerHTML;
    }

    // Enable hide capability in a bit
    //
    setTimeout("WWHFrame.WWHHelp.fResetPopupHideDisabled()", 100);
  }
  else
  {
    this.mPopup.mSetTimeoutID = setTimeout("WWHFrame.WWHHelp.fRevealPopup()", 10);
  }
}

function  WWHHelp_ResetPopupHideDisabled()
{
  this.mPopupHideDisabled = false;
}

function  WWHHelp_HidePopup()
{
  if ( ! this.mPopupHideDisabled)
  {
    this.mPopup.fHide();
  }
}

function  WWHHelp_ClickedPopup(ParamContext,
                               ParamLink,
                               ParamPopupLink)
{
  var  VarTargetLink;

  if ((WWHFrame.WWHBrowser.mbSupportsPopups) &&
      (WWHFrame.WWHBrowser.mbSupportsIFrames))
  {
    // Show popup target
    //
    this.fHidePopup();
    VarTargetLink = ParamLink;
  }
  else
  {
    // Show popup, if defined
    //
    VarTargetLink = ParamPopupLink;
    if (VarTargetLink.length == 0)
    {
      VarTargetLink = ParamLink;
    }
  }

  // Display target link
  //
  this.fDisplayFile(ParamContext, VarTargetLink);
}

function  WWHHelp_DisplayFile(ParamContext,
                              ParamLink)
{
  var  Book;
  var  Link;

  // Link defined?
  //
  if (ParamLink.length > 0)
  {
    Book = this.mBooks.fGetContextBook(ParamContext);
    if (Book != null)
    {
      Link = WWHFrame.WWHBrowser.fNormalizeURL(ParamLink);
      WWHFrame.WWHHelp.fSetDocumentHREF(this.mBaseURL + Book.mDirectory + Link, false);
    }
  }
}

function  WWHHelp_DisplayFirst()
{
  var  VarURL;

  VarURL = WWHFrame.WWHHelp.fGetBookIndexFileIndexURL(0, 0, null);
  WWHFrame.WWHHelp.fSetDocumentHREF(VarURL, true);

  // Automatically synchronize TOC
  //
  this.mbAutoSyncTOC = true;
}

function  WWHHelp_ShowTopic(ParamContext,
                            ParamTopic)
{
  var  VarContextBook;


  // Determine book directory
  //
  VarContextBook = this.mBooks.fGetContextBook(ParamContext);
  if (VarContextBook != null)
  {
    // Setup for a topic search
    //
    this.mContextDir = VarContextBook.mDirectory;
    this.mTopicTag   = ParamTopic;

    this.mDocumentURL = "";

    // Load topic data to determine document to display
    //
    this.fSetDocumentHREF(this.mBaseURL + "wwhelp/wwhimpl/common/html/document.htm", false);
  }
}

function  WWHHelp_Update(ParamURL)
{
  var  URL;
  var  Parts;


  if (this.mbInitialized)
  {
    URL = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);

    if (WWHFrame.WWHHandler.fIsReady())
    {
      Parts = this.fHREFToBookIndexFileIndexAnchor(URL);
      if ((Parts[0] >= 0) &&
          (Parts[1] >= 0))
      {
        WWHFrame.WWHHandler.fUpdate(Parts[0], Parts[1], Parts[2]);
      }

      this.fDocumentBookkeeping(URL);

      // Switch tabs, if necessary
      //
      if (this.mNewTabName != null)
      {
        WWHFrame.WWHHandler.fSetCurrentTab(this.mNewTabName);

        this.mNewTabName = null;
      }
    }
    else
    {
      // Try again in a bit
      //
      setTimeout("WWHFrame.WWHHelp.fUpdate(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\");", 100);
    }
  }
  else if (ParamURL.indexOf("wwhelp/wwhimpl/common/html/default.htm") == -1)
  {
    // Try again in a bit
    //
    this.mDocumentLoaded = ParamURL;
    setTimeout("WWHFrame.WWHHelp.fUpdate(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\");", 100);
  }
}

function  WWHHelp_SyncTOC(ParamURL,
                          bParamReportError)
{
  var  Parts;

  if (WWHFrame.WWHHandler.fIsReady())
  {
    Parts = this.fHREFToBookIndexFileIndexAnchor(ParamURL);
    if ((Parts[0] >= 0) &&
        (Parts[1] >= 0))
    {
      WWHFrame.WWHHandler.fSyncTOC(Parts[0], Parts[1], Parts[2], bParamReportError);
    }
  }
  else
  {
    // Try again in a bit
    //
    setTimeout("WWHFrame.WWHHelp.fSyncTOC(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\", " + bParamReportError + ");", 100);
  }
}

function  WWHHelp_FavoritesCurrent(ParamURL)
{
  var  Parts;

  if (WWHFrame.WWHHandler.fIsReady())
  {
    Parts = this.fHREFToBookIndexFileIndexAnchor(ParamURL);
    if ((Parts[0] >= 0) &&
        (Parts[1] >= 0))
    {
      WWHFrame.WWHHandler.fFavoritesCurrent(Parts[0], Parts[1]);
    }
    else
    {
      WWHFrame.WWHHandler.fFavoritesCurrent(-1, -1);
    }
  }
  else
  {
    // Try again in a bit
    //
    setTimeout("WWHFrame.WWHHelp.fFavoritesCurrent(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\");", 100);
  }
}

function  WWHHelp_DocumentBookkeeping(ParamURL)
{
  var  VarDocumentFrame;
  var  VarURL;

  // Highlight search words
  //
  if (typeof(WWHFrame.WWHHighlightWords) != "undefined")
  {
    WWHFrame.WWHHighlightWords.fExec();
  }

  // Update controls
  //
  WWHFrame.WWHControls.fUpdateHREF(ParamURL);

  // Update window title, if possible
  //
  if (ParamURL.indexOf("wwhelp/wwhimpl/common/html/default.htm") == -1)
  {
    if (WWHFrame.WWHBrowser.mBrowser != 1)  // Shorthand for Netscape
    {
      WWHFrame.document.title = WWHStringUtilities_UnescapeHTML(this.fHREFToTitle(ParamURL));
    }
  }

  // Automatically synchronize TOC, if requested
  //
  if ( ! this.mCollapsingTOCEntry)
  {
    this.fAutoSyncTOC();
  }
  this.mCollapsingTOCEntry = false;

  // Update favorites
  //
  VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));
  VarURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
  this.fFavoritesCurrent(VarURL);

  // Update hash
  //
  this.fUpdateHash(VarURL);
}

function  WWHHelp_UpdateHash(ParamURL)
{
  var  VarFileName;
  var  VarHash;

  // Only update if "?" is not present (and therefore has priority)
  //
  if (WWHFrame.location.href.indexOf("?") == -1)
  {
    // Update URL hash value
    //
    VarFileName = this.fGetBookFileHREF(ParamURL);
    if ((VarFileName != null) &&
        (VarFileName.length > 0) &&
        (VarFileName != "wwhelp/wwhimpl/common/html/default.htm"))
    {
      // Only update if different
      //
      VarHash = "#href=" + VarFileName;
      if (this.fSingleTopic())
      {
        VarHash += "&single=true";
      }
      if (WWHFrame.location.hash != VarHash)
      {
        // Only works well on certain browsers
        //
        if ((WWHFrame.WWHBrowser.mBrowser == 2) ||  // Shorthand for IE
            (WWHFrame.WWHBrowser.mBrowser == 4))    // Shorthand for Netscape 6.0 (Mozilla)
        {
          WWHFrame.location.hash = VarHash;
        }
      }
    }
  }
}

function  WWHHelp_AutoSyncTOC()
{
  var  VarDocumentFrame;
  var  VarURL;

  // Automatically synchronize TOC, if requested
  //
  if (this.mbAutoSyncTOC)
  {
    if (WWHFrame.WWHHandler.fGetCurrentTab() == "contents")
    {
      VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));
      VarURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
      this.fSyncTOC(VarURL, false);
    }

    this.mbAutoSyncTOC = this.mbAlwaysSyncTOC;
  }
}

function  WWHHelp_Unload()
{
  // Clear related topics list
  //
  WWHFrame.WWHRelatedTopics.fClear();
}

function  WWHHelp_IgnoreNextKeyPress(ParamEvent)
{
  if (this.mbInitialized)
  {
    if ((ParamEvent != null) &&
        (typeof(ParamEvent.keyCode) != "undefined"))
    {
      this.mbIgnoreNextKeyPress = true;
    }
  }

  return true;
}

function  WWHHelp_HandleKeyDown(ParamEvent)
{
  if (this.mbInitialized)
  {
    if ((ParamEvent != null) &&
        (typeof(ParamEvent.keyCode) != "undefined"))
    {
      if (ParamEvent.keyCode == 18)
      {
        this.mbAltKeyDown = true;
      }
      else if ((ParamEvent.keyCode >= 48) &&
               (ParamEvent.keyCode <= 57))
      {
        this.mAccessKey = ParamEvent.keyCode - 48;
      }
    }
  }

  return true;
}

function  WWHHelp_HandleKeyPress(ParamEvent)
{
  if (this.mbInitialized)
  {
    if (ParamEvent != null)
    {
      if (this.mbIgnoreNextKeyPress)
      {
        // Ignore this key press event
        //
      }
      else
      {
        if (this.mAccessKey != null)
        {
          this.fProcessAccessKey(this.mAccessKey);
        }
      }
    }

    // Reset to handle next access key
    //
    this.mbIgnoreNextKeyPress = false;
    this.mAccessKey = null;
  }

  return true;
}

function  WWHHelp_HandleKeyUp(ParamEvent)
{
  if (this.mbInitialized)
  {
    if ((ParamEvent != null) &&
        (typeof(ParamEvent.keyCode) != "undefined"))
    {
      if (ParamEvent.keyCode == 18)
      {
        this.mbAltKeyDown = false;
      }
    }
  }

  return true;
}

function  WWHHelp_ProcessAccessKey(ParamAccessKey)
{
  switch (ParamAccessKey)
  {
    case 1:
    case 2:
    case 3:
      WWHFrame.WWHHandler.fProcessAccessKey(ParamAccessKey);
      break;

    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
    case 9:
      WWHFrame.WWHControls.fProcessAccessKey(ParamAccessKey);
      break;

    case 0:
      this.fFocus("WWHDocumentFrame");
      break;
  }
}

function  WWHHelp_Focus(ParamFrameName,
                        ParamAnchorName)
{
  WWHFrame.WWHBrowser.fFocus(this.fGetFrameReference(ParamFrameName), ParamAnchorName);
}

function  WWHHelpUtilities_PreloadGraphics()
{
  var  VarImageDirectory = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";

  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/bkmark.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/bkmarkx.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/close.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/doc.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/email.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/emailx.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/fc.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/fo.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/next.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/nextx.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/prev.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/prevx.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/print.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/printx.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/related.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/relatedi.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/relatedx.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/shownav.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spacer4.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc1w2h.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc1w7h.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc2w1h.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc5w1h.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_l.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_m.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_r.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_t.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/sync.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/syncx.gif";
  WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/toolsbg.gif";
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHHighlightWords_Object()
{
  this.mWordList = null;

  this.fSetWordList = WWHHighlightWords_SetWordList;
  this.fExec        = WWHHighlightWords_Exec;
}

function  WWHHighlightWords_SetWordList(ParamWordList)
{
  this.mWordList = ParamWordList;
}

function  WWHHighlightWords_Exec()
{
  var  MaxIndex;
  var  Index;
  var  WordExpressions;
  var  LongestWordExpression;
  var  MaxExpressionIndex;
  var  ExpressionIndex;
  var  ExpressionHash = null;
  var  ExpressionEntry;
  var  Expression;
  var  VarDocumentFrame;
  var  LongestWordExpressionKey;
  var  NewHighlightedWords = null;
  var  HighlightedWords = null;
  var  TextRange;
  var  LastCharTextRange;
  var  bMatchFound;
  var  bFirstMatch;
  var  NewHighlightedWordsKey;


  if ((WWHFrame.WWHHelp.mSettings.mbHighlightingEnabled) &&
      (this.mWordList != null))
  {
    // Only works under IE on Windows
    //
    if ((WWHFrame.WWHBrowser.mBrowser == 2) &&  // Shorthand for IE
        (WWHFrame.WWHBrowser.mPlatform == 1))   // Shorthand for Windows
    {
      ExpressionHash   = new WWHHighlightWords_ExpressionHash_Object();
      HighlightedWords = new WWHHighlightWords_HighlightedWords_Object();
      bFirstMatch = true;

      // Access search words
      //
      for (MaxIndex = this.mWordList.length, Index = 0 ; Index < MaxIndex ; Index++)
      {
        if (this.mWordList[Index].length > 0)
        {
          // Determine longest sub-expression between '*'
          //
          WordExpressions = this.mWordList[Index].split("*");
          LongestWordExpression = "";
          for (MaxExpressionIndex = WordExpressions.length, ExpressionIndex = 0 ; ExpressionIndex < MaxExpressionIndex ; ExpressionIndex++)
          {
            if (WordExpressions[ExpressionIndex].length > LongestWordExpression.length)
            {
              LongestWordExpression = WordExpressions[ExpressionIndex];
            }
          }

          // Store search expression keyed by longest sub-expression
          //
          ExpressionEntry = ExpressionHash[LongestWordExpression + "~"];
          if (typeof(ExpressionEntry) == "undefined")
          {
            ExpressionEntry = new WWHHighlightWords_ExpressionEntry_Object();
            ExpressionHash[LongestWordExpression + "~"] = ExpressionEntry;
          }
          Expression = WWHStringUtilities_WordToRegExpWithSpacePattern(this.mWordList[Index]);
          ExpressionEntry.mExpressions[ExpressionEntry.mExpressions.length] = new RegExp(Expression, "i");
        }
      }

      // Ensure document window has focus to avoid "Incompatible markup pointers" error
      // http://xopus.com/devblog/2008/invalid-markup-pointers-revisited
      //
      VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));
      VarDocumentFrame.focus();

      // Search document based on longest sub-expressions
      //
      for (LongestWordExpressionKey in ExpressionHash)
      {
        LongestWordExpression = LongestWordExpressionKey.substring(0, LongestWordExpressionKey.length - 1);
        NewHighlightedWords = new WWHHighlightWords_HighlightedWords_Object();

        TextRange = VarDocumentFrame.document.body.createTextRange();
        TextRange.collapse();
        while (TextRange.findText(LongestWordExpression, 1))
        {
          TextRange.expand("word");
          ExpressionEntry = ExpressionHash[LongestWordExpression + "~"];

          // Check word against search expression
          //
          bMatchFound = false;
          MaxExpressionIndex = ExpressionEntry.mExpressions.length;
          ExpressionIndex = 0;
          while (( ! bMatchFound) &&
                 (ExpressionIndex < MaxExpressionIndex))
          {
            if (ExpressionEntry.mExpressions[ExpressionIndex].test(TextRange.text))
            {
              // Highlight text if not processed already
              //
              if (typeof(HighlightedWords[TextRange.text + "~"]) == "undefined")
              {
                // Record text highlighted for this expression
                //
                NewHighlightedWords[TextRange.text + "~"] = true;

                // Try to trim off trailing whitespace or .s
                //
                LastCharTextRange = TextRange.duplicate();
                LastCharTextRange.moveStart("character", TextRange.text.length - 1);

                if ((LastCharTextRange.text == " ") ||
                    (LastCharTextRange.text == ",") ||
                    (LastCharTextRange.text == "."))
                {
                  // Prevent infinite loops if search is for "," or "."
                  //
                  if (LastCharTextRange.text != LongestWordExpression)
                  {
                    TextRange.moveEnd("character", -1);
                  }
                }

                // Highlight words in text range
                //
                TextRange.execCommand("ForeColor", false, WWHFrame.WWHHelp.mSettings.mHighlightingForegroundColor);
                TextRange.execCommand("BackColor", false, WWHFrame.WWHHelp.mSettings.mHighlightingBackgroundColor);

                if (bFirstMatch)
                {
                  TextRange.scrollIntoView();

                  bFirstMatch = false;
                }

                bMatchFound = true;
              }
            }

            ExpressionIndex++;
          }

          TextRange.collapse(false);
        }

        // Add highlighted words to hash
        //
        for (NewHighlightedWordsKey in NewHighlightedWords)
        {
          HighlightedWords[NewHighlightedWordsKey] = true;
        }
      }
    }
  }

  // Highlight words only once
  //
  this.mWordList = null;
}

function  WWHHighlightWords_ExpressionHash_Object()
{
}

function  WWHHighlightWords_ExpressionEntry_Object()
{
  this.mExpressions = new Array();
}

function  WWHHighlightWords_HighlightedWords_Object()
{
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHPopup_Object(ParamThisPopupRef,
                          ParamWindowRef,
                          ParamPopupTranslateFunc,
                          ParamPopupFormatFunc,
                          ParamDivID,
                          ParamTextID,
                          ParamTimeout,
                          ParamOffsetX,
                          ParamOffsetY,
                          ParamWidth)
{
  this.mThisPopupRef = ParamThisPopupRef;
  this.mWindowRef    = ParamWindowRef;
  this.mDivID        = ParamDivID;
  this.mTextID       = ParamTextID;
  this.mTimeout      = (ParamTimeout > 0) ? ParamTimeout : 0;
  this.mOffsetX      = ParamOffsetX;
  this.mOffsetY      = ParamOffsetY;
  this.mWidth        = ParamWidth;


  // Updated when popup triggered
  //
  this.mbVisible     = false;
  this.mPositionX    = 0;
  this.mPositionY    = 0;
  this.mText         = "";
  this.mSetTimeoutID = null;

  this.fTranslate     = ParamPopupTranslateFunc;
  this.fFormat        = ParamPopupFormatFunc;
  this.fEventString   = WWHPopup_EventString;
  this.fDivTagText    = WWHPopup_DivTagText;
  this.fShow          = WWHPopup_Show;
  this.fLoad          = WWHPopup_Load;
  this.fPositionAt    = WWHPopup_PositionAt;
  this.fPosition      = WWHPopup_Position;
  this.fReveal        = WWHPopup_Reveal;
  this.fHide          = WWHPopup_Hide;
}

function  WWHPopup_EventString()
{
  var  EventString = "null";
  var  Browser = WWHFrame.WWHBrowser.mBrowser;


  // Set event string based on browser type
  //
  if ((Browser == 1) ||  // Shorthand for Netscape
      (Browser == 2) ||  // Shorthand for IE
      (Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
      (Browser == 5))    // Shorthand for Safari
  {
    EventString = "event";
  }
  else
  {
    EventString = "null";
  }

  return EventString;
}

function  WWHPopup_DivTagText()
{
  var  DivTagText = "";
  var  Browser = WWHFrame.WWHBrowser.mBrowser;
  var  VisibleAttribute = "visibility: hidden";


  // Update VisibleAttribute based on browser
  //
  if ((Browser == 2) ||  // Shorthand for Internet Explorer
      (Browser == 3) ||  // Shorthand for iCab
      (Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
      (Browser == 5))    // Shorthand for Safari
  {
    VisibleAttribute += " ; display: none";
  }

  // Open DIV tag
  //
  DivTagText += "<div id=\"" + this.mDivID + "\" style=\"position: absolute ; z-index: -1 ; " + VisibleAttribute + " ; top: 0px ; left: 0px\">\n";

  // Expand out popup in browsers that support innerHTML accessor
  //
  if ((Browser == 2) ||  // Shortcut for IE
      (Browser == 3) ||  // Shortcut for iCab
      (Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
      (Browser == 5))    // Shorthand for Safari
  {
    DivTagText += this.fFormat(this.mWidth, this.mTextID,
                               "Popup");
  }

  // Close out DIV tag
  //
  DivTagText += "</div>\n";

  return DivTagText;
}

function  WWHPopup_Show(ParamText,
                        ParamEvent)
{
  var  Browser = WWHFrame.WWHBrowser.mBrowser;
  var  bLoad = false;
  var  PopupDocument = eval(this.mWindowRef + ".document");
  var  TranslatedText;


  // Hide popup
  //
  this.fHide();

  // Position at 0,0
  //
  this.fPositionAt(0, 0);

  // Reset the timeout operation to display the popup
  //
  if (this.mSetTimeoutID != null)
  {
    clearTimeout(this.mSetTimeoutID);
    this.mSetTimeoutID = null;
  }

  // Check to see if there is anything to display
  //
  if ((ParamText != null) &&
      (ParamEvent != null))
  {
    if (Browser == 1)  // Shorthand for Netscape 4.x
    {
      this.mPositionX = ParamEvent.layerX;
      this.mPositionY = ParamEvent.layerY;

      this.mText = ParamText;

      bLoad = true;
    }
    else if (Browser == 2)  // Shorthand for IE
    {
      if ((typeof(PopupDocument.documentElement) != "undefined") &&
          (typeof(PopupDocument.documentElement.clientWidth) != "undefined") &&
          (typeof(PopupDocument.documentElement.clientHeight) != "undefined") &&
          ((PopupDocument.documentElement.scrollLeft != 0) ||
           (PopupDocument.documentElement.scrollTop != 0)))
      {
        this.mPositionX = PopupDocument.documentElement.scrollLeft + ParamEvent.x;
        this.mPositionY = PopupDocument.documentElement.scrollTop  + ParamEvent.y;
      }
      else
      {
        this.mPositionX = PopupDocument.body.scrollLeft + ParamEvent.x;
        this.mPositionY = PopupDocument.body.scrollTop  + ParamEvent.y;
      }

      // Workaround for IE 4.0 on Windows
      //
      if (WWHFrame.WWHBrowser.mbWindowsIE40)
      {
        this.mPositionX = ParamEvent.x;
        this.mPositionY = ParamEvent.y;
      }

      this.mText = ParamText;

      if (WWHFrame.WWHBrowser.mPlatform == 2)  // Shorthand for Macintosh
      {
        // Setting the position here before it is displayed
        // corrects a bug under IE 5 on the Macintosh
        //
        PopupDocument.all[this.mDivID].style.pixelLeft = 0;
        PopupDocument.all[this.mDivID].style.pixelTop  = 0;
        TranslatedText = this.fTranslate(this.mText);
        PopupDocument.all[this.mTextID].innerHTML = TranslatedText;
        this.fPosition();
      }

      bLoad = true;
    }
    else if ((Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
             (Browser == 5))    // Shorthand for Safari
    {
      this.mPositionX = ParamEvent.layerX;
      this.mPositionY = ParamEvent.layerY;

      this.mText = ParamText;

      bLoad = true;
    }

    // Load popup
    //
    if (bLoad == true)
    {
      this.fLoad();
    }
  }
}

function  WWHPopup_Load()
{
  var  PopupDocument = eval(this.mWindowRef + ".document");
  var  Browser = WWHFrame.WWHBrowser.mBrowser;
  var  FormattedText;
  var  TranslatedText;


  if (WWHFrame.WWHHandler.fIsReady())
  {
    if (Browser == 1)  // Shorthand for Netscape 4.x
    {
      // Format popup contents for browser
      //
      FormattedText = this.fFormat(this.mWidth, this.mTextID,
                                   this.fTranslate(this.mText));

      // Set popup contents
      //
      PopupDocument.layers[this.mDivID].document.open();
      PopupDocument.layers[this.mDivID].document.write(FormattedText);
      PopupDocument.layers[this.mDivID].document.close();
    }
    else if ((Browser == 2) ||  // Shorthand for IE
             (Browser == 3))    // Shorthand for iCab
    {
      // Format popup contents for browser
      // Set popup contents
      //
      TranslatedText = this.fTranslate(this.mText);
      PopupDocument.all[this.mTextID].innerHTML = TranslatedText;

      // Block display mode
      //
      PopupDocument.all[this.mDivID].style.display = "block";
    }
    else if ((Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
             (Browser == 5))    // Shorthand for Safari
    {
      // Format popup contents for browser
      // Set popup contents
      //
      TranslatedText = this.fTranslate(this.mText);
      PopupDocument.getElementById(this.mTextID).innerHTML = TranslatedText;

      // Block display mode
      //
      PopupDocument.getElementById(this.mDivID).style.display = "block";
    }

    // Reveal
    //
    this.mSetTimeoutID = setTimeout(this.mThisPopupRef + ".fReveal()", this.mTimeout);
  }
}

function  WWHPopup_PositionAt(ParamX,
                              ParamY)
{
  var  PopupDocument = eval(this.mWindowRef + ".document");
  var  Browser = WWHFrame.WWHBrowser.mBrowser;


  if (Browser == 1)  // Shorthand for Netscape 4.x
  {
    // Set popup position
    //
    PopupDocument.layers[this.mDivID].left = ParamX;
    PopupDocument.layers[this.mDivID].top  = ParamY;
  }
  else if (Browser == 2)  // Shorthand for IE
  {
    // Set popup position
    //
    PopupDocument.all[this.mDivID].style.pixelLeft = ParamX;
    PopupDocument.all[this.mDivID].style.pixelTop  = ParamY;
  }
  else if ((Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
           (Browser == 5))    // Shorthand for Safari
  {
    // Set popup position
    //
    PopupDocument.getElementById(this.mDivID).style.left = ParamX + "px";
    PopupDocument.getElementById(this.mDivID).style.top  = ParamY + "px";
  }
}

function  WWHPopup_Position()
{
  var  PopupWindow   = eval(this.mWindowRef);
  var  PopupDocument = eval(this.mWindowRef + ".document");
  var  Browser = WWHFrame.WWHBrowser.mBrowser;
  var  Margin = 8;
  var  NewPositionX;
  var  NewPositionY;
  var  VisibleOffsetX;
  var  VisibleOffsetY;
  var  ScrollTop;
  var  PopupWidth;
  var  PopupHeight;
  var  DeltaY;


  // Calculate new position for popup
  //
  NewPositionX = this.mPositionX + this.mOffsetX;
  NewPositionY = this.mPositionY + this.mOffsetY;

  if (Browser == 1)  // Shorthand for Netscape 4.x
  {
    // Attempt to determine DIV tag dimensions
    //
    PopupWidth = this.mWidth;
    if (PopupDocument.layers[this.mDivID].clip.width > PopupWidth)
    {
      PopupWidth = PopupDocument.layers[this.mDivID].clip.width;
    }
    PopupHeight = 60;  // Guess a value
    if (PopupDocument.layers[this.mDivID].clip.height > PopupHeight)
    {
      PopupHeight = PopupDocument.layers[this.mDivID].clip.height;
    }

    // Calculate maximum values for X and Y such that the
    // popup will remain visible
    //
    VisibleOffsetX = PopupWindow.innerWidth  - this.mOffsetX - PopupWidth - Margin;
    if (VisibleOffsetX < 0)
    {
      VisibleOffsetX = 0;
    }
    VisibleOffsetY = PopupWindow.innerHeight - this.mOffsetY - PopupHeight - Margin;
    if (VisibleOffsetY < 0)
    {
      VisibleOffsetY = 0;
    }

    // Confirm popup will be visible and adjust if necessary
    //
    if (NewPositionX > (PopupWindow.pageXOffset + VisibleOffsetX))
    {
      NewPositionX = PopupWindow.pageXOffset + VisibleOffsetX;
    }
    ScrollTop = PopupWindow.pageYOffset;
    if (NewPositionY > (PopupWindow.pageYOffset + VisibleOffsetY))
    {
      NewPositionY = PopupWindow.pageYOffset + VisibleOffsetY;
    }

    // Relocate popup if it will overlay the current mouse position
    //
    if ((this.mPositionY >= NewPositionY) &&
        (this.mPositionY <= (NewPositionY + PopupHeight)))
    {
      DeltaY = (NewPositionY + PopupHeight) - this.mPositionY;
      if (NewPositionY - (DeltaY + Margin) > ScrollTop)
      {
        NewPositionY -= DeltaY + Margin;
      }
    }

    // Set popup position
    //
    this.fPositionAt(NewPositionX, NewPositionY);
  }
  else if (Browser == 2)  // Shorthand for IE
  {
    // Attempt to determine DIV tag dimensions
    //
    PopupWidth = this.mWidth;
    if (PopupDocument.all[this.mDivID].offsetWidth > PopupWidth)
    {
      PopupWidth = PopupDocument.all[this.mDivID].offsetWidth;
    }
    PopupHeight = 60;  // Guess a value
    if (PopupDocument.all[this.mDivID].offsetHeight > PopupHeight)
    {
      PopupHeight = PopupDocument.all[this.mDivID].offsetHeight;
    }

    // Calculate maximum values for X and Y such that the
    // popup will remain visible
    //
    if ((typeof(PopupDocument.documentElement) != "undefined") &&
        (typeof(PopupDocument.documentElement.clientWidth) != "undefined") &&
        (typeof(PopupDocument.documentElement.clientHeight) != "undefined") &&
        ((PopupDocument.documentElement.clientWidth != 0) ||
         (PopupDocument.documentElement.clientHeight != 0)))
    {
      VisibleOffsetX = PopupDocument.documentElement.clientWidth  - this.mOffsetX - PopupWidth - Margin;
      VisibleOffsetY = PopupDocument.documentElement.clientHeight - this.mOffsetY - PopupHeight - Margin;
    }
    else
    {
      VisibleOffsetX = PopupDocument.body.clientWidth  - this.mOffsetX - PopupWidth - Margin;
      VisibleOffsetY = PopupDocument.body.clientHeight - this.mOffsetY - PopupHeight - Margin;
    }
    if (VisibleOffsetX < 0)
    {
      VisibleOffsetX = 0;
    }
    if (VisibleOffsetY < 0)
    {
      VisibleOffsetY = 0;
    }

    // Confirm popup will be visible and adjust if necessary
    //
    if ((typeof(PopupDocument.documentElement) != "undefined") &&
        (typeof(PopupDocument.documentElement.clientWidth) != "undefined") &&
        (typeof(PopupDocument.documentElement.clientHeight) != "undefined") &&
        ((PopupDocument.documentElement.scrollLeft != 0) ||
         (PopupDocument.documentElement.scrollTop != 0)))
    {
      if (NewPositionX > (PopupDocument.documentElement.scrollLeft + VisibleOffsetX))
      {
        NewPositionX = PopupDocument.documentElement.scrollLeft + VisibleOffsetX;
      }
      ScrollTop = PopupDocument.documentElement.scrollTop;
      if (NewPositionY > (PopupDocument.documentElement.scrollTop + VisibleOffsetY))
      {
        NewPositionY = PopupDocument.documentElement.scrollTop + VisibleOffsetY;
      }
    }
    else
    {
      if (NewPositionX > (PopupDocument.body.scrollLeft + VisibleOffsetX))
      {
        NewPositionX = PopupDocument.body.scrollLeft + VisibleOffsetX;
      }
      ScrollTop = PopupDocument.body.scrollTop;
      if (NewPositionY > (PopupDocument.body.scrollTop + VisibleOffsetY))
      {
        NewPositionY = PopupDocument.body.scrollTop + VisibleOffsetY;
      }
    }

    // Relocate popup if it will overlay the current mouse position
    //
    if ((this.mPositionY >= NewPositionY) &&
        (this.mPositionY <= (NewPositionY + PopupHeight)))
    {
      DeltaY = (NewPositionY + PopupHeight) - this.mPositionY;
      if (NewPositionY - (DeltaY + Margin) > ScrollTop)
      {
        NewPositionY -= DeltaY + Margin;
      }
    }

    // Set popup position
    //
    this.fPositionAt(NewPositionX, NewPositionY);
  }
  else if ((Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
           (Browser == 5))    // Shorthand for Safari
  {
    // Attempt to determine DIV tag dimensions
    //
    PopupWidth = this.mWidth;
    if (PopupDocument.getElementById(this.mDivID).offsetWidth > PopupWidth)
    {
      PopupWidth = PopupDocument.getElementById(this.mDivID).offsetWidth;
    }
    PopupHeight = 60;  // Guess a value
    if (PopupDocument.getElementById(this.mDivID).offsetHeight > PopupHeight)
    {
      PopupHeight = PopupDocument.getElementById(this.mDivID).offsetHeight;
    }

    // Calculate maximum values for X and Y such that the
    // popup will remain visible
    // Throw in a bit extra for vertical scroll bars when determinine the horizontal position
    //
    VisibleOffsetX = PopupWindow.innerWidth  - this.mOffsetX - PopupWidth - 16 - Margin;
    if (VisibleOffsetX < 0)
    {
      VisibleOffsetX = 0;
    }
    VisibleOffsetY = PopupWindow.innerHeight - this.mOffsetY - PopupHeight - Margin;
    if (VisibleOffsetY < 0)
    {
      VisibleOffsetY = 0;
    }

    // Confirm popup will be visible and adjust if necessary
    //
    if (NewPositionX > (PopupWindow.scrollX + VisibleOffsetX))
    {
      NewPositionX = PopupWindow.scrollX + VisibleOffsetX;
    }
    ScrollTop = PopupWindow.scrollY;
    if (NewPositionY > (PopupWindow.scrollY + VisibleOffsetY))
    {
      NewPositionY = PopupWindow.scrollY + VisibleOffsetY;
    }

    // Relocate popup if it will overlay the current mouse position
    //
    if ((this.mPositionY >= NewPositionY) &&
        (this.mPositionY <= (NewPositionY + PopupHeight)))
    {
      DeltaY = (NewPositionY + PopupHeight) - this.mPositionY;
      if (NewPositionY - (DeltaY + Margin) > ScrollTop)
      {
        NewPositionY -= DeltaY + Margin;
      }
    }

    // Set popup position
    //
    this.fPositionAt(NewPositionX, NewPositionY);
  }
}

function  WWHPopup_Reveal()
{
  var  PopupDocument = eval(this.mWindowRef + ".document");
  var  Browser = WWHFrame.WWHBrowser.mBrowser;


  if ((WWHFrame.WWHHandler.fIsReady()) &&
      (this.mSetTimeoutID != null))
  {
    if (Browser == 1)  // Shorthand for Netscape 4.x
    {
      // Position the popup
      //
      this.fPosition();

      // Show the popup
      //
      PopupDocument.layers[this.mDivID].zIndex = 1;
      PopupDocument.layers[this.mDivID].visibility = "visible";
      this.mbVisible = true;
    }
    else if ((Browser == 2) ||  // Shorthand for IE
             (Browser == 3))    // Shorthand for iCab
    {
      // Position the popup
      //
      this.fPosition();

      // Show the popup
      //
      PopupDocument.all[this.mDivID].style.zIndex = 1;
      PopupDocument.all[this.mDivID].style.visibility = "visible";
      this.mbVisible = true;
    }
    else if ((Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
             (Browser == 5))    // Shorthand for Safari
    {
      // Initial popup positioning before object size can be determined
      //
      this.fPosition();

      // Show the popup
      //
      PopupDocument.getElementById(this.mDivID).style.zIndex = 1;
      PopupDocument.getElementById(this.mDivID).style.visibility = "visible";
      this.mbVisible = true;

      // Position the popup
      // Offset calculations may be off so we might need to reposition the popup
      //
      this.fPosition();
    }
  }

  // Clear the setTimeout ID tracking field
  // to indicate that we're done.
  //
  this.mSetTimeoutID = null;
}

function  WWHPopup_Hide()
{
  var  Browser = WWHFrame.WWHBrowser.mBrowser;
  var  PopupDocument;


  // Cancel the setTimeout value that would have
  // displayed the popup
  //
  if (this.mSetTimeoutID != null)
  {
    clearTimeout(this.mSetTimeoutID);
    this.mSetTimeoutID = null;
  }

  // Shutdown the popup
  //
  if (this.mbVisible == true)
  {
    PopupDocument = eval(this.mWindowRef + ".document");

    if (Browser == 1)  // Shorthand for Netscape 4.x
    {
      PopupDocument.layers[this.mDivID].zIndex = -1;
      PopupDocument.layers[this.mDivID].visibility = "hidden";
    }
    else if ((Browser == 2) ||  // Shorthand for IE
             (Browser == 3))    // Shorthand for iCab
    {
      PopupDocument.all[this.mDivID].style.zIndex = -1;
      PopupDocument.all[this.mDivID].style.visibility = "hidden";
      PopupDocument.all[this.mDivID].style.display    = "none";
    }
    else if ((Browser == 4) ||  // Shorthand for Netscape 6.0 (Mozilla)
             (Browser == 5))    // Shorthand for Safari
    {
      PopupDocument.getElementById(this.mDivID).style.zIndex = -1;
      PopupDocument.getElementById(this.mDivID).style.visibility = "hidden";
      PopupDocument.getElementById(this.mDivID).style.display    = "none";
    }
  }

  this.mbVisible = false;
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHRelatedTopics_Object()
{
  this.mRelatedTopicList = new Array();
  this.mPopup            = new WWHPopup_Object("WWHFrame.WWHRelatedTopics.mPopup",
                                               WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"),
                                               WWHRelatedTopicsPopup_Translate,
                                               WWHRelatedTopicsPopup_Format,
                                               "WWHRelatedTopicsDIV", "WWHRelatedTopicsText", 10, 0, 0,
                                               WWHFrame.WWHHelp.mSettings.mRelatedTopics.mWidth);

  this.fHasRelatedTopics = WWHRelatedTopics_HasRelatedTopics;
  this.fClear            = WWHRelatedTopics_Clear;
  this.fAdd              = WWHRelatedTopics_Add;
  this.fHTML             = WWHRelatedTopics_HTML;
  this.fDisplayTopic     = WWHRelatedTopics_DisplayTopic;
  this.fShow             = WWHRelatedTopics_Show;
  this.fShowAtEvent      = WWHRelatedTopics_ShowAtEvent;
  this.fHide             = WWHRelatedTopics_Hide;
  this.fInlineHTML       = WWHRelatedTopics_InlineHTML;
  this.fPopupHTML        = WWHRelatedTopics_PopupHTML;
}

function  WWHRelatedTopics_HasRelatedTopics()
{
  var  bVarHasRelatedTopics = false;


  if (this.mRelatedTopicList.length > 0)
  {
    bVarHasRelatedTopics = true;
  }

  return bVarHasRelatedTopics;
}

function  WWHRelatedTopics_Clear()
{
  this.mRelatedTopicList.length = 0;
}

function  WWHRelatedTopics_Add(ParamText,
                               ParamContext,
                               ParamFileURL)
{
  this.mRelatedTopicList[this.mRelatedTopicList.length] = new WWHRelatedTopicEntry_Object(ParamText, ParamContext, ParamFileURL);
}

function  WWHRelatedTopics_HTML()
{
  var  HTML = new WWHStringBuffer_Object();
  var  Settings = WWHFrame.WWHHelp.mSettings.mRelatedTopics;
  var  FontFamily = "";
  var  FontSize;
  var  MaxIndex;
  var  Index;
  var  ContextBook;


  if ( ! WWHFrame.WWHBrowser.mbSupportsPopups)
  {
    // Determine font family if running Netscape 4.x
    // Required due to errors processing style attributes
    //
    if (WWHFrame.WWHBrowser.mBrowser == 1)  // Shorthand for Netscape 4.x
    {
      FontFamily = WWHStringUtilities_ExtractStyleAttribute("font-family", Settings.mInlineFontStyle);
      FontSize   = WWHStringUtilities_ExtractStyleAttribute("font-size", Settings.mInlineFontStyle);
    }
  }

  for (MaxIndex = this.mRelatedTopicList.length, Index = 0 ; Index < MaxIndex ; Index++)
  {
    ContextBook = WWHFrame.WWHHelp.mBooks.fGetContextBook(this.mRelatedTopicList[Index].mContext);
    if (ContextBook != null)
    {
      if (WWHFrame.WWHBrowser.mbSupportsPopups)
      {
        HTML.fAppend("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\">");
        HTML.fAppend("<tr>");
        HTML.fAppend("<td width=\"17\" valign=\"middle\">");
        HTML.fAppend("<a");
        HTML.fAppend(" href=\"javascript:WWHFrame.WWHRelatedTopics.fDisplayTopic(" + Index + ");\">");
        HTML.fAppend("<img border=\"0\" src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images/doc.gif\" width=\"17\" height=\"17\" alt=\"\">");
        HTML.fAppend("</a>");
        HTML.fAppend("</td>");
        HTML.fAppend("<td width=\"100%\" align=\"left\" valign=\"middle\">");
        HTML.fAppend("<a");
        HTML.fAppend(" href=\"javascript:WWHFrame.WWHRelatedTopics.fDisplayTopic(" + Index + ");\"");
        HTML.fAppend(" style=\"text-decoration: none ; color: " + Settings.mForegroundColor + " ; " + Settings.mFontStyle + "\">");
        HTML.fAppend(this.mRelatedTopicList[Index].mText);
        HTML.fAppend("</a>");
        HTML.fAppend("</td>");
        HTML.fAppend("</tr>");
        HTML.fAppend("</table>\n");
      }
      else
      {
        if (HTML.fSize() == 0)
        {
          HTML.fAppend("<ul>\n");
        }

        HTML.fAppend("<li>");
        if (FontFamily.length > 0)
        {
          HTML.fAppend("<font face=\"" + FontFamily + "\" point-size=\"" + FontSize + "\" color=\"" + Settings.mForegroundColor + "\">");
        }
        HTML.fAppend("<a");
        HTML.fAppend(" href=\"javascript:WWHFrame.WWHRelatedTopics.fDisplayTopic(" + Index + ");\"");
        if (FontFamily.length == 0)
        {
          HTML.fAppend(" style=\"text-decoration: none ; color: " + Settings.mForegroundColor + " ; " + Settings.mFontStyle + "\"");
        }
        HTML.fAppend(">");
        HTML.fAppend(this.mRelatedTopicList[Index].mText);
        HTML.fAppend("</a>");
        if (FontFamily.length > 0)
        {
          HTML.fAppend("</font>");
        }
        HTML.fAppend("</li>\n");
      }
    }
  }

  if ( ! WWHFrame.WWHBrowser.mbSupportsPopups)
  {
    if (HTML.fSize() > 0)
    {
      HTML.fAppend("</ul>\n");
    }
  }

  return HTML.fGetBuffer();
}

function  WWHRelatedTopics_DisplayTopic(ParamIndex)
{
  var  ContextBook;
  var  RelatedTopicURL = null;


  ContextBook = WWHFrame.WWHHelp.mBooks.fGetContextBook(this.mRelatedTopicList[ParamIndex].mContext);
  if (ContextBook != null)
  {
    RelatedTopicURL = WWHFrame.WWHHelp.mBaseURL + ContextBook.mDirectory + this.mRelatedTopicList[ParamIndex].mFileURL;

    // Hide popup to prevent JavaScript errors before displaying target document
    //
    this.fHide();

    WWHFrame.WWHHelp.fSetDocumentHREF(RelatedTopicURL, false);
  }
}

function  WWHRelatedTopicEntry_Object(ParamText,
                                      ParamContext,
                                      ParamFileURL)
{
  this.mText    = ParamText;
  this.mContext = ParamContext;
  this.mFileURL = ParamFileURL;
}

function  WWHRelatedTopics_Show()
{
  var  FakeEvent;
  var  VarDocumentFrame;


  // Create dummy event to pass to popup show command
  //
  FakeEvent = new WWHRelatedTopicsPopup_FakeEvent_Object();

  VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));

  // Assign coordinates to event base on browser type
  // Place event at far right and allow popup code to handle repositioning for display
  //
  if (WWHFrame.WWHBrowser.mBrowser == 1)  // Shorthand for Netscape 4.x
  {
    FakeEvent.layerX = VarDocumentFrame.innerWidth + VarDocumentFrame.pageXOffset;
    FakeEvent.layerY = VarDocumentFrame.pageYOffset;
  }
  else if (WWHFrame.WWHBrowser.mBrowser == 2)  // Shorthand for IE
  {
    if ((typeof(VarDocumentFrame.document.documentElement) != "undefined") &&
        (typeof(VarDocumentFrame.document.documentElement.clientWidth) != "undefined") &&
        (typeof(VarDocumentFrame.document.documentElement.clientHeight) != "undefined") &&
        ((VarDocumentFrame.document.documentElement.clientWidth != 0) ||
         (VarDocumentFrame.document.documentElement.clientHeight != 0)))
    {
      FakeEvent.x = VarDocumentFrame.document.documentElement.clientWidth;
      FakeEvent.y = 0;
    }
    else
    {
      FakeEvent.x = VarDocumentFrame.document.body.clientWidth;
      FakeEvent.y = 0;
    }
  }
  else if ((WWHFrame.WWHBrowser.mBrowser == 4) ||  // Shorthand for Netscape 6.x (Mozilla)
           (WWHFrame.WWHBrowser.mBrowser == 5))    // Shorthand for Safari
  {
    FakeEvent.layerX = VarDocumentFrame.innerWidth + VarDocumentFrame.pageXOffset;
    FakeEvent.layerY = VarDocumentFrame.pageYOffset;
  }

  // Show popup
  //
  this.fShowAtEvent(FakeEvent);
}

function  WWHRelatedTopics_ShowAtEvent(ParamEvent)
{
  var  RelatedTopicsHTML;


  // Show popup
  //
  RelatedTopicsHTML = this.fHTML();
  if (RelatedTopicsHTML.length > 0)
  {
    this.mPopup.fShow(RelatedTopicsHTML, ParamEvent);
  }
}

function  WWHRelatedTopics_Hide()
{
  this.mPopup.fHide();
}

function  WWHRelatedTopics_InlineHTML()
{
  var  HTML = "";
  var  Settings;
  var  FontFamily = "";
  var  FontSize;
  var  ForegroundColor;
  var  BackgroundColor;
  var  BorderColor;
  var  ImageDir;
  var  AnchorAttributes;


  if (this.fHasRelatedTopics())
  {
    Settings = WWHFrame.WWHHelp.mSettings.mRelatedTopics;

    // Determine font family if running Netscape 4.x
    // Required due to errors processing style attributes
    //
    if (WWHFrame.WWHBrowser.mBrowser == 1)  // Shorthand for Netscape 4.x
    {
      FontFamily = WWHStringUtilities_ExtractStyleAttribute("font-family", Settings.mInlineFontStyle);
      FontSize   = WWHStringUtilities_ExtractStyleAttribute("font-size", Settings.mInlineFontStyle);
    }

    ForegroundColor = Settings.mInlineForegroundColor;
    BackgroundColor = Settings.mInlineBackgroundColor;
    BorderColor     = Settings.mInlineBorderColor;
    ImageDir        = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";

    if (WWHFrame.WWHBrowser.mbSupportsPopups)
    {
      if (Settings.mbInlineEnabled)
      {
        AnchorAttributes = "href=\"javascript:WWHDoNothingHREF();\"";
        AnchorAttributes += " onclick=\"WWHShowRelatedTopicsPopup((document.all||document.getElementById||document.layers)?event:null);\"";

        HTML += "<div class=\"WWHInlineRelatedTopics\">";
        HTML += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        HTML += "<tr>";
        HTML += "<td valign=\"bottom\">";
        HTML += "<nobr>";
        if (FontFamily.length > 0)
        {
          HTML += "<font face=\"" + FontFamily + "\" point-size=\"" + FontSize + "\" color=\"" + ForegroundColor + "\">";
        }
        HTML += "<a";
        if (FontFamily.length == 0)
        {
          HTML += " style=\"text-decoration: none ; color: " + ForegroundColor + " ; " + Settings.mInlineFontStyle + "\"";
        }
        HTML += " " + AnchorAttributes + ">";
        HTML += WWHFrame.WWHHelp.mMessages.mRelatedTopicsIconLabel;
        HTML += "</a>";
        HTML += "&nbsp;";
        if (FontFamily.length > 0)
        {
          HTML += "</font>";
        }
        HTML += "</nobr>";
        HTML += "</td>";
        HTML += "<td valign=\"bottom\">";
        HTML += "<a " + AnchorAttributes + ">";
        HTML += "<img border=\"0\" src=\"" + ImageDir + "/relatedi.gif\" alt=\"\">";
        HTML += "</a>";
        HTML += "</td>";
        HTML += "</tr>";
        HTML += "</table>";
        HTML += "</div>";
      }
    }
    else
    {
      // Display inline without popups
      //
      if ((WWHFrame.WWHHelp.mSettings.mbRelatedTopicsEnabled) ||
          (Settings.mbInlineEnabled))
      {
        // Emit title
        //
        HTML += "<hr>";

        if (FontFamily.length > 0)
        {
          HTML += "<p>";
          HTML += "<font face=\"" + FontFamily + "\" point-size=\"" + FontSize + "\" color=\"" + ForegroundColor + "\">";
        }
        else
        {
          HTML += "<p style=\"text-decoration: none ; color: " + ForegroundColor + " ; " + Settings.mInlineFontStyle + "\">";
        }
        HTML += WWHFrame.WWHHelp.mMessages.mRelatedTopicsIconLabel + "<a name=\"WWHRelatedTopics\">&nbsp;</a>";
        if (FontFamily.length > 0)
        {
          HTML += "</font>";
        }
        HTML += "</p>";

        // Get formatted HTML
        //
        HTML += this.fHTML();
      }
    }
  }

  return HTML;
}

function  WWHRelatedTopics_PopupHTML()
{
  var  VarHTML = "";


  if (WWHFrame.WWHBrowser.mbSupportsPopups)
  {
    VarHTML = this.mPopup.fDivTagText();
  }

  return VarHTML;
}

function  WWHRelatedTopicsPopup_FakeEvent_Object()
{
}

function  WWHRelatedTopicsPopup_Translate(ParamText)
{
  return ParamText;
}

function  WWHRelatedTopicsPopup_Format(ParamWidth,
                                       ParamTextID,
                                       ParamText)
{
  var  FormattedText        = "";
  var  Settings             = WWHFrame.WWHHelp.mSettings.mRelatedTopics;
  var  ImageDir             = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
  var  BackgroundColor      = Settings.mBackgroundColor;
  var  BorderColor          = Settings.mBorderColor;
  var  TitleForegroundColor = Settings.mTitleForegroundColor;
  var  TitleBackgroundColor = Settings.mTitleBackgroundColor;
  var  ReqSpacer1w2h        = "<img src=\"" + ImageDir + "/spc1w2h.gif\" width=1 height=2 alt=\"\">";
  var  ReqSpacer2w1h        = "<img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1 alt=\"\">";
  var  ReqSpacer4w4h        = "<img src=\"" + ImageDir + "/spacer4.gif\" width=4 height=4 alt=\"\">";
  var  Spacer1w2h           = ReqSpacer1w2h;
  var  Spacer2w1h           = ReqSpacer2w1h;
  var  Spacer4w4h           = ReqSpacer4w4h;


  // Netscape 6.x (Mozilla) renders table cells with graphics
  // incorrectly inside of <div> tags that are rewritten on the fly
  //
  if (WWHFrame.WWHBrowser.mBrowser == 4)  // Shorthand for Netscape 6.x (Mozilla)
  {
    Spacer1w2h = "";
    Spacer2w1h = "";
    Spacer4w4h = "";
  }

  FormattedText += "<table width=\"" + ParamWidth + "\" border=0 cellspacing=0 cellpadding=0 bgcolor=\"" + BackgroundColor + "\">";
  FormattedText += " <tr>";
  FormattedText += "  <td height=2 colspan=6 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4 colspan=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 colspan=2 bgcolor=\"" + TitleBackgroundColor + "\">" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td bgcolor=\"" + TitleBackgroundColor + "\" width=\"100%\" align=\"left\" valign=\"middle\"><nobr><span style=\"" + Settings.mTitleFontStyle + " ; color: " + TitleForegroundColor + "\">" + ReqSpacer4w4h + WWHFrame.WWHHelp.mMessages.mRelatedTopicsIconLabel + "</span></nobr></td>";
  FormattedText += "  <td bgcolor=\"" + TitleBackgroundColor + "\" width=\"16\" align=\"right\" valign=\"middle\"><nobr><a href=\"javascript:WWHFrame.WWHRelatedTopics.fHide();\"><img src=\"" + ImageDir + "/close.gif\" border=0 width=16 height=15 alt=\"\"></a>" + ReqSpacer4w4h + "</nobr></td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 colspan=2 bgcolor=\"" + TitleBackgroundColor + "\">" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4 colspan=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td colspan=2 width=\"100%\" id=\"" + ParamTextID + "\">" + ParamText + "</td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4 colspan=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=2 colspan=6 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>";
  FormattedText += " </tr>";
  FormattedText += "</table>";

  return FormattedText;
}

function  WWHALinks_Object()
{
  this.mALinksHash = new Object();
  this.mPopup      = new WWHPopup_Object("WWHFrame.WWHALinks.mPopup",
                                         WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"),
                                         WWHALinksPopup_Translate,
                                         WWHALinksPopup_Format,
                                         "WWHALinksDIV", "WWHALinksText", 10, 0, 0,
                                         WWHFrame.WWHHelp.mSettings.mALinks.mWidth);
  this.mALinks     = new Array();
  this.mbSingle    = false;

  this.fAdd        = WWHALinks_Add;
  this.fA          = WWHALinks_Add;
  this.fSetALinks  = WWHALinks_SetALinks;
  this.fHTML       = WWHALinks_HTML;
  this.fGotoALink  = WWHALinks_GotoALink;
  this.fShow       = WWHALinks_Show;
  this.fHide       = WWHALinks_Hide;
  this.fInlineHTML = WWHALinks_InlineHTML;
  this.fPopupHTML  = WWHALinks_PopupHTML;
}

function  WWHALinks_Add(ParamKeyword,
                        ParamALinksArray)
{
  var  VarALinksEntry;


  // Access alink entry
  //
  VarALinksEntry = this.mALinksHash[ParamKeyword + "~"];
  if ((typeof(VarALinksEntry) == "undefined") ||
      (VarALinksEntry == null))
  {
    VarALinksEntry = new WWHALinksEntry_Object();
    this.mALinksHash[ParamKeyword + "~"] = VarALinksEntry;
  }

  // Add links
  //
  VarALinksEntry.fAddLinks(WWHFrame.WWHHelp.mBooks.mInitIndex, ParamALinksArray);
}

function  WWHALinks_SetALinks(ParamKeywordsArray)
{
  var  bVarFirstLink = true;
  var  VarMaxIndex;
  var  VarIndex;
  var  VarKeyword;
  var  VarALinksEntry;
  var  VarMaxBookLinksIndex;
  var  VarBookLinksIndex;
  var  VarBookLinks;
  var  VarCheckHashArray = new Array();
  var  VarALinkEntry;
  var  VarCheckHash;
  var  VarMaxLinkIndex;
  var  VarLinkIndex;
  var  VarCheckLink;


  // Reset alinks info
  //
  this.mALinks  = new Array();
  this.mbSingle = false;

  // Get links for each keyword
  //
  for (VarMaxIndex = ParamKeywordsArray.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
  {
    VarKeyword = ParamKeywordsArray[VarIndex];

    // Get keyword links
    //
    VarALinksEntry = this.mALinksHash[VarKeyword + "~"];
    if ((typeof(VarALinksEntry) != "undefined") &&
        (VarALinksEntry != null))
    {
      // Add links
      //
      for (VarMaxBookLinksIndex = VarALinksEntry.mBookLinks.length, VarBookLinksIndex = 0 ; VarBookLinksIndex < VarMaxBookLinksIndex ; VarBookLinksIndex++)
      {
        // Access book info
        //
        VarBookLinks = VarALinksEntry.mBookLinks[VarBookLinksIndex];

        // Access book entries
        //
        while (this.mALinks.length <= VarBookLinks.mBookIndex)
        {
          this.mALinks[this.mALinks.length] = new Array();
          VarCheckHashArray[VarCheckHashArray.length] = new Object();
        }
        VarALinkEntry = this.mALinks[VarBookLinks.mBookIndex];
        VarCheckHash  = VarCheckHashArray[VarBookLinks.mBookIndex];

        // Add entries
        //
        for (VarMaxLinkIndex = VarBookLinks.mLinks.length, VarLinkIndex = 0 ; VarLinkIndex < VarMaxLinkIndex ; VarLinkIndex++)
        {
          // Confirm link will not be added more than once per book
          //
          VarCheckLink = VarCheckHash[VarBookLinks.mLinks[VarLinkIndex] + "~"];
          if ((typeof(VarCheckLink) == "undefined") ||
              (VarCheckLink == null))
          {
            // Add the link
            //
            VarALinkEntry[VarALinkEntry.length] = VarBookLinks.mLinks[VarLinkIndex];
            VarCheckHash[VarBookLinks.mLinks[VarLinkIndex] + "~"] = "1";

            // Single link?
            //
            if (bVarFirstLink)
            {
              this.mbSingle = true;
              bVarFirstLink = false;
            }
            else
            {
              this.mbSingle = false;
            }
          }
        }
      }
    }
  }
}

function  WWHALinks_HTML(bParamReplace)
{
  var  VarHTML = new WWHStringBuffer_Object();
  var  VarImageDirectory = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
  var  VarSettings = WWHFrame.WWHHelp.mSettings.mALinks;
  var  VarFontFamily = "";
  var  VarFontSize;
  var  VarMaxIndex;
  var  VarIndex;
  var  VarLinks;
  var  VarLink;
  var  VarParts;
  var  VarLinkFileIndex;


  // Get font information
  //
  if ( ! WWHFrame.WWHBrowser.mbSupportsPopups)
  {
    // Determine font family if running Netscape 4.x
    // Required due to errors processing style attributes
    //
    if (WWHFrame.WWHBrowser.mBrowser == 1)  // Shorthand for Netscape 4.x
    {
      VarFontFamily = WWHStringUtilities_ExtractStyleAttribute("font-family", VarSettings.mInlineFontStyle);
      VarFontSize   = WWHStringUtilities_ExtractStyleAttribute("font-size", VarSettings.mInlineFontStyle);
    }
  }

  // Format and display as HTML
  //
  VarHTML.fReset();
  for (VarMaxIndex = this.mALinks.length, VarIndex = 0; VarIndex < VarMaxIndex ; VarIndex++)
  {
    VarLinks = this.mALinks[VarIndex];
    if (VarLinks.length > 0)
    {
      // Emit book title
      //
      if (VarSettings.mbShowBook)
      {
        // Emit the book title
        //
        VarHTML.fAppend("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\">");
        VarHTML.fAppend("<tr>");
        VarHTML.fAppend("<td width=\"17\" valign=\"middle\">");
        VarHTML.fAppend("<img border=\"0\" src=\"" + VarImageDirectory + "/fo.gif\" width=\"17\" height=\"17\" alt=\"\">");
        VarHTML.fAppend("</td>");
        VarHTML.fAppend("<td width=\"100%\" align=\"left\" valign=\"middle\">");
        VarHTML.fAppend("<span ");
        VarHTML.fAppend(" style=\"text-decoration: none ; color: " + VarSettings.mForegroundColor + " ; " + VarSettings.mFontStyle + "\">");
        VarHTML.fAppend(WWHFrame.WWHHelp.mBooks.fGetBookTitle(VarIndex));
        VarHTML.fAppend("</span>");
        VarHTML.fAppend("</td>");
        VarHTML.fAppend("</tr>");
        VarHTML.fAppend("</table>\n");

        // Open indentation
        //
        VarHTML.fAppend("<div style=\"margin-left: " + VarSettings.mIndent + "pt\">\n");
      }

      for (VarMaxLinkIndex = VarLinks.length, VarLinkIndex = 0 ; VarLinkIndex < VarMaxLinkIndex ; VarLinkIndex++)
      {
        // Get link info
        //
        VarLink = VarLinks[VarLinkIndex];
        VarParts = VarLink.split("#");
        VarLinkFileIndex = parseInt(VarParts[0]);

        // Emit link entry
        //
        VarHTML.fAppend("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\">");
        VarHTML.fAppend("<tr>");
        VarHTML.fAppend("<td width=\"17\" valign=\"middle\">");
        VarHTML.fAppend("<a");
        VarHTML.fAppend(" href=\"javascript:WWHFrame.WWHALinks.fGotoALink(" + VarIndex + "," + VarLinkIndex + ", " + bParamReplace + ");\"");
        VarHTML.fAppend(">");
        VarHTML.fAppend("<img border=\"0\" src=\"" + VarImageDirectory + "/doc.gif\" width=\"17\" height=\"17\" alt=\"\">");
        VarHTML.fAppend("</a>");
        VarHTML.fAppend("</td>");
        VarHTML.fAppend("<td width=\"100%\" align=\"left\" valign=\"middle\">");
        VarHTML.fAppend("<a");
        VarHTML.fAppend(" href=\"javascript:WWHFrame.WWHALinks.fGotoALink(" + VarIndex + "," + VarLinkIndex + ", " + bParamReplace + ");\"");
        VarHTML.fAppend(" style=\"text-decoration: none ; color: " + VarSettings.mForegroundColor + " ; " + VarSettings.mFontStyle + "\">");
        VarHTML.fAppend(WWHFrame.WWHHelp.mBooks.fBookIndexFileIndexToTitle(VarIndex, VarLinkFileIndex));
        VarHTML.fAppend("</a>");
        VarHTML.fAppend("</td>");
        VarHTML.fAppend("</tr>");
        VarHTML.fAppend("</table>\n");
      }

      if (VarSettings.mbShowBook)
      {
        // Close indendation
        //
        VarHTML.fAppend("</div>\n");
      }
    }
  }

  return VarHTML.fGetBuffer();
}

function  WWHALinks_GotoALink(ParamBookIndex,
                              ParamLinkIndex,
                              bParamReplace)
{
  var  VarLinks;
  var  VarLink;
  var  VarParts;
  var  VarLinkFileIndex;
  var  VarLinkAnchor;
  var  VarDocumentURL;


  // Hide popup to prevent JavaScript errors before displaying target document
  //
  if (WWHFrame.WWHBrowser.mbSupportsPopups)
  {
    this.fHide();
  }

  // Determine document URL
  //
  VarLinks = this.mALinks[ParamBookIndex];
  VarLink = VarLinks[ParamLinkIndex];
  VarParts = VarLink.split("#");
  VarLinkFileIndex = parseInt(VarParts[0]);
  VarLinkAnchor = null;
  if (VarParts.length > 1)
  {
    if (VarParts[1].length > 0)
    {
      VarLinkAnchor = VarParts[1];
    }
  }
  VarDocumentURL = WWHFrame.WWHHelp.fGetBookIndexFileIndexURL(ParamBookIndex, VarLinkFileIndex, VarLinkAnchor);

  // Reset alinks list
  //
  this.mALinks  = new Array();
  this.mbSingle = false;

  // Goto document
  //
  WWHFrame.WWHHelp.fSetDocumentHREF(VarDocumentURL, bParamReplace);
}

function  WWHALinks_Show(ParamKeywordArray,
                         ParamEvent)
{
  var  VarMaxIndex;
  var  VarIndex;
  var  VarLinks;
  var  VarALinksHTML;


  // Set alinks for given keywords
  //
  this.fSetALinks(ParamKeywordArray);
  if (this.mALinks.length > 0)
  {
    if (this.mbSingle)
    {
      // Just go to single target
      //
      for (VarMaxIndex = this.mALinks.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
      {
        VarLinks = this.mALinks[VarIndex];
        if (VarLinks.length > 0)
        {
          // Display single link
          //
          this.fGotoALink(VarIndex, 0, false);

          // Exit loop
          //
          VarIndex = VarMaxIndex;
        }
      }
    }
    else
    {
      if (WWHFrame.WWHBrowser.mbSupportsPopups)
      {
        // Show popup
        //
        VarALinksHTML = this.fHTML(false);
        if (VarALinksHTML.length > 0)
        {
          this.mPopup.fShow(VarALinksHTML, ParamEvent);
        }
      }
      else
      {
        // Display selection page in browser window
        //
        WWHFrame.WWHHelp.fSetDocumentHREF(WWHFrame.WWHHelp.mBaseURL + "wwhelp/wwhimpl/common/html/alinks.htm", false);
      }
    }
  }
}

function  WWHALinks_Hide()
{
  this.mPopup.fHide();
}

function  WWHALinks_InlineHTML()
{
  var  VarHTML = new WWHStringBuffer_Object();
  var  VarSettings          = WWHFrame.WWHHelp.mSettings.mALinks;
  var  ImageDir             = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
  var  BackgroundColor      = VarSettings.mBackgroundColor;
  var  BorderColor          = VarSettings.mBorderColor;
  var  TitleForegroundColor = VarSettings.mTitleForegroundColor;
  var  TitleBackgroundColor = VarSettings.mTitleBackgroundColor;
  var  ReqSpacer1w2h        = "<img src=\"" + ImageDir + "/spc1w2h.gif\" width=1 height=2 alt=\"\">";
  var  ReqSpacer2w1h        = "<img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1 alt=\"\">";
  var  ReqSpacer4w4h        = "<img src=\"" + ImageDir + "/spacer4.gif\" width=4 height=4 alt=\"\">";
  var  Spacer1w2h           = ReqSpacer1w2h;
  var  Spacer2w1h           = ReqSpacer2w1h;
  var  Spacer4w4h           = ReqSpacer4w4h;


  VarHTML.fReset();

  // Netscape 6.x (Mozilla) renders table cells with graphics
  // incorrectly inside of <div> tags that are rewritten on the fly
  //
  if (WWHFrame.WWHBrowser.mBrowser == 4)  // Shorthand for Netscape 6.x (Mozilla)
  {
    Spacer1w2h = "";
    Spacer2w1h = "";
    Spacer4w4h = "";
  }

  VarHTML.fAppend("<table border=0 cellspacing=0 cellpadding=0 bgcolor=\"" + BackgroundColor + "\">");
  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td height=2 colspan=5 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend("  <td height=4 colspan=3>" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend("  <td height=4>" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + TitleBackgroundColor + "\">" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4>" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>");
  VarHTML.fAppend("  <td>" + ReqSpacer4w4h + "</td>");
  VarHTML.fAppend("  <td bgcolor=\"" + TitleBackgroundColor + "\" align=\"left\" valign=\"middle\"><nobr><span style=\"" + VarSettings.mTitleFontStyle + " ; color: " + TitleForegroundColor + "\">" + ReqSpacer4w4h + WWHFrame.WWHHelp.mMessages.mSeeAlsoLabel + "</span></nobr></td>");
  VarHTML.fAppend("  <td>" + ReqSpacer4w4h + "</td>");
  VarHTML.fAppend("  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend("  <td height=4>" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + TitleBackgroundColor + "\">" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4>" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend("  <td height=4 colspan=3>" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>");
  VarHTML.fAppend("  <td>" + ReqSpacer4w4h + "</td>");
  VarHTML.fAppend("  <td>" + WWHFrame.WWHALinks.fHTML(true) + "</td>");
  VarHTML.fAppend("  <td>" + ReqSpacer4w4h + "</td>");
  VarHTML.fAppend("  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend("  <td height=4 colspan=3>" + Spacer4w4h + "</td>");
  VarHTML.fAppend("  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>");
  VarHTML.fAppend(" </tr>");

  VarHTML.fAppend(" <tr>");
  VarHTML.fAppend("  <td height=2 colspan=5 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>");
  VarHTML.fAppend(" </tr>");
  VarHTML.fAppend("</table>");

  return VarHTML.fGetBuffer();
}

function  WWHALinks_PopupHTML()
{
  var  VarHTML = "";


  if (WWHFrame.WWHBrowser.mbSupportsPopups)
  {
    VarHTML = this.mPopup.fDivTagText();
  }

  return VarHTML;
}

function  WWHALinksPopup_Translate(ParamText)
{
  return ParamText;
}

function  WWHALinksPopup_Format(ParamWidth,
                                ParamTextID,
                                ParamText)
{
  var  FormattedText        = "";
  var  VarSettings          = WWHFrame.WWHHelp.mSettings.mALinks;
  var  ImageDir             = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
  var  BackgroundColor      = VarSettings.mBackgroundColor;
  var  BorderColor          = VarSettings.mBorderColor;
  var  TitleForegroundColor = VarSettings.mTitleForegroundColor;
  var  TitleBackgroundColor = VarSettings.mTitleBackgroundColor;
  var  ReqSpacer1w2h        = "<img src=\"" + ImageDir + "/spc1w2h.gif\" width=1 height=2 alt=\"\">";
  var  ReqSpacer2w1h        = "<img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1 alt=\"\">";
  var  ReqSpacer4w4h        = "<img src=\"" + ImageDir + "/spacer4.gif\" width=4 height=4 alt=\"\">";
  var  Spacer1w2h           = ReqSpacer1w2h;
  var  Spacer2w1h           = ReqSpacer2w1h;
  var  Spacer4w4h           = ReqSpacer4w4h;


  // Netscape 6.x (Mozilla) renders table cells with graphics
  // incorrectly inside of <div> tags that are rewritten on the fly
  //
  if (WWHFrame.WWHBrowser.mBrowser == 4)  // Shorthand for Netscape 6.x (Mozilla)
  {
    Spacer1w2h = "";
    Spacer2w1h = "";
    Spacer4w4h = "";
  }

  FormattedText += "<table width=\"" + ParamWidth + "\" border=0 cellspacing=0 cellpadding=0 bgcolor=\"" + BackgroundColor + "\">";
  FormattedText += " <tr>";
  FormattedText += "  <td height=2 colspan=6 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4 colspan=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 colspan=2 bgcolor=\"" + TitleBackgroundColor + "\">" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td bgcolor=\"" + TitleBackgroundColor + "\" width=\"100%\" align=\"left\" valign=\"middle\"><nobr><span style=\"" + VarSettings.mTitleFontStyle + " ; color: " + TitleForegroundColor + "\">" + ReqSpacer4w4h + WWHFrame.WWHHelp.mMessages.mSeeAlsoLabel + "</span></nobr></td>";
  FormattedText += "  <td bgcolor=\"" + TitleBackgroundColor + "\" width=\"16\" align=\"right\" valign=\"middle\"><nobr><a href=\"javascript:WWHFrame.WWHALinks.fHide();\"><img src=\"" + ImageDir + "/close.gif\" border=0 width=16 height=15 alt=\"\"></a>" + ReqSpacer4w4h + "</nobr></td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 colspan=2 bgcolor=\"" + TitleBackgroundColor + "\">" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4 colspan=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td colspan=2 width=\"100%\" id=\"" + ParamTextID + "\">" + ParamText + "</td>";
  FormattedText += "  <td>" + ReqSpacer4w4h + "</td>";
  FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += "  <td height=4 colspan=4>" + Spacer4w4h + "</td>";
  FormattedText += "  <td height=4 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  FormattedText += " </tr>";

  FormattedText += " <tr>";
  FormattedText += "  <td height=2 colspan=6 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>";
  FormattedText += " </tr>";
  FormattedText += "</table>";

  return FormattedText;
}

function  WWHALinksEntry_Object()
{
  this.mBookLinks = new Array();

  this.fAddLinks = WWHALinksEntry_AddLinks;
}

function  WWHALinksEntry_AddLinks(ParamBookIndex,
                                  ParamLinksArray)
{
  var  VarBookLinks;


  VarBookLinks = new WWHALinksBookLinks_Object(ParamBookIndex, ParamLinksArray);
  this.mBookLinks[this.mBookLinks.length] = VarBookLinks;
}

function  WWHALinksBookLinks_Object(ParamBookIndex,
                                    ParamLinksArray)
{
  this.mBookIndex = ParamBookIndex;
  this.mLinks     = ParamLinksArray;
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHStringUtilities_GetBaseURL(ParamURL)
{
  var  BaseURL;
  var  Parts;


  // Remove URL parameters
  //
  BaseURL = ParamURL;
  if (BaseURL.indexOf("?") != -1)
  {
    Parts = BaseURL.split("?");
    BaseURL = Parts[0];
  }
  else if (BaseURL.indexOf("#") != -1) 
  {
    Parts = BaseURL.split("#");
    BaseURL = Parts[0];
  }

  // Trim down to last referenced directory
  //
  BaseURL = ParamURL.substring(0, ParamURL.lastIndexOf("/"));

  // Attempt to match known WWHelp directories
  //
  Parts = BaseURL.split("/wwhelp/wwhimpl/common/html");
  if (Parts[0] == BaseURL)
  {
    Parts = BaseURL.split("/wwhelp/wwhimpl/js/html");
  }

  // Append trailing slash for this directory
  //
  BaseURL = Parts[0] + "/";

  return BaseURL;
}

function  WWHStringUtilities_SearchReplace(ParamString,
                                           ParamSearchString,
                                           ParamReplaceString)
{
  var  ResultString;
  var  Index;


  ResultString = ParamString;

  if ((ParamSearchString.length > 0) &&
      (ResultString.length > 0))
  {
    Index = 0;
    while ((Index = ResultString.indexOf(ParamSearchString, Index)) != -1)
    {
      ResultString = ResultString.substring(0, Index) + ParamReplaceString + ResultString.substring(Index + ParamSearchString.length, ResultString.length);
      Index += ParamReplaceString.length;
    }
  }

  return ResultString;
}

function  WWHStringUtilities_FormatMessage(ParamMessage,
                                           ParamReplacement1,
                                           ParamReplacement2,
                                           ParamReplacement3,
                                           ParamReplacement4)
{
  var  VarFormattedMessage;
  var  VarSearchString;
  var  VarReplacementStringIndex;
  var  VarIndex;
  var  VarReplacementString;


  VarFormattedMessage = ParamMessage;
  if (VarFormattedMessage.length > 0)
  {
    VarSearchString = "%s";
    VarReplacementStringIndex = 1;
    VarIndex = 0;
    while ((VarIndex = VarFormattedMessage.indexOf(VarSearchString, VarIndex)) != -1)
    {
      VarReplacementString = null;
      if (VarReplacementStringIndex <= 4)
      {
        VarReplacementString = eval("ParamReplacement" + VarReplacementStringIndex);
      }

      if ((typeof(VarReplacementString) != "undefined") &&
          (VarReplacementString != null))
      {
        VarFormattedMessage = VarFormattedMessage.substring(0, VarIndex) + VarReplacementString + VarFormattedMessage.substring(VarIndex + VarSearchString.length, VarFormattedMessage.length);

        VarIndex += VarReplacementString.length;
      }
      else
      {
        VarIndex += VarSearchString.length;
      }

      VarReplacementStringIndex += 1;
    }
  }

  return VarFormattedMessage;
}

function  WWHStringUtilities_EscapeHTML(ParamHTML)
{
  var  EscapedHTML = ParamHTML;


  // Escape problematic characters
  // & < > "
  //
  EscapedHTML = WWHStringUtilities_SearchReplace(EscapedHTML, "&", "&amp;");
  EscapedHTML = WWHStringUtilities_SearchReplace(EscapedHTML, "<", "&lt;");
  EscapedHTML = WWHStringUtilities_SearchReplace(EscapedHTML, ">", "&gt;");
  EscapedHTML = WWHStringUtilities_SearchReplace(EscapedHTML, "\"", "&quot;");

  return EscapedHTML;
}

function  WWHStringUtilities_UnescapeHTML(ParamHTML)
{
  var  Text = ParamHTML;
  var  EscapedExpression;
  var  EscapedCharacterMatches;
  var  EscapeSequence;
  var  CharacterCode;
  var  JavaScriptCharacter;


  // Unescape problematic characters
  //
  // & < > "
  //
  Text = WWHStringUtilities_SearchReplace(Text, "&amp;", "&");
  Text = WWHStringUtilities_SearchReplace(Text, "&lt;", "<");
  Text = WWHStringUtilities_SearchReplace(Text, "&gt;", ">");
  Text = WWHStringUtilities_SearchReplace(Text, "&quot;", "\"");

  // If any still exist, replace them with normal character
  //
  if (Text.indexOf("&#") != -1)
  {
    EscapedExpression = new RegExp("&#([0-9]+);");
    EscapedCharacterMatches = EscapedExpression.exec(Text)
    while (EscapedCharacterMatches != null)
    {
      EscapeSequence = EscapedCharacterMatches[0];
      CharacterCode = parseInt(EscapedCharacterMatches[1]);

      // Turn character code into escaped JavaScript character
      //
      JavaScriptCharacter = String.fromCharCode(CharacterCode);

      // Replace in string
      //
      Text = WWHStringUtilities_SearchReplace(Text, EscapeSequence, JavaScriptCharacter);

      // Find more matches
      //
      EscapedCharacterMatches = EscapedExpression.exec(Text)
    }
  }

  return Text;
}

function  WWHStringUtilities_DecimalToHex(ParamNumber)
{
  var  HexNumber = "";


  HexNumber += WWHStringUtilities_HexDigit(ParamNumber >> 12);
  HexNumber += WWHStringUtilities_HexDigit(ParamNumber >>  8);
  HexNumber += WWHStringUtilities_HexDigit(ParamNumber >>  4);
  HexNumber += WWHStringUtilities_HexDigit(ParamNumber >>  0);

  return HexNumber;
}

function  WWHStringUtilities_HexDigit(ParamDigit)
{
  var  HexDigit;
  var  MaskedDigit = ParamDigit & 0x0F;


  // Translate to hex characters 'a' - 'f' if necessary
  //
  if (MaskedDigit == 10)
  {
    HexDigit = "a";
  }
  else if (MaskedDigit == 11)
  {
    HexDigit = "b";
  }
  else if (MaskedDigit == 12)
  {
    HexDigit = "c";
  }
  else if (MaskedDigit == 13)
  {
    HexDigit = "d";
  }
  else if (MaskedDigit == 14)
  {
    HexDigit = "e";
  }
  else if (MaskedDigit == 15)
  {
    HexDigit = "f";
  }
  else
  {
    HexDigit = MaskedDigit;
  }

  return HexDigit;
}

function  WWHStringUtilities_GetURLFilePathOnly(ParamURL)
{
  var  VarFilePathOnly;
  var  VarIndex;


  VarFilePathOnly = ParamURL;

  // Trim off any parameters
  //
  VarIndex = VarFilePathOnly.indexOf("?");
  if (VarIndex != -1)
  {
    VarFilePathOnly = VarFilePathOnly.substring(0, VarIndex);
  }

  // Trim off named anchor
  //
  VarIndex = VarFilePathOnly.indexOf("#");
  if (VarIndex != -1)
  {
    VarFilePathOnly = VarFilePathOnly.substring(0, VarIndex);
  }

  return VarFilePathOnly;
}

function  WWHStringUtilities_EscapeURLForJavaScriptAnchor(ParamURL)
{
  var  EscapedURL = ParamURL;


  // Escape problematic characters
  // \ " ' < >
  //
  EscapedURL = WWHStringUtilities_SearchReplace(EscapedURL, "\\", "\\\\");
  EscapedURL = WWHStringUtilities_SearchReplace(EscapedURL, "\"", "\\u0022");
  EscapedURL = WWHStringUtilities_SearchReplace(EscapedURL, "'", "\\u0027");
  EscapedURL = WWHStringUtilities_SearchReplace(EscapedURL, "<", "\\u003c");
  EscapedURL = WWHStringUtilities_SearchReplace(EscapedURL, ">", "\\u003e");

  return EscapedURL;
}

function  WWHStringUtilities_EscapeForJavaScript(ParamString)
{
  var  EscapedString = ParamString;


  // Escape problematic characters
  // \ " '
  //
  EscapedString = WWHStringUtilities_SearchReplace(EscapedString, "\\", "\\\\");
  EscapedString = WWHStringUtilities_SearchReplace(EscapedString, "\"", "\\u0022");
  EscapedString = WWHStringUtilities_SearchReplace(EscapedString, "'", "\\u0027");
  EscapedString = WWHStringUtilities_SearchReplace(EscapedString, "\n", "\\u000a");
  EscapedString = WWHStringUtilities_SearchReplace(EscapedString, "\r", "\\u000d");

  return EscapedString;
}

function  WWHStringUtilities_EscapeRegExp(ParamWord)
{
  var  WordRegExpPattern = ParamWord;


  // Escape special characters
  // \ ( ) [ ] . ? + ^ $
  //
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "\\", "\\\\");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, ".", "\\.");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "?", "\\?");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "+", "\\+");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "|", "\\|");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "^", "\\^");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "$", "\\$");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "(", "\\(");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, ")", "\\)");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "{", "\\{");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "}", "\\}");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "[", "\\[");
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "]", "\\]");

  // Windows IE 4.0 is brain dead
  //
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "/", "[/]");

  // Convert * to .*
  //
  WordRegExpPattern = WWHStringUtilities_SearchReplace(WordRegExpPattern, "*", ".*");

  return WordRegExpPattern;
}

function  WWHStringUtilities_WordToRegExpPattern(ParamWord)
{
  var  WordRegExpPattern;


  // Escape special characters
  // Convert * to .*
  //
  WordRegExpPattern = WWHStringUtilities_EscapeRegExp(ParamWord);

  // Add ^ and $ to force whole string match
  //
  WordRegExpPattern = "^" + WordRegExpPattern + "$";

  return WordRegExpPattern;
}

function  WWHStringUtilities_WordToRegExpWithSpacePattern(ParamWord)
{
  var  WordRegExpPattern;


  // Escape special characters
  // Convert * to .*
  //
  WordRegExpPattern = WWHStringUtilities_EscapeRegExp(ParamWord);

  // Add ^ and $ to force whole string match
  // Allow trailing whitespace
  //
  WordRegExpPattern = "^" + WordRegExpPattern + " *$";

  return WordRegExpPattern;
}

function  WWHStringUtilities_ExtractStyleAttribute(ParamAttribute,
                                                   ParamFontStyle)
{
  var  Attribute = "";
  var  AttributeIndex;
  var  AttributeStart;


  AttributeIndex = ParamFontStyle.indexOf(ParamAttribute, 0);
  if (AttributeIndex != -1)
  {
    AttributeStart = ParamFontStyle.indexOf(":", AttributeIndex);

    if (AttributeStart != -1)
    {
      AttributeStart += 1;

      AttributeEnd = ParamFontStyle.indexOf(";", AttributeStart);
      if (AttributeEnd == -1)
      {
        AttributeEnd = ParamFontStyle.length;
      }

      Attribute = ParamFontStyle.substring(AttributeStart + 1, AttributeEnd);
    }
  }

  return Attribute;
}

function  WWHStringBuffer_Object()
{
  this.mStringList        = new Array();
  this.mStringListEntries = 0;
  this.mSize              = 0;

  this.fSize      = WWHStringBuffer_Size;
  this.fReset     = WWHStringBuffer_Reset;
  this.fAppend    = WWHStringBuffer_Append;
  this.fGetBuffer = WWHStringBuffer_GetBuffer;
}

function  WWHStringBuffer_Size()
{
  return this.mSize;
}

function  WWHStringBuffer_Reset()
{
  this.mStringListEntries = 0;
  this.mSize              = 0;
}

function  WWHStringBuffer_Append(ParamString)
{
  this.mSize += ParamString.length;
  this.mStringList[this.mStringListEntries] = ParamString;
  this.mStringListEntries++;
}

function  WWHStringBuffer_GetBuffer()
{
  this.mStringList.length = this.mStringListEntries;

  return this.mStringList.join("");
}

function WWHStringUtilities_ParseWordsAndPhrases(ParamInput)
{
  var WordSplits      = new Array();
  var Results         = new Array();
  var StringWithSpace = "x x";
  var CurrentPhrase   = "";
  var CurrentWord     = "";
  var WordIndex       = 0;
  var StartQuotes     = false;

  if(ParamInput.length > 0)
  {
    WordSplits = ParamInput.split(StringWithSpace.substring(1, 2));
    for(WordIndex = 0; WordIndex < WordSplits.length; ++WordIndex)
    {
      CurrentWord = WordSplits[WordIndex];
      if(CurrentWord.length > 0)
      {
        // If the current word does not start with or end with a double quote
        // and a phrase has not been started, then add it to the result word list
        // and continue
        //
        if(CurrentWord.charAt(0) == '"')
        {
          if(StartQuotes)
          {
            // This entry ends the current phrase and the word following
            // the quote will be added as a separate word, unless there is
            // a second quote at the start that will start a new phrase
            //
            Results[Results.length] = CurrentPhrase.substring(0, CurrentPhrase.length - 1);
            CurrentPhrase = "";

            while ((CurrentWord.length > 0) &&
                     (CurrentWord.charAt(0) == '"'))
            {
              CurrentWord = CurrentWord.substring(1, CurrentWord.length);
            }
            if(CurrentWord.length > 0)
            {
              CurrentPhrase += CurrentWord + " ";
            }
          }
          else
          {
            StartQuotes = true;

            // Strip off the leading quotes and process the word
            //
            while ((CurrentWord.length > 0) &&
                     (CurrentWord.charAt(0) == '"'))
            {
              CurrentWord = CurrentWord.substring(1, CurrentWord.length);
            }

            if(CurrentWord.length > 0)
            {
              // One Word Phrase - Add it as a word and set StartQuotes to false
              //
              if(CurrentWord.charAt(CurrentWord.length - 1) == '"')
              {
                StartQuotes = false;
                // Strip off trailing quotes and add it as a word
                //
                while ((CurrentWord.length > 0) &&
                       (CurrentWord.charAt(CurrentWord.length - 1) == '"'))
                {
                  CurrentWord = CurrentWord.substring(0, CurrentWord.length - 1);
                }

                // Add the Word to the result array
                //
                Results[Results.length] = CurrentWord;
              }
              else
              {
                // The current word starts a phrase
                //
                CurrentPhrase += CurrentWord + " ";
              }
            }
          }
        }
        else if(CurrentWord.charAt(CurrentWord.length - 1) == '"')
        {
          // Strip off trailing quotes regardless
          //
          while ((CurrentWord.length > 0) &&
                 (CurrentWord.charAt(CurrentWord.length - 1) == '"'))
          {
            CurrentWord = CurrentWord.substring(0, CurrentWord.length - 1);
          }

          // Only process the word if the length is greater than 0 after
          // stripping the trailing quotes
          //
          if(CurrentWord.length > 0)
          {
            if(StartQuotes)
            {
              CurrentPhrase += CurrentWord;

              Results[Results.length] = CurrentPhrase;
              StartQuotes = false;
              CurrentPhrase = "";
            }
            else
            {
              // The phrase is not started
              //
              Results[Results.length] = CurrentWord;
            }
          }
        }
        else
        {
          // The word is either a single word or in the middle of a phrase
          //
          if(StartQuotes)
          {
            CurrentPhrase += CurrentWord + " ";
          }
          else
          {
            Results[Results.length] = CurrentWord;
          }
        }
      }
    }
  }

  return Results;
}
// Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
//

function  WWHSwitch_Object()
{
  this.mParameters     = "";
  this.mImplementation = "javascript";
  this.mSettings       = new WWHCommonSettings_Object();
  this.mMessages       = new WWHCommonMessages_Object();

  this.fExec               = WWHSwitch_Exec;
  this.fParseURLParameters = WWHSwitch_ParseURLParameters;
  this.fProcessURL         = WWHSwitch_ProcessURL;
  this.fSwitch             = WWHSwitch_Switch;

  // Load up messages
  //
  this.mMessages.fSetByLocale(WWHFrame.WWHBrowser.mLocale);
}

function  WWHSwitch_Exec(bParamNormalizeURL,
                         ParamURL)
{
  var  TargetURL   = ParamURL;
  var  FrameSetURL = "";


  // Determine cookie path
  //
  WWHFrame.WWHBrowser.fSetCookiePath(WWHStringUtilities_GetBaseURL(ParamURL));

  // Normalize URL if necessary
  //
  if (bParamNormalizeURL)
  {
    TargetURL = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);
  }

  // Process parameters
  //
  this.fProcessURL(TargetURL);

  // Pick frameset to use
  //
  if (this.mImplementation == "single")
  {
    FrameSetURL = "../../common/html/wwhelp.htm";
  }
  else
  {
    FrameSetURL = "../../js/html/wwhelp.htm";
  }

  // Switch to frameset
  //
  this.fSwitch(FrameSetURL);
}

function  WWHSwitch_ParseURLParameters(ParamURL)
{
  var  Result = new Array(null, null, null, "");
  var  Parts;
  var  MaxIndex;
  var  Index;
  var  SingleMarker     = "single=";
  var  ForceJSMarker    = "forcejs=";
  var  AccessibleMarker = "accessible=";
  var  Value;


  // Using a closure for this function. It is copied in help.js as well
  //
  function GetDelimitedArguments(ParamURL)
  {
    var  Parts = [];
    var  Parameters;

    // Process URL parameters
    //
    if (ParamURL.indexOf("?") != -1)
    {
      Parts = ParamURL.split("?");
    }
    else if (ParamURL.indexOf("#") != -1)
    {
      Parts = ParamURL.split("#");
      Parameters = Parts.slice(1).join("#");
      Parts.length = 2;
      Parts[1] = Parameters;
    }

    return Parts;
  }

  // Get parameters
  //
  Parts = GetDelimitedArguments(ParamURL);
  if (Parts.length > 0)
  {
    Parts[0] = Parts[1];

    // Sanitize parameters
    //
    Parts[0] = Parts[0].replace(/[\\<>:;"']|%5C|%3C|%3E|%3A|%3B|%22|%27/gim, "");

    Parts.length = 1;
    if (Parts[0].indexOf("&") != -1)
    {
      Parts = Parts[0].split("&");
    }

    // Process parameters, preserve non-switch related options
    //
    for (MaxIndex = Parts.length, Index = 0 ; Index < MaxIndex ; Index++)
    {
      if (Parts[Index].indexOf(SingleMarker) == 0)
      {
        Value = Parts[Index].substring(SingleMarker.length, Parts[Index].length);

        if (Value == "true")
        {
          Result[0] = true;
        }
      }
      else if (Parts[Index].indexOf(ForceJSMarker) == 0)
      {
        Value = Parts[Index].substring(ForceJSMarker.length, Parts[Index].length);

        if (Value == "true")
        {
          Result[1] = true;
        }
      }
      else if (Parts[Index].indexOf(AccessibleMarker) == 0)
      {
        Value = Parts[Index].substring(AccessibleMarker.length, Parts[Index].length);

        if ((Value == "true") ||
            (Value == "false") ||
            (Value == "ask"))
        {
          Result[2] = Value;
        }
      }
      else
      {
        if (Result[3].length > 0)
        {
          Result[3] += "&";
        }
        Result[3] += Parts[Index];
      }
    }
  }

  return Result;
}

function  WWHSwitch_ProcessURL(ParamURL)
{
  var  VarURLParameters;
  var  VarURLParam_Single;
  var  VarURLParam_ForceJS;
  var  VarURLParam_Accessible;
  var  VarAccessibleCookie = "WWH" + this.mSettings.mCookiesID + "_Acs";
  var  VarAccessible;
  var  VarImplementation;


  // Parse URL parameters
  //
  VarURLParameters = this.fParseURLParameters(ParamURL);
  VarURLParam_Single     = VarURLParameters[0];
  VarURLParam_ForceJS    = VarURLParameters[1];
  VarURLParam_Accessible = VarURLParameters[2];
  this.mParameters       = VarURLParameters[3];

  // Check for accessibility support
  //
  VarAccessible = "false";
  if ((this.mSettings.mAccessible == "true") ||
      (VarURLParam_Accessible == "true"))
  {
    VarAccessible = "true";
  }
  else if ((this.mSettings.mAccessible == "ask") ||
           (VarURLParam_Accessible == "ask"))
  {
    // Attempt to retrive setting from cookies, if allowed
    //
    VarAccessible = "ask";
    if (this.mSettings.mbCookies)
    {
      VarAccessible = WWHFrame.WWHBrowser.fGetCookie(VarAccessibleCookie);
      if (VarAccessible == null)
      {
        VarAccessible = "ask";
      }
    }

    // Ask if cookie not set or disallowed
    //
    if (VarAccessible == "ask")
    {
      if (confirm(this.mMessages.mUseAccessibleHTML))
      {
        VarAccessible = "true";
      }
      else
      {
        VarAccessible = "false";
      }
    }
  }

  // Determine implementation
  //
  VarImplementation = "javascript";

  // Reset implementation based on URL parameters
  //
  if ((VarURLParam_Single != null) &&
      (VarURLParam_Single == true))
  {
    VarImplementation = "single";
  }
  else if ((VarURLParam_ForceJS != null) &&
           (VarURLParam_ForceJS == true))
  {
    VarImplementation = "javascript";
  }

  // Store options in cookies, if possible
  //
  if (this.mSettings.mbCookies)
  {
    // Set accessibility option
    //
    if (((this.mSettings.mAccessible == "ask") &&
         (VarURLParam_Accessible == null)) ||
        (VarURLParam_Accessible == "ask"))
    {
      WWHFrame.WWHBrowser.fSetCookie(VarAccessibleCookie, VarAccessible, this.mSettings.mCookiesDaysToExpire);
    }
  }

  // Set implementation
  //
  this.mImplementation = VarImplementation;

  // Finalize URL parameters
  //
  if (VarAccessible == "true")
  {
    this.mParameters += "&accessible=true";
  }
  if (this.mParameters.length > 0)
  {
    // Using a "# to support bookmarks after the redirect
    //
    this.mParameters = "#" + this.mParameters;
  }
}

function  WWHSwitch_Switch(ParamFrameSetURL)
{
  var  SwitchURL;


  // Add parameters to redirect
  //
  SwitchURL = ParamFrameSetURL + this.mParameters;

  // Switch to desired frameset
  // Delay required since this page is processing the action
  //
  WWHFrame.WWHBrowser.fReplaceLocation("WWHFrame", SwitchURL);
}
// Copyright (c) 2009-2009 Quadralay Corporation.  All rights reserved.
//

function WWHUnicode_Break_CheckBreak_Sequence(ParamPrevious,
                                              ParamCurrent)
{
  var  VarResult = true;

  if (
      (
       (ParamPrevious == " ")
      )
       &&
      (
       (true)
      )
     )
  {
    VarResult = false;
  }
  else if (
           (
            (true)
           )
            &&
           (
            (WWHUnicodeInfo_WWNoBreak(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_WWNoBreak(ParamPrevious))
           )
            &&
           (
            (true)
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Korean_L(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Korean_L(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Korean_L(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_LV(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Korean_LV(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Korean_L(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_LV(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Korean_V(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Korean_L(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Korean_LVT(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Korean_L(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_LV(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_V(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_LVT(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_T(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Korean_T(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_ALetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_ABaseLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_ACMLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_Numeric(ParamPrevious))
             ||
            (WWHUnicodeInfo_MidNum(ParamPrevious))
             ||
            (WWHUnicodeInfo_MidNumLet(ParamPrevious))
             ||
            (WWHUnicodeInfo_MidLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_Katakana(ParamPrevious))
             ||
            (WWHUnicodeInfo_Hiragana(ParamPrevious))
             ||
            (WWHUnicodeInfo_Ideographic(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_L(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_LV(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_V(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_LVT(ParamPrevious))
             ||
            (WWHUnicodeInfo_Korean_T(ParamPrevious))
             ||
            (WWHUnicodeInfo_Extend(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Extend(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_ALetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_Extend(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_ALetter(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Katakana(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Katakana(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Numeric(ParamPrevious))
             ||
            (WWHUnicodeInfo_MidNumLet(ParamPrevious))
             ||
            (WWHUnicodeInfo_MidLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_Extend(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_ABaseLetter(ParamCurrent))
             ||
            (WWHUnicodeInfo_ACMLetter(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_ALetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_ABaseLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_ACMLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_Extend(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_MidNumLet(ParamCurrent))
             ||
            (WWHUnicodeInfo_MidLetter(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_ABaseLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_ACMLetter(ParamPrevious))
             ||
            (WWHUnicodeInfo_MidNum(ParamPrevious))
             ||
            (WWHUnicodeInfo_MidNumLet(ParamPrevious))
             ||
            (WWHUnicodeInfo_Numeric(ParamPrevious))
             ||
            (WWHUnicodeInfo_Extend(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_Numeric(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (WWHUnicodeInfo_Numeric(ParamPrevious))
             ||
            (WWHUnicodeInfo_Extend(ParamPrevious))
           )
            &&
           (
            (WWHUnicodeInfo_MidNum(ParamCurrent))
             ||
            (WWHUnicodeInfo_MidNumLet(ParamCurrent))
           )
          )
  {
    VarResult = false;
  }
  else if (
           (
            (true)
           )
            &&
           (
            (WWHUnicodeInfo_Hiragana(ParamCurrent))
             ||
            (WWHUnicodeInfo_Ideographic(ParamCurrent))
           )
          )
  {
    VarResult = true;
  }

  return VarResult;
}

function WWHUnicode_CheckBreakAtIndex(ParamString,
                                      ParamIndex)
{
  var  VarResult = false;

  if (ParamIndex < ParamString.length)
  {
    if (ParamString.length == 1)
    {
      VarResult = false;
    }
    else if (ParamString.length > 1)
    {
      // String is at least two characters long
      //
      if (ParamIndex == 0)
      {
        VarResult = false;
      }
      else
      {
        VarResult = WWHUnicode_Break_CheckBreak_Sequence(ParamString.charAt(ParamIndex - 1), ParamString.charAt(ParamIndex));
      }
    }
  }

  return VarResult;
}
// Copyright (c) 2009-2009 Quadralay Corporation.  All rights reserved.
//

// Derived from icu/source/data/unidata/DerivedCoreProperties.txt
//
// Editor: Visual Studio C# Express 2005
//
//   ^{[0-9A-F][0-9A-F][0-9A-F][0-9A-F]}\.\.{[0-9A-F][0-9A-F][0-9A-F][0-9A-F]} +;.*$
//     if (('\\u\1' <= c) && (c <= '\\u\2')) return true;
//
//   ^{[0-9A-F][0-9A-F][0-9A-F][0-9A-F]} +;.*$
//     if (c == '\\u\1') return true;
//
//   ^{[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]}\.\.{[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]} +;.*$
//     if (('\\u\1' <= c) && (c <= '\\u\2')) return true;
//
//   ^{[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]} +;.*$
//    if (c == '\\u\1') return true;

function WWHUnicodeInfo_Alphabetic(c)
{
  if (('\u0041' <= c) && (c <= '\u005A')) return true;
  if (('\u0061' <= c) && (c <= '\u007A')) return true;
  if (c == '\u00AA') return true;
  if (c == '\u00B5') return true;
  if (c == '\u00BA') return true;
  if (('\u00C0' <= c) && (c <= '\u00D6')) return true;
  if (('\u00D8' <= c) && (c <= '\u00F6')) return true;
  if (('\u00F8' <= c) && (c <= '\u01BA')) return true;
  if (c == '\u01BB') return true;
  if (('\u01BC' <= c) && (c <= '\u01BF')) return true;
  if (('\u01C0' <= c) && (c <= '\u01C3')) return true;
  if (('\u01C4' <= c) && (c <= '\u0236')) return true;
  if (('\u0250' <= c) && (c <= '\u02AF')) return true;
  if (('\u02B0' <= c) && (c <= '\u02C1')) return true;
  if (('\u02C6' <= c) && (c <= '\u02D1')) return true;
  if (('\u02E0' <= c) && (c <= '\u02E4')) return true;
  if (c == '\u02EE') return true;
  if (c == '\u0345') return true;
  if (c == '\u037A') return true;
  if (c == '\u0386') return true;
  if (('\u0388' <= c) && (c <= '\u038A')) return true;
  if (c == '\u038C') return true;
  if (('\u038E' <= c) && (c <= '\u03A1')) return true;
  if (('\u03A3' <= c) && (c <= '\u03CE')) return true;
  if (('\u03D0' <= c) && (c <= '\u03F5')) return true;
  if (('\u03F7' <= c) && (c <= '\u03FB')) return true;
  if (('\u0400' <= c) && (c <= '\u0481')) return true;
  if (('\u048A' <= c) && (c <= '\u04CE')) return true;
  if (('\u04D0' <= c) && (c <= '\u04F5')) return true;
  if (('\u04F8' <= c) && (c <= '\u04F9')) return true;
  if (('\u0500' <= c) && (c <= '\u050F')) return true;
  if (('\u0531' <= c) && (c <= '\u0556')) return true;
  if (c == '\u0559') return true;
  if (('\u0561' <= c) && (c <= '\u0587')) return true;
  if (('\u05B0' <= c) && (c <= '\u05B9')) return true;
  if (('\u05BB' <= c) && (c <= '\u05BD')) return true;
  if (c == '\u05BF') return true;
  if (('\u05C1' <= c) && (c <= '\u05C2')) return true;
  if (c == '\u05C4') return true;
  if (('\u05D0' <= c) && (c <= '\u05EA')) return true;
  if (('\u05F0' <= c) && (c <= '\u05F2')) return true;
  if (('\u0610' <= c) && (c <= '\u0615')) return true;
  if (('\u0621' <= c) && (c <= '\u063A')) return true;
  if (c == '\u0640') return true;
  if (('\u0641' <= c) && (c <= '\u064A')) return true;
  if (('\u064B' <= c) && (c <= '\u0657')) return true;
  if (('\u066E' <= c) && (c <= '\u066F')) return true;
  if (c == '\u0670') return true;
  if (('\u0671' <= c) && (c <= '\u06D3')) return true;
  if (c == '\u06D5') return true;
  if (('\u06D6' <= c) && (c <= '\u06DC')) return true;
  if (('\u06E1' <= c) && (c <= '\u06E4')) return true;
  if (('\u06E5' <= c) && (c <= '\u06E6')) return true;
  if (('\u06E7' <= c) && (c <= '\u06E8')) return true;
  if (c == '\u06ED') return true;
  if (('\u06EE' <= c) && (c <= '\u06EF')) return true;
  if (('\u06FA' <= c) && (c <= '\u06FC')) return true;
  if (c == '\u06FF') return true;
  if (c == '\u0710') return true;
  if (c == '\u0711') return true;
  if (('\u0712' <= c) && (c <= '\u072F')) return true;
  if (('\u0730' <= c) && (c <= '\u073F')) return true;
  if (('\u074D' <= c) && (c <= '\u074F')) return true;
  if (('\u0780' <= c) && (c <= '\u07A5')) return true;
  if (('\u07A6' <= c) && (c <= '\u07B0')) return true;
  if (c == '\u07B1') return true;
  if (('\u0901' <= c) && (c <= '\u0902')) return true;
  if (c == '\u0903') return true;
  if (('\u0904' <= c) && (c <= '\u0939')) return true;
  if (c == '\u093D') return true;
  if (('\u093E' <= c) && (c <= '\u0940')) return true;
  if (('\u0941' <= c) && (c <= '\u0948')) return true;
  if (('\u0949' <= c) && (c <= '\u094C')) return true;
  if (c == '\u0950') return true;
  if (('\u0958' <= c) && (c <= '\u0961')) return true;
  if (('\u0962' <= c) && (c <= '\u0963')) return true;
  if (c == '\u0981') return true;
  if (('\u0982' <= c) && (c <= '\u0983')) return true;
  if (('\u0985' <= c) && (c <= '\u098C')) return true;
  if (('\u098F' <= c) && (c <= '\u0990')) return true;
  if (('\u0993' <= c) && (c <= '\u09A8')) return true;
  if (('\u09AA' <= c) && (c <= '\u09B0')) return true;
  if (c == '\u09B2') return true;
  if (('\u09B6' <= c) && (c <= '\u09B9')) return true;
  if (c == '\u09BD') return true;
  if (('\u09BE' <= c) && (c <= '\u09C0')) return true;
  if (('\u09C1' <= c) && (c <= '\u09C4')) return true;
  if (('\u09C7' <= c) && (c <= '\u09C8')) return true;
  if (('\u09CB' <= c) && (c <= '\u09CC')) return true;
  if (c == '\u09D7') return true;
  if (('\u09DC' <= c) && (c <= '\u09DD')) return true;
  if (('\u09DF' <= c) && (c <= '\u09E1')) return true;
  if (('\u09E2' <= c) && (c <= '\u09E3')) return true;
  if (('\u09F0' <= c) && (c <= '\u09F1')) return true;
  if (('\u0A01' <= c) && (c <= '\u0A02')) return true;
  if (c == '\u0A03') return true;
  if (('\u0A05' <= c) && (c <= '\u0A0A')) return true;
  if (('\u0A0F' <= c) && (c <= '\u0A10')) return true;
  if (('\u0A13' <= c) && (c <= '\u0A28')) return true;
  if (('\u0A2A' <= c) && (c <= '\u0A30')) return true;
  if (('\u0A32' <= c) && (c <= '\u0A33')) return true;
  if (('\u0A35' <= c) && (c <= '\u0A36')) return true;
  if (('\u0A38' <= c) && (c <= '\u0A39')) return true;
  if (('\u0A3E' <= c) && (c <= '\u0A40')) return true;
  if (('\u0A41' <= c) && (c <= '\u0A42')) return true;
  if (('\u0A47' <= c) && (c <= '\u0A48')) return true;
  if (('\u0A4B' <= c) && (c <= '\u0A4C')) return true;
  if (('\u0A59' <= c) && (c <= '\u0A5C')) return true;
  if (c == '\u0A5E') return true;
  if (('\u0A70' <= c) && (c <= '\u0A71')) return true;
  if (('\u0A72' <= c) && (c <= '\u0A74')) return true;
  if (('\u0A81' <= c) && (c <= '\u0A82')) return true;
  if (c == '\u0A83') return true;
  if (('\u0A85' <= c) && (c <= '\u0A8D')) return true;
  if (('\u0A8F' <= c) && (c <= '\u0A91')) return true;
  if (('\u0A93' <= c) && (c <= '\u0AA8')) return true;
  if (('\u0AAA' <= c) && (c <= '\u0AB0')) return true;
  if (('\u0AB2' <= c) && (c <= '\u0AB3')) return true;
  if (('\u0AB5' <= c) && (c <= '\u0AB9')) return true;
  if (c == '\u0ABD') return true;
  if (('\u0ABE' <= c) && (c <= '\u0AC0')) return true;
  if (('\u0AC1' <= c) && (c <= '\u0AC5')) return true;
  if (('\u0AC7' <= c) && (c <= '\u0AC8')) return true;
  if (c == '\u0AC9') return true;
  if (('\u0ACB' <= c) && (c <= '\u0ACC')) return true;
  if (c == '\u0AD0') return true;
  if (('\u0AE0' <= c) && (c <= '\u0AE1')) return true;
  if (('\u0AE2' <= c) && (c <= '\u0AE3')) return true;
  if (c == '\u0B01') return true;
  if (('\u0B02' <= c) && (c <= '\u0B03')) return true;
  if (('\u0B05' <= c) && (c <= '\u0B0C')) return true;
  if (('\u0B0F' <= c) && (c <= '\u0B10')) return true;
  if (('\u0B13' <= c) && (c <= '\u0B28')) return true;
  if (('\u0B2A' <= c) && (c <= '\u0B30')) return true;
  if (('\u0B32' <= c) && (c <= '\u0B33')) return true;
  if (('\u0B35' <= c) && (c <= '\u0B39')) return true;
  if (c == '\u0B3D') return true;
  if (c == '\u0B3E') return true;
  if (c == '\u0B3F') return true;
  if (c == '\u0B40') return true;
  if (('\u0B41' <= c) && (c <= '\u0B43')) return true;
  if (('\u0B47' <= c) && (c <= '\u0B48')) return true;
  if (('\u0B4B' <= c) && (c <= '\u0B4C')) return true;
  if (c == '\u0B56') return true;
  if (c == '\u0B57') return true;
  if (('\u0B5C' <= c) && (c <= '\u0B5D')) return true;
  if (('\u0B5F' <= c) && (c <= '\u0B61')) return true;
  if (c == '\u0B71') return true;
  if (c == '\u0B82') return true;
  if (c == '\u0B83') return true;
  if (('\u0B85' <= c) && (c <= '\u0B8A')) return true;
  if (('\u0B8E' <= c) && (c <= '\u0B90')) return true;
  if (('\u0B92' <= c) && (c <= '\u0B95')) return true;
  if (('\u0B99' <= c) && (c <= '\u0B9A')) return true;
  if (c == '\u0B9C') return true;
  if (('\u0B9E' <= c) && (c <= '\u0B9F')) return true;
  if (('\u0BA3' <= c) && (c <= '\u0BA4')) return true;
  if (('\u0BA8' <= c) && (c <= '\u0BAA')) return true;
  if (('\u0BAE' <= c) && (c <= '\u0BB5')) return true;
  if (('\u0BB7' <= c) && (c <= '\u0BB9')) return true;
  if (('\u0BBE' <= c) && (c <= '\u0BBF')) return true;
  if (c == '\u0BC0') return true;
  if (('\u0BC1' <= c) && (c <= '\u0BC2')) return true;
  if (('\u0BC6' <= c) && (c <= '\u0BC8')) return true;
  if (('\u0BCA' <= c) && (c <= '\u0BCC')) return true;
  if (c == '\u0BD7') return true;
  if (('\u0C01' <= c) && (c <= '\u0C03')) return true;
  if (('\u0C05' <= c) && (c <= '\u0C0C')) return true;
  if (('\u0C0E' <= c) && (c <= '\u0C10')) return true;
  if (('\u0C12' <= c) && (c <= '\u0C28')) return true;
  if (('\u0C2A' <= c) && (c <= '\u0C33')) return true;
  if (('\u0C35' <= c) && (c <= '\u0C39')) return true;
  if (('\u0C3E' <= c) && (c <= '\u0C40')) return true;
  if (('\u0C41' <= c) && (c <= '\u0C44')) return true;
  if (('\u0C46' <= c) && (c <= '\u0C48')) return true;
  if (('\u0C4A' <= c) && (c <= '\u0C4C')) return true;
  if (('\u0C55' <= c) && (c <= '\u0C56')) return true;
  if (('\u0C60' <= c) && (c <= '\u0C61')) return true;
  if (('\u0C82' <= c) && (c <= '\u0C83')) return true;
  if (('\u0C85' <= c) && (c <= '\u0C8C')) return true;
  if (('\u0C8E' <= c) && (c <= '\u0C90')) return true;
  if (('\u0C92' <= c) && (c <= '\u0CA8')) return true;
  if (('\u0CAA' <= c) && (c <= '\u0CB3')) return true;
  if (('\u0CB5' <= c) && (c <= '\u0CB9')) return true;
  if (c == '\u0CBD') return true;
  if (c == '\u0CBE') return true;
  if (c == '\u0CBF') return true;
  if (('\u0CC0' <= c) && (c <= '\u0CC4')) return true;
  if (c == '\u0CC6') return true;
  if (('\u0CC7' <= c) && (c <= '\u0CC8')) return true;
  if (('\u0CCA' <= c) && (c <= '\u0CCB')) return true;
  if (c == '\u0CCC') return true;
  if (('\u0CD5' <= c) && (c <= '\u0CD6')) return true;
  if (c == '\u0CDE') return true;
  if (('\u0CE0' <= c) && (c <= '\u0CE1')) return true;
  if (('\u0D02' <= c) && (c <= '\u0D03')) return true;
  if (('\u0D05' <= c) && (c <= '\u0D0C')) return true;
  if (('\u0D0E' <= c) && (c <= '\u0D10')) return true;
  if (('\u0D12' <= c) && (c <= '\u0D28')) return true;
  if (('\u0D2A' <= c) && (c <= '\u0D39')) return true;
  if (('\u0D3E' <= c) && (c <= '\u0D40')) return true;
  if (('\u0D41' <= c) && (c <= '\u0D43')) return true;
  if (('\u0D46' <= c) && (c <= '\u0D48')) return true;
  if (('\u0D4A' <= c) && (c <= '\u0D4C')) return true;
  if (c == '\u0D57') return true;
  if (('\u0D60' <= c) && (c <= '\u0D61')) return true;
  if (('\u0D82' <= c) && (c <= '\u0D83')) return true;
  if (('\u0D85' <= c) && (c <= '\u0D96')) return true;
  if (('\u0D9A' <= c) && (c <= '\u0DB1')) return true;
  if (('\u0DB3' <= c) && (c <= '\u0DBB')) return true;
  if (c == '\u0DBD') return true;
  if (('\u0DC0' <= c) && (c <= '\u0DC6')) return true;
  if (('\u0DCF' <= c) && (c <= '\u0DD1')) return true;
  if (('\u0DD2' <= c) && (c <= '\u0DD4')) return true;
  if (c == '\u0DD6') return true;
  if (('\u0DD8' <= c) && (c <= '\u0DDF')) return true;
  if (('\u0DF2' <= c) && (c <= '\u0DF3')) return true;
  if (('\u0E01' <= c) && (c <= '\u0E30')) return true;
  if (c == '\u0E31') return true;
  if (('\u0E32' <= c) && (c <= '\u0E33')) return true;
  if (('\u0E34' <= c) && (c <= '\u0E3A')) return true;
  if (('\u0E40' <= c) && (c <= '\u0E45')) return true;
  if (c == '\u0E46') return true;
  if (c == '\u0E4D') return true;
  if (('\u0E81' <= c) && (c <= '\u0E82')) return true;
  if (c == '\u0E84') return true;
  if (('\u0E87' <= c) && (c <= '\u0E88')) return true;
  if (c == '\u0E8A') return true;
  if (c == '\u0E8D') return true;
  if (('\u0E94' <= c) && (c <= '\u0E97')) return true;
  if (('\u0E99' <= c) && (c <= '\u0E9F')) return true;
  if (('\u0EA1' <= c) && (c <= '\u0EA3')) return true;
  if (c == '\u0EA5') return true;
  if (c == '\u0EA7') return true;
  if (('\u0EAA' <= c) && (c <= '\u0EAB')) return true;
  if (('\u0EAD' <= c) && (c <= '\u0EB0')) return true;
  if (c == '\u0EB1') return true;
  if (('\u0EB2' <= c) && (c <= '\u0EB3')) return true;
  if (('\u0EB4' <= c) && (c <= '\u0EB9')) return true;
  if (('\u0EBB' <= c) && (c <= '\u0EBC')) return true;
  if (c == '\u0EBD') return true;
  if (('\u0EC0' <= c) && (c <= '\u0EC4')) return true;
  if (c == '\u0EC6') return true;
  if (c == '\u0ECD') return true;
  if (('\u0EDC' <= c) && (c <= '\u0EDD')) return true;
  if (c == '\u0F00') return true;
  if (('\u0F40' <= c) && (c <= '\u0F47')) return true;
  if (('\u0F49' <= c) && (c <= '\u0F6A')) return true;
  if (('\u0F71' <= c) && (c <= '\u0F7E')) return true;
  if (c == '\u0F7F') return true;
  if (('\u0F80' <= c) && (c <= '\u0F81')) return true;
  if (('\u0F88' <= c) && (c <= '\u0F8B')) return true;
  if (('\u0F90' <= c) && (c <= '\u0F97')) return true;
  if (('\u0F99' <= c) && (c <= '\u0FBC')) return true;
  if (('\u1000' <= c) && (c <= '\u1021')) return true;
  if (('\u1023' <= c) && (c <= '\u1027')) return true;
  if (('\u1029' <= c) && (c <= '\u102A')) return true;
  if (c == '\u102C') return true;
  if (('\u102D' <= c) && (c <= '\u1030')) return true;
  if (c == '\u1031') return true;
  if (c == '\u1032') return true;
  if (c == '\u1036') return true;
  if (c == '\u1038') return true;
  if (('\u1050' <= c) && (c <= '\u1055')) return true;
  if (('\u1056' <= c) && (c <= '\u1057')) return true;
  if (('\u1058' <= c) && (c <= '\u1059')) return true;
  if (('\u10A0' <= c) && (c <= '\u10C5')) return true;
  if (('\u10D0' <= c) && (c <= '\u10F8')) return true;
  if (('\u1100' <= c) && (c <= '\u1159')) return true;
  if (('\u115F' <= c) && (c <= '\u11A2')) return true;
  if (('\u11A8' <= c) && (c <= '\u11F9')) return true;
  if (('\u1200' <= c) && (c <= '\u1206')) return true;
  if (('\u1208' <= c) && (c <= '\u1246')) return true;
  if (c == '\u1248') return true;
  if (('\u124A' <= c) && (c <= '\u124D')) return true;
  if (('\u1250' <= c) && (c <= '\u1256')) return true;
  if (c == '\u1258') return true;
  if (('\u125A' <= c) && (c <= '\u125D')) return true;
  if (('\u1260' <= c) && (c <= '\u1286')) return true;
  if (c == '\u1288') return true;
  if (('\u128A' <= c) && (c <= '\u128D')) return true;
  if (('\u1290' <= c) && (c <= '\u12AE')) return true;
  if (c == '\u12B0') return true;
  if (('\u12B2' <= c) && (c <= '\u12B5')) return true;
  if (('\u12B8' <= c) && (c <= '\u12BE')) return true;
  if (c == '\u12C0') return true;
  if (('\u12C2' <= c) && (c <= '\u12C5')) return true;
  if (('\u12C8' <= c) && (c <= '\u12CE')) return true;
  if (('\u12D0' <= c) && (c <= '\u12D6')) return true;
  if (('\u12D8' <= c) && (c <= '\u12EE')) return true;
  if (('\u12F0' <= c) && (c <= '\u130E')) return true;
  if (c == '\u1310') return true;
  if (('\u1312' <= c) && (c <= '\u1315')) return true;
  if (('\u1318' <= c) && (c <= '\u131E')) return true;
  if (('\u1320' <= c) && (c <= '\u1346')) return true;
  if (('\u1348' <= c) && (c <= '\u135A')) return true;
  if (('\u13A0' <= c) && (c <= '\u13F4')) return true;
  if (('\u1401' <= c) && (c <= '\u166C')) return true;
  if (('\u166F' <= c) && (c <= '\u1676')) return true;
  if (('\u1681' <= c) && (c <= '\u169A')) return true;
  if (('\u16A0' <= c) && (c <= '\u16EA')) return true;
  if (('\u16EE' <= c) && (c <= '\u16F0')) return true;
  if (('\u1700' <= c) && (c <= '\u170C')) return true;
  if (('\u170E' <= c) && (c <= '\u1711')) return true;
  if (('\u1712' <= c) && (c <= '\u1713')) return true;
  if (('\u1720' <= c) && (c <= '\u1731')) return true;
  if (('\u1732' <= c) && (c <= '\u1733')) return true;
  if (('\u1740' <= c) && (c <= '\u1751')) return true;
  if (('\u1752' <= c) && (c <= '\u1753')) return true;
  if (('\u1760' <= c) && (c <= '\u176C')) return true;
  if (('\u176E' <= c) && (c <= '\u1770')) return true;
  if (('\u1772' <= c) && (c <= '\u1773')) return true;
  if (('\u1780' <= c) && (c <= '\u17B3')) return true;
  if (c == '\u17B6') return true;
  if (('\u17B7' <= c) && (c <= '\u17BD')) return true;
  if (('\u17BE' <= c) && (c <= '\u17C5')) return true;
  if (c == '\u17C6') return true;
  if (('\u17C7' <= c) && (c <= '\u17C8')) return true;
  if (c == '\u17D7') return true;
  if (c == '\u17DC') return true;
  if (('\u1820' <= c) && (c <= '\u1842')) return true;
  if (c == '\u1843') return true;
  if (('\u1844' <= c) && (c <= '\u1877')) return true;
  if (('\u1880' <= c) && (c <= '\u18A8')) return true;
  if (c == '\u18A9') return true;
  if (('\u1900' <= c) && (c <= '\u191C')) return true;
  if (('\u1920' <= c) && (c <= '\u1922')) return true;
  if (('\u1923' <= c) && (c <= '\u1926')) return true;
  if (('\u1927' <= c) && (c <= '\u1928')) return true;
  if (('\u1929' <= c) && (c <= '\u192B')) return true;
  if (('\u1930' <= c) && (c <= '\u1931')) return true;
  if (c == '\u1932') return true;
  if (('\u1933' <= c) && (c <= '\u1938')) return true;
  if (('\u1950' <= c) && (c <= '\u196D')) return true;
  if (('\u1970' <= c) && (c <= '\u1974')) return true;
  if (('\u1D00' <= c) && (c <= '\u1D2B')) return true;
  if (('\u1D2C' <= c) && (c <= '\u1D61')) return true;
  if (('\u1D62' <= c) && (c <= '\u1D6B')) return true;
  if (('\u1E00' <= c) && (c <= '\u1E9B')) return true;
  if (('\u1EA0' <= c) && (c <= '\u1EF9')) return true;
  if (('\u1F00' <= c) && (c <= '\u1F15')) return true;
  if (('\u1F18' <= c) && (c <= '\u1F1D')) return true;
  if (('\u1F20' <= c) && (c <= '\u1F45')) return true;
  if (('\u1F48' <= c) && (c <= '\u1F4D')) return true;
  if (('\u1F50' <= c) && (c <= '\u1F57')) return true;
  if (c == '\u1F59') return true;
  if (c == '\u1F5B') return true;
  if (c == '\u1F5D') return true;
  if (('\u1F5F' <= c) && (c <= '\u1F7D')) return true;
  if (('\u1F80' <= c) && (c <= '\u1FB4')) return true;
  if (('\u1FB6' <= c) && (c <= '\u1FBC')) return true;
  if (c == '\u1FBE') return true;
  if (('\u1FC2' <= c) && (c <= '\u1FC4')) return true;
  if (('\u1FC6' <= c) && (c <= '\u1FCC')) return true;
  if (('\u1FD0' <= c) && (c <= '\u1FD3')) return true;
  if (('\u1FD6' <= c) && (c <= '\u1FDB')) return true;
  if (('\u1FE0' <= c) && (c <= '\u1FEC')) return true;
  if (('\u1FF2' <= c) && (c <= '\u1FF4')) return true;
  if (('\u1FF6' <= c) && (c <= '\u1FFC')) return true;
  if (c == '\u2071') return true;
  if (c == '\u207F') return true;
  if (c == '\u2102') return true;
  if (c == '\u2107') return true;
  if (('\u210A' <= c) && (c <= '\u2113')) return true;
  if (c == '\u2115') return true;
  if (('\u2119' <= c) && (c <= '\u211D')) return true;
  if (c == '\u2124') return true;
  if (c == '\u2126') return true;
  if (c == '\u2128') return true;
  if (('\u212A' <= c) && (c <= '\u212D')) return true;
  if (('\u212F' <= c) && (c <= '\u2131')) return true;
  if (('\u2133' <= c) && (c <= '\u2134')) return true;
  if (('\u2135' <= c) && (c <= '\u2138')) return true;
  if (c == '\u2139') return true;
  if (('\u213D' <= c) && (c <= '\u213F')) return true;
  if (('\u2145' <= c) && (c <= '\u2149')) return true;
  if (('\u2160' <= c) && (c <= '\u2183')) return true;
  if (c == '\u3005') return true;
  if (c == '\u3006') return true;
  if (c == '\u3007') return true;
  if (('\u3021' <= c) && (c <= '\u3029')) return true;
  if (('\u3031' <= c) && (c <= '\u3035')) return true;
  if (('\u3038' <= c) && (c <= '\u303A')) return true;
  if (c == '\u303B') return true;
  if (c == '\u303C') return true;
  if (('\u3041' <= c) && (c <= '\u3096')) return true;
  if (('\u309D' <= c) && (c <= '\u309E')) return true;
  if (c == '\u309F') return true;
  if (('\u30A1' <= c) && (c <= '\u30FA')) return true;
  if (('\u30FC' <= c) && (c <= '\u30FE')) return true;
  if (c == '\u30FF') return true;
  if (('\u3105' <= c) && (c <= '\u312C')) return true;
  if (('\u3131' <= c) && (c <= '\u318E')) return true;
  if (('\u31A0' <= c) && (c <= '\u31B7')) return true;
  if (('\u31F0' <= c) && (c <= '\u31FF')) return true;
  if (('\u3400' <= c) && (c <= '\u4DB5')) return true;
  if (('\u4E00' <= c) && (c <= '\u9FA5')) return true;
  if (('\uA000' <= c) && (c <= '\uA48C')) return true;
  if (('\uAC00' <= c) && (c <= '\uD7A3')) return true;
  if (('\uF900' <= c) && (c <= '\uFA2D')) return true;
  if (('\uFA30' <= c) && (c <= '\uFA6A')) return true;
  if (('\uFB00' <= c) && (c <= '\uFB06')) return true;
  if (('\uFB13' <= c) && (c <= '\uFB17')) return true;
  if (c == '\uFB1D') return true;
  if (c == '\uFB1E') return true;
  if (('\uFB1F' <= c) && (c <= '\uFB28')) return true;
  if (('\uFB2A' <= c) && (c <= '\uFB36')) return true;
  if (('\uFB38' <= c) && (c <= '\uFB3C')) return true;
  if (c == '\uFB3E') return true;
  if (('\uFB40' <= c) && (c <= '\uFB41')) return true;
  if (('\uFB43' <= c) && (c <= '\uFB44')) return true;
  if (('\uFB46' <= c) && (c <= '\uFBB1')) return true;
  if (('\uFBD3' <= c) && (c <= '\uFD3D')) return true;
  if (('\uFD50' <= c) && (c <= '\uFD8F')) return true;
  if (('\uFD92' <= c) && (c <= '\uFDC7')) return true;
  if (('\uFDF0' <= c) && (c <= '\uFDFB')) return true;
  if (('\uFE70' <= c) && (c <= '\uFE74')) return true;
  if (('\uFE76' <= c) && (c <= '\uFEFC')) return true;
  if (('\uFF21' <= c) && (c <= '\uFF3A')) return true;
  if (('\uFF41' <= c) && (c <= '\uFF5A')) return true;
  if (('\uFF66' <= c) && (c <= '\uFF6F')) return true;
  if (c == '\uFF70') return true;
  if (('\uFF71' <= c) && (c <= '\uFF9D')) return true;
  if (('\uFF9E' <= c) && (c <= '\uFF9F')) return true;
  if (('\uFFA0' <= c) && (c <= '\uFFBE')) return true;
  if (('\uFFC2' <= c) && (c <= '\uFFC7')) return true;
  if (('\uFFCA' <= c) && (c <= '\uFFCF')) return true;
  if (('\uFFD2' <= c) && (c <= '\uFFD7')) return true;
  if (('\uFFDA' <= c) && (c <= '\uFFDC')) return true;
  if (('\u10000' <= c) && (c <= '\u1000B')) return true;
  if (('\u1000D' <= c) && (c <= '\u10026')) return true;
  if (('\u10028' <= c) && (c <= '\u1003A')) return true;
  if (('\u1003C' <= c) && (c <= '\u1003D')) return true;
  if (('\u1003F' <= c) && (c <= '\u1004D')) return true;
  if (('\u10050' <= c) && (c <= '\u1005D')) return true;
  if (('\u10080' <= c) && (c <= '\u100FA')) return true;
  if (('\u10300' <= c) && (c <= '\u1031E')) return true;
  if (('\u10330' <= c) && (c <= '\u10349')) return true;
  if (c == '\u1034A') return true;
  if (('\u10380' <= c) && (c <= '\u1039D')) return true;
  if (('\u10400' <= c) && (c <= '\u1044F')) return true;
  if (('\u10450' <= c) && (c <= '\u1049D')) return true;
  if (('\u10800' <= c) && (c <= '\u10805')) return true;
  if (c == '\u10808') return true;
  if (('\u1080A' <= c) && (c <= '\u10835')) return true;
  if (('\u10837' <= c) && (c <= '\u10838')) return true;
  if (c == '\u1083C') return true;
  if (c == '\u1083F') return true;
  if (('\u1D400' <= c) && (c <= '\u1D454')) return true;
  if (('\u1D456' <= c) && (c <= '\u1D49C')) return true;
  if (('\u1D49E' <= c) && (c <= '\u1D49F')) return true;
  if (c == '\u1D4A2') return true;
  if (('\u1D4A5' <= c) && (c <= '\u1D4A6')) return true;
  if (('\u1D4A9' <= c) && (c <= '\u1D4AC')) return true;
  if (('\u1D4AE' <= c) && (c <= '\u1D4B9')) return true;
  if (c == '\u1D4BB') return true;
  if (('\u1D4BD' <= c) && (c <= '\u1D4C3')) return true;
  if (('\u1D4C5' <= c) && (c <= '\u1D505')) return true;
  if (('\u1D507' <= c) && (c <= '\u1D50A')) return true;
  if (('\u1D50D' <= c) && (c <= '\u1D514')) return true;
  if (('\u1D516' <= c) && (c <= '\u1D51C')) return true;
  if (('\u1D51E' <= c) && (c <= '\u1D539')) return true;
  if (('\u1D53B' <= c) && (c <= '\u1D53E')) return true;
  if (('\u1D540' <= c) && (c <= '\u1D544')) return true;
  if (c == '\u1D546') return true;
  if (('\u1D54A' <= c) && (c <= '\u1D550')) return true;
  if (('\u1D552' <= c) && (c <= '\u1D6A3')) return true;
  if (('\u1D6A8' <= c) && (c <= '\u1D6C0')) return true;
  if (('\u1D6C2' <= c) && (c <= '\u1D6DA')) return true;
  if (('\u1D6DC' <= c) && (c <= '\u1D6FA')) return true;
  if (('\u1D6FC' <= c) && (c <= '\u1D714')) return true;
  if (('\u1D716' <= c) && (c <= '\u1D734')) return true;
  if (('\u1D736' <= c) && (c <= '\u1D74E')) return true;
  if (('\u1D750' <= c) && (c <= '\u1D76E')) return true;
  if (('\u1D770' <= c) && (c <= '\u1D788')) return true;
  if (('\u1D78A' <= c) && (c <= '\u1D7A8')) return true;
  if (('\u1D7AA' <= c) && (c <= '\u1D7C2')) return true;
  if (('\u1D7C4' <= c) && (c <= '\u1D7C9')) return true;
  if (('\u20000' <= c) && (c <= '\u2A6D6')) return true;
  if (('\u2F800' <= c) && (c <= '\u2FA1D')) return true;

  return false;
}

function WWHUnicodeInfo_Grapheme_Extend(c)
{
  if (('\u0300' <= c) && (c <= '\u0357')) return true;
  if (('\u035D' <= c) && (c <= '\u036F')) return true;
  if (('\u0483' <= c) && (c <= '\u0486')) return true;
  if (('\u0488' <= c) && (c <= '\u0489')) return true;
  if (('\u0591' <= c) && (c <= '\u05A1')) return true;
  if (('\u05A3' <= c) && (c <= '\u05B9')) return true;
  if (('\u05BB' <= c) && (c <= '\u05BD')) return true;
  if (c == '\u05BF') return true;
  if (('\u05C1' <= c) && (c <= '\u05C2')) return true;
  if (c == '\u05C4') return true;
  if (('\u0610' <= c) && (c <= '\u0615')) return true;
  if (('\u064B' <= c) && (c <= '\u0658')) return true;
  if (c == '\u0670') return true;
  if (('\u06D6' <= c) && (c <= '\u06DC')) return true;
  if (c == '\u06DE') return true;
  if (('\u06DF' <= c) && (c <= '\u06E4')) return true;
  if (('\u06E7' <= c) && (c <= '\u06E8')) return true;
  if (('\u06EA' <= c) && (c <= '\u06ED')) return true;
  if (c == '\u0711') return true;
  if (('\u0730' <= c) && (c <= '\u074A')) return true;
  if (('\u07A6' <= c) && (c <= '\u07B0')) return true;
  if (('\u0901' <= c) && (c <= '\u0902')) return true;
  if (c == '\u093C') return true;
  if (('\u0941' <= c) && (c <= '\u0948')) return true;
  if (c == '\u094D') return true;
  if (('\u0951' <= c) && (c <= '\u0954')) return true;
  if (('\u0962' <= c) && (c <= '\u0963')) return true;
  if (c == '\u0981') return true;
  if (c == '\u09BC') return true;
  if (c == '\u09BE') return true;
  if (('\u09C1' <= c) && (c <= '\u09C4')) return true;
  if (c == '\u09CD') return true;
  if (c == '\u09D7') return true;
  if (('\u09E2' <= c) && (c <= '\u09E3')) return true;
  if (('\u0A01' <= c) && (c <= '\u0A02')) return true;
  if (c == '\u0A3C') return true;
  if (('\u0A41' <= c) && (c <= '\u0A42')) return true;
  if (('\u0A47' <= c) && (c <= '\u0A48')) return true;
  if (('\u0A4B' <= c) && (c <= '\u0A4D')) return true;
  if (('\u0A70' <= c) && (c <= '\u0A71')) return true;
  if (('\u0A81' <= c) && (c <= '\u0A82')) return true;
  if (c == '\u0ABC') return true;
  if (('\u0AC1' <= c) && (c <= '\u0AC5')) return true;
  if (('\u0AC7' <= c) && (c <= '\u0AC8')) return true;
  if (c == '\u0ACD') return true;
  if (('\u0AE2' <= c) && (c <= '\u0AE3')) return true;
  if (c == '\u0B01') return true;
  if (c == '\u0B3C') return true;
  if (c == '\u0B3E') return true;
  if (c == '\u0B3F') return true;
  if (('\u0B41' <= c) && (c <= '\u0B43')) return true;
  if (c == '\u0B4D') return true;
  if (c == '\u0B56') return true;
  if (c == '\u0B57') return true;
  if (c == '\u0B82') return true;
  if (c == '\u0BBE') return true;
  if (c == '\u0BC0') return true;
  if (c == '\u0BCD') return true;
  if (c == '\u0BD7') return true;
  if (('\u0C3E' <= c) && (c <= '\u0C40')) return true;
  if (('\u0C46' <= c) && (c <= '\u0C48')) return true;
  if (('\u0C4A' <= c) && (c <= '\u0C4D')) return true;
  if (('\u0C55' <= c) && (c <= '\u0C56')) return true;
  if (c == '\u0CBC') return true;
  if (c == '\u0CBF') return true;
  if (c == '\u0CC2') return true;
  if (c == '\u0CC6') return true;
  if (('\u0CCC' <= c) && (c <= '\u0CCD')) return true;
  if (('\u0CD5' <= c) && (c <= '\u0CD6')) return true;
  if (c == '\u0D3E') return true;
  if (('\u0D41' <= c) && (c <= '\u0D43')) return true;
  if (c == '\u0D4D') return true;
  if (c == '\u0D57') return true;
  if (c == '\u0DCA') return true;
  if (c == '\u0DCF') return true;
  if (('\u0DD2' <= c) && (c <= '\u0DD4')) return true;
  if (c == '\u0DD6') return true;
  if (c == '\u0DDF') return true;
  if (c == '\u0E31') return true;
  if (('\u0E34' <= c) && (c <= '\u0E3A')) return true;
  if (('\u0E47' <= c) && (c <= '\u0E4E')) return true;
  if (c == '\u0EB1') return true;
  if (('\u0EB4' <= c) && (c <= '\u0EB9')) return true;
  if (('\u0EBB' <= c) && (c <= '\u0EBC')) return true;
  if (('\u0EC8' <= c) && (c <= '\u0ECD')) return true;
  if (('\u0F18' <= c) && (c <= '\u0F19')) return true;
  if (c == '\u0F35') return true;
  if (c == '\u0F37') return true;
  if (c == '\u0F39') return true;
  if (('\u0F71' <= c) && (c <= '\u0F7E')) return true;
  if (('\u0F80' <= c) && (c <= '\u0F84')) return true;
  if (('\u0F86' <= c) && (c <= '\u0F87')) return true;
  if (('\u0F90' <= c) && (c <= '\u0F97')) return true;
  if (('\u0F99' <= c) && (c <= '\u0FBC')) return true;
  if (c == '\u0FC6') return true;
  if (('\u102D' <= c) && (c <= '\u1030')) return true;
  if (c == '\u1032') return true;
  if (('\u1036' <= c) && (c <= '\u1037')) return true;
  if (c == '\u1039') return true;
  if (('\u1058' <= c) && (c <= '\u1059')) return true;
  if (('\u1712' <= c) && (c <= '\u1714')) return true;
  if (('\u1732' <= c) && (c <= '\u1734')) return true;
  if (('\u1752' <= c) && (c <= '\u1753')) return true;
  if (('\u1772' <= c) && (c <= '\u1773')) return true;
  if (('\u17B7' <= c) && (c <= '\u17BD')) return true;
  if (c == '\u17C6') return true;
  if (('\u17C9' <= c) && (c <= '\u17D3')) return true;
  if (c == '\u17DD') return true;
  if (('\u180B' <= c) && (c <= '\u180D')) return true;
  if (c == '\u18A9') return true;
  if (('\u1920' <= c) && (c <= '\u1922')) return true;
  if (('\u1927' <= c) && (c <= '\u1928')) return true;
  if (c == '\u1932') return true;
  if (('\u1939' <= c) && (c <= '\u193B')) return true;
  if (('\u200C' <= c) && (c <= '\u200D')) return true;
  if (('\u20D0' <= c) && (c <= '\u20DC')) return true;
  if (('\u20DD' <= c) && (c <= '\u20E0')) return true;
  if (c == '\u20E1') return true;
  if (('\u20E2' <= c) && (c <= '\u20E4')) return true;
  if (('\u20E5' <= c) && (c <= '\u20EA')) return true;
  if (('\u302A' <= c) && (c <= '\u302F')) return true;
  if (('\u3099' <= c) && (c <= '\u309A')) return true;
  if (c == '\uFB1E') return true;
  if (('\uFE00' <= c) && (c <= '\uFE0F')) return true;
  if (('\uFE20' <= c) && (c <= '\uFE23')) return true;
  if (c == '\u1D165') return true;
  if (('\u1D167' <= c) && (c <= '\u1D169')) return true;
  if (('\u1D16E' <= c) && (c <= '\u1D16F')) return true;
  if (('\u1D17B' <= c) && (c <= '\u1D182')) return true;
  if (('\u1D185' <= c) && (c <= '\u1D18B')) return true;
  if (('\u1D1AA' <= c) && (c <= '\u1D1AD')) return true;
  if (('\uE0100' <= c) && (c <= '\uE01EF')) return true;

  return false;
}

function WWHUnicodeInfo_Extend(c)
{
  return WWHUnicodeInfo_Grapheme_Extend(c);
}

// http://en.wikipedia.org/wiki/Kana
//
// Hiragana range in Unicode is U+3040 ... U+309F, and the Katakana range is U+30A0 ... U+30FF. 
//

function WWHUnicodeInfo_Hiragana(c)
{
  if (('\u3040' <= c) && (c <= '\u309F')) return true;

  return false;
}

function WWHUnicodeInfo_Katakana(c)
{
  if (('\u30A0' <= c) && (c <= '\u30FF')) return true;
  if (c == '\u30FC') return true;
  if (c == '\uFF70') return true;
  if (c == '\uFF9E') return true;
  if (c == '\uFF9F') return true;

  return false;
}

function WWHUnicodeInfo_Ideographic(c)
{
  if (('\u1100' <= c) && (c <= '\u1159')) return true;
  if (c == '\u115F') return true;
  if (('\u2E80' <= c) && (c <= '\u2E99')) return true;
  if (('\u2E9B' <= c) && (c <= '\u2EF3')) return true;
  if (('\u2F00' <= c) && (c <= '\u2FD5')) return true;
  if (('\u2FF0' <= c) && (c <= '\u2FFB')) return true;
  if (c == '\u3000') return true;
  if (('\u3003' <= c) && (c <= '\u3004')) return true;
  if (('\u3006' <= c) && (c <= '\u3007')) return true;
  if (('\u3012' <= c) && (c <= '\u3013')) return true;
  if (('\u3020' <= c) && (c <= '\u3029')) return true;
  if (('\u3030' <= c) && (c <= '\u303A')) return true;
  if (('\u303D' <= c) && (c <= '\u303F')) return true;
  if (c == '\u3042') return true;
  if (c == '\u3044') return true;
  if (c == '\u3046') return true;
  if (c == '\u3048') return true;
  if (('\u304A' <= c) && (c <= '\u3062')) return true;
  if (('\u3064' <= c) && (c <= '\u3082')) return true;
  if (c == '\u3084') return true;
  if (c == '\u3086') return true;
  if (('\u3088' <= c) && (c <= '\u308D')) return true;
  if (('\u308F' <= c) && (c <= '\u3094')) return true;
  if (c == '\u309F') return true;
  if (c == '\u30A2') return true;
  if (c == '\u30A4') return true;
  if (c == '\u30A6') return true;
  if (c == '\u30A8') return true;
  if (('\u30AA' <= c) && (c <= '\u30C2')) return true;
  if (('\u30C4' <= c) && (c <= '\u30E2')) return true;
  if (c == '\u30E4') return true;
  if (c == '\u30E6') return true;
  if (('\u30E8' <= c) && (c <= '\u30ED')) return true;
  if (('\u30EF' <= c) && (c <= '\u30F4')) return true;
  if (('\u30F7' <= c) && (c <= '\u30FA')) return true;
  if (c == '\u30FC') return true;
  if (('\u30FE' <= c) && (c <= '\u30FF')) return true;
  if (('\u3105' <= c) && (c <= '\u312C')) return true;
  if (('\u3131' <= c) && (c <= '\u318E')) return true;
  if (('\u3190' <= c) && (c <= '\u31B7')) return true;
  if (('\u3200' <= c) && (c <= '\u321C')) return true;
  if (('\u3220' <= c) && (c <= '\u3243')) return true;
  if (('\u3251' <= c) && (c <= '\u327B')) return true;
  if (('\u327F' <= c) && (c <= '\u32CB')) return true;
  if (('\u32D0' <= c) && (c <= '\u32FE')) return true;
  if (('\u3300' <= c) && (c <= '\u3376')) return true;
  if (('\u337B' <= c) && (c <= '\u33DD')) return true;
  if (('\u33E0' <= c) && (c <= '\u33FE')) return true;
  if (('\u3400' <= c) && (c <= '\u4DB5')) return true;
  if (('\u4E00' <= c) && (c <= '\u9FA5')) return true;
  if (('\uA000' <= c) && (c <= '\uA48C')) return true;
  if (('\uA490' <= c) && (c <= '\uA4C6')) return true;
  if (('\uAC00' <= c) && (c <= '\uD7A3')) return true;
  if (('\uF900' <= c) && (c <= '\uFA2D')) return true;
  if (('\uFA30' <= c) && (c <= '\uFA6A')) return true;
  if (('\uFE30' <= c) && (c <= '\uFE34')) return true;
  if (('\uFE45' <= c) && (c <= '\uFE46')) return true;
  if (('\uFE49' <= c) && (c <= '\uFE4F')) return true;
  if (c == '\uFE51') return true;
  if (c == '\uFE58') return true;
  if (('\uFE5F' <= c) && (c <= '\uFE66')) return true;
  if (c == '\uFE68') return true;
  if (c == '\uFE6B') return true;
  if (('\uFF02' <= c) && (c <= '\uFF03')) return true;
  if (('\uFF06' <= c) && (c <= '\uFF07')) return true;
  if (('\uFF0A' <= c) && (c <= '\uFF0B')) return true;
  if (c == '\uFF0D') return true;
  if (('\uFF0F' <= c) && (c <= '\uFF19')) return true;
  if (('\uFF1C' <= c) && (c <= '\uFF1E')) return true;
  if (('\uFF20' <= c) && (c <= '\uFF3A')) return true;
  if (c == '\uFF3C') return true;
  if (('\uFF3E' <= c) && (c <= '\uFF5A')) return true;
  if (c == '\uFF5C') return true;
  if (c == '\uFF5E') return true;
  if (('\uFFE2' <= c) && (c <= '\uFFE4')) return true;

  return false;
}

function WWHUnicodeInfo_ALetter(c)
{
  if (c == '\u05F3') return true;
  if (WWHUnicodeInfo_Ideographic(c)) return false;
  if (WWHUnicodeInfo_Katakana(c)) return false;
  if (WWHUnicodeInfo_Alphabetic(c)) return true;

  return false;
}

function WWHUnicodeInfo_ABaseLetter(c)
{
  if (WWHUnicodeInfo_Grapheme_Extend(c)) return false;
  if (WWHUnicodeInfo_ALetter(c)) return true;

  return false;
}

function WWHUnicodeInfo_ACMLetter(c)
{
  if (WWHUnicodeInfo_Grapheme_Extend(c))
  {
    if (WWHUnicodeInfo_ALetter(c)) return true;
  }

  return false;
}

function WWHUnicodeInfo_MidLetter(c)
{
  if (c == '\u0027') return true;
  if (c == '\u00B7') return true;
  if (c == '\u05F4') return true;
  if (c == '\u2019') return true;
  if (c == '\u2027') return true;

  return false;
}

function WWHUnicodeInfo_MidNumLet(c)
{
  if (c == '\u002E') return true;
  if (c == '\u003A') return true;

  return false;
}

function WWHUnicodeInfo_MidNum(c)
{
  if (c == '\u002C') return true;
  if (c == '\u002E') return true;
  if (c == '\u003a') return true;
  if (c == '\u003b') return true;
  if (c == '\u0589') return true;

  return false;
}

function WWHUnicodeInfo_Numeric(c)
{
  if (('\u0030' <= c) && (c <= '\u0039')) return true;
  if (('\u0660' <= c) && (c <= '\u0669')) return true;
  if (('\u066B' <= c) && (c <= '\u066C')) return true;
  if (('\u06F0' <= c) && (c <= '\u06F9')) return true;
  if (('\u07C0' <= c) && (c <= '\u07C9')) return true;
  if (('\u0966' <= c) && (c <= '\u096F')) return true;
  if (('\u09E6' <= c) && (c <= '\u09EF')) return true;
  if (('\u0A66' <= c) && (c <= '\u0A6F')) return true;
  if (('\u0AE6' <= c) && (c <= '\u0AEF')) return true;
  if (('\u0B66' <= c) && (c <= '\u0B6F')) return true;
  if (('\u0BE6' <= c) && (c <= '\u0BEF')) return true;
  if (('\u0C66' <= c) && (c <= '\u0C6F')) return true;
  if (('\u0CE6' <= c) && (c <= '\u0CEF')) return true;
  if (('\u0D66' <= c) && (c <= '\u0D6F')) return true;
  if (('\u0E50' <= c) && (c <= '\u0E59')) return true;
  if (('\u0ED0' <= c) && (c <= '\u0ED9')) return true;
  if (('\u0F20' <= c) && (c <= '\u0F29')) return true;
  if (('\u1040' <= c) && (c <= '\u1049')) return true;
  if (('\u17E0' <= c) && (c <= '\u17E9')) return true;
  if (('\u1810' <= c) && (c <= '\u1819')) return true;
  if (('\u1946' <= c) && (c <= '\u194F')) return true;
  if (('\u19D0' <= c) && (c <= '\u19D9')) return true;
  if (('\u1B50' <= c) && (c <= '\u1B59')) return true;
  if (('\u104A0' <= c) && (c <= '\u104A9')) return true;
  if (('\u1D7CE' <= c) && (c <= '\u1D7FF')) return true;

  return false;
}

function WWHUnicodeInfo_Korean_L(c)
{
  if (('\u1100' <= c) && (c <= '\u115f')) return true;
  if (('\uac00' <= c) && (c <= '\ud7a3')) return true;

  return false;
}

function WWHUnicodeInfo_Korean_V(c)
{
  if (('\u1160' <= c) && (c <= '\u11a2')) return true;

  return false;
}

function WWHUnicodeInfo_Korean_T(c)
{
  if (('\u11a8' <= c) && (c <= '\u11f9')) return true;

  return false;
}

var WWHUnicodeInfo_Korean_LV_Data = {
'\uac00': true, '\uac1c': true, '\uac38': true, '\uac54': true, '\uac70': true,'\uac8c': true, '\uaca8': true, '\uacc4': true, '\uace0': true, '\uacfc': true, '\uad18': true, '\uad34': true, '\uad50': true, '\uad6c': true, '\uad88': true, '\uada4': true, 
'\uadc0': true, '\uaddc': true, '\uadf8': true, '\uae14': true, '\uae30': true, '\uae4c': true, '\uae68': true, '\uae84': true, '\uaea0': true, '\uaebc': true, '\uaed8': true, '\uaef4': true, '\uaf10': true, '\uaf2c': true, '\uaf48': true, '\uaf64': true, 
'\uaf80': true, '\uaf9c': true, '\uafb8': true, '\uafd4': true, '\uaff0': true, '\ub00c': true, '\ub028': true, '\ub044': true, '\ub060': true, '\ub07c': true, '\ub098': true, '\ub0b4': true, '\ub0d0': true, '\ub0ec': true, '\ub108': true, '\ub124': true, 
'\ub140': true, '\ub15c': true, '\ub178': true, '\ub194': true, '\ub1b0': true, '\ub1cc': true, '\ub1e8': true, '\ub204': true, '\ub220': true, '\ub23c': true, '\ub258': true, '\ub274': true, '\ub290': true, '\ub2ac': true, '\ub2c8': true, '\ub2e4': true, 
'\ub300': true, '\ub31c': true, '\ub338': true, '\ub354': true, '\ub370': true, '\ub38c': true, '\ub3a8': true, '\ub3c4': true, '\ub3e0': true, '\ub3fc': true, '\ub418': true, '\ub434': true, '\ub450': true, '\ub46c': true, '\ub488': true, '\ub4a4': true, 
'\ub4c0': true, '\ub4dc': true, '\ub4f8': true, '\ub514': true, '\ub530': true, '\ub54c': true, '\ub568': true, '\ub584': true, '\ub5a0': true, '\ub5bc': true, '\ub5d8': true, '\ub5f4': true, '\ub610': true, '\ub62c': true, '\ub648': true, '\ub664': true, 
'\ub680': true, '\ub69c': true, '\ub6b8': true, '\ub6d4': true, '\ub6f0': true, '\ub70c': true, '\ub728': true, '\ub744': true, '\ub760': true, '\ub77c': true, '\ub798': true, '\ub7b4': true, '\ub7d0': true, '\ub7ec': true, '\ub808': true, '\ub824': true, 
'\ub840': true, '\ub85c': true, '\ub878': true, '\ub894': true, '\ub8b0': true, '\ub8cc': true, '\ub8e8': true, '\ub904': true, '\ub920': true, '\ub93c': true, '\ub958': true, '\ub974': true, '\ub990': true, '\ub9ac': true, '\ub9c8': true, '\ub9e4': true, 
'\uba00': true, '\uba1c': true, '\uba38': true, '\uba54': true, '\uba70': true, '\uba8c': true, '\ubaa8': true, '\ubac4': true, '\ubae0': true, '\ubafc': true, '\ubb18': true, '\ubb34': true, '\ubb50': true, '\ubb6c': true, '\ubb88': true, '\ubba4': true, 
'\ubbc0': true, '\ubbdc': true, '\ubbf8': true, '\ubc14': true, '\ubc30': true, '\ubc4c': true, '\ubc68': true, '\ubc84': true, '\ubca0': true, '\ubcbc': true, '\ubcd8': true, '\ubcf4': true, '\ubd10': true, '\ubd2c': true, '\ubd48': true, '\ubd64': true, 
'\ubd80': true, '\ubd9c': true, '\ubdb8': true, '\ubdd4': true, '\ubdf0': true, '\ube0c': true, '\ube28': true, '\ube44': true, '\ube60': true, '\ube7c': true, '\ube98': true, '\ubeb4': true, '\ubed0': true, '\ubeec': true, '\ubf08': true, '\ubf24': true, 
'\ubf40': true, '\ubf5c': true, '\ubf78': true, '\ubf94': true, '\ubfb0': true, '\ubfcc': true, '\ubfe8': true, '\uc004': true, '\uc020': true, '\uc03c': true, '\uc058': true, '\uc074': true, '\uc090': true, '\uc0ac': true, '\uc0c8': true, '\uc0e4': true, 
'\uc100': true, '\uc11c': true, '\uc138': true, '\uc154': true, '\uc170': true, '\uc18c': true, '\uc1a8': true, '\uc1c4': true, '\uc1e0': true, '\uc1fc': true, '\uc218': true, '\uc234': true, '\uc250': true, '\uc26c': true, '\uc288': true, '\uc2a4': true, 
'\uc2c0': true, '\uc2dc': true, '\uc2f8': true, '\uc314': true, '\uc330': true, '\uc34c': true, '\uc368': true, '\uc384': true, '\uc3a0': true, '\uc3bc': true, '\uc3d8': true, '\uc3f4': true, '\uc410': true, '\uc42c': true, '\uc448': true, '\uc464': true, 
'\uc480': true, '\uc49c': true, '\uc4b8': true, '\uc4d4': true, '\uc4f0': true, '\uc50c': true, '\uc528': true, '\uc544': true, '\uc560': true, '\uc57c': true, '\uc598': true, '\uc5b4': true, '\uc5d0': true, '\uc5ec': true, '\uc608': true, '\uc624': true, 
'\uc640': true, '\uc65c': true, '\uc678': true, '\uc694': true, '\uc6b0': true, '\uc6cc': true, '\uc6e8': true, '\uc704': true, '\uc720': true, '\uc73c': true, '\uc758': true, '\uc774': true, '\uc790': true, '\uc7ac': true, '\uc7c8': true, '\uc7e4': true, 
'\uc800': true, '\uc81c': true, '\uc838': true, '\uc854': true, '\uc870': true, '\uc88c': true, '\uc8a8': true, '\uc8c4': true, '\uc8e0': true, '\uc8fc': true, '\uc918': true, '\uc934': true, '\uc950': true, '\uc96c': true, '\uc988': true, '\uc9a4': true, 
'\uc9c0': true, '\uc9dc': true, '\uc9f8': true, '\uca14': true, '\uca30': true, '\uca4c': true, '\uca68': true, '\uca84': true, '\ucaa0': true, '\ucabc': true, '\ucad8': true, '\ucaf4': true, '\ucb10': true, '\ucb2c': true, '\ucb48': true, '\ucb64': true, 
'\ucb80': true, '\ucb9c': true, '\ucbb8': true, '\ucbd4': true, '\ucbf0': true, '\ucc0c': true, '\ucc28': true, '\ucc44': true, '\ucc60': true, '\ucc7c': true, '\ucc98': true, '\uccb4': true, '\uccd0': true, '\uccec': true, '\ucd08': true, '\ucd24': true, 
'\ucd40': true, '\ucd5c': true, '\ucd78': true, '\ucd94': true, '\ucdb0': true, '\ucdcc': true, '\ucde8': true, '\uce04': true, '\uce20': true, '\uce3c': true, '\uce58': true, '\uce74': true, '\uce90': true, '\uceac': true, '\ucec8': true, '\ucee4': true, 
'\ucf00': true, '\ucf1c': true, '\ucf38': true, '\ucf54': true, '\ucf70': true, '\ucf8c': true, '\ucfa8': true, '\ucfc4': true, '\ucfe0': true, '\ucffc': true, '\ud018': true, '\ud034': true, '\ud050': true, '\ud06c': true, '\ud088': true, '\ud0a4': true, 
'\ud0c0': true, '\ud0dc': true, '\ud0f8': true, '\ud114': true, '\ud130': true, '\ud14c': true, '\ud168': true, '\ud184': true, '\ud1a0': true, '\ud1bc': true, '\ud1d8': true, '\ud1f4': true, '\ud210': true, '\ud22c': true, '\ud248': true, '\ud264': true, 
'\ud280': true, '\ud29c': true, '\ud2b8': true, '\ud2d4': true, '\ud2f0': true, '\ud30c': true, '\ud328': true, '\ud344': true, '\ud360': true, '\ud37c': true, '\ud398': true, '\ud3b4': true, '\ud3d0': true, '\ud3ec': true, '\ud408': true, '\ud424': true, 
'\ud440': true, '\ud45c': true, '\ud478': true, '\ud494': true, '\ud4b0': true, '\ud4cc': true, '\ud4e8': true, '\ud504': true, '\ud520': true, '\ud53c': true, '\ud558': true, '\ud574': true, '\ud590': true, '\ud5ac': true, '\ud5c8': true, '\ud5e4': true, 
'\ud600': true, '\ud61c': true, '\ud638': true, '\ud654': true, '\ud670': true, '\ud68c': true, '\ud6a8': true, '\ud6c4': true, '\ud6e0': true, '\ud6fc': true, '\ud718': true, '\ud734': true, '\ud750': true, '\ud76c': true, '\ud788': true
                             };

function WWHUnicodeInfo_Korean_LV(c)
{
  if (WWHUnicodeInfo_Korean_LV_Data[c] == true) return true;

  return false;
}

function WWHUnicodeInfo_Korean_LVT(c)
{
  if ( ! WWHUnicodeInfo_Korean_LV(c))
  {
    if (('\uac00' <= c) && (c <= '\ud7a3')) return true;
  }
  return false;
}

var WWHUnicodeInfo_WWNoBreak_Data = {
'\u2027': true,
'\u00AD': true,
'\u2011': true,
'\u2010': true,
'\u2043': true,
'\u002D': true,
'\u005f': true,
'\u0332': true,
'\u002a': true,
'\u002f': true,
'\u005c': true,
'\u0040': true,
'\u0026': true,
'\u003d': true,
'\u0024': true
                                    };

function WWHUnicodeInfo_WWNoBreak(c)
{
  if (WWHUnicodeInfo_WWNoBreak_Data[c])
  {
    return true;
  }

  return false;
}

var WWHUnicodeInfo_WWOpenBracket_Data = {
'\u0028': true,
'\u005b': true,
'\u007b': true,
'\u003c': true
                                        };

function WWHUnicodeInfo_WWOpenBracket(c)
{
  if (WWHUnicodeInfo_WWOpenBracket_Data[c])
  {
    return true;
  }

  return false;
}

var WWHUnicodeInfo_WWCloseBracket_Data = {
'\u0029': true,
'\u005d': true,
'\u007d': true,
'\u003e': true
                                         };

function WWHUnicodeInfo_WWCloseBracket(c)
{
  if (WWHUnicodeInfo_WWCloseBracket_Data[c])
  {
    return true;
  }

  return false;
}

