function validation(){
var validity=true, emailExp=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
var contactExp=/^[0-9]{4,17}$/, nameExp=/^[A-Za-z\s\.]+$/;

if(!nameExp.test(document.contact_us_form.name.value)) {
document.getElementById('error_name').innerHTML="&nbsp;&nbsp;Name must be letters and not empty !";
validity=false;
}else document.getElementById('error_name').innerHTML="";

if(document.contact_us_form.company.value=="") {
document.getElementById('error_company').innerHTML="&nbsp;&nbsp;Company should not be empty !";
validity=false;
}else document.getElementById('error_company').innerHTML="";

if(document.contact_us_form.email.value==""){
document.getElementById('error_email').innerHTML="&nbsp;&nbsp;Email Address should not be empty !";
validity=false;
}
else if(!emailExp.test(document.contact_us_form.email.value)) {
document.getElementById('error_email').innerHTML="&nbsp;&nbsp;Please enter a valid email address !";
validity=false;
}else document.getElementById('error_email').innerHTML="";

if(document.contact_us_form.c_number) {
if(!contactExp.test(document.contact_us_form.c_number.value)) {
document.getElementById('error_c_number').innerHTML="&nbsp;&nbsp;Contact No. must be between 4 - 17 numbers !";
validity=false;
}else document.getElementById('error_c_number').innerHTML="";
}

if(document.contact_us_form.advertising) {
var toa=false;
for(var x=0;x<document.contact_us_form.advertising.length;x++) {
if(document.contact_us_form.advertising[x].checked) {
toa=true; break;
}
}
if(!toa) {
document.getElementById('error_advertising').innerHTML="&nbsp;&nbsp;Please choose the type of advertising !";
validity=false;
}else document.getElementById('error_advertising').innerHTML="";


}

if(document.contact_us_form.comment.value=="") {
document.getElementById('error_comment').innerHTML="&nbsp;&nbsp;Comment should not be empty !";
validity=false;
}else document.getElementById('error_comment').innerHTML="&nbsp;";
return validity;

}

