home *** CD-ROM | disk | FTP | other *** search
- // Alert.js
-
- //~~--~~//~~--~~//~~--~~//~~--~~//~~--~~//~~--~~//~~--~~
- // HTML pages that include Alert.js
- // must also include SymAlertStatic.js
- //~~--~~//~~--~~//~~--~~//~~--~~//~~--~~//~~--~~//~~--~~
-
- // Disable Drag-and-drop support
- document.ondragstart = function(){return false;}
-
- //
- // Help IDS
- //
- var IDH_NAV_ALERT_WARNING_SUBSCRIPT = 11561;
- var IDH_NAV_ALERT_EXPIRED_SUBSCRIPT = 11560;
- var IDH_NAV_ALERT_EXPIRED_SUBSCRIPT_ONSCAN = 12100;
- var IDH_NAV_ALERT_EXPIRED_VIRUSDEFS = 12150;
- var IDH_NAV_ALERT_EXPIRED_VIRUSDEFS_ONSCAN = 12151;
- var IDH_NAV_ALERT_ALU_DISABLED = 12152;
-
- var g_DefAlert;
- var g_Launcher;
-
- g_ModuleID = 3028;
-
- var IDS_VENDOR_NAME = 116;
-
- var CYCLE_SUBSEXPIRED = "SECycle";
- var CYCLE_DEFSOUTOFDATE = "DefsCycle";
- var CYCLE_LICWARNING = "LWCycle";
- var CYCLE_LICEXPIRED = "LECycle";
- var CYCLE_SCANSUBSEXPIRED = "S_SECyc";
- var CYCLE_SCANDEFSOUTOFDATE = "S_DCyc";
-
- var _1_DAY = 86400; // in seconds
-
- var iTimerID;
- var bTimerRunning = false;
- // 2 minute timeout
- var TIMEOUT = 120000;
-
- // ==========================================
- // Helper functions
- // ==========================================
-
- function createDefAlertObjects()
- {
- try
- {
- g_DefAlert = new ActiveXObject ("DefAlert.SymNavDefAlert");
- }
- catch(err)
- {
- var msg = document.frames("Errors").document.all.ERR_MSG_NO_DEFALERT.innerText;
- var id = document.frames("Errors").document.all.ERR_ID_NO_DEFALERT.innerText;
- g_ErrorHandler.DisplayNAVError (msg, id);
- return;
- }
-
- try
- {
- g_Launcher = new ActiveXObject ("Symantec.Norton.AntiVirus.AppLauncher");
- }
- catch(err)
- {
- var msg = document.frames("Errors").document.all.ERR_MSG_NO_LAUNCHER.innerText;
- var id = document.frames("Errors").document.all.ERR_ID_NO_LAUNCHER.innerText;
- g_ErrorHandler.DisplayNAVError (msg, id);
- return;
- }
- }
-
- function Init()
- {
- window.returnValue = SYMALERT_RESULT_CANCEL;
-
- createDefAlertObjects();
-
- try
- {
- if(g_DefAlert.IsHighContrast())
- document.body.scroll = "yes";
- }
- catch(err)
- {
- }
- }
-
- function DisableNotifyOption()
- {
- days.disabled = true;
- }
-
- function EnableNotifyOption()
- {
- days.disabled = false;
- }
-
- function DisableNotifyAndDontShowOptions()
- {
- days.disabled = true;
- DontShowBtn.disabled = true;
- }
-
- function EnableNotifyAndDontShowOptions()
- {
- days.disabled = false;
- DontShowBtn.disabled = false;
- }
-
- function OnHelpClick( TopicID )
- {
- try
- {
- g_Launcher.LaunchHelp( TopicID );
- }
- catch(err)
- {
- g_Launcher.NAVError.LogAndDisplay(0);
- }
-
- return false;
- }
-
- function OnClose()
- {
- CancelTimer();
- location.href = "res://closeme.xyz/";
- }
-
- function AlertOnLoad()
- {
- Init();
- }
-
- function CancelTimer()
- {
- // If the timer is running
- if (bTimerRunning == true)
- {
- // cancel the timer
- clearInterval(iTimerID);
- bTimerRunning = false;
- }
- }
-
- // ==========================================
- // ALUDisabled functions
- // ==========================================
-
- function ALUDisabledOnClickOK()
- {
- if(EnableALUBtn.checked == true)
- window.returnValue = SYMALERT_RESULT_ENABLEALU;
-
- OnClose();
- }
-
- // ==========================================
- // DefsOutOfDates functions
- // ==========================================
-
- function DefsOutOfDateOnLoad()
- {
- Init();
-
- // Set default users' selections.
- // Assume they selected "Notify me in 1 day".
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_DEFSOUTOFDATE, _1_DAY);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
- }
-
- function DefsOutOfDateOnClickOK()
- {
- // Update the DefsOutOfDate cycle anyway in case the user
- // selects LU but then cancels it later.
-
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_DEFSOUTOFDATE, (days.value * _1_DAY));
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
-
- if (LUBtn.checked == true)
- window.returnValue = SYMALERT_RESULT_LAUNCHLU;
-
- OnClose();
- }
-
- // ==========================================
- // Scanner DefsOutOfDates functions
- // ==========================================
-
- function Scan_DefsOutOfDateOnLoad()
- {
- window.returnValue = SYMALERT_RESULT_CANCEL;
-
- // Start the timer to close the window in 2 minutes
- iTimerID = setInterval("OnClose()", TIMEOUT);
- bTimerRunning = true;
-
- createDefAlertObjects();
-
- try
- {
- if(g_DefAlert.IsHighContrast())
- document.body.scroll = "yes";
- }
- catch(err)
- {
- }
-
- // Set default users' selections.
- // Set the value to 0 days so it appears again in case the user missed it
- g_DefAlert.SetAlertDword(CYCLE_SCANDEFSOUTOFDATE, 0);
- }
-
- function Scan_DefsOutOfDateOnClickOK()
- {
- CancelTimer();
-
- try
- {
- if (LUBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_LAUNCHLU;
- }
- else
- {
- g_DefAlert.SetAlertDword(CYCLE_SCANDEFSOUTOFDATE, (days.value * _1_DAY));
- }
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
-
- OnClose();
- }
-
- // ==========================================
- // Subscription Warning
- // ==========================================
-
- function SubWarningOnLoad()
- {
- Init();
-
- try
- {
- var iDaysLeft = g_DefAlert.GetVirusDefSubDaysLeft();
- daysLeft.innerText = iDaysLeft;
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
-
- try
- {
- // Check for admin rights.
- var NAVLicenseObj = new ActiveXObject("NAVLicense.NAVLicenseInfo");
-
- if(NAVLicenseObj.CanRenewSubscription == false)
- {
- table2_row_RenewNow.style.display = "none";
- table2_row_RenewLater.style.display = "none";
- table2_row_space.style.display = "none";
- RenewBtn.checked = false;
- table2_row_AdminRights.style.display = "";
- }
- }
- catch(err)
- {
- }
- }
-
- function SubWarningOnClickOK()
- {
- if(RenewBtn.checked == true)
- window.returnValue = SYMALERT_RESULT_RENEWSUBS;
-
- OnClose();
- }
-
- // ==========================================
- // Subscription Expired
- // ==========================================
-
- function SubExpiredOnLoad()
- {
- // Set default users' selections.
- // 1. Assume users cancel the alert
- // 2. Assume they selected "Notify me in 1 day".
- Init();
-
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_SUBSEXPIRED, _1_DAY);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
-
- var iDaysLeft = 0;
-
- try
- {
- iDaysLeft = g_DefAlert.GetVirusDefSubDaysLeft();
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
-
- if(iDaysLeft < 0)
- {
- var iDaysExpired = Math.abs(iDaysLeft);
- if(iDaysExpired >= 30)
- {
- DontShowTxt.style.display = "";
- DontShowBtn.style.display = "";
- DontShowBtn.disabled = true;
- days15.selected = true;
- days1.selected = false;
- }
- }
-
- try
- {
- // Check for admin rights.
- var NAVLicenseObj = new ActiveXObject("NAVLicense.NAVLicenseInfo");
-
- if(NAVLicenseObj.CanRenewSubscription == false)
- {
- table2_row_RenewNow.style.display = "none";
- table2_row_RenewLater.style.display = "none";
- table2_row_space1.style.display = "none";
- table2_row_space2.style.display = "none";
- table2_row_DontShowAgain.style.display = "none";
- RenewBtn.checked = false;
- table2_row_AdminRights.style.display = "";
- }
- }
- catch(err)
- {
- }
- }
-
- function SubExpiredOnClickOK()
- {
- if(RenewBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_RENEWSUBS;
- }
- else
- {
- if(DontShowBtn.checked == true)
- {
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_SUBSEXPIRED, -1);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
- }
- else
- {
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_SUBSEXPIRED, days.value * _1_DAY);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
- }
- }
-
- OnClose();
- }
-
- // ==========================================
- // Scanner Subscription Expired
- // ==========================================
-
- function Scan_SubExpiredOnLoad()
- {
- // Set default users' selections.
- // 1. Assume users cancel the alert
- // 2. Set the value to 0 days so it appears again in case the user missed it
- window.returnValue = SYMALERT_RESULT_CANCEL;
-
- // Start the timer to close the window in 2 minutes
- iTimerID = setInterval("OnClose()", TIMEOUT);
- bTimerRunning = true;
-
- createDefAlertObjects();
-
- try
- {
- if(g_DefAlert.IsHighContrast())
- document.body.scroll = "yes";
- }
- catch(err)
- {
- }
-
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_SCANSUBSEXPIRED, 0);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- return;
- }
-
- var iDaysLeft = 0;
-
- try
- {
- iDaysLeft = g_DefAlert.GetVirusDefSubDaysLeft();
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- return;
- }
-
- if(iDaysLeft < 0)
- {
- var iDaysExpired = Math.abs(iDaysLeft);
- if(iDaysExpired >= 30)
- {
- DontShowTxt.style.display = "";
- DontShowBtn.style.display = "";
- DontShowBtn.disabled = true;
- days15.selected = true;
- days1.selected = false;
- }
-
- }
- try
- {
- // Check for admin rights.
- var NAVLicenseObj = new ActiveXObject("NAVLicense.NAVLicenseInfo");
-
- if(NAVLicenseObj.CanRenewSubscription == false)
- {
- table2_row_RenewNow.style.display = "none";
- table2_row_RenewLater.style.display = "none";
- table2_row_space1.style.display = "none";
- table2_row_space2.style.display = "none";
- table2_row_DontShowAgain.style.display = "none";
- RenewBtn.checked = false;
- table2_row_AdminRights.style.display = "";
- }
- }
- catch(err)
- {
- }
- }
-
- function Scan_SubExpiredOnClickOK()
- {
- CancelTimer();
-
- if(RenewBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_RENEWSUBS;
- }
- else
- {
- if(DontShowBtn.checked == true)
- {
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_SCANSUBSEXPIRED, -1);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
- }
- else
- {
- try
- {
- g_DefAlert.SetAlertDword(CYCLE_SCANSUBSEXPIRED, days.value * _1_DAY);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
- }
- }
-
- OnClose();
- }
-
- // ==========================================
- // Licensing
- // ==========================================
-
- function LicensingOnClickOK()
- {
- if(ResolveBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_RESOLVELICENSE;
- }
-
- OnClose();
- }
-
- function LicensingPreActiveExpiredOnClickOK()
- {
- if(ResolveBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_ACTIVATE_SERVICE;
- }
- else if(SignupBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_SIGNUP_SERVICE;
- }
-
- OnClose();
- }
-
- function LicensingPreActiveExpiredSSOnClickOK()
- {
- if(ResolveBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_ACTIVATE_SERVICE;
- }
-
- OnClose();
- }
-
- function LicensingCanceledOnClickOK()
- {
- if(ResolveBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_RESOLVELICENSE;
- }
- else if(OptionsBtn.checked == true)
- {
- // Yes, we perform the same task as if users
- // click ResolveBtn since the back end web process
- // will change dynamically according to the licensing
- // status.
- window.returnValue = SYMALERT_RESULT_RESOLVELICENSE;
- }
- else if(UninstallBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_UNINSTALL;
- }
-
- OnClose();
- }
-
- // ================================================
- // Licensing alerts with "Notify me again" options
- // ================================================
-
- function LicensingWithRemindMeOnLoad(strRemindMeCycle)
- {
- // Set default users' selections.
- // 1. Assume they dont want to resolve license
- // 2. Assume they selected "Notify me in 1 day".
- //
- Init();
-
- try
- {
- g_DefAlert.SetAlertDword(strRemindMeCycle, _1_DAY);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
- }
-
- function LicensingWithRemindMeOnClickOK(strRemindMeCycle)
- {
- if(ResolveBtn.checked == true)
- {
- window.returnValue = SYMALERT_RESULT_RESOLVELICENSE;
- }
- else
- {
- try
- {
- g_DefAlert.SetAlertDword(strRemindMeCycle, days.value * _1_DAY);
- }
- catch(err)
- {
- g_DefAlert.NAVError.LogAndDisplay(0);
- }
- }
-
- OnClose();
- }