(function($){
$.Validate_jq = $.Validate_jq || {};
$.extend($.Validate_jq,{
	emptyLabel:AlertConst.emptylabel,
	ruleErr:AlertConst.ruleErr,
	
	valid:function(el){
		var that = this;
		var result = true;
		$(el).each(function(){
			if($(this).attr("required") == "true"){
				if($(this).val()==""){
					that.alert(that.emptyLabel + $(this).attr("label"));
					$(this).focus();
					result = false;
					return false;
				}
			}
			if($(this).attr("rule") == "email"){
				if(!that.emailRule($(this).val())){
					that.alert($(this).attr("label")+that.ruleErr);
					$(this).focus();
					result = false;
					return false;
				}
			}
			if($(this).attr("minlength")){
				if($(this).val().length<$(this).attr("minlength")){
					that.alert($(this).attr("minlenStr"));
					$(this).focus();
					result = false;
					return false;
				}
			}
		})
		return result;
	},
	
	emailRule:function(value){
		var r = /^\w+[\.\-\w+]*@\w+[\.\-].*\w+$/;
		return (r.test(value));
	},
	
	alert:function(str){
		Util.alert(str);
	}
});
})(jQuery);
