function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = "";
} 

function fillText(thefield){
	if (""==thefield.value)
	thefield.value = thefield.defaultValue;
}

function validateSearch(){
	reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
	if (document.getElementById("sclocator_zipcode").value != document.getElementById("sclocator_zipcode").defaultValue && !reZip.test(document.getElementById("sclocator_zipcode").value)) {
		alert('Please enter a valid zipcode.');
		return false;
	} else if (reZip.test(document.getElementById("sclocator_zipcode").value)) {
		return true;
	} else if (document.getElementById("sclocator_city").value != document.getElementById("sclocator_city").defaultValue && document.getElementById("sclocator_state").selectedIndex == 0){
		alert("Please select a state.");
		return false;
	} else if (document.getElementById("sclocator_city").value == document.getElementById("sclocator_city").defaultValue && document.getElementById("sclocator_state").selectedIndex != 0){
		alert("Please enter a city.");
		return false;
	} else if (document.getElementById("sclocator_city").value != document.getElementById("sclocator_city").defaultValue && document.getElementById("sclocator_state").selectedIndex != 0) {
		return true;
	} else {
		alert("Please enter a zipcode, or a city and state.");
		return false;
	}
	return true;
}