var FormValidationMd=function(){var f=function(){var c=$("#form_sample_1");var a=$(".alert-danger",c);var b=$(".alert-success",c);c.validate({errorElement:"span",errorClass:"help-block help-block-error",focusInvalid:false,ignore:"",messages:{payment:{maxlength:jQuery.validator.format("Max {0} items allowed for selection"),minlength:jQuery.validator.format("At least {0} items must be selected")},"checkboxes1[]":{required:"Please check some options",minlength:jQuery.validator.format("At least {0} items must be selected"),},"checkboxes2[]":{required:"Please check some options",minlength:jQuery.validator.format("At least {0} items must be selected"),}},rules:{name:{minlength:2,required:true},email:{required:true,email:true},email2:{required:true,email:true},url:{required:true,url:true},url2:{required:true,url:true},number:{required:true,number:true},number2:{required:true,number:true},digits:{required:true,digits:true},creditcard:{required:true,creditcard:true},delivery:{required:true},payment:{required:true,minlength:2,maxlength:4},memo:{required:true,minlength:10,maxlength:40},"checkboxes1[]":{required:true,minlength:2,},"checkboxes2[]":{required:true,minlength:3,},radio1:{required:true},radio2:{required:true}},invalidHandler:function(i,j){b.hide();a.show();App.scrollTo(a,-200)},errorPlacement:function(j,i){if(i.is(":checkbox")){j.insertAfter(i.closest(".md-checkbox-list, .md-checkbox-inline, .checkbox-list, .checkbox-inline"))}else{if(i.is(":radio")){j.insertAfter(i.closest(".md-radio-list, .md-radio-inline, .radio-list,.radio-inline"))}else{j.insertAfter(i)}}},highlight:function(h){$(h).closest(".form-group").addClass("has-error")},unhighlight:function(h){$(h).closest(".form-group").removeClass("has-error")},success:function(h){h.closest(".form-group").removeClass("has-error")},submitHandler:function(h){b.show();a.hide()}})};var d=function(){var c=$("#form_sample_2");var a=$(".alert-danger",c);var b=$(".alert-success",c);c.validate({errorElement:"span",errorClass:"help-block help-block-error",focusInvalid:false,ignore:"",messages:{payment:{maxlength:jQuery.validator.format("Max {0} items allowed for selection"),minlength:jQuery.validator.format("At least {0} items must be selected")},"checkboxes1[]":{required:"Please check some options",minlength:jQuery.validator.format("At least {0} items must be selected"),},"checkboxes2[]":{required:"Please check some options",minlength:jQuery.validator.format("At least {0} items must be selected"),}},rules:{name:{minlength:2,required:true},email:{required:true,email:true},email2:{required:true,email:true},url:{required:true,url:true},url2:{required:true,url:true},number:{required:true,number:true},number2:{required:true,number:true},digits:{required:true,digits:true},creditcard:{required:true,creditcard:true},delivery:{required:true},payment:{required:true,minlength:2,maxlength:4},memo:{required:true,minlength:10,maxlength:40},"checkboxes1[]":{required:true,minlength:2,},"checkboxes2[]":{required:true,minlength:3,},radio1:{required:true},radio2:{required:true}},invalidHandler:function(i,j){b.hide();a.show();App.scrollTo(a,-200)},errorPlacement:function(j,i){if(i.is(":checkbox")){j.insertAfter(i.closest(".md-checkbox-list, .md-checkbox-inline, .checkbox-list, .checkbox-inline"))}else{if(i.is(":radio")){j.insertAfter(i.closest(".md-radio-list, .md-radio-inline, .radio-list,.radio-inline"))}else{j.insertAfter(i)}}},highlight:function(h){$(h).closest(".form-group").addClass("has-error")},unhighlight:function(h){$(h).closest(".form-group").removeClass("has-error")},success:function(h){h.closest(".form-group").removeClass("has-error")},submitHandler:function(h){b.show();a.hide()}})};var e=function(){var c=$("#form_sample_3");var a=$(".alert-danger",c);var b=$(".alert-success",c);c.validate({errorElement:"span",errorClass:"help-block help-block-error",focusInvalid:false,ignore:"",messages:{payment:{maxlength:jQuery.validator.format("Max {0} items allowed for selection"),minlength:jQuery.validator.format("At least {0} items must be selected")},"checkboxes1[]":{required:"Please check some options",minlength:jQuery.validator.format("At least {0} items must be selected"),},"checkboxes2[]":{required:"Please check some options",minlength:jQuery.validator.format("At least {0} items must be selected"),}},rules:{name:{minlength:2,required:true},email:{required:true,email:true},email2:{required:true,email:true},url:{required:true,url:true},url2:{required:true,url:true},number:{required:true,number:true},number2:{required:true,number:true},digits:{required:true,digits:true},creditcard:{required:true,creditcard:true},delivery:{required:true},payment:{required:true,minlength:2,maxlength:4},memo:{required:true,minlength:10,maxlength:40}},invalidHandler:function(i,j){b.hide();a.show();App.scrollTo(a,-200)},errorPlacement:function(j,i){if(i.is(":checkbox")){j.insertAfter(i.closest(".md-checkbox-list, .md-checkbox-inline, .checkbox-list, .checkbox-inline"))}else{if(i.is(":radio")){j.insertAfter(i.closest(".md-radio-list, .md-radio-inline, .radio-list,.radio-inline"))}else{j.insertAfter(i)}}},highlight:function(h){$(h).closest(".form-group").addClass("has-error")},unhighlight:function(h){$(h).closest(".form-group").removeClass("has-error")},success:function(h){h.closest(".form-group").removeClass("has-error")},submitHandler:function(h){b.show();a.hide()}})};return{init:function(){f();d();e()}}}();jQuery(document).ready(function(){FormValidationMd.init()});