Click here to Skip to main content
15,895,746 members
Articles / Web Development / HTML

Object Oriented JavaScript Class Library in C#/.NET Style

Rate me:
Please Sign up or sign in to vote.
4.97/5 (166 votes)
10 Sep 2018CPOL12 min read 389.2K   355  
JavaScript class library which partly replicates Microsoft .NET Framework structure and functionality.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<title>Jocys.com Password Generator</title>
	<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
	<meta content="Microsoft FrontPage 6.0" name="GENERATOR" />
	<meta content="FrontPage.Editor.Document" name="ProgId" />
	<meta http-equiv="MSThemeCompatible" content="yes" />
	<link href="../System.Web.UI.Interface.debug.css" rel="stylesheet" type="text/css" />
	<link href="../System.Security.Password/System.Security.Password.css" rel="stylesheet"
		type="text/css" />
	<style type="text/css">
		html
		{
			height: 100%;
			overflow: hidden;
		}
		body
		{
			height: 100%;
			overflow: hidden;
		}
		form
		{
			height: 100%;
			padding: 0;
			margin: 0;
		}
		input.SWUI_PG_TbxDisabled
		{
			border: 1px solid #a7a6aa;
			background-color: #d6d5d9;
			color: #a7a6aa;
			padding: 1px 1px 3px 1px;
		}
		textarea.SWUI_PG_TbxDisabled
		{
			border: 1px solid #a7a6aa;
			background-color: #d6d5d9;
			color: #a7a6aa;
			padding: 0 1px 2px 1px;
		}
		.SWUI_PG_MainTable
		{
			visibility: hidden;
		}
		.SWUI_PG_OptionsCell
		{
			background-color: #c6c5c9;
			padding: 8px 8px 8px 8px;
			width: 190px;
		}
		.SWUI_PG_ResultsCell
		{
			background-color: ButtonFace;
			padding: 8px 8px 8px 8px;
		}
		.SWUI_PG_CallsCell
		{
			background-color: #c6c5c9;
			padding: 8px 8px 8px 8px;
			width: 210px;
		}
		.SWUI_PG_ButtonResults
		{
			width: 64px;
		}
		.SWUI_PG_PassCell
		{
			padding: 1px 0 1px 0;
		}
		.SWUI_PG_Pass
		{
			color: #000000;
			text-align: center;
			background-color: buttonface;
			border: 1px solid #E0E0E0;
			font-family: Courier New;
			font-size: 10pt;
			width: 100%;
		}
		.SWUI_PG_PassCopied
		{
			color: #008000;
			text-align: center;
			background-color: buttonface;
			border: 1px solid #E0E0E0;
			font-family: Courier New;
			font-size: 10pt;
			width: 100%;
		}
		.SWUI_PG_TdValue
		{
			padding: 2px 0 2px 0;
		}
		.SWUI_PG_TdRatio
		{
			padding: 1px 4px 1px 0;
		}
		.SWUI_PG_TdOption
		{
			padding: 0 2px 1px 0;
		}
		.SWUI_PG_TdLabel
		{
			padding-left: 4px;
		}
		.SWUI_PG_Group
		{
			padding: 0 0 8px 0;
		}
		.SWUI_PG_Legend
		{
			font-weight: bold;
			white-space: nowrap;
		}
		.SWUI_PG_SubGroup
		{
			padding: 8px 0 0 8px;
		}
		.SWUI_PG_SubGroupCharsExtra
		{
			padding: 1px 0 0 8px;
		}
		.SWUI_PG_SubGroupCharsString
		{
			padding: 2px 0 0 8px;
		}
		.SWUI_PG_Underline
		{
			text-decoration: underline;
		}
		.SWUI_PG_ScriptCodeFocus
		{
			position: absolute;
			width: 90%;
			height: 43px;
			overflow: auto;
		}
		.SWUI_PG_ScriptCodeBlur
		{
			position: inherit;
			width: 100%;
			height: 43px;
			overflow: hidden;
		}
		.SWUI_PG_InputFixPanel
		{
			padding-right: 4px;
		}
		.SWUI_PG_InputFixPanel input
		{
			padding: 1px 0 1px 0;
			margin: 0;
		}
		
		.SWUI_PG_CallLength { width: 24px; }

	</style>
	<!--[if IE]>
	<style type="text/css">
		button.SWUI_Prg { padding: 1px 4px 0 0; }
		.SWUI_PG_PassCell { padding: 0 0 0 0; }

		.SWUI_PG_SubGroup { padding: 8px 0 0 8px; }
		.SWUI_PG_SubGroupCharsExtra { padding: 0 0 0 8px; }
		.SWUI_PG_SubGroupCharsString { padding: 1px 0 0 8px; }

		.SWUI_PG_TdRatio {padding: 0 4px 0 0; }
		.SWUI_PG_CallLength { width: 18px; }
		input.SWUI_PG_TbxDisabled { border: 1px solid #a7a6aa; background-color: #d6d5d9; color: #a7a6aa; padding: 2px; margin: 0;  }
		textarea.SWUI_PG_TbxDisabled { border: 1px solid #a7a6aa; background-color: #d6d5d9; color: #a7a6aa; padding: 2px; margin: 0; }
	</style>
	<![endif]-->
	<!-- ================== LOAD FUNCTIONS ============================ -->

	<script type="text/javascript" src="../System.debug.js"></script>

	<script type="text/javascript" src="../System.Text.debug.js"></script>

	<script type="text/javascript" src="../System.BitConverter.debug.js"></script>

	<script type="text/javascript" src="../System.Web.debug.js"></script>

	<script type="text/javascript" src="../System.Web.UI.ShortKeys.debug.js"></script>

	<script type="text/javascript" src="../System.Security.Password.debug.js"></script>

	<script type="text/javascript" src="../System.Web.UI.HtmlControls.debug.js"></script>

	<script type="text/javascript" src="../System.Web.UI.Interface.debug.js"></script>

	<script type="text/javascript" src="../System.Windows.Forms.Keys.debug.js"></script>

	<script type="text/javascript" src="../System.Security.Cryptography.MD5.debug.js"></script>

	<script type="text/javascript" src="../System.Security.Cryptography.HMACMD5.debug.js"></script>

	<script type="text/javascript">

		//=====================================================
		// Helper functions
		//-----------------------------------------------------

		function $(id) {
			var node = document.getElementById(id);
			if (!node) {
				Trace.Write("Error: object $('" + id + "') was not found");
			}
			return node;
		}

		// This will store all DOM inputs.
		var CT = {}
		function InitCT() {
			// Fill controls so we don't need to find them later.
			var tags = ["input", "select", "button", "textarea"];
			for (var t = 0; t < tags.length; t++) {
				var tag = tags[t];
				var inputs = document.body.getElementsByTagName(tag);
				for (var i = 0; i < inputs.length; i++) {
					var id = inputs[i].id;
					if (id) {
						var name = id.replace("TextBox", "");
						name = name.replace("CheckBox", "");
						name = name.replace("Select", "");
						name = name.replace("Button", "");
						CT[name] = $(id);
					}
				}
			}
		}

		//=====================================================
		// Main
		//-----------------------------------------------------

		function EnableTrace(enable) {
			if (enable) {
				$("HelpPanel").style.display = "none";
				$("TracePanel").style.display = "";
				Trace.IsEnabled = true;
				Trace.Write("Trace Enabled");
				Trace.TimeStamp = "HH:mm:ss";
			} else {
				Trace.IsEnabled = false;
				$("TracePanel").style.display = "none";
				$("HelpPanel").style.display = "";
			}
		}

		var PassGen = null;
		var PassItemsCount = 0;
		var Calls = null;
		var ScriptsPath = "";

		function Window_Load(sender, e) {
			InitCT();
			// Get number of password inputs expcept dummy one.
			PassItemsCount = $("ChooseListTable").getElementsByTagName("input").length - 1;
			//EnableTrace(true);
			ScriptsPath = System.GetScriptsPath();
			InitHeader();
			QueryOptions();
			// window.resizeTo(626,470);
			PassGen = new System.Security.Password.Generator();
			PassGen.PresetChanged = PassGen_PresetChanged;
			PassGen.Error = PassGen_Error;
			Calls = new System.Security.Password.Calls();
			Trace.Write(ScriptsPath);
			Trace.Write("// Bind Presets.");
			var presetsBinder = new System.Web.UI.HtmlControls.DataBinder("PresetsBinder", CT.Presets, System.Security.Password.Templates.Presets, "PresetName", "Type.Name", "DefaultEasyToRemember");
			presetsBinder.DataBind();
			Trace.Write("// Bind Calls.");
			var callsBinder = new System.Web.UI.HtmlControls.DataBinder("CallsBinder", CT.Calls, System.Security.Password.Templates.Calls, "CallName", "Type.Name");
			callsBinder.DataBind();
			// Data was binded so we can load settings.
			LoadSettings();
			EnableTrace(CT.EnableDebug.checked);
			// This must be called before AttachEvents.
			ResizeStep0();
			UpdateForm();
			Trace.Write("// Attach events.");
			AttachEvents();
			// Load preset.
			PassGen.setPreset(CT.Presets.value);
			LoadSettingsFromPassGen();
			ResizeStep1();
			GeneratePasswords(CT.CopyOnLoad.checked);
		}

		function TestGenerator() {
			var password = PassGen.NewPassword();
			Trace.Write("Generate Default Test Password: " + password.Text);
			Trace.Write("Generate Default Test Password: " + password.LogToHtml());
		}

		//=====================================================
		// Events
		//-----------------------------------------------------

		function EnableDebugCheckBox_Click(sender, e) {
			Trace.Write("on EnableDebugCheckBox_Click(sender, e)");
			EnableTrace(CT.EnableDebug.checked);
			SaveSettings();
		}

		function PresetsSelect_Change(sender, e) {
			Trace.Write("on PresetsSelect_Change(sender[id='" + sender.tagName + "'], e)");
			ChangeProperties(sender, e);
			SaveSettings();
		}

		function FilterCharsCheckBox_Click(sender, e) {
			Trace.Write("on FilterCharsCheckBox_Click(sender, e)");
			ChangeProperties(sender, e);
		}

		function ScriptEnabledCheckBox_Click(sender, e) {
			Trace.Write("on ScriptEnabledCheckBox_Click(sender, e)");
			ChangeProperties(sender, e);
		}

		function RegexEnabledCheckBox_Click(sender, e) {
			Trace.Write("on RegexEnabledCheckBox_Click(sender, e)");
			ChangeProperties(sender, e);
		}

		function CopyButton_Click(sender, e) {
			Trace.Write("on CopyButton_Click(sender, e) // " + typeof (sender) + ", " + typeof (e));
			//Trace.Write("sender.Type = '"+sender.Type+"'");
			Trace.Write("sender.id = '" + sender.id + "'");
			CopyInput(sender.id.replace("Copy", "Password").replace("Button", "TextBox"), true);
		}

		function PassGen_PresetChanged(sender, e) {
			Trace.Write("on PassGen_PresetChanged(sender, e)");
			ChangeProperties(sender, e);
		}

		function PassGen_Error(sender, e) {
			Trace.Write("on PassGen_Error(sender, e)");
			helpHeader.setSubject(e.Message)
		}

		function PasswordGeneratorForm_Submit(sender, e) {
			// Cancel submittion of default form.
			return false;
		}

		function GenerateButton_Click(sender, e) {
			Trace.Write("on GenerateButton_Click(sender, e)");
			GeneratePasswords(true);
		}

		function GetListButton_Click(sender, e) {
			var length = parseInt(CT.ListSize.value);
			var sb = new System.Text.StringBuilder();
			var separator = "\r\n";
			try {
				separator = eval("'" + CT.ListSeparator.value.replace("'", "\\'", "g") + "'");
			} catch (ex) { }
			var password = null;
			for (var i = 0; i < length; i++) {
				password = PassGen.NewPassword();
				sb.Append(password.Text);
			}
			System.Clipboard.Copy(sb.ToString(separator));
		}

		function ScriptCodeTextBox_Focus(sender, e) {
			var w = document.body.offsetWidth - 36;
			sender.style.width = w + "px";
			var checked = CT.ScriptEnabled.checked;
			sender.className = (checked) ? "SWUI_Prg_TbxLeft SWUI_PG_ScriptCodeFocus" : "SWUI_Prg_TbxLeft SWUI_PG_ScriptCodeFocus SWUI_PG_TbxDisabled";
		}

		function ScriptCodeTextBox_Blur(sender, e) {
			sender.style.cssText = "";
			var checked = CT.ScriptEnabled.checked;
			sender.className = (checked) ? "SWUI_Prg_TbxLeft SWUI_PG_ScriptCodeBlur" : "SWUI_Prg_TbxLeft SWUI_PG_ScriptCodeBlur SWUI_PG_TbxDisabled";
			GeneratePasswords(true);
		}

		function CopyOnLoadCheckBox_Click(sender, e) {
			Trace.Write("on CopyOnLoadCheckBox_Click(sender, e)");
			SaveSettings();
		}

		//-----------------------------------------------------

		function CallsSelect_Change(sender, e) {
			Trace.Write("on CallsSelect_Change(sender[id='" + sender.id + "'], e)");
			ShowCalls();
			SaveSettings();
		}

		//=====================================================
		// Save and Load client settings.
		//-----------------------------------------------------

		var settingsPrefix = "System.Security.Password.Settings.";

		function LoadSettings() {
			Trace.Write("LoadSettings() // Load settings from cookies.");
			var p = settingsPrefix;
			try {
				CT.Presets.selectedIndex = System.Web.Cookies.Get(p + "PresetsSelect", 4);
				CT.Calls.selectedIndex = System.Web.Cookies.Get(p + "CallsSelect", 3);
				CT.CopyOnLoad.checked = System.Bool.Parse(System.Web.Cookies.Get(p + "CopyOnLoad", false));
				CT.EnableDebug.checked = System.Bool.Parse(System.Web.Cookies.Get(p + "EnableDebug", false)); ;
			} catch (ex) {
				Trace.Write("Error: " + ex.message);
			}
		}

		function SaveSettings() {
			Trace.Write("SaveSettings() // Save settings to cookies.");
			var p = settingsPrefix;
			try {
				System.Web.Cookies.Set(p + "PresetsSelect", CT.Presets.selectedIndex, 60);
				System.Web.Cookies.Set(p + "CallsSelect", CT.Calls.selectedIndex, 60);
				System.Web.Cookies.Set(p + "CopyOnLoad", CT.CopyOnLoad.checked, 60);
				System.Web.Cookies.Set(p + "EnableDebug", CT.EnableDebug.checked, 60);
			} catch (ex) {
				Trace.Write("Error: " + ex.message);
			}
		}

		//=====================================================
		// Other
		//-----------------------------------------------------

		function GeneratePasswords(checkCopyOption) {
			SaveSettingsToPassGen();
			Trace.Write("GeneratePasswords(checkCopyOption=" + checkCopyOption + ")");
			var password = null;
			for (var i = 1; i <= PassItemsCount; i++) {
				password = PassGen.NewPassword();
				CT["Password" + i].value = password.Text;
				// Reset color of list items to black.
				CT["Password" + i].className = "SWUI_PG_Pass";
			}
			// if "Copy on [Generate]" checked...
			if (CT.CopyOnGenerate.checked && checkCopyOption) {
				CopyInput("Password1TextBox", false);
			}
		}

		function CopyInput(id, regenerate) {
			System.Clipboard.Copy($(id).value);
			// Reset all to black.
			for (var i = 1; i <= PassItemsCount; i++) {
				CT["Password" + i].className = "SWUI_PG_Pass";
			}
			// Mark password as copied.
			$(id).className = "SWUI_PG_PassCopied";
			Trace.Write("Copied: [" + id + "]='" + $(id).value + "'");
			CT.CallsPassword.value = $(id).value;
			ShowCalls();
			if (regenerate) {
				if (CT.GenerateOnCopy.checked) {
					// Regenerate black inputs
					for (var i = 1; i <= PassItemsCount; i++) {
						if (CT["Password" + i].className == "SWUI_PG_Pass") {
							CT["Password" + i].value = PassGen.NewPassword().Text;
						}
					}
				}
			}
		}

		function ChangeProperties(sender, e) {
			Trace.Write("call ChangeProperties(sender[id='" + sender.id + "'], e)");
			switch (sender.id) {
				case "PresetsSelect":
					PassGen.setPreset(sender.value);
					Trace.Write("Preset was changed to '" + PassGen.Preset.Name + "'");
					LoadSettingsFromPassGen();
					break;
				default:
					UpdateForm();
					break;
			}
			//Trace.Write(sender.id+": "+sender.type);
			GeneratePasswords(CT.CopyOnLoad.checked);
		}

		var exclude = { PresetName: true, PresetDescription: true, CharsNumbers: true, CharsUppercase: true, CharsLowercase: true, CharsExtended: true };

		function LoadSettingsFromPassGen() {
			/// <summary>
			/// Update Form inputs from PassGen settings.
			/// </summary>			
			Trace.Write("call LoadSettingsFromPassGen()", 1);
			// Suspend events.
			UpdateFormEnabled = false;
			for (var property in System.Security.Password.Templates.Presets.Default) {
				var type = typeof (System.Security.Password.Templates.Presets.Default[property]);
				if (!exclude[property]) {
					var value = PassGen.Preset[property];
					if (CT[property]) {
						switch (type) {
							case "boolean":
								CT[property].checked = value;
								break;
							case "number":
								CT[property].value = value;
								break;
							case "string":
								CT[property].value = value;
								break;
							default:
								break;
						} 
					}
					//Trace.Write(type+" "+property+" = "+value);
					PassGen.Preset[property] = value;
				}
			}
			Trace.Write("}", -2);
			UpdateFormEnabled = true;
			UpdateForm();
		}


		function SaveSettingsToPassGen() {
			/// <summary>
			/// Update PassGen settings from Form inputs.
			/// </summary>	
			Trace.Write("call SaveSettingsToPassGen()");
			for (var property in System.Security.Password.Templates.Presets.Default) {
				var type = typeof (System.Security.Password.Templates.Presets.Default[property]);
				if (!exclude[property]) {
					var value = null;
					if (CT[property]) {
						switch (type) {
							case "boolean":
								value = CT[property].checked;
								break;
							case "number":
								value = parseInt(CT[property].value);
								break;
							case "string":
								value = CT[property].value;
								break;
							default:
								break;
						} 
					}
					//Trace.Write(type+" "+property+" = "+value);
					PassGen.Preset[property] = value;
				}
			}
		}

		// Convert text to Calls Table.
		function ShowCalls() {
			Trace.Write("call  ShowCalls()", 1);
			var callName = CT.Calls.value;
			Trace.Write("Current Preset: " + callName);
			var call = Calls.Items[callName];
			var html = call.ToHtml(CT.CallsPassword.value, "Table");
			$("CallsPasswordLengthTextBox").value = CT.CallsPassword.value.length;
			$("CallsPanel").innerHTML = html;
			Trace.Write("}", -2);
		}

		var UpdateFormEnabled = true;

		function UpdateForm() {
			/// <summary>
			/// Updates related controls.
			/// </summary>
			Trace.Write("call UpdateForm()");
			var checked;
			if (UpdateFormEnabled) {
				for (var property in System.Security.Password.CharTypeEnum) {
					checked = CT["Use" + property].checked;
					CT["Ratio" + property].className = (checked) ? "SWUI_Prg_TbxCenter" : "SWUI_Prg_TbxCenter SWUI_PG_TbxDisabled";
				}
				checked = CT.UseExtra.checked;
				CT.CharsExtra.className = (checked) ? "SWUI_Prg_TbxCenter SWUI_100w" : "SWUI_Prg_TbxCenter SWUI_100w SWUI_PG_TbxDisabled";
			}
			checked = CT.ScriptEnabled.checked;
			var css = CT.ScriptCode.className.replace("SWUI_PG_TbxDisabled", "");
			CT.ScriptCode.className = (checked) ? css : css + " SWUI_PG_TbxDisabled";
			checked = CT.RegexEnabled.checked;
			CT.RegexPatternFind.className = (checked) ? "SWUI_Prg_TbxLeft SWUI_100w" : "SWUI_Prg_TbxLeft SWUI_100w SWUI_PG_TbxDisabled";
			CT.RegexPatternReplace.className = (checked) ? "SWUI_Prg_TbxLeft SWUI_100w" : "SWUI_Prg_TbxLeft SWUI_100w SWUI_PG_TbxDisabled";
			checked = CT.FilterChars.checked;
			CT.FilterCharsString.className = (checked) ? "SWUI_Prg_TbxLeft SWUI_100w" : "SWUI_Prg_TbxLeft SWUI_100w SWUI_PG_TbxDisabled";

		}

		//=================================================================
		// Help.
		//-----------------------------------------------------------------			

		var helpHeader;
		var Help = {
			Presets: "Select preconfigured password preset.",
			Calls: "Select calls type. NATO calls are most popular calls to use if you want to pass your message thru phone or radio.",
			RatioNumbers: "Numeric relationship in quantity between other type of characters.",
			RatioUppercase: "Uppercase relationship in quantity between other type of characters.",
			RatioLowercase: "Lowercase relationship in quantity between other type of characters.",
			RatioExtendedTextBox: "Extended relationship in quantity between other type of characters.",
			RatioExtraTextBox: "Extra relationship in quantity between other type of characters.",
			UseNumbers: "Use numbers inside password.",
			UseUppercase: "Use uppercase letters inside password.",
			UseLowercase: "Use lowercase letters inside password.",
			UseExtended: "Use extended characters inside password.",
			UseExtra: "Use extra symbols inside password.",
			CharsExtra: "Specify extra symbols to include inside password.",
			FilterRemember: "Combine volves and consonants in such order so password will look as normal word.",
			FilterKeyboard: "Make sure that each next pasword character will be located on different side of keyboard.",
			FilterPhone: "Make sure that each next pasword character will be located on different keypad.",
			FilterAscii: "Remove all non ASCII characters from password.",
			FilterChars: "Remove custom characters from password.",
			FilterCharsString: "Specify custom characters to remove from password.",
			RegexEnabled: "Apply Regular Expression patterns on password.",
			RegexPatternFind: "Find pattern of Regular Expression.",
			RegexPatternReplace: "Replace pattern of Regular Expression.",
			ScriptEnabled: "Apply JavaScript code on password.",
			ScriptCode: "Enter JavaScript code here. For example: return \"^\"+password.Text+\"^\";",
			ListSize: "Specify how many passwords will be generated into List.",
			ListSeparator: "Separate each List passsword with this separator. You can use backward slash for special charachters: \\t - tab, \\r - return, \\n - new line...",
			CopyOnLoad: "Copy password to clipboard as soon as Password Generator window loads.",
			CopyOnGenerate: "Copy password to clipboard after [Generate] button was pressed.",
			GenerateOnCopy: "Regenerate passwords after one of the [Copy] buttons was clicked.",
			EnableDebug: "Show Trace Log window.",
			Ok: "Update password field on parent window and close this window.",
			Apply: "Update password field on parent window.",
			Cancel: "Close this window.",
			aaa: ""
		}


		function InitHelp() {
			helpHeader.AddEvent(CT.Presets, Help.Presets);
			helpHeader.AddEvent(CT.Calls, Help.Calls);

			helpHeader.AddEvent("PasswordLengthTextBox", "Pasword Length.", "ALT+D");

			helpHeader.AddEvent("UseNumbersCell0", Help.RatioNumbers);
			helpHeader.AddEvent("UseNumbersCell1", Help.UseNumbers);
			helpHeader.AddEvent("UseNumbersCell2", Help.UseNumbers);
			helpHeader.AddEvent("UseUppercaseCell0", Help.RatioUppercase);
			helpHeader.AddEvent("UseUppercaseCell1", Help.UseUppercase);
			helpHeader.AddEvent("UseUppercaseCell2", Help.UseUppercase);
			helpHeader.AddEvent("UseLowercaseCell0", Help.RateLowercase);
			helpHeader.AddEvent("UseLowercaseCell1", Help.UseLowercase);
			helpHeader.AddEvent("UseLowercaseCell2", Help.UseLowercase);
			helpHeader.AddEvent("UseExtendedCell0", Help.RatioExtended);
			helpHeader.AddEvent("UseExtendedCell1", Help.UseExtended);
			helpHeader.AddEvent("UseExtendedCell2", Help.UseExtended);
			helpHeader.AddEvent("UseExtraCell0", Help.RatioExtra);
			helpHeader.AddEvent("UseExtraCell1", Help.UseExtra);
			helpHeader.AddEvent("UseExtraCell2", Help.UseExtra);
			helpHeader.AddEvent("CharsExtraTextBox", Help.CharsExtra);

			helpHeader.AddEvent("FilterRememberRow", Help.FilterRemember);
			helpHeader.AddEvent("FilterKeyboardRow", Help.FilterKeyboard);
			helpHeader.AddEvent("FilterPhoneRow", Help.FilterPhone);
			helpHeader.AddEvent("FilterAsciiRow", Help.FilterAscii);
			helpHeader.AddEvent("FilterCharsRow", Help.FilterChars);
			helpHeader.AddEvent(CT.FilterCharsString, Help.FilterCharsString);

			helpHeader.AddEvent("RegexEnabledRow", Help.RegexEnabled);
			helpHeader.AddEvent("RegexPatternFindTextBox", Help.RegexPatternFind);
			helpHeader.AddEvent("RegexPatternFindLabel", Help.RegexPatternFind);
			helpHeader.AddEvent("RegexPatternReplaceTextBox", Help.RegexPatternReplace);
			helpHeader.AddEvent("RegexPatternReplaceLabel", Help.RegexPatternReplace);
			helpHeader.AddEvent("ScriptEnabledRow", Help.ScriptEnabled);
			helpHeader.AddEvent(CT.ScriptCode, Help.ScriptCode);

			helpHeader.AddEvent("ListSizeCell0", Help.ListSize);
			helpHeader.AddEvent("ListSizeCell1", Help.ListSize);
			helpHeader.AddEvent("ListSeparatorCell0", Help.ListSeparator);
			helpHeader.AddEvent("ListSeparatorCell1", Help.ListSeparator);

			helpHeader.AddEvent("CopyOnLoadRow", Help.CopyOnLoad);
			helpHeader.AddEvent("CopyOnGenerateRow", Help.CopyOnGenerate);
			helpHeader.AddEvent("GenerateOnCopyRow", Help.GenerateOnCopy);
			helpHeader.AddEvent("EnableDebugRow", Help.EnableDebug);

			helpHeader.AddEvent(CT.Ok, Help.Ok);
			helpHeader.AddEvent(CT.Apply, Help.Apply);
			helpHeader.AddEvent(CT.Cancel, Help.Cancel);

			helpHeader.AddEvent("Copy1Button", "Copy password 1 to clipboard.", "ALT+1");
			helpHeader.AddEvent("Copy2Button", "Copy password 2 to clipboard.", "ALT+2");
			helpHeader.AddEvent("Copy3Button", "Copy password 3 to clipboard.", "ALT+3");
			helpHeader.AddEvent("Copy4Button", "Copy password 4 to clipboard.", "ALT+4");
			helpHeader.AddEvent("GenerateButton", "Press to regenerate passwords.", "ALT+G");
			helpHeader.AddEvent("GetListButton", "Generate list of passwords and copy to clipboard.");
			helpHeader.AddEvent("CallsPasswordTextBox", "Convert any text or password into calls so you can easily pass them thru radio or phone conversation.", "ALT+C");
			// Save CTRL+W, Save and Close: CTRL+X
		}

		function InitHeader() {
			helpHeader = new System.Web.UI.Interface.HelpHeader("HelpHeader", document, "Help", "Welcome to super flexible Password Generator!", ScriptsPath + "/System.Security.Password/Images/Icons/PassGen-48x48.gif");
			helpHeader.setCategory("Password Generator");
			helpHeader.SaveDefault();
			helpHeader.AttachDefaultEvents();
			$("HeaderPanel").appendChild(helpHeader.Node);
			InitHelp();
		}

		//=================================================================
		// Control Shortcuts.
		//-----------------------------------------------------------------			

		var shortKeys;

		function shortKeys_Action(sender, e) {
			Trace.Write("on shortKeys_Action(sender, e[EventName='" + e.EventName + "'; EventName='" + e.KeyName + "'; KeyCode=" + e.KeyCode + "])");
			// Run these actions only on keydown
			if (e.EventName == "OnKeyDown") {
				switch (e.KeyName) {
					case "ALT+D": CT.PasswordLength.focus(); break;
					case "ALT+1": CopyInput("Password1TextBox", true); break;
					case "ALT+2": CopyInput("Password2TextBox", true); break;
					case "ALT+3": CopyInput("Password3TextBox", true); break;
					case "ALT+4": CopyInput("Password4TextBox", true); break;
					case "ALT+N": CT.UseNumbers.click(); break;
					case "ALT+U": CT.UseUppercase.click(); break;
					case "ALT+L": CT.UseLowercase.click(); break;
					case "ALT+E": CT.UseExtended.click(); break;
					case "ALT+G": CT.Generate.click(); break;
					case "ALT+C": CT.CallsPassword.focus(); break;
					case "ALT+X":
						if (CT.UseExtra.checked) CT.CharsExtra.blur();
						CT.UseExtra.click();
						if (CT.UseExtra.checked) {
							if (CT.RatioExtra.value == "0") CT.RatioExtra.value = 1;
							CT.CharsExtra.focus();
						}
						break;
					case "CTRL+X": ApplyChangesAndClose(); break;
					case "CTRL+X": ApplyChanges(); break;
					case "ESCAPE": CancelChanges(); break;
					default:
				}
			}
			var enableKey = null;
			// allow [Enter] if this is notes textBox
			if (e.ActiveElement.id == "ScriptCodeTextBox" && e.KeyName == "RETURN") {
				enableKey = true;
			}
			// make sure that scripts does not run twice on key down and key up.
			if (e.EventName == "OnKeyUp") {
				if (e.KeyName == "RETURN") {
					if (e.ActiveElement == CT.PasswordLength ||
						e.ActiveElement == CT.RegexPatternFind ||
						e.ActiveElement == CT.CharsExtra ||
						e.ActiveElement == CT.RegexPatternReplace) {
						ChangeProperties(CT.PasswordLength, e);
					}
				}
				if (e.ActiveElement == CT.CallsPassword) {
					ShowCalls();
				}
			}
			// Key was pressed do enable timout;
			//TimerActionReinit();
			// Return key status
			return enableKey;
		}

		function InitializeShortKeys() {
			shortKeys = new System.Web.UI.ShortKeys.KeysManager("shortKeys");
			shortKeys.PreventKeys(["RETURN", "ALT+X", "CTRL+X", "CTRL+L", "CTRL+G", "CTRL+T", "CTRL+N", "CTRL+R", "CTRL+S", "CTRL+U", "ALT+T", "ALT+F", "ALT+M", "ALT+L", "ALT+N", "ALT+B", "ALT+W", "ALT+E", "ALT+D", "ALT+N"]);
			shortKeys.OnShortCutAction = shortKeys_Action;
		}

		//=================================================================
		// EVENTS
		//-----------------------------------------------------------------			

		function AttachEvents() {
			Events.Add(CT.FilterChars, "click", new System.EventHandler(this, FilterCharsCheckBox_Click), false);
			Events.Add(CT.Presets, "change", new System.EventHandler(this, PresetsSelect_Change), false);
			Events.Add(CT.Calls, "change", new System.EventHandler(this, CallsSelect_Change), false);
			Events.Add(CT.RegexEnabled, "click", new System.EventHandler(this, RegexEnabledCheckBox_Click), false);
			Events.Add(CT.Generate, "click", new System.EventHandler(this, GenerateButton_Click), false);
			Events.Add(CT.EnableDebug, "click", new System.EventHandler(this, EnableDebugCheckBox_Click), false);
			// Disable submition of form.
			$("PasswordGeneratorForm").onsubmit = function() { return false; }
			for (var property in System.Security.Password.CharTypeEnum) {
				Events.Add(CT["Use" + property], "click", new System.EventHandler(this, ChangeProperties), false);
			}
			for (var property in System.Security.Password.FilterTypeEnum) {
				Events.Add(CT["Filter" + property], "click", new System.EventHandler(this, ChangeProperties), false);
			}
			for (var i = 1; i <= PassItemsCount; i++) {
				Events.Add(CT["Copy" + i], "click", new System.EventHandler(this, CopyButton_Click), false);
			}
			System.Web.UI.AutoSelect.AddTo(CT.CallsPassword, 4000);
			// Convert to NumericUpDown. Parameters: id, default value, minimum, maximum, step.
			System.Web.UI.ConvertToNumericUpDown.AddTo(CT.PasswordLength, 9, 0, 100, 1);
			Events.Add(CT.ScriptEnabled, "click", new System.EventHandler(this, ScriptEnabledCheckBox_Click), false);
			Events.Add(CT.ScriptCode, "focus", new System.EventHandler(this, ScriptCodeTextBox_Focus), false);
			Events.Add(CT.ScriptCode, "blur", new System.EventHandler(this, ScriptCodeTextBox_Blur), false);
			Events.Add(CT.GetList, "click", new System.EventHandler(this, GetListButton_Click), false);
			// Add events to form control buttons.
			Events.Add(CT.Ok, "click", new System.EventHandler(this, ApplyChangesAndClose), false);
			Events.Add(CT.Cancel, "click", new System.EventHandler(this, CancelChanges), false);
			Events.Add(CT.Apply, "click", new System.EventHandler(this, ApplyChanges), false);
			Events.Add(CT.CopyOnLoad, "click", new System.EventHandler(this, CopyOnLoadCheckBox_Click), false);
			Events.Add(window, "resize", new System.EventHandler(this, Window_Resize), false);
			// Init short keys.
			InitializeShortKeys();
		}

		//=================================================================
		// Resize functions.
		//-----------------------------------------------------------------			

		function Window_Resize(sender, e) {
			ResizeStep1();
		}

		//-----------------------------------------------------------------			

		function ResizeStep0() {
			Trace.Write("ResizeStep0()");
			// Set size of all controls. Minus group padding and borders.
			var w = CT.Presets.offsetWidth - 8 - 2 - 4 - 8;
			//CT.Presets.style.width = w;
			CT.CharsExtra.style.width = w + "px";
			CT.FilterCharsString.style.width = w + "px";
			CT.RegexPatternFind.style.width = w + "px";
			CT.RegexPatternReplace.style.width = w + "px";
			CT.ScriptCode.style.width = w + "px";
			// Resize window first time.
			var mtow = $("MainTable").offsetWidth;
			var mtoh = $("MainTable").offsetHeight;
			var dbow = document.body.offsetWidth;
			var dboh = document.body.offsetHeight;
			var dw = mtow - dbow;
			var dh = mtoh - dboh;
			Trace.Write("mto=[" + mtow + ":" + mtoh + "]; dbo=[" + dbow + ":" + dboh + "]; d=[" + dw + ":" + dh + "];");
			var win = (parent) ? parent : window;
			var ieCorrection = (window.ActiveXObject) ? -2 : 0;
			//win.resizeBy(dw, dh+ieCorrection);
			win.resizeBy(0, dh + ieCorrection);
			$("CallsPanel").style.height = new String(mtoh - 58 - 58 - 3) + "px";
			$("MainTable").style.height = "100%";
			$("MainTable").style.width = "100%";
			$("MainTable").style.visibility = "visible";
		}

		function ResizeStep1() {
			for (var i = 1; i <= PassItemsCount; i++) {
				CT["Password" + i].style.width = "0";
			}
			Trace.Write("asa: " + FieldToUpdateId);
			var h = (window.ActiveXObject) ? 206 : 200; // defaul InfoCell height
			var ubh = 38; // UpdateButtonsRow height
			var bt = 28;
			//$("InfoCell").style.border = "solid 1px red";
			if (FieldToUpdateId) {
				$("InfoCell").style.height = new String(h) + "px";
				$("HelpContentPanel").style.height = new String(h - bt) + "px";
				$("TraceLog").style.height = new String(h - bt) + "px"; ;
				$("UpdateButtonsRow").style.display = "";
			} else {
				$("UpdateButtonsRow").style.display = "none";
				$("InfoCell").style.height = new String(h + ubh) + "px";
				$("HelpContentPanel").style.height = new String(h - bt + ubh) + "px";
				$("TraceLog").style.height = new String(h - bt + ubh) + "px";
			}
			setTimeout(ResizeStep2, 200);
		}

		function ResizeStep2() {
			//Trace.Write("boh: "+document.body.offsetHeight);
			//Trace.Write("wih: "+window.innerHeight);
			//Trace.Write("woh: "+window.outerHeight);
			//Trace.Write("wsh: "+window.screen.height);
			//Trace.Write("sah: "+window.screen.availHeight);
			//Trace.Write("bsh: "+document.body.scrollHeight);
			//Trace.Write("mth: "+$("MainTable").offsetHeight);
			//Trace.Write("wdh: "+parent.dialogHeight);
			var w = $("Password1Cell").offsetWidth - 4;
			for (var i = 1; i <= PassItemsCount; i++) {
				CT["Password" + i].style.width = w + "px";
			}
		}

		//=================================================================
		// Form Control Buttons
		//-----------------------------------------------------------------			

		var FieldToUpdateId;

		function QueryOptions() {
			FieldToUpdateId = System.Web.HttpContext.Current.Request.GetValue("Field", true);
		}

		function UpdateSource() {
			Trace.Write("UpdateSource() // FieldToUpdateId='" + FieldToUpdateId + "'");
			var win = (parent) ? parent : window;
			var password = CT.CallsPassword.value;
			try {
				win.opener.document.getElementById(FieldToUpdateId).value = password;
			} catch (ex) { }
		}


		function ApplyChangesAndClose() {
			Trace.Write("call ApplyChangesAndClose()");
			UpdateSource();
			var win = (parent) ? parent : window;
			win.close();
		}

		function ApplyChanges() {
			Trace.Write("call ApplyChanges()");
			UpdateSource();
		}

		function CancelChanges() {
			Trace.Write("call CancelChanges()");
			var win = (parent) ? parent : window;
			win.close();
		}

		//=================================================================
		// Window Init
		//-----------------------------------------------------------------			

		Events.Add(window, "load", new System.EventHandler(this, Window_Load), false);
	
	</script>

</head>
<body class="SWUI_NoScroll">
	<form id="PasswordGeneratorForm" enctype="multipart/form-data" action="">
	<div style="display: none;">
		<input type="checkbox" id="RegexIgnoreCaseCheckBox" />
	</div>
	<table id="MainTable" cellspacing="0" cellpadding="0" border="0" class="SWUI_PG_MainTable">
		<tr>
			<td id="HeaderPanel" style="height: 58px; border-bottom: solid 1px #bac2d6; width: 100%;">
			</td>
		</tr>
		<tr>
			<td style="height: 100%;" valign="top">
				<table cellspacing="0" cellpadding="0" border="0" style="height: 100%; width: 100%;">
					<tr>
						<td valign="top" class="SWUI_PG_OptionsCell">
							<div class="SWUI_PG_Group">
								<select class="SWUI_Prg_TbxLeft" id="PresetsSelect" style="width: 100%;">
								</select>
							</div>
							<div class="SWUI_PG_Group">
								<span class="SWUI_PG_Legend">Password Contains</span>
								<div class="SWUI_PG_SubGroup">
									<table class="TableEnabled" id="PasswordContainsTable" cellspacing="0" cellpadding="0"
										border="0">
										<tr>
											<td class="SWUI_PG_TdRatio" id="UseNumbersCell0">
												<input class="SWUI_Prg_TbxCenter" size="1" value="1" id="RatioNumbersTextBox" />
											</td>
											<td class="SWUI_PG_TdValue" id="UseNumbersCell1">
												<input type="checkbox" id="UseNumbersCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel" id="UseNumbersCell2">
												<label for="UseNumbersCheckBox" id="UseNumbersLabel">
													<span class="SWUI_PG_Underline">N</span>umbers</label>
											</td>
										</tr>
										<tr id="UseUppercaseRow">
											<td class="SWUI_PG_TdRatio" id="UseUppercaseCell0">
												<input class="SWUI_Prg_TbxCenter" size="1" value="1" id="RatioUppercaseTextBox" />
											</td>
											<td class="SWUI_PG_TdValue" id="UseUppercaseCell1">
												<input type="checkbox" id="UseUppercaseCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel" id="UseUppercaseCell2">
												<label for="UseUppercaseCheckBox" id="UseUppercaseLabel">
													<span class="SWUI_PG_Underline">U</span>ppercase</label>
											</td>
										</tr>
										<tr id="UseLowercaseRow">
											<td class="SWUI_PG_TdRatio" id="UseLowercaseCell0">
												<input class="SWUI_Prg_TbxCenter" size="1" value="1" id="RatioLowercaseTextBox" />
											</td>
											<td class="SWUI_PG_TdValue" id="UseLowercaseCell1">
												<input type="checkbox" id="UseLowercaseCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel" id="UseLowercaseCell2">
												<label for="UseLowercaseCheckBox" id="UseLowercaseLabel">
													<span class="SWUI_PG_Underline">L</span>owercase</label>
											</td>
										</tr>
										<tr id="UseExtendedRow">
											<td class="SWUI_PG_TdRatio" id="UseExtendedCell0">
												<input class="SWUI_Prg_TbxCenter" size="1" value="1" id="RatioExtendedTextBox" />
											</td>
											<td class="SWUI_PG_TdValue" id="UseExtendedCell1">
												<input type="checkbox" id="UseExtendedCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel" id="UseExtendedCell2">
												<label for="UseExtendedCheckBox" id="UseExtendedLabel">
													<span class="SWUI_PG_Underline">E</span>xtended</label>
											</td>
										</tr>
										<tr id="UseExtraRow">
											<td class="SWUI_PG_TdRatio" id="UseExtraCell0">
												<input class="SWUI_Prg_TbxCenter" size="1" value="1" id="RatioExtraTextBox" />
											</td>
											<td class="SWUI_PG_TdValue" id="UseExtraCell1">
												<input type="checkbox" id="UseExtraCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel" id="UseExtraCell2">
												<label for="UseExtraCheckBox" id="UseExtraLabel">
													E<span class="SWUI_PG_Underline">x</span>tra:</label>
											</td>
										</tr>
									</table>
								</div>
								<div class="SWUI_PG_SubGroupCharsExtra">
									<input class="SWUI_Prg_TbxLeft SWUI_100w" value="" id="CharsExtraTextBox" /><br />
								</div>
							</div>
							<div class="SWUI_PG_Group">
								<label class="SWUI_PG_Legend" for="PasswordLengthTextBox" autocomplete="off">
									Passwor<span class="SWUI_PG_Underline">d</span> Length</label>
								<div class="SWUI_PG_SubGroup">
									<table class="TableEnabled" cellspacing="0" cellpadding="0" border="0">
										<tr>
											<td class="SWUI_PG_TdRatio">
												<input id="PasswordLengthTextBox" class="SWUI_Prg_TbxCenter" size="1" value="9" />
											</td>
											<td class="SWUI_PG_TdLabel">
											</td>
										</tr>
									</table>
								</div>
							</div>
							<div class="SWUI_PG_Group">
								<span class="SWUI_PG_Legend">Apply Filters</span>
								<div class="SWUI_PG_SubGroup">
									<table id="tblFilters" cellspacing="0" cellpadding="0" border="0">
										<tr id="FilterRememberRow">
											<td class="SWUI_PG_TdValue">
												<input type="checkbox" id="FilterRememberCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel">
												<label for="FilterRememberCheckBox" id="FilterRememberLabel">
													Easy to Remember</label>
											</td>
										</tr>
										<tr id="FilterKeyboardRow">
											<td class="SWUI_PG_TdValue">
												<input type="checkbox" id="FilterKeyboardCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel">
												<label for="FilterKeyboardCheckBox" id="FilterKeyboardLabel">
													For PC Keyboard</label>
											</td>
										</tr>
										<tr id="FilterPhoneRow">
											<td class="SWUI_PG_TdValue">
												<input type="checkbox" id="FilterPhoneCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel">
												<label for="FilterPhoneCheckBox" id="FilterPhoneLabel">
													For Phone Keypad</label>
											</td>
										</tr>
										<tr id="FilterAsciiRow">
											<td class="SWUI_PG_TdValue">
												<input type="checkbox" id="FilterAsciiCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel">
												<label for="FilterAsciiCheckBox" id="FilterAsciiLabel">
													ASCII Only</label>
											</td>
										</tr>
										<tr id="FilterCharsRow">
											<td class="SWUI_PG_TdValue">
												<input type="checkbox" id="FilterCharsCheckBox" class="SWUI_Prg_Cbx13" />
											</td>
											<td class="SWUI_PG_TdLabel">
												<label for="FilterCharsCheckBox" id="FilterCharsLabel">
													Chars:</label>
											</td>
										</tr>
									</table>
								</div>
								<div class="SWUI_PG_SubGroupCharsString">
									<input class="SWUI_Prg_TbxLeft SWUI_100w" size="14" value="qwxzQWXZ" name="FilterCharsStringTextBox"
										id="FilterCharsStringTextBox" />
								</div>
							</div>
							<div class="SWUI_PG_Group">
								<table cellspacing="0" cellpadding="0" border="0">
									<tr id="RegexEnabledRow">
										<td>
											<input type="checkbox" value="1" id="RegexEnabledCheckBox" class="SWUI_Prg_Cbx13" />
										</td>
										<td class="SWUI_PG_TdLabel">
											<label for="RegexEnabledCheckBox" id="RegexEnabledLabel" class="SWUI_PG_Legend">
												Apply Regular Expressions</label>
										</td>
									</tr>
								</table>
								<div class="SWUI_PG_SubGroup" id="RegexSubgroupPanel">
									<label for="RegexPatternFindTextBox" id="RegexPatternFindLabel">
										Pattern To Find:</label><br />
									<input id="RegexPatternFindTextBox" class="SWUI_Prg_TbxLeft SWUI_100w" style="" /><br />
									<label for="RegexPatternReplaceTextBox" id="RegexPatternReplaceLabel">
										Pattern To Replace:</label><br />
									<input id="RegexPatternReplaceTextBox" class="SWUI_Prg_TbxLeft SWUI_100w" />
								</div>
							</div>
							<div class="SWUI_PG_Group">
								<table cellspacing="0" cellpadding="0" border="0">
									<tr id="ScriptEnabledRow">
										<td>
											<input type="checkbox" value="1" id="ScriptEnabledCheckBox" class="SWUI_Prg_Cbx13" />
										</td>
										<td class="SWUI_PG_TdLabel">
											<label for="ScriptEnabledCheckBox" id="ScriptEnabledLabel" class="SWUI_PG_Legend">
												Apply Scripts</label>
										</td>
									</tr>
								</table>
								<div class="SWUI_PG_SubGroup" id="ApplyScriptsGroupPanel" style="padding-bottom: 0;">
									<textarea cols="10" rows="2" id="ScriptCodeTextBox" wrap="off" class="SWUI_Prg_TbxLeft SWUI_PG_ScriptCodeBlur"></textarea>
								</div>
							</div>
						</td>
						<td valign="top" class="SWUI_PG_ResultsCell" id="ResultsCell">
							<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;" id="ResultsTable">
								<tr>
									<td>
										<div class="SWUI_PG_Group">
											<span class="SWUI_PG_Legend">Choose From List</span>
											<div class="SWUI_PG_SubGroup">
												<table id="ChooseListTable" style="width: 100%;" cellspacing="2" cellpadding="0"
													border="0">
													<tr>
														<td style="width: 100%;" class="SWUI_PG_PassCell" id="Password1Cell">
															<input class="SWUI_PG_Pass" type="text" id="Password1TextBox" />
														</td>
														<td align="right">
															<button id="Copy1Button" style="margin-left: 4px; width: 74px; outline: none;" type="button"
																class="SWUI_Prg_TbxCenter">
																Copy</button>
														</td>
													</tr>
													<tr>
														<td style="white-space: nowrap; width: 100%;" class="SWUI_PG_PassCell">
															<input class="SWUI_PG_Pass" type="text" id="Password2TextBox" />
														</td>
														<td align="right">
															<button id="Copy2Button" style="margin-left: 4px; width: 74px; outline: none;" type="button"
																class="SWUI_Prg_TbxCenter">
																Copy</button>
														</td>
													</tr>
													<tr>
														<td style="white-space: nowrap; width: 100%;" class="SWUI_PG_PassCell">
															<input class="SWUI_PG_Pass" type="text" id="Password3TextBox" />
														</td>
														<td align="right">
															<button id="Copy3Button" style="margin-left: 4px; width: 74px; outline: none;" type="button"
																class="SWUI_Prg_TbxCenter">
																Copy</button>
														</td>
													</tr>
													<tr>
														<td style="white-space: nowrap; width: 100%;" class="SWUI_PG_PassCell">
															<input class="SWUI_PG_Pass" type="text" id="Password4TextBox" />
														</td>
														<td align="right">
															<button id="Copy4Button" style="margin-left: 4px; width: 74px; outline: none;" type="button"
																class="SWUI_Prg_TbxCenter">
																Copy</button>
														</td>
													</tr>
													<tr>
														<td style="white-space: nowrap; width: 100%;" class="SWUI_PG_PassCell">
															<input class="SWUI_PG_Pass" type="text" id="Text1" style="width: 4px; visibility: hidden;" />
														</td>
														<td align="right">
															<button id="GenerateButton" type="button" style="margin-left: 4px; width: 74px; outline: none;"
																class="SWUI_Prg_TbxCenter">
																<span style="text-decoration: underline;">G</span>enerate</button>
														</td>
													</tr>
												</table>
											</div>
										</div>
										<div class="SWUI_PG_Group">
											<span class="SWUI_PG_Legend">Generate List</span>
											<div class="SWUI_PG_SubGroup">
												<table id="Table5" cellspacing="0" cellpadding="0" border="0">
													<tr>
														<td class="SWUI_PG_TdOption" id="ListSizeCell0">
															<input class="SWUI_Prg_TbxCenter" size="1" value="20" id="ListSizeTextBox" />
														</td>
														<td class="SWUI_PG_TdLabel" id="ListSizeCell1" style="white-space: nowrap; padding-right: 4px;">
															<label for="ListSizeTextBox" id="ListSizeLabel">
																Passwords with</label>
														</td>
														<td class="SWUI_PG_TdOption" id="ListSeparatorCell0">
															<input class="SWUI_Prg_TbxCenter" id="ListSeparatorTextBox" size="1" value="\r\n" />
														</td>
														<td class="SWUI_PG_TdLabel" id="ListSeparatorCell1">
															<label for="ListSeparatorTextBox" id="ListSeparatorLabel">
																separator</label>
														</td>
														<td align="right" style="width: 100%;">
														</td>
														<td align="right" style="width: 100%">
															<button id="GetListButton" type="button" style="margin-left: 4px; width: 74px; outline: none;"
																class="SWUI_Prg_TbxCenter">
																Get List</button>
														</td>
													</tr>
												</table>
											</div>
										</div>
										<div class="SWUI_PG_Group">
											<span class="SWUI_PG_Legend">Generator Options</span>
											<div class="SWUI_PG_SubGroup">
												<table cellspacing="0" cellpadding="0" border="0">
													<tr id="CopyOnLoadRow">
														<td class="SWUI_PG_TdValue">
															<input type="checkbox" id="CopyOnLoadCheckBox" class="SWUI_Prg_Cbx13" />
														</td>
														<td class="SWUI_PG_TdLabel">
															<label for="CopyOnLoadCheckBox">
																Copy on Load</label>
														</td>
													</tr>
													<tr id="CopyOnGenerateRow">
														<td class="SWUI_PG_TdValue">
															<input type="checkbox" checked="checked" id="CopyOnGenerateCheckBox" class="SWUI_Prg_Cbx13" />
														</td>
														<td class="SWUI_PG_TdLabel">
															<label for="CopyOnGenerateCheckBox">
																Copy on [Generate]</label>
														</td>
													</tr>
													<tr id="GenerateOnCopyRow">
														<td class="SWUI_PG_TdValue">
															<input type="checkbox" checked="checked" id="GenerateOnCopyCheckBox" class="SWUI_Prg_Cbx13" />
														</td>
														<td class="SWUI_PG_TdLabel">
															<label for="GenerateOnCopyCheckBox">
																Generate on [Copy]</label>
														</td>
													</tr>
													<tr id="EnableDebugRow">
														<td class="SWUI_PG_TdValue">
															<input type="checkbox" id="EnableDebugCheckBox" class="SWUI_Prg_Cbx13" />
														</td>
														<td class="SWUI_PG_TdLabel">
															<label for="EnableDebugCheckBox">
																Enable Debug</label>
														</td>
													</tr>
													<tr style="display: none;">
														<td class="SWUI_PG_TdValue">
															<input type="checkbox" value="1" name="cbxOptionGenerateTimer" id="cbxOptionGenerateTimer"
																class="SWUI_Prg_Cbx13" />
														</td>
														<td class="SWUI_PG_TdLabel">
															<table border="0" cellpadding="0" cellspacing="0" id="Table2">
																<tr>
																	<td>
																		<label for="cbxOptionGenerateTimer">
																			Generate each</label>
																	</td>
																	<td>
																		<input type="text" class="SWUI_Prg_TbxCenter" style="margin-left: 4px; margin-right: 4px;"
																			size="1" value="5" id="tbxGenerateTimerInterval" name="tbxGenerateTimerInterval" />
																	</td>
																	<td>
																		<label for="cbxOptionGenerateTimer">
																			sec</label>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</div>
										</div>
									</td>
								</tr>
								<tr>
									<td valign="top" id="InfoCell">
										<div class="SWUI_PG_Group" id="HelpPanel" style="padding-bottom: 0;">
											<span class="SWUI_PG_Legend" style="">Help</span>
											<div class="SWUI_PG_SubGroup" style="padding-right: 8px;">
												<div id="HelpContentPanel" class="SWUI_MenuDown" style="width: 100%;">
													<p style="margin: 0; padding: 4px 4px 4px 4px; text-align: justify; color: #606060;">
														This password generator can generate "Easy to Remember" passwords which look like
														real words but they are not. It is easy to pronounce such passwords and they contain
														only most popular Latin letters. It is much easier for brain to remember them as
														whole words and not as separate sequence of random chars. These passwords can benefit
														you if you are network admin or have loads of passwords to remember. Just press
														[Generate] button and choose easiest to read password from the list.
														<br />
														<br />
														You also can use "Calls" feature and convert any password or text into international
														NATO phonetic alphabet (Alpha, Bravo, Charlie, Delta...) so it will be easy to pass
														them correctly thru radio or phone conversation.</p>
												</div>
											</div>
										</div>
										<div class="SWUI_PG_Group" id="TracePanel" style="display: none; padding-bottom: 0;">
											<span class="SWUI_PG_Legend">Debug - Log</span>
											<div class="SWUI_PG_SubGroup" style="padding-right: 8px;">
												<div id="TraceLog" style="width: 100%;"></div>
											</div>
										</div>
									</td>
								</tr>
								<tr id="UpdateButtonsRow" style="display: none; height: 30px;">
									<td valign="bottom" align="center">
										<button class="SWUI_Prg SWUI_Btn" id="OkButton" type="button">
											<div>
												<img alt="OK" src="../System.Security.Password/Images/Icons/OK-16x16.png" />OK</div>
										</button>
										<button class="SWUI_Prg SWUI_Btn" id="CancelButton" type="button" style="margin-left: 4px;">
											<div>
												<img alt="Cancel" src="../System.Security.Password/Images/Icons/Cancel-16x16.png" />Cancel</div>
										</button>
										<button class="SWUI_Prg SWUI_Btn" id="ApplyButton" type="button" style="margin-left: 4px;">
											<div>
												<img alt="Apply" src="../System.Security.Password/Images/Icons/Apply-16x16.png" />Apply</div>
										</button>
									</td>
								</tr>
							</table>
						</td>
						<td valign="top" class="SWUI_PG_CallsCell">
							<div class="SWUI_PG_Group">
								<div class="SWUI_PG_InputFixPanel" style="padding: 0;">
									<table cellpadding="0" cellspacing="0" border="0" style="width: 100%; padding: 0; margin: 0;">
										<tr>
											<td>
												<input id="CallsPasswordTextBox" class="SWUI_Prg_TbxCenter" type="text" size="20"
													style="color: green; font-family: Courier New; font-size: 9pt; width: 100%;" />
											</td>
											<td style="width: 30px" align="right">
												<input id="CallsPasswordLengthTextBox" class="SWUI_PG_TbxDisabled SWUI_PG_CallLength" type="text" size="20"
													style="font-family: Courier New; font-size: 9pt; text-align: center; color: #808080;" /></td>
										</tr>
									</table>
								</div>
								<select class="SWUI_Prg_TbxLeft" style="margin-top: 2px; width: 100%;" id="CallsSelect"
									name="CallsSelect">
									<option selected="selected" value="NATO">NATO</option>
									<option value="TelecomB">Telecom B</option>
									<option value="CT">Names and Things</option>
								</select>
								<div id="CallsPanel" style="width: 100%; height: 468px; overflow-x: hidden; overflow-y: auto;">
								</div>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	</form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions