home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: modifyRule.js (Javascript file for modifyRule.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- window.dialogHeight = "478px";
- window.dialogWidth = "520px";
- window.returnValue = null;
- var currGroup = 1;
- var xmlRules = null;
- var g_TopItemBtnText = GetStyleSheet("topitembtn")[0];
- var g_IEVer = GetIEVersion();
-
- function init()
- {
- // Change the relative top pos of .topitembtntxt based on the browser version
- if(g_IEVer >= 5)
- g_TopItemBtnText.style.top = "-1px";
- else
- g_TopItemBtnText.style.top = "-7px";
-
- var args = window.dialogArguments;
-
- xmlRules = args;
- var appName = xmlRules.selectSingleNode("/*/ApplicationDescription");
- if (null != appName)
- {
- ruleDoc.init(args, "Application");
- }
- else
- {
- ruleDoc.init(args, "UnknownB");
- }
-
- TabAction.style.borderBottomWidth = 0;
- TabAction.focus();
-
- }
-
- function GetStyleSheet(ruleName)
- {
- var Rules = new Array();
- var styleCount = 0;
- for(var ssIndex = 0; ssIndex < document.styleSheets.length; ssIndex++)
- {
- styleSheet = document.styleSheets[ssIndex];
- for(var rIndex=0; rIndex < styleSheet.rules.length; rIndex++)
- {
- rule=styleSheet.rules[rIndex]
- if(rule.selectorText == ("." + ruleName) || rule.selectorText == ruleName)
- {
- Rules[styleCount] = rule
- styleCount++;
- }
- }
- }
- return Rules;
- }
-
-
- function putBordersBack()
- {
- TabAction.style.borderBottomWidth = 1;
- TabAction.style.borderBottomStyle = "solid"; // This tab is not underlined by default.
- TabAction.style.borderBottomColor = "black";
- TabConnections.style.borderBottomWidth = 1;
- TabComputers.style.borderBottomWidth = 1;
- TabCommunication.style.borderBottomWidth = 1;
- TabTracking.style.borderBottomWidth = 1;
- TabTitle.style.borderBottomWidth = 1;
- }
-
- function switchTab(ctrl, dest, group)
- {
- var badpage = ruleDoc.validateAll();
-
- if (!badpage)
- {
- //
- // Remove bottom border from selected tab. But first,
- // make sure all the other ones have bottom border.
- //
- putBordersBack();
- ctrl.style.borderBottomWidth = 0;
- ruleDoc.SetPage(dest);
- }
-
- }
-
- function applyChanges()
- {
- var badpage = ruleDoc.validateAll();
-
- if (!badpage)
- {
- window.returnValue = ruleDoc.saveRule();
- window.navigate("res://closeme.xyz");
- }
- }
-