function checkEmailAddress(field) {

var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.biz)|(\..{2,2}))$)\b/gi);

if (goodEmail){
return false;
} else {
return true;
}
}

function VerifySignupData() {

if (document.signupform.company.value=="") {
		document.signupform.company.focus()
		alert("Please fill in your company-name.\n")
		return false;
	}
	
if (document.signupform.lastname.value=="") {
		document.signupform.lastname.focus()
		alert("Please fill in your (last) name.\n")
		return false;
	}
	
if (document.signupform.email.value=="") {
		document.signupform.email.focus()
		alert("Please fill in your emailaddress.\n")
		return false;
	}
if (document.signupform.email.value!=document.signupform.emailverify.value) {
		document.signupform.email.focus()
		alert("The email-addresses do not match.\n")
		return false;
	}	
if(checkEmailAddress(document.signupform.email)) {
		document.signupform.email.focus()
		alert("The email-address you filled in is invalid.\n")
		return false;
}

if (document.signupform.phone.value=="") {
		document.signupform.phone.focus()
		alert("Please fill in your phone-number.\n")
		return false;
	}
		
if (document.signupform.address.value=="") {
		document.signupform.address.focus()
		alert("Please fill in your  address.\n")
		return false;
	}

if (document.signupform.postal_code.value=="") {
		document.signupform.postal_code.focus()
		alert("Please fill in your postal code.\n")
		return false;
	}

if (document.signupform.city.value=="") {
		document.signupform.city.focus()
		alert("Please fill in your city.\n")
		return false;
	}
	
if (document.signupform.btw_no.value=="") {
		document.signupform.btw_no.focus()
		alert("Please fill in your VAT-number.\n")
		return false;
	}

if (document.signupform.password.value=="") {
		document.signupform.password.focus()
		alert("Please fill in  a password of 5 characters or more.\n")
		return false;
	}
	
if (document.signupform.terms.checked == false) {
		alert("Please agree to the companies policy by clicking the checkbox below.\n")
		return false;
	}

if (!document.signupform.password.value==document.signupform.password2.value) {
		document.signupform.password2.focus()
		alert("Your passwords do not match.\n")
		return false;
	}

document.signupform.submit() 
}



function VerifyContactData() {
// to verify contact-form on contact.php


if (document.contactform.name.value == "") {
		document.contactform.name.focus()
		alert("Please fill in your name.\n")
		return false;
	}

if (document.contactform.email.value == "") {
		document.contactform.email.focus()
		alert("Please fill in your emailaddress.\n")
		return false;
	}
	
if(checkEmailAddress(document.contactform.email)) {
		document.contactform.email.focus()
		alert("The email-address you filled in is invalid.\n")
		return false;
}


if (document.contactform.remarks.value == "") {
		document.contactform.remarks.focus()
		alert("You did not give any remark or question.\n")
		return false;
	}
	

document.contactform.submit() 
}
	
function requestNewPassword(){
	
	var my_email	= window.prompt("Please fill in your e-mailaddress with wich you have signed up, and you will receive a new password.\n", "");

			if(my_email) {
				iframe.location.href='http://www.ivy-art.com/requestNewPassword.php?email=' + my_email;
			}
}	
