function checkForm(frm) {
	for (var i=0;i<frm.length;i++) {
		current = frm.elements[i];
		if(current.name.indexOf("_req") > -1) {
			if(current.value.replace(/^\s+|\s+$/, '') == "" && current.type=="text") {
					alert("You need to enter text in all required fields.");
					return false;
			}
			if(current.value.replace(/^\s+|\s+$/, '') == "" && current.type=="password") {
				alert("You need to enter text in all password fields.");
				return false;
			}
			if(current.value == "#" && current.type != "text") {
				alert("You have to make a selection in all drop down menus.");
				return false;
			}
			if(current.value.replace(/^\s+|\s+$/, '') == "" && current.type=="textarea") {
				alert("You need to enter text in all required text areas.");
				return false;
			}
			if(current.name == "human_req2") {
				if(current.checked != true) {
					alert("You have not checked the spam verification box. Please do so and try again.");
					return false;
				}
			}
			if(current.name == "collemail_req" && (current.value == " your email here" || current.value.replace(/^\s+|\s+$/, '') == "")) {
				alert("You need to enter your email address in order to proceed.");
				return false;
			}
		}
	}
	return true;
}

function checkSelectedTypes(frm) {
	alert(frm.ql_restaurants.value);
	if(frm.ql_restaurants.value != "true" || frm.ql_stores.value != "true" || frm.ql_wines.value != "true") {
		alert("Please check at least one search type: Restaurants, Stores, or Wines"); 
		return false;
	}
	return true;
}

function setSearch($target) {
	if($target == "restaurants") $searchtarget = "Bulgarian restaurants";
	if($target == "foodstores") $searchtarget = "Bulgarian food stores";
	if($target == "wines") $searchtarget = "Bulgarian wines";
	document.forms[1].q.value = $searchtarget;

}

function confirmSubmit() {
	return confirm("Do you really want to delete this item?\n\nOnce you delete something, it cannot be restored automatically.");
}

function showgooglelocation() {
	// override if necessary
}
