home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 January / EnterCD 0105.iso / Internet / Norton Internet Security 2005 / NIS_Retail.EXE / Setup / SymLT / ActRes.DLL / HTML / SELECT.JS < prev    next >
Encoding:
Text File  |  2004-08-17  |  8.3 KB  |  331 lines

  1. g_ModuleID = 3009;
  2.  
  3. var MainFrame = window.parent;
  4. var Register = true;
  5. var Activate = true;
  6. var nPanelSkippedTo = 0;
  7.  
  8.  
  9.     
  10. function DisableButtons()
  11. {
  12.     NextButton.disabled = true;
  13.     NextButton.style.display = "";
  14.     BackButton.disabled = true;
  15.     BackButton.style.display = "";
  16. }
  17.  
  18. function OnLoad()
  19. {
  20.     DisableButtons();
  21.     MainFrame.g_bSelectFrameLoaded = true;
  22.     BackButton.disabled = true;
  23. }
  24.  
  25. function OnSkipButton()
  26. {    
  27.     try
  28.     {
  29.         // If skip is renamed to finish and summon clicks it bail out.
  30.         if( SkipButton.innerHTML == FinishBtnText.innerHTML )
  31.             window.parent.frames("contents").OnCloseButton();
  32.  
  33.         // Get the current panel
  34.         var nCurPanel = MainFrame.m_nCurrentPanel;
  35.         
  36.         // Roadmap frame to access objects local to him
  37.         var RMFrame = window.parent.frames("contents");
  38.  
  39.         // If PageOb (activex that supports ICCIWNAvigation) is defined
  40.         // let him get first crack at the skip button otherwise we are in control
  41.         if((MainFrame.g_PageOb != null))
  42.         {
  43.             // PageOb has control - returns true
  44.             if (MainFrame.g_PageOb.Skip())
  45.             {
  46.                 return;
  47.             }
  48.             // PageOb gave up control - returns false
  49.             else
  50.             {
  51.                 // We have control so set the PageObject to null
  52.                 MainFrame.g_PageOb = null;
  53.                 window.parent.frames("contents").OnCloseButton();
  54.                 return;
  55.             }
  56.         }
  57.         
  58.         if( (MainFrame.m_aWizardPanels[nCurPanel].m_sTitle == "Registration"))
  59.         {
  60.             var RMFrame = window.parent.frames("contents");                    
  61.             var SkipRegTo = 0;
  62.             
  63.             if( MainFrame.g_iLicenseType == 0)
  64.                 SkipRegTo = RMFrame.nActivationPanel;
  65.             else
  66.                 SkipRegTo = RMFrame.nPostInstall;
  67.             
  68.             LoadPage( SkipRegTo );
  69.         }    
  70.     }
  71.     catch(err)
  72.     {
  73.         var msg = document.frames("Errors").document.all.ERR_MSG_NAVIGATION.innerText;
  74.         var id = document.frames("Errors").document.all.ID_MSG_NAVIGATION.innerText;
  75.         g_ErrorHandler.DisplayNAVError (msg, id);
  76.         return;
  77.     }
  78.     
  79. }
  80.  
  81. function OnNextButton()
  82. {
  83.     try
  84.     {    
  85.         // If next is renamed to finish and summon clicks it bail out.
  86.         if( NextButton.innerHTML == FinishBtnText.innerHTML )
  87.             window.parent.frames("contents").OnCloseButton();
  88.             
  89.         // Roadmap frame to access objects local to him
  90.         var RMFrame = window.parent.frames("contents");
  91.  
  92.         // Get the next panel
  93.         var nNextPanel = MainFrame.m_nCurrentPanel + 1;
  94.  
  95.         // If PageOb (activex that supports ICCIWNAvigation) is defined
  96.         // let him get first crack at the next button otherwise we are in control
  97.         if( MainFrame.g_PageOb != null )
  98.         {
  99.             // PageOb has control - returns true
  100.             if ( MainFrame.g_PageOb.Next() )
  101.             {
  102.                 return;
  103.             }
  104.             // PageOb gave up control - returns false
  105.             else
  106.             {    
  107.                 // We have control so set the PageObject to null
  108.                 MainFrame.g_PageOb = null;
  109.                 window.parent.frames("contents").OnCloseButton();
  110.                 return;
  111.             }
  112.         }
  113.  
  114.         // Run the post action for the current panel
  115.         if (MainFrame.m_nCurrentPanel >= 0)
  116.         {
  117.             if (MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_pPostAction != null)
  118.             {
  119.                 MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_pPostAction();
  120.             }
  121.         }
  122.         
  123.         var nNextPanel = MainFrame.m_nCurrentPanel + 1;
  124.  
  125.         if(MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_sTitle == "SELECTACTIVATION" && !Register)
  126.         {
  127.             nPanelSkippedTo = nNextPanel;
  128.             
  129.             if(Activate)
  130.             {
  131.                 nPanelSkippedTo = RMFrame.nActivationPanel;
  132.             }
  133.             else
  134.             {
  135.                 nPanelSkippedTo = RMFrame.nSubscriptionPanel;
  136.             }
  137.  
  138.             LoadPage(nPanelSkippedTo);
  139.  
  140.             return;
  141.         }    
  142.  
  143.         for (; nNextPanel < MainFrame.m_nMaxPanels; nNextPanel++)
  144.         {    
  145.                 if (MainFrame.m_aWizardPanels[nNextPanel].m_bLoadPanel == false || MainFrame.m_aWizardPanels[nNextPanel].m_bDisplayPanel == false)
  146.             {    
  147.                 // Run the pre action
  148.                 if (MainFrame.m_aWizardPanels[nNextPanel].m_pPreAction != null)
  149.                 {
  150.                     MainFrame.m_aWizardPanels[nNextPanel].m_pPreAction();
  151.                 }
  152.  
  153.                 // Run the post action
  154.                 if (MainFrame.m_aWizardPanels[nNextPanel].m_pPostAction != null)
  155.                 {
  156.                     MainFrame.m_aWizardPanels[nNextPanel].m_pPostAction();
  157.                 }
  158.                 
  159.                 continue;
  160.             }
  161.             break;
  162.         }
  163.         LoadPage(nNextPanel);
  164.     }
  165.     catch(err)
  166.     {
  167.         var msg = document.frames("Errors").document.all.ERR_MSG_NAVIGATION.innerText;
  168.         var id = document.frames("Errors").document.all.ERR_ID_NAVIGATION.innerText;
  169.         g_ErrorHandler.DisplayNAVError (msg, id);
  170.         return;
  171.     }
  172. }
  173.  
  174. function OnBackButton()
  175. {
  176.     try
  177.     {
  178.         // Get the roadmap frame
  179.         var RMFrame = window.parent.frames("contents");    
  180.                 
  181.         // Get the previous panel 
  182.         var nPrevPanel = MainFrame.m_nCurrentPanel - 1;
  183.         
  184.         
  185.         // If PageOb (activex that supports ICCIWNAvigation) is defined
  186.         // let him get first crack at the next button otherwise we are in control
  187.         if( MainFrame.g_PageOb != null )
  188.         {
  189.         if( MainFrame.g_PageOb.Back() )
  190.             {
  191.                 // PageOb has control - returns true
  192.                 return;
  193.             }
  194.             else
  195.             {
  196.                 // PageOb has control - returns false
  197.                 MainFrame.g_PageOb = null;
  198.             }
  199.         }        
  200.         
  201.         if ( nPanelSkippedTo == MainFrame.m_nCurrentPanel)
  202.         {
  203.             LoadPage(RMFrame.nSelectPanel);
  204.             
  205.             nPanelSkippedTo = 0;
  206.             return;
  207.         }
  208.  
  209.         if(MainFrame.g_iLicenseType == 1)
  210.         {
  211.             switch ( MainFrame.m_aWizardPanels[nPrevPanel].m_sTitle )
  212.             {
  213.                 case "Registration":
  214.                     if(window.external.ObjectArg("DRM::LicenseState") != DJSMAR00_LicenseState_PURCHASED)    
  215.                     {
  216.                         nPrevPanel=RMFrame.nActivationPanel;
  217.  
  218.                     }
  219.                 break;
  220.                 
  221.                 default:
  222.                 
  223.                 break;
  224.             }
  225.             
  226.             LoadPage(nPrevPanel);
  227.             return;
  228.         }
  229.  
  230.         for (; nPrevPanel >= 0; nPrevPanel--)
  231.         {
  232.             if (MainFrame.m_aWizardPanels[nPrevPanel].m_bLoadPage == false || MainFrame.m_aWizardPanels[nPrevPanel].m_bDisplayPage == false)
  233.             {
  234.                 continue;
  235.             }
  236.             break;
  237.         }
  238.         
  239.         LoadPage(nPrevPanel);
  240.     }
  241.     catch(err)
  242.     {
  243.         var msg = document.frames("Errors").document.all.ERR_MSG_NAVIGATION.innerText;
  244.         var id = document.frames("Errors").document.all.ERR_ID_NAVIGATION.innerText;
  245.         g_ErrorHandler.DisplayNAVError (msg, id);
  246.         return;
  247.     }
  248. }
  249.  
  250. function LoadPage(nPanel)
  251. {
  252.  
  253.     if (nPanel > MainFrame.m_nMaxPanels - 1  || nPanel < -1)
  254.     {
  255.         return;
  256.     }
  257.     
  258.  
  259.     if (MainFrame.m_nCurrentPanel >= 0)
  260.     {
  261.         // Update the "content" frame
  262.         MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_TitleID.style.backgroundImage = '';
  263.         MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_Arrow.style.display = "none";
  264.  
  265.         MainFrame.m_nCurrentPanel = nPanel;
  266.         MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_TitleID.style.backgroundImage = 'url(Current.gif)';
  267.         MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_Arrow.style.display = "";
  268.     }
  269.     else
  270.     {
  271.         MainFrame.m_nCurrentPanel = nPanel;    
  272.  
  273.         // Update the "content" frame
  274.         MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_TitleID.style.backgroundImage = 'url(Current.gif)';
  275.         MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_Arrow.style.display = "";
  276.     }
  277.  
  278.     // Load the page into the "main" frame
  279.     window.parent.frames("main").location.replace(MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_htm);
  280.     
  281.     switch (MainFrame.m_aWizardPanels[nPanel].m_sTitle)
  282.     {
  283.         case "Activation":
  284.             SkipButton.style.display = "";
  285.             SkipButton.disabled = false;
  286.             SkipButton.innerHTML = ActSkipBtnText.innerHTML;
  287.             SkipButton.accessKey = ActSkipHotKey.innerText;
  288.         break;
  289.  
  290.         default:
  291.             SkipButton.style.display = "none";
  292.             txtHelpLink.style.display = "none";
  293.         break;
  294.     }
  295.     
  296.  
  297.     // Disable the Back button 
  298.     if (MainFrame.m_nCurrentPanel <= MainFrame.m_nFirstPanel && MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_bLoadPanel)
  299.     {
  300.         BackButton.disabled    = true;
  301.     }
  302.     else
  303.     {
  304.         BackButton.disabled = false;
  305.     }
  306.  
  307.     // Determine the Next and Finish button state
  308.     if (MainFrame.m_nCurrentPanel == MainFrame.m_nMaxPanels - 1)
  309.     {
  310.         // We are at the last panel, hide the Next button and show the Finish button
  311.         NextButton.style.display = "none";
  312.         
  313.         SkipButton.disabled = false;
  314.         SkipButton.style.display = "";
  315.         SkipButton.accessKey = FinishHotKey.innerText;
  316.         SkipButton.innerHTML = FinishBtnText.innerHTML;
  317.         SkipButton.focus();
  318.     }
  319.     else
  320.     {
  321.         // We are not at the last panel, hide the Finish button and show the Next button
  322.         NextButton.style.display = "";
  323.         NextButton.disabled = false;
  324.     }
  325.     
  326.     // Run the Pre action for the panel
  327.     if (MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_pPreAction != null)
  328.         MainFrame.m_aWizardPanels[MainFrame.m_nCurrentPanel].m_pPreAction();
  329.     
  330. }
  331.