function getKey2() {
	var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
	if(keyCode==13) zoekTop();
}

function zoekTop(){
	a=document.zoekentop.zoekwoord.value;
	if(a==""){
		alert('Vul aub een zoekterm in');
		return void(0);
	}
	else{
	document.zoekentop.action='zoek_resultaat.php?pagina=zoeken.html';
	document.zoekentop.submit();
	};
}
/*
function zoek(){
	a=document.zoeken.zoekwoord.value;
	if(a=="typ een zoekterm in" || a==""){
		alert('Vul aub een zoekterm in');
		return void(0);
	}
	else{
	document.zoeken.action='zoek_resultaat.php?pagina=zoeken.html';
	document.zoeken.submit();
	};
}
*/
function checkInhoud(element){
	if(element.value=="") {
		element.focus();
		alert("Vul aub alle velden in");		
		return false;
	} return true;
}

//checkt nu beide velden alleen op inhoud zoals afgesproken
function checkTelefoon(){
	if(document.form_contact.phone.value.length<10){
		alert("Vul aub een geldig telefoonnummer in");
		document.form_contact.phone.focus();
		return false;
	} else {
		return true;
	}
}

function checkMail(element){
	if(element.value==""){
		alert("Vul aub een geldig e-mail adres in");
		element.focus();
		return false;
		}
	if(element.value.indexOf('@')==-1 || element.value.indexOf('@')==0 || element.value.indexOf('@')==(element.value.length-1)){
		alert("Vul aub een geldig e-mail adres in");
		element.focus();
		return false;
	}
	if(element.value.indexOf('.')==-1 || element.value.indexOf('.')==0 || element.value.indexOf('.')==(element.value.length-1)){
		alert("Vul aub een geldig e-mail adres in");
		element.focus();
		return false;
	}
	return true;
}

function focusMe(a) {
	a.style.background="#E5EEF3";
	a.style.color="#000000";
}

function blurMe(a) {
	a.style.background="#FFFFFF";
	a.style.color="#000000";	
}

	function checkVW(){
		if(!document.form_contact.kosten.checked) {
			alert("U dient akkoord te gaan met de voorwaarden");
			document.form_contact.kosten.focus();
			return false;
		} else {
			return true;
		}
	}
	
function verstuur_contact(){
	if(!checkInhoud(document.form_contact.bedrijfsnaam)) return;
	if(!checkInhoud(document.form_contact.name)) return;
	if(!checkMail(document.form_contact.email)) return;
	document.form_contact.action='contact_send.php';
	document.form_contact.submit();
}

function verstuur_training(){
	if(!checkInhoud(document.form_contact.bedrijfsnaam)) return;
	if(!checkInhoud(document.form_contact.inschrijver)) return;
	if(!checkInhoud(document.form_contact.name)) return;
	if(!checkTelefoon()) return;
	if(!checkMail(document.form_contact.email)) return;
	if(checkVW()){
		document.form_contact.action='training_send.php';
		document.form_contact.submit();
	}
}

function verstuur_login_formulier(){
	if(!checkInhoud(document.login_formulier.username)) return;
	if(!checkInhoud(document.login_formulier.password)) return;
	//if(checkInhoud(document.login_formulier.spamcheck)) return;	
	document.login_formulier.action='login.php';
	document.login_formulier.submit();
}

function sorteer(sort_ID){
		location.href="contracteninzien_reseller.php?sort_ID="+sort_ID;
}
	
