jQuery(document).ready(function($) {
	$('a[rel*=facebox]').facebox();
})

function clearText(thefield) {
	if (thefield.defaultValue==thefield.value)
	{
		thefield.value = "";
	} else if (thefield.value == "") {
		thefield.value = thefield.defaultValue;
	}
}

function YellowPage_Show_Search () {
	document.getElementById('yellow-page-search').style.display = 'block';
	document.getElementById('yellow-page-browse').style.display = 'none';
	document.getElementById('yp-search-img').src = '/-images/content/utilities/yp-search-active.jpg';
	document.getElementById('yp-browse-img').src = '/-images/content/utilities/yp-browse-inactive.jpg';
}

function YellowPage_Show_Browse () {
	document.getElementById('yellow-page-search').style.display = 'none';
	document.getElementById('yellow-page-browse').style.display = 'block';
	document.getElementById('yp-search-img').src = '/-images/content/utilities/yp-search-inactive.jpg';
	document.getElementById('yp-browse-img').src = '/-images/content/utilities/yp-browse-active.jpg';
}

function Validate_YellowPage_Widget(form) {
	
	if ((form.state.value == "") || (form.confirm.value == "")) {
		alert("Please select a state to search.");
		return false;
	} else if ((form.location.value == form.location.defaultValue) || (form.location.value == "Enter County or City")) {
		alert("Please enter a county or city to search.");
		return false;
	} else if ((form.phrase.value == form.phrase.defaultValue) || (form.phrase.value == "Enter Search Term")) {
		alert("Please enter a phrase to search.");
		return false;
	}
	
	return true;	
}