home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd2.bin / nav2004 / download / NAV / External / NORTON / actlang.DLL / HTML / ACTIVATIONPANEL.JS < prev    next >
Text File  |  2003-08-15  |  5KB  |  167 lines

  1. var MainFrame = window.parent;
  2. var TimerID = 0;
  3. var PageOb = null;
  4. var SelectFrame = null;
  5. // Globals
  6. MainFrame.iLicType;
  7. MainFrame.iLicZone;
  8.  
  9. var bReady = false;
  10. var g_lTimerID = 0;
  11.  
  12. //Enums for button states
  13. var NEXT_BUTTON    = 0;
  14. var BACK_BUTTON    = 1;
  15. var SKIP_BUTTON    = 2;
  16.     
  17. var BUTTON_KILLED    = -1;
  18. var BUTTON_DISABLE    = 0;
  19. var BUTTON_ENABLE    = 1;
  20. var BUTTON_HIDE        = 2;
  21. var BUTTON_SHOW        = 4;
  22. var BUTTON_SETFOCUS = 8;
  23.  
  24.  
  25. // DJSMar license Types
  26. var DJSMAR_LicenseType_Violated            = -1;
  27. var DJSMAR_LicenseType_Retail            = 0;
  28. var DJSMAR_LicenseType_Trial            = 1;
  29. var DJSMAR_LicenseType_Rental            = 2;
  30. var DJSMAR_LicenseType_TryDie            = 3;
  31. var DJSMAR_LicenseType_Beta                = 4;
  32. var DJSMAR_LicenseType_Unlicensed        = 5;
  33. var DJSMAR_LicenseType_ESD                = 6;
  34.  
  35. // DJSMar license Zones
  36. var DJSMAR_LicenseZone_Trial            =   (0x00000001); // in a trial period
  37. var DJSMAR_LicenseZone_Expired            =   (0x00000002); // the license has expired
  38. var DJSMAR_LicenseZone_Warning            =   (0x00000004); // the license is about to expire
  39. var DJSMAR_LicenseZone_PreActivation    =   (0x00000008); // the license has never been activated
  40. var DJSMAR_LicenseZone_PostActivation    =    (0x00000010); // the license has been activated
  41. var DJSMAR_LicenseZone_Purchased        =   (0x00000020); // the license is in a purchased(AKA Activated) state
  42. var DJSMAR_LicenseZone_Violated            =   (0x00000040); // the license has been violated (i.e. failed security checks)
  43. var DJSMAR_LicenseZone_Killed            =   (0x00000080); 
  44.  
  45. function LoadStockPanel()
  46. {
  47.     window.parent.frames("main").navigate( "StockPanel.htm" );
  48. }
  49.  
  50. function OnLoad()
  51. {
  52.     if ( MainFrame.g_bRoadmapFrameLoaded && MainFrame.g_bSelectFrameLoaded )
  53.     {
  54.         UpdatePage();
  55.     }
  56.     else
  57.     {
  58.         // Wait for the other frames to load
  59.         g_lTimerID = window.setInterval( "UpdatePage()", 500 );
  60.     }
  61. }
  62.  
  63. function UpdatePage()
  64. {
  65.     if ( MainFrame.g_bRoadmapFrameLoaded && MainFrame.g_bSelectFrameLoaded )
  66.     {
  67.         
  68.         try
  69.         {
  70.             SelectFrame = window.parent.frames("bottom");
  71.             clearInterval(g_lTimerID);    
  72.             
  73.             // See what license zone and type we are and if we don't need to 
  74.             // go on to activation we can cut them off here by navigating to the 
  75.             // stockpanel
  76.             
  77.             MainFrame.iLicType = window.external.ObjectArg("DRM::LicenseType");
  78.             MainFrame.iLicZone = window.external.ObjectArg("DRM::LicenseZone");
  79.             
  80.             
  81.             if( (MainFrame.iLicType == DJSMAR_LicenseType_Violated) || ((MainFrame.iLicZone & DJSMAR_LicenseZone_Violated) == DJSMAR_LicenseZone_Violated) )
  82.             {
  83.                 LoadStockPanel();
  84.                 return;
  85.             }
  86.             
  87.             if( ((MainFrame.iLicZone & DJSMAR_LicenseZone_Purchased) == DJSMAR_LicenseZone_Purchased) &&
  88.                 (MainFrame.iLicZone & DJSMAR_LicenseZone_Warning) != DJSMAR_LicenseZone_Warning)
  89.             {
  90.                 LoadStockPanel();
  91.                 return;
  92.             }
  93.                 
  94.             switch ( MainFrame.iLicType )
  95.             {
  96.                 case DJSMAR_LicenseType_TryDie:
  97.                     
  98.                     // Show stock panels for trial and killed states
  99.                     LoadStockPanel();
  100.                     return;
  101.                     
  102.                 break;
  103.                 
  104.                 case DJSMAR_LicenseType_Beta:
  105.                     // Show stock panels for double expired
  106.                     if ( ((MainFrame.iLicZone & DJSMAR_LicenseZone_PostActivation) == DJSMAR_LicenseZone_PostActivation) &&
  107.                         ((MainFrame.iLicZone & DJSMAR_LicenseZone_Expired) == DJSMAR_LicenseZone_Expired))
  108.                     {
  109.                         LoadStockPanel();
  110.                         return;
  111.                     }
  112.                 break;
  113.                 
  114.                 default:
  115.                 break;
  116.             }
  117.             
  118.             // Disable the buttons for beginning state
  119.             SelectFrame.DisableButtons();
  120.             
  121.             // Show the skip button
  122.             SelectFrame.SkipButton.disabled = true;
  123.             SelectFrame.SkipButton.style.display = "";
  124.             SelectFrame.SkipButton.innerHTML = ActBtnSkipText.innerHTML;
  125.             SelectFrame.SkipButton.accessKey = ActBtnSkipHotKey.innerText
  126.             
  127.             SelectFrame.bControlDone = false;
  128.             
  129.             // Get a pointer to our Activation object
  130.             PageOb = SymUIAx;
  131.             
  132.             // Set background to white        
  133.             SymUIAx.SetProperty("Color0", "FFFFFF");
  134.             SymUIAx.SetProperty("Color1", "FFFFFF");
  135.             SymUIAx.SetProperty("Color2", "FFFFFF");
  136.             SymUIAx.SetProperty("Color3", "FFFFFF");
  137.             
  138.             // Set us to first in chain if we are the first panel.
  139.             if( MainFrame.m_nCurrentPanel  == 0 )
  140.                 SymUIAx.SetProperty( "FirstInChain", "true" );
  141.             else
  142.                 SymUIAx.SetProperty( "FirstInChain", "false" );
  143.  
  144.             // Actwizard is always last in chain at least til they want to add ore apges to it            
  145.             SymUIAx.SetProperty( "LastInChain", "true" );
  146.             
  147.             // No LR in Actwizard
  148.             SymUIAx.SetProperty( "SendLiveRegistration", "false");
  149.             
  150.             // Get the path to the helper DLL from the collection and tell the control
  151.             SymUIAx.SetProperty( "HelperDLLPath", window.external.ObjectArg("DRM::ActivationUIPath"));
  152.  
  153.             SymUIAx.SetDataCollection( window.external.ObjectArg );
  154.             
  155.             SymUIAx.Initialize();
  156.         }
  157.         catch(err)
  158.         {
  159.             MainFrame.iLicType = DJSMAR_LicenseType_Violated;
  160.             MainFrame.iLicZone = DJSMAR_LicenseZone_Violated;
  161.             
  162.             LoadStockPanel();
  163.         }
  164.     }
  165. }
  166.  
  167.