function Validation(theForm)

{



  if (theForm.surname.value == "")

  {

    alert("You forgot to enter a name.");

    theForm.surname.focus();

    return (false);

  }

  

  if (theForm.address.value == "")

  {

    alert("You forgot to enter an address.");

    theForm.address.focus();

    return (false);

  }

  

  if (theForm.zip.value == "")

  {

    alert("You forgot to enter a zipcode.");

    theForm.zipcode.focus();

    return (false);

  }

  

  if (theForm.city.value == "")

  {

    alert("You forgot to enter the city you live in.");

    theForm.city.focus();

    return (false);

  }

  

  if (theForm.question.value == "")

  {

    alert("You forgot to ask your question.");

    theForm.question.focus();

    return (false);

  }

  

  if(!(EmailCheck(theForm.email.value)))

  {

    alert("The e-mail adress you provided is incorrect.");

    theForm.email.focus();

    return (false);

  }

  

  alert("Thank you for contacting us. We will get back to you as soon as possible.");

  return (true);

}



function EmailCheck(str){

	var count=0;

	pos=str.indexOf('@');

	if(pos<1||pos>str.length-4){

		pos=-1

	}

	while(pos!=-1){

		count++;

		pos=str.indexOf('@',pos+1);

	}

	tld=str.substring(str.lastIndexOf('.')+1,99);

	tld=tld.toLowerCase();

	if ((tld.length!=2&&tld!='com'&&tld!='net'&&tld!='org'&&tld!='gov'&&tld!='mil'&&tld!='int'&&tld!='nato'&&tld!='arpa'&&tld!='name'&&tld!='museum'&&tld!='coop'&&tld!='info'&&tld!='aero'&&tld!='biz'&&tld!='pro')||count!=1){

		return false

	}else{

		return true

	}

}
