
// BEGIN COMMENTED OUT FUNCTIONS THAT AREN'T CURRENTLY IN USE
/*
function GetInstalledProducts() {
	// get list of known apps that can be detected
	var arrKnownApps = GetKnownApps();
	// get list of values in "InstalledApps" registy key
	var strInstalledApps = "";
	strInstalledApps = ProductDataCollector.EnumRegSubkeyValues("HKEY_LOCAL_MACHINE","SOFTWARE\\Symantec\\InstalledApps");
	// if installed app is "Norton Personal Firewall" (NPF) or "Norton Desktop_Firewall" (NDF), change it to "Norton Internet Security"
	if (strInstalledApps.indexOf("Norton Internet Security") != -1) {
		// get NIS registry key value
		var strNISRegKeyValue=ProductDataCollector.GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Symantec\\InstalledApps","Norton Internet Security");
		// if installed app is "Norton Personal Firewall", change it to "Norton Internet Security"
		if (strNISRegKeyValue.indexOf("Personal Firewall") != -1) {
			var regexPattern = /Internet Security/gi;
			var str = strInstalledApps.replace(regexPattern,"Personal Firewall");
			strInstalledApps=str;
		}
		// ACTION: THERE COULD BE A BUG HERE.  WHY DO WHY CHECK FOR "Desktop_Firewall" instead of "Desktop Firewall"?
		// if installed app is "Norton Desktop_Firewall", change it to "Norton Internet Security"
		if (strNISRegKeyValue.indexOf("Desktop_Firewall") != -1) {
			var regexPattern = /Norton Internet Security/gi;
			var str = strInstalledApps.replace(regexPattern,"Symantec Desktop Firewall");
			strInstalledApps=str;
		}
	}
	// if installed app is "NAV", change it to "Norton AntiVirus"
	if (strInstalledApps.indexOf("NAV") != -1) {
		var regexPattern = /NAV/g;
		var str = strInstalledApps.replace(regexPattern,"Norton AntiVirus");
		strInstalledApps=str;
	}
	// if installed app is "WINFAX", change it to "WinFax"
	if (strInstalledApps.indexOf("WINFAX") != -1) {
		var regexPattern = /WINFAX/g;
		var str = strInstalledApps.replace(regexPattern,"WinFax");
		strInstalledApps=str;
	}
	// Split Installed Apps string into an array
	var arrInstalledApps = SplitData(strInstalledApps);
	for (var i=0; i < arrInstalledApps.length; i++){
		arrInstalledApps[i]=arrInstalledApps[i].substr(0,arrInstalledApps[i].indexOf("\t"));
	}
	var arrKnownInstalledApps = new Array();
	// loop through known apps looking for any items that are also in installed apps list
	for (var i=0; i < arrKnownApps.length; i++) {
		// loop installed apps list
		for (var i2=0; i2 < arrInstalledApps.length; i2++) {
			if (arrKnownApps[i] == arrInstalledApps[i2]) {
				// if installed app is "AntiSpam", change it to "Norton AntiSpam"
				if (arrInstalledApps[i2] == "AntiSpam") arrInstalledApps[i2] = "Norton AntiSpam";
				if (arrInstalledApps[i2] == "Norton AntiVirus") {
					// if the app is NAV, determine if it's corporate edition
					var isCorporateEdition=false;
					// get the NAV application directory path
					var strNAVDirectory=escapePath(GetRegValueData("HKEY_LOCAL_MACHINE","SOFTWARE\\Symantec\\InstalledApps","NAV"));
					// get the version of NAV from the "ABOUTPLG.DLL" file
					var strNAVVersion=GetFileInfo(strNAVDirectory+"\\ABOUTPLG.DLL","version");
					// check if NAV is actually NAV CE 7.x or SAV 8.x
					if (strNAVVersion == "UNKNOWN" || strNAVVersion == null || strNAVVersion == "" || strNAVVersion.indexOf("ERR") != -1) {
						// check for NAV CE 7.x
						var strNAVCE7x=GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{BD12EB47-DBDF-11D3-BEEA-00A0CC272509}","DisplayName");
						if (strNAVCE7x.indexOf("Corporate Edition") != -1) {
							arrInstalledApps[i2] = "Norton AntiVirus Corporate Edition";
						}
						// check for SAV 8.x
						var strSAV8x=GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{0EFC6259-3AD8-4CD2-BC57-D4937AF5CC0E}","DisplayName");
						if (strSAV8x.indexOf("Client") != -1) {
							arrInstalledApps[i2] = "Symantec AntiVirus Client";
						}
					}
				}
				// add this app to the new array of known installed apps
				arrKnownInstalledApps.push(arrInstalledApps[i2]);
			}
		}
	}
	return arrKnownInstalledApps;
}
function FilterInstalledEnterpriseApps(arrInstalledApps) {
	var arrFilteredInstalledApps = new Array();
	var arrKnownEnterpriseApps = GetKnownEnterpriseApps();
	for (var ix=0; ix < arrInstalledApps.length; ix++) {
		var isEnterpriseApp = false;
		for (var ix2=0; ix2 < arrKnownEnterpriseApps.length; ix2++) {
			if (arrInstalledApps[ix] == arrKnownEnterpriseApps[ix2]) isEnterpriseApp=true;
		}
		if (!isEnterpriseApp) {
			arrFilteredInstalledApps.push(arrInstalledApps[ix]);
		}
	}
	return arrFilteredInstalledApps;
}
// define list of known apps that can be detected by ActiveData
function GetKnownApps() {
	var arrAppList = ['NAV','Norton AntiVirus','Norton CleanSweep','Norton Ghost','Norton Internet Security','Norton SystemWorks','Norton Utilities','pcAnywhere',"WinFax","Norton Personal Firewall","Norton Desktop Firewall","AntiSpam"];
	return arrAppList;
}
// define list of known apps that can be detected by ActiveData
function GetKnownEnterpriseApps() {
	var arrAppList = ["Norton AntiVirus Corporate Edition", "Symantec AntiVirus Client"];
	return arrAppList;
}
*/
// END COMMENTED OUT FUNCTIONS THAT AREN'T CURRENTLY IN USE
// determine if Auto-Protect is expected to be resident in memory (NAV is installed and version is not NAV 2003 9x or NAV 2004 9x)
function IsAutoProtectExpected() {
	// get the platform
	var strPlatform = GetPlatform();
	if (strPlatform == null) return false; // return false if platform could not be determined
	if (strPlatform == 'NT') return true; // return true if platform is NT
	// determine if NAV is installled & get the version of NAV installed
	var strProductVersion = GetNAVProductVersion();
	if (strProductVersion.indexOf('ERR') != -1) return false; // return false if product version could not be determined
	// get first part of product version
	var strShortProductVersion = strProductVersion.substr(0,strProductVersion.indexOf('.'));
	// return false if product version is 9 (2003) or 10 (2004)
	if (strShortProductVersion == '9' || strShortProductVersion == '10') return false;
	return true;
}
// determine if NAV is installled and get the version of NAV installed (return 'ERR' if anything goes wrong)
function GetNAVProductVersion() {
	// initialize the product version variable
	var strProductVersion = 'ERR';
	// get the NAV directory path from the "HKEY_LOCAL_MACHINE/Software/Symantec/InstalledApps/NAV" registry key value
	var strRegKeyValue = ProductDataCollector.GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Symantec\\InstalledApps","NAV");
	if (strRegKeyValue.indexOf("ERR") == -1 && strRegKeyValue != "" && strRegKeyValue != null) {
		try {
			// get product version from ABOUTPLG.DLL file
			strAppVersion = GetFileInfo(escapePath(strRegKeyValue)+"\\ABOUTPLG.DLL","productversion");
			if (strAppVersion.indexOf('undefined') == -1) strProductVersion = strAppVersion;
		} catch(e) {
			// do nothing
		}
	}
	return strProductVersion;
}
// determine if the browser is valid for ActiveData control use
function BrowserCheck() {
	// set default value for valid browser flag variable
	var is_valid_browser = true;
	// exclude IE 3 versions
	if (navigator.appVersion.indexOf("MSIE 3.") != -1) is_valid_browser = false;
	// exclude Mac browsers
	if (navigator.appVersion.indexOf("Mac") != -1) is_valid_browser = false;
	// check if browser is IE 5.5
	IE5 = ( (document.all) && (navigator.appVersion.indexOf("MSIE 5.5") != -1) ) ? true : false;
	// check if browser is IE 6
	IE6 = ( (document.all) && (navigator.appVersion.indexOf("MSIE 6.") != -1) ) ? true : false;
	// set flag to indicate if browser version is IE 5.5+
	IE55plus = IE5 || IE6;
	// exclude if browser is earlier than IE 5.5 or platform is not Windows
	if (!IE55plus || (navigator.platform != "Win32")) {
		is_valid_browser = false;
	} else {
		var is_getElementById   = (document.getElementById) ? "true" : "false"; // check if browser supports retrieving elements by ID
		var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // check if browser supports retrieving elements by name
		var is_documentElement = (document.documentElement) ? "true" : "false"; // check if browser has document elements
		var is_forms = (document.forms) ? "true" : "false"; // check if browser has forms elements
		// exclude if browser does not support items checked above
		if (!is_getElementById || !is_getElementsByTagName || !is_documentElement || !is_forms) is_valid_browser = false;
	}
	return is_valid_browser;
}
// determine if the control downloaded successfully, by calling GetSysVersion
function IsControlAvailable() {
	try {
		var test=ProductDataCollector.GetSysVersion();
		if (test.indexOf("ERR ") == -1) return true;
	} catch(e) {
		// do nothing
	}
	return false;
}
// determine if auto-protect is resident in memory, by looking for process
function IsAutoProtectLoaded() {
	// get user's process list
	var RunningProcesses = GetProcessList();
	// check if auto-protect is in running processes list
	if (indexOfNoCase(RunningProcesses,'navapsvc') != -1) return true;
	if (indexOfNoCase(RunningProcesses,'navapw32') != -1) return true;
	if (indexOfNoCase(RunningProcesses,'rtvscan') != -1) return true;
	// get user's service list
	var RunningServices = GetRunningServicesList();
	// check if auto-protect is running services list
	if (indexOfNoCase(RunningServices,'navapsvc') != -1) return true;
	if (indexOfNoCase(RunningServices,'navapw32') != -1) return true;
	if (indexOfNoCase(RunningServices,'rtvscan') != -1) return true;
	return false;
}
// determine if the user's virus definitions are up-to-date
// if anything goes wrong, return true as the failover, which assumes the defs are up-to-date even though they may not be
function IsVirusDefDateCurrent() {
	// latest virus definition date
	var latest_virus_def_date = GetVirusDefDateInteger("20041221");
	if (latest_virus_def_date == null) return true;
	// get definfo.dat file path
	var strDefInfoPath = GetDefInfoPath();
	// get user's virus def date
	var user_virus_def_date = ProductDataCollector.GetFileContents(strDefInfoPath,"CurDefs");
	// if the data returned is not what is expected, bail out and return true
	if (user_virus_def_date.indexOf("CurDefs") == -1) return true;
	// get the date value from the string returned by ProductDataCollector.GetFileContents
	var tmp = user_virus_def_date.split("=");
	user_virus_def_date = tmp[1];
	var pos = user_virus_def_date.lastIndexOf(".");
	user_virus_def_date = user_virus_def_date.substr(0,pos);
	// if the user's virus def date format is not what is expected, bail out and return true
	var user_virus_def_date = GetVirusDefDateInteger(user_virus_def_date);
	if (user_virus_def_date == 0) return true;
	// check the user's virus def date against the known latest virus def date, and return false if defs are not current
	if (user_virus_def_date < latest_virus_def_date) return false;
	return true;
}
// determine if the string passed is a valid virus def date (format)
// if the passed string is not a valid virus def date, return null
function GetVirusDefDateInteger(strDate) {
	intDate = parseInt(strDate);
	if (strDate.length != 8 || intDate == 0 || isNaN(intDate)) return null;
	return intDate;
}
// derive the definfo.dat file path
function GetDefInfoPath() {
	// get the client system drive letter, for deriving the definfo.dat path
	var strSystemDrive = GetSystemDrive();
	// build the definfo.dat path
	var strDefInfoPath = strSystemDrive+"\\Program Files\\Common Files\\Symantec Shared\\VirusDefs\\definfo.dat";
	return strDefInfoPath;
}
// uses ProductDataCollector.LaunchExe to execute LiveUpdate on the client system
function LaunchLU() {
	// get the path to the LiveUpdate executable (LUALL.EXE)
	var strLiveUpdatePath = GetLiveUpdatePath();
	// try to launch LU via ProductDataCollector.LaunchExe
	try {
		strResult = ProductDataCollector.LaunchExe(strLiveUpdatePath, "Symantec Corporation",4);
	} catch(e) {
		// do nothing
	}
	// if launch was unsuccessful, display error message
	if (strResult != 'LaunchFileSuccess') {
		alert("LiveUpdate could not be launched, possibly because it's not installed on your system.");
	}
}
// derive the LiveUpdate executable (LUALL.EXE) file path
function GetLiveUpdatePath() {
	// initialize the path variable
	var strPath = '';
	// get the LU directory path from the "HKEY_LOCAL_MACHINE/Software/Symantec/SharedUsage/LiveUpdate" registry key value
	var strRegKeyValue = ProductDataCollector.GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Symantec\\SharedUsage","LiveUpdate");
	// check for problems getting the NAV registry key value
	if (strRegKeyValue.indexOf("ERR") == -1 && strRegKeyValue != "" && strRegKeyValue != null) {
		// build the LU executable path based on the LU registry key value (more reliable initial method)
		strPath = strRegKeyValue+"\\LUALL.EXE";
	} else {
		// build the LU executable path based drive letter and fixed path (not as reliable secondary method)
		// get the client system drive letter, for deriving the LU path
		var strSystemDrive = GetSystemDrive();
		// build the LiveUpdate path
		var strPath = strSystemDrive+"\\Program Files\\Symantec\\LiveUpdate\\LUALL.EXE";
	}
	return strPath;
}
// get the drive letter of the active system
function GetSystemDrive() {
	var strSystemDrive="C:";
	try {
		var platform=GetPlatform();
		if (platform == "NT") {
			var sysinfo = SplitData(ProductDataCollector.GetSysInfo());
			var strTempPath = sysinfo[4];
			var arrTempPath = strTempPath.split("\\");
			strSystemDrive = arrTempPath[0];
		} else {
			var strWindowsDirectory = GetWindowsDirectory();
			var arrPath = strWindowsDirectory.split("\\");
			strSystemDrive = arrPath[0];
		}
	} catch(e) {
		// do nothing
	}
	return strSystemDrive;
}
// get the user's platform (NT or 9x)
function GetPlatform() {
	var strSystemVersion="";
	try {
		strSystemVersion=ProductDataCollector.GetSysVersion();
		arrSystemVersion=SplitData(strSystemVersion);
		var platform="9x";
		if (arrSystemVersion[3] == 2) platform="NT";
	} catch(e) {
		return null;
	}
	return platform;
}
// get the user's Windows directory path
function GetWindowsDirectory() {
	var windir='';
	try {
		var strSysInfo = ProductDataCollector.GetSysInfo();
		if (!/ERR/.test(strSysInfo)) {
			arrSysInfo = SplitData(strSysInfo);
			windir=arrSysInfo[3];
			if (/ERR/.test(windir) || windir == null) {
				windir='';
			}
		}
	} catch(e) {
		windir='';
	}
	return windir;
}
// uses ProductDataCollector.LaunchExe to launch the Norton AntiVirus application
function LaunchNAV() {
	// get the NAV application path
	var strNAVPath = GetNAVPath();
	// initialize the results variable for the LaunchExe call
	var strResult = '';
	// try to launch NAV via ProductDataCollector.LaunchExe
	try {
		strResult = ProductDataCollector.LaunchExe(strNAVPath, "Symantec Corporation",4);
	} catch(e) {
		// do nothing
	}
	// if launch was unsuccessful, display error message
	if (strResult != 'LaunchFileSuccess') {
		alert("Norton AntiVirus could not be launched, possibly because it's not installed on your system.");
	}
}
// derive the Norton AntiVirus executable file path
function GetNAVPath() {
	// initialize the path variable
	var strPath = '';
	// get the NAV directory path from the "HKEY_LOCAL_MACHINE/Software/Symantec/InstalledApps/NAV" registry key value
	var strRegKeyValue = ProductDataCollector.GetRegValueData("HKEY_LOCAL_MACHINE","Software\\Symantec\\InstalledApps","NAV");
	// check for problems getting the NAV registry key value
	if (strRegKeyValue.indexOf("ERR") == -1 && strRegKeyValue != "" && strRegKeyValue != null) {
		// build the NAV executable path
		strPath = strRegKeyValue+"\\NAVW32.EXE";
	}
	return strPath;
}
// split a string on the new line characters and return the resulting array
function SplitData(str) {
	return str.split("\n");
}


