function orderSubmit(type) 
{
if (type == 'search') {
 if (!checkRequired() )
   {	
  document.ForLet.submit();
  return true;
   }
 else {
   return false;
   }
}
}

function checkRequired() {

if (!document.ForLet.minprice.value.length)
{
document.ForLet.minprice.focus()
alert('You have not entered all of the necessary details.\n' +
'Please enter a minimum price');
return true;
}

if (!document.ForLet.maxprice.value.length)
{
document.ForLet.maxprice.focus()
alert('You have not entered all of the necessary details.\n' +
'Please enter a maximum price.');
return true;
}

if (document.ForLet.house.checked == false && document.ForLet.flat.checked == false)
{
document.ForLet.house.focus()
alert('You have not entered all of the necessary details.\n' +
'Please tick at least one type of property.');
return true;
}

if (document.ForLet.name.value.length && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.address1.value.length  && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.address2.value.length && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.town.value.length && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.county.value.length && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.postcode.value.length && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.tel.value.length && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.requirements.value.length && !document.ForLet.email.value.length)
{
document.ForLet.email.focus()
alert('If you would like to join our mailing list,\n' +
'please ensure that you supply a valid email address.');
return true;
}

if (document.ForLet.confirmemail.value.length != document.ForLet.email.value.length)
{
document.ForLet.confirmemail.focus()
alert('You have not entered your email address correctly.\n' +
'Please check that you have typed a valid email address\n' +
'into the Email Address field and the Confirm Email field.');
return true;
}

if (document.ForLet.email.value.length && document.ForLet.minprice.value == '100.00' && document.ForLet.maxprice.value == '10,000.00')
{
document.ForLet.minprice.focus()
alert('If you are submitting to our mailing list, please enter a more specific\n' +
      'price range so that we can send you only the most relevant information.');
return true;
}

else 
{
return false;
}

}
