   function check_survey(tgt) {

		if (tgt.restaurant_name && !tgt.restaurant_name.value.length ) {
			alert('Please enter the restaurant name.');
			if (tgt.restaurant_name) {
				tgt.restaurant_name.focus();
			}
			return false;
		}
		if (tgt.band_name && !tgt.band_name.value.length) {
			alert('Please enter the band name.');
			if (tgt.band_name) {
				tgt.band_name.focus();
			}
			return false;
		}
		if (tgt.agree && !tgt.agree[0].checked) {
			alert('You must agree to the terms to continue.');
			return false;
		}
		if (tgt.club_name && !tgt.club_name.value.length ) {
			alert('Please enter the club name.');
			if (tgt.club_name) {
				tgt.club_name.focus();
			}
			return false;
		}
		if (!tgt.updatename.value) {
			alert('You must provide your name to complete and submit this survey.');
			tgt.updatename.focus();
			return false;
			}

		else if (!tgt.updatephone.value) {
			alert('You must provide contact information to complete and submit this survey.');
			tgt.updatephone.focus();
			return false;
			}

		return ValidateForm(tgt);

	}
	
	function IsNumeric(sText)
	{     var ValidChars = "0123456789.,";
	   var IsNumber=true;
	   var Char;
	   var decCount = 0;
	
	
	   for (i = 0; i < sText.length && IsNumber == true; i++) {
		  Char = sText.charAt(i);
		  if ( Char == '.' ) decCount++;
		  if ( decCount > 1 ) {
			 IsNumber = false;
			 break;
		  }
		  if (ValidChars.indexOf(Char) == -1
			&& !(i == 0 && sText.charAt(i) == '-')  ) {
			 IsNumber = false;
			 break;
		  }
	   }
	   return IsNumber;
	
	}

	function strCount( needle, haystack ) {
		var count = 0;
		while( haystack.indexOf(needle) ) {
			count++;
			haystack = haystack.substring( haystack.indexOf(needle) );
		}
		return count;
	}
	
	function ValidateForm(form) {
		if (form.min_price && !IsNumeric(form.min_price.value))
	   {
		  alert('Enter only numbers, decimal points, or commas in the Least expensive entree field')
		  form.min_price.focus();
		  return false;
		  }
		if (form.max_price && !IsNumeric(form.max_price.value))
	   {
		  alert('Enter only numbers, decimal points, or commas in the Most expensive entree field')
		  form.max_price.focus();
		  return false;
		}
	   return check_required_fields();
	}
	
	function check_required_fields() {
			if (document.theform.company && !document.theform.company.value.length ) {
				alert('The required field company name has not been completed. Please enter a value for this field before submitting your data!');
	
			if ( document.theform.company ) {
				document.theform.company.focus();
			}
			return false;
			}
			return true;
	}
