(function(a){a.fn.formalize=function(){return this.each(function(){var b=a(this);a("input[type='submit']",this).click(function(d){d.preventDefault();var c={};a("input, select, textarea",b).each(function(){if(this.name!=""){c[this.name]=this.value}});a.post(b.attr("action"),c,function(e){if(e.status=="errorneous"){a("input, select, textarea",b).each(function(){var f=(e.errors[this.name]==undefined)?"green":"red";a("*[name='"+this.name+"']",b).css("border-color",f)})}else{b.submit()}},"json")})})}})(jQuery);function namespace(d){var c=this.split(d||".");var e=window;for(var b=0,a=c.length;b<a;b++){e=e[c[b]]=e[c[b]]||{}}return e}$(document).ready(function(){});