
function CreateFlash(DivID, CLSID, URL, WIDTH, HEIGHT){
	var d = document.getElementById(DivID);
  d.innerHTML = '<object classid=' + CLSID + ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"  width=' + WIDTH + ' height=' + HEIGHT +'><param name="movie" value="' + URL + '"><param name="quality" value="high"><param name="wmode" value="transparent"><embed src="'+ URL +'" width="'+ WIDTH +'" height="'+ HEIGHT +'" vspace="0" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object>';
}

function checkNaam(){
	if(document.forms[0].naam.value=="") {
		alert("Please fill in your full name");
		document.forms[0].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() {
	if(document.forms[0].telefoon.value=="") {
		alert("Please fill in your telephone number");
		document.forms[0].telefoon.focus();
		return false;
	}
	if(!isTelefoon(document.forms[0].telefoon.value) || (document.forms[0].telefoon.value.length<10)){
		alert("Please fill in your telephone number");
		document.forms[0].telefoon.focus();
		return false;
	} return true;
}

function checkMail(){
	if(document.form1.email.value==""){
		alert("Please fill in a valid e-mail address");
		document.forms[0].email.focus();
		return false;
		}
	if(document.forms[0].email.value.indexOf('@')==-1 || document.forms[0].email.value.indexOf('@')==0 || document.forms[0].email.value.indexOf('@')==(document.forms[0].email.value.length-1)){
		alert("Please fill in a valid e-mail address");
		document.forms[0].email.focus();
		return false;
	}
	if(document.forms[0].email.value.indexOf('.')==-1 || document.forms[0].email.value.indexOf('.')==0 || document.forms[0].email.value.indexOf('.')==(document.forms[0].email.value.length-1)){
		alert("Please fill in a valid e-mail address");
		document.forms[0].email.focus();
		return false;
	}
	return true;
}

function verstuur(){
	if(!checkNaam()) return;
	if(!checkTelefoon()) return;
	if(!checkMail()) return;
	document.form1.action="contact_mail.php";
	document.form1.submit();
}




