// javaScript function to check a form.
function validateForm(theForm){

	var reason = "";
	
	reason += validateRequired(theForm.contact_name);
	reason += validateRequired(theForm.contact_address);
	reason += validateRequired(theForm.contact_postalcode);
	reason += validateRequired(theForm.contact_city);
	reason += validateRequired(theForm.contact_phone);
	reason += validateRequired(theForm.contact_email);
			
	if (reason !="") {
		document.getElementById('warning_formContact').style.display = "block";
		return false;
	} 
	
	return true;	
}

// javaScript function to check textfield is filled.
function validateRequired(inputField){

	var error = "";
	
	if(inputField.value.length == 0){
		inputField.style.background = "Yellow";
		error = "required";
	}else {
		inputField.style.background = 'White';
	}
	
	return error;
}
