home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / 01_03.iso / software / snpf / NPF / NPF.MSI / pcwiz.dll / HTML / WIZ-ACCOUNTMODE.JS < prev    next >
Encoding:
JavaScript  |  2002-09-21  |  2.8 KB  |  129 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    wiz-AccountMode.htm.js (Javascript file for wiz-AccountMode.HTM)
  6. //
  7. // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. function OnTabOver()
  12. {
  13.     // Last Control Tab over to the <back, next, close> button.
  14.     var VK_TAB = 9;
  15.     if (window.event.keyCode == VK_TAB)
  16.         window.parent.frames("bottom",0).focus();
  17.  
  18. }
  19.  
  20. function Is9x()
  21. {
  22.     var agt=navigator.userAgent.toLowerCase();;
  23.     var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
  24.     var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
  25.       
  26.     if(!is_win98 && !is_winme)
  27.     {
  28.         return false;
  29.     }
  30.     else
  31.     {
  32.         return true;
  33.     }
  34.         
  35.     
  36. }
  37.  
  38. function Page_GoNext()
  39. {
  40.     if(AccountModeSel[0].checked)
  41.     {
  42.         
  43.         // If password protection is on we cannot switch to windows account mode under Windows9x
  44.         ccPassWord.ProductName = WrapNisum.ProductName;
  45.         ccPassWord.ProductID = 2;    // Product ID for NIS is 2
  46.         ccPassWord.FeatureName = "";
  47.         ccPassWord.UserName = WrapNisum.CurrentUser;
  48.         ccPassWord.UseWindowsAccounts = false;        
  49.         
  50.         if(ccPassWord.Enabled && Is9x())
  51.         {
  52.             
  53.             // Give the user a warning that he cannot turn on windows account with password protection on.
  54.             ccWebWindow.MsgBox("This feature cannot be enabled when password protection is enabled",
  55.                     WrapNisum.ProductName, 0);
  56.  
  57.             
  58.             return false;
  59.         }
  60.  
  61.         
  62.         // Now switch the User Mode behind the scenes
  63.         if(PCWizHelper.bWinUserOK == true)
  64.         {
  65.             parent.window.SetAccountMode(0);
  66.             
  67.             // To Speed things up we only want to "Switch" the mode if it is
  68.             // if it is currently different                        
  69.             if(PCWizHelper.bWindowsAccount == false)            
  70.                 PCWizHelper.SetWindowsAccount(true);
  71.         }
  72.         else
  73.         {
  74.             PCWizHelper.MultiUserWarning();
  75.             return false;
  76.         }
  77.  
  78.     }
  79.     else
  80.     {
  81.         parent.window.SetAccountMode(1);
  82.         
  83.         // To Speed things up we only want to "Switch" the mode if it is
  84.         // if it is currently different        
  85.         if(PCWizHelper.bWindowsAccount == true)                    
  86.             PCWizHelper.SetWindowsAccount(false);        
  87.                 
  88.     }
  89.         
  90.     
  91.     return true;
  92. }
  93.  
  94. function Page_GoBack()
  95. {
  96.     
  97.     
  98.     return true;
  99. }
  100.  
  101.  
  102. function OnLoad()
  103. {
  104.     if (PCWizHelper.bWinUserOK)
  105.     {
  106.         AccountModeSel[0].checked = true;
  107.         AccountModeSel[1].checked = false;        
  108.     }
  109.     else
  110.     {
  111.         AccountModeSel[0].checked = false;        
  112.         AccountModeSel[1].checked = true;
  113.     }
  114.  
  115. }
  116.  
  117. function OnKeyDownHandler()
  118. {
  119.     // Last Control Tab over to the <back, next, close> button.
  120.     var VK_ESCAPE = 27;
  121.  
  122.     if (window.event.keyCode == VK_ESCAPE)
  123.     {
  124.         // Escape key.. We want to exit out of the wizard..
  125.         parent.window.navigate("res://closeme.xyz");
  126.  
  127.     }
  128.     
  129. }