	//  search functions --------------------
	
	var req;
	
	function formSbmt(){
		var goFlag = true;
		msg = "";
		$("errFlag").style.display = "none";
		
		// return result
		if(goFlag){
			document.SearchForm.submit();
		}else{
			$("errFlag").innerHTML = msg;
			$("errFlag").style.display = "block";
			return false;
		}
	}
	
	function submitRemoveCannedSearch(){
		document.SearchForm.cannedsearch.value = "0";
		document.SearchForm.submit();
	}

	function searchInit(theId, testStr){
		if(testStr == "Type a subject, topic, or title"){
		document.getElementById(theId).value="";
		}
	}
	
	function val_search(){
		// this does no validation except remove the default input text
		if (document.SearchForm.searchterm.value == "Type a subject, topic, or title"){
			document.SearchForm.searchterm.value = "";
		}
		temp = document.SearchForm.softwaretype.value;
//		alert("'" + temp.substring(0, 4) + "'");
		if (temp.substring(0, 4) == "====")
		{
			$("errFlag").innerHTML = "Please select a software product.";
			$("errFlag").style.display = "block";
			return false;
		}
		// return result
		return true;
	}

	/* 	
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FUNCTION: URLEncode 
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	*/
	function URLEncode(origString)	{
		// The Javascript escape and unescape functions do not correspond
		// with what browsers actually do...
		var SAFECHARS = "0123456789" +					// Numeric
						"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
						"abcdefghijklmnopqrstuvwxyz" +
						"-_.!~*'()";					// RFC2396 Mark characters
		var HEX = "0123456789ABCDEF";
		
		var plaintext = origString;
		var encoded = "";
		for (var i = 0; i < plaintext.length; i++ ) {
			var ch = plaintext.charAt(i);
			if (ch == " ") {
				encoded += "+";				// x-www-urlencoded, rather than %20
			} else if (SAFECHARS.indexOf(ch) != -1) {
				encoded += ch;
			} else {
				var charCode = ch.charCodeAt(0);
				if (charCode > 255) {
					/*
					alert( "Unicode Character '" 
							+ ch 
							+ "' cannot be encoded using standard URL encoding.\n" +
							  "(URL encoding only supports 8-bit characters.)\n" +
							  "A space (+) will be substituted." );
					*/
					encoded += "+";
				} else {
					encoded += "%";
					encoded += HEX.charAt((charCode >> 4) & 0xF);
					encoded += HEX.charAt(charCode & 0xF);
				}
			}
		} // for
		
		//document.URLForm.F2.value = encoded;
		return encoded;
	};
	
	/* 	
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FUNCTION: clk = Used for click through reporting
				valId: Id of hit
				searchFormName: Which form holds the query
					element?
				queryElementName: What element holds the query
					text?
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	*/
	/*
	function clk(valId) {
		var strUrl 			= encodeURIComponent(document.getElementById(valId).getAttribute("href"));
		var strAnchorText 	= encodeURIComponent(document.getElementById(valId).innerHTML);
		var strQuery 		= encodeURIComponent(document.forms[searchFormName].elements[queryElementName].value);
		//strParentSite		= encodeURIComponent(strParentSite);
		strParentURL		= encodeURIComponent(strParentUrl);
		var urlString 		= MY_DOMAIN + "index.cfm?fa=search.clickticker&sf=" + strQuery + "&cci=" + intContentConsumerId + "&upp=" + strParentURL + "&uc=" + strUrl + "&t=" + strAnchorText;
		
		//alert (urlString);
		
		// branch for native XMLHttpRequest object
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			//req.onreadystatechange = processReqChange();
			req.open("GET", urlString , true);
			req.send(null);
					
		// branch for IE/Windows ActiveX version
		} else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				//req.onreadystatechange = processReqChange();
				req.open("GET", urlString , true);
				req.send();
			}
		}
	}
	
	function processReqChange() {
		// only if req shows "loaded"
		if (req.readyState == 4) {
			// only if "OK"
			if (req.status == 200) {
				alert(req.responseText)
			} else {
				alert("There was a problem retrieving the XML data:\n" +
					req.statusText);
			}
		}
	}
	*/
	
	/* 	
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FUNCTION: keyhandler = Used for handling "enter" key
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	*/
	function keyhandler(e) {
		if (document.layers)
			Key = e.which;
		else
			Key = window.event.keyCode;
		if (Key == 13)
		{
			document.forms[1].elements[4].click();return false;
		}
		else return true;
	}
	
	/* 	
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FUNCTION: left = Trim left side of string
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	*/
	function left(str, n)
	{
		if (n <= 0)
		{
			return "";
		}
		else if (n > String(str).length)
		{
			return str;
		}
		else
		{
			return String(str).substring(0,n);
		}
	}
	
	/* 	
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FUNCTION: right = Trim right side of string
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	*/
	function right(str, n)
	{
		if (n <= 0)
		{
		   return "";
		}
		else if (n > String(str).length)
		{
		   return str;
		}
		else
		{
		   var iLen = String(str).length;
		   return String(str).substring(iLen, iLen - n);
		}
	}
	
	
	
	
	// end search functions ----------------------
