/*
 * Add Specific Validator for FAL
 */
$.validator.addMethod('ValidCity',function(value, element) {
	if (value == undefined || value == null || value == "") {
		return true;
	}

	return ($("#citySearchStatus").val() != 0 && $("#citySearchStatus").val() != 2)
});

$.validator.addMethod('CityWithLawyers',function(value, element) {
	if (this.optional(element)) {
		return true;
	}

	return ($("#citySearchStatus").val() != 5)
});

$.validator.addMethod('ValidPostCode',function(value, element) {
	if (value == undefined || value == null || value == "") {
		return true;
	}

	return $.inArray(value, postCodes) != -1;
});

$.validator.addMethod('NoLawyers',function(value, element) {
	if (this.optional(element)) {
		return true;
	}

	return ($("#citySearchStatus").val() != 3)
});

$.validator.addMethod('KnownCity',function(value, element) {
	if (value == undefined || value == null || value == "") {
		return true;
	}

	return ($("#citySearchStatus").val() != 4)
});

$.validator.addMethod('NameMinLength',function(value, element, minlength) {
	return !($("#nameStatus").val() == 0 && (value == null || $.trim(value).length < minlength));
});
