home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd2.bin / ruzne / painter / PAINTE~2.cab / _358490287D14441EB8FFE1989B02CBFD < prev    next >
Text File  |  2003-01-06  |  3KB  |  110 lines

  1. // Copyright (c) 2000-2001 Quadralay Corporation.  All rights reserved.
  2. // 
  3.  
  4. function  WWHelpSwitch_Object()
  5. {
  6.   var  BrowserDetect = new BrowserDetect_Object();
  7.  
  8.  
  9.   this.mBrowser  = BrowserDetect.mBrowser;
  10.   this.mPlatform = BrowserDetect.mPlatform;
  11.  
  12.   this.mbJavaEnabled = false;
  13.  
  14.   this.fForceJavaScript  = WWHelpSwitch_ForceJavaScript;
  15.   this.fCheckJavaEnabled = WWHelpSwitch_CheckJavaEnabled;
  16.   this.fGetFrameSet      = WWHelpSwitch_GetFrameSet;
  17.   this.fSwitchFrameSet   = WWHelpSwitch_SwitchFrameSet;
  18. }
  19.  
  20. function  WWHelpSwitch_CheckJavaEnabled()
  21. {
  22.   if (navigator != null)
  23.   {
  24.     this.mbJavaEnabled = navigator.javaEnabled();
  25.   }
  26.   else
  27.   {
  28.     this.mbJavaEnabled = false;
  29.   }
  30. }
  31.  
  32. function  WWHelpSwitch_GetFrameSet()
  33. {
  34.   var  WhichFrameSet = "wwhelp/js/html/frames.htm";
  35.  
  36.  
  37.   // Detect current environment and use appropriate frameset
  38.   // if JavaScript isn't forced on.
  39.   //
  40.   if (this.fForceJavaScript() == false)
  41.   {
  42.     // Check to see if Java is enabled
  43.     //
  44.     if (this.mbJavaEnabled)
  45.     {
  46.       // We'll try to run the Java version unless
  47.       // a particular platform doesn't support it.
  48.       //
  49.       if (this.mBrowser == 1)  // Shorthand for Netscape
  50.       {
  51.         if (this.mPlatform == 1)  // Shorthand for Windows
  52.         {
  53.           WhichFrameSet = "wwhelp/java/html/wwhnsfs.htm";  // Java works on NS for Windows
  54.         }
  55.         else if (this.mPlatform == 2)  // Shorthand for Macintosh
  56.         {
  57.           WhichFrameSet = "wwhelp/js/html/frames.htm";  // Java doesn't work on NS for Macintosh
  58.         }
  59.         else
  60.         {
  61.           WhichFrameSet = "wwhelp/java/html/wwhnsfs.htm";  // Java works on NS for UNIX
  62.         }
  63.       }
  64.       else if (this.mBrowser == 4)  // Shorthand for Netscape
  65.       {
  66.         // LiveConnect broken under Netscape 6.0 on Windows and Mac
  67.         //
  68.         WhichFrameSet = "wwhelp/js/html/frames.htm";  // Play it safe.
  69.       }
  70.       else  // Assume IE
  71.       {
  72.         if (this.mPlatform == 1)  // Shorthand for Windows
  73.         {
  74.           WhichFrameSet = "wwhelp/java/html/wwhiefs.htm";  // Java works on IE for Windows
  75.         }
  76.         else if (this.mPlatform == 2)  // Shorthand for Macintosh
  77.         {
  78.           WhichFrameSet = "wwhelp/java/html/wwhmacfs.htm";  // Java works on IE and iCab for Macintosh (no favorites)
  79.         }
  80.         else
  81.         {
  82.           WhichFrameSet = "wwhelp/js/html/frames.htm";  // Java doesn't work on IE for UNIX
  83.         }
  84.       }
  85.     }
  86.   }
  87.  
  88.   return WhichFrameSet;
  89. }
  90.  
  91. function  WWHelpSwitch_SwitchFrameSet()
  92. {
  93.   var  NewLocation;
  94.  
  95.  
  96.   NewLocation = this.fGetFrameSet();
  97.  
  98.   if (location.href.indexOf("?") != -1)
  99.   {
  100.     var  Parts;
  101.  
  102.  
  103.     Parts = location.href.split("?");
  104.  
  105.     NewLocation += "?" + Parts[1];
  106.   }
  107.  
  108.   location.href = NewLocation;
  109. }
  110.