var foutmelding="Er is niet aan alle verplichte onderdelen van het formulier voldaan"
function leeg_check(Str){
	if (Str=="" || Str==null)
		return true
	else
		return false
	}
function checkemail(str){
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/
	if (!reg1.test(str)&&reg2.test(str))
		return false
	else
		return true
	}
function alertForm(locElName,locFormName,locType){
	blAlerted=0
	blinkTime=300
	tmpForm=document.getElementById(locFormName)
	alertEl=""
	for (var i=0; i<tmpForm.length; i++){
		if (tmpForm[i].name!=locElName)
			tmpForm[i].style.backgroundColor=''
		else
			alertEl=tmpForm[i].name
		}
	for (var i=0; i<tmpForm.length; i++){
		if (tmpForm[i].name==locElName){
			switch (locType){
				case 'email':
					if (leeg_check(tmpForm[i].value))
						alert(foutmelding)
					else
						alert("\""+tmpForm[i].value+"\" is geen e-mail adres")
					break
				case 'isNaN':
					if (leeg_check(tmpForm[i].value))
						alert(foutmelding)
					else
						alert("\""+tmpForm[i].value+"\" is geen getal")
					break
				case '':
					if (blAlerted!=1)
						alert(foutmelding)
					blAlerted=1
					break
				default:
					alert(locType)
					break
				}
			if (tmpForm[i].name==alertEl)
				flashOff=alertColor
			else
				flashOff=''
			tmpForm[i].style.backgroundColor=alertFlashColor
			setTimeout('tmpForm['+i+'].style.backgroundColor="'+flashOff+'"',blinkTime)
			setTimeout('tmpForm['+i+'].style.backgroundColor="'+alertFlashColor+'"',blinkTime*2)
			setTimeout('tmpForm['+i+'].style.backgroundColor= "'+alertColor+'"',blinkTime*3)
			function fncFocus() {tmpForm[i].focus();tmpForm[i].select();return}
			switch(tmpForm[i].type) {
				case "checkbox":
					tmpForm[i].focus();return
				case "file":
					fncFocus()
				case "password":
					fncFocus()
				case "select-multiple":
					tmpForm[i].focus()
				case "select-one":
					tmpForm[i].focus();return
				case "radio":
					tmpForm[i].focus()
				case "text":
					fncFocus()
				case "textarea":
					fncFocus()
				}
			}
		}
	}

