<!--

	function removeFromList(listField) 
		{
			if ( listField.length == -1) {  // If the list is empty
				alert("There are no values which can be removed!");
			} else {
				var selected = listField.selectedIndex;
				if (selected == -1) {
					alert("You must select an entry to be removed!");
				} else {  // Build arrays with the text and values to remain
					var replaceTextArray = new Array(listField.length-1);
					var replaceValueArray = new Array(listField.length-1);
					for (var i = 0; i < listField.length; i++) {
						// Put everything except the selected one into the array
						if ( i < selected) { replaceTextArray[i] = listField.options[i].text; }
						if ( i > selected ) { replaceTextArray[i-1] = listField.options[i].text; }
						if ( i < selected) { replaceValueArray[i] = listField.options[i].value; }
						if ( i > selected ) { replaceValueArray[i-1] = listField.options[i].value; }
					}
					listField.length = replaceTextArray.length;  // Shorten the input list
					for (i = 0; i < replaceTextArray.length; i++) { // Put the array back into the list
						listField.options[i].value = replaceValueArray[i];
						listField.options[i].text = replaceTextArray[i];
					}
				} // Ends the check to make sure something was selected
			} // Ends the check for there being none in the list
		}
		
	function InsertIntoListBox(textbox, selection)
		{
		
			if ((GetOptionText(selection) != "By...") && (GetSummarizeText().length > 0))
			{
				var anOption = document.createElement("OPTION")
				
				document.frmSearch.selQuery.options.add(anOption)
				anOption.innerText = GetOptionText(selection) + " = " + GetSummarizeText() 
				anOption.Value = "2"
				
				BuildSQLString(document.frmSearch.selQuery);

				var sQueryString = "Your selected criteria are "
				var sSQLStringHolder = document.frmSearch.SQLStringHolder.value
				document.getElementById('sqlQuery').innerHTML = sQueryString + " " + sSQLStringHolder.substring(0,sSQLStringHolder.length-4)
			}
			else
				alert("A category must be selected and the information textbox must have text in it.");
		}
		
	function GetSummarizeText()
		{
			return document.frmSearch.SummarizeText.value   //.frmSearch.SummarizeText.Value
		}
		
	function GetOptionText(selection)
		{
			return selection.options[selection.selectedIndex].text
		}
		
	function categorySelection(selection)
		{
			document.frmSearch.SQLStringHolder1.value=selection.options[selection.selectedIndex].text			
		}
	
	function BuildSQLString(listField) 
		{
			document.frmSearch.SQLStringHolder.value = "";
			
			for (var i = 0; i < listField.length; i++) {
				var aKeyPair = listField.options[i].text.split(" = ");
				if (
				(aKeyPair[0]=="FileDate") || 
				(aKeyPair[0]=="DateContactedUtility")||
				(aKeyPair[0]=="DateOfSettlement")
				)
					{
						document.frmSearch.SQLStringHolder.value += aKeyPair[0] + " >= " + "#" + aKeyPair[1] + "#" + " AND "
					}
				else
					{
						document.frmSearch.SQLStringHolder.value += aKeyPair[0] + " Like '" + aKeyPair[1] + "' AND "
					}
			}		
			//alert("SQLStringHolder = '" + document.frmSearch.SQLStringHolder.value + "'");
		}
		
	function SQLString(frmSearch)
		{
			with(document.frmSearch)
			{
				if (
				(SQLStringHolder1.value=="FileDate") || 
				(SQLStringHolder1.value=="DateContactedUtility")||
				(SQLStringHolder1.value=="DateOfSettlement")
				)
					{
						SQLStringHolder.value += SQLStringHolder1.value + " >= " + "#" + SummarizeText.value + "#" + " AND "
					}
				else
					{
						SQLStringHolder.value += SQLStringHolder1.value + " Like '" + SummarizeText.value + "' AND "
					}
				alert("Category: " + SQLStringHolder1.value + "\n" + "Criterion: " + SummarizeText.value+ "\n" + "Please make another selection for your search. Otherwise, click the green GET button to see the result from your selections.")
			}
		}	
	//-->