/*_____________________________ Function: validEmail() _________________________________
Function for validating e-mail.

Parameter passed to the f():
EmailAdr from function SendForm(form). 

The function calls the following other functions:
_______________________________________________________________________________________*/
	function validEmail(email) {
			InvalidSign = "/:,; " // the sign (/) (:) (,) (;) and (space) are not valid

			if(email == "") {
			return true 
			}
			for	(i=0; i<InvalidSign.length;i++) {
				ErrorSign = InvalidSign.charAt(i)
				if (email.indexOf(ErrorSign,0)>-1) { 
					return false
				}
			}
			OnPossion = email.indexOf("@",1)
			if (OnPossion == -1) {
				return false
			}
			if (email.indexOf("@",OnPossion+1)!=-1) {
				return false
			}
			DotPossion = email.indexOf(".",OnPossion)
			if (DotPossion == -1) {
				return false
			}
			if (DotPossion+3 >email.length){
				return false
			}
			return true
	}

/*___________________________ Function: checkEmail() _____________________________________
Function for validating email address

_______________________________________________________________________________________*/
	function checkEmail(form) {				
			// remember the email
			if (form.email.value == "") {
				form.email.focus()
				form.email.select()
				return false
			}

			// Validate syntax of e-mail address
			if (!validEmail(form.email.value)) {
				alert("Den indtastede email: \n\n"+ form.email.value + "\n\nindeholder forkerte tegn eller mangler et . eller @ tegn.")
				form.email.focus()
				form.email.select()
				return false
			}
	}