home *** CD-ROM | disk | FTP | other *** search
/ Microsoft DirectX SDK 7.0 / Dx7.bin / DXF / doc / directx6.1 / directx.chm / dxmedia / foundation / dplay / gloss.js < prev    next >
Encoding:
JavaScript  |  1999-03-03  |  1.9 KB  |  85 lines

  1. //General variables
  2. var g_win = new Object();    // Window Object for LoadImage()
  3. var g_counter = 0;        // Slowdown counter
  4. var g_sFileName = ''        // Glossary file name to load
  5. var ID = 0;            // Timeout ID
  6.  
  7. //Slowdown open window process
  8. function SlowDown_OpenWindow(){
  9.     if(typeof(ID) !='undefined') {window.clearTimeout(ID)};
  10.     if (g_counter < 1) {
  11.     g_counter++;
  12.     ID = window.setTimeout("SlowDown_OpenWindow()",175);
  13.     }
  14.     else {
  15.     g_counter = 0;
  16.     OpenWindow();
  17.     }
  18. }
  19.  
  20. //Open floating window
  21. function OpenWindow() {
  22.     var s = 'width=300,height=450,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
  23.     g_win = window.open(g_sFileName, 'GLOS_SARY', s);
  24. }
  25.  
  26. function ShowHelp(path){
  27.     window.showHelp(path);
  28. }
  29.  
  30. //Close down the floating window
  31. function CloseWindow(){
  32.     //IE4
  33.     if ((g_isIE == true) && (g_iMaj >=4)) {
  34.         self.g_win.close();
  35.     }
  36.     
  37.     //IE3
  38.     if ((g_isIE == true) && (g_iMaj < 4)) {
  39.         //IE skips this step,
  40.     }
  41.     
  42.     //NAVIGATOR 
  43.     if (g_isNav == true){ 
  44.     if(g_win.closed == true){} else{g_win.close();}
  45.     }
  46.     
  47.     //OTHER
  48.     if(g_win.closed == true){} else{g_win.close();}
  49. }
  50.  
  51. /********************************/
  52. function Glossary(path) { 
  53.     g_sFileName = path;
  54.     //IE4
  55.     if ((g_isIE == true) && (g_iMaj >=4)) {
  56.     lnkOver(path);
  57.     }
  58.  
  59.     //NAVIGATOR
  60.     if (g_isNav == true) {
  61.         if (typeof(g_win.closed) == 'undefined') {
  62.         OpenWindow()
  63.      }
  64.      else{
  65.         CloseWindow();
  66.         SlowDown_OpenWindow();
  67.      }
  68.      }
  69.  
  70.     //IE3, open window now and skip. Never close the window.
  71.     if ((g_isIE == true) && (g_iMaj < 4 )) {
  72.     OpenWindow(); 
  73.     }
  74.     
  75.     //OTHER
  76.     if ((g_isIE != true) && (g_isNav != true))
  77.         if (typeof(g_win.closed) == 'undefined') {
  78.         OpenWindow()
  79.         }
  80.         else{
  81.             CloseWindow();
  82.         SlowDown_OpenWindow()
  83.         }
  84. }
  85.