	//----------------------------------------------------------
	// Name		: ltrim
	// Purpose	: Removes leading spaces from start of string
	//----------------------------------------------------------
	//
	function ltrim(strText)
	{
		while (strText.charAt(0)==" ")
		{
			strText = strText.substring(1);
		}
		return strText;
	}

	//----------------------------------------------------------
	// Name		: rtrim
	// Purpose	: Remove trailing spaces from end of string
	//----------------------------------------------------------
	//
	function rtrim(strText)
	{
		while (strText.charAt( strText.length-1 )==" ")
		{
			strText = strText.substring(0, strText.length-1);
		}
		return strText;
	}

	//----------------------------------------------------------
	// Name		: trim
	// Purpose	: Removes any leading or trailing spaces from a string.
	//----------------------------------------------------------
	//
	function trim(strText)
	{
		strText = ltrim(strText);
		strText = rtrim(strText);
		return strText;
	}

	//----------------------------------------------------------
	// Name		: isEmailAddr
	// Purpose	: Checks for correct email syntax
	//----------------------------------------------------------
	//
	function isEmailAddr(email)
	{
		var result = false;
		var theStr = new String(email)
		var index = theStr.indexOf("@");
		if (index > 0)
		{
			var pindex = theStr.indexOf(".",index);
			if ((pindex > index+1) && (theStr.length > pindex+1))
				result = true;
		}
		return result;
	}

	//----------------------------------------------------------
	// Name		: validateSearch
	// Purpose	: Search Engine Validation
	//----------------------------------------------------------
	//
	function validateSearch(theForm)
	{
		var checkStr = new String(trim(theForm.SearchString.value));
	
		if ((checkStr == "") || (checkStr.length < 2))
		{
			alert("Please enter at least 2 characters for your search words or phrases.");
			theForm.SearchString.focus();
			return false;
		}

		if ((checkStr.length == 2) && (checkStr.indexOf("-", 1) == 1))
		{
			alert("Please enter more information.");
			theForm.SearchString.focus();
			return false;
		}

		var checkOK = "£,.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒšœŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789- \t\r\n\f";
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
					if (j == checkOK.length)
					{
						allValid = false;
						break;
					}
		}
	
		if (!allValid)
		{
			alert("Please enter only letters or numbers for your search words or phrases.");
			theForm.SearchString.focus();
			return (false);
		}
		return true;
	}