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

  1. var MainFrame = window.parent;
  2. // var bAgreedToEULA = false;
  3.  
  4. // Licensing state
  5. var DJSMAR00_LicenseState_TRIAL        = 0;
  6. var DJSMAR00_LicenseState_PURCHASED = 1;
  7. // Force Override
  8. var DJSMAR00_QueryMode_ForceOverride = 7;
  9.  
  10. function OnLoad()
  11. {
  12.     document.body.tabIndex=-1;
  13.     // Disable the Next button
  14.     // window.parent.frames("bottom").NextButton.disabled = true;
  15.     if (MainFrame.bAgreedToEULA)
  16.     {
  17.         AgreeEULAForm.AgreeEULA.checked = true;
  18.         OnAgreeEULAClick();
  19.     }
  20.     else
  21.     {
  22.         OnDisagreeEULAClick();
  23.     }
  24.  
  25.     EULAText.innerText = EULAIFrame.document.body.innerText;
  26.     EULAIFrame.focus ();
  27.  
  28. }
  29.  
  30. function OnAgreeEULAClick()
  31. {
  32.     // Enable the Next button
  33.     window.parent.frames("bottom").NextButton.disabled = false;
  34.     window.parent.frames("bottom").NextButton.focus();    
  35.     MainFrame.bAgreedToEULA = true;
  36. }
  37.  
  38. function OnDisagreeEULAClick()
  39. {
  40.     // Disable the Next button
  41.     window.parent.frames("bottom").NextButton.disabled = true;
  42.     MainFrame.bAgreedToEULA = false;
  43. }
  44.  
  45. function OnUnLoad()
  46. {
  47.     if ( MainFrame.bAgreedToEULA == true )
  48.     {
  49.         try
  50.         {
  51.             // Reset trial date on CTO only (expensive call)
  52.             if( MainFrame.g_lOEM == 2 )
  53.             {
  54.                 var NAVLicense;
  55.                 
  56.                 NAVLicense = new ActiveXObject("NAVLicense.NAVLicenseInfo");
  57.                 // this license is expried until DJSMAR00_QueryMode_ForceOverride has been called.
  58.                 NAVLicense.GetLicenseStateEx( DJSMAR00_QueryMode_ForceOverride );
  59.                 
  60.                 // Activation control should have populated the collection with the proper data
  61.                 NAVLicense.RefreshLicensing();
  62.                 // Also, need to re-verify that license is still valid.                            
  63.                 MainFrame.g_iLicenseState = window.external.ObjectArg("DRM::LicenseState") = NAVLicense.GetLicenseState();
  64.                 MainFrame.g_iLicenseZone = window.external.ObjectArg("DRM::LicenseZone") = NAVLicense.GetLicenseZone();
  65.                 MainFrame.g_bLicenseValid = ((MainFrame.g_iLicenseState == DJSMAR00_LicenseState_TRIAL) || (MainFrame.g_iLicenseState == DJSMAR00_LicenseState_PURCHASED));
  66.                 MainFrame.g_iDaysRemaining = window.external.ObjectArg("DRM::RemainingDays") = NAVLicense.LicenseDaysRemaining;
  67.             }
  68.             
  69.             // Enable subscription.
  70.             window.parent.frames("contents").OnSubscriptionInfo();
  71.         }
  72.         catch(err)
  73.         {
  74.             var msg = document.frames("Errors").document.all.ERR_MSG_NO_LICENSE.innerText;
  75.             var id = document.frames("Errors").document.all.ERR_ID_NO_LICENSE.innerText;
  76.             g_ErrorHandler.DisplayNAVError (msg, id);
  77.         }
  78.     }
  79. }
  80.