(function(e){var t={},n={},r=e.each,i=function(t){var n=function(r,i,s){if(typeof r=="object")e.each(r,function(e,t){n(e,t,s)});else if(s===undefined||s===!0)t[r]||(t[r]=[]),t[r].push(i)};return n},s=e.isArray,o=function(t){return e.map(t,function(e,t){return t})},u=function(e,t){var n={};return r(t,function(t,r){e[r]&&(n[r]=e[r])}),n},a=function(t,n){var i={};return r(t,function(t,r){~e.inArray(t,n)||(i[t]=r)}),i},f=function(n,i,s){return e.dform.hasSubscription(n)&&this.each(function(){var o=e(this);r(t[n],function(e,t){t.call(o,i,s)})}),this},l=function(e){var t=e.type,n=this;return this.dform("run","[pre]",e,t),r(e,function(e,r){n.dform("run",e,r,t)}),this.dform("run","[post]",e,t),this};e.extend(e,{keyset:o,withKeys:u,withoutKeys:a,dform:{options:{prefix:"ui-dform-"},defaultType:function(t){return e("<"+t.type+">").dform("attr",t)},types:function(e){return e?n[e]:n},addType:i(n),subscribers:function(e){return e?t[e]:t},subscribe:i(t),hasSubscription:function(e){return t[e]?!0:!1},createElement:function(t){if(!t.type)throw"No element type given! Must always exist.";var i=t.type,s=null,o=e.withoutKeys(t,["type"]);return n[i]?r(n[i],function(e,t){s=t.call(s,o)}):s=e.dform.defaultType(t),e(s)},methods:{run:function(e,t,n){return typeof e!="string"?l.call(this,e):f.call(this,e,t,n)},append:function(t,n){n&&e.dform.converters&&e.isFunction(e.dform.converters[n])&&(t=e.dform.converters[n](t));var r=e.dform.createElement(t);this.append(r),r.dform("run",t)},attr:function(n,r){var i=e.keyset(t);s(r)&&e.merge(i,r),this.attr(e.withoutKeys(n,i))},ajax:function(t,n,r){var i={error:r,url:t},s=this;typeof t!="string"&&e.extend(i,t),i.success=function(e){s.dform(e),n&&n.call(s,e)},e.ajax(i)},init:function(t,n){var r=t.type?t:e.extend({type:"form"},t);n&&e.dform.converters&&e.isFunction(e.dform.converters[n])&&(r=e.dform.converters[n](r)),this.is(r.type)?(this.dform("attr",r),this.dform("run",r)):this.dform("append",r)}}}}),e.fn.dform=function(t,n,r){var i=e(this);return e.dform.methods[t]?e.dform.methods[t].apply(i,Array.prototype.slice.call(arguments,1)):typeof t=="string"?e.dform.methods.ajax.call(i,{url:t,dataType:"json"},n,r):e.dform.methods.init.apply(i,arguments),this}})(jQuery),function(e){var t=e.each,n=function(t,n){return function(r){return e(t).dform("attr",r,n)}},r=function(n,r){var i=this;e.isPlainObject(n)?i.dform("append",n):e.isArray(n)?t(n,function(e,t){i.dform("append",t)}):i.html(n)};e.dform.addType({container:n("
"),text:n(''),password:n(''),submit:n(''),reset:n(''),hidden:n(''),radio:n(''),checkbox:n(''),file:n(''),number:n(''),url:n(''),tel:n(''),email:n(''),checkboxes:n("
",["name"]),radiobuttons:n("
",["name"])}),e.dform.subscribe({"class":function(e,t){this.addClass(e)},html:r,elements:r,value:function(e){this.val(e)},css:function(e){this.css(e)},options:function(n,r){var i=this;r!=="select"&&r!=="optgroup"||typeof n=="string"?(r==="checkboxes"||r==="radiobuttons")&&t(n,function(t,n){var s=r==="radiobuttons"?{type:"radio"}:{type:"checkbox"};typeof n=="string"?s.caption=n:e.extend(s,n),s.value=t,i.dform("append",s)}):t(n,function(t,n){var r={type:"option",value:t};typeof n=="string"&&(r.html=n),typeof n=="object"&&(r=e.extend(r,n)),i.dform("append",r)})},caption:function(t,n){var r={};typeof t=="string"?r.html=t:e.extend(r,t);if(n=="fieldset")r.type="legend",this.dform("append",r);else{r.type="label",this.attr("id")&&(r["for"]=this.attr("id"));var i=e(e.dform.createElement(r));n==="checkbox"||n==="radio"?this.parent().append(e(i)):i.insertBefore(this),i.dform("run",r)}},type:function(t,n){e.dform.options.prefix&&this.addClass(e.dform.options.prefix+n)},url:function(e,t){},"[post]":function(t,n){if(n==="checkboxes"||n==="radiobuttons"){var r=n==="checkboxes"?"checkbox":"radio";this.children("[type="+r+"]").each(function(){e(this).attr("name",t.name)})}}})}(jQuery),function(e){var t=function(t,n){return e.withKeys(n,e.keyset(e.ui[t].prototype.options))},n=function(e,t){for(var n=t,r=0;r").dform("attr",n).progressbar(t("progressbar",n))},e.isFunction(e.fn.progressbar)),e.dform.addType("slider",function(n){return e("
").dform("attr",n).slider(t("slider",n))},e.isFunction(e.fn.slider)),e.dform.addType("accordion",function(t){return e("
").dform("attr",t)},e.isFunction(e.fn.accordion)),e.dform.addType("tabs",function(t){return e("
").dform("attr",t)},e.isFunction(e.fn.tabs)),e.dform.subscribe("entries",function(t,n){if(n=="accordion"){var r=this;e.each(t,function(t,n){var i=e.extend({type:"div"},n);e(r).dform("append",i);if(n.caption){var s=e(r).children("div:last").prev();s.replaceWith('

'+s.html()+"

")}})}},e.isFunction(e.fn.accordion)),e.dform.subscribe("entries",function(t,n){if(n=="tabs"){var r=this;this.append("