
// 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 BIKE */

function validateForm(quoteBike)
{

if(""==document.forms.quoteBike.Title.value)
{
alert("Please enter your 'Title'");
document.forms.quoteBike.Title.focus();

return false;
}

if(""==document.forms.quoteBike.Fname.value)
{
alert("Please enter your 'First Name'.");
document.forms.quoteBike.Fname.focus();

return false;
}

if(""==document.forms.quoteBike.Sname.value)
{
alert("Please enter your 'Last Name'.");
document.forms.quoteBike.Sname.focus();

return false;
}

if(""==document.forms.quoteBike.Postcode.value)
{
alert("Please enter your 'Post Code'.");
document.forms.quoteBike.Postcode.focus();

return false;
}

if(""==document.forms.quoteBike.Houseno.value)
{
alert("Please enter your 'House Name or Number'.");
document.forms.quoteBike.Houseno.focus();

return false;
}

if(""==document.forms.quoteBike.Telno.value)
{
alert("Please enter your 'Contact Telephone No'.");
document.forms.quoteBike.Telno.focus();

return false;
}

if(""==document.forms.quoteBike.clientEmail.value)
{
alert("Please enter your 'Email Address'.");
document.forms.quoteBike.clientEmail.focus();

return false;
}

if(""==document.forms.quoteBike.Dob.value)
{
alert("Please enter your 'Date of Birth'.");
document.forms.quoteBike.Dob.focus();

return false;
}

if(""==document.forms.quoteBike.Mstatus.value)
{
alert("Please choose your 'Marital Status'.");
document.forms.quoteBike.Mstatus.focus();
 
return false;
}

if(""==document.forms.quoteBike.YearsUk.value)
{
alert("Please choose 'How long you have been a UK Resident'.");
document.forms.quoteBike.YearsUk.focus();

return false;
}

if(""==document.forms.quoteBike.Rider.value)
{
alert("Please choose 'Who is going to Ride the Motorcycle'.");
document.forms.quoteBike.Rider.focus();

return false;
}

if(""==document.forms.quoteBike.BikeUse.value)
{
alert("Please choose 'What the Motorcycle will be used for'.");
document.forms.quoteBike.BikeUse.focus();

return false;
}

if(""==document.forms.quoteBike.emType.value)
{
alert("Please choose 'Your Employment type'.");
document.forms.quoteBike.emType.focus();

return false;
}

if(""==document.forms.quoteBike.Occupation.value)
{
alert("Please enter your 'Job Title'.");
document.forms.quoteBike.Occupation.focus();

return false;
}

if(""==document.forms.quoteBike.LicenceType.value)
{
alert("Please choose your 'Licence type'.");
document.forms.quoteBike.LicenceType.focus();

return false;
}

if(""==document.forms.quoteBike.dateLicence.value)
{
alert("Please enter 'What date you obtained your licence'.");
document.forms.quoteBike.dateLicence.focus();

return false;
}

if(""==document.forms.quoteBike.Bike.value)
{
alert("Please enter your 'Motorcycle Make'.");
document.forms.quoteBike.Bike.focus();

return false;
}

if(""==document.forms.quoteBike.BikeMod.value)
{
alert("Please enter your 'Motorcycle Model'.");
document.forms.quoteBike.BikeMod.focus();

return false;
}

if(""==document.forms.quoteBike.EngineSize.value)
{
alert("Please enter your 'Motorcycle Engine Size'.");
document.forms.quoteBike.EngineSize.focus();

return false;
}

if(""==document.forms.quoteBike.YearManu.value)
{
alert("Please enter your 'Motorcycle Manufacture Date'.");
document.forms.quoteBike.YearManu.focus();

return false;
}

if(""==document.forms.quoteBike.Value.value)
{
alert("Please enter your 'Current Motorcycle Value in GBP(£)'.");
document.forms.quoteBike.Value.focus();

return false;
}

if(""==document.forms.quoteBike.datePurchased.value)
{
alert("Please enter 'The Date You Purchased the Motorcycle'.");
document.forms.quoteBike.datePurchased.focus();

return false;
}

if(""==document.forms.quoteBike.Miles.value)
{
alert("Please enter 'The Estimated Annual Mileage for the Motorcycle'.");
document.forms.quoteBike.Miles.focus();

return false;
}

if(""==document.forms.quoteBike.mcKept.value)
{
alert("Please choose 'Where the Motorcycle will be kept at night'.");
document.forms.quoteBike.mcKept.focus();

return false;
}

if(""==document.forms.quoteBike.access.value)
{
alert("Please confirm 'If you have any modifications or accessories on your Motorcycle'.");
document.forms.quoteBike.access.focus();

return false;
}

if(""==document.forms.quoteBike.yearsNcb.value)
{
alert("Please confirm 'No. of years Motorcycle no claims bonus held'.");
document.forms.quoteBike.yearsNcb.focus();

return false;
}


}