function changeAct() {
  
  	var where = document.getElementById('wheres').value
		.toLowerCase() // change everything to lowercase
		.replace(/^\s+|\s+$/g, "") // trim leading and trailing spaces		
		.replace(/[_|\s]+/g, "-") // change all spaces and underscores to a hyphen
		.replace(/[^a-z0-9-]+/g, "") // remove all non-alphanumeric characters except the hyphen
		.replace(/[-]+/g, "-") // replace multiple instances of the hyphen with a single instance
		.replace(/^-+|-+$/g, "") // trim leading and trailing hyphens				
		; 
		where=where.substr(0, 1).toUpperCase() + where.substr(1);

	//alert(where); // debug
  
	var what = document.getElementById('whats').value
	
		.toLowerCase() // change everything to lowercase
		.replace(/^\s+|\s+$/g, "") // trim leading and trailing spaces		
		.replace(/[_|\s]+/g, "-") // change all spaces and underscores to a hyphen
		.replace(/[^a-z0-9-]+/g, "") // remove all non-alphanumeric characters except the hyphen
		.replace(/[-]+/g, "-") // replace multiple instances of the hyphen with a single instance
		.replace(/^-+|-+$/g, "") // trim leading and trailing hyphens				
		; 
	what=what.substr(0, 1).toUpperCase() + what.substr(1);
	//alert(what); // debug

			if(what != ""){
				if(where  != ""){
		  		document.searchForm.action = 'find/'+what+'/'+where+'/';
				}
				else {document.searchForm.action = 'find/'+what+'/';}	
		   }

			if(where != ""){
				if(what  != ""){
		  		document.searchForm.action = 'find/'+what+'/'+where+'/';
				}
				else {document.searchForm.action = 'find/all/'+where+'/';}
		   } 
   
   

}

function validateForm() {
	var minLength=3;
	var minLength2=4;
	
	if (document.searchForm.whats.value.length < minLength) {
	alert('Search term must be at least ' + minLength + ' characters long.');
	return false;
	}	
	
	if (document.searchForm.wheres.value.length < minLength2) {
	alert('Location must be at least ' + minLength2 + ' characters long.');
	return false;
	}	
	
}

