/***********************************************
 copyright : (C) 2009 - DesignBox ShopSoft      
 Web: www.designbox.nl  Mail: info@designbox.nl 
 change date : 11 - 02- 2009                    
 **********************************************/

function checkNaam(oForm){
	if(oForm.naam.value=="") {
		alert("Vul a.u.b. uw naam in.");
		oForm.naam.focus();
		return false;
	} return true;
}

function isTelefoon(inField){
	var acceptable="0123456789 +-";
	var ok=true;
	for(i=0;i<inField.length;i++){
		if(acceptable.indexOf(inField.charAt(i).toUpperCase())==-1){
			ok=false;
			break;
		} 
	}
	return (ok);
}

function checkTelefoon(oForm) {
	if(oForm.telefoon.value=="") {
		alert("Vul uw telefoonnummer in.");
		oForm.telefoon.focus();
		return false;
	}
	if(!isTelefoon(oForm.telefoon.value) || (oForm.telefoon.value.length<10)){
		alert("Het ingevoerde telefoonnummer is niet correct.");
		oForm.telefoon.focus();
		return false;
	} return true;
}

function checkMail(oForm){
	if(oForm.email.value==""){
		alert("Vul uw email adres in.");
		oForm.email.focus();
		return false;
	}
	if(oForm.email.value.indexOf('@')==-1 || oForm.email.value.indexOf('@')==0 || oForm.email.value.indexOf('@')==(oForm.email.value.length-1)){
		alert("Het ingevoerde email adres is niet correct.");
		oForm.email.focus();
		return false;
	}
	if(oForm.email.value.indexOf('.')==-1 || oForm.email.value.indexOf('.')==0 || oForm.email.value.indexOf('.')==(oForm.email.value.length-1)){
		alert("Het ingevoerde email adres is niet correct.");
		oForm.email.focus();
		return false;
	}
	return true;
}

function checkContactpersoon(oForm){
	if(oForm.contactpersoon.value=="") {
		alert("Vul a.u.b. de contactpersoon in.");
		oForm.contactpersoon.focus();
		return false;
	} return true;
}

function checkNorobot(oForm){
	if(oForm.norobot.value=="") {
		alert("Vul a.u.b. de cijfercode in.");
		oForm.norobot.focus();
		return false;
	} return true;
}

function Verstuur(oForm){
	if(!checkNaam(oForm)) return false;
	if(!checkTelefoon(oForm)) return false;
	if(!checkMail(oForm)) return false;
	if(!checkContactpersoon(oForm)) return false;
	if(!checkNorobot(oForm)) return false;
	return true;
}