function check(){
	// onsubmit function
	// First make sure that the user has entered at least one search parameter.
	var textboxes	= document.getElementsByClassName('textbox');
	var categories	= document.getElementsByClassName('category');
	// Look at all textboxes for a non-NULL value
	for(var i = 0; i < textboxes.length; i++){
		if(textboxes[i].value != ""){
			// If we find a non-NULL value, it's ok to submit the form 
			disable_empty();
			return true;
		}
	}
	// Look at all selects for a non-NULL value
	for(var i = 0; i < categories.length; i++){
		if(categories[i].value != ""){
			// If we find a non-NULL value, it's ok to submit the form 
			disable_empty();
			return true;
		}
	}
	
	// If we got all the way down here, then all parameters are null, complain and return false.
	alert(
		"Bitte geben Sie mind. einen Suchbegriff ein.\n\n" +
		"z.B.: Suche nach italienisch sprechendem/r Therapeut/in,\n" + 
		"bitte auf \"Sprache\" klicken und \"Italienisch\" auswählen."
	);
	return false;
}

function disable_empty(){
	// If the text-inputs are empty, disable them before submitting.
	if(getV('vorname')	== "")	get('vorname').disabled = true;
	if(getV('name')		== "")	get('name').disabled	= true;
	if(getV('firma')	== "")	get('firma').disabled	= true;
	if(getV('ort')		== "")	get('ort').disabled		= true;
}

function displayCategory(search_option){
	// Toggles on/off whether to show a search field or not.
	// Function is called when any of the parameter-buttons are clicked.
	// By default, a search field that is null is hidden, so only the button shows.
	var div = get("contains_" + search_option);
	if(div.style.display == "none"){
		div.style.display = "block";
		// When a search field is shown, focus it.
		if(isDefined(search_option)){
			get(search_option).focus();
		}else if(isDefined(search_option + "[]")){
			get(search_option + "[]").focus();
		}
	}else{
		div.style.display = "none";
	}
}

function myReset(){
	
	if (!document.getElementsByClassName){
		// For IE users... *sigh*, when will they ever learn?
		window.location.reload();
	}
	
	// clear all input fields
	var textboxes	= document.getElementsByClassName('textbox');
	var categories	= document.getElementsByClassName('category');
	// Clear all textboxes
	for(var i = 0; i < textboxes.length; i++){
		textboxes[i].value = "";
	}
	// Clear all selects
	for(var i = 0; i < categories.length; i++){
		categories[i].selectedIndex = -1;
	}
}
