function validate(theForm){
	if (theForm.name.value == "" || theForm.name.value.length < 2){
		alert("Udfyld feltet med dit navn.");
		theForm.name.focus();
		return false;
	}
	if (theForm.mail.value == "" || theForm.mail.value.indexOf('@',1)== -1 || theForm.mail.value.indexOf('.',2)==-1){
		alert("Udfyld feltet med din E-mail adresse.");
		theForm.mail.focus();
		return false;
	}
	
	var filter = /^\d+(1,3})?$/;
	if (filter.test(theForm.post.value) == false || theForm.post.value > 9999 || theForm.post.value < 900) {
	  alert("Udfyld feltet med dit Post nr.");
	  theForm.post.focus();
	  return false;
	}
		
	
	if (theForm.lejestart.value == "" || theForm.lejestart.value.length < 2){
		alert("Udfyld feltet med dit Leje start.");
		theForm.lejestart.focus();
		return false;
	}
	if (theForm.lejeslut.value == "" || theForm.lejeslut.value.length < 2){
		alert("Udfyld feltet med dit Leje slut.");
		theForm.lejeslut.focus();
		return false;
	}
	
	if (!theForm.sted[0].checked && !theForm.sted[1].checked){
		alert("Du skal angive, hvlken afdeling du ønsker at kontakte");
		theForm.sted[0].focus();
		return false;
	}

	if (theForm.message.value == "" || theForm.message.value.length < 2){
		alert("Udfyld feltet med din besked.");
		theForm.message.focus();
		return false;
	}

return true;
}



