
// 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(estimate_form)
{

if(""==document.forms.estimate_form.name.value)
{
alert("Please enter your 'Name'");
document.forms.estimate_form.name.focus();

return false;
}

if(""==document.forms.estimate_form.company.value)
{
alert("Please enter your 'Company'");
document.forms.estimate_form.company.focus();

return false;
}

if(""==document.forms.estimate_form.address.value)
{
alert("Please enter your 'Address'.");
document.forms.estimate_form.address.focus();

return false;
}

if(""==document.forms.estimate_form.tel.value)
{
alert("Please enter your 'Phone Number'.");
document.forms.estimate_form.tel.focus();

return false;
}

if(""==document.forms.estimate_form.email.value)
{
alert("Please enter your 'Email'.");
document.forms.estimate_form.email.focus();

return false;
}

if(""==document.forms.estimate_form.details.value)
{
alert("Please enter 'Details of Estimate'.");
document.forms.estimate_form.details.focus();

return false;
}


}