

$(window).load(function(){
	if ($('#contactForm')) {
		$('#contactForm').submit(
			function() {
				
				var error		= '';	
				
				var txtZipcode	= $.trim($('#zipcode').attr('value'));
				var txtName	= $.trim($('#customer').attr('value'));
				var txtEmail	= $.trim($('#email').attr('value'));
				var txtPh    = $.trim($('#phone').attr('value'));
							
				if (txtZipcode =='') {
					
						error += 'Please enter Your Zip Code number..\n';
						$('#zipcode').focus();
					}
					
				 if (txtZipcode !='') {
					if (!isNumeric(txtZipcode)) {
						error += 'Please enter only numeric values in phone first box..\n';
						$('#zipcode').focus();
					}
					
					
				}
				if (txtName =='') {
					
						error += 'Please enter Your Name..\n';
						$('#customer').focus();
					}
				

				if (txtPh =='') {
					
						error += 'Please enter Your Phone number..\n';
						$('#phone').focus();
					}
				 if (txtPh !='') {
					if (!isNumeric(txtPh)) {
						error += 'Please enter only numeric values in phone first box..\n';
						$('#phone').focus();
					}
					if((txtPh.length<10) || (txtPh.length>10))
					error +='Please Enter a valid Phone number..\n';
					$('#phone').focus();
					
				}
				if ($.trim(error)) {
					alert(error);
					return false;
				}
				return true;
			}
		);
	}
});
function isNumeric(form_value) { 
    if (form_value.match(/^\d+$/) == null) 
        return false; 
    else 
        return true; 
}


