home *** CD-ROM | disk | FTP | other *** search
/ Microsoft DirectX SDK 7.0 / Dx7.bin / DXF / doc / directx6.1 / directx.chm / dxmedia / foundation / d3drm / gloss.js < prev    next >
Encoding:
JavaScript  |  1999-03-03  |  1.9 KB  |  86 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.     OpenWindow();
  58.     }
  59.  
  60.     //NAVIGATOR
  61.     if (g_isNav == true) {
  62.         if (typeof(g_win.closed) == 'undefined') {
  63.         OpenWindow()
  64.      }
  65.      else{
  66.         CloseWindow();
  67.         SlowDown_OpenWindow();
  68.      }
  69.      }
  70.  
  71.     //IE3, open window now and skip. Never close the window.
  72.     if ((g_isIE == true) && (g_iMaj < 4 )) {
  73.     OpenWindow(); 
  74.     }
  75.     
  76.     //OTHER
  77.     if ((g_isIE != true) && (g_isNav != true))
  78.         if (typeof(g_win.closed) == 'undefined') {
  79.         OpenWindow()
  80.         }
  81.         else{
  82.             CloseWindow();
  83.         SlowDown_OpenWindow()
  84.         }
  85. }
  86.