home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 January / Gamestar_80_2006-01_dvd.iso / Utility / 5-11_xp-2k_dd_ccc_wdm_enu_27345.exe / Data1.cab / _440B8963FEA3411CA198A35924FFACDB < prev    next >
Text File  |  2003-09-15  |  2KB  |  78 lines

  1. // Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WWHFile_Object(ParamTitle,
  5.                          ParamHREF)
  6. {
  7.   this.mTitle = ParamTitle;
  8.   this.mHREF  = ParamHREF;
  9. }
  10.  
  11. function  WWHFileList_Object()
  12. {
  13.   this.mFileList = new Array();
  14.   this.mFileHash = new WWHFileHash_Object();
  15.  
  16.   this.fAddFile          = WWHFileList_AddFile;
  17.   this.fA                = WWHFileList_AddFile;
  18.   this.fHREFToIndex      = WWHFileList_HREFToIndex;
  19.   this.fHREFToTitle      = WWHFileList_HREFToTitle;
  20.   this.fFileIndexToHREF  = WWHFileList_FileIndexToHREF;
  21.   this.fFileIndexToTitle = WWHFileList_FileIndexToTitle;
  22. }
  23.  
  24. function  WWHFileList_AddFile(ParamTitle,
  25.                               ParamHREF)
  26. {
  27.   this.mFileHash[ParamHREF + "~"] = this.mFileList.length;
  28.   this.mFileList[this.mFileList.length] = new WWHFile_Object(ParamTitle, ParamHREF);
  29. }
  30.  
  31. function  WWHFileList_HREFToIndex(ParamHREF)
  32. {
  33.   var  MatchIndex = -1;
  34.   var  Match;
  35.  
  36.  
  37.   Match = this.mFileHash[ParamHREF + "~"];
  38.   if (typeof(Match) != "undefined")
  39.   {
  40.     MatchIndex = Match;
  41.   }
  42.  
  43.   return MatchIndex;
  44. }
  45.  
  46. function  WWHFileList_HREFToTitle(ParamHREF)
  47. {
  48.   var  Title = "";
  49.   var  MatchIndex;
  50.  
  51.  
  52.   MatchIndex = this.fHREFToIndex(ParamHREF);
  53.   if (MatchIndex != -1)
  54.   {
  55.     Title = this.mFileList[MatchIndex].mTitle;
  56.   }
  57.   else
  58.   {
  59.     Title = WWHStringUtilities_EscapeHTML(unescape(ParamHREF));
  60.   }
  61.  
  62.   return Title;
  63. }
  64.  
  65. function  WWHFileList_FileIndexToHREF(ParamIndex)
  66. {
  67.   return this.mFileList[ParamIndex].mHREF;
  68. }
  69.  
  70. function  WWHFileList_FileIndexToTitle(ParamIndex)
  71. {
  72.   return this.mFileList[ParamIndex].mTitle;
  73. }
  74.  
  75. function  WWHFileHash_Object()
  76. {
  77. }
  78.