home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / 01_03.iso / software / snpf / NPF / NPF.MSI / AlertAst.exe / HTML / ALERTAST.JS < prev    next >
Encoding:
JavaScript  |  2002-09-21  |  5.5 KB  |  191 lines

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. //strKnownApplicationList is the list of known programs.  When adding to this
  4. //list, be sure to prepend the operating system type to the new entries.
  5. //The following operating system types are supported:
  6. //98, me, 2k, xp
  7. //
  8. ///////////////////////////////////////////////////////////////////////////
  9.  
  10. var strKnownApplicationList = "98_subsystem,98_svchost.exe,98_rundll32.exe,98_wininit.exe,me_subsystem,me_svchost.exe,me_rundll32.exe,me_explorer.exe,me_spool32.exe, 2k_subsystem,2k_svchost.exe,2k_mstask.exe,2k_navapw32.exe,2k_csrss.exe,2k_lsass.exe,2k_winlogon.exe, xp_subsystem,xp_svchost.exe,xp_mstsc.exe,xp_rdpclip.exe,xp_mstask.exe,xp_navapw32.exe,xp_csrss.exe,xp_lsass.exe";
  11.  
  12.  
  13. function getArgs()
  14. {
  15.   var args = new Object();
  16.   var query = location.href.substring(
  17.     location.href.indexOf('#') + 1,
  18.     location.href.length);
  19.   
  20.   var pairs = query.split(",");               // Break at comma.
  21.   for(var i = 0; i < pairs.length; i++)
  22.   {
  23.     var pos = pairs[i].indexOf('=');          // Look for "name=value".
  24.     if (pos == -1)
  25.       continue;                               // If not found, skip.
  26.     var argname = pairs[i].substring(0,pos);  // Extract the name.
  27.     var value = pairs[i].substring(pos+1);    // Extract the value.
  28.     args[argname] = unescape(value);          // Store as a property.
  29.   }
  30.   return args;                                // Return the object.
  31. }
  32.  
  33. function DrawFooter()
  34. {
  35.     //Depending on the version of the product, pick the
  36.     //appropriate footer graphic
  37.  
  38.     var WrapNisum = new ActiveXObject("WrapUM.WrapNISUM");
  39.     var pt = WrapNisum.ProductType;
  40.     var szFooter;
  41.     
  42.     switch(pt)
  43.     {
  44.     case "PT_NPF":
  45.         szFooter = "<img border=0 src=\"branding_bar_npf.gif\"/>";
  46.            break;
  47.     case "PT_PRO":
  48.         szFooter = "<img border=0 src=\"branding_bar_nispro.gif\"/>";
  49.            break;
  50.     default:
  51.         szFooter = "<img border=0 src=\"branding_bar.gif\"/>";
  52.            break;
  53.     }
  54.     
  55.     document.write(szFooter);
  56. }
  57.  
  58. function DrawPopup(strProgramName)
  59. {
  60.     //alert("KnownApplications.htm#" + strProgramName + "#" + location.href);
  61.     window.navigate("KnownApplications.htm#" + strProgramName + "#" + location.href);
  62. }
  63.  
  64. function DrawProgramName(strProgramName)
  65. {
  66.     //Build string to represent which operating system we have.  This will be appended to the program name
  67.     //when we test to see if it is one we have additional info for.
  68.     var args = getArgs();
  69.     var strProgNameWithOS = strProgramName;
  70.  
  71.     //Special case for "Windows Subsystem"
  72.     if (strProgNameWithOS == "Windows Subsystem")
  73.     {
  74.         strProgNameWithOS = "subsystem";
  75.     }
  76.  
  77.     if (args.os)
  78.     {
  79.       strProgNameWithOS = args.os + "_" + strProgNameWithOS;
  80.     }
  81.  
  82.     strKnownApplicationList = strKnownApplicationList.toLowerCase();
  83.     if (strKnownApplicationList.indexOf(strProgNameWithOS.toLowerCase()) >= 0)
  84.     {
  85.         oPROGNAME.innerHTML = "<a href='KnownApplications.htm" + "?from=" + location.href + "#" + strProgramName + "' onClick=\"DrawPopup('" + strProgNameWithOS + "');return false\">" + strProgramName + "</a>";
  86.         //alert(oPROGNAME.innerHTML);
  87.     }
  88.     else
  89.     {
  90.         oPROGNAME.innerText = strProgramName;
  91.     }
  92. }
  93.  
  94. function VisualTracking_OnClick(objAnchor)
  95. {
  96.     window.open(String(objAnchor.href), String(objAnchor.target), "width=830, height=785, toolbar=no, menubar=no, location=no, directories=no, resizable=yes, scrollbars=yes");
  97.     return false;
  98. }
  99.  
  100. function GetCountryCode()
  101. {
  102.     return navigator.systemLanguage;
  103. }
  104.  
  105. function DrawVisualTrackingLink(strIPAddr)
  106. {
  107.     var szLangID = GetCountryCode();
  108.  
  109.     // Figure out what version of the product this is
  110.     //
  111.  
  112.     // var pt = WrapNisum.ProductType;
  113.     var pid = "NIS2003";
  114.     var pt;
  115.     var args = getArgs();
  116.     
  117.     if (args.pt)
  118.     {
  119.         switch(pt)
  120.         {
  121.         case "PT_NPF":
  122.            pid = "NPF2003";
  123.            break;
  124.         case "PT_SCF":
  125.            pid = "SCF2003";
  126.            break;
  127.         case "PT_PRO":
  128.            pid = "NISPro2003";
  129.            break;
  130.         default:
  131.            pid = "NIS2003";
  132.            break;
  133.         }
  134.     }
  135.  
  136.     var strRet = "<a href='http://visualtracking.symantec.com/default.asp?productid=" + pid + "&langid=" + szLangID + "&venid=sym" + "&go=" + strIPAddr + "' target='VisualTracking' onClick='return VisualTracking_OnClick(this)'>" + strIPAddr + "</a>";
  137.     return strRet;
  138. }
  139.  
  140. function ToggleMoreDetails()
  141. {
  142.     if(window.oMORE_DETAILS_TEXT.style.display == "")
  143.     {
  144.         window.oMORE_DETAILS_TEXT.style.display ="none";
  145.         img_Arrow_MoreDetails.src = "blue_arrow_rt.gif";
  146.     }
  147.     else
  148.     {
  149.         window.oMORE_DETAILS_TEXT.style.display ="";    
  150.         img_Arrow_MoreDetails.src = "blue_arrow_dn.gif";
  151.     }
  152. }
  153.  
  154. function ToggleReduceAlerts()
  155. {
  156.     if(window.oREDUCE_ALERTS_TEXT.style.display == "")
  157.     {
  158.         window.oREDUCE_ALERTS_TEXT.style.display ="none";
  159.         img_Arrow_ReduceAlerts.src = "blue_arrow_rt.gif";
  160.     }
  161.     else
  162.     {
  163.         window.oREDUCE_ALERTS_TEXT.style.display ="";    
  164.         img_Arrow_ReduceAlerts.src = "blue_arrow_dn.gif";
  165.     }
  166. }
  167.  
  168. function ToggleWhatShouldIDo()
  169. {
  170.     if(window.oWHAT_SHOULD_I_DO_TEXT.style.display == "")
  171.     {
  172.         window.oWHAT_SHOULD_I_DO_TEXT.style.display ="none";
  173.         img_Arrow_WhatShouldIDo.src = "blue_arrow_rt.gif";
  174.     }
  175.     else
  176.     {
  177.         window.oWHAT_SHOULD_I_DO_TEXT.style.display ="";
  178.         img_Arrow_WhatShouldIDo.src = "blue_arrow_dn.gif";
  179.     }
  180. }
  181.  
  182. function CollapseSections()
  183. {
  184.     // Collapse these text by default
  185.     window.oMORE_DETAILS_TEXT.style.display ="none";
  186.     img_Arrow_MoreDetails.src = "blue_arrow_rt.gif";
  187.     window.oREDUCE_ALERTS_TEXT.style.display ="none";
  188.     img_Arrow_ReduceAlerts.src = "blue_arrow_rt.gif";
  189.     window.oWHAT_SHOULD_I_DO_TEXT.style.display ="none";
  190.     img_Arrow_WhatShouldIDo.src = "blue_arrow_rt.gif";
  191. }