home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 October / CHIP1002.ISO / exe / COMPUGUI.exe / whdata / whtdata.js < prev    next >
Encoding:
Text File  |  2002-04-23  |  1.1 KB  |  58 lines

  1. var gTEA = new Array();
  2. function aTE()
  3. {
  4.     gTEA[gTEA.length] = new tocEntry(aTE.arguments);
  5. }
  6.  
  7. function tocEntry(fn_arguments) 
  8. {
  9.     if (fn_arguments.length < 3)    
  10.     {
  11.         alert ("data format wrong!!!");
  12.         return;
  13.     }
  14.     
  15.     this.nType = fn_arguments[0];
  16.     this.nContents = fn_arguments[1];
  17.     this.sItemName = fn_arguments[2];
  18.     
  19.     if (this.nType == 1 || this.nType == 2 || this.nType == 16)
  20.     {
  21.         if (fn_arguments.length > 3)
  22.         {
  23.             this.sItemURL = fn_arguments[3];
  24.             if (fn_arguments.length > 4)
  25.             {
  26.                 this.sTarget = fn_arguments[4];
  27.                 if (fn_arguments.length > 5)
  28.                     this.sIconRef = fn_arguments[5];
  29.             }
  30.         }
  31.     }
  32.     if (this.nType == 4 || this.nType == 8)
  33.     {
  34.         if (fn_arguments.length > 3)
  35.         {
  36.             this.sRefURL = fn_arguments[3];
  37.             if (fn_arguments.length > 4)
  38.             {
  39.                 this.sItemURL = fn_arguments[4];
  40.                 if (fn_arguments.length > 5)
  41.                 {
  42.                     this.sTarget = fn_arguments[5];
  43.                     if (fn_arguments.length > 6)
  44.                         this.sIconRef = fn_arguments[6];
  45.                 }
  46.             }
  47.         }
  48.     }
  49. }
  50.  
  51.  
  52. function window_OnLoad()
  53. {
  54.     if (parent && parent != this && parent.putData) {
  55.         parent.putData(gTEA);
  56.     }
  57. }
  58. window.onload = window_OnLoad;