function chk_Contact(){	

	if(document.getElementById('con_name').value=="null" != document.getElementById('con_name').value==""){
		alert('Please Key in your Name');
		document.getElementById('con_name').focus();
		return false;
	}
	if(document.getElementById('con_compname').value=="null" != document.getElementById('con_compname').value==""){
		alert('Please Key in your Company Name');
		document.getElementById('con_compname').focus();
		return false;
	}
	
		if(document.getElementById('con_email').value==""){
		alert('Please key in your E-mail Address');
		document.getElementById('con_email').focus();
		return false;
	}
var a=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var b=document.getElementById('con_email').value;
if(a.test(b) == false) {
	  alert('Invalid Email Address');
      return false;
   }
     
	if(document.getElementById('con_contactno').value=="null" != document.getElementById('con_contactno').value==""){
		alert('Please Key in your Contact Number');
		document.getElementById('con_contactno').focus();
		return false;
		}
		var x=document.getElementById('con_contactno').value;
		if(isNaN(x)){
		alert('Please Key numbers only');
		document.getElementById('con_contactno').focus();
		return false;
		}
		var y=document.getElementById('con_contactno').value;
		var z = y.length;
		if(z>10){
		alert('accept 10 digits only!');
		document.getElementById('con_contactno').focus();
		return false;
		}
		/*if(document.getElementById('cust_gender').value==""){
		alert('Pls select gender!');
		document.getElementById('cust_gender').focus();
		return false;
	}
	if(document.getElementById('cust_age').value==""){
		alert('Pls select age!');
		document.getElementById('cust_age').focus();
		return false;
	}*/

   if(document.getElementById('con_message').value==""){
		alert('Please Key in your Message');
		document.getElementById('con_message').focus();
		return false;
	}
	if(document.getElementById('address2').value==""){
		alert('Please Key in your Address2');
		document.getElementById('address2').focus();
		return false;
	}
	if(document.getElementById('city').value==""){
		alert('Please Key in your city');
		document.getElementById('city').focus();
		return false;
	}
	if(document.getElementById('state').selectedIndex == 0){
		alert('Please Select your State Location');
		document.getElementById('state').focus();
		return false;
	}
	if(document.getElementById('postal_code').value==""){
		alert('Please Key in Your Postal Code');
		document.getElementById('postal_code').focus();
		return false;
	}
	var x=document.getElementById('postal_code').value;
		if(isNaN(x)){
		alert('Please Key numbers only');
		document.getElementById('postal_code').focus();
		return false;
		}
	if(document.getElementById('con_user').value.length < 4 ){
		alert('Please Key in your UserName');
		document.getElementById('con_user').focus();
		return false;
	}
	if(document.getElementById('con_password').value.length < 6 ){
		alert('Please Select a Password with atleast 6 characters');
		document.getElementById('con_password').focus();
		return false;
	}
	if(document.getElementById('con_confirmation').value=="" ){
		alert('Please re-key in your Password confirmation');
		document.getElementById('con_confirmation').select();
		return false;
	}
	
	if(document.getElementById('con_confirmation').value != document.getElementById('con_password').value){
		alert('Pls enter correct password !');
		document.getElementById('con_confirmation').focus();
		return false;
	}
	if(document.getElementById('con_value').checked==false){
	    alert('You must agree to the terms!');
		document.getElementById('con_value').focus();
		return false;
    }
	else
	{
		window.location='search_key.php?q='+key;
		return true;
	}
	
} 
