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

  1. g_ModuleID = 3002;
  2.  
  3. // Disable Drag-and-drop support
  4. document.ondragstart = function(){return false;}
  5.  
  6.  
  7. // Globals status
  8. //
  9. // Values are    0 - OK
  10. //                1 - Alert
  11. //                2 - Urgent alert
  12. var gc_OK = 0;
  13. var gc_Warning = 1;
  14. var gc_Urgent = 2;
  15.  
  16. // The g_fReady variable is used to enable the buttons and panel switching.  We have
  17. // been seeing crashes and hangs when we allow the user to start clicking around
  18. // before we have returned from onLoad.
  19. var g_fReady = false;
  20.  
  21. // The g_fStartingScan variable is used to disable the scan now button for a bit
  22. // after it has been pressed.  It's a hack to get around not knowing
  23. // when we are currently executing a scan.
  24. var g_fStartingScan = false;
  25.  
  26. var g_iVirusDefOldThreshold     = 14;        // days old before warning
  27. var g_iVirusDefReallyOldThreshold = 30;        // days old before urgent
  28.  
  29. var g_statusNone = 0;             // Couldn't get state or uninitialized - ERROR
  30. var g_statusNotInstalled = 1;    // Should be installed but isn't, tried to init but failed - ERROR
  31. var g_statusNotRunning = 2;         // Not loaded
  32. var g_statusEnabled = 3;           // Default OK setting
  33. var g_statusDisabled = 4;        // Loaded but turned off
  34. var g_statusNotAvailable = 5;    // Not supposed to exist ( e.g. Rescue Disk on NT ) Not an error!
  35.  
  36. var g_LastItem = 0;                // Last status item row clicked on
  37. var g_LastHintText = 0;         // Last status item hint text displayed.
  38. var g_LastHintID;                 // Last status item ID - for refreshes
  39. var g_LastButtonText = 0;
  40.  
  41. var g_APHintText = 0;                // Current AP text object
  42. var g_VirusDefHintText = 0;            // Current virus def text object
  43. var g_FullSystemScanHintText = 0;    // Current full system scan text object
  44. var g_EmailHintText = 0;            // Current Email text object
  45. var g_USHintText = 0;                // Current Update service text object
  46. var g_ALUHintText = 0;                // Current ALU text object
  47.  
  48. var g_LastID = "";
  49.  
  50. var g_SelectColor = "#CFE0FF";
  51. var g_LastHotColor;                    // Last color of active text
  52.  
  53. var g_APHelpID = 11512;
  54. var g_EmailHelpID = 11513;
  55. var g_SBHelpID = 11514;
  56. var g_FSSHelpID = 11515;
  57. var g_VirusDefHelpID = 11516;
  58. var g_ALUHelpID = 11517;
  59. var g_USHelpID = 11518;
  60.  
  61. var IDH_RETAIL_PREACTIVATION_TRIAL = 11810;
  62. var IDH_RETAIL_PREACTIVATION_EXPIRED = 11811;
  63. var IDH_TRYBUY_PREACTIVATION_TRIAL = 11520;
  64. var IDH_TRYBUY_PREACTIVATION_EXPIRED = 11521;
  65. var IDH_SCSS_PREACTIVATION_TRIAL = 11523;
  66. var IDH_SCSS_PREACTIVATION_TRIAL_EXPIRED = 11524;
  67. var IDH_SCSS_ACTIVE = 11525;
  68. var IDH_SCSS_WARNING = 11526;
  69. var IDH_SCSS_EXPIRED = 11527;
  70. var IDH_SCSS_KILLED = 11528;
  71.  
  72. // Interfaces
  73. //
  74. var g_strAPInterface = "NAVAPSCR.ScriptableAutoProtect";
  75. var g_strOptionsInterface = "Symantec.Norton.AntiVirus.NAVOptions";
  76. var g_strScanTasksInterface = "Symantec.Norton.AntiVirus.ScanTasks";
  77. var g_strLauncherInterface = "Symantec.Norton.AntiVirus.AppLauncher";
  78. var g_strStatusInterface = "Status.NAVStatus";
  79. var g_strNAVLicense = "NAVLicense.NAVLicenseInfo";
  80. var g_strDefAlert = "DefAlert.SymNavDefAlert";
  81. var g_strIconOK = "check_wht.gif";
  82. var g_strIconWarning = "warning_wht.gif";
  83. var g_strIconUrgent = "urgent_wht.gif";
  84.  
  85. var g_iLicenseType = 0;
  86.  
  87. // License zone
  88. //
  89. var DJSMAR_LicenseZone_Trial            =   (0x00000001); // in a trial period
  90. var DJSMAR_LicenseZone_Expired            =   (0x00000002); // the license has expired
  91. var DJSMAR_LicenseZone_Warning            =   (0x00000004); // the license is about to expire
  92. var DJSMAR_LicenseZone_PreActivation   =   (0x00000008); // the license has never been activated
  93. var DJSMAR_LicenseZone_Purchased        =   (0x00000020); // the license is in a purchased(AKA Activated) state
  94. var DJSMAR_LicenseZone_Killed            =   (0x00000080); // the license has been purposely killed (By the server)
  95. var DJSMAR_LicenseZone_Violated            =   (0x00000040) // the license has been violated (i.e. failed security checks)
  96.  
  97. // License state
  98. //
  99. var DJSMAR00_LicenseState_Violated   = -2;
  100.  
  101. // License types
  102. //
  103. var DJSMAR_LicenseType_Retail = 0;
  104. var DJSMAR_LicenseType_Trial = 1;
  105. var DJSMAR_LicenseType_Rental = 2;
  106. var DJSMAR_LicenseType_TryDie = 3;
  107. var DJSMAR_LicenseType_Beta = 4;
  108. var DJSMAR_LicenseType_Unlicensed = 5;
  109. var DJSMAR_LicenseType_ESD = 6;
  110.  
  111. // Vendor id
  112. var DJSMAR00_VendorID_SoftSecure = 2;
  113.  
  114. var STATUS_RETAIL_PREACTIVE     = 0;
  115. var STATUS_RETAIL_EXPIRED        = 1;
  116. var STATUS_RETAIL_ACTIVE         = 2;
  117. var STATUS_TRIALWARE_ACTIVE        = 3;
  118. var STATUS_TRIALWARE_EXPIRED    = 4;
  119. var STATUS_TRYDIE_ACTIVE        = 5;
  120. var STATUS_TRYDIE_EXPIRED        = 6;
  121. var STATUS_RENTAL_TRIAL            = 7;
  122. var STATUS_RENTAL_TRIAL_EXPIRED    = 8;
  123. var STATUS_RENTAL_ACTIVE         = 9;
  124. var STATUS_RENTAL_WARNING         = 10;
  125. var STATUS_RENTAL_EXPIRED         = 11;
  126. var STATUS_RENTAL_KILLED         = 12;
  127. var STATUS_CORRUPTED             = 13;
  128. var STATUS_ERROR                 = 14;
  129.  
  130. // Constant feature index
  131. var gc_AP = 0;
  132. var gc_Email = 1;
  133. var gc_SB = 2;
  134. var gc_FSS = 3;
  135. var gc_VirusDef = 4;
  136. var gc_US = 5;
  137. var gc_ALU = 6;
  138. var gc_LASTONE = 7;    // always the last one
  139.  
  140. // Product status
  141. var Icons = new Array (gc_LASTONE);
  142.  
  143. Icons[gc_AP] = new Icon ( "APIcon", g_strIconOK);
  144. Icons[gc_Email] = new Icon ( "EmailIcon", g_strIconOK);
  145. Icons[gc_SB] = new Icon ( "SBIcon", g_strIconOK);
  146. Icons[gc_FSS] = new Icon ( "FSSIcon", g_strIconOK);
  147. Icons[gc_VirusDef] = new Icon ( "VirusDefIcon", g_strIconOK);
  148. Icons[gc_US] = new Icon ( "USIcon", g_strIconOK);
  149. Icons[gc_ALU] = new Icon ( "ALUIcon", g_strIconOK);
  150.  
  151. var Features = new Array (gc_LASTONE);
  152.  
  153. // Scope the objects
  154. //
  155. var g_Options;
  156. var g_Launcher;
  157. var g_AP;
  158. var g_NAVLicense;
  159. var g_bProductEnabled = true;
  160. var g_ProductStatus = STATUS_RETAIL_ACTIVE;
  161.  
  162. function Icon ( id, source )
  163. {
  164.     this.idtag = id;
  165.     this.source = source;
  166. }
  167.  
  168. function Feature (state, row, hinttext, buttontext, detailstext, detailsbody)
  169. {
  170.     this.state = state;
  171.     this.row = row;
  172.     this.hinttext = hinttext;
  173.     this.buttontext = buttontext;
  174.     this.detailstext = detailstext;
  175.     this.detailsbody = detailsbody;
  176. }
  177.  
  178. function UpdateNAVStatus()
  179. {
  180.     UpdateProductStatus();
  181.     
  182.     UpdateAPStatus ();
  183.     
  184.     UpdateVirusDefStatus ();
  185.  
  186.     UpdateALUStatus ();
  187.  
  188.     UpdateServiceStatus ();
  189.  
  190.     UpdateEmailStatus ();
  191.  
  192.     if ( g_Options != null && g_Options.SCRIPTBLOCKING.Installed != 0 )
  193.         UpdateScriptBlockingStatus ();
  194.  
  195.     UpdateFullSystemScan ();
  196.  
  197.    // Evaluate global status.
  198.     UpdateSystemStatus();
  199.  
  200.     // We are now ready to let the user start clicking on stuff.
  201.     g_fReady = true;
  202.  
  203.     // If the def subscription is out of date, or the defs are old (or gone)
  204.     // make the scanner icons "!"
  205.     if ( g_NAVStatus.ProductLicenseType != DJSMAR_LicenseType_Rental )
  206.     {
  207.         if ( Features[gc_US].state == gc_Urgent || 
  208.              Features[gc_VirusDef].state == gc_Urgent )
  209.         {
  210.             if ( Features[gc_AP].state == gc_OK )
  211.                 Icons[gc_AP].source = g_strIconWarning;
  212.  
  213.             if ( Features[gc_Email].state == gc_OK )
  214.                 Icons[gc_Email].source = g_strIconWarning;
  215.             
  216.             if ( Features[gc_SB].state == gc_OK )                
  217.                 Icons[gc_SB].source = g_strIconWarning;
  218.         }    
  219.         
  220.         // "Virus Definition Service"
  221.         idtxt_navstats_VPUTitle_Rental.style.display = "none";
  222.         idtxt_navstats_VPUTitle.style.display = "";
  223.     }
  224.     else
  225.     {
  226.         // "Norton AntiVirus Service"
  227.         idtxt_navstats_VPUTitle_Rental.style.display = "";
  228.         idtxt_navstats_VPUTitle.style.display = "none";
  229.     }
  230.     
  231.     // Refresh the status details text
  232.     //
  233.     if ( g_LastItem != 0 )
  234.         onHint ( g_LastItem, g_LastHintID );
  235.     else
  236.     {
  237.         // If any rows are Urgent, select it for the user.
  238.         //
  239.         if ( Features[gc_US].state == gc_Urgent )
  240.             onHint ( Features[gc_US].row, Features[gc_US].hinttext );
  241.         else
  242.         {
  243.               for ( var iIndex = 0; iIndex < Features.length ; iIndex++)
  244.               {
  245.                 
  246.                 if ( Features[iIndex].state == gc_Urgent )
  247.                 {
  248.                     onHint ( Features[iIndex].row, Features[iIndex].hinttext );
  249.                     break;
  250.                 }
  251.               }
  252.         }
  253.             
  254.     }
  255.     
  256.     UpdateIcons();
  257. }
  258.  
  259.  
  260. function OnLoad()
  261. {
  262.     // Set up row info
  263.     Features[gc_AP] = new Feature (gc_OK);
  264.     Features[gc_AP].row = APRow;
  265.     Features[gc_AP].hinttext = "AP";
  266.     Features[gc_AP].state = gc_OK;        
  267.  
  268.     Features[gc_Email] = new Feature (gc_OK);
  269.     Features[gc_Email].row = EmailRow;
  270.     Features[gc_Email].hinttext = "Email";    
  271.     Features[gc_Email].state = gc_OK;
  272.     Features[gc_Email].detailstext = EmailHintText;
  273.     Features[gc_Email].detailsbody = HintTableEmail_cell5;
  274.  
  275.     Features[gc_SB] = new Feature (gc_OK);
  276.     Features[gc_SB].row = SBRow;
  277.     Features[gc_SB].hinttext = "SB";    
  278.     Features[gc_SB].state = gc_OK;
  279.     Features[gc_SB].detailstext = SBHintText;
  280.     Features[gc_SB].detailsbody = idtxt_navstats_sb_body1;
  281.     
  282.     Features[gc_FSS] = new Feature (gc_OK);
  283.     Features[gc_FSS].row = FSSRow;
  284.     Features[gc_FSS].hinttext = "FSS";    
  285.     Features[gc_FSS].state = gc_OK;
  286.     Features[gc_FSS].detailstext = FullSystemScanHintText;
  287.     Features[gc_FSS].detailsbody = idtxt_navstats_sb_body2;    // yeah, this is correct
  288.  
  289.     Features[gc_VirusDef] = new Feature (gc_OK);
  290.     Features[gc_VirusDef].row = VirusDefRow;
  291.     Features[gc_VirusDef].hinttext = "VirusDef";    
  292.     Features[gc_VirusDef].state = gc_OK;
  293.  
  294.     Features[gc_US] = new Feature (gc_OK);
  295.     Features[gc_US].row = USRow;
  296.     Features[gc_US].hinttext = "US";    
  297.     Features[gc_US].state = gc_OK;
  298.  
  299.     Features[gc_ALU] = new Feature (gc_OK);
  300.     Features[gc_ALU].row = ALURow;
  301.     Features[gc_ALU].hinttext = "ALU";    
  302.     Features[gc_ALU].state = gc_OK;    
  303.     
  304.     var SBInstalled;
  305.  
  306.     try
  307.     {
  308.         g_Launcher = new ActiveXObject( g_strLauncherInterface );
  309.     }
  310.     catch (err)
  311.     {
  312.         var msg = document.frames("Errors").document.all.ERR_MSG_NO_LAUNCHER.innerText;
  313.         var id = document.frames("Errors").document.all.ERR_ID_NO_LAUNCHER.innerText;
  314.         g_ErrorHandler.DisplayNAVError (msg, id);
  315.         AllError ();
  316.         return;
  317.     }
  318.  
  319.     // Create the Options object.
  320.     CreateOptions ();
  321.     if ( g_Options == null)
  322.     {
  323.         return;
  324.     }
  325.     
  326.     try
  327.     {
  328.         g_AP = new ActiveXObject ( g_strAPInterface );
  329.     }
  330.     catch (err)
  331.     {
  332.         var msg = document.frames("Errors").document.all.ERR_MSG_NO_APSCR.innerText;
  333.         var id = document.frames("Errors").document.all.ERR_ID_NO_APSCR.innerText;
  334.         g_ErrorHandler.DisplayNAVError (msg, id);
  335.         AllError ();
  336.         return;
  337.     }
  338.  
  339.     try
  340.     {
  341.         g_NAVLicense = new ActiveXObject( g_strNAVLicense );
  342.     }
  343.     catch(err)
  344.     {
  345.         var msg = document.frames("Errors").document.all.ERR_MSG_NO_LICENSE.innerText;
  346.         var id = document.frames("Errors").document.all.ERR_ID_NO_LICENSE.innerText;
  347.         g_ErrorHandler.DisplayNAVError (msg, id);
  348.             AllError ();
  349.         return;
  350.     }
  351.  
  352.     try
  353.     {
  354.         g_iLicenseType = g_NAVLicense.GetLicenseType();
  355.     }
  356.     catch(err)
  357.     {
  358.         g_NAVLicense.NAVError.LogAndDisplay(0);
  359.             AllError ();
  360.         return;
  361.     }
  362.  
  363.     // Set hint text
  364.     onMouseOut(null);
  365.  
  366.     try
  367.     {
  368.         g_Options.Load();
  369.         SBInstalled = g_Options.SCRIPTBLOCKING.Installed;
  370.     }
  371.        catch (NAVErr)
  372.     {
  373.         g_Options.NAVError.LogAndDisplay(0);
  374.         AllError ();
  375.         return;
  376.     }
  377.  
  378.     try
  379.     {
  380.         // Get AP notifications
  381.         g_NAVStatus.UseAP = 1;
  382.  
  383.         // Get virus defs date notifications
  384.         g_NAVStatus.UseVirusDef = 1;
  385.  
  386.         // Get Automatic LiveUpdate notifications
  387.         g_NAVStatus.UseALU = 1;
  388.  
  389.         // Get virus def subscription notifications
  390.         // K2 virus def subscription is applied to Retail and trialware.
  391.         //  Managed Rental uses DJSLicensing.
  392.         switch(g_iLicenseType)
  393.         {
  394.         case DJSMAR_LicenseType_Retail:
  395.         case DJSMAR_LicenseType_Trial:
  396.         case DJSMAR_LicenseType_Unlicensed:
  397.         case DJSMAR_LicenseType_ESD:
  398.         case DJSMAR_LicenseType_Beta:
  399.             {
  400.                     g_NAVStatus.UseVirusDefSubscription = 1;
  401.             }
  402.         break;
  403.         
  404.         default:
  405.         break;
  406.         }
  407.             
  408.         g_NAVStatus.UseEmail = 1;
  409.  
  410.         // Is Script Blocking supposed to be installed?
  411.         //
  412.         if ( SBInstalled == 0 )
  413.         {
  414.             SBRow.style.display = "none";
  415.             MainTable_cell26.style.display = "none";
  416.         }
  417.         else
  418.             g_NAVStatus.UseScriptBlocking = 1;
  419.  
  420.         g_NAVStatus.UseFullSystemScan = 1;
  421.         
  422.         g_NAVStatus.UseLicensing = 1;
  423.  
  424.         try
  425.         {
  426.             // Call all data gathering methods.
  427.             g_NAVStatus.GetStatus( 1 );
  428.         }
  429.         catch (err)
  430.         {
  431.             var msg = document.frames("Errors").document.all.ERR_MSG_NO_STATUS_OBJECT.innerText;
  432.             var id = document.frames("Errors").document.all.ERR_ID_NO_STATUS_OBJECT.innerText;
  433.             g_ErrorHandler.DisplayNAVError (msg, id);
  434.             return;
  435.         }        
  436.     }
  437.        catch (NAVErr)
  438.     {
  439.         g_NAVStatus.NAVError.LogAndDisplay(0);
  440.         AllError ();
  441.         return;
  442.     }
  443.  
  444.    document.all.APTitle.focus();
  445. }
  446.  
  447. function UpdateFullSystemScan ()
  448. {
  449.     idtxt_navstats_fss_refreshing.style.display = "none";
  450.     idtxt_navstats_fss_license_corrupted.style.display = "none";
  451.  
  452.     if(g_NAVStatus.ProductLicenseState == DJSMAR00_LicenseState_Violated)
  453.     {
  454.         // Corrupted
  455.         //    
  456.         Features[gc_FSS].state = gc_Urgent;
  457.         Icons[gc_FSS].source = g_strIconUrgent;
  458.         Features[gc_FSS].buttontext = NoButton;
  459.  
  460.         idtxt_navstats_fss_date.style.display="none";
  461.         idtxt_navstats_fss_notrun.style.display = "none";
  462.         idtxt_navstats_fss_license_corrupted.style.display = "";        
  463.         return;
  464.     }
  465.  
  466.     
  467.     var lFSSStatus;
  468.     var lScanAge;
  469.     var strFSSDate;
  470.  
  471.     try
  472.     {
  473.         lFSSStatus = g_NAVStatus.FullSystemScanStatus;
  474.         lScanAge = g_NAVStatus.FullSystemScanAge;
  475.         strFSSDate = g_NAVStatus.FullSystemScanDate;
  476.     }
  477.     catch (NAVErr)
  478.     {
  479.         g_NAVStatus.NAVError.LogAndDisplay(0);
  480.     }
  481.  
  482.     try
  483.     {
  484.         switch ( lFSSStatus )
  485.         {
  486.             case g_statusEnabled:
  487.  
  488.             if ( lScanAge < 90 )
  489.             {
  490.                 // OK
  491.                 //
  492.                 Features[gc_FSS].state = gc_OK;
  493.                 idtxt_navstats_fss_date.style.display="";
  494.                 idtxt_navstats_fss_notrun.style.display = "none";
  495.                 Icons[gc_FSS].source = g_strIconOK;
  496.                 idtxt_navstats_fss_date.innerText = strFSSDate;
  497.             }
  498.             else
  499.             {
  500.                 // Old
  501.                 //
  502.                 Features[gc_FSS].state = gc_Warning;
  503.                 idtxt_navstats_fss_date.style.display="";
  504.                 idtxt_navstats_fss_notrun.style.display = "none";
  505.                 Icons[gc_FSS].source = g_strIconWarning;
  506.                 idtxt_navstats_fss_date.innerText = strFSSDate;
  507.             }
  508.             break;
  509.  
  510.             default:
  511.             // Never run or error
  512.             //
  513.             Features[gc_FSS].state = gc_Urgent;
  514.             idtxt_navstats_fss_date.style.display = "none";
  515.             idtxt_navstats_fss_notrun.style.display = "";
  516.             Icons[gc_FSS].source = g_strIconUrgent;
  517.             break;
  518.         }
  519.  
  520.         Features[gc_FSS].buttontext = FSSButtonScan;
  521.     }
  522.     catch (err)
  523.     {
  524.         var msg = document.frames("Errors").document.all.ERR_MSG_FSS_STATUS.innerText;
  525.         var id = document.frames("Errors").document.all.ERR_ID_FSS_STATUS.innerText;
  526.         g_ErrorHandler.DisplayNAVError (msg, id);
  527.         return;
  528.     }
  529. }
  530.  
  531. function UpdateEmailStatus ()
  532. {
  533.     // Turn off the extra titles by default
  534.     //
  535.     idtxt_navstats_email_title_on.style.display = "";
  536.     idtxt_navstats_email_title_incoming.style.display = "none";
  537.     idtxt_navstats_email_title_outgoing.style.display = "none";
  538.     idtxt_navstats_email_license_corrupted.style.display= "none";
  539.  
  540.     // Turn off refresh text
  541.     //
  542.     idtxt_navstats_email_refreshing.style.display= "none";
  543.     
  544.     if(g_NAVStatus.ProductLicenseState == DJSMAR00_LicenseState_Violated)
  545.     {
  546.         // Corrupted
  547.         //    
  548.         Features[gc_Email].state = gc_Urgent;
  549.         Icons[gc_Email].source = g_strIconUrgent;        
  550.         Features[gc_Email].buttontext = NoButton;
  551.         
  552.         idtxt_navstats_email_error.style.display= "none";
  553.         idtxt_navstats_email_on.style.display= "none";
  554.         idtxt_navstats_email_off.style.display= "none";
  555.         idtxt_navstats_email_license_corrupted.style.display= "";
  556.         return;
  557.     }
  558.  
  559.     var iEmailStatus;
  560.     var bPOP;
  561.     var bSMTP;
  562.     var bCanEnable;
  563.  
  564.     try
  565.     {
  566.         iEmailStatus = g_NAVStatus.EmailStatus;
  567.         bPOP = g_NAVStatus.EmailPOP;
  568.         bSMTP = g_NAVStatus.EmailSMTP;
  569.         bCanEnable = g_NAVStatus.EmailCanEnable;
  570.     }
  571.     catch (NAVErr)
  572.     {
  573.         g_NAVStatus.NAVError.LogAndDisplay(0);
  574.     }
  575.  
  576.     try
  577.     {
  578.         switch ( iEmailStatus )
  579.         {
  580.             case g_statusEnabled :
  581.             // On
  582.             //
  583.             Features[gc_Email].state = gc_OK;
  584.             Icons[gc_Email].source = g_strIconOK;
  585.             idtxt_navstats_email_error.style.display= "none";
  586.             idtxt_navstats_email_on.style.display= "";
  587.             idtxt_navstats_email_off.style.display= "none";
  588.             Features[gc_Email].buttontext = NoButton;
  589.  
  590.             // Now figure out which title to use
  591.             //
  592.             if ( bPOP && bSMTP )
  593.             {
  594.                 idtxt_navstats_email_title_on.style.display = "";
  595.                 idtxt_navstats_email_title_incoming.style.display = "none";
  596.                 idtxt_navstats_email_title_outgoing.style.display = "none";
  597.             }
  598.             else if ( bPOP )
  599.             {
  600.                 idtxt_navstats_email_title_on.style.display = "none";
  601.                 idtxt_navstats_email_title_incoming.style.display = "";
  602.                 idtxt_navstats_email_title_outgoing.style.display = "none";
  603.             }
  604.             else if ( bSMTP )
  605.             {
  606.                 idtxt_navstats_email_title_on.style.display = "none";
  607.                 idtxt_navstats_email_title_incoming.style.display = "none";
  608.                 idtxt_navstats_email_title_outgoing.style.display = "";
  609.             }
  610.             break;
  611.  
  612.             case g_statusDisabled :
  613.             // Off
  614.             //
  615.             Features[gc_Email].state = gc_Warning;
  616.             Icons[gc_Email].source = g_strIconWarning;
  617.             idtxt_navstats_email_error.style.display= "none";
  618.             idtxt_navstats_email_on.style.display= "none";
  619.             idtxt_navstats_email_off.style.display= "";
  620.  
  621.             if ( bCanEnable )
  622.                 Features[gc_Email].buttontext = EmailButtonOff;
  623.             else
  624.                 Features[gc_Email].buttontext = NoButton;
  625.  
  626.             break;
  627.  
  628.             default:
  629.             // Error
  630.             //
  631.             Features[gc_Email].state = gc_Urgent;
  632.             Icons[gc_Email].source = g_strIconUrgent;
  633.             idtxt_navstats_email_error.style.display= "";
  634.             idtxt_navstats_email_on.style.display= "none";
  635.             idtxt_navstats_email_off.style.display= "none";
  636.             Features[gc_Email].buttontext = NoButton;
  637.             break;
  638.         }// end switch
  639.     }
  640.     catch (err)
  641.     {
  642.         var msg = document.frames("Errors").document.all.ERR_MSG_EMAIL_STATUS.innerText;
  643.         var id = document.frames("Errors").document.all.ERR_ID_EMAIL_STATUS.innerText;
  644.         g_ErrorHandler.DisplayNAVError (msg, id);
  645.         return;
  646.     }
  647. }
  648.  
  649. function UpdateScriptBlockingStatus ()
  650. {
  651.     // Hide the "Refreshing"
  652.     //
  653.     idtxt_navstats_sb_refreshing.style.display = "none";
  654.     idtxt_navstats_sb_license_corrupted.style.display= "none";
  655.  
  656.     if(g_NAVStatus.ProductLicenseState == DJSMAR00_LicenseState_Violated)
  657.     {
  658.         // corrupted
  659.         //
  660.         Features[gc_SB].state = gc_Urgent;
  661.         Icons[gc_SB].source = g_strIconUrgent;
  662.         Features[gc_SB].buttontext = NoButton;              // No button for error
  663.         
  664.         idtxt_navstats_sb_error.style.display= "none";
  665.         idtxt_navstats_sb_on.style.display= "none";
  666.         idtxt_navstats_sb_off.style.display= "none";
  667.         idtxt_navstats_sb_license_corrupted.style.display= "";
  668.         return;
  669.     }
  670.     
  671.     var iSBStatus;
  672.     var bCanEnable;
  673.  
  674.     try
  675.     {
  676.         iSBStatus = g_NAVStatus.ScriptBlockingStatus;
  677.         bCanEnable = g_NAVStatus.ScriptBlockingCanEnable;
  678.     }
  679.     catch (NAVErr)
  680.     {
  681.         g_NAVStatus.NAVError.LogAndDisplay(0);
  682.     }
  683.  
  684.     try
  685.     {
  686.         // Error?
  687.         if ( iSBStatus < g_statusEnabled )
  688.         {
  689.             // Error
  690.             Features[gc_SB].state = gc_Urgent;
  691.             Icons[gc_SB].source = g_strIconUrgent;
  692.             idtxt_navstats_sb_error.style.display= "";
  693.             idtxt_navstats_sb_on.style.display= "none";
  694.             idtxt_navstats_sb_off.style.display= "none";
  695.             Features[gc_SB].buttontext = NoButton;                // No button for error
  696.         }
  697.         else
  698.         {
  699.             if ( iSBStatus == g_statusEnabled )
  700.             {
  701.                 // On
  702.                 //
  703.                 Features[gc_SB].state = gc_OK;
  704.                 Icons[gc_SB].source = g_strIconOK;
  705.                 idtxt_navstats_sb_error.style.display= "none";
  706.                 idtxt_navstats_sb_on.style.display= "";
  707.                 idtxt_navstats_sb_off.style.display= "none";
  708.                 Features[gc_SB].buttontext = NoButton;
  709.             }
  710.             else
  711.             {
  712.                 // Off
  713.                 //
  714.                 Features[gc_SB].state = gc_Warning;
  715.                 Icons[gc_SB].source = g_strIconWarning;
  716.                 idtxt_navstats_sb_error.style.display= "none";
  717.                 idtxt_navstats_sb_on.style.display= "none";
  718.                 idtxt_navstats_sb_off.style.display= "";
  719.  
  720.                 if ( bCanEnable )
  721.                     Features[gc_SB].buttontext = SBButtonOff;
  722.                 else
  723.                     Features[gc_SB].buttontext = NoButton;
  724.             }
  725.         }
  726.     }
  727.     catch (err)
  728.     {
  729.         var msg = document.frames("Errors").document.all.ERR_MSG_SB_STATUS.innerText;
  730.         var id = document.frames("Errors").document.all.ERR_ID_SB_STATUS.innerText;
  731.         g_ErrorHandler.DisplayNAVError (msg, id);
  732.         return;
  733.     }
  734. }
  735.  
  736. function UpdateServiceStatus ()
  737. {    
  738.     idtxt_navstats_us_refreshing.style.display = "none";
  739.     idtxt_navstats_us_numdays.style.display= "none";
  740.     idtxt_navstats_us_expired.style.display= "none";
  741.     idtxt_navstats_us_error.style.display= "none";
  742.     idtxt_navstats_us_notinstalled.style.display= "none";
  743.     idtxt_navstats_us_license_rental_active.style.display = "none";
  744.     idtxt_navstats_us_license_rental_warning.style.display = "none";
  745.     idtxt_navstats_us_license_rental_expired.style.display = "none";
  746.     idtxt_navstats_us_license_rental_killed.style.display = "none";
  747.     idtxt_navstats_us_license_corrupted.style.display = "none";
  748.     
  749.     USTitleOK.style.display = "none";
  750.     USTitleLicenseRetail.style.display = "none";
  751.     USTitleLicenseRetailExpired.style.display = "none";
  752.     USTitleLicenseTrialware.style.display = "none";
  753.     USTitleLicenseTrialwareExpired.style.display = "none";
  754.     USTitleLicenseRental.style.display = "none";
  755.     USTitleNAV.style.display = "none";
  756.     
  757.     Features[gc_US].detailsbody = HintTableUSOK_cell4;
  758.     
  759.     Features[gc_US].state = gc_Urgent;
  760.     Icons[gc_US].source = g_strIconUrgent;
  761.  
  762.     switch(g_ProductStatus)
  763.     {    
  764.     case STATUS_RETAIL_PREACTIVE:
  765.         {
  766.             SetServiceStatus(gc_Warning, g_strIconWarning, USTitleLicenseRetail, idtxt_navstats_us_numdays, USHintTextRetailPreactive, USButtonRetailPreactive);
  767.             
  768.             try
  769.             {
  770.                 var strDate = g_NAVLicense.LicenseExpirationDate;                
  771.                 idtxt_navstats_us_numdays.innerText = strDate;            
  772.                 LicenseDateRetail.innerText = strDate;
  773.                 Features[gc_US].detailsbody = HintTableUSRetailPreactive_cell4;
  774.             }
  775.             catch(err)
  776.             {
  777.                 g_NAVLicense.NAVError.LogAndDisplay(0);
  778.             }            
  779.         }
  780.         break;
  781.  
  782.     case STATUS_RETAIL_EXPIRED:
  783.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleLicenseRetailExpired, idtxt_navstats_us_expired, USHintTextRetailExpired, USButtonRetailExpired);
  784.         Features[gc_US].detailsbody = HintTableUSRetailExpired_cell4;
  785.         break;
  786.         
  787.     case STATUS_RETAIL_ACTIVE:
  788.         {
  789.             // Retail/Trialware Purchased
  790.             //
  791.         
  792.             // Is the sub info OK?
  793.             //
  794.             var lSubState;
  795.             var lSubStatus;
  796.             var strDate;
  797.         
  798.             try
  799.             {
  800.                 lSubState = g_NAVStatus.VirusDefSubState;
  801.                 lSubStatus = g_NAVStatus.VirusDefSubStatus;
  802.                 strDate = g_NAVStatus.VirusDefSubDate;
  803.             }
  804.             catch (NAVErr)
  805.             {
  806.                 g_NAVStatus.NAVError.LogAndDisplay(0);
  807.             }
  808.         
  809.             try
  810.             {
  811.                 USTitleOK.style.display = "";
  812.         
  813.                 // SUB_UNKNOWN = 0
  814.                 // SUB_OK = 1
  815.                 // SUB_WARNING = 2
  816.                 // SUB_EXPIRED = 3
  817.         
  818.                 if ( lSubStatus > g_statusNotRunning && lSubState != 0 )
  819.                 {
  820.                     // Expired?
  821.                     //
  822.                     if ( lSubState == 3 )
  823.                     {
  824.                         Features[gc_US].state = gc_Urgent;
  825.                         Icons[gc_US].source = g_strIconUrgent;
  826.                         idtxt_navstats_us_expired.style.display= "";
  827.         
  828.                         try
  829.                         {
  830.                             if ( g_NAVLicense.CanRenewSubscription )
  831.                                 Features[gc_US].buttontext = USButtonRenewExpired;
  832.                             else
  833.                                 Features[gc_US].buttontext = NoButton;
  834.                         }
  835.                         catch (NAVErr)
  836.                         {
  837.                             g_Launcher.NAVError.LogAndDisplay(0);
  838.                         }
  839.         
  840.                         Features[gc_US].detailstext = USHintTextExpired;
  841.                         Features[gc_US].detailsbody = HintTableUSExpired_cell4;
  842.                     }
  843.                     else
  844.                     {
  845.                         if ( lSubState == 2 )
  846.                         {
  847.                             // Warning
  848.                             //
  849.                             Features[gc_US].state = gc_Warning;
  850.                             Icons[gc_US].source = g_strIconWarning;
  851.         
  852.                             var numberExp = /#/gi;    // Replace all #'s - regular expression
  853.         
  854.                             var strNewText = idtxt_navstats_us_hint_expires.innerText;
  855.                             idtxt_navstats_us_hint_expires.innerText = strNewText.replace ( numberExp , strDate );
  856.         
  857.                             try
  858.                             {
  859.                                 if ( g_Launcher.CanLaunchLiveUpdate )
  860.                                     Features[gc_US].buttontext = USButtonRenewWarning;
  861.                                 else
  862.                                     Features[gc_US].buttontext = NoButton;
  863.                             }
  864.                             catch (NAVErr)
  865.                             {
  866.                                 g_Launcher.NAVError.LogAndDisplay(0);
  867.                             }
  868.     
  869.                             Features[gc_US].detailstext = USHintTextOld;
  870.                             Features[gc_US].detailsbody = HintTableUSOld_cell4;
  871.                         }
  872.                         else
  873.                         {
  874.                             // OK
  875.                             //
  876.                             Features[gc_US].state = gc_OK;
  877.                             Icons[gc_US].source = g_strIconOK;
  878.                             
  879.                             // Add "Renew" button to allow
  880.                             //  renew on demand.
  881.                             try
  882.                             {
  883.                                 if(g_NAVStatus.VirusDefSubDaysLeft <= 366)
  884.                                 {
  885.                                     if ( g_Launcher.CanLaunchLiveUpdate )
  886.                                         Features[gc_US].buttontext = USButtonRenew;
  887.                                     else
  888.                                         Features[gc_US].buttontext = NoButton;
  889.                                 }
  890.                                 else
  891.                                 {
  892.                                     Features[gc_US].buttontext = NoButton;
  893.                                 }
  894.                                     
  895.                             }
  896.                             catch (NAVErr)
  897.                             {
  898.                                 g_Launcher.NAVError.LogAndDisplay(0);
  899.                             }
  900.  
  901.                             Features[gc_US].detailstext = USHintText;
  902.                         }
  903.         
  904.                         // Put in the # days left
  905.                         //
  906.                         idtxt_navstats_us_numdays.innerText = strDate
  907.                         idtxt_navstats_us_numdays.style.display = "";
  908.                     }
  909.                 }
  910.                 else
  911.                 {
  912.                     // Errors
  913.                     //
  914.                     Features[gc_US].buttontext = NoButton;
  915.                     Features[gc_US].detailstext = USHintText;
  916.         
  917.                     if ( lSubStatus == g_statusNotInstalled )
  918.                     {
  919.                         idtxt_navstats_us_notinstalled.style.display = "";
  920.                     }
  921.                     else
  922.                     {
  923.                         idtxt_navstats_us_error.style.display = "";
  924.                     }
  925.         
  926.                     Features[gc_US].state = gc_Urgent;
  927.                 }
  928.             }
  929.             catch (err)
  930.             {
  931.                 var msg = document.frames("Errors").document.all.ERR_MSG_SUB_STATUS.innerText;
  932.                 var id = document.frames("Errors").document.all.ERR_ID_SUB_STATUS.innerText;
  933.                 g_ErrorHandler.DisplayNAVError (msg, id);
  934.                 return;
  935.             }
  936.  
  937.             // Suppress renew button for public beta.            
  938.             if(g_NAVStatus.ProductLicenseType == DJSMAR_LicenseType_Beta)
  939.             {        
  940.                 USButtonRenew.style.display = "none";
  941.                 USButtonRenewWarning.style.display = "none";
  942.                 USButtonRenewExpired.style.display = "none";
  943.             }
  944.         }
  945.         break;
  946.         
  947.     case STATUS_TRIALWARE_ACTIVE:
  948.         {
  949.             SetServiceStatus(gc_Warning, g_strIconWarning, USTitleLicenseTrialware, idtxt_navstats_us_numdays, USHintTextTrialwareActive, USButtonTrialwareActive);
  950.             
  951.             try
  952.             {
  953.                 var strDate = g_NAVLicense.LicenseExpirationDate;
  954.                 idtxt_navstats_us_numdays.innerText = strDate;
  955.                 LicenseDateTryBuy.innerText = strDate;
  956.                 Features[gc_US].detailsbody = HintTableUSTrialwareActive_cell4;
  957.             }
  958.             catch(err)
  959.             {
  960.                 g_NAVLicense.NAVError.LogAndDisplay(0);
  961.             }            
  962.         }
  963.         break;
  964.  
  965.     case STATUS_TRIALWARE_EXPIRED:
  966.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleLicenseTrialwareExpired, idtxt_navstats_us_expired, USHintTextTrialwareExpired, USButtonTrialwareExpired);
  967.         Features[gc_US].detailsbody = HintTableUSTrialwareExpired_cell4;
  968.         break;
  969.  
  970.     case STATUS_TRYDIE_ACTIVE:
  971.         {
  972.             SetServiceStatus(gc_Warning, g_strIconWarning, USTitleLicenseTrialwareExpired, idtxt_navstats_us_numdays, USHintTextTryDieActive, NoButton);
  973.             
  974.             try
  975.             {
  976.                 var strDate = g_NAVLicense.LicenseExpirationDate;
  977.                 idtxt_navstats_us_numdays.innerText = strDate;
  978.                 LicenseDateTryDie.innerText = strDate;
  979.                 Features[gc_US].detailsbody = HintTableUSTryDieActive_cell4;
  980.             }
  981.             catch(err)
  982.             {
  983.                 g_NAVLicense.NAVError.LogAndDisplay(0);
  984.             }            
  985.         }
  986.         break;
  987.  
  988.     case STATUS_TRYDIE_EXPIRED:
  989.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleLicenseTrialwareExpired, idtxt_navstats_us_expired, USHintTextTryDieExpired, NoButton);
  990.         Features[gc_US].detailsbody = HintTableUSTryDieExpired_cell4;
  991.         break;
  992.  
  993.         
  994.     case STATUS_RENTAL_TRIAL:
  995.         {            
  996.             SetServiceStatus(gc_OK, g_strIconOK, USTitleLicenseRental, idtxt_navstats_us_license_rental_active, USHintTextRentalTrial, USButtonRentalTrial);
  997.             Features[gc_US].detailsbody = HintTableUSRentalTrial_cell4;
  998.             
  999.             try
  1000.             {
  1001.                 var daysLeft = g_NAVLicense.LicenseDaysRemaining;
  1002.                 RentalTrialwareDaysLeft.innerText = daysLeft;    
  1003.             }
  1004.             catch(err)
  1005.             {
  1006.                 g_NAVLicense.NAVError.LogAndDisplay(0);
  1007.             }
  1008.         }            
  1009.         break;
  1010.         
  1011.     case STATUS_RENTAL_TRIAL_EXPIRED:
  1012.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleLicenseRental, idtxt_navstats_us_expired, USHintTextRentalTrialExpired, USButtonRentalTrialExpired);
  1013.         Features[gc_US].detailsbody = HintTableUSRentalTrialExpired_cell4;
  1014.         break;
  1015.             
  1016.     case STATUS_RENTAL_ACTIVE: 
  1017.         SetServiceStatus(gc_OK, g_strIconOK, USTitleLicenseRental, idtxt_navstats_us_license_rental_active, USHintTextRentalActive, NoButton);
  1018.         Features[gc_US].detailsbody = HintTableUSRentalActive_cell4;
  1019.         break;
  1020.         
  1021.     case STATUS_RENTAL_WARNING:
  1022.         SetServiceStatus(gc_Warning, g_strIconWarning, USTitleLicenseRental, idtxt_navstats_us_license_rental_warning, USHintTextRentalWarning, USButtonRentalWarning);
  1023.         Features[gc_US].detailsbody = HintTableUSRentalWarning_cell4;
  1024.         break;
  1025.     
  1026.     case STATUS_RENTAL_EXPIRED:
  1027.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleLicenseRental, idtxt_navstats_us_license_rental_expired, USHintTextRentalExpired, USButtonRentalExpired);    
  1028.         Features[gc_US].detailsbody = HintTableUSRentalExpired_cell4;
  1029.         break;
  1030.         
  1031.     case STATUS_RENTAL_KILLED:
  1032.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleLicenseRental, idtxt_navstats_us_license_rental_killed, USHintTextRentalKilled, USButtonRentalKilled);
  1033.         Features[gc_US].detailsbody = HintTableUSRentalKilled_cell4;
  1034.         break;        
  1035.                 
  1036.     case STATUS_CORRUPTED:
  1037.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleNAV, idtxt_navstats_us_license_corrupted, USHintTextLicenseCorrupted, NoButton);
  1038.         Features[gc_US].detailsbody = HintTableUSLicenseCorrupted_cell4;
  1039.         break;
  1040.         
  1041.     case STATUS_ERROR:
  1042.         SetServiceStatus(gc_Urgent, g_strIconUrgent, USTitleLicenseRetailExpired, idtxt_navstats_us_error, USHintTextLicenseError, NoButton);
  1043.         Features[gc_US].detailsbody = HintTableUSLicenseError_cell4
  1044.         break;
  1045.         
  1046.     default:
  1047.         break;
  1048.     }
  1049. }
  1050.  
  1051. function UpdateVirusDefStatus ()
  1052. {
  1053.     // Hide the "Refreshing" text.
  1054.     //
  1055.     idtxt_navstats_vp_refreshing.style.display = "none";
  1056.     idtxt_navstats_vp_license_corrupted.style.display= "none";
  1057.     Features[gc_VirusDef].detailsbody = idtxt_navstats_virusdef_ok;
  1058.  
  1059.     if(g_NAVStatus.ProductLicenseState == DJSMAR00_LicenseState_Violated)
  1060.     {
  1061.         // corrupted
  1062.         //
  1063.         Features[gc_VirusDef].state = gc_Urgent;
  1064.         Features[gc_VirusDef].detailstext = VirusDefHintText;
  1065.         Features[gc_VirusDef].buttontext = NoButton;
  1066.         Icons[gc_VirusDef].source = g_strIconUrgent;
  1067.         
  1068.         idtxt_navstats_vp_updating.style.display = "none";
  1069.         idtxt_navstats_vp_error.style.display= "none";
  1070.         idtxt_navstats_vp_date.style.display= "none";
  1071.         idtxt_navstats_vp_license_corrupted.style.display= "";
  1072.         
  1073.         return;
  1074.     }
  1075.  
  1076.     var iVirusDefStatus;
  1077.     var defsAge;
  1078.  
  1079.     try
  1080.     {
  1081.         iVirusDefStatus = g_NAVStatus.VirusDefStatus;
  1082.  
  1083.         // Get the defs age in days
  1084.         //
  1085.         defsAge = g_NAVStatus.VirusDefAge;
  1086.     }
  1087.     catch (NAVErr)
  1088.     {
  1089.         g_NAVStatus.NAVError.LogAndDisplay(0);
  1090.     }
  1091.  
  1092.     try
  1093.     {
  1094.         Features[gc_VirusDef].detailstext = VirusDefHintTextOld; // Default to "out of date" text
  1095.         Features[gc_VirusDef].detailsbody = idtxt_navstats_virusdef_old;
  1096.  
  1097.         switch ( iVirusDefStatus )
  1098.         {
  1099.             case g_statusEnabled :
  1100.  
  1101.                 // Display defs date (it's already formatted for region by the Status object, so we don't have to)
  1102.                 //
  1103.                 idtxt_navstats_vp_date.innerText = g_NAVStatus.VirusDefDate;
  1104.                 idtxt_navstats_vp_error.style.display= "none";
  1105.                 idtxt_navstats_vp_date.style.display= "";
  1106.                 idtxt_navstats_vp_updating.style.display = "none";
  1107.  
  1108.                 // Make sure defs are no more than a month old.
  1109.                 //
  1110.                 if( defsAge > g_iVirusDefOldThreshold )
  1111.                 {
  1112.                     // Defs are stale
  1113.                     //
  1114.                     Icons[gc_VirusDef].source = g_strIconWarning;
  1115.                     Features[gc_VirusDef].state = gc_Warning;
  1116.                     
  1117.                     // Defs are really stale
  1118.                     if ( defsAge > g_iVirusDefReallyOldThreshold )
  1119.                     {
  1120.                         Icons[gc_VirusDef].source = g_strIconUrgent;
  1121.                         Features[gc_VirusDef].state = gc_Urgent;
  1122.                     }
  1123.  
  1124.                     try
  1125.                     {
  1126.                         Features[gc_VirusDef].buttontext = VirusDefButtonUpdate;
  1127.                     }
  1128.                     catch (NAVErr)
  1129.                     {
  1130.                         g_Launcher.NAVError.LogAndDisplay(0);
  1131.                     }
  1132.                 }
  1133.                 else
  1134.                 {
  1135.                     // Defs are good
  1136.                     //
  1137.                     Icons[gc_VirusDef].source = g_strIconOK;
  1138.                     Features[gc_VirusDef].state = gc_OK;
  1139.                     Features[gc_VirusDef].buttontext = NoButton;    // no button
  1140.                     Features[gc_VirusDef].detailstext = VirusDefHintText;
  1141.                 }
  1142.  
  1143.             break;
  1144.  
  1145.             case g_statusNotAvailable :
  1146.                 Features[gc_VirusDef].state = gc_OK;
  1147.                 Icons[gc_VirusDef].source = g_strIconOK;
  1148.                 idtxt_navstats_vp_updating.style.display = "";
  1149.                 idtxt_navstats_vp_error.style.display= "none";
  1150.                 idtxt_navstats_vp_date.style.display= "none";
  1151.                 Features[gc_VirusDef].buttontext = NoButton;    // no button
  1152.             break;
  1153.  
  1154.             // Error
  1155.             //
  1156.             default :
  1157.                 Features[gc_VirusDef].state = gc_Urgent;
  1158.                 Icons[gc_VirusDef].source = g_strIconUrgent;
  1159.                 idtxt_navstats_vp_updating.style.display = "none";
  1160.                 idtxt_navstats_vp_error.style.display= "";
  1161.                 idtxt_navstats_vp_date.style.display= "none";
  1162.                 idtxt_navstats_vp_error.style.display ="";
  1163.  
  1164.                 try
  1165.                 {
  1166.                     Features[gc_VirusDef].buttontext = VirusDefButtonUpdate;
  1167.                 }
  1168.                 catch (NAVErr)
  1169.                 {
  1170.                     g_Launcher.NAVError.LogAndDisplay(0);
  1171.                 }
  1172.             break;
  1173.         }
  1174.     }
  1175.     catch (err)
  1176.     {
  1177.         var msg = document.frames("Errors").document.all.ERR_MSG_VIRUSDEF_STATUS.innerText;
  1178.         var id = document.frames("Errors").document.all.ERR_ID_VIRUSDEF_STATUS.innerText;
  1179.         g_ErrorHandler.DisplayNAVError (msg, id);
  1180.         return;
  1181.     }
  1182. }
  1183.  
  1184.  
  1185. function UpdateAPStatus()
  1186. {
  1187.     // Turn off Refreshing text
  1188.     //
  1189.     idtxt_navstats_rts_refreshing.style.display = "none";
  1190.     idtxt_navstats_rts_license_corrupted.style.display = "none";
  1191.  
  1192.     Features[gc_AP].detailstext = APHintText;
  1193.     Features[gc_AP].detailsbody = idtxt_navstats_rts_tablebody;
  1194.  
  1195.     if(g_NAVStatus.ProductLicenseState == DJSMAR00_LicenseState_Violated)
  1196.     {
  1197.         // corrupted
  1198.         //
  1199.         Icons[gc_AP].source  = g_strIconUrgent;
  1200.         Features[gc_AP].state = gc_Urgent;
  1201.         Features[gc_AP].buttontext = NoButton;
  1202.  
  1203.         idtxt_navstats_rts_on.style.display = "none";
  1204.         idtxt_navstats_rts_off.style.display = "none";
  1205.         idtxt_navstats_rts_notrunning.style.display = "none";
  1206.         idtxt_navstats_rts_error.style.display = "none";
  1207.            idtxt_navstats_rts_license_corrupted.style.display = "";
  1208.            return;
  1209.     }
  1210.  
  1211.     var iAPStatus;
  1212.     var bCanEnable;
  1213.  
  1214.     try
  1215.     {
  1216.         iAPStatus = g_NAVStatus.APStatus;
  1217.         bCanEnable = g_NAVStatus.APCanEnable;
  1218.     }
  1219.     catch (NAVErr)
  1220.     {
  1221.         g_NAVStatus.NAVError.LogAndDisplay(0);
  1222.     }
  1223.  
  1224.     try
  1225.     {
  1226.         switch ( iAPStatus )
  1227.         {
  1228.             case g_statusEnabled :
  1229.  
  1230.                 // Enabled
  1231.                 //
  1232.                 Icons[gc_AP].source = g_strIconOK;
  1233.                 idtxt_navstats_rts_on.style.display = "";
  1234.                 idtxt_navstats_rts_off.style.display = "none";
  1235.                 idtxt_navstats_rts_notrunning.style.display = "none";
  1236.                 idtxt_navstats_rts_error.style.display = "none";
  1237.                 Features[gc_AP].state = gc_OK;
  1238.                 Features[gc_AP].buttontext = NoButton;
  1239.                 break;
  1240.  
  1241.             case g_statusDisabled :
  1242.  
  1243.                 // Disabled
  1244.                 //
  1245.                 Icons[gc_AP].source = g_strIconWarning;
  1246.                 idtxt_navstats_rts_on.style.display = "none";
  1247.                 idtxt_navstats_rts_off.style.display = "";
  1248.                 idtxt_navstats_rts_notrunning.style.display = "none";
  1249.                 idtxt_navstats_rts_error.style.display = "none";
  1250.                 Features[gc_AP].state = gc_Warning;
  1251.  
  1252.                 if ( bCanEnable )
  1253.                     Features[gc_AP].buttontext = APButtonOff;
  1254.                 else
  1255.                     Features[gc_AP].buttontext = NoButton;
  1256.                 break;
  1257.  
  1258.             case g_statusNotRunning :
  1259.  
  1260.                 // Not Running
  1261.                 //
  1262.                 Icons[gc_AP].source = g_strIconWarning;
  1263.                 idtxt_navstats_rts_on.style.display = "none";
  1264.                 idtxt_navstats_rts_off.style.display = "none";
  1265.                 idtxt_navstats_rts_notrunning.style.display = "";
  1266.                 idtxt_navstats_rts_error.style.display = "none";
  1267.                 Features[gc_AP].state = gc_Warning;
  1268.                 Features[gc_AP].detailstext = APHintTextNotRunning;
  1269.                 Features[gc_AP].detailsbody = idtxt_navstats_rts_tablebody2;                
  1270.  
  1271.                 if ( bCanEnable )
  1272.                     Features[gc_AP].buttontext = APButtonLoad;
  1273.                 else
  1274.                     Features[gc_AP].buttontext = NoButton;
  1275.  
  1276.                 break;
  1277.  
  1278.             default :
  1279.  
  1280.                 // Error
  1281.                 //
  1282.                 Icons[gc_AP].source  = g_strIconUrgent;
  1283.                 idtxt_navstats_rts_on.style.display = "none";
  1284.                 idtxt_navstats_rts_off.style.display = "none";
  1285.                 idtxt_navstats_rts_notrunning.style.display = "none";
  1286.                 idtxt_navstats_rts_error.style.display = "";
  1287.                 Features[gc_AP].state = gc_Urgent;
  1288.                 Features[gc_AP].buttontext = NoButton
  1289.                 break;
  1290.         }
  1291.     }
  1292.     catch (err)
  1293.     {
  1294.         var msg = document.frames("Errors").document.all.ERR_MSG_AP_STATUS.innerText;
  1295.         var id = document.frames("Errors").document.all.ERR_ID_AP_STATUS.innerText;
  1296.         g_ErrorHandler.DisplayNAVError (msg, id);
  1297.         return;
  1298.     }
  1299. }
  1300.  
  1301. function UpdateALUStatus ()
  1302. {
  1303.     idtxt_navstats_alu_refreshing.style.display="none";
  1304.     idtxt_navstats_alu_license_corrupted.style.display="none";
  1305.  
  1306.     Features[gc_ALU].detailstext = ALUHintText;
  1307.     Features[gc_ALU].detailsbody = HintTableALU_cell4;
  1308.     
  1309.     if(g_NAVStatus.ProductLicenseState == DJSMAR00_LicenseState_Violated)
  1310.     {
  1311.         // corrupted
  1312.         //
  1313.         Features[gc_ALU].state = gc_Urgent;
  1314.         Features[gc_ALU].buttontext = NoButton;
  1315.         Icons[gc_ALU].source = g_strIconUrgent;
  1316.  
  1317.         idtxt_navstats_alu_on.style.display="none";
  1318.         idtxt_navstats_alu_off.style.display="none";
  1319.         idtxt_navstats_alu_error.style.display="none";
  1320.         idtxt_navstats_alu_license_corrupted.style.display="";
  1321.         
  1322.         return;
  1323.     }
  1324.  
  1325.     var iALUStatus;
  1326.     var bCanEnable;
  1327.  
  1328.     try
  1329.     {
  1330.         iALUStatus = g_NAVStatus.ALUStatus;
  1331.         bCanEnable = g_NAVStatus.ALUCanEnable;
  1332.     }
  1333.     catch (NAVErr)
  1334.     {
  1335.         g_NAVStatus.NAVError.LogAndDisplay(0);
  1336.     }
  1337.  
  1338.     try
  1339.     {
  1340.         switch ( iALUStatus )
  1341.         {
  1342.             case g_statusEnabled :
  1343.             // On
  1344.             //
  1345.             Icons[gc_ALU].source = g_strIconOK;
  1346.             idtxt_navstats_alu_on.style.display="";
  1347.             idtxt_navstats_alu_off.style.display="none";
  1348.             idtxt_navstats_alu_error.style.display="none";
  1349.             Features[gc_ALU].state = gc_OK;
  1350.             Features[gc_ALU].buttontext = NoButton;
  1351.             break;
  1352.  
  1353.             case g_statusDisabled :
  1354.             // Off
  1355.             //
  1356.             Icons[gc_ALU].source = g_strIconWarning;
  1357.             idtxt_navstats_alu_on.style.display="none";
  1358.             idtxt_navstats_alu_off.style.display="";
  1359.             idtxt_navstats_alu_error.style.display="none";
  1360.             Features[gc_ALU].state = gc_Warning;
  1361.  
  1362.             if ( bCanEnable )
  1363.                 Features[gc_ALU].buttontext = ALUButtonOff;
  1364.             else
  1365.                 Features[gc_ALU].buttontext = NoButton;
  1366.             break;
  1367.  
  1368.             case g_statusNotAvailable :
  1369.             // Feature not supported (no Task Scheduler)
  1370.             //
  1371.             Icons[gc_ALU].source = g_strIconOK;
  1372.             idtxt_navstats_alu_on.style.display="none";
  1373.             idtxt_navstats_alu_off.style.display="";
  1374.             idtxt_navstats_alu_error.style.display="none";
  1375.             Features[gc_ALU].state = gc_OK;
  1376.             Features[gc_ALU].buttontext = NoButton;
  1377.             break;
  1378.  
  1379.             default :
  1380.             // Error
  1381.             //
  1382.             Icons[gc_ALU].source = g_strIconUrgent;
  1383.             idtxt_navstats_alu_on.style.display="none";
  1384.             idtxt_navstats_alu_off.style.display="none";
  1385.             idtxt_navstats_alu_error.style.display="";
  1386.             Features[gc_ALU].state = gc_Urgent;
  1387.             Features[gc_ALU].buttontext = NoButton;
  1388.             break;
  1389.         }
  1390.     }
  1391.     catch (err)
  1392.     {
  1393.         var msg = document.frames("Errors").document.all.ERR_MSG_ALU_STATUS.innerText;
  1394.         var id = document.frames("Errors").document.all.ERR_ID_ALU_STATUS.innerText;
  1395.         g_ErrorHandler.DisplayNAVError (msg, id);
  1396.         return;
  1397.     }
  1398. }
  1399.  
  1400. function UpdateSystemStatus()
  1401. {
  1402.     var bWarning = false;
  1403.     
  1404.     // Make sure there is nothing urgently wrong.
  1405.     for ( var iIndex = 0; iIndex < Features.length; iIndex++ )
  1406.     {
  1407.         if ( Features[iIndex].state == gc_Urgent )
  1408.         {
  1409.             // There is.
  1410.             AllUrgent.style.display = "";
  1411.             AllWarning.style.display = "none";
  1412.             AllOK.style.display = "none";
  1413.             return;
  1414.         }
  1415.         
  1416.         if ( Features[iIndex].state == gc_Warning )
  1417.             bWarning = true;
  1418.     }
  1419.     
  1420.     // Make sure there are no items in need of attention
  1421.     if ( bWarning )
  1422.     {
  1423.         AllUrgent.style.display = "none";
  1424.         AllWarning.style.display = "";
  1425.         AllOK.style.display = "none";
  1426.         return;
  1427.     }
  1428.     else
  1429.     {
  1430.         // Things must be ok.
  1431.         AllUrgent.style.display = "none";
  1432.         AllWarning.style.display = "none";
  1433.         AllOK.style.display = "";
  1434.     }
  1435. }
  1436.  
  1437. function UpdateIcons ()
  1438. {
  1439.     for ( var iIndex = 0; iIndex < Icons.length ; iIndex++)
  1440.     {
  1441.         var item = document.all(Icons[iIndex].idtag);
  1442.         item.src = Icons[iIndex].source;
  1443.  
  1444.     }
  1445. }
  1446.  
  1447. function onHint( row, itemtext  )
  1448. {
  1449.     if (!g_fReady)
  1450.     {
  1451.         // The page is not availabe for user input yet.  Kill the click.
  1452.         return;
  1453.     }
  1454.  
  1455.     var lasthint;
  1456.     var lastButton;
  1457.  
  1458.     // Is this the first time through?
  1459.     //
  1460.     if ( g_LastItem == 0 )
  1461.     {
  1462.         lasthint = DefaultHintText.id
  1463.         g_LastHintText = document.all(lasthint)
  1464.  
  1465.     }
  1466.     else
  1467.     {
  1468.         // Is it the same one again?
  1469.         //
  1470.         if ( g_LastItem != row )
  1471.             g_LastItem.style.background=""
  1472.  
  1473.         // Hide the old button, if there was one
  1474.         //
  1475.         if ( g_LastButtonText != NoButton )
  1476.         {
  1477.             g_LastButtonText.style.visibility = "hidden";
  1478.         }
  1479.     }
  1480.  
  1481.     // Set hot color
  1482.     row.style.background = g_SelectColor;
  1483.     var iFeature = 0;
  1484.  
  1485.     switch ( itemtext )
  1486.     {
  1487.         case "AP" :
  1488.             iFeature = gc_AP;
  1489.             if(g_bProductEnabled)
  1490.             {
  1491.                 APButtonOff.disabled = false;
  1492.             }
  1493.             else
  1494.             {
  1495.                 APButtonOff.disabled = true;
  1496.             }
  1497.             break;
  1498.  
  1499.         case "Email" :
  1500.             iFeature = gc_Email;
  1501.             if(g_bProductEnabled)
  1502.             {
  1503.                 EmailButtonOff.disabled = false;
  1504.             }
  1505.             else
  1506.             {
  1507.                 EmailButtonOff.disabled = true;
  1508.             }
  1509.             break;
  1510.  
  1511.         case "SB" :
  1512.             iFeature = gc_SB;
  1513.             if(g_bProductEnabled)
  1514.             {
  1515.                 SBButtonOff.disabled = false;
  1516.             }
  1517.             else
  1518.             {
  1519.                 SBButtonOff.disabled = true;
  1520.             }
  1521.             break;
  1522.  
  1523.         case "FSS" :
  1524.             iFeature = gc_FSS;
  1525.  
  1526.             if(g_bProductEnabled)
  1527.             {
  1528.                 FSSButtonScan.disabled = false;
  1529.             }
  1530.             else
  1531.             {
  1532.                 FSSButtonScan.disabled = true;
  1533.             }
  1534.             break;
  1535.  
  1536.         case "VirusDef" :
  1537.             iFeature = gc_VirusDef;
  1538.             break;
  1539.  
  1540.         case "ALU" :
  1541.             iFeature = gc_ALU;
  1542.             break;
  1543.  
  1544.         case "US" :
  1545.             iFeature = gc_US;        
  1546.             break;
  1547.     }
  1548.  
  1549.     lasthint = Features[iFeature].detailstext.id;
  1550.     lastButton    = Features[iFeature].buttontext.id;
  1551.     
  1552.     if ( Features[iFeature].state == gc_Urgent )
  1553.         Features[iFeature].detailsbody.style.color = "Red";
  1554.     else
  1555.         Features[iFeature].detailsbody.style.color = "Black";
  1556.  
  1557.     // Hide old text, if this isn't a click on the same item
  1558.     //
  1559.     if ( g_LastHintText != document.all(lasthint))
  1560.     {
  1561.         g_LastHintText.style.display = "none";
  1562.  
  1563.         // Show the new one
  1564.         //
  1565.         g_LastHintText = document.all(lasthint);
  1566.         g_LastHintText.style.display = "";
  1567.     }
  1568.  
  1569.     g_LastButtonText = document.all(lastButton);
  1570.  
  1571.     // Show the new button
  1572.     //
  1573.     g_LastButtonText.style.visibility = "inherit";
  1574.  
  1575.     g_LastHintID = itemtext;
  1576.     g_LastItem = row;
  1577.     g_LastID = itemtext;
  1578.  
  1579.     UpdateIcons ();
  1580. }
  1581.  
  1582. function ScanMyComputerDelay()
  1583. {
  1584.     // Let the scan now button be pressed again.
  1585.     g_fStartingScan = false;
  1586. }
  1587.  
  1588. function ButtonClick ()
  1589. {
  1590.     if (!g_fReady)
  1591.     {
  1592.         // The page is not availabe for user input yet.  Kill the click.
  1593.         return;
  1594.     }
  1595.  
  1596.     switch ( g_LastButtonText )
  1597.     {
  1598.     case APButtonOff :
  1599.         // Disabled
  1600.         //
  1601.         try
  1602.         {
  1603.             g_AP.Enabled = 1;
  1604.         }
  1605.         catch (NAVErr)
  1606.         {
  1607.             g_AP.NAVError.LogAndDisplay(0);
  1608.         }
  1609.         break;
  1610.  
  1611.     case APButtonLoad :
  1612.         // Not loaded
  1613.         //
  1614.         try
  1615.         {
  1616.             g_AP.Load ();
  1617.         }
  1618.         catch (NAVErr)
  1619.         {
  1620.             g_AP.NAVError.LogAndDisplay(0);
  1621.         }
  1622.         break;
  1623.  
  1624.     case EmailButtonOff :
  1625.         try
  1626.         {
  1627.             delete g_Options;
  1628.             CreateOptions ();
  1629.             if ( g_Options != null )
  1630.             {
  1631.                 g_Options.Load ();
  1632.                 g_Options.NAVEMAIL.ScanOutgoing = 1;
  1633.                 g_Options.NAVEMAIL.ScanIncoming = 1;
  1634.                 g_Options.Save ();
  1635.             }
  1636.         }
  1637.         catch (NAVErr)
  1638.         {
  1639.             g_Options.NAVError.LogAndDisplay(0);
  1640.         }
  1641.         break;
  1642.  
  1643.     case SBButtonOff :
  1644.         try
  1645.         {
  1646.             delete g_Options;
  1647.             CreateOptions ();
  1648.             if ( g_Options != null )
  1649.             {
  1650.                 g_Options.Load ();
  1651.                 g_Options.SCRIPTBLOCKING.Enabled = 1;
  1652.                 g_Options.Save ();
  1653.             }
  1654.         }
  1655.         catch (NAVErr)
  1656.         {
  1657.             g_Options.NAVError.LogAndDisplay(0);
  1658.         }
  1659.         break;
  1660.  
  1661.     case FSSButtonScan :
  1662.         if (!g_fStartingScan)
  1663.         {
  1664.             // Disable the button for until our timeout happens.
  1665.             // This prevents people from clicking the button again and
  1666.             // launching another scan.  It's not perfect but it deters
  1667.             // the customer from pressing it again for a bit.
  1668.             g_fStartingScan = true;
  1669.  
  1670.             try
  1671.             {
  1672.                 if ( typeof (g_NAVScanTasks) == 'undefined' )
  1673.                     g_NAVScanTasks = new ActiveXObject ( g_strScanTasksInterface );
  1674.             }
  1675.             catch (err)
  1676.             {
  1677.                 var msg = document.frames("Errors").document.all.ERR_MSG_NO_NAVTASKS.innerText;
  1678.                 var id = document.frames("Errors").document.all.ERR_ID_NO_NAVTASKS.innerText;
  1679.                 g_ErrorHandler.DisplayNAVError (msg, id);
  1680.                 return;
  1681.             }
  1682.  
  1683.             try
  1684.             {
  1685.                 g_NAVScanTasks.ScanMyComputer ();
  1686.             }
  1687.             catch (NAVErr)
  1688.             {
  1689.                 g_NAVScanTasks.NAVError.LogAndDisplay(0);
  1690.             }
  1691.             window.setTimeout("ScanMyComputerDelay()",5000)
  1692.         }
  1693.         break;
  1694.  
  1695.     case VirusDefButtonUpdate :
  1696.         try
  1697.         {
  1698.             g_Launcher.LaunchLiveUpdate ();
  1699.         }
  1700.         catch (NAVErr)
  1701.         {
  1702.             g_Launcher.NAVError.LogAndDisplay(0);
  1703.         }
  1704.         break;
  1705.  
  1706.     case ALUButtonOff :
  1707.         try
  1708.         {
  1709.             if ( g_Options != null)
  1710.             {
  1711.                 g_Options.Load ();
  1712.                 g_Options.LiveUpdate = 1;
  1713.                 g_Options.Save ();
  1714.             }
  1715.         }
  1716.         catch (NAVErr)
  1717.         {
  1718.             g_Options.NAVError.LogAndDisplay(0);
  1719.         }
  1720.         break;
  1721.  
  1722.     case USButtonRenew :
  1723.     case USButtonRenewWarning :
  1724.     case USButtonRenewExpired :
  1725.         try
  1726.         {
  1727.             g_Launcher.LaunchSubscriptionWizard ();
  1728.         }
  1729.         catch (NAVErr)
  1730.         {
  1731.             g_Launcher.NAVError.LogAndDisplay(0);
  1732.         }
  1733.         break;
  1734.  
  1735.     case USButtonRetailPreactive:
  1736.     case USButtonRetailExpired:
  1737.     case USButtonTrialwareActive:
  1738.     case USButtonTrialwareExpired:
  1739.     case USButtonRentalTrial:
  1740.     case USButtonRentalTrialExpired:    
  1741.     case USButtonRentalWarning:
  1742.     case USButtonRentalExpired:
  1743.     case USButtonRentalExpiredSS:
  1744.     case USButtonRentalKilled:
  1745.         {            
  1746.             try
  1747.             {
  1748.                 var HWNDPARENT_FIND = 1; // Ask NAVlicense to find the parent window, which is the integrator.
  1749.                 var SYMALERT_RESULT_RESOLVELICENSE = 1; // Pass parameter "User selects 'activate license'" to ActWiz.
  1750.                 g_NAVLicense.LaunchActivationWizardEx(0, SYMALERT_RESULT_RESOLVELICENSE, HWNDPARENT_FIND);
  1751.             }
  1752.             catch (err)
  1753.             {
  1754.                 g_NAVLicense.NAVError.LogAndDisplay(0);
  1755.             }
  1756.         }
  1757.         break;
  1758.     }
  1759. }
  1760.  
  1761. function MoreInfo ( dwHelpID )
  1762. {
  1763.     if (!g_fReady)
  1764.     {
  1765.         // The page is not availabe for user input yet.  Kill the click.
  1766.         return;
  1767.     }
  1768.  
  1769.     try
  1770.     {
  1771.         g_Launcher.LaunchHelp ( dwHelpID );
  1772.     }
  1773.     catch (NAVErr)
  1774.     {
  1775.         g_Launcher.NAVError.LogAndDisplay(0);
  1776.     }
  1777. }
  1778.  
  1779. function HotText (row)
  1780. {
  1781.     // Set cold color
  1782.     if( row != null )
  1783.     {
  1784.         g_LastHotColor = row.style.color;
  1785.         // Set hot color
  1786.         row.style.textDecorationUnderline = 1
  1787.         row.style.color="Blue";
  1788.     }
  1789. }
  1790.  
  1791. function onMouseOut( row )
  1792. {
  1793.     // Set cold color
  1794.     if( row != null )
  1795.     {
  1796.         row.style.textDecorationNone = 1
  1797.         row.style.color=g_LastHotColor;
  1798.         //row.style.fontWeight="normal";
  1799.     }
  1800.  
  1801. }
  1802.  
  1803. function AllError ()
  1804. {
  1805.     for ( var iIndex = 0; iIndex < Features.length; iIndex ++ )
  1806.     {
  1807.         Features[iIndex].state = gc_Urgent;
  1808.     }
  1809.  
  1810.     idtxt_navstats_rts_refreshing.style.display= "none";
  1811.     idtxt_navstats_rts_error.style.display= "";
  1812.  
  1813.     idtxt_navstats_email_refreshing.style.display= "none";
  1814.     idtxt_navstats_email_error.style.display= "";
  1815.  
  1816.     idtxt_navstats_sb_refreshing.style.display= "none";
  1817.     idtxt_navstats_sb_error.style.display= "";
  1818.  
  1819.     idtxt_navstats_fss_refreshing.style.display= "none";
  1820.     idtxt_navstats_fss_notrun.style.display= "";
  1821.  
  1822.     idtxt_navstats_vp_refreshing.style.display= "none";
  1823.     idtxt_navstats_vp_error.style.display= "";
  1824.  
  1825.     idtxt_navstats_us_refreshing.style.display= "none";
  1826.     idtxt_navstats_us_error.style.display= "";
  1827.  
  1828.     idtxt_navstats_alu_refreshing.style.display= "none";
  1829.     idtxt_navstats_alu_error.style.display= "";
  1830.  
  1831.     UpdateSystemStatus ();
  1832. }
  1833.  
  1834. function UpdateProductStatus()
  1835. {
  1836.     g_ProductStatus = STATUS_ERROR;
  1837.     var nZone = g_NAVStatus.ProductLicenseZone;    
  1838.     
  1839.     var bViolated = ((nZone & DJSMAR_LicenseZone_Violated) == DJSMAR_LicenseZone_Violated);
  1840.     var bPreactivation = ((nZone & DJSMAR_LicenseZone_PreActivation) == DJSMAR_LicenseZone_PreActivation);
  1841.     var bKilled    = ((nZone & DJSMAR_LicenseZone_Killed) == DJSMAR_LicenseZone_Killed);
  1842.     var bExpired = ((nZone & DJSMAR_LicenseZone_Expired) == DJSMAR_LicenseZone_Expired);             
  1843.     var bWarning = ((nZone & DJSMAR_LicenseZone_Warning) == DJSMAR_LicenseZone_Warning) || ((nZone & DJSMAR_LicenseZone_Trial) == DJSMAR_LicenseZone_Trial);
  1844.     
  1845.     g_bProductEnabled = true;
  1846.     
  1847.     if(bExpired || bViolated || bKilled)
  1848.     {
  1849.         g_bProductEnabled = false;
  1850.     }
  1851.  
  1852.     if(bViolated)
  1853.     {
  1854.         g_ProductStatus = STATUS_CORRUPTED;
  1855.         return;
  1856.     }
  1857.     
  1858.     if(bPreactivation)
  1859.     {
  1860.            switch(g_NAVStatus.ProductLicenseType)
  1861.            {        
  1862.         case DJSMAR_LicenseType_Retail:
  1863.         case DJSMAR_LicenseType_Unlicensed:
  1864.         case DJSMAR_LicenseType_ESD:
  1865.         case DJSMAR_LicenseType_Beta:
  1866.             {
  1867.                 if(bExpired)
  1868.                 {        
  1869.                     g_ProductStatus = STATUS_RETAIL_EXPIRED;
  1870.                 }
  1871.                 else if(bWarning)
  1872.                 {
  1873.                     g_ProductStatus = STATUS_RETAIL_PREACTIVE;
  1874.                 }
  1875.             }
  1876.             break;
  1877.         
  1878.         case DJSMAR_LicenseType_Trial:
  1879.             {
  1880.                 if(bExpired)
  1881.                 {
  1882.                     g_ProductStatus = STATUS_TRIALWARE_EXPIRED;
  1883.                 }
  1884.                 else if(bWarning)
  1885.                 {
  1886.                     g_ProductStatus = STATUS_TRIALWARE_ACTIVE;
  1887.                 }
  1888.             }
  1889.             break;
  1890.             
  1891.         case DJSMAR_LicenseType_TryDie:
  1892.             {
  1893.                 if(bExpired)
  1894.                 {
  1895.                     g_ProductStatus = STATUS_TRYDIE_EXPIRED;
  1896.                 }
  1897.                 else if(bWarning)
  1898.                 {
  1899.                     g_ProductStatus = STATUS_TRYDIE_ACTIVE;
  1900.                 }
  1901.             }
  1902.             break;
  1903.         
  1904.         case DJSMAR_LicenseType_Rental:
  1905.             {
  1906.                 if(bWarning)
  1907.                 {
  1908.                     if(bExpired)
  1909.                     {
  1910.                         g_ProductStatus = STATUS_RENTAL_TRIAL_EXPIRED;
  1911.                     }
  1912.                     else
  1913.                     {
  1914.                         g_ProductStatus = STATUS_RENTAL_TRIAL;
  1915.                     }                    
  1916.                 }            
  1917.             }
  1918.             break;
  1919.             
  1920.         default:
  1921.             break;
  1922.            }       
  1923.            return;    
  1924.        }
  1925.          
  1926.     switch(g_NAVStatus.ProductLicenseType)
  1927.     {
  1928.     case DJSMAR_LicenseType_Rental:
  1929.         {
  1930.             if(bKilled)
  1931.             {
  1932.                 g_ProductStatus = STATUS_RENTAL_KILLED;    
  1933.             }
  1934.             else if(bExpired)
  1935.             {            
  1936.                 g_ProductStatus = STATUS_RENTAL_EXPIRED;
  1937.             }
  1938.             else if(bWarning)
  1939.             {
  1940.                 g_ProductStatus = STATUS_RENTAL_WARNING;
  1941.             }
  1942.             else
  1943.             {
  1944.                 g_ProductStatus = STATUS_RENTAL_ACTIVE;                    
  1945.             }
  1946.         }
  1947.         break;
  1948.         
  1949.     case DJSMAR_LicenseType_Retail:
  1950.     case DJSMAR_LicenseType_Unlicensed:
  1951.     case DJSMAR_LicenseType_ESD:
  1952.     case DJSMAR_LicenseType_Trial:
  1953.         if(!bExpired)
  1954.         {
  1955.             g_ProductStatus = STATUS_RETAIL_ACTIVE;
  1956.         }
  1957.         break;    
  1958.         
  1959.     case DJSMAR_LicenseType_Beta:
  1960.         if(bExpired)
  1961.         {
  1962.             g_ProductStatus = STATUS_TRYDIE_EXPIRED;
  1963.         }
  1964.         else
  1965.         {
  1966.             g_ProductStatus = STATUS_RETAIL_ACTIVE;
  1967.         }
  1968.         break;    
  1969.  
  1970.     default:
  1971.         break;
  1972.     }        
  1973. }
  1974.  
  1975. function SetServiceStatus(USState, USIcon, strUSTitle, strUSStatus, USHintText, USButtonText)
  1976. {
  1977.     Features[gc_US].state = USState;
  1978.     Icons[gc_US].source = USIcon;
  1979.     strUSTitle.style.display = "";
  1980.     strUSStatus.style.display="";
  1981.     Features[gc_US].detailstext = USHintText;
  1982.     Features[gc_US].buttontext = USButtonText;
  1983. }
  1984.  
  1985. function CreateOptions ()
  1986. {
  1987.     try
  1988.     {
  1989.         g_Options = new ActiveXObject ( g_strOptionsInterface );
  1990.     }
  1991.     catch (err)
  1992.     {
  1993.             var msg = document.frames("Errors").document.all.ERR_MSG_NO_OPTIONS.innerText;
  1994.             var id = document.frames("Errors").document.all.ERR_ID_NO_OPTIONS.innerText;
  1995.             g_ErrorHandler.DisplayNAVError (msg, id);
  1996.             AllError ();
  1997.             g_Options = null;
  1998.             return;
  1999.     }
  2000. }