function validate_form ( )
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address = document.contact_form.email.value;
		var validation = true;
		
		if ( document.contact_form.email.value.replace(/ /g,"") =="" )
		{
			document.getElementById('error_email').style.display = "block";
			document.contact_form.email.focus();
			document.contact_form.email.value = "";
			validation = false;
		}
		else{
			document.getElementById('error_email').style.display = "none";
			}
			
		if(reg.test(address) == false) {
      		document.getElementById('error_email').style.display = "block";
			 document.contact_form.email.focus();
			document.contact_form.email.value = "";
			validation = false;
  		 }	
   
		if ( document.contact_form.name.value.replace(/ /g,"") =="" )
		{
			document.getElementById('error_name').style.display = "block";
			document.contact_form.name.focus();
			document.contact_form.name.value = "";
			validation = false;
		}
		else{
			document.getElementById('error_name').style.display = "none";
			}
			
		if ( document.contact_form.company.value.replace(/ /g,"") =="" )
		{
			document.getElementById('error_company').style.display = "block";
			document.contact_form.company.focus();
			document.contact_form.company.value = "";
			validation = false;
		}
		else{
			document.getElementById('error_company').style.display = "none";
			}
			
		if ( document.contact_form.phone.value.replace(/ /g,"") =="" )
		{
			document.getElementById('error_phone').style.display = "block";
			document.contact_form.phone.focus();
			document.contact_form.phone.value = "";
			validation = false;
			return false;
		}
		else{
			document.getElementById('error_phone').style.display = "none";
			}
			
		//validation for phone no format
		   if(document.contact_form.phone.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1)
		   {
			alert("The phone number you entered is not valid.\r\nPlease enter a phone number with the format xxx-xxx-xxxx.");
			document.contact_form.phone.focus();
			document.contact_form.phone.value = "";
			validation = false;
		   }
		//ph no validation ends
			
		if(validation == false){
        return false;
        }	
	}
	
checked=false;
function checkedAll (contact_form) {
	var aa= document.getElementById('contact_form');
	 if (checked == false)
          {
           checked = true
          }
        else
          {
          checked = false
          }
	for (var i =0; i < aa.elements.length; i++) 
	{
	 aa.elements[i].checked = checked;
	}
      }
