(function(){var e=function(e){var t=this,n=function(){var t=/radio|checkbox/i,n=/[^\[\]]+/g,r=/^[\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?$/,i=function(e){return typeof e=="number"?!0:typeof e!="string"?!1:e.match(r)};e.fn.extend({formParams:function(t,n){return!!t===t&&(n=t,t=null),t?this.setParams(t):this[0].nodeName.toLowerCase()=="form"&&this[0].elements?e(e.makeArray(this[0].elements)).getParams(n):e("input[name], textarea[name], select[name]",this[0]).getParams(n)},setParams:function(t){this.find("[name]").each(function(){var n=t[e(this).attr("name")],r;n!==undefined&&(r=e(this),r.is(":radio")?r.val()==n&&r.attr("checked",!0):r.is(":checkbox")?(n=e.isArray(n)?n:[n],e.inArray(r.val(),n)>-1&&r.attr("checked",!0)):r.val(n))})},getParams:function(r){var s={},o;return r=r===undefined?!1:r,this.each(function(){var u=this,a=u.type&&u.type.toLowerCase();if(a=="submit"||!u.name)return;var f=u.name,l=e.data(u,"value")||e.fn.val.call([u]),c=t.test(u.type),h=f.match(n),p=!c||!!u.checked,d;r&&(i(l)?l=parseFloat(l):l==="true"?l=!0:l==="false"&&(l=!1),l===""&&(l=undefined)),o=s;for(var v=0;v<h.length-1;v++)o[h[v]]||(o[h[v]]={}),o=o[h[v]];d=h[h.length-1];if(o[d])e.isArray(o[d])||(o[d]=o[d]===undefined?[]:[o[d]]),p&&o[d].push(l);else if(p||!o[d])o[d]=p?l:undefined}),s}})};n(),t.resolveWith(n)};dispatch("mvc/dom.form_params").containing(e).to("Foundry/2.1 Modules")})();