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

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    navigation_pane.js (Javascript file for navigation_pane.HTM)
  6. //
  7. // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. var NISFE = 1;
  12. var NISNOAD = 2
  13. var NIS = 3;
  14. var NPF = 4;
  15. var SDF = 5;
  16.  
  17. var NOT_PRESENT =0;
  18. var PRESENT = 1;
  19. var PRESENT_FAKE=2;
  20.  
  21. // Pane that allows you to choose
  22. var AccountModeHeadingPane = new WizardPane(window.AccountMode, window.AccountModeH, window.AccountMode, window.AccountModeH,
  23.     "Account Mode", "wiz-AccountMode.htm", null, null);
  24.  
  25.  
  26. // Windows Managed Panes
  27. var WindowsManagedHeadingPane = new WizardPane(window.WindowsManaged, window.WindowsManagedH, window.WindowsManaged, window.WindowsManagedH,
  28.     "Set Type", "wiz-SetType.htm", null, null);
  29.  
  30. var SetTypePane = new WizardPane(window.SetType, window.SetTypeH, window.WindowsManaged, window.WindowsManagedH,
  31.     "Set Type", "wiz-SetType.htm", null, null);
  32.  
  33.  
  34. // Application Managed Panes
  35. var ApplicationManagedHeadingPane = new WizardPane(window.ApplicationManaged, window.ApplicationManagedH, window.ApplicationManaged, window.ApplicationManagedH,
  36.     "Supervisor", "wiz-Supervisor.htm", null, null);
  37.  
  38. var SupervisorPane = new WizardPane(window.Supervisor, window.SupervisorH, window.ApplicationManaged, window.ApplicationManagedH,
  39.     "Supervisor", "wiz-Supervisor.htm", null, null);
  40.  
  41. var CreateAccountsPane = new WizardPane(window.CreateAccounts, window.CreateAccountsH, window.ApplicationManaged, window.ApplicationManagedH,
  42.     "Create Accounts", "wiz-CreateAccounts.htm", null, null);
  43.  
  44. var SetPasswordPane = new WizardPane(window.SetPassword, window.SetPasswordH, window.ApplicationManaged, window.ApplicationManagedH,
  45.     "Set Password", "wiz-SetPassword.htm", null, null);
  46.         
  47. var DefaultAccountPane = new WizardPane(window.DefaultAccount, window.DefaultAccountH, window.ApplicationManaged, window.ApplicationManagedH,
  48.     "Default Account", "wiz-DefaultAccount.htm", null, null);
  49.  
  50.  
  51. // Summary Pane
  52. var SummaryHeadingPane = new WizardPane(window.SummaryHeading, window.SummaryHeadingH, window.SummaryHeading, window.SummaryHeadingH,
  53.     "Summary", "wiz-Done.htm", null, null);
  54.  
  55.  
  56. // Pane Object
  57. function WizardPane(sID, shID, sHeading, sHLHeading, sTitle, shtm, pPreviousLink, pNextLink)
  58. {
  59.     shtm = SwitchTitle(shtm);
  60.     
  61.     this.m_ID = sID;            // ID for non-HighLighted Pane
  62.     this.m_hID = shID;            // ID for Highlighted
  63.     this.m_Heading = sHeading;        // Heading for this Pane
  64.     this.m_HLHeading = sHLHeading;        // Highlighed Heading for this Pane
  65.     this.m_sTitle = sTitle;            // Title of the (Pane) Web Page
  66.     this.m_htm  = shtm;            // WebPage Link
  67.     this.m_bPageOn = true;            // bool switch to determine if Page exist
  68.     this.m_pPreviousLink = pPreviousLink;     // Pointer to Previous Pane
  69.     this.m_pNextLink = pNextLink;        // Pointer to Next Pane    
  70.  
  71. }
  72.  
  73. function  SwitchTitle(sHtm)
  74. {
  75.     if(NisFetOHelper.State == PRESENT)
  76.     {
  77.         switch(sHtm)
  78.         {
  79.             case "wiz-SetType.htm":
  80.                  sHtm = "ProductivityControl_wiz-SetType.htm";
  81.                  break;
  82.  
  83.             case "wiz-CreateAccounts.htm":
  84.                  sHtm = "ProductivityControl_wiz-CreateAccounts.htm";
  85.                  break;
  86.  
  87.             case "wiz-SetPassword.htm":
  88.                  sHtm = "ProductivityControl_wiz-SetPassword.htm";
  89.                  break;
  90.  
  91.             case "wiz-DefaultAccount.htm":
  92.                  sHtm = "ProductivityControl_wiz-DefaultAccount.htm";
  93.                  break;
  94.  
  95.             case "wiz-Done.htm":
  96.                  sHtm = "ProductivityControl_wiz-Done.htm";
  97.                  break;
  98.         }
  99.     }
  100.  
  101.     return sHtm;
  102. }
  103.  
  104.  
  105. // Return a pointer to the current Pane
  106. function FindPane(sPaneID)
  107. {    
  108.     switch(sPaneID)
  109.     {
  110.         case "Account Mode":
  111.             return     window.AccountModeHeadingPane;
  112.                     break;
  113.         case "Set Type":
  114.             return     window.SetTypePane;
  115.                     break;                     
  116.         case "Supervisor":
  117.             return     window.SupervisorPane;
  118.                     break;                  
  119.         case "Create Accounts":
  120.             return window.CreateAccountsPane;
  121.                     break;
  122.         case "Set Password":
  123.             return window.SetPasswordPane;
  124.                     break;                    
  125.         case "Default Account":
  126.             return window.DefaultAccountPane;
  127.             break;
  128.         case "Summary":
  129.             return window.SummaryHeadingPane;
  130.                     break;
  131.     }
  132. }
  133.  
  134.     
  135.  
  136. function SetWizardLinks()
  137. {        
  138.     
  139.     
  140.     var bFirstRun = PCWizHelper.PCWizFirstRun;
  141.     // Remove Supervisor Pane
  142.     if(!bFirstRun)
  143.     {
  144.         SupervisorPane.m_bPageOn = false;
  145.         SupervisorPane.m_ID.style.display="none";
  146.         SupervisorBR.style.display="none";
  147.         SupervisorTab.style.display="none";
  148.     }
  149.     
  150.     
  151.     iAccountMode = window.parent.g_iAccountMode;
  152.     // NEXT LINK!!!!
  153. //    AccountModeHeadingPane.m_pNextLink = WindowsManagedHeadingPane;        // Windows Managed was selected
  154. //    AccountModeHeadingPane.m_pNextLink = ApplicationManagedHeadingPane;    // Application Managed was selected
  155.     if(iAccountMode == 0)
  156.         AccountModeHeadingPane.m_pNextLink = SetTypePane;            // Windows Managed was selected
  157.     else
  158.     {
  159.         // Modify for Supervisor Pane
  160.         if(bFirstRun)        
  161.             AccountModeHeadingPane.m_pNextLink = SupervisorPane;            // Application Managed was selected
  162.         else
  163.             AccountModeHeadingPane.m_pNextLink = CreateAccountsPane
  164.  
  165.         
  166.     }
  167.  
  168.     
  169.     // Windows Managed Selected
  170.     if(iAccountMode == 0)
  171.     {
  172.         WindowsManagedHeadingPane.m_pNextLink  = SetTypePane;
  173.         SetTypePane.m_pNextLink = SummaryHeadingPane;
  174.     }
  175.     
  176.     // Application Managed Selected
  177.         // Windows Managed Selected
  178.     if(iAccountMode == 1)
  179.     {
  180.         // Modify for Supervisor Pane
  181.         if(bFirstRun)        
  182.             ApplicationManagedHeadingPane.m_pNextLink = CreateAccountsPane;    //First next is Create Accout
  183.         else
  184.             ApplicationManagedHeadingPane.m_pNextLink = SetPasswordPane;    // First "next" is SetPassword
  185.  
  186.         SupervisorPane.m_pNextLink = CreateAccountsPane;    // This line is redundant if Supervisor Page doesn't exist
  187.         CreateAccountsPane.m_pNextLink = SetPasswordPane;
  188.         SetPasswordPane.m_pNextLink = DefaultAccountPane;
  189.         DefaultAccountPane.m_pNextLink = SummaryHeadingPane;
  190.     }
  191.     
  192.     // Summary Heading
  193.     SummaryHeadingPane.m_pNextLink = null;
  194.  
  195.  
  196.  
  197.     // BACK LINK!!!!    
  198.     AccountModeHeadingPane.m_pPreviousLink = null;
  199.     
  200.     // Windows Managed Selected
  201.     if(iAccountMode == 0)
  202.     {
  203.         WindowsManagedHeadingPane.m_pPreviousLink = AccountModeHeadingPane;
  204.         SetTypePane.m_pPreviousLink = AccountModeHeadingPane;
  205.     }
  206.     
  207.     // Application Managed Selected
  208.     if(iAccountMode == 1)
  209.     {    
  210.         WindowsManagedHeadingPane.m_pPreviousLink = AccountModeHeadingPane;    
  211.         SupervisorPane.m_pPreviousLink = AccountModeHeadingPane;
  212.         
  213.         // Modify for Supervisor Pane
  214.         if(bFirstRun)    
  215.             CreateAccountsPane.m_pPreviousLink = SupervisorPane;
  216.         else
  217.             CreateAccountsPane.m_pPreviousLink = AccountModeHeadingPane;
  218.             
  219.         SetPasswordPane.m_pPreviousLink = CreateAccountsPane;
  220.         DefaultAccountPane.m_pPreviousLink = CreateAccountsPane;    
  221.         
  222.     }
  223.     
  224.     // Summary must select where to go back from
  225.     if(iAccountMode == 0)
  226.         SummaryHeadingPane.m_pPreviousLink = SetTypePane;    
  227.     else
  228.         SummaryHeadingPane.m_pPreviousLink = DefaultAccountPane;
  229.     
  230.  
  231. }
  232.  
  233.  
  234. function OnLoad()
  235. {    
  236.     // Set the Wizard Link for the first time..     
  237.     SetWizardLinks();
  238.  
  239. }
  240.  
  241. function OnFocus()
  242. {
  243.  
  244.     // Last Control Tab over to the <back, next, close> button.
  245.     window.parent.frames("main",0).focus();
  246. }
  247.  
  248. function OnKeyDownHandler()
  249. {
  250.     // Last Control Tab over to the <back, next, close> button.
  251.     var VK_ESCAPE = 27;
  252.  
  253.     if (window.event.keyCode == VK_ESCAPE)
  254.     {
  255.         // Escape key.. We want to exit out of the wizard..
  256.         parent.window.navigate("res://closeme.xyz");
  257.  
  258.     }
  259.     
  260. }