function orderSubmit(type) 
{
if (type == 'search') {
 if (!checkRequired() )
   {	
  document.ForSale.submit();
  return true;
   }
 else {
   return false;
   }
}
}

function checkRequired() {

if (!document.ForSale.minprice.value.length)
{
document.ForSale.minprice.focus()
alert('You have not entered all of the necessary details.\n' +
'Please enter a minimum price');
return true;
}

if (!document.ForSale.maxprice.value.length)
{
document.ForSale.maxprice.focus()
alert('You have not entered all of the necessary details.\n' +
'Please enter a maximum price.');
return true;
}

if (document.ForSale.house.checked == false && document.ForSale.flat.checked == false)
{
document.ForSale.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.ForSale.name.value.length && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.address1.value.length  && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.address2.value.length && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.town.value.length && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.county.value.length && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.postcode.value.length && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.tel.value.length && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.requirements.value.length && !document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.confirmemail.value.length != document.ForSale.email.value.length)
{
document.ForSale.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.ForSale.email.value.length && document.ForSale.minprice.value == '100.00' && document.ForSale.maxprice.value == '2,000,000.00')
{
document.ForSale.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;
}

}