// ### COMMON METHODS ###

function isValidSearch() {
	form = document.forms.quickSearchForm
	if (form.searchTerm.value == "") {
		alert("Please provide a search term.");
		return false;
	} else if (form.searchTerm.value.length < 4) {
		alert("Search terms must be at least 4 characters long.");
		return false;
	}
	return (true)
}

function buildSearch() {
	if (isValidSearch()) {
		searchTerm = escape(form.searchTerm.value);
		targetURL = "./newsSearch.uri?searchTerm=" + searchTerm
		parent.location.href = targetURL;
	}
}

function autoSubmit(event) {
	if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13))
		return false;
	return true;
}
	
function commentPopUp(theURL) {
	window.open(theURL,'Comments','scrollbars=yes,resizable=yes,width=560,height=550') 
}
function birthdayPopUp(theURL) {
	window.open(theURL,'Birthday Calendar','scrollbars=yes,resizable=yes,width=560,height=550') 
}