home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd2.bin / nav2004 / download / NAV / External / NORTON / APP / CfgWzRes.dll / HTML / WELCOME.JS < prev   
Text File  |  2003-08-17  |  9KB  |  355 lines

  1. g_ModuleID = 3009;
  2. var lOEM = 0;
  3. var MainFrame = window.parent;
  4. var CfgWizMgrObj;
  5. var NAVLicense;
  6. var NAVOptionObj;
  7.  
  8. var DJSMAR_LicenseType_Violated            = -1;
  9. var DJSMAR_LicenseType_Retail            = 0;
  10. var DJSMAR_LicenseType_Trial            = 1;
  11. var DJSMAR_LicenseType_Rental            = 2;
  12. var DJSMAR_LicenseType_TryDie            = 3;
  13. var DJSMAR_LicenseType_Beta                = 4;
  14. var DJSMAR_LicenseType_Unlicensed        = 5;
  15. var DJSMAR_LicenseType_ESD                = 6;
  16.  
  17. MainFrame.g_WebWnd = null;
  18. MainFrame.bPromptUser = true;
  19. MainFrame.g_iLicenseType = DJSMAR_LicenseType_Retail;
  20.  
  21. function OnLoad()
  22. {
  23.     try
  24.     {
  25.         MainFrame.g_WebWnd = window.external.ObjectArg("CFGWIZ_WEBWINDOW_OBJECT");
  26.         MainFrame.g_WebWnd.OnCloseCallback = OnCloseButton;
  27.     }
  28.     catch(err)
  29.     {
  30.         var msg = document.frames("Errors").document.all.ERR_MSG_NO_WEBWND.innerText;
  31.         var id = document.frames("Errors").document.all.ERR_ID_NO_WEBWND.innerText;
  32.         g_ErrorHandler.DisplayNAVError (msg, id);
  33.         return;
  34.     }
  35.     
  36.     try
  37.     {
  38.         CfgWizMgrObj = new ActiveXObject ("NAVCfgWizDll.NAVCfgWizMgr");
  39.     }
  40.     catch(err)
  41.     {
  42.         var msg = document.frames("Errors").document.all.ERR_MSG_NO_CFGWIZDLL.innerText;
  43.         var id = document.frames("Errors").document.all.ERR_ID_NO_CFGWIZDLL.innerText;
  44.         g_ErrorHandler.DisplayNAVError (msg, id);        
  45.         return;
  46.     }
  47.     
  48.     try
  49.     {
  50.         NAVLicense = new ActiveXObject("NAVLicense.NAVLicenseInfo");
  51.     }
  52.     catch(err)
  53.     {
  54.         var msg = document.frames("Errors").document.all.ERR_MSG_NO_LICENSE.innerText;
  55.         var id = document.frames("Errors").document.all.ERR_ID_NO_LICENSE.innerText;
  56.         g_ErrorHandler.DisplayNAVError (msg, id);
  57.         return;
  58.     }
  59.  
  60.     try
  61.     {
  62.         MainFrame.g_iLicenseType = window.external.ObjectArg("DRM::LicenseType");
  63.     }
  64.     catch(err)
  65.     {
  66.         NAVLicense.NAVError.LogAndDisplay(0);
  67.     }
  68.     
  69.     try
  70.     {
  71.         NAVOptionObj = new ActiveXObject ("Symantec.Norton.AntiVirus.NAVOptions");
  72.     }
  73.     catch(err)
  74.     {
  75.         var msg = document.frames("Errors").document.all.ERR_MSG_NO_OPTIONS.innerText;
  76.         var id = document.frames("Errors").document.all.ERR_ID_NO_OPTIONS.innerText;
  77.         g_ErrorHandler.DisplayNAVError (msg, id);
  78.         return;
  79.     }    
  80.     
  81.     try
  82.     {
  83.         // Check if OEM sku
  84.         lOEM = CfgWizMgrObj.ProductType;
  85.         
  86.         
  87.         
  88.         if ( NAVOptionObj.IsNAVPro )
  89.         {
  90.             intro_table.style.backgroundImage = "url('welcome_bkg_pro.gif')";
  91.             text_table_cell2.style.display = "none";
  92.             text_table_cell2_oem.style.display = "none";
  93.             text_table_cell2_oem_spacer.style.display = "none";
  94.             text_table_cell2_pro.style.display = "";        
  95.             g_strProductName = ProductNamePro.innerText;
  96.         }
  97.         else
  98.         {        
  99.             g_strProductName = ProductName.innerText;
  100.             intro_table.style.backgroundImage = "url('welcome_bkg.gif')";
  101.             
  102.             // If OEM layout, display OEM text.
  103.             if (lOEM == 1)
  104.             {
  105.                 // hide non-OEM text
  106.                 
  107.                 text_table_cell1.style.display = "none";
  108.                 text_table_cell2.style.display = "none";
  109.                 text_table_cell2_pro.style.display = "none";        
  110.                 text_table_cell2_oem.style.display = "";
  111.             }
  112.             else
  113.                 text_table_cell2_oem_spacer.style.display = "none";
  114.  
  115.             if(DJSMAR_LicenseType_Rental == MainFrame.g_iLicenseType)
  116.             {            
  117.                 try
  118.                 {
  119.                     if (CfgWizMgrObj.ShowBrandingLogo)
  120.                     {
  121.                         // Check to see if the system is in high contrast mode.
  122.                         //  If yes, windows will not show the vendor logo because it's a background image.
  123.                         //  We will need to need to show vendor name in text.
  124.                         
  125.                         var bShowVendorLogo = true;                            
  126.                         var DefAlertObj;
  127.                         
  128.                         try
  129.                         {                            
  130.                             DefAlertObj = new ActiveXObject ("DefAlert.SymNavDefAlert");
  131.                             
  132.                             if(DefAlertObj.IsHighContrast())
  133.                             {
  134.                                 // Load vendor name from NAVUIRES.DLL                                
  135.                                 var IDS_VENDOR_NAME = 116;    // from NAVUIRES.H    
  136.                                                                                         
  137.                                 var VendorName = DefAlertObj.GetStringFromBrandingResource(IDS_VENDOR_NAME, false);
  138.                                 
  139.                                 var szBrandingText = p_partner_text.innerText + " " + VendorName;    
  140.                                 
  141.                                 p_partner_text.innerText = szBrandingText;
  142.                                 
  143.                                 bShowVendorLogo = false;
  144.                             }
  145.                         }
  146.                         catch(err)
  147.                         {
  148.                             // ignore error.
  149.                         }
  150.                         
  151.                         try
  152.                         {                        
  153.                             if(bShowVendorLogo)
  154.                             {
  155.                                 intro_table3.style.backgroundImage = "url(\'res://" + NAVOptionObj.NortonAntiVirusPath + "\\navuires.dll/WELCOME_VENDOR.gif\')";
  156.                                 intro_table3.style.backgroundRepeat = "no-repeat";
  157.                                 intro_table3.style.backgroundPosition = "right";
  158.                             }
  159.                         }
  160.                         catch(err)
  161.                         {
  162.                             NAVOptionObj.NAVError.LogAndDisplay(0);
  163.                             
  164.                             intro_table3.style.backgroundImage = "none";
  165.                             partner_text.style.display = "none";
  166.                         }
  167.                         
  168.                         partner_text.style.display = "";                    
  169.                     }
  170.                 }
  171.                 catch(err)
  172.                 {
  173.                     CfgWizMgrObj.NAVError.LogAndDisplay(0);
  174.                 }
  175.                         
  176.                 var nTotalText;
  177.                 try
  178.                 {
  179.                     // Check to see if there is branding text.
  180.                     nTotalText = CfgWizMgrObj.TotalBrandingText;
  181.                 }
  182.                 catch(err)
  183.                 {
  184.                     CfgWizMgrObj.NAVError.LogAndDisplay(0);
  185.                 }
  186.                 
  187.                 // Get branding text from NAVUIRES.                
  188.                 if(nTotalText == 0)
  189.                 {
  190.                     // Hide all bullets.
  191.                     //  (i.e. TOnline does not want to display any text in the welcome screen.)
  192.                     text_table_cell1.style.display = "none";
  193.                     text_table_bullet1.style.display = "none";
  194.                     text_table_bullet2.style.display = "none";
  195.                     text_table_bullet3.style.display = "none";
  196.                 }
  197.                 else if(nTotalText > 0)
  198.                 {
  199.                     // Get branding text from NAVUIRES.
  200.                     var aText = new Array(nTotalText);
  201.                     
  202.                     for(var i=0; i < nTotalText; i++)
  203.                     {
  204.                         aText[i] = CfgWizMgrObj.GetBrandingText(i);                
  205.                     }
  206.                     
  207.                     switch(nTotalText)
  208.                     {
  209.                     case 3:
  210.                         {
  211.                             if(aText[0].length != 0)
  212.                                 text_table_bullet1.innerText = aText[0];
  213.                             
  214.                             if(aText[1].length != 0)                    
  215.                                 text_table_bullet2.innerText = aText[1];
  216.                                 
  217.                             if(aText[2].length != 0)                    
  218.                                 text_table_bullet3.innerText = aText[2];
  219.                         }
  220.                         break;                                                                
  221.                         
  222.                     case 2:
  223.                         {
  224.                             if(aText[0].length != 0)
  225.                                 text_table_bullet1.innerText = aText[0];
  226.                                 
  227.                             if(aText[1].length != 0)
  228.                                 text_table_bullet2.innerText = aText[1];
  229.                                 
  230.                             // Hide the last bullet.
  231.                             text_table_bullet3.style.display = "none";
  232.                         }
  233.                         break;
  234.                         
  235.                     case 1:
  236.                         {
  237.                             if(aText[0].length != 0)
  238.                                 text_table_bullet1.innerText = aText[0];
  239.                                 
  240.                             // Hide the last two bullets.
  241.                             text_table_bullet2.style.display = "none";
  242.                             text_table_bullet3.style.display = "none";
  243.                         }
  244.                         break;                            
  245.                     
  246.                     default:
  247.                         break;
  248.                     }
  249.                 }                
  250.             }
  251.         }
  252.         
  253.         intro_table.style.backgroundRepeat = "no-repeat";
  254.     }
  255.     catch(err)
  256.     {
  257.         CfgWizMgrObj.NAVError.LogAndDisplay (0);
  258.         window.navigate("res://closeme.xyz");
  259.         return;
  260.     }
  261.  
  262.  
  263.     // Make sure we're at the top
  264.     document.body.scrollTop = 0;
  265.     
  266.     // Always set focus to the next button
  267.     var TimerID = 0;
  268.     
  269.     TimerID = setInterval("SetNextButtonFocus()", 500);
  270. }
  271.  
  272. function SetNextButtonFocus()
  273. {
  274.     NextButton.focus();
  275. }
  276.  
  277. function NextPage()
  278. {
  279.     var bShowPostInstallTasks = true;
  280.     
  281.     try
  282.     {
  283.         // Are all post install tasks are set to hidden?
  284.         bShowLaunchLiveUpdate = CfgWizMgrObj.ShowLaunchLiveUpdate;
  285.         bShowLaunchRescue = CfgWizMgrObj.ShowLaunchRescue;
  286.         bShowEnableWeeklyScan = CfgWizMgrObj.ShowEnableWeeklyScan;
  287.            bShowLaunchFullSysScan = CfgWizMgrObj.ShowLaunchFullSysScan;
  288.            
  289.         bShowPostInstallTasks = bShowLaunchLiveUpdate || bShowLaunchRescue || bShowEnableWeeklyScan || bShowLaunchFullSysScan;    
  290.     }
  291.     catch(err)
  292.     {
  293.         CfgWizMgrObj.NAVError.LogAndDisplay(0);
  294.         bShowPostInstallTasks = true;
  295.     }
  296.         
  297.     
  298.     try
  299.     {    
  300.         // Navigate to frameset page
  301.         window.navigate("home.htm");
  302.     }
  303.     catch(err)
  304.     {
  305.         // Fatal error
  306.         var msg = document.frames("Errors").document.all.ERR_MSG_FATAL_DJS.innerText;
  307.         var id = document.frames("Errors").document.all.ERR_ID_FATAL_DJS.innerText;
  308.         g_ErrorHandler.DisplayNAVError (msg, id);
  309.         return;
  310.     }
  311.     
  312.     // Pass license sub type to the next page.
  313.     window.external.Global = window.external.ObjectArg;
  314. }
  315.  
  316. function OnScroll ()
  317. {
  318.     document.body.scrollTop = 0;
  319. }
  320.  
  321. function OnCloseButton()
  322. {
  323. // MessageBox() Flags
  324. var MB_YESNO =                  0x00000004;
  325. var MB_ICONQUESTION =           0x00000020;
  326. var IDYES =             6;
  327.  
  328.     if (MainFrame.m_nCurrentPanel == MainFrame.m_nMaxPanels - 1)
  329.     {
  330.         OnCompleteCfgWiz();
  331.         MainFrame.navigate("res://closeme.xyz");
  332.         return true;
  333.     }
  334.     else
  335.     {
  336.         // Prompt users to see if they really wanna cancel
  337.         if( MainFrame.bPromptUser == true )
  338.         {
  339.  
  340.             iMsgBoxReturn = MainFrame.g_WebWnd.MsgBox(CancelWarning.innerHTML, MainFrame.g_strProductName, MB_YESNO | MB_ICONQUESTION);
  341.  
  342.             if (iMsgBoxReturn == IDYES)
  343.             {
  344.                 MainFrame.navigate("res://closeme.xyz");
  345.                 return true;
  346.             }
  347.             return false
  348.         }
  349.         else
  350.             MainFrame.navigate("res://closeme.xyz");
  351.     }
  352.     return true;
  353. }
  354.  
  355.