
function orderSubmit(type) 
{

if (type == 'webmail') {
 if (!CheckDetails() )
   {	
   document.form1.submit();
   return true;
   }
 else {
   return false;
   }
}

}


function CheckDetails() {

if (!document.form1.name.value.length)
{
document.form1.name.focus()
alert('You have not filled out all of the necessary details.\n\n' +
'Please enter your name.');
return true;
}

if (!document.form1.town.value.length)
{
document.form1.town.focus()
alert('You have not filled out all of the necessary details.\n\n' +
'Please enter the Town where you live.');
return true;
}

if (!document.form1.tel.value.length)
{
document.form1.tel.focus()
alert('You have not filled out all of the necessary details.\n\n' +
'Please enter your telephone number.');
return true;
}

if (!document.form1.email.value.length)
{
document.form1.email.focus()
alert('You have not filled out all of the necessary details.\n\n' +
'Please enter your email address.');
return true;
}

if (document.form1.email.value.length)
{
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form1.email.value)))
{
document.form1.email.focus()
alert('The format of your email address appears to be incorrect.\n\n' +
      'Could you please carefully check to make sure that you have\n' +
      'entered the email address in the \'Email Address\' field correctly.')
return true;
}
}

if (document.form1.confirmemail.value != document.form1.email.value)
{
document.form1.confirmemail.focus()
alert('You have not entered the email address correctly.\n\n' +
'Please check that you have typed the same valid email address\n' +
'into the \'Email Address\' and \'Confirm Email Address\' fields.');
return true;
}

if (!document.form1.subject.value.length)
{
document.form1.subject.focus()
alert('You have not filled out all of the necessary details.\n\n' +
'Please enter your subject.');
return true;
}

if (!document.form1.message.value.length)
{
document.form1.message.focus()
alert('You have not filled out all of the necessary details.\n\n' +
'Please enter your message.');
return true;
}

else 
{
return false;
}

}