jQuery.validator.addMethod(   
   "selectNone",   
   function(value, element) {   
     if (element.value == "none")   
     {   
       return false;   
     }   
     else return true;   
   },   
   "Please select an option."  
);   


$(document).ready(function() {
						   
	$("#form1").validate({
   		submitHandler: function(form) {
			if (checkifphone()) {
				form.submit();
			} else {
				return false;
			}
   		},
		invalidHandler: function(form, validator) {
			checkifphone();
		},
		rules: {   
			ClaimAgainst: {   
         		selectNone: true  
       		}   
	    } 
	});
	
	$('.required_group').keyup(function(){
		if ($(this).val() != '') {
			checkifphone();			
		}
	});
	
});

function checkifphone(){
	if ($('div.panel').find('.required_group:filled').length == 0) {	
		//$('div.panel').find('.required_group').each(function(i){
			//if ($(this).next('.error_custom').length == 0)
			$('div.panel').append('<label class="error_custom" for="' + this.id + '" generated="true">Please provide us with at least one telephone number so that we can contact you*</label>');
		//});
		return false;
	} else {
		$('div.panel').find('.error_custom').remove();
		return true;
	}
}
