<!--
function submitit() {
flag = 0;
if (document.restaurantform.proposer.value=="") {
alert("Please enter the proposers name and all partners names (if applicable), then resubmit the"
+ " form.");
document.restaurantform.proposer.focus();
flag = 1;
return false; 
}
if (document.restaurantform.tradingname.value=="") {
alert("Please enter your trading name, then resubmit the"
+ " form.");
document.restaurantform.tradingname.focus();
flag = 1;
return false; 
}
tradingstatuschoice = document.restaurantform.tradingstatus.selectedIndex
if (document.restaurantform.tradingstatus.options[tradingstatuschoice].value=="") {
alert("Please select your trading status, then resubmit the form.");
document.restaurantform.tradingstatus.focus();
flag = 1;
return false;
}
tradingstatuschoice = document.restaurantform.tradingstatus.selectedIndex
if (document.restaurantform.tradingstatus.options[tradingstatuschoice].value=="ltdcompany" && document.restaurantform.limitedcompanyname.value=="") {
alert("Please enter the limited company name then resubmit the quote form.");
document.restaurantform.limitedcompanyname.focus();
flag = 1;
return false;
}
if (document.restaurantform.restaurantaddress.value=="") {
alert("Please enter the address of the restaurant, then resubmit the"
+ " form.");
document.restaurantform.restaurantaddress.focus();
flag = 1;
return false; 
}
if (document.restaurantform.postcode.value=="") {
alert("Please enter the postcode of the restaurant, then resubmit the"
+ " form.");
document.restaurantform.postcode.focus();
flag = 1;
return false; 
}
test = document.restaurantform.postcode.value; size = test.length
test = test.toUpperCase(); //change to uppercase
while (test.slice(0,1) == " ") //strip leading spaces
{test = test.substr(1,size-1);size = test.length
}
while(test.slice(size-1,size)== " ") //strip trailing spaces
{test = test.substr(0,size-1);size = test.length
}
document.restaurantform.postcode.value = test; //write back to form field
if (size < 6 || size > 8){ //code length rule
alert(test + " is not a valid postcode - wrong length");
document.restaurantform.postcode.focus();
return false;
}
if (!(isNaN(test.charAt(0)))){ //leftmost character must be alpha character rule
alert(test + " is not a valid postcode - cannot start with a number");
document.restaurantform.postcode.focus();
return false;
}
if (isNaN(test.charAt(size-3))){ //first character of inward code must be numeric rule
alert(test + " is not a valid postcode - alpha character in wrong position");
document.restaurantform.postcode.focus();
return false;
}
if (!(isNaN(test.charAt(size-2)))){ //second character of inward code must be alpha rule
alert(test + " is not a valid postcode - number in wrong position");
document.restaurantform.postcode.focus();
return false;
}
if (!(isNaN(test.charAt(size-1)))){ //third character of inward code must be alpha rule
alert(test + " is not a valid postcode - number in wrong position");
document.restaurantform.postcode.focus();
return false;
}
if (!(test.charAt(size-4) == " ")){//space in position length-3 rule
alert(test + " is not a valid postcode - no space or space in wrong position");
document.restaurantform.postcode.focus();
return false;
}
count1 = test.indexOf(" ");count2 = test.lastIndexOf(" ");
if (count1 != count2){//only one space rule
alert(test + " is not a valid postcode - only one space allowed");
document.restaurantform.postcode.focus();
flag = 1;
return false;
}
if (document.restaurantform.telephone.value=="") {
alert("Please enter your daytime telephone number, then resubmit the"
+ " form.");
document.restaurantform.telephone.focus();
flag = 1;
return false; 
}
if (document.restaurantform.email.value=="") {
alert("Please enter your email address, then resubmit the"
+ " form.");
document.restaurantform.email.focus();
flag = 1;
return false; 
}
var testresults
var str=document.restaurantform.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address, then resubmit the form.")
document.restaurantform.email.focus();
flag = 1;
testresults=false
return (testresults)
}
if (document.restaurantform.criminalconvictions[0].checked == true
 && document.restaurantform.criminalconvictionsdetails.value=="") {
alert("Please provide details of the criminal offences.");
document.restaurantform.criminalconvictionsdetails.focus();
flag = 1;
return false;
}
if (document.restaurantform.bankrupt[0].checked == true
 && document.restaurantform.bankruptcydetails.value=="") {
alert("Please provide details of the bankruptcy or insolvency.");
document.restaurantform.bankruptcydetails.focus();
flag = 1;
return false;
}
if (document.restaurantform.insurancerefused[0].checked == true
 && document.restaurantform.insurancerefuseddetails.value=="") {
alert("Please provide details of the insurance refusal, declinature or special terms.");
document.restaurantform.insurancerefuseddetails.focus();
flag = 1;
return false;
}
if (document.restaurantform.businessdescription.value=="") {
alert("Please confirm the business description (e.g. Restaurant, Take-Away, etc.), then resubmit the"
+ " form.");
document.restaurantform.businessdescription.focus();
flag = 1;
return false; 
}
if (document.restaurantform.typeoffoodserved.value=="") {
alert("Please state confirm the type of food served (e.g. Indian, Chinese, Italian, etc.), then resubmit the"
+ " form.");
document.restaurantform.typeoffoodserved.focus();
flag = 1;
return false; 
}
if (document.restaurantform.deliveryservice[0].checked == true
 && document.restaurantform.percentageofturnoverfordelivery.value=="") {
alert("Please confirm the percentage of your turnover that is derived from the delivery of food.");
document.restaurantform.percentageofturnoverfordelivery.focus();
flag = 1;
return false;
}
if (document.restaurantform.constructionofwalls.value=="") {
alert("Please state the construction of the walls (e.g. brick, stone, concrete, etc.), then resubmit the"
+ " form.");
document.restaurantform.constructionofwalls.focus();
flag = 1;
return false; 
}
if (document.restaurantform.constructionofroof.value=="") {
alert("Please state the construction of the roof (e.g. slate, tile, bitumen, etc.), then resubmit the"
+ " form.");
document.restaurantform.constructionofroof.focus();
flag = 1;
return false; 
}
if (document.restaurantform.anyflatroofing[0].checked == true
 && document.restaurantform.percentageflatroof.value=="") {
alert("Please confirm the approximate percentage of flat roofing compared to the overall roofing area.");
document.restaurantform.percentageflatroof.focus();
flag = 1;
return false;
}
if (document.restaurantform.anyflatroofing[0].checked == true
 && document.restaurantform.typeofflatroofing.value=="") {
alert("Please confirm the type of flat roofing e.g. felt/bitumen on wood, concrete, etc.");
document.restaurantform.typeofflatroofing.focus();
flag = 1;
return false;
}
if (document.restaurantform.constructionoffloor.value=="") {
alert("Please state the construction of the floors (e.g. wooden, concrete, wooden and concrete, etc.), then resubmit the"
+ " form.");
document.restaurantform.constructionoffloor.focus();
flag = 1;
return false; 
}
if (document.restaurantform.yearpremisesbuilt.value=="") {
alert("Please state the approximate year the property was built, then resubmit the"
+ " form.");
document.restaurantform.yearpremisesbuilt.focus();
flag = 1;
return false; 
}
gradelistedbuildingchoice = document.restaurantform.gradelistedbuilding.selectedIndex
if (document.restaurantform.gradelistedbuilding.options[gradelistedbuildingchoice].value=="") {
alert("Please confirm whether or not the property is a grade listed building (i.e. grade i, ii, ii*).");
document.restaurantform.gradelistedbuilding.focus();
flag = 1;
return false 
}
if (document.restaurantform.proximitytowater.value=="") {
alert("Please state the approximate distance to the nearest water (e.g. river, coast, lake, canal, etc.), then resubmit the"
+ " form.");
document.restaurantform.proximitytowater.focus();
flag = 1;
return false; 
}
if (document.restaurantform.subsidenceorflooddamage[0].checked == true
 && document.restaurantform.subsidenceorflooddetails.value=="") {
alert("Please provide details of any previous subsidence or flood damage.");
document.restaurantform.subsidenceorflooddetails.focus();
flag = 1;
return false;
}
if (document.restaurantform.seatsinrestaurant.value=="") {
alert("Please confirm the number of seats that there are in the restaurant, then resubmit the"
+ " form.");
document.restaurantform.seatsinrestaurant.focus();
flag = 1;
return false; 
}
if (document.restaurantform.deepfatfrying[0].checked == true
 && document.restaurantform.typeoffryingequipment.value=="") {
alert("Please provide details of the most hazardous type of frying equipment that you use, then resubmit the form.");
document.restaurantform.typeoffryingequipment.focus();
flag = 1;
return false;
}
if (document.restaurantform.sprinklersystem[0].checked == true
 && document.restaurantform.sprinklersystemdetails.value=="") {
alert("Please provide details of the specification of the sprinkler system or enter 'not known' if you do not know the specification.");
document.restaurantform.sprinklersystemdetails.focus();
flag = 1;
return false;
}
if (document.restaurantform.alarm[0].checked == true && document.restaurantform.nacossalarm.value=="") {
alert("Please state whether or not the alarm is NACOSS/NSI approved.");
document.restaurantform.nacossalarm.focus();
flag = 1;
return false;
}
if (document.restaurantform.alarm[0].checked == true && document.restaurantform.typeofalarm.value=="") {
alert("Please confirm the type of alarm signalling in the event of activation.");
document.restaurantform.typeofalarm.focus();
flag = 1;
return false;
}
coverrequiredchoice = document.restaurantform.coverrequired.selectedIndex
if (document.restaurantform.coverrequired.options[coverrequiredchoice].value=="") {
alert("Please confirm the lever of cover that you require.");
document.restaurantform.coverrequired.focus();
flag = 1;
return false 
}
if (document.restaurantform.businessinterruptionrequired[0].checked == true && document.restaurantform.annualgrossprofit.value=="") {
alert("Please confirm the approximate annual gross profit of the business.");
document.restaurantform.annualgrossprofit.focus();
flag = 1;
return false;
}
if (document.restaurantform.lossoflicencerequired[0].checked == true && document.restaurantform.lossoflicencesuminsured.value=="") {
alert("Please confirm the loss of liquor licence sum insured i.e. the depreciation of the value of the business in the event of loss of liquor licence.");
document.restaurantform.lossoflicencesuminsured.focus();
flag = 1;
return false;
}
if (document.restaurantform.bookdebtsrequired[0].checked == true && document.restaurantform.bookdebtssuminsured.value=="") {
alert("Please confirm the maximum amount of outstanding debit balances outstanding at any one moment in time.");
document.restaurantform.bookdebtssuminsured.focus();
flag = 1;
return false;
}
if (document.restaurantform.turnover.value=="") {
alert("Please state the approximate turnover of your business, then resubmit the"
+ " form.");
document.restaurantform.turnover.focus();
flag = 1;
return false;
}
if (document.restaurantform.employersliabilityrequired[0].checked == true && document.restaurantform.numberofemployees.value=="") {
alert("Please confirm the total number of employees you employ.");
document.restaurantform.numberofemployees.focus();
flag = 1;
return false;
}
if (document.restaurantform.currentinsurer.value=="") {
alert("Please state the name of your current/previous insurer (e.g. Aviva, Zurich, etc.) with whom you have been insured. if you don't know the name of your current insurer, please enter 'not known' or if you have never held insurance before, please enter 'no previous"
+ " insurer'.");
document.restaurantform.currentinsurer.focus();
flag = 1;
return false;
}
if (flag == 0) {
document.restaurantform.send.value="details being processed...";
return true; }
}
// -->
