
// AUTHOR - LEXHAM INSURANCE WAYNE DAVIES 2008



/* FIELD DATA RESTRICTORS */

var phone = "0123456789 ";
var numb = "0123456789 ";
var engineSize = "0123456789-. ";
var curValue = "0123456789";
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
var postcode = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
var regCode = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
function res(t,v){
var w = "";
for (i=0; i < t.value.length; i++) {
x = t.value.charAt(i);
if (v.indexOf(x,0) != -1)
w += x;
}
t.value = w;
}




/*FIELD VALIDATORS Quad */

function validateForm(quoteQuad)
{

if(""==document.forms.quoteQuad.Title.value)
{
alert("Please enter your 'Title'");
document.forms.quoteQuad.Title.focus();

return false;
}

if(""==document.forms.quoteQuad.Fname.value)
{
alert("Please enter your 'First Name'.");
document.forms.quoteQuad.Fname.focus();

return false;
}

if(""==document.forms.quoteQuad.Sname.value)
{
alert("Please enter your 'Last Name'.");
document.forms.quoteQuad.Sname.focus();

return false;
}

if(""==document.forms.quoteQuad.Postcode.value)
{
alert("Please enter your 'Post Code'.");
document.forms.quoteQuad.Postcode.focus();

return false;
}

if(""==document.forms.quoteQuad.Houseno.value)
{
alert("Please enter your 'House Name or Number'.");
document.forms.quoteQuad.Houseno.focus();

return false;
}

if(""==document.forms.quoteQuad.Telno.value)
{
alert("Please enter your 'Contact Telephone No'.");
document.forms.quoteQuad.Telno.focus();

return false;
}

if(""==document.forms.quoteQuad.clientEmail.value)
{
alert("Please enter your 'Email Address'.");
document.forms.quoteQuad.clientEmail.focus();

return false;
}

if(""==document.forms.quoteQuad.Dob.value)
{
alert("Please enter your 'Date of Birth'.");
document.forms.quoteQuad.Dob.focus();

return false;
}

if(""==document.forms.quoteQuad.Mstatus.value)
{
alert("Please choose your 'Marital Status'.");
document.forms.quoteQuad.Mstatus.focus();
 
return false;
}

if(""==document.forms.quoteQuad.YearsUk.value)
{
alert("Please choose 'How long you have been a UK Resident'.");
document.forms.quoteQuad.YearsUk.focus();

return false;
}

if(""==document.forms.quoteQuad.Rider.value)
{
alert("Please choose 'Who is going to Ride the Quad'.");
document.forms.quoteQuad.Rider.focus();

return false;
}

if(""==document.forms.quoteQuad.BikeUse.value)
{
alert("Please choose 'What the Quad will be used for'.");
document.forms.quoteQuad.BikeUse.focus();

return false;
}

if(""==document.forms.quoteQuad.emType.value)
{
alert("Please choose 'Your Employment type'.");
document.forms.quoteQuad.emType.focus();

return false;
}

if(""==document.forms.quoteQuad.Occupation.value)
{
alert("Please enter your 'Job Title'.");
document.forms.quoteQuad.Occupation.focus();

return false;
}

if(""==document.forms.quoteQuad.LicenceType.value)
{
alert("Please choose your 'Licence type'.");
document.forms.quoteQuad.LicenceType.focus();

return false;
}

if(""==document.forms.quoteQuad.dateLicence.value)
{
alert("Please enter 'What date you obtained your licence'.");
document.forms.quoteQuad.dateLicence.focus();

return false;
}

if(""==document.forms.quoteQuad.Bike.value)
{
alert("Please enter your 'Quad Make'.");
document.forms.quoteQuad.Bike.focus();

return false;
}

if(""==document.forms.quoteQuad.BikeMod.value)
{
alert("Please enter your 'Quad Model'.");
document.forms.quoteQuad.BikeMod.focus();

return false;
}

if(""==document.forms.quoteQuad.EngineSize.value)
{
alert("Please enter your 'Quad Engine Size'.");
document.forms.quoteQuad.EngineSize.focus();

return false;
}

if(""==document.forms.quoteQuad.YearManu.value)
{
alert("Please enter your 'Quad Manufacture Date'.");
document.forms.quoteQuad.YearManu.focus();

return false;
}

if(""==document.forms.quoteQuad.Value.value)
{
alert("Please enter your 'Current Quad Value in GBP(£)'.");
document.forms.quoteQuad.Value.focus();

return false;
}

if(""==document.forms.quoteQuad.datePurchased.value)
{
alert("Please enter 'The Date You Purchased the Quad'.");
document.forms.quoteQuad.datePurchased.focus();

return false;
}

/*if(""==document.forms.quoteQuad.Miles.value)
{
alert("Please enter 'The Estimated Annual Mileage for the Quad'.");
document.forms.quoteQuad.Miles.focus();

return false;
}*/

/*if(""==document.forms.quoteQuad.mcKept.value)
{
alert("Please choose 'Where the Quad will be kept at night'.");
document.forms.quoteQuad.mcKept.focus();

return false;
}*/

/*if(""==document.forms.quoteQuad.access.value)
{
alert("Please confirm 'If you have any modifications or accessories on your Quad'.");
document.forms.quoteQuad.access.focus();

return false;
}*/

if(""==document.forms.quoteQuad.yearsNcb.value)
{
alert("Please confirm 'No. of years Quad no claims bonus held'.");
document.forms.quoteQuad.yearsNcb.focus();

return false;
}


}