home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Js / AdministerAlertsMain.js < prev    next >
Encoding:
Text File  |  2003-06-24  |  68.1 KB  |  2,096 lines

  1. var    CCOneBoxHeight = "190px"; // 298
  2. var   EGCCOneBoxHeight = "275px";
  3. var    ALMode = ""; // Mode of Operation, New, Edit, Delete, Lookup, ObjectLookup
  4. var    ALupMode = ""; // Lookup Mode of Operation, Computer, Counter
  5. var     SchedTxtArray = new Array("Sec(s)","Min(s)","Hour(s)","Day(s)");
  6. var   ServicesArray = new Array("PING","HTTP","FTP","SMTP","POP","DNS","USER","SQL","SNMP","TELNET","ORACLE","L_NOTES","AGENT");
  7. var   InactDaysArray = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
  8. var   SeverityArray = new Array("Normal","Caution","Critical");
  9. var    SchedState = 0; // Schedule Drop-down state
  10. var    CDUnits = 0; // Schedule Units
  11. var     CDCount = 1; // Schedule Count
  12. var    SrvFreqState = 0; // Service Frequency Drop-down state
  13. var    SrvUnits = 1; // Service Check Frequency Units
  14. var     SrvCount = 1; // Service Check Frequency Count
  15. var    MaxAlertsState = 0; // Max Alert Count Drop-down state
  16. var     MaxAlertsCount = 0; // Max Alerts Count
  17. var   SuppressMonitoringState = 0;
  18. var    ObjectLUPreqd = true; // Object Lookup Required
  19. var    ObjectLupRecCount = 0; // Object Lookup record counter
  20. var    LastObjectName = ""; // Name of Last Object in Store
  21. var    CurObjName = ""; // Name of Current Open Object
  22. var    CurObjID = 0;
  23. var   CurObjDesc = "";
  24. var    CurObjIx = 0; 
  25. var    CurCntrName = ""; // Name of Current Open Counter 
  26. var    CurCntrDesc = "";
  27. var    CurCntrID = 0;
  28. var    CurCntrIx = 0;
  29. var    CurExpCntrIx = 0;
  30. var    CurCmpIx    = 0; // Current Computer Counter
  31. var    CmpsSelectedCount = 0; // total count of computers selected
  32. var    LastCmpSelectedSuffix = null; // Last Selected Computer DIV ID suffix
  33. var    Tid = null, CTid = null, WSToId = null; // Timeout ID
  34. var     ReconnectEvent = false;
  35. var     Hp = 82;
  36.  
  37. var ServicesRecCount = 0; // Count of records returned from Services Lookup operation
  38. var SmtpServerAddress = ""; // Global Smtp Server Address for Email notifications
  39. var SmtpServerAuthStatus = "0"; // Status
  40. var SmtpServerAuthLogin = ""; // Login
  41. var SmtpServerAuthPswd = ""; // password
  42.  
  43. var bdH = 0;
  44. var byM = null;
  45. var borderSz = 2; // Thin Bord is 2pixels
  46. var PuPW = "400px", PuPWu=400, PuPH = "280px", PuPHu=280, PuPCH = "190px";
  47. var PuPATW = "300px", PuPATWu=300, PuPATCH = "160px";
  48. var PuPOIDW = "500px", PuPOIDWu=500, PuPOIDCH = "330px";
  49. var PuPW_EG = "600px", PuPWu_EG=600, PuPH_EG = "460px", PuPHu_EG=460;
  50. var SCbsy = false;
  51. var CCOneExpH = 0;
  52. var CCOneExpL = 0;
  53. var CollapseButtonTop = 0;
  54. var CollapseButtonLeft = 0;
  55. var ASch = ""; // Computed Alert Schedule
  56. var ASdt = ""; // Computed Start D/T
  57. var AEdt = ""; // Computed Stop D/T
  58. var AAid = ""; // Computed Array ID
  59. var LastNewName = null;
  60. var ignoreDBChangeEvent = false;
  61.  
  62. var WinServicesLUPreqd = true; // Object Lookup Required
  63. var WinServicesRecCount = 0; // Object Lookup record counter
  64.  
  65. var ServiceType="0", CounterType="1", EventLogType="2", UserType="3", SNMPTrapType="4", WinServicesType="5";
  66. var FileCheckType="6", SyslogCheckType="7", ProcessCheckType="8", WatchReportType="99";
  67. var CurrentAT = "0";
  68. var selectImage = "sAdminAlerts.gif";
  69. var ProgramTestInProgress = false;
  70. var DuplicateFlag = false;
  71.  
  72. var   AlertSelectIdx = 0; // Index of currently selected Alert 
  73. var     AlertStoreArr = new Array();
  74. var   AlertLupRecCount = 0; // Count of records returned from Alert Lookup operation
  75.  
  76. /* On Load tell the Comm control to Connect to the Server */
  77. function InitRpmCC_AL() {
  78.     Tid = null; //reset
  79.     if ( TreeButtonsLoaded == false ) { // Have buttons been loaded?
  80.         if ( plTreeButtons() == false ) { // No go set them up
  81.             Tid = setTimeout("InitRpmCC_AL()",100); // Not complete, delay 100 ms. then check again
  82.             return; // exit and wait
  83.         }
  84.     }
  85.     top.MainLoaded = true; // Flag that Main is now loaded
  86.     byM = 2*parseFloat(document.body.style.margin);
  87.     processSizeChange(); // process initial window size
  88.     initButtonState(); // set initial button states
  89.     
  90.     /* Create Duration dropdown selections */
  91.     dct = AL_SchedCount;
  92.     dun = AL_SchedUnits;
  93.     for ( var i=1; i<= 99; i++ ) { // count drop down
  94.         i = ( i < 10 ) ? " "+i : i;
  95.         addElementToSelect(dct," "+i);
  96.     }
  97.     for ( i=0; i < 3; i++ ) { // unit drop down
  98.         addElementToSelect(dun,SchedTxtArray[i]);
  99.     }
  100.     
  101.     /* Create Service Check Frequency dropdown selections */
  102.     dct = AL_SrvFreqCount;
  103.     dun = AL_SrvFreqUnits;
  104.     for ( i=1; i<= 59; i++ ) { // count drop down
  105.         i = ( i < 10 ) ? " "+i : i;
  106.         addElementToSelect(dct," "+i);
  107.     }
  108.     for ( i=0; i<4; i++ ) { // unit drop down
  109.         addElementToSelect(dun,SchedTxtArray[i]);
  110.     }
  111.     
  112.     /* Create Max Alerts Count dropdown selections */
  113.     dct = AL_MaxAlertsCount;
  114.     for ( i=0; i<= 99; i++ ) { // count drop down
  115.         i = ( i < 10 ) ? " "+i : i;
  116.         addElementToSelect(dct," "+i);
  117.     }
  118.  
  119.     /* Create Suppress Monitoring dropdown selections */
  120.     for ( i=0; i<= 6; i++ ) { // DaysOfWeek drop down
  121.         addElementToSelect(AL_InactPerDaysS1,InactDaysArray[i]);
  122.         addElementToSelect(AL_InactPerDaysS2,InactDaysArray[i]);
  123.         addElementToSelect(AL_InactPerDaysE1,InactDaysArray[i]);
  124.         addElementToSelect(AL_InactPerDaysE2,InactDaysArray[i]);
  125.     }
  126.     for ( i=0; i<= 23; i++ ) { // Hours drop down
  127.         i = ( i < 10 ) ? "0"+i : i;
  128.         addElementToSelect(AL_InactPerHours1S,""+i);
  129.         addElementToSelect(AL_InactPerHours2S,""+i);
  130.         addElementToSelect(AL_InactPerHours1E,""+i);
  131.         addElementToSelect(AL_InactPerHours2E,""+i);
  132.     }
  133.     for ( i=0; i<= 59; i++ ) { // Mins drop down
  134.         i = ( i < 10 ) ? "0"+i : i;
  135.         addElementToSelect(AL_InactPerMins1S,""+i);
  136.         addElementToSelect(AL_InactPerMins2S,""+i);
  137.         addElementToSelect(AL_InactPerMins1E,""+i);
  138.         addElementToSelect(AL_InactPerMins2E,""+i);
  139.     }
  140.     
  141.     for ( i=1; i<= 64; i++ ) { // Precedence drop down
  142.         i = ( i < 10 ) ? " "+i : i;
  143.         addElementToSelect(AL_SLPrec," "+i);
  144.     }
  145.     for ( i=1; i<= 64; i++ ) { // Precedence drop down
  146.         i = ( i < 10 ) ? " "+i : i;
  147.         addElementToSelect(AL_ELPrec," "+i);
  148.     }
  149.  
  150.  
  151.     /* Connect to Server */
  152.     Hp = parseInt(document.body.RPMHostPort,10);
  153.     RpmCC_AL.Connect(document.body.RPMHostIP,Hp, "");
  154. }
  155. function processReconnect() {
  156.     Tid = null;
  157.     if ( RpmCC_AL.IsConnected() ) {
  158.         Tid = setTimeout("processConnectionCheck()",60000); // Delay 30 secs then check connection
  159.         return;
  160.     }
  161.     RpmCC_AL.Connect(document.body.RPMHostIP,Hp, ""); 
  162. }
  163. function processConnectConfirmed() {
  164.     // Restore Filter and Computer Store    
  165.     if ( ReconnectEvent == false ) {
  166.         top.banner.processStartComm();
  167.         RpmCC_AL.GetGlobalSMTP(); // Request Global SMTP address 
  168.         RpmCC_AL.GetGlobalSMTPAuth(); // Request Global SMTP authorization status
  169.         RpmCC_AL.GetGlobalBeeper(); // Request Global Pager/Beeper Port and Delay seconds 
  170.         processAlLookupReset(); // go do Alert Lookup
  171.         ReconnectEvent = true;
  172.     }
  173.     top.Rstatus.Pstat("Connected");
  174.     if ( Tid != null ) {
  175.         clearTimeout(Tid); // stop timeout routine
  176.     }
  177.     Tid = setTimeout("processConnectionCheck()",60000); // Delay 30 secs then check connection
  178. }
  179. function processConnectionCheck() {
  180.     Tid = null;
  181.     RpmCC_AL.SendKeepAlive("Check");
  182.     Tid = setTimeout("processConnectionCheck()",60000); // Delay 30 secs then check connection
  183. }
  184.  
  185. /* On Unload tell the Comm control to Disconnect from the Server */
  186. function DiscoRpmCC_AL() {
  187.     top.QuickStartProcessing = false;
  188.     RpmCC_AL.Disconnect(); // Disconnect from Server
  189.     top.banner.processStopCommX();
  190.     if ( Tid != null ) {
  191.         clearTimeout(Tid); // stop timeout routine
  192.     }
  193.     if ( CTid != null ) {
  194.         clearTimeout(CTid); // stop timeout routine
  195.     }
  196. }
  197. // Process Display View Size Change
  198. var SCbsy = false;
  199. var MomPuPW = "275px", MomPuPWu=275;
  200. var PuPFACW = "270px", PuPFACWu=270, PuPFACCH = "326px";
  201. function processSizeChange() {
  202.     if ( SCbsy ) 
  203.         return;
  204.     SCbsy = true;
  205.     
  206.     // Display Height and Width
  207.     bCh = document.body.clientHeight;
  208.     bCw = document.body.clientWidth;
  209.     
  210.    // PopUp 
  211.    PuPLeft = (bCw-PuPWu)/2;
  212.    PuPTop = (bCh-PuPHu)/2;
  213.    PopUpConfirm.style.left = PuPLeft+"px"; 
  214.    PopUpConfirm.style.top = "85px"; //PuPTop+"px"; 
  215.    PopUpConfirm.style.height = PuPCH;
  216.    PopUpConfirm.style.width = PuPW;
  217.  
  218.    PopUpEmailGroups.style.left = PuPLeft+"px"; 
  219.    PopUpEmailGroups.style.top = "140px"; //PuPTop+"px"; 
  220.    PopUpEmailGroups.style.height = PuPCH;
  221.    PopUpEmailGroups.style.width = PuPW;
  222.  
  223.    PuPLeft = (bCw-660)/2;
  224.    EmailGroupReport.style.left = PuPLeft+"px"; 
  225.    EmailGroupReport.style.top = "120px"; //PuPTop+"px"; 
  226.    EmailGroupReport.style.height = "400px";
  227.    EmailGroupReport.style.width = "660px";
  228.  
  229.    PuPLeft = (bCw-660)/2;
  230.    WatchReport.style.left = PuPLeft+"px"; 
  231.    WatchReport.style.top = "120px"; //PuPTop+"px"; 
  232.    WatchReport.style.height = (bCh-150)+"px"; //"400px";
  233.    WatchReport.style.width = "660px";
  234.     document.all["repwatch"].style.height = WatchReport.style.posHeight-50;//"325px";
  235.     document.all["repwatch"].style.width = "640px";
  236.  
  237.     PupSLeft = (bCw-516)/2;
  238.    PopUpSelectDiv.style.left = PupSLeft+"px"; 
  239.    PopUpSelectDiv.style.top = "40px"; //PuPTop+"px"; 
  240.    PopUpSelectDiv.style.height = (bCh-70)+"px"; 
  241.    PopUpSelectDiv.style.width = "516px";
  242.    AL_CCOneWatchReport.style.height = (bCh-120)+"px"; 
  243.  
  244.    PuPLeft = (bCw-410)/2;
  245.    PopUpEmailAddress.style.left = PuPLeft+"px"; 
  246.    PopUpEmailAddress.style.top = "140px"; //PuPTop+"px"; 
  247.    PopUpEmailAddress.style.height = "190px";
  248.    PopUpEmailAddress.style.width = "410px";
  249.  
  250.    PopUpEmailText.style.left = PuPLeft+"px"; 
  251.    PopUpEmailText.style.top = "140px"; //PuPTop+"px"; 
  252.    PopUpEmailText.style.height = PuPCH;
  253.    PopUpEmailText.style.width = PuPW;
  254.  
  255.    EGPuPLeft = (bCw-PuPWu_EG)/2-12;
  256.    PopUpEmailGroupsManage.style.left = EGPuPLeft+"px"; 
  257.    PopUpEmailGroupsManage.style.top = "55px"; 
  258.    PopUpEmailGroupsManage.style.height = PuPH_EG;
  259.    PopUpEmailGroupsManage.style.width = PuPW_EG;
  260.     AL_EGCCOne.style.height = EGCCOneBoxHeight;
  261.     AL_EGCCOne.style.overflow = (AL_EGCCOne.scrollHeight >= AL_EGCCOne.clientHeight) ? "scroll" : "";
  262.     
  263.    PuPATLeft = (bCw-PuPATWu)/2;
  264.    PopUpAT.style.left = PuPATLeft+"px"; 
  265.    PopUpAT.style.top = "235px"; //PuPTop+"px"; 
  266.    PopUpAT.style.height = PuPATCH;
  267.    PopUpAT.style.width = PuPATW;
  268.  
  269.    PuPOIDLeft = (bCw-PuPOIDWu)/2;
  270.    PopUpOID.style.left = PuPOIDLeft+"px"; 
  271.    PopUpOID.style.top = "190px"; //PuPTop+"px"; 
  272.    PopUpOID.style.height = PuPOIDCH;
  273.    PopUpOID.style.width = PuPOIDW;
  274.  
  275.    PuPFACLeft = ((bCw-PuPFACWu)/2)+75;
  276.    PopUpFAC.style.left = PuPFACLeft+"px"; 
  277.    PopUpFAC.style.top = "188px"; //PuPTop+"px"; 
  278.    PopUpFAC.style.height = PuPFACCH;
  279.    PopUpFAC.style.width = PuPFACW;
  280.  
  281.       // PopUp 
  282.    MomPuPLeft = (bCw-MomPuPWu)/2;
  283.    PopUpMoment.style.left = MomPuPLeft+"px"; 
  284.    PopUpMoment.style.top = "300px"; 
  285.    PopUpMoment.style.height = "115px";
  286.    PopUpMoment.style.width = MomPuPW;
  287.  
  288.     //PopUpContext Menu
  289.    PopUpContextSize(bCw);
  290.     
  291.     CCOneExpH = bCh-(bdH+byM-borderSz)-110;
  292.    CCOneExpL = (bCw > 510) ? (bCw-511)/2 : 2;
  293.    //CCExpandHdr.style.left = CCOneExpL;
  294.     CollapseButtonTop = CCOneExpH+70;
  295.     CollapseButtonLeft = CCOneExpL;
  296.     CollapseButton.style.top = CollapseButtonTop;
  297.     CollapseButton.style.left = CollapseButtonLeft;
  298.    if ( AL_CCOne.className == "CCOneBoxExp" ) {
  299.         AL_CCOne.style.height = CCOneExpH;
  300.         AL_CCOne.style.left = CCOneExpL;
  301.     }
  302.    else if ( AL_CCOneServ.className == "CCOneBoxExp" ) {
  303.         AL_CCOneServ.style.height = CCOneExpH;
  304.         AL_CCOneServ.style.left = CCOneExpL;
  305.     }
  306.    else if ( AL_CCOneEventLog.className == "CCOneBoxExp" ) {
  307.         AL_CCOneEventLog.style.height = CCOneExpH;
  308.         AL_CCOneEventLog.style.left = CCOneExpL;
  309.     }
  310.    else if ( AL_CCOneSNMPTrap.className == "CCOneBoxExp" ) {
  311.         AL_CCOneSNMPTrap.style.height = CCOneExpH;
  312.         AL_CCOneSNMPTrap.style.left = CCOneExpL;
  313.     }
  314.    else if ( AL_CCOneWinServ.className == "CCOneBoxExp" ) {
  315.         AL_CCOneWinServ.style.height = CCOneExpH;
  316.         AL_CCOneWinServ.style.left = CCOneExpL;
  317.     }
  318.    else if ( AL_CCOneFileCheck.className == "CCOneBoxExp" ) {
  319.         AL_CCOneFileCheck.style.height = CCOneExpH;
  320.         AL_CCOneFileCheck.style.left = CCOneExpL;
  321.     }
  322.    else if ( AL_CCOneSyslogCheck.className == "CCOneBoxExp" ) {
  323.         AL_CCOneSyslogCheck.style.height = CCOneExpH;
  324.         AL_CCOneSyslogCheck.style.left = CCOneExpL;
  325.     }
  326.    else if ( AL_CCOneProcessCheck.className == "CCOneBoxExp" ) {
  327.         AL_CCOneProcessCheck.style.height = CCOneExpH;
  328.         AL_CCOneProcessCheck.style.left = CCOneExpL;
  329.     }
  330.     SCbsy = false;
  331. }
  332.  
  333. /* Initial Alert Lookup Request */
  334. function processAlLookupReset() {
  335.     /* Make sure Alert Store and Alert Name combo are flushed */
  336.     lth = AL_AlertSel.length;
  337.     for (i=0; i < lth; ++i)
  338.         AL_AlertSel.remove(0);
  339.  
  340.     AlertStoreArr.length = 0;
  341.         
  342.     lth = AL_DependencySel.length;
  343.     for (i=0; i < lth; ++i)
  344.         AL_DependencySel.remove(0);
  345.     addElementToSelect(AL_DependencySel,""); 
  346.  
  347.     AC_ServicesStoreArr.length = 0;
  348.  
  349.     AlertLupRecCount = 0; // clear Lookup record counter
  350.     if ( RpmCC_AL.AlertGroupLookup("*") ) {
  351.             ALMode = "";
  352.             top.Rstatus.Pstat("Unable to start the Watch/Alert lookup request",true);
  353.             processResetButton();
  354.     }
  355.     else {
  356.             ALMode = "Lookup"; // set Mode of operation
  357.             top.Rstatus.Pstat("One moment while Watch/Alert lookup request completes");
  358.     }
  359. }
  360.  
  361. // SNMP Trap Alert New & Edit Routines
  362. function processSNMPTrapTree() {
  363.     if ( ALMode == "Edit" || DuplicateFlag ) {
  364.         processInitialLookup("STTCompLookup");
  365.     }
  366.     else {
  367.         procOIDLookup();
  368.     }
  369.     if ( ALMode == "New" || ALMode == "Edit") {
  370.         TrapHint.style.visibility ="visible";
  371.     }
  372. }
  373. function processOIDChoices() {
  374.     PopUpOID.style.display = "";
  375.     AL_OIDName.style.display = "none";
  376.     svButtonSt(); // save button state
  377.     OIDTreeIndex = 0;
  378.     OIDTreeCount = 0;    
  379.     OID_Data.innerHTML = "";
  380.     processOIDChoicesContinue();
  381. }
  382. function processOIDChoicesContinue() {
  383.     Tid = null;
  384.     var CCEs = "";
  385.     var warr = new Array();
  386.     var i = OIDTreeIndex;
  387.     var j = OIDTreeCount;
  388.     var loopcount = 0;
  389.     for ( ; i<gOIDarray.length-1 && loopcount < 25; loopcount++, i+=4, ++j ) {
  390.         warr = gOIDarray[i+3].split("'");
  391.         gOIDarray[i+3] = warr.join("`");
  392.         
  393.         CCEs += "<table border='0' cellpadding='1' cellSpacing='0' width='460'><tr title='"+gOIDarray[i+3]+"'>";
  394.           CCEs += "<td width='10'></td><td width='11' align='center'><img id='oid_chk"+i;
  395.         if ( gOIDarray[i] == "1" ) {
  396.            CCEs += "' checked='1' src='images/Checked.gif'"; 
  397.         }
  398.         else {
  399.            CCEs += "' checked='0' src='images/Unchecked.gif'";
  400.         }
  401.           CCEs += "style='cursor:hand' onclick='procOIDCmpImgClick(this)' width='9' height='9'></td>";
  402.         CCEs += "<td width='*' id='oid_nme"+i;
  403.         CCEs += "' style='cursor:hand' onclick='procOIDCmpImgClick(this)' class='optext'>  " + gOIDarray[i+1]+" ( "+gOIDarray[i+2]+" )" + "</td>";
  404.         CCEs += "</tr></table>";
  405.     }
  406.       OID_Data.style.overflow = ( j > 14 ) ? "scroll" : "";
  407.     OID_Data.insertAdjacentHTML("beforeEnd",CCEs);
  408.     OIDTreeIndex = i;
  409.     OIDTreeCount = j;
  410.     if ( i < gOIDarray.length-1 ) { // continue if not done
  411.             Tid = setTimeout("processOIDChoicesContinue()",50); // delay 50 ms. then process Tree           
  412.     }    
  413. }
  414.  
  415. function processOID_OK() {
  416.     PopUpOID.style.display = "none";
  417.     AL_OIDName.style.display = "";
  418.     reButtonSt(); // restore button state
  419.     displayOIDChoices(); // display them
  420. }
  421. function processOID_Cancel() {
  422.     PopUpOID.style.display = "none";
  423.     AL_OIDName.style.display = "";
  424.     reButtonSt(); // restore button state
  425. }
  426. /* Process Click to Check or Uncheck an OID */
  427. function procOIDCmpImgClick(CmpIm) {
  428.     isx = CmpIm.id;  
  429.     if ( isx.charAt(0) != "o") 
  430.                 return;
  431.     var cx = isx.substring(7,isx.length); // Strip off index
  432.     var CObj = document.all["oid_chk"+cx]; // Clicked Check box
  433.     if ( CObj.checked == "1" ) { // if currently Checked, Uncheck
  434.         CObj.src = "images/Unchecked.gif";
  435.        CObj.checked = "0"; // Set Unchecked
  436.        gOIDarray[parseInt(cx,10)] = "0";
  437.    }
  438.     else { // otherwise Check
  439.         CObj.src = "images/Checked.gif";
  440.        CObj.checked = "1"; // Set Checked
  441.        gOIDarray[parseInt(cx,10)] = "1";
  442.     }
  443. }
  444. function createSNMPTrapArray() {
  445.     gOIDstrg = ""; // reset 
  446.     // Find & create array of selected OID
  447.     for ( var i=0,k=0; i<gOIDarray.length-1; i+=4 ) {
  448.         if ( gOIDarray[i] == "1" ) { // if Chosen
  449.             gOIDstrg += "~"+gOIDarray[i+2];
  450.             ++k;
  451.         }
  452.     }
  453.     return ((k==0) ? false : true);
  454. }
  455.  
  456. // Process SNMP Trap New After Apply Button
  457. var STADcix = -1;
  458. function processSNMPTRapAdd() {
  459.     STADcix = (-1); // Index to computer array for this alert
  460.     Tid = setTimeout("processSNMPTRapAddContinue()",10); // delay 10 ms. then start add
  461. }
  462. function processSNMPTRapAddContinue() {
  463.     Tid= null;
  464.     if ( ++STADcix < ELM_Ar.length ) {
  465.         var astrg = ((AL_Suspend.checked) ? "0" :"1")+"~"+ELM_Ar[STADcix]+"~"+curAGRPID+gOIDstrg;
  466.         if ( RpmCC_AL.SnmpTrapMonitorAdd(astrg) ) { // if unable to initiate request        
  467.             top.Rstatus.Pstat("Unable to start the SNMPTrapWatch Add request",true);
  468.             processResetButton();    
  469.         }
  470.         else { // waiting for OperationCompleteEvent
  471.             top.Rstatus.Pstat("One moment while SNMPTrapWatch Add request completes");
  472.         }
  473.     }
  474.     else {
  475.         processAlLookupReset(); // Done
  476.     }    
  477. }
  478.  
  479. // Process SNMP Trap Edit After Apply Button
  480. var STCRix = -1;
  481. function processSNMPTRapEdit() {
  482.     STADcix = (-1); // Index to conputer array for this alert
  483.     STCRix = (-1); // Index to original SNMP Trap Computer Recs array for this alert
  484.     Tid = setTimeout("processSNMPTRapEditContinue()",10); // delay 10 ms. then start add
  485. }
  486. function processSNMPTRapEditContinue() {
  487.     var warr = new Array();
  488.     Tid= null;
  489.     
  490.     // Process all computers in the selected array
  491.     if ( ++STADcix < ELM_Ar.length ) { 
  492.         var CID = ELM_Ar[STADcix]; // computer ID from array of selected
  493.         for ( var i=0; i<SNMPTrapCompRecs.length-1; i++ ) { // process out Trap Monitor records
  494.             warr = SNMPTrapCompRecs[i].split("~"); // parse each record
  495.             if ( CID == warr[2] ) { // if found
  496.                 break;
  497.             }
  498.         }
  499.         var astrg = ((AL_Suspend.checked) ? "0" :"1")+"~"+CID+"~"+curAGRPID+gOIDstrg;
  500.         // if selected Computer found in original, do Replace
  501.         if ( i<SNMPTrapCompRecs.length-1 ) {
  502.             astrg = warr[0]+"~"+astrg; // prepend Rec ID for Replace
  503.             warr[0] = (-1); // flag as replaced
  504.             SNMPTrapCompRecs[i] = warr.join("~"); // store back
  505.             if ( RpmCC_AL.SnmpTrapMonitorReplace(astrg) ) { // if unable to initiate request        
  506.                 top.Rstatus.Pstat("Unable to start the SNMPTrapWatch Replace request",true);
  507.                 processResetButton();    
  508.             }
  509.             else { // waiting for OperationCompleteEvent
  510.                 top.Rstatus.Pstat("One moment while SNMPTrapWatch Replace request completes");
  511.             }
  512.         }
  513.         // selected Computer not found in original, do Add
  514.         else {
  515.             if ( RpmCC_AL.SnmpTrapMonitorAdd(astrg) ) { // if unable to initiate request        
  516.                 top.Rstatus.Pstat("Unable to start the SNMPTrapWatch Add request",true);
  517.                 processResetButton();    
  518.             }
  519.             else { // waiting for OperationCompleteEvent
  520.                 top.Rstatus.Pstat("One moment while SNMPTrapWatch Add request completes");
  521.             }
  522.         }
  523.     }
  524.     
  525.     // Next, delete any original computer records not replaced
  526.     else if ( ++STCRix < SNMPTrapCompRecs.length-1 ) {
  527.         warr = SNMPTrapCompRecs[STCRix].split("~"); // parse each record
  528.         if ( warr[0] != (-1) ) { // if to be deleted
  529.             if ( RpmCC_AL.SnmpTrapMonitorDelete(warr[0]) ) { // if unable to initiate request        
  530.                 top.Rstatus.Pstat("Unable to start the SNMPTrapWatch Delete request",true);
  531.                 processResetButton();    
  532.             }
  533.             else { // waiting for OperationCompleteEvent
  534.                 top.Rstatus.Pstat("One moment while SNMPTrapWatch Delete request completes");
  535.             }
  536.         }
  537.         else {
  538.             Tid = setTimeout("processSNMPTRapEditContinue()",5); // delay 5 ms. then check next
  539.         }
  540.     }
  541.     
  542.     // Done
  543.     else {
  544.         // Insure Service Checking is Enabled
  545.         //if ( RpmCC_AL.StartStopServicesCheck("1") ) { // if unable to initiate request        
  546.         //    top.Rstatus.Pstat("Unable to restart the SERVICES Checking",true);
  547.         //}
  548.         ALMode = ""; // reset
  549.         finishEditComplete();
  550.     }    
  551. }
  552.  
  553. // Process SNMP Trap Delete 
  554. function processSNMPTrapDelete(AID) {
  555.     AGIDtdel= AID; // save AGid to delete
  556.     // Find SNMP Trap Computer records for this AGid
  557.     if ( RpmCC_AL.SnmpTrapMonitorFindByAGId(AID) ) { // if unable to initiate request        
  558.         ALupMode = "";
  559.         PINP_Bsy = false;
  560.         top.Rstatus.Pstat("Unable to start the SNMPTrapWatch Server/Device lookup request",true);
  561.     }
  562.     else {
  563.         ALupMode = "SNMPTrapComputerDlete"; // Mode
  564.         top.Rstatus.Pstat("One moment while SNMPTrapWatch Server/Device lookup request completes");
  565.     }
  566. }
  567. // Process Read of SNMP Trap Monitors by AGId
  568. var STCRdix = -1;
  569. var AGIDtdel = null;
  570. function processSNMPTrapComputersDelete(coidstrg) {
  571.     SNMPTrapCompRecs = coidstrg.split(";"); // parse out the Trap Monitor Computer records
  572.     STCRdix = -1; // initialize index
  573.     Tid = setTimeout("processSNMPTrapComputersDeleteContinue()",10); // delay 10 ms. then start delete
  574. }
  575. function processSNMPTrapComputersDeleteContinue() {
  576.     var warr = new Array;
  577.     Tid = null;
  578.     if ( ++STCRdix < SNMPTrapCompRecs.length-1 ) { // delete a Trap Monitor records
  579.         warr = SNMPTrapCompRecs[STCRdix].split("~"); // parse each record
  580.         if ( RpmCC_AL.SnmpTrapMonitorDelete(warr[0]) ) { // if unable to initiate request        
  581.             top.Rstatus.Pstat("Unable to start the SNMPTrapWatch Delete request",true);
  582.             processResetButton();    
  583.         }
  584.         else { // waiting for OperationCompleteEvent
  585.             top.Rstatus.Pstat("One moment while SNMPTrapWatch Delete request completes");
  586.         }
  587.     }
  588.     // Done deleting records, now delete AG
  589.     else {
  590.         if ( RpmCC_AL.AlertGroupDelete(AGIDtdel) ) {
  591.             top.Rstatus.Pstat("Unable to start the DELETE request",true);
  592.             processResetButton();
  593.         }
  594.         else { // waiting for OperationCompleteEvent
  595.             ignoreDBChangeEvent = true;
  596.             top.Rstatus.Pstat("One moment while DELETE request completes");
  597.         }
  598.     }
  599. }
  600.  
  601. // SNMP Trap OID Routines
  602. function procOIDLookup() {
  603.     // Get OID definitions
  604.     if ( RpmCC_AL.EnumOidDefs() ) { // if unable to initiate request        
  605.         top.Rstatus.Pstat("Unable to start the OID lookup request",true);
  606.         processResetButton();    
  607.     }
  608.     else { // waiting for OperationCompleteEvent
  609.         top.Rstatus.Pstat("One moment while OID lookup request completes");
  610.     }
  611. }
  612. var gOIDstrg = "";
  613. var gOIDarray = new Array();
  614. function processOIDLookupRecord(OIDstrg) {
  615.     gOIDstrg = OIDstrg; // save
  616.     gOIDarray = OIDstrg.split("~"); // parse
  617.     var gset = ( ALMode == "New" ) ? "0" : "0";
  618.     for ( var i=0; i<gOIDarray.length-1; i+=4 ) {
  619.         gOIDarray[i] = gset; // default to none selected if New
  620.     }
  621.     displayOIDChoices(); // display them
  622.     processInitialLookup("STTCompLookup");
  623. }
  624. function displayOIDChoices() {
  625.     if ( CurSelTab == "CounterTab" ) {
  626.         AL_OIDName.innerHTML = ""; // clear
  627.         addElementToSelect(AL_OIDName,"List of SNMP Trap OIDs for this Watch/Alert...");
  628.         addElementToSelect(AL_OIDName,"___________________________________");
  629.         for ( var i=0; i<gOIDarray.length-1; i+=4 ) {
  630.             if ( gOIDarray[i] == "1" ) { // if Chosen
  631.                 addElementToSelect(AL_OIDName,gOIDarray[i+1]+" ( "+gOIDarray[i+2]+" )");
  632.             }
  633.         }
  634.     }
  635. }
  636. function processOID_New() {
  637.     OID_Select.style.display = "none";
  638.     OID_Define.style.display = "";
  639.     if ( processOIDCheck() ) {
  640.         AL_nOIDNme.focus();
  641.     }
  642.     else {
  643.         AL_nOIDId.focus();
  644.     }
  645. }
  646. function processOIDCheck() {
  647.     if ( AL_nOIDAdd.checked ) {
  648.         AL_nOIDNme.className = "";
  649.         AL_nOIDNme.disabled = "";
  650.         AL_nOIDDesc.className = "";
  651.         AL_nOIDDesc.disabled = "";
  652.         return true;
  653.     }
  654.     else {
  655.         AL_nOIDNme.value = ""
  656.         AL_nOIDNme.className = "idis";
  657.         AL_nOIDNme.disabled = "disabled";
  658.         AL_nOIDDesc.value = ""
  659.         AL_nOIDDesc.className = "idis";
  660.         AL_nOIDDesc.disabled = "disabled";
  661.         return false;
  662.     }
  663. }
  664.  
  665. function processOID_newOK() {
  666.     if ( AL_nOIDId.value == "" ) {
  667.         alert("Please enter an SNMP Trap OID!");
  668.         AL_nOIDId.focus();
  669.         return;
  670.     }
  671.     if ( AL_nOIDAdd.checked ) {
  672.         // Add OID Def to Dictionary
  673.         if ( AL_nOIDNme.value == "" ) {
  674.             alert("Please enter an SNMP Trap Name!");
  675.             AL_nOIDNme.focus();
  676.             return;
  677.         }
  678.         OID_Select.style.display = "";
  679.         OID_Define.style.display = "none";
  680.         // Add OID Def to Dictionary
  681.         if ( RpmCC_AL.OidDefs("1","0",AL_nOIDNme.value+"~"+AL_nOIDId.value+"~"+AL_nOIDDesc.value) ) { 
  682.             top.Rstatus.Pstat("Unable to start the OID update request",true);
  683.         }
  684.         else {
  685.             top.Rstatus.Pstat("One moment while OID is added to the Definition Dictionary");
  686.         }
  687.     }
  688.     else {
  689.         OID_Select.style.display = "";
  690.         OID_Define.style.display = "none";
  691.         processCustomOID();
  692.     }
  693. }
  694. function processOIDDict(DRstat) {
  695.     var warr = new Array();
  696.     warr = DRstat.split("~")
  697.     if ( warr[1] == "0" ) { //if successful
  698.         processCustomOID();
  699.     }
  700.     else {
  701.         alert("Error updating OID dictionary: "+warr[1]);
  702.         processOID_New(); // go retry
  703.     }
  704. }
  705.  
  706. function processCustomOID() {
  707.     //add to array
  708.     var i = gOIDarray.length-1;
  709.     gOIDarray[i++] = "1";
  710.     gOIDarray[i++] = AL_nOIDNme.value;
  711.     gOIDarray[i++] = AL_nOIDId.value;
  712.     gOIDarray[i++] = AL_nOIDDesc.value;
  713.     gOIDarray[i++] = "1"; //pseudo value
  714.     reButtonSt(); // restore button state
  715.     processOIDChoices();
  716.     top.Rstatus.Pstat("Done");
  717. }
  718. function processOIDNewRead() {
  719.     gOIDstrg = OIDstrg; // save
  720.     gOIDarray = OIDstrg.split("~"); // parse
  721.     var gset = ( ALMode == "New" ) ? "1" : "0";
  722.     for ( var i=0; i<gOIDarray.length-1; i+=4 ) {
  723.         gOIDarray[i] = gset; // default to all selected if New
  724.     }
  725.     displayOIDChoices(); // display them
  726. }
  727. function processOID_newCancel() {
  728.     OID_Select.style.display = "";
  729.     OID_Define.style.display = "none";
  730. }
  731. // Get OIDs and Computers for this Alert Group
  732. function processPopulateSNMPTrapComputers() {
  733.     if ( gOIDarray.length == 0 ) {
  734.         procOIDLookup(); // get OIDs    
  735.     }
  736.     else {
  737.         for ( var k=0; k<gOIDarray.length-1; k+=4 ) {
  738.             gOIDarray[k] = "0"; // reset
  739.         }
  740.          processSNMPTrapPopIn("");
  741.     }
  742. }
  743. // Continue here after OID Lookup
  744. function processSNMPTrapPopIn(OIDstrg) {
  745.     if ( OIDstrg != "" ) {
  746.         gOIDstrg = OIDstrg; // save
  747.         gOIDarray = OIDstrg.split("~"); // parse
  748.         for ( var i=0; i<gOIDarray.length-1; i+=4 ) {
  749.             gOIDarray[i] = "0"; // default to none selected
  750.         }
  751.     }
  752.     if ( RpmCC_AL.SnmpTrapMonitorFindByAGId(curAGRPID) ) { // if unable to initiate request        
  753.         ALupMode = "";
  754.         PINP_Bsy = false;
  755.         top.Rstatus.Pstat("Unable to start the SNMPTrapWatch Server/Device lookup request",true);
  756.     }
  757.     else {
  758.         CountOfComps = CountOfCompsRcvd = 0; 
  759.         CompIdLupArr = ""; // Computer Id Array
  760.         ALupMode = "SNMPTrapComputerLookupPopIn"; // Mode
  761.         top.Rstatus.Pstat("One moment while SNMPTrapWatch Server/Device lookup request completes");
  762.     }
  763. }
  764. // Process Read of SNMP Trap Monitors by AGId
  765. var SNMPTrapCompRecs = new Array();
  766. function processPopulateSNMPTrapComputersContinue(coidstrg) {
  767.     var warr1 = new Array();
  768.     var warr2 = new Array();
  769.     warr1 = coidstrg.split("~");
  770.     warr2 = warr1[1].split(":");
  771.     if ( warr2[0] == "Err" ) {
  772.         ALupMode = "";
  773.         PINP_Bsy = false;    
  774.         top.Rstatus.Pstat("Unsuccessful Lookup; "+warr1[1],true);   
  775.         return;
  776.     }
  777.     SNMPTrapCompRecs = coidstrg.split(";"); // parse out the Trap Monitor Computer records
  778.     for ( var i=0; i<SNMPTrapCompRecs.length-1; i++ ) { // process out Trap Monitor records
  779.         ++CountOfCompsRcvd;
  780.         warr1 = SNMPTrapCompRecs[i].split("~"); // parse each record
  781.         if ( i == 0 ) { // if first one, get OIDs
  782.             AL_Suspend.checked = (warr1[1] == "0") ? "checked" :"";
  783.             for ( var j=4; j<warr1.length; j++ ) {
  784.                 // for each OID, enable for display
  785.                 for ( var k=0; k<gOIDarray.length-1; k+=4 ) {
  786.                     if ( gOIDarray[k+2] == warr1[j] ) { // find it
  787.                         gOIDarray[k] = "1"; // enable for display
  788.                         break;
  789.                     }
  790.                 }
  791.                 if ( k >= gOIDarray.length-1 ) { //if not found, add to array
  792.                     k = gOIDarray.length-1;
  793.                     gOIDarray[k++] = "1";
  794.                     gOIDarray[k++] = "";
  795.                     gOIDarray[k++] = warr1[j];
  796.                     gOIDarray[k++] = "";
  797.                     gOIDarray[k++] = "1"; //pseudo value
  798.                 }
  799.             }
  800.             displayOIDChoices(); // display them
  801.         }
  802.         else {
  803.              CompIdLupArr += ","; // Computer Id Array
  804.         }
  805.         CompIdLupArr += warr1[2]; // Computer Id Array
  806.     }
  807.     AL_CCOneSNMPTrap.style.overflow = ( CountOfCompsRcvd > 9 ) ? "scroll" : "";
  808.     processPopulateCounterInputComplete();
  809. }
  810.  
  811. // Event Log Alert Routines
  812. function processELTree() {
  813.     processInitialLookup("ELCompLookup");
  814. }
  815.  
  816. function processFileCheckTree() {
  817.     processInitialLookup("FCCompLookup");
  818. }
  819.  
  820. function processSyslogCheckTree() {
  821.     processInitialLookup("SLCompLookup");
  822. }
  823.  
  824. function processProcessCheckTree() {
  825.     processInitialLookup("PCCompLookup");
  826. }
  827.  
  828. function processFilterSet() { }
  829. function processSpecifyButton() {
  830.     // Set selected computers if Edit mode
  831.     if ( ALMode == "Edit" ) {
  832.         if ( CurrentAT == WinServicesType ) {
  833.             processWSTEdit();
  834.         }
  835.         else {
  836.             // preset not selected
  837.             for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  838.                 AC_CompStoreArr[j+4] = "0"; 
  839.             }
  840.             var cluparr = new Array();
  841.             // get selected Computer IDs
  842.             cluparr = CompIdLupArr.split(",");
  843.             for ( var i=0; i<cluparr.length; i++ ) {
  844.                 // for each selected Computer, find it and set selected
  845.                 for ( j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) {
  846.                     if ( cluparr[i] == AC_CompStoreArr[j] ) {
  847.                         AC_CompStoreArr[j+4] = "1"; // set selected
  848.                         break;
  849.                     }
  850.                 }
  851.             }
  852.         }
  853.     }
  854.     if ( !(ALMode == "Edit" && CurrentAT == WinServicesType) ) {
  855.         if ( lima0.expanded == "0"  ) { // expand first group if necessary
  856.             procGrpImgClick(lima0,true);
  857.         }
  858.     }
  859.     SetButtonState(UUpdateButton,"0");
  860.     SetButtonState(UResetButton,"0");
  861.     top.Rstatus.Pstat("Done");
  862. }
  863.  
  864. /* Get only the Alert Name from Store based on Alert ID */
  865. function getOnlyAlertName(AgID) {
  866.     var AlertName = "";
  867.     for (i=0, j=0; i < AlertStoreArr.length; ++j, i+=AlertRecLength) {
  868.         if ( AlertStoreArr[i+1] == AgID ) {
  869.             AlertName = AlertStoreArr[i];
  870.             break;
  871.         }
  872.     }
  873.     return AlertName;
  874. }
  875.  
  876. // Do nothing click handler for in use Computer 
  877. function procDoNothing() {
  878.     return;
  879. }
  880.  
  881.  
  882. function processPLocClick() {
  883.     if    ( document.RunPrgmRadio.AL_PLoc[2].checked )    {
  884.          AL_ExecP.className = "idis"; 
  885.         AL_ArgsP.className = "idis"; 
  886.     }
  887.     else {
  888.         AL_ExecP.className = ""; 
  889.         AL_ArgsP.className = ""; 
  890.     }
  891. }
  892. function GoStartIPServiceLookup() {
  893.     // Do Services Lookup
  894.     ServicesRecCount = 0; // reset count
  895.     ALMode = "ServicesLookup";
  896.     rstat = RpmCC_AL.ServicesLookup("","","ComputerID,ID DESC");    
  897.     if ( rstat ) { // if unable to initiate request        
  898.         top.Rstatus.Pstat("Unable to start the IP Services lookup request",true);
  899.         processResetButton();    
  900.     }
  901.     else { // waiting for OperationCompleteEvent
  902.         top.Rstatus.Pstat("One moment while IP Services lookup request completes");
  903.     }
  904. }
  905.  
  906. /* Process Alert/Object OP Complete Event */
  907. var updSrvcName = "";
  908. function processAlertOpComplete() {
  909.     var wrkarr = new Array();
  910.     top.Rstatus.Pstat("Request Completed");
  911.     if (ALMode == "Lookup") {
  912.         // Win Services Lookup
  913.         if ( WinServicesLUPreqd ) {
  914.             ALMode = "WinServicesLookup";
  915.             WinServicesArr.length = 0; // reset Array
  916.             rstat = RpmCC_AL.NTServicesListLookupId("0");    
  917.             if ( rstat ) { // if unable to initiate request        
  918.                 top.Rstatus.Pstat("Unable to start the WinServicesWatch lookup request",true);
  919.                 processResetButton();    
  920.             }
  921.             else { // waiting for OperationCompleteEvent
  922.                 top.Rstatus.Pstat("One moment while WinServicesWatch lookup request completes");
  923.             }
  924.         }
  925.         else {
  926.             GoStartIPServiceLookup(); // Start IP Services Lookup
  927.         }
  928.     }
  929.     else if (ALMode == "ObjectLookup") {
  930.         rss = ""; // default null status message
  931.         if (AlertLupRecCount == 0) { // check if any Alert Group records found
  932.             rss += "No records found for Watch/Alert lookup";    
  933.         }
  934.         if (ServicesRecCount == 0) { // check if any Service records found
  935.             if ( rss.length > 0 ) {
  936.                 rss += " & for IP Services lookup";
  937.             }
  938.             else {
  939.                 rss = "No records found for IP Services lookup";    
  940.             }
  941.         }
  942.         if (ObjectLupRecCount == 0) { // check if any Object records found
  943.             if ( rss.length > 0 ) {
  944.                 rss += " & for Object/Counter lookup";
  945.             }
  946.             else {
  947.                 rss = "No records found for Object/Counter lookup";    
  948.             }
  949.         }
  950.         else {
  951.             /* Get name of Last Object in Store */
  952.             LastObjectName = AL_OCStoreArr[(ObjectLupRecCount-1)*ObjectRecLength];
  953.             ObjectLUPreqd = false;
  954.         }
  955.         if ( rss.length > 0 ) {
  956.             top.Rstatus.Pstat(rss);    
  957.         }
  958.         else {
  959.             top.Rstatus.Pstat("Done");
  960.         }
  961.         processGoodResetButton();    
  962.     }
  963.     else if (ALMode == "Edit") {
  964.         /* update the Storage */
  965.         if ( CurrentAT == CounterType || CurrentAT == UserType ) { // if Counter or User or EventLog checked
  966.             ALMode = "";
  967.             finishEditComplete();
  968.         }
  969.         else if ( CurrentAT == EventLogType ) {
  970.             // if unable to initiate request        
  971.             if ( RpmCC_AL.ELMonitorDelAllByAlertGroupID(curAGRPID) ) { 
  972.                 top.Rstatus.Pstat("Unable to update the EventLogWatch",true);
  973.                 processResetButton();
  974.             }
  975.             else { // waiting for OperationCompleteEvent
  976.                 ALupMode = "ELMDelAll";
  977.                 top.Rstatus.Pstat("One moment while UPDATE request completes");
  978.                 processGeneralClick(CounterTab);
  979.             }
  980.         }
  981.         else if ( CurrentAT == SNMPTrapType ) {
  982.            ALupMode = "SNMPTrapEdit";
  983.            processSNMPTRapEdit();
  984.           }
  985.         else if ( CurrentAT == WinServicesType ) {
  986.            ALupMode = "WSMonitorEdit";
  987.            WSM_ArIndex = 0;
  988.            processWSMonitorEdit();
  989.           }
  990.         else if ( CurrentAT == FileCheckType ) {
  991.            ALupMode = "FileCheckEdit";
  992.            processFileCheckEdit();
  993.           }
  994.         else if ( CurrentAT == ProcessCheckType ) {
  995.            ALupMode = "ProcessCheckEdit";
  996.            processProcessCheckEdit();
  997.           }
  998.         else if ( CurrentAT == SyslogCheckType ) {
  999.            ALupMode = "SyslogCheckEdit";
  1000.            processSyslogCheckEdit();
  1001.           }
  1002.         else { // Service Alert edit
  1003.             // Sort CompIDs and reform to a string
  1004.             wrkarr = CompIdLupArr.split(",");
  1005.             wrkarr = wrkarr.sort(); // sort Computer IDs
  1006.             CompIdLupArr = wrkarr.join(",");
  1007.             updSrvcName = (curSrvcName == "SQL") ? "SQLCONNECT" : curSrvcName;
  1008.  
  1009.             // Disable Specified Services to be checked
  1010.             if ( RpmCC_AL.ServicesAlertDisabled(updSrvcName,curAGRPID,CompIdLupArr) ) { // if unable to initiate request        
  1011.                 top.Rstatus.Pstat("Unable to start the UPDATE request",true);
  1012.                 processResetButton();
  1013.             }
  1014.             else { // waiting for OperationCompleteEvent
  1015.                 top.Rstatus.Pstat("One moment while UPDATE request completes");
  1016.                 processGeneralClick(CounterTab);
  1017.             }
  1018.         }
  1019.     }    
  1020.     else if (ALMode == "Delete") {
  1021.         /* update the Storage */
  1022.         var i = AlertRecLength*AlertSelectIdx;
  1023.         for (var j = i+AlertRecLength; j < AlertStoreArr.length; ++i, ++j) {
  1024.             AlertStoreArr[i] = AlertStoreArr[j];
  1025.         }
  1026.         AlertStoreArr.length -= AlertRecLength;                
  1027.  
  1028.         if ( CurrentAT == ServiceType ) { // if Service Alert
  1029.             // Reset orig settings 
  1030.            for ( var i=0; i<AC_ServicesStoreArr.length; i+=ServicesRecLength ) {
  1031.                if ( AC_ServicesStoreArr[i+1] == curAGRPID ) {
  1032.                    AC_ServicesStoreArr[i+1] = 0; // clear Alert Group ID
  1033.                }
  1034.             }
  1035.         }        
  1036.         AL_AlertSel.remove(AlertSelectIdx);
  1037.         if (AL_AlertSel.length == 0) { // if no more Alerts
  1038.             AL_Desc.value = ""; // clear Description field
  1039.             AL_Thrsh.value = ""; // clear Threshold field
  1040.             AL_Dur.value = ""; // clear Duration field
  1041.             AL_ExecP.value = ""; // clear Execute Program field
  1042.             AL_ArgsP.value = ""; // clear Program Args field
  1043.             AL_EAddr.value = ""; // clear Email Addr field
  1044.             AL_ESubj.value = ""; // clear Email Subj field
  1045.  
  1046.             AL_TUnder.checked = "";
  1047.             AL_EveryT.checked = "";
  1048.                AL_RunIt.checked = "";
  1049.             AL_ENotify.checked = "";
  1050.  
  1051.             AlertLupRecCount = 0; // clear Lookup record counter
  1052.         }
  1053.         processGoodResetButton(); 
  1054.     }
  1055.     else { // ALMode New
  1056.         /* Reset for next */
  1057.         processAlLookupReset();
  1058.     }
  1059. }
  1060.  
  1061. // Finish the Edit Op Complete processing
  1062. function finishEditComplete() {
  1063.     updateStore(AlertSelectIdx);
  1064.     processCommonReset(); // common button and field reset
  1065.     populateInput(AlertRecLength*AlertSelectIdx); // set input fields
  1066.     AL_AlertSel.disabled = "";
  1067.     if ( AL_AlertSel.style.visibility != "hidden" ) {
  1068.         AL_AlertSel.focus();    
  1069.     }
  1070. }
  1071.  
  1072. // Process Alert/Object OP Complete Event 
  1073. function processAlertAddOpComplete(nagid) {
  1074.       if ( CurrentAT == CounterType  || CurrentAT == UserType ) { // if Counter or User checked
  1075.         top.Rstatus.Pstat("Request Completed");
  1076.         processAlLookupReset();
  1077.         return;
  1078.     }
  1079.     curAGRPID = nagid; // update current Alert Group ID 
  1080.     if ( CurrentAT == EventLogType ) {
  1081.        ALupMode = "ELMonitorAdd";
  1082.        processELMonitorAdd();
  1083.       }
  1084.     else if ( CurrentAT == SNMPTrapType ) {
  1085.        ALupMode = "SNMPTrapAdd";
  1086.        processSNMPTRapAdd();
  1087.       }
  1088.     else if ( CurrentAT == WinServicesType ) {
  1089.        ALupMode = "WSMonitorAdd";
  1090.        WSM_ArIndex = 0;
  1091.        processWSMonitorAdd("");
  1092.     }
  1093.     else if ( CurrentAT == FileCheckType ) {
  1094.        ALupMode = "FileCheckAdd";
  1095.        processFileCheckAdd();
  1096.       }
  1097.     else if ( CurrentAT == ProcessCheckType ) {
  1098.        ALupMode = "ProcessCheckAdd";
  1099.        processProcessCheckAdd();
  1100.       }
  1101.     else if ( CurrentAT == SyslogCheckType ) {
  1102.        ALupMode = "SyslogCheckAdd";
  1103.        processSyslogCheckAdd();
  1104.       }
  1105.     // go update the Enabled Services Alert
  1106.     else { // Services
  1107.         ALMode = "ServicesAdd";
  1108.         processServicesAlertEnable(nagid);
  1109.     }
  1110. }    
  1111.  
  1112. /* Process common button and field reset items */
  1113. function processCommonReset() {
  1114.     AL_Desc.className = "idis";
  1115.     AL_Thrsh.className = "idis";
  1116.     AL_Dur.className = "idis";
  1117.     AL_Sched.className = "idis";
  1118.     AL_SrvFreq.className = "idis";
  1119.     AL_MaxAlerts.className = "idis";
  1120.     AL_Dependency.className = "idis";
  1121.     AL_InactPer1.className = "idis";
  1122.     AL_InactPer2.className = "idis";
  1123.     AL_CWRestore.className = "idis";
  1124.     AL_CWRestore.disabled = "disabled";
  1125.     AL_WASeverity.style.display = "";
  1126.     AL_WASeveritySel.style.display = "none";
  1127.     
  1128.     
  1129.     AL_EvSrc.className = "idis";
  1130.     AL_EvID.className = "idis";
  1131.     AL_EvCat.className = "idis";
  1132.     AL_EvMsg.className = "idis";
  1133.     AL_LogAnd.className = "idis";
  1134.     AL_LogAnd.disabled = "disabled";
  1135.     AL_LogExclude.className = "idis";
  1136.     AL_LogExclude.disabled = "disabled";
  1137.     AL_LogNot.className = "idis";
  1138.     AL_LogNot.disabled = "disabled";
  1139.     AL_LogName.style.display = "";
  1140.     AL_LogNameSel.style.display = "none";
  1141.     AL_LogType.style.display = "";
  1142.     AL_LogTypeSel.style.display = "none";
  1143.     AL_ELPrec.className = "idis";
  1144.     AL_ELPrec.disabled = "disabled";
  1145.  
  1146.     AL_FileAnd.className = "idis";
  1147.     AL_FileAnd.disabled = "disabled";
  1148.     AL_FileNot.className = "idis";
  1149.     AL_FileNot.disabled = "disabled";
  1150.     //AL_FCPrec.className = "idis";
  1151.     //AL_FCPrec.disabled = "disabled";
  1152.     AL_FileInterval.className = "idis";
  1153.  
  1154.     AL_MemCheck.className = "idis";
  1155.     AL_HDDCheck.className = "idis";
  1156.  
  1157.     SrvcHint.style.visibility ="hidden";
  1158.     CounterHint.style.visibility ="hidden";
  1159.     TrapHint.style.visibility ="hidden";
  1160.     OIDChoiceButton.style.display = "none";
  1161.     AL_OIDName.className = "idis"; 
  1162.     
  1163.     AL_FileCheckPath.className = "idis";
  1164.     AL_FileCheckString.className = "idis";
  1165.     AL_FileCheckSize.className = "idis";
  1166.     AL_DeltaSize.className = "idis";
  1167.     AL_DeltaSize.disabled = "disabled";
  1168.     AL_DeltaDT.className = "idis";
  1169.     AL_DeltaDT.disabled = "disabled";
  1170.  
  1171.     AL_ProcessPath.className = "idis";
  1172.     AL_ProcessName.className = "idis";
  1173.     ProcCPUMax.className = "idis";
  1174.     ProcMemory.className = "idis";
  1175.     ProcPP.className = "idis";
  1176.     ProcNPP.className = "idis";
  1177.     ProcPF.className = "idis";
  1178.     ProcInstanceCount.className = "idis";
  1179.     ProcDuration.className = "idis";
  1180.     ProcExclWildCard.className = "idis";
  1181.     ProcNotifyOnly.className = "idis";
  1182.     ProcNotifyOnly.disabled = "disabled";
  1183.     ProcRestart.className = "idis";
  1184.     ProcRestart.disabled = "disabled";
  1185.     ProcTerminate.className = "idis";
  1186.     ProcTerminate.disabled = "disabled";
  1187.     PCEnumButton.style.visibility = "hidden";
  1188.     ProcRunningRadio[0].disabled = "disabled";
  1189.     ProcRunningRadio[1].disabled = "disabled";
  1190.     ProcRunningRadio[0].className = "idis";
  1191.     ProcRunningRadio[1].className = "idis";
  1192.  
  1193.     AL_SLFacility.className = "idis";
  1194.     AL_SLSeverity.className = "idis";
  1195.     AL_SLTag.className = "idis";
  1196.     AL_SLContent.className = "idis";
  1197.     AL_SLAnd.className = "idis";
  1198.     AL_SLAnd.disabled = "disabled";
  1199.     AL_SLPrec.className = "idis";
  1200.     AL_SLPrec.disabled = "disabled";
  1201.     FACButton.style.visibility = "hidden";
  1202.     SEVButton.style.visibility = "hidden";
  1203.     
  1204.     AL_ExecP.className = "idis"; 
  1205.     AL_ArgsP.className = "idis"; 
  1206.     AL_EAddr.className = "idis"; 
  1207.     AL_ESubj.className = "idis"; 
  1208.     AL_PhoneNbr.className = "idis"; 
  1209.     AL_AccessNbr.className = "idis"; 
  1210.     AL_PagePswd.className = "idis"; 
  1211.     AL_TTSpeak.className = "idis"; 
  1212.     AL_BeeperNbr.className = "idis"; 
  1213.     AL_TTSend.className = "idis"; 
  1214.     
  1215.     AL_TUnder.className = "idis";
  1216.     AL_EveryT.className = "idis";
  1217.     AL_Suspend.className = "idis";
  1218.     AL_RunIt.className = "idis";
  1219.     AL_ENotify.className = "idis";
  1220.     AL_Phone.className = "idis";
  1221.     AL_Beeper.className = "idis";
  1222.  
  1223.     AL_TUnder.disabled = "disabled";
  1224.     AL_EveryT.disabled = "disabled";
  1225.     AL_Suspend.disabled = "disabled";
  1226.     AL_RunIt.disabled = "disabled";
  1227.     AL_ENotify.disabled = "disabled";
  1228.     AL_Phone.disabled = "disabled";
  1229.     AL_Beeper.disabled = "disabled";
  1230.  
  1231.     AL_Dependency.style.display = "";
  1232.     AL_DependencySel.style.display = "none";
  1233.  
  1234.       document.RunPrgmRadio.AL_PLoc[0].className = "idis";
  1235.       document.RunPrgmRadio.AL_PLoc[1].className = "idis";
  1236.       document.RunPrgmRadio.AL_PLoc[2].className = "idis";
  1237.     document.RunPrgmRadio.AL_PLoc[0].disabled = "disabled";
  1238.     document.RunPrgmRadio.AL_PLoc[1].disabled = "disabled";
  1239.     document.RunPrgmRadio.AL_PLoc[2].disabled = "disabled";
  1240.     
  1241.     document.WinSrvcRadio.AL_WinSrvcDisp[0].disabled = "disabled";
  1242.     document.WinSrvcRadio.AL_WinSrvcDisp[1].disabled = "disabled";
  1243.     document.WinSrvcRadio.AL_WinSrvcDisp[0].className = "idis";
  1244.     document.WinSrvcRadio.AL_WinSrvcDisp[1].className = "idis";
  1245.     AL_WSRestart.disabled = "disabled";
  1246.     AL_WSRestart.className = "idis";
  1247.     WSTSelect.style.visibility = "hidden";
  1248.     WinSrvcRadioDisplay.style.visibility = "hidden";
  1249.  
  1250.     bIPSelC.style.visibility = "hidden";
  1251.     bIPUselC.style.visibility = "hidden";
  1252.     bIPSelE.style.visibility = "hidden";
  1253.     bIPUselE.style.visibility = "hidden";
  1254.     
  1255.     bELSelC.style.visibility = "hidden";
  1256.     bELUselC.style.visibility = "hidden";
  1257.  
  1258.     bSTSelC.style.visibility = "hidden";
  1259.     bSTUselC.style.visibility = "hidden";
  1260.  
  1261.     bFCSelC.style.visibility = "hidden";
  1262.     bFCUselC.style.visibility = "hidden";
  1263.  
  1264.     bPCSelC.style.visibility = "hidden";
  1265.     bPCUselC.style.visibility = "hidden";
  1266.  
  1267.     bSLSelC.style.visibility = "hidden";
  1268.     bSLUselC.style.visibility = "hidden";
  1269.  
  1270.     /* enable and disable appropriate buttons */
  1271.     //SetButtonState(UNewButton,"0");    
  1272.     SetButtonState(UUpdateButton,"1");    
  1273.     SetButtonState(UResetButton,"1");
  1274.  
  1275.     /* enable appropriate Alert Name fields */
  1276.     AL_Alert.style.display = "none";
  1277.     AL_AlertSel.style.display = "";
  1278. }
  1279.  
  1280. function processKeyPress() {
  1281.     /* get KeyCode and check if invalid */
  1282.     kc = event.keyCode;
  1283.     stat = 1; // default to OK
  1284.  
  1285.     // Keys:   ~            %           [           ]           #           !
  1286.     if (kc == 126 ||    kc == 37 || kc == 91 ||    kc == 93 /*|| kc == 35*/ || kc == 33) { // Not acceptable 
  1287.         stat = 0;
  1288.     } // Keys:        *           ?
  1289.     else if ( (/*kc == 42 ||*/ kc == 63) &&  event.srcElement.name != "AL_Alert"  ) { //Not acceptable
  1290.         stat = 0;
  1291.     }
  1292.     if (stat == 0) { // if Not Acceptable
  1293.         event.returnValue=false;
  1294.         //top.Rstatus.Pstat("Keys ~%*?[]#! are not accepted for this field");    
  1295.         top.Rstatus.Pstat("Keys ~%?[]! are not accepted for this field");    
  1296.         alert("Keys ~%?[]! are not accepted for this field");    
  1297.     }
  1298.     else {
  1299.         top.Rstatus.Pstat(""); // clear status line
  1300.     }
  1301. }    
  1302.  
  1303. // Process Serverices LOOKUP Record Event
  1304. var ServicesRecLength = 4; // Services Lookup record length
  1305. var AC_ServicesStoreArr = new Array();
  1306. function processServicesRecord(SRVstrg) {
  1307.     var warr = new Array();
  1308.     warr = SRVstrg.split("~");
  1309.     var j = ServicesRecCount * ServicesRecLength;
  1310.      AC_ServicesStoreArr[j] = warr[1]; // Computer ID
  1311.       AC_ServicesStoreArr[j+1] = warr[2]; // AlertGroup ID
  1312.       warr[3] = (warr[3] == "SQLCONNECT") ? "SQL" : warr[3];
  1313.       AC_ServicesStoreArr[j+2] = warr[3]; // Type
  1314.       AC_ServicesStoreArr[j+3] = SRVstrg; 
  1315.     ++ServicesRecCount; // bump record counter    
  1316. }
  1317.  
  1318. // Prcoess Services Operation Complete Event
  1319. function processServicesOpComplete() {
  1320.     if (ALMode == "ServicesLookup") {
  1321.         if ( ObjectLUPreqd ) { // Need to Lookup Objects
  1322.             ObjectLupRecCount = 0; // clear Lookup record counter
  1323.             AL_OCStoreArr.length = 0;
  1324.             if ( RpmCC_AL.ObjectLookupForObjCompArray("*") ) {
  1325.                 ALMode = "";
  1326.                 top.Rstatus.Pstat("Unable to start the Object lookup request",true);
  1327.             }
  1328.             else {
  1329.                 ALMode = "ObjectLookup"; // set Mode of operation
  1330.                 top.Rstatus.Pstat("One moment while Object lookup request completes");
  1331.                 return;
  1332.             }
  1333.         }
  1334.         processGoodResetButton(); 
  1335.     }
  1336.     else if (ALMode == "ServicesAdd") {
  1337.         ALMode = ""; // reset mode
  1338.         processAlLookupReset();
  1339.         if ( top.QuickStartProcessing ) {
  1340.             alert("When finished, exit this 'Configure Watches/Alerts' screen and continue with the 'QuickStart' steps screen.  Next, you will show the ServerWatch Status display of the Servers/Computers you are now monitoring");
  1341.             top.QuickStartProcessing = false;
  1342.         }
  1343.     }
  1344.     else if (ALMode == "ServicesEdit") {
  1345.         ALMode = ""; // reset mode
  1346.         finishEditComplete();
  1347.     }
  1348.     else if (ALMode == "Edit") {
  1349.         // go update the Enabled Services Alert
  1350.         ALMode = "ServicesEdit";
  1351.         processServicesAlertEnable(curAGRPID);
  1352.     }
  1353.     else if (ALMode == "New") {
  1354.         /* Reset for next */
  1355.         processAlLookupReset();
  1356.     }
  1357. }
  1358.  
  1359. var FreqArg = ""; // initialize
  1360. function processServicesAlertEnable(agid) {
  1361.     var wrkarr = new Array();
  1362.     var sortarr = new Array();
  1363.     FreqArg=""; // initailize
  1364.     // Determine Frequency parameters argument
  1365.     for ( var i=0; i<4; i++ ) {
  1366.         FreqArg += ( i == SrvUnits ) ? SrvCount : "0";
  1367.        FreqArg += ",";
  1368.     }
  1369.     FreqArg += ( AL_Suspend.checked ) ? "1" : "0"; // determine Suspend flag
  1370.     
  1371.     if ( updSrvcName == "AGENT" ) {
  1372.        FreqArg += ",";
  1373.         FreqArg += AL_MemCheck.value; 
  1374.        FreqArg += ",";
  1375.         FreqArg += AL_HDDCheck.value; 
  1376.     }    
  1377.     // Sort CompIDs and reform to a string
  1378.     wrkarr = SrvCIDArr.split(",");
  1379.     wrkarr = wrkarr.sort(); // sort Computer IDs
  1380.     sortarr = wrkarr.join(",");
  1381.     // Add Services to be checked
  1382.     updSrvcName = (curSrvcName == "SQL") ? "SQLCONNECT" : curSrvcName;
  1383.     if ( RpmCC_AL.ServicesAlertEnabled(updSrvcName,FreqArg,agid,sortarr) ) { // if unable to initiate request        
  1384.         top.Rstatus.Pstat("Unable to start the UPDATE request",true);
  1385.         processResetButton();
  1386.     }
  1387.     else { // waiting for OperationCompleteEvent
  1388.         top.Rstatus.Pstat("One moment while UPDATE request completes");
  1389.         processGeneralClick(CounterTab);
  1390.     }
  1391. }
  1392.  
  1393. /* Process Object Lookup Record Event */
  1394. var    ObjectRecLength = 3; // Object Lookup record length
  1395. var AL_OCStoreArr = new Array();
  1396. function processObjectLookup(ONme,ODesc,OCIdA) {
  1397.     var i = ObjectLupRecCount * ObjectRecLength;
  1398.     AL_OCStoreArr[i++] = ONme; 
  1399.     AL_OCStoreArr[i++] = ODesc; 
  1400.     AL_OCStoreArr[i] = OCIdA;
  1401.     ++ObjectLupRecCount; // bump record received counter
  1402. }
  1403.  
  1404. /* Process Counter Lookup Record Event */
  1405. function processCounterLookup(CN,CD,OA) {
  1406.     /* If PopulateInput, Go process */
  1407.     if (ALupMode == "CounterLookupPopIn") {
  1408.         processPopulateInputCounter(CN,CD,OA);
  1409.     } 
  1410.     /* If Counter Edit, Go process */
  1411.     else if (ALupMode == "CounterLookupEdit") {
  1412.         processEditCounter(CN,CD,OA);
  1413.     } 
  1414. }
  1415.  
  1416. /* Process Computer Lookup Record Event */
  1417. function processComputerLookup(Cid,CNme,CDesc) {
  1418.     /* If PopulateInput,  Go process */
  1419.     if (ALupMode == "ComputerLookupPopIn") {
  1420.         ++CountOfCompsRcvd;
  1421.         processPopulateInputComputer(CNme,CDesc,Cid);
  1422.     } 
  1423.     if (ALupMode == "ComputerLookupEdit") {
  1424.         processEditComputer(CNme,CDesc,Cid);
  1425.     } 
  1426.     if (ALupMode == "SrvComputerLookupEdit") {
  1427.         processEditSrvComputer(CNme,CDesc,Cid);
  1428.     } 
  1429. }
  1430.  
  1431. /* Process Click on Duration Field */
  1432. function processSchedClick() {
  1433.     if ( document.all.AL_Sched.className == "idis" ) {
  1434.         return;
  1435.     }
  1436.     if (  SchedState == "0") { // if closed
  1437.         SchedState = "1";
  1438.         document.all.SchedIn.style.display = "none";
  1439.         document.all.SchedDD.style.display = "";
  1440.         document.all.AL_SchedCount.options[CDCount-1].selected = "selected";
  1441.         document.all.AL_SchedUnits.options[CDUnits].selected = "selected";
  1442.     }
  1443.     else {
  1444.         SchedState = "0"; // closed
  1445.         CDUnits = document.all.AL_SchedUnits.selectedIndex;
  1446.         CDCount = document.all.AL_SchedCount.selectedIndex+1;
  1447.         document.all.SchedIn.style.display = "";
  1448.         document.all.SchedDD.style.display = "none";
  1449.         document.all.AL_Sched.value = " " + CDCount + " " + SchedTxtArray[CDUnits];
  1450.     }
  1451. }
  1452.  
  1453. /* Process Click on Service Check Frequency Field */
  1454. function processSrvFreqClick() {
  1455.     if ( document.all.AL_SrvFreq.className == "idis" ) {
  1456.         return;
  1457.     }
  1458.     if (  SrvFreqState == "0") { // if closed
  1459.         SrvFreqState = "1";
  1460.         document.all.FreqIn.style.display = "none";
  1461.         document.all.FreqDD.style.display = "";
  1462.         document.all.AL_SrvFreqCount.options[SrvCount-1].selected = "selected";
  1463.         document.all.AL_SrvFreqUnits.options[SrvUnits].selected = "selected";
  1464.     }
  1465.     else {
  1466.         SrvFreqState = "0"; // closed
  1467.         SrvUnits = document.all.AL_SrvFreqUnits.selectedIndex;
  1468.         SrvCount = document.all.AL_SrvFreqCount.selectedIndex+1;
  1469.         document.all.FreqIn.style.display = "";
  1470.         document.all.FreqDD.style.display = "none";
  1471.         document.all.AL_SrvFreq.value = " " + SrvCount + " " + SchedTxtArray[SrvUnits];
  1472.     }
  1473. }
  1474.  
  1475. /* Process Click on Max Alerts Field */
  1476. function processMaxAlertsClick() {
  1477.     if ( AL_MaxAlerts.className == "idis" ) {
  1478.         return;
  1479.     }
  1480.     if (  MaxAlertsState == "0") { // if closed
  1481.         MaxAlertsState = "1";
  1482.         AL_MaxAlerts.style.display = "none";
  1483.         MaxAlertsDD.style.display = "";
  1484.         AL_MaxAlertsCount.options[MaxAlertsCount].selected = "selected";
  1485.     }
  1486.     else {
  1487.         MaxAlertsState = "0";
  1488.         AL_MaxAlerts.style.display = "";
  1489.         MaxAlertsDD.style.display = "none";
  1490.         MaxAlertsCount = AL_MaxAlertsCount.selectedIndex;
  1491.         AL_MaxAlerts.value = " " + MaxAlertsCount;
  1492.     }
  1493. }
  1494.  
  1495. /* Process Click on Suppress Monitoring Field */
  1496. var Suppress1 = new Array();
  1497. var Suppress2 = new Array();
  1498. function processInactivePeriodsClick() {
  1499.     if ( AL_InactPer1.className == "idis" ) {
  1500.         return;
  1501.     }
  1502.     if ( SuppressMonitoringState == "0") { // if closed
  1503.         SuppressMonitoringState = "1";
  1504.         InactPer.style.display = "none";
  1505.         InactPerDD.style.display = "";
  1506.  
  1507.         AL_InactPerDaysS1.selectedIndex = Suppress1[0];
  1508.         AL_InactPerDaysE1.selectedIndex = Suppress1[1];
  1509.         AL_InactPerHours1S.selectedIndex = Suppress1[2];
  1510.         AL_InactPerHours1E.selectedIndex = Suppress1[3];
  1511.         AL_InactPerMins1S.selectedIndex = Suppress1[4];
  1512.         AL_InactPerMins1E.selectedIndex = Suppress1[5];
  1513.  
  1514.         AL_InactPerDaysS2.selectedIndex = Suppress2[0];
  1515.         AL_InactPerDaysE2.selectedIndex = Suppress2[1];
  1516.         AL_InactPerHours2S.selectedIndex = Suppress2[2];
  1517.         AL_InactPerHours2E.selectedIndex = Suppress2[3];
  1518.         AL_InactPerMins2S.selectedIndex = Suppress2[4];
  1519.         AL_InactPerMins2E.selectedIndex = Suppress2[5];
  1520.     }
  1521.     else {
  1522.         SuppressMonitoringState = "0";
  1523.         InactPer.style.display = "";
  1524.         InactPerDD.style.display = "none";
  1525.         
  1526.         Suppress1[0] = AL_InactPerDaysS1.selectedIndex;
  1527.         Suppress1[1] = AL_InactPerDaysE1.selectedIndex;
  1528.         Suppress1[2] = AL_InactPerHours1S.selectedIndex;
  1529.         Suppress1[3] = AL_InactPerHours1E.selectedIndex;
  1530.         Suppress1[4] = AL_InactPerMins1S.selectedIndex;
  1531.         Suppress1[5] = AL_InactPerMins1E.selectedIndex;
  1532.         processInactPer1Value(); // go set value
  1533.                 
  1534.         Suppress2[0] = AL_InactPerDaysS2.selectedIndex;
  1535.         Suppress2[1] = AL_InactPerDaysE2.selectedIndex;
  1536.         Suppress2[2] = AL_InactPerHours2S.selectedIndex;
  1537.         Suppress2[3] = AL_InactPerHours2E.selectedIndex;
  1538.         Suppress2[4] = AL_InactPerMins2S.selectedIndex;
  1539.         Suppress2[5] = AL_InactPerMins2E.selectedIndex;
  1540.         processInactPer2Value(); // go set value        
  1541.     }   
  1542. }
  1543. function processInactPer1Value() {
  1544.     if ( Suppress1.join(",") == "0,0,0,0,0,0" ) {
  1545.          AL_InactPer1.value = "";
  1546.     }
  1547.     else {
  1548.         AL_InactPer1.value = InactDaysArray[ Suppress1[0] ];
  1549.         AL_InactPer1.value += "-"+InactDaysArray[ Suppress1[1] ];
  1550.         AL_InactPer1.value += "  "+ ((Suppress1[2] < 10) ? "0"+Suppress1[2] : Suppress1[2]);
  1551.         AL_InactPer1.value += ":"+ ((Suppress1[4] < 10) ? "0"+Suppress1[4] : Suppress1[4]);
  1552.         AL_InactPer1.value += " - "+ ((Suppress1[3] < 10) ? "0"+Suppress1[3] : Suppress1[3]);
  1553.         AL_InactPer1.value += ":"+ ((Suppress1[5] < 10) ? "0"+Suppress1[5] : Suppress1[5]);
  1554.     }
  1555. }
  1556.  
  1557. function processInactPer2Value() {
  1558.     if ( Suppress2.join(",") == "0,0,0,0,0,0" ) {
  1559.          AL_InactPer2.value = "";
  1560.     }
  1561.     else {
  1562.         AL_InactPer2.value = InactDaysArray[ Suppress2[0] ];
  1563.         AL_InactPer2.value += "-"+InactDaysArray[ Suppress2[1] ];
  1564.         AL_InactPer2.value += "  "+ ((Suppress2[2] < 10) ? "0"+Suppress2[2] : Suppress2[2]);
  1565.         AL_InactPer2.value += ":"+ ((Suppress2[4] < 10) ? "0"+Suppress2[4] : Suppress2[4]);
  1566.         AL_InactPer2.value += " - "+ ((Suppress2[3] < 10) ? "0"+Suppress2[3] : Suppress2[3]);
  1567.         AL_InactPer2.value += ":"+ ((Suppress2[5] < 10) ? "0"+Suppress2[5] : Suppress2[5]);
  1568.     }
  1569. }
  1570.  
  1571. /* Close Calendar  Fields if opened */
  1572. function closeCalendarTimeFields() {
  1573.     if ( SchedState == "1" ) { // if Schedule opened
  1574.        processSchedClick(); // close it
  1575.     }
  1576.     if ( SrvFreqState == "1" ) { // if ServiceFrequency opened
  1577.        processSrvFreqClick(); // close it
  1578.     }
  1579.     if ( MaxAlertsState == "1" ) { // if Max Alert Count opened
  1580.        processMaxAlertsClick(); // close it
  1581.     }
  1582. }
  1583.  
  1584. /* Process DB Error in Services Lookup Operation */
  1585. function processServicesOpError() {
  1586.     alert("An error occurred during a Services operation");
  1587.     processResetButton(); // reset
  1588. }
  1589.  
  1590. var UNewSv,UEditSv,UDelSv,UUpSv,UResSv,UDupSv;
  1591. var     SMTPAddrCancel = false;
  1592. var sWASeverity = "";
  1593. function processSmtpServer() {
  1594.     var wrk = new Array();
  1595.     wrk = SmtpServerAddress.split("~"); // change the "~" to ";"
  1596.     
  1597.     PopUpConfirm.style.display=""; // enable Smtp Confirm pop-up
  1598.     SetButtonState(SMTPAddrOKButton,"0");
  1599.     SMTPAddrCancel = false;
  1600.     GlobalSmtp.value = wrk.join("; "); // prime the fields
  1601.     GlobalFrom.value = AL_OrigDomain.value;
  1602.     GlobalSmtp.focus();
  1603.     sWASeverity = AL_WASeveritySel.style.visibility;
  1604.     AL_WASeveritySel.style.visibility = "hidden";
  1605.     
  1606.     svButtonSt(); // save button state
  1607. }
  1608. function processSpecAT() {
  1609.     if (AL_SpecAT.selectedIndex < 0)
  1610.         AL_SpecAT.selectedIndex = 0;
  1611.     PopUpAT.style.display=""; // enable AT Spec pop-up
  1612.     AL_SpecAT.focus();
  1613.     svButtonSt(); // save button state
  1614. }
  1615. function processOKSpecAT() {
  1616.     PopUpAT.style.display="none"; // disable AT Spec pop-up
  1617.     reButtonSt(); // restore button states
  1618.     top.Rstatus.Pstat("");
  1619.     CurrentAT = AL_SpecAT.options[AL_SpecAT.selectedIndex].value;
  1620.     processTypeClick();
  1621.     processNewContinue();
  1622. }    
  1623. function processSpecATCancelButton() {
  1624.     PopUpAT.style.display="none"; // disable Add Confirm pop-up
  1625.     reButtonSt(); // restore button states
  1626.     SetButtonState(UUpdateButton,"1");    
  1627.     SetButtonState(UResetButton,"1");
  1628.     top.Rstatus.Pstat("");
  1629. }    
  1630.     
  1631. function processSmtpConfirmCancelButton() {
  1632.     SMTPAddrCancel = true;
  1633.     PopUpConfirm.style.display="none"; // disable Add Confirm pop-up
  1634.     AL_WASeveritySel.style.visibility = sWASeverity;
  1635.     reButtonSt(); // restore button states
  1636.     top.Rstatus.Pstat("");
  1637. }    
  1638.  
  1639. var GSmtpArr = new Array();
  1640. var GSmtpArrOK = new Array();
  1641. var GSmtpIx = 0;    
  1642. var GSmtpOK = 0;
  1643. function processSmtpConfirmOKButton() {
  1644.     SetButtonState(SMTPAddrOKButton,"1");
  1645.     GSmtpArr.length = GSmtpArrOK.length = 0;
  1646.     GSmtpArr = GlobalSmtp.value.split(";");
  1647.     GSmtpIx = GSmtpOK = 0;
  1648.     processSmtpConfirmOK_Continue();
  1649. }
  1650. function processSmtpConfirmOK_Continue() {
  1651.     var wrk = new Array();
  1652.     GSmtpArr[GSmtpIx] = TrimLeadingSpaces(GSmtpArr[GSmtpIx]);
  1653.     wrk = GSmtpArr[GSmtpIx].split(":");
  1654.     wrk[1] = (wrk.length < 2) ? "25" : wrk[1];
  1655.     top.Rstatus.Pstat("One moment while the SMTP Server address '"+GSmtpArr[GSmtpIx]+"' is verified",true);
  1656.     RpmMIL.Smtp(wrk[0],wrk[1],15);
  1657. }
  1658. function processSmtpResponse(ReqID,RetCode,Reason) {
  1659.     if (     SMTPAddrCancel ) {
  1660.         return; // ignore   
  1661.    }
  1662.     if ( RetCode == 0 ) {
  1663.         top.Rstatus.Pstat("SMTP Server address '"+GSmtpArr[GSmtpIx]+"' is verified");
  1664.         GSmtpArrOK[GSmtpOK++] = GSmtpArr[GSmtpIx];
  1665.     }
  1666.     else {
  1667.        alert("SMTP Server address '"+GSmtpArr[GSmtpIx]+"' verify failed. Response message: "+Reason);
  1668.     }
  1669.     if ( ++GSmtpIx >= GSmtpArr.length ) { // if checked all
  1670.        if ( GSmtpOK == 0 ) {
  1671.            alert("Unsuccessful check of all specified SMTP Server(s). Try again");
  1672.               SetButtonState(SMTPAddrOKButton,"0");
  1673.        }
  1674.        else {
  1675.            var Strg = "Accept the successful SMTP Server(s): ";
  1676.             GlobalSmtp.value = GSmtpArrOK.join("; ");
  1677.             Strg += "'"+GlobalSmtp.value+"'";
  1678.            if ( confirm( Strg ) ) {
  1679.                processSmtpAccept();
  1680.             }
  1681.             else {
  1682.                   SetButtonState(SMTPAddrOKButton,"0");
  1683.             }
  1684.         }
  1685.     }
  1686.     else {
  1687.        processSmtpConfirmOK_Continue(); // do next
  1688.     }
  1689. }
  1690. function processSmtpAccept() {
  1691.     var wrk = new Array();
  1692.     SmtpServerAddress = GSmtpArrOK.join("~");
  1693.  
  1694.     AL_Smtp.value = GlobalSmtp.value;
  1695.     AL_OrigDomain.value = GlobalFrom.value;
  1696.     SmtpServerAuthStatus = (AL_PSmtpAuth.checked) ? "1" : "0";
  1697.     AL_SmtpAuth.checked = (SmtpServerAuthStatus == "1") ? "checked" : "";
  1698.     SmtpServerAuthLogin = AL_SmtpLogin.value = (SmtpServerAuthStatus == "1") ? AL_PSmtpLogin.value : "";    
  1699.     SmtpServerAuthPswd = AL_SmtpPswd.value = (SmtpServerAuthStatus == "1") ? AL_PSmtpPswd.value : "";    
  1700.     RpmCC_AL.SetGlobalSMTP(SmtpServerAddress+";"+GlobalFrom.value); // save Global setting & in Registry
  1701.     RpmCC_AL.RegSetKey(top.banner.ServerID+"GlobalSMTPServer",SmtpServerAddress+";"+GlobalFrom.value); 
  1702.     RpmCC_AL.SetGlobalSMTPAuth(SmtpServerAuthStatus+";"+SmtpServerAuthLogin+";"+SmtpServerAuthPswd);         
  1703.     PopUpConfirm.style.display="none"; // disable Add Confirm pop-up
  1704.     AL_WASeveritySel.style.visibility = sWASeverity;
  1705.     reButtonSt(); // restore button states
  1706.     top.Rstatus.Pstat("SMTP Server address(es) set");
  1707. }
  1708.  
  1709. function TrimLeadingSpaces(Ostrg) {
  1710.     for ( var i=0; i<Ostrg.length; i++ ) {
  1711.         if ( Ostrg.charAt(i) != " " ) 
  1712.             break;
  1713.     }
  1714.     if ( i > 0 ) 
  1715.         Ostrg = Ostrg.substr(i);
  1716.     return Ostrg;
  1717. }
  1718.  
  1719. function svButtonSt() {
  1720.     // Get and save button states
  1721.     UNewSv = UNewButton.bdis;    
  1722.     UEditSv = UEditButton.bdis;    
  1723.     UDupSv = UDupButton.bdis;    
  1724.     UDelSv = UDeleteButton.bdis;
  1725.     UUpSv = UUpdateButton.bdis;
  1726.     UResSv = UResetButton.bdis;
  1727.     initButtonState(); // disable buttons
  1728. }
  1729. function reButtonSt() {
  1730.     SetButtonState(UNewButton,UNewSv);    
  1731.     SetButtonState(UEditButton,UEditSv);    
  1732.     SetButtonState(UDupButton,UDupSv);    
  1733.     SetButtonState(UDeleteButton,UDelSv);
  1734.     SetButtonState(UUpdateButton,UUpSv);    
  1735.     SetButtonState(UResetButton,UResSv);
  1736. }
  1737.  
  1738. function processBeeperTest() {
  1739.     var Tstrg = ""+PgBpPort.options[PgBpPort.selectedIndex].text+";";
  1740.     Tstrg += AL_BeeperNbr.value+";"+(BeepSecs.selectedIndex+1)+";"+AL_TTSend.value;
  1741.     SetCursor("wait");
  1742.     top.banner.processStartComm();
  1743.     SetButtonState(BTestButton,"1");
  1744.     RpmCC_AL.BeeperTest(Tstrg);
  1745.     top.Rstatus.Pstat("One moment while the Beeper test completes",true);
  1746. }
  1747.  
  1748. function processProgramTest() {
  1749.     var Tstrg = "processProgramTest;";
  1750.     var AEp = AL_ExecP.value;
  1751.     if ( document.RunPrgmRadio.AL_PLoc[1].checked ) { // if Remote checked
  1752.         AEp = ">"+AEp;
  1753.     }
  1754.     else if ( document.RunPrgmRadio.AL_PLoc[2].checked ) { // if Remote Reboot checked
  1755.         AEp = '>"RESTART"';
  1756.     }
  1757.     if ( AEp.length == 0) {
  1758.         top.Rstatus.Pstat("Please select a Name of Program to Run on Alert Action",true);    
  1759.         alert("Please select a Name of Program to Run on Alert Action");    
  1760.         processGeneralClick(ActsTab);
  1761.         processRunPSetup();
  1762.         return;
  1763.     }
  1764.     Tstrg += AEp+";"+AL_ArgsP.value;
  1765.     ProgramTestInProgress = true;
  1766.     SetCursor("wait");
  1767.     top.banner.processStartComm();
  1768.     SetButtonState(PrgTestButton,"1");
  1769.     RpmCC_AL.EmailTest(Tstrg);
  1770.     top.Rstatus.Pstat("One moment while the Execute Program test completes",true);
  1771. }
  1772.  
  1773. function processPagerTest() {
  1774.     var Tstrg = ""+PgBpPort.options[PgBpPort.selectedIndex].text+";";
  1775.  
  1776.     var warrAN = new Array();
  1777.     warrAN = AL_AccessNbr.value.split(";");
  1778.     var AccessNbr = warrAN.join("[+]");
  1779.     warrAN = AL_PhoneNbr.value.split(";");
  1780.     var PhoneNbr = warrAN.join("[+]");
  1781.     warrAN = AL_PagePswd.value.split(";");
  1782.     var PagePswd = warrAN.join("[+]");
  1783.     
  1784.     Tstrg += AccessNbr+"^"+PagePswd+";"+PhoneNbr+";"+AL_TTSpeak.value;
  1785.     SetCursor("wait");
  1786.     top.banner.processStartComm();
  1787.     SetButtonState(PTestButton,"1");
  1788.     RpmCC_AL.PagerTest(Tstrg);
  1789.     top.Rstatus.Pstat("One moment while the Pager test completes",true);
  1790. }
  1791.  
  1792. function processEmailTest() {
  1793.     var warr = new Array();
  1794.     var Tstrg = "";
  1795.     if ( AL_EAddr.value == "" ) {
  1796.         alert("Please enter a valid Email address to send the Test Email");
  1797.         AL_EAddr.focus();
  1798.         return;
  1799.     }
  1800.  
  1801.     if ( AL_OrigDomain.value.length > 0 ) {
  1802.        Tstrg += AL_OrigDomain.value;
  1803.    }
  1804.     else {
  1805.        Tstrg += "MonitorIT_Email_Test"
  1806.     }
  1807.     warr = AL_EAddr.value.split(";");
  1808.     AL_EAddr.value = warr.join(",");
  1809.     Tstrg += ";"+AL_EAddr.value+";"+AL_ESubj.value+";"+SmtpServerAddress;
  1810.     
  1811.     SetCursor("wait");
  1812.     top.banner.processStartComm();
  1813.     SetButtonState(ETestButton,"1");
  1814.     RpmCC_AL.EmailTest(Tstrg);
  1815.     top.Rstatus.Pstat("One moment while the Email test completes",true);
  1816. }
  1817.  
  1818.  
  1819. function processEmailSetup() {
  1820.     Acts1.style.display = "";
  1821.     Acts2.style.display = "none";
  1822.     Acts3.style.display = "none";
  1823.     Acts4.style.display = "none";
  1824. }
  1825. function processPagerSetup() {
  1826.     Acts1.style.display = "none";
  1827.     Acts2.style.display = "";
  1828.     Acts3.style.display = "none";
  1829.     Acts4.style.display = "none";
  1830. }
  1831. function processBeeperSetup() {
  1832.     Acts1.style.display = "none";
  1833.     Acts2.style.display = "none";
  1834.     Acts3.style.display = "";
  1835.     Acts4.style.display = "none";
  1836. }
  1837. function processRunPSetup() {
  1838.     Acts1.style.display = "none";
  1839.     Acts2.style.display = "none";
  1840.     Acts3.style.display = "none";
  1841.     Acts4.style.display = "";
  1842. }
  1843.  
  1844. function processPgBpPortChange() {
  1845.     var Bstrg = ""+(BeepSecs.selectedIndex+1)+";";
  1846.     Bstrg += PgBpPort.options[PgBpPort.selectedIndex].text;
  1847.     RpmCC_AL.SetGlobalBeeper(Bstrg); // save Global setting
  1848. }
  1849.  
  1850. /* Process Combo Alert Name Change Event */
  1851. function processDefAlertName() {
  1852.     initButtonState();
  1853.     Nobj = document.all.AL_AlertSel; // get object
  1854.     for (i=0; i < Nobj.length; ++i) {
  1855.         if ( Nobj.options[i].selected ) {
  1856.             AlertSelectIdx = i;
  1857.             AL_AlertSel.blur();
  1858.             populateInput(AlertRecLength*i);
  1859.             break;
  1860.         }
  1861.     }
  1862. }
  1863.  
  1864. /* Set initial button state for all buttons */
  1865. function initButtonState() {
  1866.     SetButtonState(UNewButton,"1");    
  1867.     SetButtonState(UEditButton,"1");    
  1868.     SetButtonState(UDupButton,"1");    
  1869.     SetButtonState(UDeleteButton,"1");
  1870.     SetButtonState(UUpdateButton,"1");    
  1871.     SetButtonState(UResetButton,"1");
  1872. }
  1873. function    checkEnableSchedButton() { // Enable Schedule Button?
  1874. }
  1875.  
  1876. // Reset DB Change Event flag
  1877. function resetDBCEF() {
  1878.     CTid = null;
  1879.     ignoreDBChangeEvent = false;
  1880. }
  1881.  
  1882. /* Reset Processing after initial and subsequent Alert operations */
  1883. function processResetButton() {
  1884.     ErrProcFlag = true;
  1885.     processGoodResetButton();
  1886. }
  1887. var ErrProcFlag = false;
  1888. function processGoodResetButton() {
  1889.     top.banner.processStopCommX();
  1890.     AlertSelectIdx = (ALMode == "Edit" || DuplicateFlag) ? AlertSelectIdx : 0; // reset index
  1891.     ALMode = "";
  1892.     ALupMode = "";
  1893.     PINP_Bsy = DuplicateFlag = false;
  1894.     if ( CollapseButton.style.display != "none" ) {
  1895.        processCollapseButton();
  1896.     }
  1897.     if ( SuppressMonitoringState == "1") { // if opened
  1898.         SuppressMonitoringState = "0";
  1899.         InactPer.style.display = "";
  1900.         InactPerDD.style.display = "none";
  1901.     }
  1902.     
  1903.       AL_CCOne.innerHTML = ""; // clear current display<HR>
  1904.       AL_CCOneServ.innerHTML = ""; // clear current display
  1905.       AL_CCOneEventLog.innerHTML = ""; // clear current display
  1906.       AL_CCOneWinServ.innerHTML = ""; // clear current display
  1907.       AL_CCOneFileCheck.innerHTML = ""; // clear current display
  1908.       AL_CCOneProcessCheck.innerHTML = ""; // clear current display
  1909.       AL_CCOneSyslogCheck.innerHTML = ""; // clear current display
  1910.     if ( AlertLupRecCount == 0 ) {
  1911.         AlertSelectIdx = 0; // reset index
  1912.         closeCalendarTimeFields(); // Insure D/T fields closed
  1913.       processCommonReset();
  1914.          SetButtonState(UNewButton,"0");    
  1915.           SetButtonState(UEditButton,"1");    
  1916.           SetButtonState(UDupButton,"1");    
  1917.         SetButtonState(UDeleteButton,"1");
  1918.         AL_CCOne.style.backgroundColor = "threedlightshadow";
  1919.         AL_CCOne.style.height = CCOneBoxHeight;
  1920.         AL_CCOneServ.style.backgroundColor = "threedlightshadow";
  1921.         AL_CCOneServ.style.height = CCOneBoxHeight;
  1922.         AL_CCOneEventLog.style.backgroundColor = "threedlightshadow";
  1923.         AL_CCOneEventLog.style.height = CCOneBoxHeight;
  1924.         AL_CCOneWinServ.style.backgroundColor = "threedlightshadow";
  1925.         AL_CCOneWinServ.style.height = CCOneBoxHeight;
  1926.         AL_CCOneFileCheck.style.backgroundColor = "threedlightshadow";
  1927.         AL_CCOneFileCheck.style.height = CCOneBoxHeight;
  1928.         AL_CCOneProcessCheck.style.backgroundColor = "threedlightshadow";
  1929.         AL_CCOneProcessCheck.style.height = CCOneBoxHeight;
  1930.         AL_CCOneSyslogCheck.style.backgroundColor = "threedlightshadow";
  1931.         AL_CCOneSyslogCheck.style.height = CCOneBoxHeight;
  1932.         CurrentAT = ServiceType;    
  1933.         processTypeClick();
  1934.         SrvcNmeRow.style.visibility = "visible";
  1935.         if ( top.QuickStartProcessing ) {
  1936.             showHelp('Help/QuickStart_Help.htm#ConfigureWatches');
  1937.             CurrentAT = ServiceType;
  1938.             processNewContinue();
  1939.             window.focus();
  1940.         }
  1941.     }
  1942.     else {    
  1943.         SetButtonState(UUpdateButton,"1");    
  1944.          SetButtonState(UResetButton,"1");
  1945.         processGeneralClick(CounterTab);
  1946.         Tid = setTimeout("processResetFinish()",10); // delay 10 ms. then finish Reset
  1947.     }
  1948. }
  1949.  
  1950. function processResetFinish() {
  1951.     Tid = null; // clear timeout ID
  1952.     closeCalendarTimeFields(); // Insure D/T fields closed
  1953.     processCommonReset(); // common button and field reset
  1954.     if ( ErrProcFlag == true ) {
  1955.         AlertSelectIdx = 0; // reset index
  1956.         ErrProcFlag = false; // reset and exit
  1957.          SetButtonState(UNewButton,"0");    
  1958.           SetButtonState(UEditButton,"0");    
  1959.           SetButtonState(UDupButton,"0");    
  1960.         SetButtonState(UDeleteButton,"0");
  1961.         return;
  1962.     }
  1963.     if ( LastNewName != null ) {
  1964.         getAlertID(LastNewName);
  1965.         //populateInput(AlertRecLength*AlertSelectIdx);
  1966.         //AL_AlertSel.options[AlertSelectIdx].selected = "selected";
  1967.         LastNewName = null; // reset
  1968.     }
  1969.     //else {
  1970.     //    populateInput(0); // set input fields
  1971.     //    AL_AlertSel.options[0].selected = "selected";
  1972.     //}
  1973.     populateInput(AlertRecLength*AlertSelectIdx);
  1974.     AL_AlertSel.options[AlertSelectIdx].selected = "selected";
  1975. }
  1976.  
  1977. function PopUpContextOpen() {
  1978.     AL_SpecAT.style.visibility = "hidden";
  1979.     AL_AlertSel.style.visibility = "hidden";
  1980.     AL_EvLogName.style.visibility = "hidden";
  1981.     AL_EvLogType.style.visibility = "hidden";
  1982.     AL_SchedCount.style.visibility = "hidden";
  1983.     AL_SchedUnits.style.visibility = "hidden";
  1984.     AL_SrvFreqCount.style.visibility = "hidden";
  1985.     AL_SrvFreqUnits.style.visibility = "hidden";
  1986.     AL_MaxAlertsCount.style.visibility = "hidden";
  1987.     AL_OIDName.style.visibility = "hidden";
  1988.     AL_DependencySel.style.visibility = "hidden";
  1989.     AL_SLPrec.style.visibility = "hidden";
  1990.     AL_ELPrec.style.visibility = "hidden";
  1991.     PgBpPort.style.visibility = "hidden";
  1992.     BeepSecs.style.visibility = "hidden";
  1993.     PopUpFAC.style.display = "none";
  1994.     if ( CurrentAT == ProcessCheckType ) {
  1995.         PopUpFAC.style.display = "none";
  1996.     }
  1997. }
  1998. function PopUpContextClose() {
  1999.     AL_SpecAT.style.visibility = "visible";
  2000.     AL_AlertSel.style.visibility = "visible";
  2001.     AL_EvLogName.style.visibility = "visible";
  2002.     AL_EvLogType.style.visibility = "visible";
  2003.     AL_SchedCount.style.visibility = "visible";
  2004.     AL_SchedUnits.style.visibility = "visible";
  2005.     AL_SrvFreqCount.style.visibility = "visible";
  2006.     AL_SrvFreqUnits.style.visibility = "visible";
  2007.     AL_MaxAlertsCount.style.visibility = "visible";
  2008.     AL_DependencySel.style.visibility = "visible";
  2009.     AL_OIDName.style.visibility = "visible";
  2010.     AL_SLPrec.style.visibility = "visible";
  2011.     AL_ELPrec.style.visibility = "visible";
  2012.     PgBpPort.style.visibility = "visible";
  2013.     BeepSecs.style.visibility = "visible";
  2014. }
  2015.  
  2016. function checkSelUnselButtons() {
  2017. }
  2018.  
  2019. // Create new Window and load specified Page
  2020. function processAdminComputerButton() {
  2021.     processPopUpSelect(10,false);
  2022.     return;
  2023. }
  2024.  
  2025. /* Process Click on selected Tab */
  2026. var CurSelTab = null; // current selected tab
  2027. function processActionClick(th) {
  2028.     Acts1.style.display="none";
  2029.     Acts2.style.display="none";
  2030.     Acts3.style.display="none";
  2031.     Acts4.style.display="none";
  2032.     EmailTab.className="TabUnsel";
  2033.     PagerTab.className="TabUnsel";
  2034.     BeeperTab.className="TabUnsel";
  2035.     ProgramTab.className="TabUnsel";
  2036.     th.className="TabSel";
  2037.  
  2038.     CurSelTab = th.id;
  2039.     switch ( th.id ) {
  2040.    case "EmailTab" : 
  2041.      Acts1.style.display=""; // Enable this Tab's view
  2042.       break;
  2043.    case "PagerTab" : 
  2044.        Acts2.style.display=""; // Enable this Tab's view
  2045.       break;
  2046.    case "BeeperTab" : 
  2047.       Acts3.style.display=""; // Enable this Tab's view
  2048.       break;
  2049.    case "ProgramTab" : 
  2050.       Acts4.style.display=""; // Enable this Tab's view
  2051.       break;
  2052.     }
  2053. }
  2054. var test = false;
  2055. var waitapply = false;
  2056. var testnumber = 0;
  2057. var testcount = 0;
  2058. function startTestButton() {
  2059.     if ( test ) {
  2060.         if ( waitapply ) {
  2061.             if ( UEditButton.bdis == "0" ) {
  2062.                 Tid = setTimeout("startTestButton()",TestDelayTime); // delay 
  2063.                 if ( top.Rstatus.statw.innerText == "Request Completed" ) {
  2064.                     waitapply = false;
  2065.                 }
  2066.                 return;
  2067.             }
  2068.         }
  2069.         if ( UEditButton.bdis == "0" ) {
  2070.             processEditButton();
  2071.             Tid = setTimeout("startTestButton()",TestDelayTime); // delay 
  2072.             return;
  2073.         }
  2074.         else if ( UUpdateButton.bdis == "0" ) {
  2075.             if ( testnumber == 0 ) {
  2076.                 processUpdateButton();
  2077.             }
  2078.             else {
  2079.                 processGoodResetButton()
  2080.             }
  2081.             ++testcount;
  2082.             waitapply = true;
  2083.         }
  2084.         Tid = setTimeout("startTestButton()",100); // delay 
  2085.     }
  2086. }
  2087.  
  2088. var TestDelayTime = 100;
  2089. function processAdjustTestTime() {
  2090.     TestDelayTime += 1000;
  2091.     if ( TestDelayTime > 11000 ) {
  2092.          TestDelayTime = 100;
  2093.      }
  2094.     top.Rstatus.Pstat("Test Time Delay = "+TestDelayTime+" ms.");
  2095.      
  2096. }