/* Apply */

function Form_Validatorc()
{

  if (document.apply.firstname.value == "") {
    alert("Please enter your first name.");
    document.apply.firstname.focus();
    return;
  }

  if (document.apply.lastname.value == "") {
    alert("Please enter your last name.");
    document.apply.lastname.focus();
    return;
  }

  if (document.apply.telwork.value == "" && document.apply.telmobile.value == "" && document.apply.telhome.value == "") {
    alert("Please enter one telephone number.");
    document.apply.telwork.focus();
    return;
  }

if (document.apply.email.value == "" || document.apply.email.value.indexOf("@") == -1 || document.apply.email.value.indexOf(".") == -1)	{
	alert("Please enter your full email address for us to deal with your request more effectively.");
	document.apply.email.focus();
	return;
}
	
  if (document.apply.coveringletter.value == "" && document.apply.uploadcv.value == "") {
    alert("Please add a covering letter or attach your CV.");
    document.apply.coveringletter.focus();
    return;
  }

  document.apply.submit();

}


/* Contact Us */


function openWin(URL){
aWindow = window.open(URL , "thewindow" , 'width=580,height=500,titlebar=yes,scrollbars=yes,menubar=yes');
}


function Form_Validatora()
{

  if (document.contactForm.name.value == "") {
    alert("Please enter your name.");
    document.contactForm.name.focus();
    return;
  }

  if (document.contactForm.address.value == "" && document.contactForm.phoneHome.value == "" && document.contactForm.phoneMobile.value == "" && document.contactForm.email.value == "") {
    alert("Please enter either an address, phone number or email address so we can deal with your enquiry effectively.");
    return;
  }



  if (document.contactForm.email.value == "" || document.contactForm.email.value.indexOf("@") == -1 || document.contactForm.email.value.indexOf(".") == -1)
  {
    alert("Please enter your full email address for us to deal with your request more effectively.");
    document.contactForm.email.focus();
    return;
}


  document.contactForm.submit();

}

/* register */

function Form_Validatorb()
{

  if (document.form1.firstname.value == "") {
    alert("Please enter your first name.");
    document.form1.firstname.focus();
    return;
  }

  if (document.form1.lastname.value == "") {
    alert("Please enter your last name.");
    document.form1.lastname.focus();
    return;
  }

  if (document.form1.address1.value == "") {
    alert("Please enter your address.");
    document.form1.address1.focus();
    return;
  }

  if (document.form1.town.value == "") {
    alert("Please enter your town/city name.");
    document.form1.town.focus();
    return;
  }

  if (document.form1.county.value == "") {
    alert("Please enter your county name.");
    document.form1.county.focus();
    return;
  }

  if (document.form1.postcode.value == "") {
    alert("Please enter your postcode.");
    document.form1.postcode.focus();
    return;
  }

  if (document.form1.country.value == "") {
    alert("Please enter your country name.");
    document.form1.country.focus();
    return;
  }

	  if (document.form1.email.value == "" || document.form1.email.value.indexOf("@") == -1 || document.form1.email.value.indexOf(".") == -1)
	  {
	    alert("Please enter your full email address for us to deal with your request more effectively.");
	    document.form1.email.focus();
	    return;
	}
 
  
  if (document.form1.telhome.value == "" && document.form1.telwork.value == "" && document.form1.telmobile.value == "")
  {
    alert("Please enter a telephone number for us to deal with your request more effectively.");
    document.form1.telhome.focus();
    return;
  }

  if (document.form1.UploadDoc.value == "" && document.form1.cv.value == "") {
    alert("Please attach a CV or input a covvering letter.");
    document.form1.UploadDoc.focus();
    return;
  }

  
  document.form1.submit();

}


/* jobs by email */

function Form_Validatord()
{
  if (document.form1.email.value == "" || document.form1.email.value.indexOf("@") == -1 || document.form1.email.value.indexOf(".") == -1)
  {
    alert("Please enter your email address.");
    form1.email.focus();
    return;
  }
  document.form1.submit();
}


/* jobs by email finish */

function Form_Validatorjbe()
{
if (document.sjbe.email.value == "" || document.sjbe.email.value.indexOf("@") == -1 || document.sjbe.email.value.indexOf(".") == -1)	{
	alert("Please enter your full email address for us to deal with your request more effectively.");
	document.sjbe.email.focus();
	return;
}

}


/* No Results */




function Form_noResults()
{

  if (document.noResults.name.value == "") {
    alert("Please enter your name.");
    document.noResults.name.focus();
    return;
  }

  if (document.noResults.email.value == "" || document.noResults.email.value.indexOf("@") == -1 || document.noResults.email.value.indexOf(".") == -1)
  {
    alert("Please enter your full email address for us to deal with your request more effectively.");
    document.noResults.email.focus();
    return;
}


  document.noResults.submit();

}