function validateForm(theForm) {
if (theForm.name.value==""){
alert("Please enter your name.");
theForm.name.focus();
return(false);
}
if (theForm.address.value==""){
alert("Please enter your address.");
theForm.address.focus();
return(false);
}
if (theForm.city.value==""){
alert("Please enter your City or Suburb.");
theForm.city.focus();
return(false);
}
if (theForm.state.value==""){
alert("Please enter your State.");
theForm.state.focus();
return(false);
}
if (theForm.postcode.value==""){
alert("Please enter your postcode.");
theForm.postcode.focus();
return(false);
}
if (theForm.country.value==""){
alert("Please enter your country.");
theForm.country.focus();
return(false);
}
Ctrl = theForm.email;
if (theForm.email.value==""){
alert("Please enter your email address.");
theForm.email.focus();
return(false);
}
else if (Ctrl.value==" " || Ctrl.value.indexOf ('@',0) == -1)
{
alert("Please enter a valid email address.");
theForm.email.focus();
return(false);
}
else if (Ctrl.value==" " || Ctrl.value.indexOf ('.',0) == -1){
alert("Please enter a valid email address.");
theForm.email.focus();
return(false);
}
if (theForm.phone.value==""){
alert("Please enter your telephone number.");
theForm.phone.focus();
return(false);
}
if (theForm.fax.value==""){
alert("Please enter your facsimile number.");
theForm.fax.focus();
return(false);
}
if (theForm.compname.value==""){
alert("Please enter your Company name.");
theForm.compname.focus();
return(false);
}
return(true);
} 

