text: var awe=function(){function g(n){return n.k}function rt(n){return n.c}function br(n){return n.substr(0,1).toLowerCase()+n.substr(1)}function nt(n,t){return t?n.scrollTop():n.scrollLeft()}function tt(n,t,i){i?n.scrollTop(t):n.scrollLeft(t)}function u(n,t){return n.addClass(t)}function e(n,t){return n.removeClass(t)}function r(n,t){return t?n.data("api",t):n.data("api")}function bt(n){return String(n).replace(/[&<>"']/g,function(n){return ir[n]})}function rr(n){n=ht(n);for(var t in ir)n=n.split(ir[t]).join(t);return n}function oi(){return n('<div><div class="awe-scon"><\/div><\/div>')}function kr(n){return"[data-k='"+bt(n)+"']"}function pu(n,t){var i=n.which;n.ctrlKey||t.indexOf(i)+1||(i<58&&!n.shiftKey||i<48)&&i!=32||i>111&&i<146||(i<96||i>105)&&f(n)}function dr(n,t,r,u){return function(e){var o=e.which,c=t[0],s=t.val(),h=wu(c),l=s.slice(h.s,h.e);o==38?u(1):o==40?u(-1):o==188||o==190||o==110?(f(e),n.dec!=i&&(s.indexOf(r)==-1||l.indexOf(r)>-1)&&(s=s.slice(0,h.s)+r+s.slice(h.e),t.val(s),bu(c,h.s+1))):o!=109&&(o!=189||e.shiftKey)?awe.pnn(e,[]):(s.indexOf("-")>-1&&l.indexOf("-")==-1||h.s>0||n.min>=0)&&f(e)}}function wu(n){var u,t,i,r,f;return"selectionStart"in n?{s:n.selectionStart,e:n.selectionEnd}:(u=document.selection.createRange().getBookmark(),t=n.createTextRange(),t.moveToBookmark(u),i=n.createTextRange(),i.collapse(!0),i.setEndPoint("EndToStart",t),r=i.text.length,f=t.text.length,{s:r,e:r+f})}function bu(n,t){if(n.createTextRange){var i=n.createTextRange();i.move("character",t);i.select()}else n.selectionStart&&(n.focus(),n.setSelectionRange(t,t))}function ht(n){return n==i?t:n.toString()}function ku(n){return String(n).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function si(n){var t=n[0],r=i;return window.getComputedStyle?r=window.getComputedStyle(t).direction:t.currentStyle&&(r=t.currentStyle.direction),r=="rtl"}function hi(n){return n.length?wt(n):t}function nu(t,i,r){var u=0;return r||(t.sort(),i.sort()),t.length==i.length&&(u=1,n.each(t,function(n,t){i[n]!=t&&(u=0)})),u}function tu(n){return n&&n.length}function du(n,t){function e(i){var r,u;for(r in t){if(u="("+r+")",n.substr(i+1,u.length).toUpperCase()==u.toUpperCase())return{p:r,l:u.length};if(n.substr(i+1,r.length).toUpperCase()==r.toUpperCase())return{p:r,l:r.length}}}for(var f,i="",u=[],r=0;r<n.length;r++){if(n[r]=="."&&(f=e(r),f)){r+=f.l;i&&(u.push(i),i="");u.push(f);continue}i+=n[r]}return i&&u.push(i),u}function kt(t,i,r){if(t.data){var u=t.data.vals,f=[],o=[],e=[];n.each(u,function(n,i){t.data.l[n]&&e.push(i)});function s(t){if(!lt(o,t)){o.push(t);var i=n("#"+t).data("o");i&&i.data&&n.each(i.data.vals,function(n,t){lt(u,t)&&i.data.l[n]&&f.push(t);s(t)})}}t.data.vals.length>1&&n.each(u,function(n,t){lt(f,t)||s(t)});n.each(u,function(u,o){var s=n("#"+o).data("o");lt(f,o)||(s&&s.pch?n("#"+o).bind(st,function(n,u){u&&(cu(e,u.p)&&!r?i(u):t.v.trigger(st,u))}):!r&&cu(e,[o])&&n("#"+o).bind(c,function(){i({p:[o]})}))})}}function iu(t,i){var r=0;return n.each(i,function(n,i){g(t)==bt(i)&&(r=1)}),r}function ru(i,r){i.d.empty();var f=ct(i.v),u="<ul>";n.each(i.lrs,function(n,e){u+='<li><label class="awe-label"><input type="'+r+'" value="'+g(e)+'" name="'+i.nm+'" '+(iu(e,f)?'checked="checked"':t)+" />"+rt(e)+"<\/label><\/li>"});u+="<\/ul>";i.d.append(u)}function ur(n,t){n.pch=1;n.v.change(function(t,i){i=et(i,{p:[]});i.p||(i.p=[]);i.p.push(n.i);n.v.trigger(st,i)});n.l&&t();kt(n,function(n){t(n)})}function ci(t,r,o,s,h,c,a,y,w,b,k,d,g,it,rt,ut,ft,et,ot,st){function vt(h){function ei(t){var r,e,s,i;if(f(h),f(t),gt>3||vt&&ri){r={};kt=r;clearInterval(dt);ii=1;u(ot,ar);c&&ht.hide();e=vt?t.originalEvent.touches[0]:t;p=e.pageX;k=e.pageY;function v(){var u,t,r,i;for(ui=p-ni,yt=k-ti,fi&&(u=n(window),yt-=u.scrollTop(),yt>u.height()&&(yt=u.height()-20)),yt<0&&(yt=0),ot&&ot.css({left:ui,top:yt}).show(),rt&&rt(),r=0;r<bt.length;r++)if(i=bt[r],i&&k>i.Ys&&k<i.Ye&&p>i.Xs&&p<i.Xe){t=r;break}pt!=t&&w();t>=0&&(ft?s=ft(o[t],ht,p,k,ot):a&&a[t]&&a[t](ht,p,k,ot));pt=t}v();i=b;st&&(i=(st(s)||[]).concat(i));y(i);function y(t,i){var u;t&&n.each(t,function(n,f){function b(i,u,o,c,l){if(i>u&&i<o){e=yu((c?o-i:i-u)/s*15);var b=l?f.sh:f.sw;c&&(e*=-1);function g(){if(kt&&(!h||(c?w>Math.abs(e):w+e<b))){w+=e;tt(d,w,l);var i=nt(d,l);h&&(l?k+=e:p+=e);v();tt(d,i,l);i==rt?(clearInterval(dt),y(t,n)):a();rt=i}}function a(){kt==r&&setTimeout(g,10)}return a(),1}}if(i>=n)return!0;var s=30,o=f.c,d=f.p||o,h=f.w,e,rt,c=h?nt(l,1):o.offset().top,g=c+o.outerHeight(),ut=c+s,ft=g-s,a=h?nt(l):o.offset().left,it=a+o.outerWidth(),et=a+s,ot=it-s,w=nt(o,f.y);return f.y?u=p>a&&p<it&&(b(k,c,ut,1,1)||b(k,ft,g,0,1)):f.x&&(u=k>c&&k<g&&(b(p,a,et,1)||b(p,ot,it))),u?!1:void 0})}}else gt++}var dt,vt=h.type!="mousedown",kt,wt=vt?h.originalEvent.touches[0]:h,ht=r?n(h.target).closest(r):t,ni=wt.pageX-ht.offset().left,ti=wt.pageY-ht.offset().top,ii,ri,bt,ui,yt,p,k,pt,ot,fi,gt;if(g&&g(vt,wt,ht,h))return!0;setTimeout(function(){ri=1},300);f(h);bt=[];ut&&(o=$(ut).map(function(n,t){return $(t)}).get());n.each(o,function(n,t){if(t&&t.length){var r={};r.Ys=t.offset().top;r.Ye=r.Ys+t.outerHeight();r.Xs=t.offset().left;r.Xe=r.Xs+t.outerWidth();bt.push(r)}else bt.push(i)});n.each(b,function(n,t){if(t.c.is(at)){t.w=1;var u=lr(),i=l.height()-at.height(),r=l.width()-at.width();i&&(i+=u);r&&(r+=u);t.sh=i;t.sw=r}});ot=d(ht);lt||(ni=wt.pageX-ot.offset().left,ti=wt.pageY-ot.offset().top);fi=ot.css("position")=="fixed";gt=0;n(document).on(vt?"touchmove":"mousemove",ei).one(vt?"touchend":"mouseup",function(){n(document).off("touchmove mousemove",ei);clearInterval(dt);kt=i;setTimeout(function(){e(ot,ar)},1);!it&&ot&&ot.remove();ct&&ct.remove();pt!=i&&(et?et(o[pt],ht,p,k):s[pt]&&s[pt](ht,p,k));w();y();c&&ht.show();!ii&&vt&&n(h.target).trigger(v)})}var ct,lt;w=w||p;y=y||p;k=k||function(n){return n};b=b||[];d=d||function(i){var f=i.width(),e=i.height(),r=u(k(i.clone(),i),"awe-drag "+ht(h)).hide();return si(t)?ct=n('<div style="direction:rtl"/>').appendTo(n("body")).append(r):r.appendTo(n("body")),r.width(f).height(e),lt=1,r};t.on(ri,ot||r,vt);return function(){t.off(ri,vt)}}function dt(t){var i=t.p,f=i.d;f.data("o",t);i.i&&n("#"+i.i).length&&r(n("#"+i.i)).destroy();i.g&&(n(".awe-popup[aweg="+i.g+"]").each(function(){var t=r(n(this));t&&t.destroy()}),f.attr("aweg",i.g));u(f,"awe-popup");i.i&&f.attr("id",i.i);awe.popup(t)}function w(n,t){return awe.readd(n,t)}function ut(n){awe.ff(n)}function uu(n,t){if(n.sc)n.fm.on(c,gi,t);else n.fm.on(v,".awe-searchbtn",t)}function it(n,t){var i=function(){};return r(n.v,i),n.api=i,t&&(i.load=function(i){return i&&(i.params&&(n.params=i.params),i.oparams&&(n.oparams=i.oparams)),t()}),i}function fr(n,t,i){return tf(n.d),u(n.d,"awe-load"),or(n,t),hr(n,t,function(n){i(n)},function(){e(n.d,"awe-load");rf(n.d)})}function er(n,r){if(r.d){r=r.d;var u=r.v;u==i&&(u=t);n.lrs=r.it;n.v.val(wt(u))}else n.lrs=r}function ft(n,t,i){n.v.trigger(d,[t,i])}function or(n,t,i){n.v.trigger(vt,[t,i])}function gu(n,t){n.v.trigger("awebeforeload",[t])}function et(n,t){return n?n:t}function nf(n,t){return n.substring(0,t.length)===t}function o(n,t){n.v.trigger(c,t);fu(n.v)}function fu(n){n.valid&&n.closest("form").length>0&&n.valid()}function ct(t){var r,i=t.val();return t.hasClass("awe-array")?(i.length||(i="[]"),r=i[0]=="["?n.map(tr(i),function(n){return ht(n)}):[ht(i)]):r=[ht(i)],r}function li(n,t){return gt(ct(n),t)}function ai(t){var r=[];for(var i in t)n.isArray(t[i])?r=r.concat(gt(t[i],i)):r.push({name:i,value:t[i]});return r}function gt(t,i){var u=[],r;for(n.isArray(t)||(t=[t]),r=0;r<t.length;r++)u.push({name:i,value:t[r]});return u}function h(t,i){var r=[],u,f;if(t.pro&&(r=r.concat(h(t.pro,1))),t.i&&(r=r.concat(gt(t.i,au))),t.v&&!i&&(r=r.concat(li(t.v,"v"))),t.oparams&&(r=r.concat(ai(t.oparams)),t.oparams=0),t.params&&(r=r.concat(ai(t.params))),t.data&&n.each(t.data.keys,function(i,u){r=r.concat(li(n("#"+t.data.vals[i]),u))}),t.pars&&n.each(t.pars.keys,function(n,i){r=r.concat(gt(t.pars.vals[n],i))}),t.parf)for(u=t.parf,n.isArray(u)||(u=[u]),f=0;f<u.length;f++)r=r.concat(ai(u[f]()));return r}function tf(n){n.before(a)}function rf(n){var t=n.prev();t.hasClass("awe-ldgcnt")&&t.remove()}function f(n){n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}function b(t){t.v=n("#"+t.i);t.f=t.v.parent();t.lrs=[];t.rtl==i&&(t.rtl=si(t.f));t.rtl&&u(t.f,"awe-rtl");t.d=t.f.find(".awe-display");t.v.data("o",t)}function vi(n){n.v.val()?u(n.f,vr):e(n.f,vr)}function ni(n){return n.outerHeight(!0)-n.height()}function eu(n,t){n?t.append('<tr class="awe-loadcont"><td>'+a+"<\/td><\/tr>"):t.append('<li class="awe-loadcont">'+a+"<\/li>")}function ou(n,t,i){n&&window.FormData?(i.data=new FormData(t[0]),i.contentType=!1,i.processData=!1):i.data=t.serialize()}function yi(n,t,i,r){i||(i=1);var u=h(n,n);return u=u.concat(t),n.srl.empty(),eu(n.tl,n.srl),su(n,u,i,0,0,r)}function su(n,i,r,u,f,e){var o=[{name:"page",value:r}],h,s;return n.tl&&(h=!n.srl.closest("table").find("thead:first").html(),o=o.concat({name:"isTheadEmpty",value:h})),u&&(o=o.concat({name:"isMoreClick",value:u}),o=o.concat({name:"pivot",value:n.pivot||t})),s=i.concat(o),e&&or(n,s),y(n,n.searchUrl,s,function(t){var o=w(t,n).d;u||n.srl.empty();uf(n,o,i,r,e);n.pivot=o.p;f&&f();e?ft(n,t,o):n.srl.trigger(d,[t,i])},function(){f&&f();n.srl.find(".awe-loadcont").remove()})}function hu(i,r,u){var f,e;r&&(r.th&&u.closest("table").find("thead:first").html(r.th),f=u.find(".awe-li").map(function(){return n(this).data("val")}),r.c?(e=n("<div/>").append(r.c),e.find(".awe-li").each(function(){n.inArray(n(this).data("val"),f)>=0&&n(this).remove()}),u.append(e.children())):r.it&&n.each(r.it,function(r,e){var o=i.mode?t:'<button type="button" class="awe-movebtn awe-btn" tabindex="-1"><i class="awe-icon"><\/i><\/button>';n.inArray(g(e),f)<0&&u.append('<li class="awe-li" data-val="'+g(e)+'">'+o+rt(e)+"<\/li>")}))}function uf(t,i,r,u,f){var e,o,s;hu(t,i,t.srl);i.m&&(e=n('<div class="awe-morebtn">'+t.mt+"<\/div>").click(function(){u++;var i=n(this);i.after(n("<div class='awe-loading'><span><\/span><\/div>"));i.hide();su(t,r,u,1,function(){i.closest(".awe-li").remove()},f)}),t.tl?(o=t.srl.find(".awe-li:not(.awe-morecont):first > td").length,s=n('<tr class="awe-li awe-morecont"><td colspan="'+o+'"><\/td><\/tr>'),t.srl.append(s),t.srl.find("tr:last td").append(e)):(t.srl.append('<li class="awe-li awe-morecont"><\/li>'),t.srl.find("li:last").append(e)))}function sr(n){return n===0&&(n="0"),n||(n=t),n}function k(n,t){return n.replace(/{(\d+)}/g,function(n,i){return typeof t[i]!="undefined"?t[i]:n})}function lt(t,i){return n.inArray(i,t)+1}function ff(t,i){return n.grep(t,function(n){return lt(i,n)})}function cu(n,t){return ff(n,t).length}function hr(t,i,r,u){return t.df?n.when(t.df(i)).done(function(n){try{r(n)}finally{u()}}):y(t,t.url,i,r,u)}function y(n,t,i,r,u){return ot(n,{url:t,data:i,success:r},u)}function ot(t,i,r){return i.type||(i.type="post"),i.traditional=!0,n.ajax(i).fail(function(n,i,r){awe.err(t,n,i,r)}).always(r)}function cr(t){return!n(t.target).parents(".awe-nonselect").length&&!n(t.target).hasClass("awe-nonselect")}function ef(t){var i=t.lrs.p,u=t.lrs.pc,f,o,e;t.lrs.pgn&&(f=t.v,o=u<8?pi(1,u,i):i<5?pi(1,5,i)+" ... "+ti(u,i):i>u-3?ti(1,i)+" ... "+pi(u-3,u,i):ti(1,i)+" ... "+pi(i-1,i+1,i,1)+" ... "+ti(u,i),e=f.find(".awe-pager"),e.html(o),e.find("button").click(function(){var i=n(this),u=i.data("p"),e=i.data("act"),o=i.closest(".awe-pager");t.ldg||n.when(r(f).load({start:function(){t.pg=parseInt(u)}})).done(function(){var t=o.find("[data-p="+u+"]"),n=e?o.find("[data-act="+e+"]"):t;n.length||(n=t);n.focus()})}))}function pi(n,r,u,f){for(var o=t,s=1,e=n;e<=r;e++,s++)o+=ti(e,u,e,f?s:i);return o}function ti(n,i,r,u){return r||(r=n),k("<button type='button' data-p='{0}' data-act='{3}' class='awe-btn awe-pager-btn {1}'>{2}<\/button>",[n,i!=n?t:s,r,u||t])}function of(){var n=$(":focus");window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty();n.is(":focus")||n.focus()}function lr(){var i=document.createElement("p"),t,n,u,r;return i.style.width="100%",i.style.height="200px",t=document.createElement("div"),n=t.style,n.position="absolute",n.top="0px",n.left="0px",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(i),document.body.appendChild(t),u=i.offsetWidth,n.overflow="scroll",r=i.offsetWidth,u==r&&(r=t.clientWidth),document.body.removeChild(t),u-r}var n=jQuery,l=n(document),at=n(window),gr;n(function(){n("body").append('<a href="http://aspnetawesome.com">built using Trial version of ASP.net MVC Awesome http://aspnetawesome.com<\/a>')});var a="<span class='awe-ldgcnt'><div class='awe-loading'><span><\/span><\/div><\/span>",wi="disabled",c="change",bi="focusin",lu="focusout",st="awepch",v="click",vt="awebeginload",d="aweload",au="__aweconid",ii="<div class='awe-empty'>&nbsp;<\/div>",i=null,ri="touchstart mousedown",ki=" ",yt=".awe-row",s="awe-selected",ui="awe-changing",ar="awe-dragging",vr="awe-hasval",di="awe-groupable",yr="."+s,gi=":input[name]",pr='<input type="text" name="search" class="awe-searchtxt" placeholder="{1}..."/><button type="button" class="awe-searchbtn awe-btn">{0}<\/button>',vu="<input type='hidden' name='{0}' value='{1}' />",wr='<col class="awe-idn"/>',t="",fi=".",pt=Math.max,nr=Math.min,yu=Math.round,ei={},wt=function(n){return typeof n=="object"?JSON.stringify(n):n},tr=n.parseJSON,p=function(){},ir={"&":"&amp;","<":"&lt;",'"':"&quot;","'":"&#39;",">":"&gt;"};return gr=function(){var n={};return{setItem:function(t,i){n[t]=i},getItem:function(t){return n[t]},removeItem:function(t){delete n[t]}}}(),{err:function(){},errMsg:function(){return t},test:function(){},ach:o,pnn:pu,val:ct,scrollw:lr,ppk:"awe16_",gmd:i,tmd:i,rdd:ci,params:h,rgv:sr,grid:function(o){function b(){return o.columns}function li(t){return!n(t.target).closest(".awe-grid").is(c)}function ff(){var t=(o.gl+o.th)*gt;return n.each(b(),function(n,i){ri(i)||(t+=i.W||i.Mw)}),t}function pu(n,t){var i=n.attr("colspan"),r=i?parseInt(i,10):1;n.attr("colspan",r+t)}function sf(n){while(n--)hi.prepend(wr)}function hf(){return n(yt+yr,c).map(function(){return n(this).data("model")}).get()}function uu(n,t){var i=ir+o.th-(n-1),r;return t?(r=b().length-nu,i+=r):i+=1,i}function wu(n){var t=0;try{n==1?t=gr:n==2?t=sessionStorage:n==3&&(t=localStorage)}catch(i){}return t}function lf(){ut={};ht&&ht.removeItem(o.pk);ct&&ct.removeItem(o.cpk)}function eu(n,t,i){return n.I=t.I,(n.R||i)&&(n.W=t.W),n.Hid=t.Hid,(n.G||i)&&(n.Gd=t.Gd,n.Gk=t.Gk),(n.S||i)&&(n.So=t.So,n.Sort=t.Sort),n}function ti(){try{if(ht&&ht.setItem(o.pk,wt([{pg:o.pg,So:o.So},ut])),ct){var t=n.map(b(),function(n){return eu({},n,1)});ct.setItem(o.cpk,wt(t))}}catch(i){}}function af(){var n,u,f,s,h,c,e,l;if(ct){function a(n,t){for(var i=0;i<n.length;i++)if(n[i].I==t)return i;return-1}if(n=ct.getItem(o.cpk),n){n=tr(ct.getItem(o.cpk));for(var r=0,t=0,i=b();r<n.length&&t<i.length;)u=n[r],f=i[t],u.I==f.I?(eu(f,u),r++,t++):~a(n,f.I)?(s=a(i,u.I),~s?(h=i[s],i[s]=f,i[t]=h,eu(h,u),r++,t++):r++):t++}}ht&&(c=ht.getItem(o.pk),c&&(e=tr(c),e&&e.length==2&&(l=e[0],o.pg=l.pg,o.So=l.So,ut=e[1])))}function ou(n){return b()[n.data("i")]}function bu(n){ot.find(".awe-col").length||ot.empty();ot.append(k("<div class='awe-col awe-sortable {3}' data-i='{1}'><div class='awe-il '>{2}{0}<\/div>{4}<\/div>",[n.H,n.ix,lu,vr[n.Sort]+" "+(n.Hcc||t),n.Gr?"<div class='awe-il awe-remb'><i class='awe-rem'><\/i><\/div>":t]))}function vf(){function v(){r.remove()}function h(){e(ot,"awe-highlight");r.hide()}function y(i,u){return r=c.find(".awe-reh").clone().appendTo(a),f=u.hasClass(di),s=u.hasClass("awe-rer"),t=u.data("i"),n("<table/>").append(n("<tr/>").append(u.clone()))}function l(i,u){if(s){var o=-1,f,c,e;if(it.find(".awe-hc").each(function(t,i){var r=n(i);return c=r.offset(),e=c.left,u>e&&u<e+r.outerWidth()?(f=r,o=f.data("i"),!1):void 0}),f){if(e-=5,(t<o&&!dt||dt&&t>o)&&(e+=f.outerWidth()),t!=o&&f.hasClass("awe-rer"))return r.css({left:e,top:c.top+1,height:f.outerHeight()+1}).show(),o;h()}}}function p(n,r,u){var f,e,o;s&&(f=l(n,r,u),f!=i&&(e=b(),o=e.splice(t,1),e.splice(f,0,o[0]),c.trigger("awereorder"),hu(),ti()))}function w(){f&&u(ot,"awe-highlight")}function k(n){f&&(o.ldg||yf(n.data("i")))}var r,t,f,s,a=n("body");ci(it,"."+di+", .awe-rer",[ot,it],[k,p],"awe-dcol",i,[w,l],v,h,[{c:wi,x:1,p:g},{c:at,x:1}],y)}function yf(t){var r=b()[t],u;if(!r.Gd){u=0;n.each(b(),function(n,t){t.Gd&&t.Gk>u&&(u=t.Gk)});function f(){o.p1&&(o.pg=1);bu(r);r.Gd=1;r.Gk=u+1;oi(1)}vt(i,f)}}function su(t,i,r,u){var f,e;return u="rl"+u,f=r[u],(!f||o.rsr)&&(f=du(t,i),r[u]=f),e="",n.each(f,function(n,t){e+=t.p?sr(i[t.p]):t}),e}function pf(n,t,i){if(!t&&!i)return n;var r=n.indexOf(">");return n.substr(0,r)+i+">"+t+n.substr(r+1)}function wf(n){for(var i=t,r=0;r<n-1;r++)i+="<td class='awe-idn'><\/td>";return i}function bf(i,r,u,f,e){var s=t,h=0;return n(b()).each(function(_,col){var val,colspan;if(ri(col))return 1;val=t;!r&&(col.F||col.T)?col.F?val=eval(col.F)(i,col.P):col.T&&(val=su(col.T,i,col,"cf")):val=r&&col.Ft?su(col.Ft,i,col,"f"):sr(i[col.px]);var cellbtn=t,attributes=t,cclass=col.Cc||t;h==0&&(f&&(cellbtn+="<i class='awe-ce-ico "+(o.cohc?t:"awe-ceb")+"'><\/i>"),(o.th||e)&&(colspan=uu(u),colspan>1&&(attributes+=" colspan='"+colspan+"' "),f||(cclass+=" awe-lf")));nf((val||t).toString(),"<td")?s+=pf(val,cellbtn,attributes):(f&&o.cohc&&!h&&(cclass+=" awe-ceb"),val||(val=ii),cclass&&(attributes+=" class='"+cclass+"'"),s+="<td"+attributes+">"+cellbtn+val+"<\/td>");h++}),o.rsr&&(o.rsr=0),s}function vi(i,r,u,f,e,s,h,c,l,a,v){var w=et(c,r),p,y;return o.st&&i&&(u+=" awe-selectable"),o.rcf&&i&&(u+=" "+su(o.rcf,i,o.rls,"rcc")),a&&(p=bi[bt(i[o.k])],p&&(u+=" "+p+"-on")),y=t,o.k&&i&&i[o.k]&&(y+="data-k='"+bt(i[o.k])+"'"),f&&(y+=" style='display:none;' "),v&&(y+=v),n(k("<tr {4} data-lvl='{0}' class='{1}'>{2}{3}<\/tr>",[r,u,wf(w),h?h:bf(i,e,w,s,l),y])).data("model",i)}function ur(r,u,f,e,s,h,c){var y,p,w,d,v,it,rt;e=e||0;var b=!1,l=[],a=r.h;if(a){var g=a.i,k=a.k+u,nt=t,tt=r.nt==3;b=tt||ut[k]==i||a.ip?a.cl:ut[k];y=b?" awe-collapsed ":t;y+="awe-ghead ";g&&(y+="awe-row ");a.c&&(y+=o.cohc?" awe-ceb":t,nt="<td colspan='"+uu(u,1)+"'><i class='awe-ce-ico"+(o.cohc?t:" awe-ceb")+"'><\/i>"+a.c+"<\/td>");p=vi(g,u,y,f,0,1,nt,0,1,c);p.data("i",k);tt&&p.data("l",1);l=l.concat(p)}if(!f&&b&&(f=!0),r.gs&&n.each(r.gs,function(n,t){l=l.concat(ur(t,u+1,f))}),w=r.it,w)for(d=u,r.nt!=2&&d++,v=0;v<w.length;v++){if(s){s--;continue}if(it=(v+e)%2==0?t:" awe-alt",l=l.concat(vi(w[v],d,"awe-row"+it,f,0,i,i,i,i,c)),h&&h==v+1)break}return r.f&&(rt=ir+1,l=l.concat(vi(r.f,u,"awe-gfoot",f,1,0,0,rt))),l}function oi(r){var l=0,a=t,tt=t,f,e,u,w;if(ot.empty(),r||(hi.empty(),it.empty()),f=1,o.hg&&n.each(o.hg,function(n,t){f=pt(f,t.L+2)}),e=[],n.each(b(),function(n,i){if(i.ix=n,i.Gd&&(e.push(i),i.Sort||(i.Sort=1)),!ri(i)){var u=i.W;l+=u||i.Mw;r||(a+="<col "+(u?"style='width:"+u+"px'":t)+" data-i='"+n+"' />")}}),o.sh&&!r){var et={},d={},rt=1,ut;for(u=0;u<f;u++){var h=t,s,ft,g=1,nt=1,c=f-1,v=[],y=p;n.each(b(),function(r,l){function ot(n){if(rt||ut==r){for(var t=0;t<e.length;t++)h='<td class="awe-idn" rowspan='+n+"><\/td>"+h;ut=r;rt=0}}var p,tt,a,it,w,b;if(!ri(l)){if(a=f-1,o.hg){l.Hg&&n.each(l.Hg,function(n,t){var r=o.hg[t],i=r.L;i==u&&(p=r,tt=t);i>u&&(a=a?nr(a,i):i)});p?tt==ft?(nt++,c=nr(c,a),v.push(r)):(s&&y(),st(),v=[r]):(s&&y(),st(),v=[]);function st(){nt=1;s=p;ft=tt;c=a}y=function(){s&&(g=c-u,h+="<td colspan="+nt+" rowspan="+g+'><div class="awe-col">'+s.C+"<\/div><\/td>",s=i,n.each(v,function(n,t){d[t]=c}),ot(g))}}it=d[r];p||it&&it!=u||(w=t,!r&&o.th&&(w="colspan='"+(o.th+1)+"'"),b=f-u,b>1&&(w+=" rowspan="+b),h+=k("<td data-i={0} class='awe-hc {8} {3} {4} {5} {7}' {6}><div class='awe-col' unselectable='on' >{1}{2}<\/div><\/td>",[r,l.H||ii,l.S?lu:t,l.S?"awe-sortable":t,l.G?di:t,vr[l.Sort],w,l.Re?"awe-rer":t,l.Hcc||t]),et[r]=1,d[r]=-1,ot(b))}});y();tt+="<tr>"+h+"<\/tr>"}}if(o.gl=e.length,w=o.gl+o.th,w&&(l+=w*gt),!r){while(w--)a=wr+a;hi.append(a);it.append(tt);yu.css("min-width",l+"px");vu.css("min-width",l+"px")}e.sort(function(n,t){return n.Gk-t.Gk});n.each(e,function(n,t){bu(t)});o.gl||ot.html(o.gbt);fr()}function fr(){var f,i,s,r;if(c.is(":visible")){si(c)?(u(c,"awe-rtl"),dt=1):u(c,"awe-ltr");f=c.outerHeight(!0)-g.height();i=n("<div><\/div>");i.css("overflow-y","scroll");i.css("position","relative");i.append("<p/>");c.append(i);s=i.find("p").position().left;i.remove();r=["left","right"];s<3&&r.reverse();var e=lr()+"px",h="padding-",l=h+r[0],a=h+r[1];ui.css("margin-bottom","-"+e);o.h&&(g.css("overflow-y","scroll"),g.height(pt(o.h-f,70)),ui.css(l,e),ui.css(a,t),dr[0]&&(dr.css(l,e),dr.css(a,t)));o.mh&&g.css("min-height",o.mh-f);fi?ui.show():ui.hide()}}function hu(){var i,r,t;if(o.lrso)return vt();if(!o.ldg){if(bi={},i=nt(g,1),r=nt(g),!o.lrs)throw"no data";fi=o.lrs.fr;t=o.lrs.dt;nu=0;n.each(b(),function(n,t){ri(t)&&nu++});t.gs&&(fi=0);g.css("min-height",g.height());oi();o.rsr=1;fi&&rf.html(ur(t,0,0,0,0,fi));uf.empty().append(ur(t,0,0,0,fi,0));g.css("min-height","");tt(g,i,1);au&&tt(g,r);au=1;c.trigger("awerender")}}function yi(n,t,i,r,u){for(;;){var f=n.data("lvl");if(!f)return;if(f=parseInt(f,10),f<t)break;if(f==t&&!n.hasClass("awe-gfoot"))break;(r==f&&!n.hasClass("awe-gfoot")||r>f)&&(r=!1);u?u.push(n):r||(i?n.hide():n.hasClass("awe-nest")&&!n.hasClass("awe-open")||n.show());n.hasClass("awe-collapsed")&&!r?yi(n.next(),t,i,f,u):yi(n.next(),t,i,r,u);break}}function ku(n,t){var r,i;return(t||(t=st.children(kr(n))),r=parseInt(t.data("lvl"),10),!t.length)?[]:(i=[t],yi(t.next(),r,0,0,i),i)}function kf(n,t){return tf(st.children(kr(n)),t)}function tf(t,r){var s=rr(t.data("k")),c=t.hasClass("awe-alt")?1:0,u=o.lreq.slice(0),f,e,h;return u.push({name:"Key",value:s}),r&&(u=u.concat(ai(r))),f=n(a),t.find("td:not(.awe-idn):first").prepend(f),e=parseInt(t.data("lvl"),10),h=ku(s,t),hr(o,u,function(r){var u=w(r,o),l,s,a,f;u!=i&&(o.rsr=1,l=tu(u.dt.gs),(tu(u.dt.it)||l)&&(s=o.th,a=e-o.gl+(u.th-1),o.th=pt(s,a),f=o.th-s,f&&(sf(f),pu(it.find("td:not(.awe-idn):first"),f),n.each(st.children("tr"),function(t,i){pu(n(i).children(":not(.awe-idn):first"),f)})),t.before(ur(u.dt,e-1,0,c,0,0,1))),n.each(h,function(n,t){t.remove()}))},function(){f.remove()})}function vt(i,r){function f(){var f,l,e,s;r&&r();o.ldg=1;f=[];l=[];n.each(b(),function(n,t){t.Gd?f.push(t):t.Sort!=0&&l.push(t)});f.sort(function(n,t){return n.Gk-t.Gk});l.sort(function(n,t){return n.So-t.So});var v=f.concat(l),y=[t,"asc","desc"],u=h(o);for(i&&(o.pg=i),u.push({name:"page",value:o.pg}),u.push({name:"tzo",value:(new Date).getTimezoneOffset()}),e=0;e<v.length;e++)u.push({name:"SortNames",value:v[e].P}),u.push({name:"SortDirections",value:y[v[e].Sort]});for(s=0;s<f.length;s++)u.push({name:"Groups",value:f[s].P}),u.push({name:"Headers",value:f[s].H});return o.sc&&u.push({name:"Cs",value:wt(b())}),c.find(".awe-gblc").html(a),or(o,u),hr(o,u,function(t){var i=w(t,o),r;i&&(o.pg=i.p,o.lrs=i,o.lrso=0,t.cs&&(o.columns=JSON.parse(t.cs),o.rls={}),o.th=i.th,r=i.k,i.a&&r&&(r=br(r)),o.k=et(o.ck,r),ht||(ut={}),n.each(b(),function(n,t){t.px=i.a&&t.P?br(t.P):t.P}),ir=i.gc,o.ldg=0,o.v.trigger("awebfren"),d.buildPager(o),hu(),ti());o.lreq=u;o.lres=t},function(){c.find(".awe-gblc").empty();o.ldg=0;ft(o,o.lres,u)})}var u={load:f};return gu(o,u),u.load?u.load():void 0}function ri(n){return!o.sgc&&n.Gd||n.Hid}var vr=[t,"awe-asc","awe-desc"],lu="<i class='awe-sord'><\/i>",d=function(){},c=n("#"+o.i),gi,iu,ir,ru,ei,ni,fu,ht,ct,er,ar,cu;o.v=c;o.th=0;o.ih=o.h;o.rls={};c.data("o",o);var au=0,ot=c.find(".awe-groupbar"),hi=c.find("colgroup"),g=c.find(".awe-content"),ui=c.find(".awe-gfc"),pr=ui.children().first(),vu=c.find(".awe-tablw"),fi,st=c.find(".awe-tbody"),rf=st.first(),uf=g.find(".awe-tbody"),dt,dr=c.find(".awe-header"),wi=c.find(".awe-hcon"),yu=c.find(".awe-colw"),it=c.find(".awe-hrow"),rt,gt=16,nu,bi={},ut={};if(o.So=100,o.pg=1,gi=n.extend(!0,{},o),iu=o.pk,o.pk=awe.ppk+et(iu,o.i)+o.prs,o.cpk=awe.ppk+"c_"+et(iu,o.i)+o.cps,ir=0,r(c,d),d.ft={},d.update=kf,d.select=ku,d.lay=fr,d.render=hu,d.persist=ti,d.clearpersist=lf,d.getSelection=hf,d.renderRow=function(n,t){o.rsr=1;var i=o.gl+1+o.th;return vi(n,et(t,i),"awe-row",0,0,0,0,0,0,1)},d.getRequest=function(){return o.lreq},d.getResult=function(){return o.lres},d.reset=function(){o.ldg||vt(1,function(){ut={};o.columns=n.extend(!0,[],gi.columns);o.pg=gi.pg;o.So=gi.So;oi(1);c.trigger("aweinit")})},d.load=function(t){function r(){t&&(t.start&&t.start(),t.params&&(o.params=t.params),t.oparams&&(o.oparams=t.oparams),t.group&&n.each(b(),function(n,i){var r=lt(t.group,i.P);r?(i.Gd=1,i.Gk=r):i.Gd=0}),t.sort&&n.each(b(),function(i,r){var f=0,u=0;n.each(t.sort,function(n,t){if(r.P==t.Prop)return u=t,f=n+1,!1});u?(r.Sort=u.Sort,r.So=f):r.Sort=0}));oi(1)}return vt(i,r)},d.buildPager=ef,d.conw=ff,o.api=d,awe.ggmd&&awe.ggmd(o),ru=o.md||awe.gmd,ru&&n.each(ru,function(n,t){t(o)}),ei=i,ni=o.st,vf(),fu=o.fs,ni){c.on(v,yt+ki+fu,cf);function cf(t){var r,f,l,o,h,a;li(t)||cr(t)&&(r=n(this),fu&&(r=r.closest(yt)),f=st.children(),l=1,t.shiftKey&&ei!==i&&ni>=2?(t.ctrlKey||ni!=2||e(f,s),o=f.index(r),h=f.index(ei),o>h&&(o=-(h=(o+=h)-h)+o),(n(t.target).closest(yt).hasClass(s)?e:u)(f.slice(o,h+1),s),ni==3&&(ei=r)):t.ctrlKey&&ni==2||ni==3?(r.toggleClass(s),ei=r):(ei=r,a=!r.hasClass(s),e(f,s),a?u(r,s):l=0),l&&of(),c.trigger("aweselect"))}}ht=wu(o.prs);ct=wu(o.cps);at.resize(fr);c.find(".awe-reload").click(function(){d.reset()});c.on(v,".awe-remb",function(t){var r,i;li(t)||o.ldg||(r=ou(n(this).closest(".awe-col")),r.Gd=0,i=0,n.each(b(),function(n,t){t.So<i&&(i=t.So)}),r.So=i-1,ti(),oi(1),vt())});st.on(v,".awe-ceb",function(t){if(!li(t)&&!n(t.target).closest(".awe-nonceb").length){var i=n(this).closest(".awe-ghead"),r=parseInt(i.data("lvl"),10),f=i.next(),o=i.data("i");i.hasClass("awe-collapsed")?(i.data("l")&&(i.data("l",0),tf(i)),e(i,"awe-collapsed"),yi(f,r,!1),ut[o]=0):(u(i,"awe-collapsed"),yi(f,r,!0),ut[o]=1);ti()}});er=0;c.on(v,".awe-sortable",function(t){function h(){o.p1&&(o.pg=1);r.Sort=f;u(e(c.find("[data-i="+s.data("i")+"]"),"awe-asc awe-desc"),vr[f]);r.Gd||(o.s&&n.each(b(),function(n,t){if(t.Gd||t.P==r.P)return 1;t.Sort=0;e(it.find("[data-i="+n+"]"),"awe-asc awe-desc")}),f==1&&(ou(s).So=++o.So));ti()}if(!li(t)&&!o.ldg){er=0;var s=n(this).closest(".awe-sortable"),r=ou(s),f=r.Sort+1;f==3&&(f=r.Gd?1:0);vt(i,h)}});g.on("scroll",function(){var n=nt(g);tt(wi,n);tt(pr,n)});pr.on("scroll",function(){var n=nt(pr);tt(wi,n);tt(g,n)});if(o.nsts){d.nestClose=function(n,t,i){pi(n,t,1,i)};d.nestOpen=pi;function pi(row,clss,close,forceRem){function closeAll(){ncfg.S&&st.find(".awe-nest.awe-open").each(function(){var t=n(this);r(t).close()})}function showNest(n){bi[row.data("k")]=clss;u(row,clss+"-on");u(n.show(),"awe-open")}for(var el,nests,clnest,fnest,nrapi,cell,ls,st,ncfgs=o.nsts,ncfg=ncfgs[0],key=row.data("model")[o.k],j=0;j<ncfgs.length;j++)el=ncfgs[j],el.C==clss&&(ncfg=el);if(close||row.nextUntil(":not(.awe-nest)",".awe-open:not(.n-"+clss+")").each(function(t,i){pi(row,n(i).data("nest"),1)}),nests=row.nextUntil(":not(.awe-nest)",".n-"+clss),close){nests.length&&(clnest=nests.first(),bi[row.data("k")]=i,e(row,clss+"-on"),ncfg.L&&!forceRem?e(clnest.hide(),"awe-open"):clnest.remove());return}if(nests.length)fnest=nests.first(),fnest.is(":visible")?ncfg.T&&pi(row,clss,1):(closeAll(),showNest(fnest));else{closeAll();var lvl=row.data("lvl"),nestAttr="data-nest='"+clss+"' data-nk='"+bt(key)+"'",nestRow=vi(0,lvl,"awe-nest n-"+clss,0,0,0,"<td colspan='"+uu(lvl,1)+"' class='awe-nestcell'><\/td>",i,i,i,nestAttr);row.after(nestRow);showNest(nestRow);nrapi=function(){};nrapi.close=function(n){var t=d.select(key);t.length&&pi(t[0],clss,1,n)};r(nestRow,nrapi);cell=nestRow.find(".awe-nestcell");ncfg.U?(ls=n(a),st=setTimeout(function(){cell.append(ls)},100),y(o,ncfg.U,{key:key},function(n){cell.html(n)},function(){clearTimeout(st);ls.remove()})):ncfg.F&&eval(ncfg.F)(row,nestRow,cell)}}function df(t){st.on(v,"."+t.C,function(i){if(!li(i)){var r=n(this).closest(yt);d.nestOpen(r,t.C)}})}for(ar=0;ar<o.nsts.length;ar++)df(o.nsts[ar])}it.on("mousemove","td:not(.awe-idn)",function(t){var r=n(t.target).closest("td"),i=r.data("i"),s=r.offset().left,h=r.outerWidth(),u=s-5,e;if((er++,!(er<3))&&(t.pageX>h/2+s?(u+=h,i!=b().length-1||dt||(u-=5),dt&&i--):dt||i--,i>-1&&b()[i].R)){if(!rt){rt=n('<div class="awe-resh"/>').appendTo("body");e=function(t){var i=n(t.target);i.is(rt)||i.closest(".awe-header").length||cu||(l.off("mousemove",e),rt.remove(),rt=0)};l.on("mousemove",e);rt.on("mousedown",function(t){var i,e,y,p;f(t);i=n(this).width(20).data("i");cu=1;var h=hi.find("[data-i="+i+"]"),w=it.find("[data-i="+i+"]"),k=t.pageX,s=0,c=0,r=b()[i].W,u=gt*(o.th+o.gl),a=w.outerWidth(),v=b()[i].Mw;n.each(b(),function(n,t){ri(t)||(u+=t.W||t.Mw,n==i||t.W||(c=1))});e=i?0:o.th*gt;r?r+=e:(r=a,u+=r-(v+o.th*gt));y=wi.width();p=function(t){var tt,w,f,g,nt,it,p;t.pageX<l.width()-10&&rt.css({left:t.pageX-10,top:t.pageY-10});tt=t.pageX;w=tt-k;dt&&(w=w*-1);f=0;c?f=r+w:(g=y-(a+w),nt=u-r,g<nt&&(g=nt),it=nt/g||1,f=(a+w)*it);f<1&&(f=1);p=1;f<v&&(p=v/f,f=f*p);f-=e;h.css("width",f+"px");b()[i].W=f;var d=f,ut=gt*(o.th+o.gl),ft=(u-(ut+(r-e)))*p+f+ut;if(!c&&(p>1||s)&&y>=ft+5)n.each(b(),function(n,t){if(n!=i&&b()[n].R&&!ri(t)&&t.W){s||(t.ciw=t.W);var r=t.ciw*p;hi.find("[data-i="+n+"]").css("width",r+"px");t.W=r;d+=r}}),d+=gt*(o.th+o.gl),s=1,p<=1&&(s=0);else{if(p>1)return;d+=u-(r-e)}vu.css("min-width",d+"px");yu.css("min-width",d+"px");h.trigger("awecolresize")};l.on("mousemove",p);l.one("mouseup",function(){cu=0;l.off("mousemove",p);rt.width(10);ti();h.trigger("awecolresizeend")})})}rt.data("i",i).css({left:u,top:r.offset().top,height:r.outerHeight()})}});af();oi();fr();c.trigger("aweinit");o.l&&vt();kt(o,function(){vt(1)},!o.lpc)},form:function(t){function u(i){function e(){if(t.notok=1,t.ua){var n={url:et(t.u,u.attr("action")),success:function(n){typeof n!="object"&&t.ff?u.html(n):(t.sf&&t.sf(n),u.trigger("aweformsuccess",n));t.notok=0}};ou(t.ufd,u,n);u.trigger("submit");ot(t,n,function(){u.trigger(d)})}else u.data("aweex",1),t.u&&u.attr("action",t.u),u.submit()}var u=n(this);if(!u.data("aweex")&&(f(i),!t.bf||t.bf(u)!==!1)&&!t.notok){if(t.c)return t.p.d=n("<div>"+t.ms+"<\/div>"),t.p.btns=[{text:t.yes,click:function(){e();r(n(this)).close()},k:1},{text:t.no,click:function(){r(n(this)).close()},c:1}],dt(t),r(t.p.d).open(),n(".ui-dialog-buttonset button").blur(),!1;e()}}var i="."+t.cl;n(document).off("submit.awe",i).on("submit.awe",i,u)},autocomplete:function(r){r.v=r.d=n("#"+r.i);var u=r.d,f=i,e=t,o=u.val();r.k&&(f=n("#"+r.k),e=f.val());r.num&&u.keydown(dr(r,u,t,p));u.autocomplete({minLength:r.ml,autoFocus:r.af,source:function(t,i){ot(r,{url:r.url,dataType:"json",data:h(r),success:function(t){i(n.map(t,function(n){return{label:rt(n),value:rt(n),id:g(n)}}))}})}});u.bind("autocompleteselect",function(n,i){f&&(e=i.item?i.item.id:t,f.val(e).trigger(c),o=i.item.value);u.trigger(c)});f&&u.keyup(function(n){n.which!="13"&&u.val()!=o&&(f.val(t),e!=t&&(e=t,f.trigger(c)))})},numeric:function(r){function ut(t){n(t.target).closest(r.f).length||n(":focus").is(f)||(l.off(bi+ki+v,ut),g=0,f.change(),f.val(r.ff(b(0,r.dec,r.v))))}function st(n){var t;if(n.indexOf(h)==-1)return n;for(t=n.length-1;t>0;t--)if(n[t]!="0")break;return n[t]==h&&t--,n.substr(0,t+1)}function ft(n){var t=n.indexOf(fi)+1;return t?n.length-t:0}function et(n,i){var r=n.replace(",",fi);return(r==fi||r==t)&&(r="0"),i?parseFloat(r):r}function b(n,u,e,o,s){var v=(e||f).val(),a,c,l;return!v&&!n?t:(a=et(v),c=parseFloat(a),isNaN(c)&&(c=et(r.v.val(),1)),l=u||pt(ft(a),ft(rt.toString())),o&&l<r.dec&&(l=r.dec),o||r.dec!=i||(l=0),n&&(c+=n),s||(r.min!=i&&(c=pt(c,r.min)),r.max!=i&&(c=nr(c,r.max))),c.toFixed(l).replace(fi,h))}function it(n){nt=1;f.val(b(rt*(n||k))).keyup()}function ht(){d||(c=setInterval(it,50))}function ot(n){if(y!=n&&y)y=t;else if(y=n,d=0,setTimeout(function(){f.is(":focus")||f.focus();it()}),!(a+c)){a=setTimeout(ht,300);l.one("mouseup touchend touchcancel",function(){d=1;clearTimeout(a);clearInterval(c);a=0;c=0;e(r.f.find(".awe-spinbtn"),s);f.is(":focus")||f.focus()})}}var f=r.d,h=r.sep,rt=r.stp,k=1,c,a,d=1,y,w=r.api,g,nt,tt;if(w.foh=p,tt=r.v.val(),w.render=function(){var t=r.v.val(),n;t&&(n=b(0,0,r.v,1,1),f.val(r.ff(n)))},f.keydown(dr(r,f,h,it)),f.keydown(function(n){nt&&n.which==13&&f.change()}),w.dch=function(){var n=b(0,r.dec);n=st(n);r.v.val(n);n!=tt&&(tt=n,o(r));nt=0},w.fih=function(){if(!g){g=1;f.val(r.v.val());l.on(bi+ki+v,ut)}},r.ss){r.f.find(".awe-spinbtn").on("mousedown",function(){u(n(this),s)}).on("mouseup",function(){e(n(this),s)});r.f.find(".awe-spinup").on(ri,function(n){k=1;ot(n.type)});r.f.find(".awe-spindown").on(ri,function(n){k=-1;ot(n.type)})}},chk:function(n){b(n);n.d.change(function(){n.v.val(n.d.is(":checked")).change()})},txt:function(n){b(n);var t=it(n),i=n.d;n.ff=n.ff||function(n){return n};t.foh=function(){t.render()};t.fih=function(){i.val(n.v.val())};t.dch=function(){n.v.val(i.val());o(n)};n.d.on(bi,function(n){t.fih(n)}).on(lu,function(n){t.foh(n)}).on(c,function(n){t.dch(n)}).on("keyup",function(){n.v.val(n.d.val())}).on("keydown keyup",function(t){n.v.trigger(t)});t.render=function(){i.val(n.ff(n.v.val()))};n.num&&awe.numeric(n);t.render()},tmp:function(n){b(n);n.d.change(function(){var i=n.d.eq(0).val()+n.s+n.d.eq(1).val()+" "+(n.d.eq(2).val()||t);n.v.val(i)})},dpw:function(t){var u=t.p,r=t.v,s;if(u.onClose=function(){fu(r)},t.rtl&&u.isRTL==i&&(u.isRTL=1),u.ilc){s=t.f.find(".awe-ilc");function h(){var n="ui-state-active",t=r.val();s.datepicker("setDate",t);t||e(s.find("."+n),n)}u.onSelect=function(){var i=s.datepicker("getDate");r.val(n.datepicker.formatDate(u.dateFormat,i));o(t)};r.change(h);s.datepicker(u);h()}else u.onSelect=function(){o(t);t.f.find(".awe-dpbtn").focus()},r.datepicker(u),t.f.find(".awe-dpbtn").click(function(n){f(n);r.attr(wi,wi);r.datepicker("show");r.removeAttr(wi)}).keydown(function(n){n.which==9&&!n.shiftKey&&r.datepicker("widget").is(":visible")?(f(n),$("#ui-datepicker-div :tabbable:first").focus()):(n.target=r[0],r.trigger(n))})},dtp:function(n){b(n);var i=n.v;it(n);awe.dpw(n);n.f.find(".awe-clearbtn").click(function(n){f(n);i.val(t).change()});vi(n);n.v.change(function(){vi(n)})},ajaxList:function(t){function i(n){return n||(n=1),yi(t,[],n,1)}t.v=n("#"+t.i);t.srl=t.tl?t.v.find(".awe-srl"):t.v;t.mode="s";it(t,i);i();kt(t,function(){i(1)},!t.lpc)},checkboxList:function(t){function r(){return n(t.d.find("input:checked")).map(function(){return n(this).val()}).get()}function u(n){function f(f){var e=w(f,t),h,s;t.lrs=e;h=ct(t.v);e&&(er(t,e),i.render());s=r();t.v.val(hi(s));nu(s,h)?n&&t.v.trigger(st,n):o(t,n);ft(t,f,u)}var u=h(t);return fr(t,u,f)}b(t);var i=it(t,u);i.render=function(){ru(t,"checkbox")};t.md&&t.md(t);ur(t,u);t.v.on(c,function(n,t){t&&t.i||i.render()});t.d.on(c,"input:checkbox",function(n){t.v.val(hi(r()));o(t,{i:1});n.stopPropagation()})},radioList:function(n){function r(){var i=t,r=n.d.find("input:checked");return r.length&&(i=r.val()),i}function u(t){function f(f){var s=w(f,n),e;s&&er(n,s);n.lrs&&i.render();e=r();n.v.val()!=e?(n.v.val(e),o(n,t)):t&&n.v.trigger(st,t);ft(n,f,u)}var u=h(n);return fr(n,u,f)}b(n);n.nm="item"+n.i;var i=it(n,u);i.render=function(){ru(n,"radio")};n.md&&n.md(n);ur(n,u);n.v.on(c,function(n,t){t&&t.i||i.render()});n.d.on(c,"input:radio",function(t){n.v.val(r());o(n,{i:1});t.stopPropagation()})},lookup:function(i){function gt(){return ht(l.find(yr).data("val"))}function ti(n){i.v.val(n);o(i);i.ms=0;r(l).close()}function pt(){var o,h,f;if(ct=0,l=oi(),u(l,"awe-lookup-popup"),et=l.find(".awe-scon"),i.p.d=l,l.data("o",i),l.bind("aweresize",st),l.bind("aweclose",function(){i.ms&&e(l.find(".awe-li"),s);i.ms=0;i.f.find(".awe-openbtn").focus()}),o=i.tl?"<table class='awe-ajaxlist awe-lookup-list awe-selectable'><thead><\/thead><tbody class='awe-srl'><\/tbody><\/table>":"<ul class='awe-ajaxlist awe-lookup-list awe-srl awe-selectable'><\/ul>",h=i.pu?t:"<div class='awe-search'><\/div><div class='awe-list awe-srlcont'>"+o+"<\/div>",et.html(h),i.p.btns=[{text:i.ok,click:nt.ok,k:1},{text:i.cancel,click:function(){r(n(this)).close()},c:1}],dt(i),i.fm=0,i.soc=1,!i.pu){i.srl=l.find(".awe-srl");f=".awe-li:not(.awe-morecont)";i.srl.on(v,f,function(t){var r=n(this);cr(t)&&(r.toggleClass(s),e(l.find(".awe-li").not(r),s),i.ms=1)}).on("dblclick",f,function(t){cr(t)&&(u(n(this),s),i.ms=0,nt.ok())})}i.v.trigger("awepopupinit");r(l).lay=bt}function wt(n){if(i.d.html(at),vi(i),i.v.val()){ot=1;i.d.prepend(a);var r=h(i);y(i,i.getUrl,r,function(f){i.d.html(at);var e=t,s=w(f,i);s&&(i.d.html(k(lt,[rt(s)])),e=rr(g(s)),i.hi&&n!=1&&u(i.d,ui).removeClass(ui,1e3));i.v.val()!=e&&(i.v.val(e),o(i,1));ot=0;ft(i,f,r)},function(){ot=0})}}function tt(){n.when(yi(i,i.fm.find(gi).serializeArray(),1,0)).done(function(){i.soc=0})}function st(){nt.lay()}function bt(){if(i.p.isOpen){var t=ni(l)+l.find(".awe-search:first").outerHeight()+ni(l.find(".awe-list")),n=(i.avh||l.height())-t;n<i.p.mlh&&(n=i.p.mlh);l.find(".awe-list").height(n);l.trigger("awelay")}}var l,et,ot,ct,lt,at,nt,yt;b(i);i.soc=1;i.mode="s";i.p.af=1;lt='<div class="awe-caption">{0}<\/div>';at=k(lt,[ii]);kt(i,function(){i.soc=1});nt=it(i);nt.initPopup=pt;nt.search=tt;nt.gsval=gt;nt.sval=ti;nt.ok=function(){nt.sval(nt.gsval())};nt.lay=bt;nt.pinit=p;yt=i.md||awe.lmd;yt&&yt(i);wt(1);i.v.change(function(n,t){t||wt()});pt();i.f.find(".awe-clearbtn").click(function(n){f(n);i.v.val(t);o(i);i.soc=1});i.f.find(".awe-openbtn").click(function(t){var u,e;if(f(t),!ot){if(i.p.isOpen){r(l).close();return}i.pu||i.fm||(i.fm=l.find(".awe-search"),i.fm.on(c,"*",st).submit(function(n){f(n);n.stopPropagation();tt()}));r(l).open(t);i.soc&&(u=h(i),i.pu?ct&&nt.rload?nt.rload():(e=n(a),et.html(e),l.trigger(vt,[u]),y(i,i.pu,u,function(n){et.html(n);nt.pinit();ut(i);ct=1;i.soc=0},function(){e.remove();l.trigger(d)})):i.fm.html()?tt():(i.sf?y(i,i.sf,u,function(n){i.fm.html(n);tt();st();ut(i)}):(i.fm.html(k(pr,[i.st,i.stp])),tt()),uu.call(this,i,tt)));st();ut(i)}})},add:function(i){function f(n){function r(r){i.d.empty();var f=w(r,i);f&&(er(i,f),i.lrs&&u(i));i.v.val()!=i.d.val()?(i.v.val(i.d.val()),o(i,n)):n&&i.v.trigger(st,n);ft(i,r,t)}var t=h(i);return fr(i,t,r)}b(i);var e=it(i,f),u=function(i){i.d.empty();var r=ct(i.v);n.each(i.lrs,function(n,u){var e=iu(u,r),f=t;e&&(f="selected = 'selected'");i.d.append("<option "+f+' value="'+g(u)+'">'+rt(u)+"<\/option>")})};e.render=u;ur(i,f);i.v.on(c,function(){r(i.v).render(i)});i.d.keyup(function(){n(this).change()}).change(function(){i.v.val()!=i.d.val()&&(i.v.val(i.d.val()),o(i))})},readd:function(n,t){return typeof n!="object"?(awe.err(t,{responseText:n}),i):(typeof n=="object"||typeof n=="string")&&n!=i?n:i},ic:function(n){ei[n.i]=n},oc:function(t,i){var u=ei[t+"-aweic"],r;if(!u)throw t+" not initialized";return r=n.extend(!0,{},u),n.extend(!0,r,i),r.u?ot(r,{data:h(r),url:r.u,cache:!1,success:function(n){r.sf&&r.sf(n)}}):void 0},ip:function(t){t.f=n("#"+t.i+"-awein");t.rtl=si(t.f);ei[t.i]=t},open:function(t,i,r){var f=ei[t],u=n.extend(!0,{},f);if(n.extend(!0,u,i),u.type=="op")awe.op(r,u);else if(u.type=="pf")awe.pf(r,u);else throw t+" not initialized";},ff:function(n){n.p.d.find(":tabbable:first").focus()},pf:function(t,i){function s(n){o.html(n);ut(i);i.ol&&i.ol.call(i)}var u,o,e,c,l;f(t);u=oi();o=u.find(".awe-scon");u.on("submit","form",function(t){if((f(t),!t.awesh)&&(t.awesh=1,!i.notok)){i.notok=1;var e=n(this),h=e.attr("method"),o={url:e.attr("action"),success:function(n){if(typeof n=="object"){i.sf&&i.sf(n,u);var t=r(u);t&&(t.success=!0,u.trigger("awepopupformsuccess",n),i.cs&&t.close(),i.rs&&location.reload(!0))}else s(n)},type:h};ou(i.ufd,e,o);ot(i,o,function(){i.notok=0;u.trigger(d)})}});e=[];n.each(i.b,function(_,btn){btn.click=eval(btn.sf);e.push(btn)});i.udb&&(e=e.concat([{text:i.ot,click:function(){u.find("form:first").submit()},k:1},{text:i.ct,click:function(){r(u).close()},c:1}]));i.p.d=u;i.p.btns=e;dt(i);r(u).open(t);i.c?s(i.c):i.u&&(c=h(i),l=n(a),o.html(l),u.trigger(vt,[c]),ot(i,{type:"get",data:c,url:i.u,cache:!1,success:function(n){s(n)}},function(){l.remove();u.trigger(d)}))},op:function(t,i){var s,c,l;f(t);var e=n("#"+i.p.i),u=oi(),o=u.find(".awe-scon"),v=i.ol;e.length&&i.lo&&r(e).ld?r(e).open(t):(s=[],n.each(i.b,function(_,btn){btn.click=eval(btn.sf);s.push(btn)}),i.p.d=u,i.p.btns=s,dt(i),r(u).open(t),i.c?(o.html(i.c),r(u).ld=1):i.u&&(c=n(a),o.append(c),l=h(i),u.trigger(vt,[l]),ot(i,{type:"get",data:l,url:i.u,cache:!1,success:function(n){o.html(n);r(u).ld=1;v&&v.call(i)}},function(){c.remove();u.trigger(d)})))},autoSize:1,popup:function(){},multilookup:function(i){function at(){return i.sel.find(".awe-li").map(function(){return n(this).data("val")}).get()}function fi(n){i.v.val(hi(n));yt(n);o(i);i.ms=0;r(e).close()}function yt(t){l.empty();n.each(t,function(n,t){l.append(k(vu,[ht,ku(t)]))})}function pt(){var f;st=0;e=oi();u(e,"awe-multilookup-popup");tt=e.find(".awe-scon");i.p.d=e;e.data("o",i);e.bind("aweresize",ot);e.bind("aweclose",function(){i.ms&&(i.soc=1);i.ms=0;i.f.find(".awe-openbtn").focus()});var h=i.tl?"<table class='awe-ajaxlist awe-lookup-list'><thead><\/thead><tbody class='awe-srl'><\/tbody><\/table>":"<ul class='awe-ajaxlist awe-lookup-list awe-srl'><\/ul>",c=i.tl?"<table class='awe-ajaxlist awe-lookup-list'><thead><\/thead><tbody class='awe-sel'><\/tbody><\/table>":"<ul class='awe-ajaxlist awe-lookup-list awe-sel'><\/ul>",l=i.pu?t:"<div class='awe-search'><\/div><div class='awe-econt'><div class='awe-list awe-srlcont'>"+h+"<\/div><div class='awe-list awe-selcont' >"+c+"<\/div><\/div>";if(tt.html(l),i.p.btns=[{text:i.ok,click:s.ok,k:1},{text:i.cancel,click:function(){r(n(this)).close()},c:1}],dt(i),i.fm=0,i.soc=1,!i.pu){i.srl=e.find(".awe-srl");i.sel=e.find(".awe-sel");i.srl.on(v,".awe-movebtn",wt);i.sel.on(v,".awe-movebtn",bt);if(f=[i.srl.closest(".awe-list"),i.sel.closest(".awe-list")],i.dg){function a(n){wt.call(n)}function y(n){bt.call(n)}function o(n){return function(t,i){var r=i.pageX-n.offset().left;return t&&(n.width()-r<70||r<70)}}ci(i.srl,".awe-li:not(.awe-morecont)",f,[p,a],"awe-srl",1,0,0,0,0,0,0,o(i.srl));ci(i.sel,".awe-li",f,[y,p],"awe-sel",1,0,0,0,0,0,0,o(i.sel))}}i.v.trigger("awepopupinit");r(e).lay=ti}function wt(){n(this).closest(".awe-li").prependTo(i.sel);i.ms=1}function bt(){n(this).closest(".awe-li").prependTo(i.srl);i.ms=1}function ot(){s.lay()}function ei(){var n,r;i.sel.html(t);eu(i.tl,i.sel);n=h(i,i);n=n.concat(li(i.v,"selected"));i.tl&&(r=i.srl.closest("table").find("thead:first").html()?!1:!0,n=n.concat({name:"isTheadEmpty",value:r}));y(i,i.selectedUrl,n,function(n){i.sel.empty();var t=w(n,i);t&&(hu(i,t.d,i.sel),i.loaded=1)})}function nt(){var t=i.fm.find(gi).serializeArray(),r;r=i.loaded?yi(i,gt(at(),"selected").concat(t)):yi(i,li(i.v,"selected").concat(t));n.when(r).done(function(){i.soc=1})}function ti(){if(i.p.isOpen){var t=ni(e)+e.find(".awe-search:first").outerHeight()+ni(e.find(".awe-srlcont"))+ni(e.find(".awe-selcont")),n=(i.avh||e.height())-t;n<i.p.mlh&&(n=i.p.mlh);e.find(".awe-list").height(n*.5);e.trigger("awelay")}}function ri(r){var b="<li>"+ii+"<\/li>",f=i.d,k=f.outerHeight(),v,p,e,s,c;f.html(b);v=i.v.val();p=ct(i.v);vi(i);v?(e=[],et=1,s=n(a),i.f.prepend(s),f.css("min-height",k),c=h(i),y(i,i.getMultipleUrl,c,function(t){var s=w(t,i);s&&(f.empty(),n.each(s,function(n,t){f.append("<li>"+rt(t)+"<\/li>");e.push(rr(g(t)))}),i.hi&&!r&&u(f,ui).removeClass(ui,1e3),f.trigger("aweresize"));yt(e);i.v.val(hi(e));nu(e,p)||o(i,1);et=0;ft(i,t,c)},function(){s.remove();et=0;f.css("min-height",t)})):l.empty().append("<input type='checkbox' name='"+ht+"' />")}var e,tt,et,st,l,ht,s,lt;b(i);i.soc=1;i.p.af=1;l=i.v.next();ht=i.nm;kt(i,function(){i.soc=1});s=it(i);s.initPopup=pt;s.lay=ti;s.gsval=at;s.sval=fi;s.pinit=p;s.ok=function(){s.sval(s.gsval())};lt=i.md||awe.lmd;lt&&lt(i);ri(1);i.v.on(c,function(n,t){i.soc=1;t||ri()});pt();i.f.find(".awe-clearbtn").click(function(n){f(n);l.empty();i.v.val(t);o(i);i.soc=1});i.f.find(".awe-openbtn").click(function(t){var u,o;if(f(t),!et){if(i.p.isOpen){r(e).close();return}i.pu||i.fm||(i.fm=e.find(".awe-search"),i.fm.on(c,"*",ot).submit(function(n){f(n);n.stopPropagation();nt()}));r(e).open(t);i.soc&&(u=h(i),i.loaded=0,i.pu?st&&s.rload?s.rload():(o=n(a),tt.html(o),e.trigger(vt,[u]),y(i,i.pu,u,function(n){tt.html(n);s.pinit();ut(i);st=1;i.soc=0},function(){o.remove();e.trigger(d)})):(i.fm.html()?nt():(i.sf?y(i,i.sf,u,function(n){i.fm.html(n);nt();ot();ut(i)}):(i.fm.html(k(pr,[i.st,i.stp])),nt()),uu.call(this,i,nt)),ei()));ot();ut(i)}})},tabs:function(t){var i=n("#"+t.i),f=i.find(".awe-tabsbar"),o=i.find(".awe-tabscontent").children(),r="awe-active",s=t.md||awe.tmd;s&&n.each(s,function(n,i){i(t)});o.each(function(t,i){var h=n(i),c="awe-tab-btn",s;t?h.hide():c+=" "+r;s=$('<button type="button" class="'+c+'">'+h.data("caption")+"<\/button>");s.click(function(){e(f.children(),r);u(s,r);o.hide();h.show()});f.append(s)});i.trigger("awerender")}}}()