
	function setInitialValues() {
		changeCountry();
		changeFields(); 
	 }

	function changeCountry() {
		 if(document.search.country.selectedIndex == 1) {
			document.getElementById("locationsearch").style.visibility = "hidden";
			document.getElementById("statesearch").style.visibility = "hidden";
			document.getElementById("provincesearch").style.visibility = "visible";
		 } else {
			changeFields();
		 }
	 }

	 function changeFields() {
		 if (document.search.country.selectedIndex == 0) {
			 if(document.search.category.selectedIndex == 5) {
				document.getElementById("statesearch").style.visibility = "visible";
				document.getElementById("locationsearch").style.visibility = "hidden";
				document.getElementById("provincesearch").style.visibility = "hidden";
			 } else {
				document.getElementById("statesearch").style.visibility = "hidden";
				document.getElementById("locationsearch").style.visibility = "visible";
				document.getElementById("provincesearch").style.visibility = "hidden";
			 }
		 }
	 }

	 function validateForm() {
		if ((document.search.country.selectedIndex == 0) && (document.search.category.selectedIndex != 5)) 
			{
			if (document.search.location.value == "")
				{
				alert("Please enter a valid ZIP code or City, State combination");
				return false;
				}
			else 
				{
				if (!IsNumeric(document.search.location.value))
					{
					if (document.search.location.value.indexOf(',') > 0)
						{
						return true;
						}
					else
						{
						alert("Please enter a valid city and state.\n For Example: Burbank, CA or Provo, Utah");
						return false;
						}
					}
				else 
					{
					if (document.search.location.value.length != 5)
						{
						alert("Please enter a valid 5-digit ZIP code.");
						return false;
						}
					else
						{
						return true;
						}
					}
				}
			}
		}

	function IsNumeric(sText)
		{
	   var ValidChars = "0123456789.";
	   var IsNumber=true;
	   var Char;

	 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
			 IsNumber = false;
			 }
		  }
	   return IsNumber;
	   
	   }



