

function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 



function zipvalidation(entered, alertbox)
{
with (entered)
{
if (isNaN(value))
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 




function emailvalidation(entered, alertbox)
{
with (entered)
{
apos=value.indexOf("@"); 
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
} 




function formvalidation(thisform)
{
with (thisform)
{
if (emptyvalidation(name,"Error ! Please type in your Name !")==false) {name.focus(); return false;}
if (emptyvalidation(email,"Error ! Please type in your Email Address !")==false) {email.focus(); return false;}
if (emptyvalidation(add,"Error ! Please type in your Address !")==false) {add.focus(); return false;}
if (emptyvalidation(city,"Error ! Please type in your City Address !")==false) {city.focus(); return false;}
if (emptyvalidation(zip,"Error ! Please type in your Zip Code !")==false) {zip.focus(); return false;}

if (emailvalidation(email,"Error ! Please provide with your valid Email Address !")==false) {email.focus(); return false;}

if (zipvalidation(zip,"Error ! Please provide with your valid Zip Code !")==false) {zip.focus(); return false;}



else
{
	document.get_quote.submit();
}

}
} 





