compass-jquery-plugin 0.2.5.2 → 0.2.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,424 +1,424 @@
1
- (function(a){a.jgrid=a.jgrid||{};a.extend(a.jgrid,{htmlDecode:function(d){if(d=="&nbsp;"||d=="&#160;"||d.length==1&&d.charCodeAt(0)==160)return"";return!d?d:String(d).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(d){return!d?d:String(d).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(d){var e=a.makeArray(arguments).slice(1);if(d===undefined)d="";return d.replace(/\{(\d+)\}/g,function(b,
2
- f){return e[f]})},getCellIndex:function(d){d=a(d);d=(!d.is("td")&&!d.is("th")?d.closest("td,th"):d)[0];if(a.browser.msie)return a.inArray(d,d.parentNode.cells);return d.cellIndex},stripHtml:function(d){d+="";var e=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(d)return(d=d.replace(e,""))&&d!=="&nbsp;"&&d!=="&#160;"?d:"";else return d},stringToDoc:function(d){var e;if(typeof d!=="string")return d;try{e=(new DOMParser).parseFromString(d,"text/xml")}catch(b){e=new ActiveXObject("Microsoft.XMLDOM");e.async=false;
3
- e.loadXML(d)}return e&&e.documentElement&&e.documentElement.tagName!="parsererror"?e:null},parse:function(d){d=d;if(d.substr(0,9)=="while(1);")d=d.substr(9);if(d.substr(0,2)=="/*")d=d.substr(2,d.length-4);d||(d="{}");d=a.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(d):eval("("+d+")");return d.hasOwnProperty("d")?d.d:d},empty:function(){for(;this.firstChild;)this.removeChild(this.firstChild)},jqID:function(d){d+="";return d.replace(/([\.\:\[\]])/g,"\\$1")},
4
- ajaxOptions:{},extend:function(d){a.extend(a.fn.jqGrid,d);this.no_legacy_api||a.fn.extend(d)}});a.fn.jqGrid=function(d){if(typeof d=="string"){var e=a.fn.jqGrid[d];if(!e)throw"jqGrid - No such method: "+d;var b=a.makeArray(arguments).slice(1);return e.apply(this,b)}return this.each(function(){if(!this.grid){var f=a.extend(true,{url:"",height:150,page:1,rowNum:20,records:0,pager:"",pgbuttons:true,pginput:true,colModel:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",
5
- altRows:false,selarrrow:[],savedRow:[],shrinkToFit:true,xmlReader:{},jsonReader:{},subGrid:false,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,onHeaderClick:null,viewrecords:false,loadonce:false,multiselect:false,multikey:false,editurl:null,search:false,
6
- caption:"",hidegrid:true,hiddengrid:false,postData:{},userData:{},treeGrid:false,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del"},forceFit:false,gridstate:"visible",cellEdit:false,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[false,""],scroll:false,multiboxonly:false,deselectAfterSort:true,scrollrows:false,autowidth:false,
7
- scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:false,rownumWidth:25,rownumbers:false,pagerpos:"center",recordpos:"right",footerrow:false,userDataOnFooter:false,hoverrows:true,altclass:"ui-priority-secondary",viewsortcols:[false,"vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false},a.jgrid.defaults,d||{}),g={headers:[],cols:[],footers:[],dragStart:function(o,s,t){this.resizing={idx:o,startX:s.clientX,sOL:t[0]};
8
- this.hDiv.style.cursor="col-resize";this.curGbox=a("#rs_m"+f.id,"#gbox_"+f.id);this.curGbox.css({display:"block",left:t[0],top:t[1],height:t[2]});a.isFunction(f.resizeStart)&&f.resizeStart.call(this,s,o);document.onselectstart=new Function("return false")},dragMove:function(o){if(this.resizing){var s=o.clientX-this.resizing.startX;o=this.headers[this.resizing.idx];var t=f.direction==="ltr"?o.width+s:o.width-s,A;if(t>33){this.curGbox.css({left:this.resizing.sOL+s});if(f.forceFit===true){A=this.headers[this.resizing.idx+
9
- f.nv];s=f.direction==="ltr"?A.width-s:A.width+s;if(s>33){o.newWidth=t;A.newWidth=s}}else{this.newWidth=f.direction==="ltr"?f.tblwidth+s:f.tblwidth-s;o.newWidth=t}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var o=this.resizing.idx,s=this.headers[o].newWidth||this.headers[o].width;s=parseInt(s,10);this.resizing=false;a("#rs_m"+f.id).css("display","none");f.colModel[o].width=s;this.headers[o].width=s;this.headers[o].el.style.width=s+"px";if(this.cols.length>0)this.cols[o].style.width=
10
- s+"px";if(this.footers.length>0)this.footers[o].style.width=s+"px";if(f.forceFit===true){s=this.headers[o+f.nv].newWidth||this.headers[o+f.nv].width;this.headers[o+f.nv].width=s;this.headers[o+f.nv].el.style.width=s+"px";if(this.cols.length>0)this.cols[o+f.nv].style.width=s+"px";if(this.footers.length>0)this.footers[o+f.nv].style.width=s+"px";f.colModel[o+f.nv].width=s}else{f.tblwidth=this.newWidth||f.tblwidth;a("table:first",this.bDiv).css("width",f.tblwidth+"px");a("table:first",this.hDiv).css("width",
11
- f.tblwidth+"px");this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(f.footerrow){a("table:first",this.sDiv).css("width",f.tblwidth+"px");this.sDiv.scrollLeft=this.bDiv.scrollLeft}}a.isFunction(f.resizeStop)&&f.resizeStop.call(this,s,o)}this.curGbox=null;document.onselectstart=new Function("return true")},populateVisible:function(){g.timer&&clearTimeout(g.timer);g.timer=null;var o=a(g.bDiv).height();if(o){var s=a("table:first",g.bDiv),t=a("> tbody > tr:visible:first",s).outerHeight()||g.prevRowHeight;if(t){g.prevRowHeight=
12
- t;var A=f.rowNum,D=g.scrollTop=g.bDiv.scrollTop,N=Math.round(s.position().top)-D,I=N+s.height();t=t*A;var P,J,H;if(N<=0&&I<o&&(f.lastpage==null||parseInt((I+D+t-1)/t,10)<f.lastpage)){J=parseInt((o-I+t-1)/t,10);if(I>=0||J<2||f.scroll===true){P=Math.round((I+D)/t)+1;N=-1}else N=1}if(N>0){P=parseInt(D/t,10)+1;J=parseInt((D+o)/t,10)+2-P;H=true}if(J)if(!(f.lastpage&&P>f.lastpage))if(g.hDiv.loading)g.timer=setTimeout(g.populateVisible,200);else{f.page=P;if(H){g.selectionPreserver(s[0]);g.emptyRows(g.bDiv)}g.populate(J)}}}},
13
- scrollGrid:function(){if(f.scroll){var o=g.bDiv.scrollTop;if(o!=g.scrollTop){g.scrollTop=o;g.timer&&clearTimeout(g.timer);g.timer=setTimeout(g.populateVisible,200)}}g.hDiv.scrollLeft=g.bDiv.scrollLeft;if(f.footerrow)g.sDiv.scrollLeft=g.bDiv.scrollLeft},selectionPreserver:function(o){var s=o.p,t=s.selrow,A=s.selarrrow?a.makeArray(s.selarrrow):null,D=o.grid.bDiv.scrollLeft,N=s.gridComplete;s.gridComplete=function(){s.selrow=null;s.selarrrow=[];if(s.multiselect&&A&&A.length>0)for(var I=0;I<A.length;I++)A[I]!=
14
- t&&a(o).jqGrid("setSelection",A[I],false);t&&a(o).jqGrid("setSelection",t,false);o.grid.bDiv.scrollLeft=D;if(s.gridComplete=N)N()}}};this.p=f;var h,j,c;if(this.p.colNames.length===0)for(h=0;h<this.p.colModel.length;h++)this.p.colNames[h]=this.p.colModel[h].label||this.p.colModel[h].name;if(this.p.colNames.length!==this.p.colModel.length)alert(a.jgrid.errors.model);else{var l=a("<div class='ui-jqgrid-view'></div>"),k,n=a.browser.msie?true:false,m=a.browser.safari?true:false;c=this;c.p.direction=a.trim(c.p.direction.toLowerCase());
15
- if(a.inArray(c.p.direction,["ltr","rtl"])==-1)c.p.direction="ltr";j=c.p.direction;a(l).insertBefore(this);a(this).appendTo(l).removeClass("scroll");var p=a("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");a(p).insertBefore(l).attr({id:"gbox_"+this.id,dir:j});a(l).appendTo(p).attr("id","gview_"+this.id);k=n&&a.browser.version<=6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"";a("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+
16
- this.id+"'></div>").append(k).insertBefore(l);a("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(l);a(this).attr({cellSpacing:"0",cellPadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var r=function(o,s){o=parseInt(o,10);return isNaN(o)?s?s:0:o},q=function(o,s){var t=c.p.colModel[o].align,A='style="',D=c.p.colModel[o].classes;if(t)A+="text-align:"+t+";";if(c.p.colModel[o].hidden===
17
- true)A+="display:none;";if(s===0)A+="width: "+g.headers[o].width+"px;";return A+'"'+(D!==undefined?' class="'+D+'"':"")},u=function(o,s,t,A,D){o=v(o,s,t,D,"add");return'<td role="gridcell" '+q(t,A)+' title="'+a.jgrid.stripHtml(o)+'">'+o+"</td>"},v=function(o,s,t,A,D){t=c.p.colModel[t];if(typeof t.formatter!=="undefined"){o={rowId:o,colModel:t,gid:c.p.id};s=a.isFunction(t.formatter)?t.formatter.call(c,s,o,A,D):a.fmatter?a.fn.fmatter(t.formatter,s,o,A,D):w(s)}else s=w(s);return s},w=function(o){return o===
18
- undefined||o===null||o===""?"&#160;":c.p.autoencode?a.jgrid.htmlEncode(o):o+""},z=function(o,s,t){o='<input type="checkbox" id="jqg_'+o+'" class="cbox" name="jqg_'+o+'"/>';return"<td role='gridcell' "+q(s,t)+">"+o+"</td>"},B=function(o,s,t,A){t=(parseInt(t,10)-1)*parseInt(A,10)+1+s;return'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+q(o,s)+">"+t+"</td>"},C=function(o){var s,t=[],A=0,D;for(D=0;D<c.p.colModel.length;D++){s=c.p.colModel[D];if(s.name!=="cb"&&s.name!=="subgrid"&&s.name!==
19
- "rn"){t[A]=o=="xml"?s.xmlmap||s.name:s.jsonmap||s.name;A++}}return t},y=function(o){var s=c.p.remapColumns;if(!s||!s.length)s=a.map(c.p.colModel,function(t,A){return A});if(o)s=a.map(s,function(t){return t<o?null:t-o});return s},F=function(o,s){var t=a("tbody:first",o);if(!c.p.gridview||c.p.jqgdnd)a("*",t).children().unbind();if(n)a.jgrid.empty.apply(t[0]);else t[0].innerHTML="";if(s&&c.p.scroll){a(">div:first",o).css({height:"auto"}).children("div:first").css({height:0,display:"none"});o.scrollTop=
20
- 0}},x=function(o,s){var t,A;t=o[s];if(t===undefined){if(typeof s==="string")A=s.split(".");if(A.length)for(t=o;t&&A.length;){o=A.shift();t=t[o]}}return t},M=function(o,s,t,A,D){var N=new Date;c.p.reccount=0;if(a.isXMLDoc(o)){if(c.p.treeANode===-1&&!c.p.scroll){F(s);t=0}else t=t>0?t:0;var I,P=0,J,H,O=0,X=0,ca=0,ha,pa,na=[],ra,ja={},Da=c.rows.length,ia,Aa,fa=[],ua=0,Ea=c.p.altRows===true?" "+c.p.altclass:"";c.p.xmlReader.repeatitems||(na=C("xml"));ha=c.p.keyIndex===false?c.p.xmlReader.id:c.p.keyIndex;
21
- if(na.length>0&&!isNaN(ha)){if(c.p.remapColumns&&c.p.remapColumns.length)ha=a.inArray(ha,c.p.remapColumns);ha=na[ha]}pa=(ha+"").indexOf("[")===-1?na.length?function(Ba,ya){return a(ha,Ba).text()||ya}:function(Ba,ya){return a(c.p.xmlReader.cell,Ba).eq(ha).text()||ya}:function(Ba,ya){return Ba.getAttribute(ha.replace(/[\[\]]/g,""))||ya};a(c.p.xmlReader.page,o).each(function(){c.p.page=this.textContent||this.text||1});a(c.p.xmlReader.total,o).each(function(){c.p.lastpage=this.textContent||this.text;
22
- if(c.p.lastpage===undefined)c.p.lastpage=1});a(c.p.xmlReader.records,o).each(function(){c.p.records=this.textContent||this.text||0});a(c.p.xmlReader.userdata,o).each(function(){c.p.userData[this.getAttribute("name")]=this.textContent||this.text});o=a(c.p.xmlReader.root+" "+c.p.xmlReader.row,o);var Fa=o.length,qa=0;if(o&&Fa){var Ha=parseInt(c.p.rowNum,10),Ja=c.p.scroll?(parseInt(c.p.page,10)-1)*Ha+1:1;if(D)Ha*=D+1;for(D=a.isFunction(c.p.afterInsertRow);qa<Fa;){ia=o[qa];Aa=pa(ia,Ja+qa);I=t==0?0:t+1;
23
- I=(I+qa)%2==1?Ea:"";fa[ua++]='<tr id="'+Aa+'" role="row" class ="ui-widget-content jqgrow ui-row-'+c.p.direction+""+I+'">';if(c.p.rownumbers===true){fa[ua++]=B(0,qa,c.p.page,c.p.rowNum);ca=1}if(c.p.multiselect===true){fa[ua++]=z(Aa,ca,qa);O=1}if(c.p.subGrid===true){fa[ua++]=a(c).jqGrid("addSubGridCell",O+ca,qa+t);X=1}if(c.p.xmlReader.repeatitems){ra||(ra=y(O+X+ca));var Ka=a(c.p.xmlReader.cell,ia);a.each(ra,function(Ba){var ya=Ka[this];if(!ya)return false;J=ya.textContent||ya.text;ja[c.p.colModel[Ba+
24
- O+X+ca].name]=J;fa[ua++]=u(Aa,J,Ba+O+X+ca,qa+t,ia)})}else for(I=0;I<na.length;I++){J=a(na[I],ia).text();ja[c.p.colModel[I+O+X+ca].name]=J;fa[ua++]=u(Aa,J,I+O+X+ca,qa+t,ia)}fa[ua++]="</tr>";if(c.p.gridview===false){if(c.p.treeGrid===true){I=c.p.treeANode>=-1?c.p.treeANode:0;H=a(fa.join(""))[0];try{a(c).jqGrid("setTreeNode",ja,H)}catch(La){}Da===0?a("tbody:first",s).append(H):a(c.rows[qa+I+t]).after(H)}else a("tbody:first",s).append(fa.join(""));if(c.p.subGrid===true)try{a(c).jqGrid("addSubGrid",c.rows[c.rows.length-
25
- 1],O+ca)}catch(Ma){}D&&c.p.afterInsertRow.call(c,Aa,ja,ia);fa=[];ua=0}ja={};P++;qa++;if(P==Ha)break}}c.p.gridview===true&&a("tbody:first",s).append(fa.join(""));c.p.totaltime=new Date-N;if(P>0){c.grid.cols=c.rows[0].cells;if(c.p.records===0)c.p.records=Fa}fa=null;if(!c.p.treeGrid&&!c.p.scroll)c.grid.bDiv.scrollTop=0;c.p.reccount=P;c.p.treeANode=-1;c.p.userDataOnFooter&&a(c).jqGrid("footerData","set",c.p.userData,true);A||da(false,true)}},Y=function(o,s,t,A,D){var N=new Date;c.p.reccount=0;if(o){if(c.p.treeANode===
26
- -1&&!c.p.scroll){F(s);t=0}else t=t>0?t:0;var I=0,P,J,H,O=[],X,ca=0,ha=0,pa=0,na,ra,ja,Da={},ia,Aa=c.rows.length,fa;H=[];ia=0;var ua=c.p.altRows===true?" "+c.p.altclass:"";c.p.page=x(o,c.p.jsonReader.page)||1;ja=x(o,c.p.jsonReader.total);c.p.lastpage=ja===undefined?1:ja;c.p.records=x(o,c.p.jsonReader.records)||0;c.p.userData=x(o,c.p.jsonReader.userdata)||{};c.p.jsonReader.repeatitems||(X=O=C("json"));ja=c.p.keyIndex===false?c.p.jsonReader.id:c.p.keyIndex;if(O.length>0&&!isNaN(ja)){if(c.p.remapColumns&&
27
- c.p.remapColumns.length)ja=a.inArray(ja,c.p.remapColumns);ja=O[ja]}if(ra=x(o,c.p.jsonReader.root)){na=ra.length;o=0;var Ea=parseInt(c.p.rowNum,10),Fa=c.p.scroll?(parseInt(c.p.page,10)-1)*Ea+1:1;if(D)Ea*=D+1;for(var qa=a.isFunction(c.p.afterInsertRow);o<na;){D=ra[o];fa=D[ja];if(fa===undefined){fa=Fa+o;if(O.length===0)if(c.p.jsonReader.cell)fa=D[c.p.jsonReader.cell][ja]||fa}P=t==0?0:t+1;P=(P+o)%2==1?ua:"";H[ia++]='<tr id="'+fa+'" role="row" class= "ui-widget-content jqgrow ui-row-'+c.p.direction+""+
28
- P+'">';if(c.p.rownumbers===true){H[ia++]=B(0,o,c.p.page,c.p.rowNum);pa=1}if(c.p.multiselect){H[ia++]=z(fa,pa,o);ca=1}if(c.p.subGrid){H[ia++]=a(c).jqGrid("addSubGridCell",ca+pa,o+t);ha=1}if(c.p.jsonReader.repeatitems){if(c.p.jsonReader.cell)D=x(D,c.p.jsonReader.cell);X||(X=y(ca+ha+pa))}for(J=0;J<X.length;J++){P=x(D,X[J]);H[ia++]=u(fa,P,J+ca+ha+pa,o+t,D);Da[c.p.colModel[J+ca+ha+pa].name]=P}H[ia++]="</tr>";if(c.p.gridview===false){if(c.p.treeGrid===true){ia=c.p.treeANode>=-1?c.p.treeANode:0;H=a(H.join(""))[0];
29
- try{a(c).jqGrid("setTreeNode",Da,H)}catch(Ha){}Aa===0?a("tbody:first",s).append(H):a(c.rows[o+ia+t]).after(H)}else a("tbody:first",s).append(H.join(""));if(c.p.subGrid===true)try{a(c).jqGrid("addSubGrid",c.rows[c.rows.length-1],ca+pa)}catch(Ja){}qa&&c.p.afterInsertRow.call(c,fa,Da,D);H=[];ia=0}Da={};I++;o++;if(I==Ea)break}c.p.gridview===true&&a("tbody:first",s).append(H.join(""));c.p.totaltime=new Date-N;if(I>0){c.grid.cols=c.rows[0].cells;if(c.p.records===0)c.p.records=na}}if(!c.p.treeGrid&&!c.p.scroll)c.grid.bDiv.scrollTop=
30
- 0;c.p.reccount=I;c.p.treeANode=-1;c.p.userDataOnFooter&&a(c).jqGrid("footerData","set",c.p.userData,true);A||da(false,true)}},da=function(o,s){var t,A,D,N,I,P,J,H="";D=(parseInt(c.p.page,10)-1)*parseInt(c.p.rowNum,10);I=D+c.p.reccount;if(c.p.scroll){t=a("tbody:first > tr",c.grid.bDiv);D=I-t.length;if(A=t.outerHeight()){t=D*A;A=parseInt(c.p.records,10)*A;a(">div:first",c.grid.bDiv).css({height:A}).children("div:first").css({height:t,display:t?"":"none"})}}H=c.p.pager?c.p.pager:"";H+=c.p.toppager?H?
31
- ","+c.p.toppager:c.p.toppager:"";if(H){J=a.jgrid.formatter.integer||{};if(c.p.loadonce){t=A=1;c.p.lastpage=c.page=1;a(".selbox",H).attr("disabled",true)}else{t=r(c.p.page,1);A=r(c.p.lastpage,1);a(".selbox",H).attr("disabled",false)}if(c.p.pginput===true){a(".ui-pg-input",H).val(c.p.page);a("#sp_1",H).html(a.fmatter?a.fmatter.util.NumberFormat(c.p.lastpage,J):c.p.lastpage)}if(c.p.viewrecords)if(c.p.reccount===0)a(".ui-paging-info",H).html(c.p.emptyrecords);else{N=D+1;P=c.p.records;if(a.fmatter){N=
32
- a.fmatter.util.NumberFormat(N,J);I=a.fmatter.util.NumberFormat(I,J);P=a.fmatter.util.NumberFormat(P,J)}a(".ui-paging-info",H).html(a.jgrid.format(c.p.recordtext,N,I,P))}if(c.p.pgbuttons===true){if(t<=0)t=A=1;if(t==1){a("#first, #prev",c.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");c.p.toppager&&a("#first_t, #prev_t",c.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#first, #prev",c.p.pager).removeClass("ui-state-disabled");c.p.toppager&&a("#first_t, #prev_t",
33
- c.p.toppager).removeClass("ui-state-disabled")}if(t==A){a("#next, #last",c.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");c.p.toppager&&a("#next_t, #last_t",c.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#next, #last",c.p.pager).removeClass("ui-state-disabled");c.p.toppager&&a("#next_t, #last_t",c.p.toppager).removeClass("ui-state-disabled")}}}o===true&&c.p.rownumbers===true&&a("td.jqgrid-rownum",c.rows).each(function(O){a(this).html(D+1+O)});
34
- s&&c.p.jqgdnd&&a(c).jqGrid("gridDnD","updateDnD");a.isFunction(c.p.gridComplete)&&c.p.gridComplete.call(c)},Q=function(o){if(!c.grid.hDiv.loading){var s=c.p.scroll&&o==false,t={},A,D=c.p.prmNames;if(D.search!==null)t[D.search]=c.p.search;if(D.nd!=null)t[D.nd]=(new Date).getTime();if(D.rows!==null)t[D.rows]=c.p.rowNum;if(D.page!==null)t[D.page]=c.p.page;if(D.sort!==null)t[D.sort]=c.p.sortname;if(D.order!==null)t[D.order]=c.p.sortorder;var N=c.p.loadComplete,I=a.isFunction(N);I||(N=null);var P=0;o=
35
- o||1;if(o>1)if(D.npage!=null){t[D.npage]=o;P=o-1;o=1}else N=function(H){I&&c.p.loadComplete.call(c,H);c.grid.hDiv.loading=false;c.p.page++;Q(o-1)};else D.npage!=null&&delete c.p.postData[D.npage];a.extend(c.p.postData,t);var J=!c.p.scroll?0:c.rows.length-1;if(a.isFunction(c.p.datatype))c.p.datatype.call(c,c.p.postData,"load_"+c.p.id);else{a.isFunction(c.p.beforeRequest)&&c.p.beforeRequest.call(c);A=c.p.datatype.toLowerCase();switch(A){case "json":case "jsonp":case "xml":case "script":a.ajax(a.extend({url:c.p.url,
36
- type:c.p.mtype,dataType:A,data:a.isFunction(c.p.serializeGridData)?c.p.serializeGridData.call(c,c.p.postData):c.p.postData,complete:function(H,O){if(O=="success"||H.statusText=="OK"&&H.status=="200"){A==="xml"?M(H.responseXML,c.grid.bDiv,J,o>1,P):Y(a.jgrid.parse(H.responseText),c.grid.bDiv,J,o>1,P);N&&N.call(c,H);s&&c.grid.populateVisible()}U()},error:function(H,O,X){a.isFunction(c.p.loadError)&&c.p.loadError.call(c,H,O,X);U()},beforeSend:function(H){ea();a.isFunction(c.p.loadBeforeSend)&&c.p.loadBeforeSend.call(c,
37
- H)}},a.jgrid.ajaxOptions,c.p.ajaxGridOptions));if(c.p.loadonce||c.p.treeGrid)c.p.datatype="local";break;case "xmlstring":ea();t=a.jgrid.stringToDoc(c.p.datastr);I&&c.p.loadComplete.call(c,t);M(t,c.grid.bDiv);c.p.datatype="local";c.p.datastr=null;U();break;case "jsonstring":ea();t=typeof c.p.datastr=="string"?a.jgrid.parse(c.p.datastr):c.p.datastr;I&&c.p.loadComplete.call(c,t);Y(t,c.grid.bDiv);c.p.datatype="local";c.p.datastr=null;U();break;case "local":case "clientside":ea();c.p.datatype="local";
38
- I&&c.p.loadComplete.call(c,"");ga();da(true,true);U();break}}}},ea=function(){c.grid.hDiv.loading=true;if(!c.p.hiddengrid)switch(c.p.loadui){case "disable":break;case "enable":a("#load_"+c.p.id).show();break;case "block":a("#lui_"+c.p.id).show();a("#load_"+c.p.id).show();break}},U=function(){c.grid.hDiv.loading=false;switch(c.p.loadui){case "disable":break;case "enable":a("#load_"+c.p.id).hide();break;case "block":a("#lui_"+c.p.id).hide();a("#load_"+c.p.id).hide();break}},ga=function(){var o=/[\$,%]/g,
39
- s=[],t=0,A,D,N,I=c.p.sortorder=="asc"?1:-1;a.each(c.p.colModel,function(J){if(this.index==c.p.sortname||this.name==c.p.sortname){t=c.p.lastsort=J;A=this.sorttype;return false}});N=A=="float"||A=="number"||A=="currency"?function(J){J=parseFloat(J.replace(o,""));return isNaN(J)?0:J}:A=="int"||A=="integer"?function(J){return r(J.replace(o,""),0)}:A=="date"||A=="datetime"?function(J){return sa(c.p.colModel[t].datefmt||"Y-m-d",J).getTime()}:function(J){return a.trim(J.toUpperCase())};a.each(c.rows,function(J,
40
- H){try{D=a.unformat(a(H).children("td").eq(t),{rowId:H.id,colModel:c.p.colModel[t]},t,true)}catch(O){D=a(H).children("td").eq(t).text()}H.sortKey=N(D);s[J]=this});if(c.p.treeGrid)a(c).jqGrid("SortTree",I);else{s.sort(function(J,H){if(J.sortKey<H.sortKey)return-I;if(J.sortKey>H.sortKey)return I;return 0});if(s[0]){a("td",s[0]).each(function(J){a(this).css("width",g.headers[J].width+"px")});c.grid.cols=s[0].cells}var P="";if(c.p.altRows)P=c.p.altclass;a.each(s,function(J,H){if(P)J%2==1?a(H).addClass(P):
41
- a(H).removeClass(P);a("tbody",c.grid.bDiv).append(H);H.sortKey=null})}c.grid.bDiv.scrollTop=0},sa=function(o,s){var t={m:1,d:1,y:1970,h:0,i:0,s:0},A,D,N;s=s.split(/[\\\/:_;.\t\T\s-]/);o=o.split(/[\\\/:_;.\t\T\s-]/);var I=a.jgrid.formatter.date.monthNames;A=0;for(D=o.length;A<D;A++){if(o[A]=="M"){N=a.inArray(s[A],I);if(N!==-1&&N<12)s[A]=N+1}if(o[A]=="F"){N=a.inArray(s[A],I);if(N!==-1&&N>11)s[A]=N+1-12}t[o[A].toLowerCase()]=parseInt(s[A],10)}t.m=parseInt(t.m,10)-1;o=t.y;if(o>=70&&o<=99)t.y=1900+t.y;
42
- else if(o>=0&&o<=69)t.y=2E3+t.y;return new Date(t.y,t.m,t.d,t.h,t.i,t.s,0)};k=function(o,s){var t="",A="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",D="",N,I,P,J,H=function(O){c.p.selrow=null;if(c.p.multiselect){c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}c.p.savedRow=[];if(a.isFunction(c.p.onPaging))if(c.p.onPaging.call(c,O)=="stop")return false;return true};o=o.substr(1);N="pg_"+o;I=o+"_left";
43
- P=o+"_center";J=o+"_right";a("#"+o).append("<div id='"+N+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;' role='row'><tbody><tr><td id='"+I+"' align='left'></td><td id='"+P+"' align='center' style='white-space:pre;'></td><td id='"+J+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(c.p.rowList.length>0){D="<td dir='"+j+"'>";D+="<select class='ui-pg-selbox' role='listbox'>";for(I=
44
- 0;I<c.p.rowList.length;I++)D+="<option role='option' value='"+c.p.rowList[I]+"'"+(c.p.rowNum==c.p.rowList[I]?" selected":"")+">"+c.p.rowList[I]+"</option>";D+="</select></td>"}if(j=="rtl")A+=D;if(c.p.pginput===true)t="<td dir='"+j+"'>"+a.jgrid.format(c.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1'></span>")+"</td>";if(c.p.pgbuttons===true){I=["first"+s,"prev"+s,"next"+s,"last"+s];j=="rtl"&&I.reverse();A+="<td id='"+I[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";
45
- A+="<td id='"+I[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";A+=t!=""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+t+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":"";A+="<td id='"+I[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";A+="<td id='"+I[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else if(t!=
46
- "")A+=t;if(j=="ltr")A+=D;A+="</tr></tbody></table>";c.p.viewrecords===true&&a("td#"+o+"_"+c.p.recordpos,"#"+N).append("<div dir='"+j+"' style='text-align:"+c.p.recordpos+"' class='ui-paging-info'></div>");a("td#"+o+"_"+c.p.pagerpos,"#"+N).append(A);D=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+D+";visibility:hidden;' ></div>");A=a(A).clone().appendTo("#testpg").width();a("#testpg").remove();if(A>0){if(t!=
47
- "")A+=50;a("td#"+o+"_"+c.p.pagerpos,"#"+N).width(A)}c.p._nvtd=[];c.p._nvtd[0]=A?Math.floor((c.p.width-A)/2):Math.floor(c.p.width/3);c.p._nvtd[1]=0;A=null;a(".ui-pg-selbox","#"+N).bind("change",function(){c.p.page=Math.round(c.p.rowNum*(c.p.page-1)/this.value-0.5)+1;c.p.rowNum=this.value;if(s)a(".ui-pg-selbox",c.p.pager).val(this.value);else c.p.toppager&&a(".ui-pg-selbox",c.p.toppager).val(this.value);if(!H("records"))return false;Q();return false});if(c.p.pgbuttons===true){a(".ui-pg-button","#"+
48
- N).hover(function(){if(a(this).hasClass("ui-state-disabled"))this.style.cursor="default";else{a(this).addClass("ui-state-hover");this.style.cursor="pointer"}},function(){if(!a(this).hasClass("ui-state-disabled")){a(this).removeClass("ui-state-hover");this.style.cursor="default"}});a("#first"+s+", #prev"+s+", #next"+s+", #last"+s,"#"+o).click(function(){var O=r(c.p.page,1),X=r(c.p.lastpage,1),ca=false,ha=true,pa=true,na=true,ra=true;if(X===0||X===1)ra=na=pa=ha=false;else if(X>1&&O>=1)if(O===1)pa=ha=
49
- false;else{if(!(O>1&&O<X))if(O===X)ra=na=false}else if(X>1&&O===0){ra=na=false;O=X-1}if(this.id==="first"+s&&ha){c.p.page=1;ca=true}if(this.id==="prev"+s&&pa){c.p.page=O-1;ca=true}if(this.id==="next"+s&&na){c.p.page=O+1;ca=true}if(this.id==="last"+s&&ra){c.p.page=X;ca=true}if(ca){if(!H(this.id))return false;Q()}return false})}c.p.pginput===true&&a("input.ui-pg-input","#"+N).keypress(function(O){if((O.charCode?O.charCode:O.keyCode?O.keyCode:0)==13){c.p.page=a(this).val()>0?a(this).val():c.p.page;if(!H("user"))return false;
50
- Q();return false}return this})};var za=function(o,s,t,A){if(c.p.colModel[s].sortable)if(!(c.p.savedRow.length>0)){if(!t){if(c.p.lastsort==s)if(c.p.sortorder=="asc")c.p.sortorder="desc";else{if(c.p.sortorder=="desc")c.p.sortorder="asc"}else c.p.sortorder="asc";c.p.page=1}if(A)if(c.p.lastsort==s&&c.p.sortorder==A)return;else c.p.sortorder=A;t=a("thead:first",c.grid.hDiv).get(0);a("tr th:eq("+c.p.lastsort+") span.ui-grid-ico-sort",t).addClass("ui-state-disabled");a("tr th:eq("+c.p.lastsort+")",t).attr("aria-selected",
51
- "false");a("tr th:eq("+s+") span.ui-icon-"+c.p.sortorder,t).removeClass("ui-state-disabled");a("tr th:eq("+s+")",t).attr("aria-selected","true");if(!c.p.viewsortcols[0])if(c.p.lastsort!=s){a("tr th:eq("+c.p.lastsort+") span.s-ico",t).hide();a("tr th:eq("+s+") span.s-ico",t).show()}c.p.lastsort=s;o=o.substring(5);c.p.sortname=c.p.colModel[s].index||o;t=c.p.sortorder;if(a.isFunction(c.p.onSortCol))if(c.p.onSortCol.call(c,o,s,t)=="stop")return;if(c.p.datatype=="local")c.p.deselectAfterSort&&a(c).jqGrid("resetSelection");
52
- else{c.p.selrow=null;c.p.multiselect&&a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false);c.p.selarrrow=[];c.p.savedRow=[];c.p.scroll&&F(c.grid.bDiv,true)}c.p.subGrid&&c.p.datatype=="local"&&a("td.sgexpanded","#"+c.p.id).each(function(){a(this).trigger("click")});Q();if(c.p.sortname!=o&&s)c.p.lastsort=s}},Ca=function(o){var s=o,t;for(t=o+1;t<c.p.colModel.length;t++)if(c.p.colModel[t].hidden!==true){s=t;break}return s-o},va=function(o){var s,t={},A=m?0:c.p.cellLayout;for(s=t[0]=t[1]=t[2]=
53
- 0;s<=o;s++)if(c.p.colModel[s].hidden===false)t[0]+=c.p.colModel[s].width+A;if(c.p.direction=="rtl")t[0]=c.p.width-t[0];t[0]-=c.grid.bDiv.scrollLeft;if(a(c.grid.cDiv).is(":visible"))t[1]+=a(c.grid.cDiv).height()+parseInt(a(c.grid.cDiv).css("padding-top"),10)+parseInt(a(c.grid.cDiv).css("padding-bottom"),10);if(c.p.toolbar[0]==true&&(c.p.toolbar[1]=="top"||c.p.toolbar[1]=="both"))t[1]+=a(c.grid.uDiv).height()+parseInt(a(c.grid.uDiv).css("border-top-width"),10)+parseInt(a(c.grid.uDiv).css("border-bottom-width"),
54
- 10);if(c.p.toppager)t[1]+=a(c.grid.topDiv).height()+parseInt(a(c.grid.topDiv).css("border-bottom-width"),10);t[2]+=a(c.grid.bDiv).height()+a(c.grid.hDiv).height();return t};this.p.id=this.id;if(a.inArray(c.p.multikey,["shiftKey","altKey","ctrlKey"])==-1)c.p.multikey=false;c.p.keyIndex=false;for(h=0;h<c.p.colModel.length;h++)if(c.p.colModel[h].key===true){c.p.keyIndex=h;break}c.p.sortorder=c.p.sortorder.toLowerCase();if(this.p.treeGrid===true)try{a(this).jqGrid("setTreeGrid")}catch(Ga){}if(this.p.subGrid)try{a(c).jqGrid("setSubGrid")}catch(E){}if(this.p.multiselect){this.p.colNames.unshift("<input id='cb_"+
55
- this.p.id+"' class='cbox' type='checkbox'/>");this.p.colModel.unshift({name:"cb",width:m?c.p.multiselectWidth+c.p.cellLayout:c.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}if(this.p.rownumbers){this.p.colNames.unshift("");this.p.colModel.unshift({name:"rn",width:c.p.rownumWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}c.p.xmlReader=a.extend(true,{root:"rows",row:"row",page:"rows>page",total:"rows>total",
56
- records:"rows>records",repeatitems:true,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:true,cell:"cell"}},c.p.xmlReader);c.p.jsonReader=a.extend(true,{root:"rows",page:"page",total:"total",records:"records",repeatitems:true,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:true,cell:"cell"}},c.p.jsonReader);if(c.p.scroll){c.p.pgbuttons=false;c.p.pginput=false;c.p.rowList=[]}var G="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",V,
57
- L,W,R,S,T,K,ba;L=ba="";if(c.p.shrinkToFit===true&&c.p.forceFit===true)for(h=c.p.colModel.length-1;h>=0;h--)if(!c.p.colModel[h].hidden){c.p.colModel[h].resizable=false;break}if(c.p.viewsortcols[1]=="horizontal"){ba=" ui-i-asc";L=" ui-i-desc"}V=n?"class='ui-th-div-ie'":"";ba="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+ba+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+j+"'></span>";ba+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+
58
- L+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+j+"'></span></span>";for(h=0;h<this.p.colNames.length;h++){G+="<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+j+"'>";L=c.p.colModel[h].index||c.p.colModel[h].name;G+="<div id='jqgh_"+c.p.colModel[h].name+"' "+V+">"+c.p.colNames[h];if(L==c.p.sortname)c.p.lastsort=h;G+=ba+"</div></th>"}G+="</tr></thead>";a(this).append(G);a("thead tr:first th",this).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
59
- if(this.p.multiselect){var Z=true,ka=[],aa;if(typeof c.p.onSelectAll!=="function")Z=false;a("#cb_"+a.jgrid.jqID(c.p.id),this).bind("click",function(){if(this.checked){a("[id^=jqg_]",c.rows).attr("checked",true);a(c.rows).each(function(o){if(!a(this).hasClass("subgrid")){a(this).addClass("ui-state-highlight").attr("aria-selected","true");c.p.selarrrow[o]=c.p.selrow=this.id}});aa=true;ka=[]}else{a("[id^=jqg_]",c.rows).attr("checked",false);a(c.rows).each(function(o){if(!a(this).hasClass("subgrid")){a(this).removeClass("ui-state-highlight").attr("aria-selected",
60
- "false");ka[o]=this.id}});c.p.selarrrow=[];c.p.selrow=null;aa=false}if(Z)c.p.onSelectAll.call(c,aa?c.p.selarrrow:ka,aa)})}a.each(c.p.colModel,function(){if(!this.width)this.width=150;this.width=parseInt(this.width,10)});if(c.p.autowidth===true){G=a(p).innerWidth();c.p.width=G>0?G:"nw"}(function(){var o=0,s=c.p.cellLayout,t=0,A,D=c.p.scrollOffset,N,I=false,P,J=0,H=0,O=0,X;if(m)s=0;a.each(c.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){o+=r(this.width,
61
- 0);if(this.fixed){J+=this.width;H+=this.width+s}else t++;O++}});if(isNaN(c.p.width))c.p.width=g.width=o;else g.width=c.p.width;c.p.tblwidth=o;if(c.p.shrinkToFit===false&&c.p.forceFit===true)c.p.forceFit=false;if(c.p.shrinkToFit===true&&t>0){P=g.width-s*t-H;if(!isNaN(c.p.height)){P-=D;I=true}o=0;a.each(c.p.colModel,function(ca){if(this.hidden===false&&!this.fixed){this.width=N=Math.floor(P/(c.p.tblwidth-J)*this.width);o+=N;A=ca}});X=0;if(I){if(g.width-H-(o+s*t)!==D)X=g.width-H-(o+s*t)-D}else if(!I&&
62
- Math.abs(g.width-H-(o+s*t))!==1)X=g.width-H-(o+s*t);c.p.colModel[A].width+=X;c.p.tblwidth=o+X+J+O*s}})();a(p).css("width",g.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+c.p.id+"'>&#160;</div>");a(l).css("width",g.width+"px");G=a("thead:first",c).get(0);var wa="<table role='grid' style='width:"+c.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+j+"'>";l=a("tr:first",G);c.p.disableClick=
63
- false;a("th",l).each(function(o){a("div",this);W=c.p.colModel[o].width;if(typeof c.p.colModel[o].resizable==="undefined")c.p.colModel[o].resizable=true;if(c.p.colModel[o].resizable){R=document.createElement("span");a(R).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+j);!a.browser.opera&&a(R).css("cursor","col-resize");a(this).addClass(c.p.resizeclass)}else R="";a(this).css("width",W+"px").prepend(R);c.p.colModel[o].hidden&&a(this).css("display","none");g.headers[o]={width:W,el:this};
64
- S=c.p.colModel[o].sortable;if(typeof S!=="boolean")S=c.p.colModel[o].sortable=true;var s=c.p.colModel[o].name;s=="cb"||s=="subgrid"||s=="rn"||c.p.viewsortcols[2]&&a("div",this).addClass("ui-jqgrid-sortable");if(S)if(c.p.viewsortcols[0]){a("div span.s-ico",this).show();o==c.p.lastsort&&a("div span.ui-icon-"+c.p.sortorder,this).removeClass("ui-state-disabled")}else if(o==c.p.lastsort){a("div span.s-ico",this).show();a("div span.ui-icon-"+c.p.sortorder,this).removeClass("ui-state-disabled")}wa+="<td role='gridcell' "+
65
- q(o,0)+">&#160;</td>"}).mousedown(function(o){if(a(o.target).closest("th>span.ui-jqgrid-resize").length==1){var s=a.jgrid.getCellIndex(this);if(c.p.forceFit===true)c.p.nv=Ca(s);g.dragStart(s,o,va(s));return false}}).click(function(o){if(c.p.disableClick)return c.p.disableClick=false;var s="th>div.ui-jqgrid-sortable",t,A;c.p.viewsortcols[2]||(s="th>div>span>span.ui-grid-ico-sort");o=a(o.target).closest(s);if(o.length==1){s=a.jgrid.getCellIndex(this);if(!c.p.viewsortcols[2]){t=true;A=o.attr("sort")}za(a("div",
66
- this)[0].id,s,t,A);return false}});if(c.p.sortable&&a.fn.sortable)try{a(c).jqGrid("sortableColumns",l)}catch(ta){}wa+="</tr></tbody></table>";this.appendChild(document.createElement("tbody"));a(this).addClass("ui-jqgrid-btable");l=a("<table class='ui-jqgrid-htable' style='width:"+c.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(G);var la=c.p.caption&&c.p.hiddengrid===true?true:false;G=a("<div class='ui-jqgrid-hbox"+(j=="rtl"?
67
- "-rtl":"")+"'></div>");g.hDiv=document.createElement("div");a(g.hDiv).css({width:g.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(G);a(G).append(l);la&&a(g.hDiv).hide();if(c.p.pager){if(typeof c.p.pager=="string"){if(c.p.pager.substr(0,1)!="#")c.p.pager="#"+c.p.pager}else c.p.pager="#"+a(c.p.pager).attr("id");a(c.p.pager).css({width:g.width+"px"}).appendTo(p).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom");la&&a(c.p.pager).hide();k(c.p.pager,"")}c.p.cellEdit===false&&
68
- c.p.hoverrows===true&&a(c).bind("mouseover",function(o){K=a(o.target).closest("tr.jqgrow");a(K).attr("class")!=="subgrid"&&a(K).addClass("ui-state-hover");return false}).bind("mouseout",function(o){K=a(o.target).closest("tr.jqgrow");a(K).removeClass("ui-state-hover");return false});var ma,oa;a(c).before(g.hDiv).click(function(o){T=o.target;var s=a(T).hasClass("cbox");K=a(T,c.rows).closest("tr.jqgrow");if(a(K).length===0)return this;var t=true;if(a.isFunction(c.p.beforeSelectRow))t=c.p.beforeSelectRow.call(c,
69
- K[0].id,o);if(T.tagName=="A"||(T.tagName=="INPUT"||T.tagName=="TEXTAREA"||T.tagName=="OPTION"||T.tagName=="SELECT")&&!s)return true;if(t===true){if(c.p.cellEdit===true)if(c.p.multiselect&&s)a(c).jqGrid("setSelection",K[0].id,true);else{ma=K[0].rowIndex;oa=a.jgrid.getCellIndex(T);try{a(c).jqGrid("editCell",ma,oa,true)}catch(A){}}else if(c.p.multikey)if(o[c.p.multikey])a(c).jqGrid("setSelection",K[0].id,true);else{if(c.p.multiselect&&s){s=a("[id^=jqg_]",K).attr("checked");a("[id^=jqg_]",K).attr("checked",
70
- !s)}}else{if(c.p.multiselect&&c.p.multiboxonly)if(!s){a(c.p.selarrrow).each(function(D,N){D=c.rows.namedItem(N);a(D).removeClass("ui-state-highlight");a("#jqg_"+a.jgrid.jqID(N),D).attr("checked",false)});c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}a(c).jqGrid("setSelection",K[0].id,true)}if(a.isFunction(c.p.onCellSelect)){ma=K[0].id;oa=a.jgrid.getCellIndex(T);c.p.onCellSelect.call(c,ma,oa,a(T).html(),o)}}o.stopPropagation()}).bind("reloadGrid",function(o,s){if(c.p.treeGrid===
71
- true)c.p.datatype=c.p.treedatatype;s&&s.current&&c.grid.selectionPreserver(c);if(c.p.datatype=="local")a(c).jqGrid("resetSelection");else if(!c.p.treeGrid){c.p.selrow=null;if(c.p.multiselect){c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}c.p.savedRow=[];c.p.scroll&&F(c.grid.bDiv)}if(s&&s.page){o=s.page;if(o>c.p.lastpage)o=c.p.lastpage;if(o<1)o=1;c.p.page=o;c.grid.bDiv.scrollTop=c.grid.prevRowHeight?(o-1)*c.grid.prevRowHeight*c.p.rowNum:0}if(c.grid.prevRowHeight&&
72
- c.p.scroll){delete c.p.lastpage;c.grid.populateVisible()}else c.grid.populate();return false});a.isFunction(this.p.ondblClickRow)&&a(this).dblclick(function(o){T=o.target;K=a(T,c.rows).closest("tr.jqgrow");if(a(K).length===0)return false;ma=K[0].rowIndex;oa=a.jgrid.getCellIndex(T);c.p.ondblClickRow.call(c,a(K).attr("id"),ma,oa,o);return false});a.isFunction(this.p.onRightClickRow)&&a(this).bind("contextmenu",function(o){T=o.target;K=a(T,c.rows).closest("tr.jqgrow");if(a(K).length===0)return false;
73
- c.p.multiselect||a(c).jqGrid("setSelection",K[0].id,true);ma=K[0].rowIndex;oa=a.jgrid.getCellIndex(T);c.p.onRightClickRow.call(c,a(K).attr("id"),ma,oa,o);return false});g.bDiv=document.createElement("div");a(g.bDiv).append(a('<div style="position:relative;'+(n&&a.browser.version<8?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:c.p.height+(isNaN(c.p.height)?"":"px"),width:g.width+"px"}).scroll(g.scrollGrid);a("table:first",g.bDiv).css({width:c.p.tblwidth+
74
- "px"});if(n){a("tbody",this).size()==2&&a("tbody:first",this).remove();c.p.multikey&&a(g.bDiv).bind("selectstart",function(){return false})}else c.p.multikey&&a(g.bDiv).bind("mousedown",function(){return false});la&&a(g.bDiv).hide();g.cDiv=document.createElement("div");var Ia=c.p.hidegrid===true?a("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){Ia.addClass("ui-state-hover")},function(){Ia.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css(j==
75
- "rtl"?"left":"right","0px"):"";a(g.cDiv).append(Ia).append("<span class='ui-jqgrid-title"+(j=="rtl"?"-rtl":"")+"'>"+c.p.caption+"</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");a(g.cDiv).insertBefore(g.hDiv);if(c.p.toolbar[0]){g.uDiv=document.createElement("div");if(c.p.toolbar[1]=="top")a(g.uDiv).insertBefore(g.hDiv);else c.p.toolbar[1]=="bottom"&&a(g.uDiv).insertAfter(g.hDiv);if(c.p.toolbar[1]=="both"){g.ubDiv=document.createElement("div");a(g.uDiv).insertBefore(g.hDiv).addClass("ui-userdata ui-state-default").attr("id",
76
- "t_"+this.id);a(g.ubDiv).insertAfter(g.hDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id);la&&a(g.ubDiv).hide()}else a(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);la&&a(g.uDiv).hide()}if(c.p.toppager){c.p.toppager=c.p.id+"_toppager";g.topDiv=a("<div id='"+c.p.toppager+"'></div>")[0];c.p.toppager="#"+c.p.toppager;a(g.topDiv).insertBefore(g.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width);k(c.p.toppager,"_t")}if(c.p.footerrow){g.sDiv=
77
- a("<div class='ui-jqgrid-sdiv'></div>")[0];G=a("<div class='ui-jqgrid-hbox"+(j=="rtl"?"-rtl":"")+"'></div>");a(g.sDiv).append(G).insertAfter(g.hDiv).width(g.width);a(G).append(wa);g.footers=a(".ui-jqgrid-ftable",g.sDiv)[0].rows[0].cells;if(c.p.rownumbers)g.footers[0].className="ui-state-default jqgrid-rownum";la&&a(g.sDiv).hide()}if(c.p.caption){var xa=c.p.datatype;if(c.p.hidegrid===true){a(".ui-jqgrid-titlebar-close",g.cDiv).click(function(o){var s=a.isFunction(c.p.onHeaderClick);if(c.p.gridstate==
78
- "visible"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+c.p.id).slideUp("fast");c.p.pager&&a(c.p.pager).slideUp("fast");c.p.toppager&&a(c.p.toppager).slideUp("fast");if(c.p.toolbar[0]===true){c.p.toolbar[1]=="both"&&a(g.ubDiv).slideUp("fast");a(g.uDiv).slideUp("fast")}c.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+c.p.id).slideUp("fast");a("span",this).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");c.p.gridstate="hidden";if(s)la||c.p.onHeaderClick.call(c,c.p.gridstate,
79
- o)}else if(c.p.gridstate=="hidden"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+c.p.id).slideDown("fast");c.p.pager&&a(c.p.pager).slideDown("fast");c.p.toppager&&a(c.p.toppager).slideDown("fast");if(c.p.toolbar[0]===true){c.p.toolbar[1]=="both"&&a(g.ubDiv).slideDown("fast");a(g.uDiv).slideDown("fast")}c.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+c.p.id).slideDown("fast");a("span",this).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(la){c.p.datatype=xa;Q();la=false}c.p.gridstate=
80
- "visible";s&&c.p.onHeaderClick.call(c,c.p.gridstate,o)}return false});if(la){c.p.datatype="local";a(".ui-jqgrid-titlebar-close",g.cDiv).trigger("click")}}}else a(g.cDiv).hide();a(g.hDiv).after(g.bDiv).mousemove(function(o){if(g.resizing){g.dragMove(o);return false}});a(".ui-jqgrid-labels",g.hDiv).bind("selectstart",function(){return false});a(document).mouseup(function(){if(g.resizing){g.dragEnd();return false}return true});this.updateColumns=function(){var o=this.rows[0],s=this;if(o){a("td",o).each(function(t){a(this).css("width",
81
- s.grid.headers[t].width+"px")});this.grid.cols=o.cells}return this};c.formatCol=q;c.sortData=za;c.updatepager=da;c.formatter=function(o,s,t,A,D){return v(o,s,t,A,D)};a.extend(g,{populate:Q,emptyRows:F});this.grid=g;c.addXmlData=function(o){M(o,c.grid.bDiv)};c.addJSONData=function(o){Y(o,c.grid.bDiv)};Q();c.p.hiddengrid=false;a(window).unload(function(){a(this).empty();this.p=this.grid=null})}}})};a.jgrid.extend({getGridParam:function(d){var e=this[0];if(e.grid)return d?typeof e.p[d]!="undefined"?
82
- e.p[d]:null:e.p},setGridParam:function(d){return this.each(function(){this.grid&&typeof d==="object"&&a.extend(true,this.p,d)})},getDataIDs:function(){var d=[],e=0,b;this.each(function(){if((b=this.rows.length)&&b>0)for(;e<b;){d[e]=this.rows[e].id;e++}});return d},setSelection:function(d,e){return this.each(function(){function b(c,l){var k=a(f.grid.bDiv)[0].clientHeight,n=a(f.grid.bDiv)[0].scrollTop,m=f.rows[c].offsetTop+f.rows[c].clientHeight;c=f.rows[c].offsetTop;if(l=="d")if(m>=k)a(f.grid.bDiv)[0].scrollTop=
83
- n+m-c;if(l=="u")if(c<n)a(f.grid.bDiv)[0].scrollTop=n-m+c}var f=this,g,h,j;if(d!==undefined){e=e===false?false:true;h=f.rows.namedItem(d+"");if(h!==null){if(f.p.selrow&&f.p.scrollrows===true){g=f.rows.namedItem(f.p.selrow).rowIndex;j=f.rows.namedItem(d).rowIndex;if(j>=0)j>g?b(j,"d"):b(j,"u")}if(f.p.multiselect){f.p.selrow=h.id;j=a.inArray(f.p.selrow,f.p.selarrrow);if(j===-1){h.className!=="ui-subgrid"&&a(h).addClass("ui-state-highlight").attr("aria-selected","true");g=true;a("#jqg_"+a.jgrid.jqID(f.p.selrow),
84
- f.rows[h.rowIndex]).attr("checked",g);f.p.selarrrow.push(f.p.selrow);f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,f.p.selrow,g)}else{h.className!=="ui-subgrid"&&a(h).removeClass("ui-state-highlight").attr("aria-selected","false");g=false;a("#jqg_"+a.jgrid.jqID(f.p.selrow),f.rows[h.rowIndex]).attr("checked",g);f.p.selarrrow.splice(j,1);f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,f.p.selrow,g);h=f.p.selarrrow[0];f.p.selrow=h===undefined?null:h}}else if(h.className!=="ui-subgrid"){f.p.selrow&&a("tr#"+a.jgrid.jqID(f.p.selrow),
85
- f.grid.bDiv).removeClass("ui-state-highlight").attr("aria-selected","false");f.p.selrow=h.id;a(h).addClass("ui-state-highlight").attr("aria-selected","true");f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,f.p.selrow,true)}}}})},resetSelection:function(){return this.each(function(){var d=this,e;if(d.p.multiselect){a(d.p.selarrrow).each(function(b,f){e=d.rows.namedItem(f);a(e).removeClass("ui-state-highlight").attr("aria-selected","false");a("#jqg_"+a.jgrid.jqID(f),e).attr("checked",false)});a("#cb_"+a.jgrid.jqID(d.p.id),
86
- d.grid.hDiv).attr("checked",false);d.p.selarrrow=[]}else if(d.p.selrow){a("tr#"+a.jgrid.jqID(d.p.selrow),d.grid.bDiv).removeClass("ui-state-highlight").attr("aria-selected","false");d.p.selrow=null}d.p.savedRow=[]})},getRowData:function(d){var e={},b,f=false,g,h=0;this.each(function(){var j=this,c,l;if(typeof d=="undefined"){f=true;b=[];g=j.rows.length}else{l=j.rows.namedItem(d);if(!l)return e;g=1}for(;h<g;){if(f)l=j.rows[h];a("td",l).each(function(k){c=j.p.colModel[k].name;if(c!=="cb"&&c!=="subgrid")if(j.p.treeGrid===
87
- true&&c==j.p.ExpandColumn)e[c]=a.jgrid.htmlDecode(a("span:first",this).html());else try{e[c]=a.unformat(this,{rowId:l.id,colModel:j.p.colModel[k]},k)}catch(n){e[c]=a.jgrid.htmlDecode(a(this).html())}});h++;if(f){b.push(e);e={}}}});return b?b:e},delRowData:function(d){var e=false,b,f,g;this.each(function(){var h=this;if(b=h.rows.namedItem(d)){g=b.rowIndex;a(b).remove();h.p.records--;h.p.reccount--;h.updatepager(true,false);e=true;if(h.p.multiselect){f=a.inArray(d,h.p.selarrrow);f!=-1&&h.p.selarrrow.splice(f,
88
- 1)}if(d==h.p.selrow)h.p.selrow=null}else return false;g==0&&e&&h.updateColumns();if(h.p.altRows===true&&e){var j=h.p.altclass;a(h.rows).each(function(c){c%2==1?a(this).addClass(j):a(this).removeClass(j)})}});return e},setRowData:function(d,e,b){var f,g=false;this.each(function(){var h=this,j,c,l=typeof b;if(!h.grid)return false;c=h.rows.namedItem(d);if(!c)return false;e&&a(this.p.colModel).each(function(k){f=this.name;if(e[f]!=undefined){j=h.formatter(d,e[f],k,e,"edit");h.p.treeGrid===true&&f==h.p.ExpandColumn?
89
- a("td:eq("+k+") > span:first",c).html(j).attr("title",a.jgrid.stripHtml(j)):a("td:eq("+k+")",c).html(j).attr("title",a.jgrid.stripHtml(j));g=true}});if(l==="string")a(c).addClass(b);else l==="object"&&a(c).css(b)});return g},addRowData:function(d,e,b,f){b||(b="last");var g=false,h,j,c,l,k,n,m,p,r="",q,u,v;if(e){if(a.isArray(e)){q=true;b="last";u=d}else{e=[e];q=false}this.each(function(){var w=this,z=e.length;k=w.p.rownumbers===true?1:0;c=w.p.multiselect===true?1:0;l=w.p.subGrid===true?1:0;if(!q)if(typeof d!=
90
- "undefined")d+="";else{d=w.p.records+1+"";if(w.p.keyIndex!==false){cmn=w.p.colModel[w.p.keyIndex+c+l+k].name;if(typeof e[0][cmn]!="undefined")d=e[0][cmn]}}v=w.p.altclass;for(var B=0,C=a.isFunction(w.p.afterInsertRow)?true:false;B<z;){data=e[B];j="";if(q){try{d=data[u]}catch(y){d=w.p.records+1}var F=w.p.altRows===true?(w.rows.length-1)%2==0?v:"":""}if(k){r=w.formatCol(k,1);j+='<td role="gridcell" class="ui-state-default jqgrid-rownum" '+r+">0</td>"}if(c){p='<input type="checkbox" id="jqg_'+d+'" class="cbox"/>';
91
- r=w.formatCol(k,1);j+='<td role="gridcell" '+r+">"+p+"</td>"}if(l)j+=a(w).jqGrid("addSubGridCell",c+k,1);for(m=c+l+k;m<this.p.colModel.length;m++){h=this.p.colModel[m].name;p=w.formatter(d,data[h],m,data,"add");r=w.formatCol(m,1);j+='<td role="gridcell" '+r+' title="'+a.jgrid.stripHtml(p)+'">'+p+"</td>"}j='<tr id="'+d+'" role="row" class="ui-widget-content jqgrow ui-row-'+w.p.direction+" "+F+'">'+j+"</tr>";if(w.p.subGrid===true){j=a(j)[0];a(w).jqGrid("addSubGrid",j,c+k)}if(w.rows.length===0)a("table:first",
92
- w.grid.bDiv).append(j);else switch(b){case "last":a(w.rows[w.rows.length-1]).after(j);break;case "first":a(w.rows[0]).before(j);break;case "after":if(n=w.rows.namedItem(f))a(w.rows[n.rowIndex+1]).hasClass("ui-subgrid")?a(w.rows[n.rowIndex+1]).after(j):a(n).after(j);break;case "before":if(n=w.rows.namedItem(f)){a(n).before(j);n=n.rowIndex}break}w.p.records++;w.p.reccount++;if(!w.grid.cols||!w.grid.cols.length)w.grid.cols=w.rows[0].cells;if(b==="first"||b==="before"&&n<=1||w.rows.length===1)w.updateColumns();
93
- C&&w.p.afterInsertRow(w,d,data);B++}if(w.p.altRows===true&&!q)if(b=="last")(w.rows.length-1)%2==1&&a(w.rows[w.rows.length-1]).addClass(v);else a(w.rows).each(function(x){x%2==1?a(this).addClass(v):a(this).removeClass(v)});w.updatepager(true,true);g=true})}return g},footerData:function(d,e,b){function f(c){for(var l in c)return false;return true}var g,h=false,j={};if(typeof d=="undefined")d="get";if(typeof b!="boolean")b=true;d=d.toLowerCase();this.each(function(){var c=this,l;if(!c.grid||!c.p.footerrow)return false;
94
- if(d=="set")if(f(e))return false;h=true;a(this.p.colModel).each(function(k){g=this.name;if(d=="set"){if(e[g]!=undefined){l=b?c.formatter("",e[g],k,e,"edit"):e[g];a("tr.footrow td:eq("+k+")",c.grid.sDiv).html(l).attr("title",a.jgrid.stripHtml(l));h=true}}else if(d=="get")j[g]=a("tr.footrow td:eq("+k+")",c.grid.sDiv).html()})});return d=="get"?j:h},ShowHideCol:function(d,e){return this.each(function(){var b=this,f=false;if(b.grid){if(typeof d==="string")d=[d];e=e!="none"?"":"none";var g=e==""?true:
95
- false;a(this.p.colModel).each(function(h){if(a.inArray(this.name,d)!==-1&&this.hidden===g){a("tr",b.grid.hDiv).each(function(){a("th:eq("+h+")",this).css("display",e)});a(b.rows).each(function(j){a("td:eq("+h+")",b.rows[j]).css("display",e)});b.p.footerrow&&a("td:eq("+h+")",b.grid.sDiv).css("display",e);if(e=="none")b.p.tblwidth-=this.width;else b.p.tblwidth+=this.width;this.hidden=!g;f=true}});if(f===true){a("table:first",b.grid.hDiv).width(b.p.tblwidth);a("table:first",b.grid.bDiv).width(b.p.tblwidth);
96
- b.grid.hDiv.scrollLeft=b.grid.bDiv.scrollLeft;if(b.p.footerrow){a("table:first",b.grid.sDiv).width(b.p.tblwidth);b.grid.sDiv.scrollLeft=b.grid.bDiv.scrollLeft}}}})},hideCol:function(d){return this.each(function(){a(this).jqGrid("ShowHideCol",d,"none")})},showCol:function(d){return this.each(function(){a(this).jqGrid("ShowHideCol",d,"")})},remapColumns:function(d,e,b){function f(j){var c;c=j.length?a.makeArray(j):a.extend({},j);a.each(d,function(l){j[l]=c[this]})}function g(j,c){a(">tr"+(c||""),j).each(function(){var l=
97
- this,k=a.makeArray(l.cells);a.each(d,function(){var n=k[this];n&&l.appendChild(n)})})}var h=this.get(0);f(h.p.colModel);f(h.p.colNames);f(h.grid.headers);g(a("thead:first",h.grid.hDiv),b&&":not(.ui-jqgrid-labels)");e&&g(a("tbody:first",h.grid.bDiv),".jqgrow");h.p.footerrow&&g(a("tbody:first",h.grid.sDiv));if(h.p.remapColumns)if(h.p.remapColumns.length)f(h.p.remapColumns);else h.p.remapColumns=a.makeArray(d);h.p.lastsort=a.inArray(h.p.lastsort,d);if(h.p.treeGrid)h.p.expColInd=a.inArray(h.p.expColInd,
98
- d)},setGridWidth:function(d,e){return this.each(function(){var b=this,f,g=0,h=b.p.cellLayout,j,c=0,l=false,k=b.p.scrollOffset,n,m=0,p=0,r=0,q;if(b.grid){if(typeof e!="boolean")e=b.p.shrinkToFit;if(!isNaN(d)){d=parseInt(d,10);b.grid.width=b.p.width=d;a("#gbox_"+b.p.id).css("width",d+"px");a("#gview_"+b.p.id).css("width",d+"px");a(b.grid.bDiv).css("width",d+"px");a(b.grid.hDiv).css("width",d+"px");b.p.pager&&a(b.p.pager).css("width",d+"px");if(b.p.toolbar[0]===true){a(b.grid.uDiv).css("width",d+"px");
99
- b.p.toolbar[1]=="both"&&a(b.grid.ubDiv).css("width",d+"px")}b.p.footerrow&&a(b.grid.sDiv).css("width",d+"px");if(e===false&&b.p.forceFit==true)b.p.forceFit=false;if(e===true){if(a.browser.safari)h=0;a.each(b.p.colModel,function(){if(this.hidden===false){g+=parseInt(this.width,10);if(this.fixed){p+=this.width;m+=this.width+h}else c++;r++}});if(c!=0){b.p.tblwidth=g;n=d-h*c-m;if(!isNaN(b.p.height))if(a(b.grid.bDiv)[0].clientHeight<a(b.grid.bDiv)[0].scrollHeight){l=true;n-=k}g=0;var u=b.grid.cols.length>
100
- 0;a.each(b.p.colModel,function(v){if(this.hidden===false&&!this.fixed){this.width=f=Math.floor(n/(b.p.tblwidth-p)*this.width);g+=f;b.grid.headers[v].width=f;b.grid.headers[v].el.style.width=f+"px";if(b.p.footerrow)b.grid.footers[v].style.width=f+"px";if(u)b.grid.cols[v].style.width=f+"px";j=v}});q=0;if(l){if(d-m-(g+h*c)!==k)q=d-m-(g+h*c)-k}else if(Math.abs(d-m-(g+h*c))!==1)q=d-m-(g+h*c);b.p.colModel[j].width+=q;f=b.p.colModel[j].width;b.grid.headers[j].width=f;b.grid.headers[j].el.style.width=f+"px";
101
- if(u)b.grid.cols[j].style.width=f+"px";b.p.tblwidth=g+q+p+h*r;a("table:first",b.grid.bDiv).css("width",b.p.tblwidth+"px");a("table:first",b.grid.hDiv).css("width",b.p.tblwidth+"px");b.grid.hDiv.scrollLeft=b.grid.bDiv.scrollLeft;if(b.p.footerrow){b.grid.footers[j].style.width=f+"px";a("table:first",b.grid.sDiv).css("width",b.p.tblwidth+"px")}}}}}})},setGridHeight:function(d){return this.each(function(){var e=this;if(e.grid){a(e.grid.bDiv).css({height:d+(isNaN(d)?"":"px")});e.p.height=d;e.p.scroll&&
102
- e.grid.populateVisible()}})},setCaption:function(d){return this.each(function(){this.p.caption=d;a("span.ui-jqgrid-title",this.grid.cDiv).html(d);a(this.grid.cDiv).show()})},setLabel:function(d,e,b,f){return this.each(function(){var g=this,h=-1;if(g.grid){if(isNaN(d))a(g.p.colModel).each(function(l){if(this.name==d){h=l;return false}});else h=parseInt(d,10);if(h>=0){var j=a("tr.ui-jqgrid-labels th:eq("+h+")",g.grid.hDiv);if(e){var c=a(".s-ico",j);a("[id^=jqgh_]",j).empty().html(e).append(c);g.p.colNames[h]=
103
- e}if(b)typeof b==="string"?a(j).addClass(b):a(j).css(b);typeof f==="object"&&a(j).attr(f)}}})},setCell:function(d,e,b,f,g){return this.each(function(){var h=this,j=-1,c;if(h.grid){if(isNaN(e))a(h.p.colModel).each(function(k){if(this.name==e){j=k;return false}});else j=parseInt(e,10);if(j>=0)if(c=h.rows.namedItem(d)){var l=a("td:eq("+j+")",c);if(b!==""){c=h.formatter(d,b,j,c,"edit");h.p.treeGrid&&a(".tree-wrap",a(l)).length>0?a("span",a(l)).html(c).attr("title",a.jgrid.stripHtml(c)):a(l).html(c).attr("title",
104
- a.jgrid.stripHtml(c))}if(typeof f==="string")f?a(l).addClass(f):a(l).removeClass();else f&&a(l).css(f);typeof g==="object"&&a(l).attr(g)}}})},getCell:function(d,e){var b=false;this.each(function(){var f=this,g=-1;if(f.grid){if(isNaN(e))a(f.p.colModel).each(function(c){if(this.name===e){g=c;return false}});else g=parseInt(e,10);if(g>=0){var h=f.rows.namedItem(d);if(h)try{b=a.unformat(a("td:eq("+g+")",h),{rowId:h.id,colModel:f.p.colModel[g]},g)}catch(j){b=a.jgrid.htmlDecode(a("td:eq("+g+")",h).html())}}}});
105
- return b},getCol:function(d,e,b){var f=[],g,h=0;e=typeof e!="boolean"?false:e;if(typeof b=="undefined")b=false;this.each(function(){var j=this,c=-1;if(j.grid){if(isNaN(d))a(j.p.colModel).each(function(m){if(this.name===d){c=m;return false}});else c=parseInt(d,10);if(c>=0){var l=j.rows.length,k=0;if(l&&l>0){for(;k<l;){try{g=a.unformat(a(j.rows[k].cells[c]),{rowId:j.rows[k].id,colModel:j.p.colModel[c]},c)}catch(n){g=a.jgrid.htmlDecode(j.rows[k].cells[c].innerHTML)}b?(h+=parseFloat(g)):e?f.push({id:j.rows[k].id,
106
- value:g}):(f[k]=g);k++}if(b)switch(b.toLowerCase()){case "sum":f=h;break;case "avg":f=h/l;break;case "count":f=l;break}}}}});return f},clearGridData:function(d){return this.each(function(){var e=this;if(e.grid){if(typeof d!="boolean")d=false;a("tbody:first tr",e.grid.bDiv).remove();e.p.footerrow&&d&&a(".ui-jqgrid-ftable td",e.grid.sDiv).html("&#160;");e.p.selrow=null;e.p.selarrrow=[];e.p.savedRow=[];e.p.records=0;e.p.page="0";e.p.lastpage="0";e.p.reccount=0;e.updatepager(true,false)}})},getInd:function(d,
107
- e){var b=false,f;this.each(function(){if(f=this.rows.namedItem(d))b=e===true?f:f.rowIndex});return b}})})(jQuery);
108
- (function(a){a.jgrid.extend({editCell:function(d,e,b){return this.each(function(){var f=this,g,h,j;if(!(!f.grid||f.p.cellEdit!==true)){e=parseInt(e,10);f.p.selrow=f.rows[d].id;f.p.knv||a(f).jqGrid("GridNav");if(f.p.savedRow.length>0){if(b===true)if(d==f.p.iRow&&e==f.p.iCol)return;a(f).jqGrid("saveCell",f.p.savedRow[0].id,f.p.savedRow[0].ic)}else window.setTimeout(function(){a("#"+f.p.knv).attr("tabindex","-1").focus()},0);g=f.p.colModel[e].name;if(!(g=="subgrid"||g=="cb"||g=="rn")){j=a("td:eq("+e+
109
- ")",f.rows[d]);if(f.p.colModel[e].editable===true&&b===true&&!j.hasClass("not-editable-cell")){if(parseInt(f.p.iCol)>=0&&parseInt(f.p.iRow)>=0){a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight");a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover")}a(j).addClass("edit-cell ui-state-highlight");a(f.rows[d]).addClass("selected-row ui-state-hover");try{h=a.unformat(j,{rowId:f.rows[d].id,colModel:f.p.colModel[e]},e)}catch(c){h=a(j).html()}if(f.p.autoencode)h=
110
- a.jgrid.htmlDecode(h);if(!f.p.colModel[e].edittype)f.p.colModel[e].edittype="text";f.p.savedRow.push({id:d,ic:e,name:g,v:h});if(a.isFunction(f.p.formatCell)){var l=f.p.formatCell(f.rows[d].id,g,h,d,e);if(l!=undefined)h=l}l=a.extend({},f.p.colModel[e].editoptions||{},{id:d+"_"+g,name:g});var k=createEl(f.p.colModel[e].edittype,l,h,true,a.extend({},a.jgrid.ajaxOptions,f.p.ajaxSelectOptions||{}));a.isFunction(f.p.beforeEditCell)&&f.p.beforeEditCell(f.rows[d].id,g,h,d,e);a(j).html("").append(k).attr("tabindex",
111
- "0");window.setTimeout(function(){a(k).focus()},0);a("input, select, textarea",j).bind("keydown",function(n){if(n.keyCode===27)if(a("input.hasDatepicker",j).length>0)a(".ui-datepicker").is(":hidden")?a(f).jqGrid("restoreCell",d,e):a("input.hasDatepicker",j).datepicker("hide");else a(f).jqGrid("restoreCell",d,e);n.keyCode===13&&a(f).jqGrid("saveCell",d,e);if(n.keyCode==9)if(f.grid.hDiv.loading)return false;else n.shiftKey?a(f).jqGrid("prevCell",d,e):a(f).jqGrid("nextCell",d,e);n.stopPropagation()});
112
- a.isFunction(f.p.afterEditCell)&&f.p.afterEditCell(f.rows[d].id,g,h,d,e)}else{if(parseInt(f.p.iCol)>=0&&parseInt(f.p.iRow)>=0){a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight");a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover")}j.addClass("edit-cell ui-state-highlight");a(f.rows[d]).addClass("selected-row ui-state-hover");if(a.isFunction(f.p.onSelectCell)){h=j.html().replace(/\&#160\;/ig,"");f.p.onSelectCell(f.rows[d].id,g,h,d,e)}}f.p.iCol=e;f.p.iRow=
113
- d}}})},saveCell:function(d,e){return this.each(function(){var b=this,f;if(!(!b.grid||b.p.cellEdit!==true)){f=b.p.savedRow.length>=1?0:null;if(f!=null){var g=a("td:eq("+e+")",b.rows[d]),h,j,c=b.p.colModel[e],l=c.name,k=a.jgrid.jqID(l);switch(c.edittype){case "select":if(c.editoptions.multiple){k=a("#"+d+"_"+k,b.rows[d]);var n=[];if(h=a(k).val())h.join(",");else h="";a("option:selected",k).each(function(w,z){n[w]=a(z).text()});j=n.join(",")}else{h=a("#"+d+"_"+k+">option:selected",b.rows[d]).val();j=
114
- a("#"+d+"_"+k+">option:selected",b.rows[d]).text()}if(c.formatter)j=h;break;case "checkbox":var m=["Yes","No"];if(c.editoptions)m=c.editoptions.value.split(":");j=h=a("#"+d+"_"+k,b.rows[d]).attr("checked")?m[0]:m[1];break;case "password":case "text":case "textarea":case "button":j=h=a("#"+d+"_"+k,b.rows[d]).val();break;case "custom":try{if(c.editoptions&&a.isFunction(c.editoptions.custom_value)){h=c.editoptions.custom_value(a(".customelement",g),"get");if(h===undefined)throw"e2";else j=h}else throw"e1";
115
- }catch(p){p=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);p=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,p.message,jQuery.jgrid.edit.bClose)}break}if(j!=b.p.savedRow[f].v){if(a.isFunction(b.p.beforeSaveCell))if(f=b.p.beforeSaveCell(b.rows[d].id,l,h,d,e))h=f;var r=checkValues(h,e,b);if(r[0]===true){f={};
116
- if(a.isFunction(b.p.beforeSubmitCell))(f=b.p.beforeSubmitCell(b.rows[d].id,l,h,d,e))||(f={});if(j=="")j=" ";a("input.hasDatepicker",g).length>0&&a("input.hasDatepicker",g).datepicker("hide");if(b.p.cellsubmit=="remote")if(b.p.cellurl){var q={};if(b.p.autoencode)h=a.jgrid.htmlEncode(h);q[l]=h;m=b.p.prmNames;c=m.id;k=m.oper;q[c]=b.rows[d].id;q[k]=m.editoper;q=a.extend(f,q);a("#lui_"+b.p.id).show();b.grid.hDiv.loading=true;a.ajax(a.extend({url:b.p.cellurl,data:a.isFunction(b.p.serializeCellData)?b.p.serializeCellData(q):
117
- q,type:"POST",complete:function(w,z){a("#lui_"+b.p.id).hide();b.grid.hDiv.loading=false;if(z=="success")if(a.isFunction(b.p.afterSubmitCell)){w=b.p.afterSubmitCell(w,q.id,l,h,d,e);if(w[0]===true){a(g).empty();a(b).jqGrid("setCell",b.rows[d].id,e,j);a(g).addClass("dirty-cell");a(b.rows[d]).addClass("edited");a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell(b.rows[d].id,l,h,d,e);b.p.savedRow.splice(0,1)}else{info_dialog(a.jgrid.errors.errcap,w[1],a.jgrid.edit.bClose);a(b).jqGrid("restoreCell",d,e)}}else{a(g).empty();
118
- a(b).jqGrid("setCell",b.rows[d].id,e,j);a(g).addClass("dirty-cell");a(b.rows[d]).addClass("edited");a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell(b.rows[d].id,l,h,d,e);b.p.savedRow.splice(0,1)}},error:function(w,z){a("#lui_"+b.p.id).hide();b.grid.hDiv.loading=false;a.isFunction(b.p.errorCell)?b.p.errorCell(w,z):info_dialog(a.jgrid.errors.errcap,w.status+" : "+w.statusText+"<br/>"+z,a.jgrid.edit.bClose);a(b).jqGrid("restoreCell",d,e)}},a.jgrid.ajaxOptions,b.p.ajaxCellOptions||{}))}else try{info_dialog(a.jgrid.errors.errcap,
119
- a.jgrid.errors.nourl,a.jgrid.edit.bClose);a(b).jqGrid("restoreCell",d,e)}catch(u){}if(b.p.cellsubmit=="clientArray"){a(g).empty();a(b).jqGrid("setCell",b.rows[d].id,e,j);a(g).addClass("dirty-cell");a(b.rows[d]).addClass("edited");a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell(b.rows[d].id,l,h,d,e);b.p.savedRow.splice(0,1)}}else try{window.setTimeout(function(){info_dialog(a.jgrid.errors.errcap,h+" "+r[1],a.jgrid.edit.bClose)},100);a(b).jqGrid("restoreCell",d,e)}catch(v){}}else a(b).jqGrid("restoreCell",
120
- d,e)}a.browser.opera?a("#"+b.p.knv).attr("tabindex","-1").focus():window.setTimeout(function(){a("#"+b.p.knv).attr("tabindex","-1").focus()},0)}})},restoreCell:function(d,e){return this.each(function(){var b=this,f;if(!(!b.grid||b.p.cellEdit!==true)){f=b.p.savedRow.length>=1?0:null;if(f!=null){var g=a("td:eq("+e+")",b.rows[d]);if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker",g).datepicker("hide")}catch(h){}a(g).empty().attr("tabindex","-1");a(b).jqGrid("setCell",b.rows[d].id,e,b.p.savedRow[f].v);
121
- b.p.savedRow.splice(0,1)}window.setTimeout(function(){a("#"+b.p.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(d,e){return this.each(function(){var b=this,f=false;if(!(!b.grid||b.p.cellEdit!==true)){for(var g=e+1;g<b.p.colModel.length;g++)if(b.p.colModel[g].editable===true){f=g;break}if(f!==false)a(b).jqGrid("editCell",d,f,true);else b.p.savedRow.length>0&&a(b).jqGrid("saveCell",d,e)}})},prevCell:function(d,e){return this.each(function(){var b=this,f=false;if(!(!b.grid||b.p.cellEdit!==
122
- true)){for(var g=e-1;g>=0;g--)if(b.p.colModel[g].editable===true){f=g;break}if(f!==false)a(b).jqGrid("editCell",d,f,true);else b.p.savedRow.length>0&&a(b).jqGrid("saveCell",d,e)}})},GridNav:function(){return this.each(function(){function d(j,c,l){if(l.substr(0,1)=="v"){var k=a(b.grid.bDiv)[0].clientHeight,n=a(b.grid.bDiv)[0].scrollTop,m=b.rows[j].offsetTop+b.rows[j].clientHeight,p=b.rows[j].offsetTop;if(l=="vd")if(m>=k)a(b.grid.bDiv)[0].scrollTop=a(b.grid.bDiv)[0].scrollTop+b.rows[j].clientHeight;
123
- if(l=="vu")if(p<n)a(b.grid.bDiv)[0].scrollTop=a(b.grid.bDiv)[0].scrollTop-b.rows[j].clientHeight}if(l=="h"){l=a(b.grid.bDiv)[0].clientWidth;k=a(b.grid.bDiv)[0].scrollLeft;n=b.rows[j].cells[c].offsetLeft;if(b.rows[j].cells[c].offsetLeft+b.rows[j].cells[c].clientWidth>=l+parseInt(k))a(b.grid.bDiv)[0].scrollLeft=a(b.grid.bDiv)[0].scrollLeft+b.rows[j].cells[c].clientWidth;else if(n<k)a(b.grid.bDiv)[0].scrollLeft=a(b.grid.bDiv)[0].scrollLeft-b.rows[j].cells[c].clientWidth}}function e(j,c){var l,k;if(c==
124
- "lft"){l=j+1;for(k=j;k>=0;k--)if(b.p.colModel[k].hidden!==true){l=k;break}}if(c=="rgt"){l=j-1;for(k=j;k<b.p.colModel.length;k++)if(b.p.colModel[k].hidden!==true){l=k;break}}return l}var b=this;if(!(!b.grid||b.p.cellEdit!==true)){b.p.knv=b.p.id+"_kn";var f=a("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span tabindex='-1' style='width:0px;height:0px;background-color:grey' id='"+b.p.knv+"'></span></span>"),g,h;a(f).insertBefore(b.grid.cDiv);a("#"+b.p.knv).focus().keydown(function(j){h=
125
- j.keyCode;if(b.p.direction=="rtl")if(h==37)h=39;else if(h==39)h=37;switch(h){case 38:if(b.p.iRow-1>=0){d(b.p.iRow-1,b.p.iCol,"vu");a(b).jqGrid("editCell",b.p.iRow-1,b.p.iCol,false)}break;case 40:if(b.p.iRow+1<=b.rows.length-1){d(b.p.iRow+1,b.p.iCol,"vd");a(b).jqGrid("editCell",b.p.iRow+1,b.p.iCol,false)}break;case 37:if(b.p.iCol-1>=0){g=e(b.p.iCol-1,"lft");d(b.p.iRow,g,"h");a(b).jqGrid("editCell",b.p.iRow,g,false)}break;case 39:if(b.p.iCol+1<=b.p.colModel.length-1){g=e(b.p.iCol+1,"rgt");d(b.p.iRow,
126
- g,"h");a(b).jqGrid("editCell",b.p.iRow,g,false)}break;case 13:parseInt(b.p.iCol,10)>=0&&parseInt(b.p.iRow,10)>=0&&a(b).jqGrid("editCell",b.p.iRow,b.p.iCol,true);break}return false})}})},getChangedCells:function(d){var e=[];d||(d="all");this.each(function(){var b=this,f;!b.grid||b.p.cellEdit!==true||a(b.rows).each(function(g){var h={};if(a(this).hasClass("edited")){a("td",this).each(function(j){f=b.p.colModel[j].name;if(f!=="cb"&&f!=="subgrid")if(d=="dirty"){if(a(this).hasClass("dirty-cell"))try{h[f]=
127
- a.unformat(this,{rowId:b.rows[g].id,colModel:b.p.colModel[j]},j)}catch(c){h[f]=a.jgrid.htmlDecode(a(this).html())}}else try{h[f]=a.unformat(this,{rowId:b.rows[g].id,colModel:b.p.colModel[j]},j)}catch(l){h[f]=a.jgrid.htmlDecode(a(this).html())}});h.id=this.id;e.push(h)}})});return e}})})(jQuery);
128
- var showModal=function(a){a.w.show()},closeModal=function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},createModal=function(a,d,e,b,f,g){var h=document.createElement("div"),j;j=jQuery(e.gbox).attr("dir")=="rtl"?true:false;h.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";h.id=a.themodal;var c=document.createElement("div");c.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";c.id=a.modalhead;jQuery(c).append("<span class='ui-jqdialog-title'>"+
129
- e.caption+"</span>");var l=jQuery("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){l.addClass("ui-state-hover")},function(){l.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");jQuery(c).append(l);if(j){h.dir="rtl";jQuery(".ui-jqdialog-title",c).css("float","right");jQuery(".ui-jqdialog-titlebar-close",c).css("left","0.3em")}else{h.dir="ltr";jQuery(".ui-jqdialog-title",c).css("float","left");jQuery(".ui-jqdialog-titlebar-close",
130
- c).css("right","0.3em")}var k=document.createElement("div");jQuery(k).addClass("ui-jqdialog-content ui-widget-content").attr("id",a.modalcontent);jQuery(k).append(d);h.appendChild(k);jQuery(h).prepend(c);g===true?jQuery("body").append(h):jQuery(h).insertBefore(b);if(typeof e.jqModal==="undefined")e.jqModal=true;d={};if(jQuery.fn.jqm&&e.jqModal===true){if(e.left==0&&e.top==0){b=[];b=findPos(f);e.left=b[0]+4;e.top=b[1]+4}d.top=e.top+"px";d.left=e.left}else if(e.left!=0||e.top!=0){d.left=e.left;d.top=
131
- e.top+"px"}jQuery("a.ui-jqdialog-titlebar-close",c).click(function(){var p=jQuery("#"+a.themodal).data("onClose")||e.onClose,r=jQuery("#"+a.themodal).data("gbox")||e.gbox;hideModal("#"+a.themodal,{gb:r,jqm:e.jqModal,onClose:p});return false});if(e.width==0||!e.width)e.width=300;if(e.height==0||!e.height)e.height=200;if(!e.zIndex)e.zIndex=950;f=0;if(j&&d.left&&!g){f=jQuery(e.gbox).width()-(!isNaN(e.width)?parseInt(e.width):0)-8;d.left=parseInt(d.left)+parseInt(f)}if(d.left)d.left+="px";jQuery(h).css(jQuery.extend({width:isNaN(e.width)?
132
- "auto":e.width+"px",height:isNaN(e.height)?"auto":e.height+"px",zIndex:e.zIndex,overflow:"hidden"},d)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":a.modalhead,"aria-hidden":"true"});if(typeof e.drag=="undefined")e.drag=true;if(typeof e.resize=="undefined")e.resize=true;if(e.drag){jQuery(c).css("cursor","move");if(jQuery.fn.jqDrag)jQuery(h).jqDrag(c);else try{jQuery(h).draggable({handle:jQuery("#"+c.id)})}catch(n){}}if(e.resize)if(jQuery.fn.jqResize){jQuery(h).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>");
133
- jQuery("#"+a.themodal).jqResize(".jqResize",a.scrollelm?"#"+a.scrollelm:false)}else try{jQuery(h).resizable({handles:"se, sw",alsoResize:a.scrollelm?"#"+a.scrollelm:false})}catch(m){}e.closeOnEscape===true&&jQuery(h).keydown(function(p){if(p.which==27){p=jQuery("#"+a.themodal).data("onClose")||e.onClose;hideModal(this,{gb:e.gbox,jqm:e.jqModal,onClose:p})}})},viewModal=function(a,d){d=jQuery.extend({toTop:true,overlay:10,modal:false,onShow:showModal,onHide:closeModal,gbox:"",jqm:true,jqM:true},d||
134
- {});if(jQuery.fn.jqm&&d.jqm==true)d.jqM?jQuery(a).attr("aria-hidden","false").jqm(d).jqmShow():jQuery(a).attr("aria-hidden","false").jqmShow();else{if(d.gbox!=""){jQuery(".jqgrid-overlay:first",d.gbox).show();jQuery(a).data("gbox",d.gbox)}jQuery(a).show().attr("aria-hidden","false");try{jQuery(":input:visible",a)[0].focus()}catch(e){}}},hideModal=function(a,d){d=jQuery.extend({jqm:true,gb:""},d||{});if(d.onClose){var e=d.onClose(a);if(typeof e=="boolean"&&!e)return}if(jQuery.fn.jqm&&d.jqm===true)jQuery(a).attr("aria-hidden",
135
- "true").jqmHide();else{if(d.gb!="")try{jQuery(".jqgrid-overlay:first",d.gb).hide()}catch(b){}jQuery(a).hide().attr("aria-hidden","true")}};
136
- function info_dialog(a,d,e,b){var f={width:290,height:"auto",dataheight:"auto",drag:true,resize:false,caption:"<b>"+a+"</b>",left:250,top:170,zIndex:1E3,jqModal:true,modal:false,closeOnEscape:true,align:"center",buttonalign:"center",buttons:[]};jQuery.extend(f,b||{});var g=f.jqModal;if(jQuery.fn.jqm&&!g)g=false;a="";if(f.buttons.length>0)for(b=0;b<f.buttons.length;b++){if(typeof f.buttons[b].id=="undefined")f.buttons[b].id="info_button_"+b;a+="<a href='javascript:void(0)' id='"+f.buttons[b].id+"' class='fm-button ui-state-default ui-corner-all'>"+
137
- f.buttons[b].text+"</a>"}b=isNaN(f.dataheight)?f.dataheight:f.dataheight+"px";var h="<div id='info_id'>";h+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+b+";"+("text-align:"+f.align+";")+"'>"+d+"</div>";h+=e?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+f.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+
138
- e+"</a>"+a+"</div>":"";h+="</div>";try{jQuery("#info_dialog").attr("aria-hidden")=="false"&&hideModal("#info_dialog",{jqm:g});jQuery("#info_dialog").remove()}catch(j){}createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},h,f,"","",true);a&&jQuery.each(f.buttons,function(l){jQuery("#"+this.id,"#info_id").bind("click",function(){f.buttons[l].onClick.call(jQuery("#info_dialog"));return false})});jQuery("#closedialog","#info_id").click(function(){hideModal("#info_dialog",
139
- {jqm:g});return false});jQuery(".fm-button","#info_dialog").hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")});viewModal("#info_dialog",{onHide:function(l){l.w.hide().remove();l.o&&l.o.remove()},modal:f.modal,jqm:g});try{$("#info_dialog").focus()}catch(c){}}function findPos(a){var d=curtop=0;if(a.offsetParent){do{d+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent)}return[d,curtop]}
140
- function isArray(a){return a.constructor.toString().indexOf("Array")==-1?false:true}
141
- function createEl(a,d,e,b,f){function g(r,q){if(jQuery.isFunction(q.dataInit)){r.id=q.id;q.dataInit(r);delete q.id;delete q.dataInit}if(q.dataEvents){jQuery.each(q.dataEvents,function(){this.data!=null?jQuery(r).bind(this.type,this.data,this.fn):jQuery(r).bind(this.type,this.fn)});delete q.dataEvents}return q}var h="";d.defaultValue&&delete d.defaultValue;switch(a){case "textarea":h=document.createElement("textarea");if(b)d.cols||jQuery(h).css({width:"98%"});else if(!d.cols)d.cols=20;if(!d.rows)d.rows=
142
- 2;if(e=="&nbsp;"||e=="&#160;"||e.length==1&&e.charCodeAt(0)==160)e="";h.value=e;d=g(h,d);jQuery(h).attr(d);break;case "checkbox":h=document.createElement("input");h.type="checkbox";if(d.value){var j=d.value.split(":");if(e===j[0]){h.checked=true;h.defaultChecked=true}h.value=j[0];jQuery(h).attr("offval",j[1]);try{delete d.value}catch(c){}}else{j=e.toLowerCase();if(j.search(/(false|0|no|off|undefined)/i)<0&&j!==""){h.checked=true;h.defaultChecked=true;h.value=e}else h.value="on";jQuery(h).attr("offval",
143
- "off")}d=g(h,d);jQuery(h).attr(d);break;case "select":h=document.createElement("select");var l,k=[];if(d.multiple===true){l=true;h.multiple="multiple"}else l=false;if(d.dataUrl!=null)jQuery.ajax(jQuery.extend({url:d.dataUrl,type:"GET",complete:function(r){try{delete d.dataUrl;delete d.value}catch(q){}if(d.buildSelect!=null){r=d.buildSelect(r);r=jQuery(r).html();delete d.buildSelect}else r=jQuery(r.responseText).html();if(r){jQuery(h).append(r);d=g(h,d);if(typeof d.size==="undefined")d.size=l?3:1;
144
- if(l){k=e.split(",");k=jQuery.map(k,function(u){return jQuery.trim(u)})}else k[0]=e;jQuery(h).attr(d);setTimeout(function(){jQuery("option",h).each(function(u){if(u==0)this.selected="";if(jQuery.inArray(jQuery(this).text(),k)>-1||jQuery.inArray(jQuery(this).val(),k)>-1){this.selected="selected";if(!l)return false}})},0)}}},f||{}));else if(d.value){if(l){k=e.split(",");k=jQuery.map(k,function(r){return jQuery.trim(r)});if(typeof d.size==="undefined")d.size=3}else d.size=1;if(typeof d.value==="function")d.value=
145
- d.value();if(typeof d.value==="string"){b=d.value.split(";");for(j=0;j<b.length;j++){f=b[j].split(":");if(f.length>2)f[1]=jQuery.map(f,function(r,q){if(q>0)return r}).join(":");a=document.createElement("option");a.value=f[0];a.innerHTML=f[1];if(!l&&(f[0]==e||f[1]==e))a.selected="selected";if(l&&(jQuery.inArray(f[1],k)>-1||jQuery.inArray(f[0],k)>-1))a.selected="selected";h.appendChild(a)}}else if(typeof d.value==="object"){b=d.value;for(j in b){a=document.createElement("option");a.value=j;a.innerHTML=
146
- b[j];if(!l&&(j==e||b[j]==e))a.selected="selected";if(l&&(jQuery.inArray(b[j],k)>-1||jQuery.inArray(j,k)>-1))a.selected="selected";h.appendChild(a)}}d=g(h,d);try{delete d.value}catch(n){}jQuery(h).attr(d)}break;case "text":case "password":case "button":h=document.createElement("input");h.type=a;h.value=e;d=g(h,d);if(a!="button")if(b)d.size||jQuery(h).css({width:"98%"});else if(!d.size)d.size=20;jQuery(h).attr(d);break;case "image":case "file":h=document.createElement("input");h.type=a;d=g(h,d);jQuery(h).attr(d);
147
- break;case "custom":h=document.createElement("span");try{if(jQuery.isFunction(d.custom_element)){var m=d.custom_element.call(this,e,d);if(m){m=jQuery(m).addClass("customelement").attr({id:d.id,name:d.name});jQuery(h).empty().append(m)}else throw"e2";}else throw"e1";}catch(p){p=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_element' "+jQuery.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);p=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_element' "+jQuery.jgrid.edit.msg.novalue,
148
- jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,p.message,jQuery.jgrid.edit.bClose)}break}return h}
149
- function checkValues(a,d,e){var b,f,g;if(typeof d=="string"){f=0;for(len=e.p.colModel.length;f<len;f++)if(e.p.colModel[f].name==d){b=e.p.colModel[f].editrules;d=f;try{g=e.p.colModel[f].formoptions.label}catch(h){}break}}else if(d>=0)b=e.p.colModel[d].editrules;if(b){g||(g=e.p.colNames[d]);if(b.required===true)if(a.match(/^s+$/)||a=="")return[false,g+": "+jQuery.jgrid.edit.msg.required,""];f=b.required===false?false:true;if(b.number===true)if(!(f===false&&isEmpty(a)))if(isNaN(a))return[false,g+": "+
150
- jQuery.jgrid.edit.msg.number,""];if(typeof b.minValue!="undefined"&&!isNaN(b.minValue))if(parseFloat(a)<parseFloat(b.minValue))return[false,g+": "+jQuery.jgrid.edit.msg.minValue+" "+b.minValue,""];if(typeof b.maxValue!="undefined"&&!isNaN(b.maxValue))if(parseFloat(a)>parseFloat(b.maxValue))return[false,g+": "+jQuery.jgrid.edit.msg.maxValue+" "+b.maxValue,""];var j;if(b.email===true)if(!(f===false&&isEmpty(a))){j=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
151
- if(!j.test(a))return[false,g+": "+jQuery.jgrid.edit.msg.email,""]}if(b.integer===true)if(!(f===false&&isEmpty(a))){if(isNaN(a))return[false,g+": "+jQuery.jgrid.edit.msg.integer,""];if(a%1!=0||a.indexOf(".")!=-1)return[false,g+": "+jQuery.jgrid.edit.msg.integer,""]}if(b.date===true)if(!(f===false&&isEmpty(a))){d=e.p.colModel[d].datefmt||"Y-m-d";if(!checkDate(d,a))return[false,g+": "+jQuery.jgrid.edit.msg.date+" - "+d,""]}if(b.time===true)if(!(f===false&&isEmpty(a)))if(!checkTime(a))return[false,g+
152
- ": "+jQuery.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(b.url===true)if(!(f===false&&isEmpty(a))){j=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!j.test(a))return[false,g+": "+jQuery.jgrid.edit.msg.url,""]}if(b.custom===true)if(!(f===false&&isEmpty(a)))if(jQuery.isFunction(b.custom_func)){a=b.custom_func.call(e,a,g);return jQuery.isArray(a)?a:[false,jQuery.jgrid.edit.msg.customarray,""]}else return[false,jQuery.jgrid.edit.msg.customfcheck,
153
- ""]}return[true,"",""]}
154
- function checkDate(a,d){var e={},b;a=a.toLowerCase();b=a.indexOf("/")!=-1?"/":a.indexOf("-")!=-1?"-":a.indexOf(".")!=-1?".":"/";a=a.split(b);d=d.split(b);if(d.length!=3)return false;b=-1;for(var f,g=-1,h=-1,j=0;j<a.length;j++){f=isNaN(d[j])?0:parseInt(d[j],10);e[a[j]]=f;f=a[j];if(f.indexOf("y")!=-1)b=j;if(f.indexOf("m")!=-1)h=j;if(f.indexOf("d")!=-1)g=j}f=a[b]=="y"||a[b]=="yyyy"?4:a[b]=="yy"?2:-1;j=DaysArray(12);var c;if(b===-1)return false;else{c=e[a[b]].toString();if(f==2&&c.length==1)f=1;if(c.length!=
155
- f||e[a[b]]==0&&d[b]!="00")return false}if(h===-1)return false;else{c=e[a[h]].toString();if(c.length<1||e[a[h]]<1||e[a[h]]>12)return false}if(g===-1)return false;else{c=e[a[g]].toString();if(c.length<1||e[a[g]]<1||e[a[g]]>31||e[a[h]]==2&&e[a[g]]>daysInFebruary(e[a[b]])||e[a[g]]>j[e[a[h]]])return false}return true}function daysInFebruary(a){return a%4==0&&(a%100!=0||a%400==0)?29:28}
156
- function DaysArray(a){for(var d=1;d<=a;d++){this[d]=31;if(d==4||d==6||d==9||d==11)this[d]=30;if(d==2)this[d]=29}return this}function isEmpty(a){return a.match(/^s+$/)||a==""?true:false}function checkTime(a){var d=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!isEmpty(a))if(a=a.match(d)){if(a[3]){if(a[1]<1||a[1]>12)return false}else if(a[1]>23)return false;if(a[2]>59)return false}else return false;return true}
157
- (function(a){a.jgrid.extend({getColProp:function(d){var e={},b=this[0];if(b.grid){b=b.p.colModel;for(var f=0;f<b.length;f++)if(b[f].name==d){e=b[f];break}return e}},setColProp:function(d,e){return this.each(function(){if(this.grid)if(e)for(var b=this.p.colModel,f=0;f<b.length;f++)if(b[f].name==d){a.extend(this.p.colModel[f],e);break}})},sortGrid:function(d,e,b){return this.each(function(){var f=this,g=-1;if(f.grid){if(!d)d=f.p.sortname;for(var h=0;h<f.p.colModel.length;h++)if(f.p.colModel[h].index==
158
- d||f.p.colModel[h].name==d){g=h;break}if(g!=-1){h=f.p.colModel[g].sortable;if(typeof h!=="boolean")h=true;if(typeof e!=="boolean")e=false;h&&f.sortData("jqgh_"+d,g,e,b)}}})},GridDestroy:function(){return this.each(function(){if(this.grid){this.p.pager&&a(this.p.pager).remove();var d=this.id;try{a("#gbox_"+d).remove()}catch(e){}}})},GridUnload:function(){return this.each(function(){if(this.grid){var d={id:a(this).attr("id"),cl:a(this).attr("class")};this.p.pager&&a(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom");
159
- var e=document.createElement("table");a(e).attr({id:d.id});e.className=d.cl;d=this.id;a(e).removeClass("ui-jqgrid-btable");if(a(this.p.pager).parents("#gbox_"+d).length===1){a(e).insertBefore("#gbox_"+d).show();a(this.p.pager).insertBefore("#gbox_"+d)}else a(e).insertBefore("#gbox_"+d).show();a("#gbox_"+d).remove()}})},setGridState:function(d){return this.each(function(){if(this.grid){$t=this;if(d=="hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+$t.p.id).slideUp("fast");$t.p.pager&&a($t.p.pager).slideUp("fast");
160
- if($t.p.toolbar[0]===true){$t.p.toolbar[1]=="both"&&a($t.grid.ubDiv).slideUp("fast");a($t.grid.uDiv).slideUp("fast")}$t.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+$s.p.id).slideUp("fast");a(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");$t.p.gridstate="hidden"}else if(d=="visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+$t.p.id).slideDown("fast");$t.p.pager&&a($t.p.pager).slideDown("fast");if($t.p.toolbar[0]===true){$t.p.toolbar[1]==
161
- "both"&&a($t.grid.ubDiv).slideDown("fast");a($t.grid.uDiv).slideDown("fast")}$t.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+$t.p.id).slideDown("fast");a(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");$t.p.gridstate="visible"}}})},updateGridRows:function(d,e,b){var f,g=false;this.each(function(){var h=this,j,c,l,k;if(!h.grid)return false;e||(e="id");d&&d.length>0&&a(d).each(function(){l=this;if(c=h.rows.namedItem(l[e])){k=
162
- l[e];if(b===true)if(h.p.jsonReader.repeatitems===true){if(h.p.jsonReader.cell)l=l[h.p.jsonReader.cell];for(var n=0;n<l.length;n++){j=h.formatter(k,l[n],n,l,"edit");h.p.treeGrid===true&&f==h.p.ExpandColumn?a("td:eq("+n+") > span:first",c).html(j).attr("title",a.jgrid.stripHtml(j)):a("td:eq("+n+")",c).html(j).attr("title",a.jgrid.stripHtml(j))}return g=true}a(h.p.colModel).each(function(m){f=b===true?this.jsonmap||this.name:this.name;if(l[f]!=undefined){j=h.formatter(k,l[f],m,l,"edit");h.p.treeGrid===
163
- true&&f==h.p.ExpandColumn?a("td:eq("+m+") > span:first",c).html(j).attr("title",a.jgrid.stripHtml(j)):a("td:eq("+m+")",c).html(j).attr("title",a.jgrid.stripHtml(j));g=true}})}})});return g},filterGrid:function(d,e){e=a.extend({gridModel:false,gridNames:false,gridToolbar:false,filterModel:[],formtype:"horizontal",autosearch:true,formclass:"filterform",tableclass:"filtertable",buttonclass:"filterbutton",searchButton:"Search",clearButton:"Clear",enableSearch:false,enableClear:false,beforeSearch:null,
164
- afterSearch:null,beforeClear:null,afterClear:null,url:"",marksearched:true},e||{});return this.each(function(){var b=this;this.p=e;if(this.p.filterModel.length==0&&this.p.gridModel===false)alert("No filter is set");else if(d){this.p.gridid=d.indexOf("#")!=-1?d:"#"+d;var f=a(this.p.gridid).jqGrid("getGridParam","colModel");if(f){if(this.p.gridModel===true){var g=a(this.p.gridid)[0],h;a.each(f,function(n){var m=[];this.search=this.search===false?false:true;h=this.editrules&&this.editrules.searchhidden===
165
- true?true:this.hidden===true?false:true;if(this.search===true&&h===true){m.label=b.p.gridNames===true?g.p.colNames[n]:"";m.name=this.name;m.index=this.index||this.name;m.stype=this.edittype||"text";if(m.stype!="select")m.stype="text";m.defval=this.defval||"";m.surl=this.surl||"";m.sopt=this.editoptions||{};m.width=this.width;b.p.filterModel.push(m)}})}else a.each(b.p.filterModel,function(){for(var n=0;n<f.length;n++)if(this.name==f[n].name){this.index=f[n].index||this.name;break}if(!this.index)this.index=
166
- this.name});var j=function(){var n={},m=0,p,r=a(b.p.gridid)[0],q;r.p.searchdata={};a.isFunction(b.p.beforeSearch)&&b.p.beforeSearch();a.each(b.p.filterModel,function(){q=this.index;switch(this.stype){case "select":if(p=a("select[name="+q+"]",b).val()){n[q]=p;b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).addClass("dirty-cell");m++}else{b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).removeClass("dirty-cell");try{delete r.p.postData[this.index]}catch(w){}}break;default:if(p=a("input[name="+
167
- q+"]",b).val()){n[q]=p;b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).addClass("dirty-cell");m++}else{b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).removeClass("dirty-cell");try{delete r.p.postData[this.index]}catch(z){}}}});var u=m>0?true:false;a.extend(r.p.postData,n);var v;if(b.p.url){v=a(r).jqGrid("getGridParam","url");a(r).jqGrid("setGridParam",{url:b.p.url})}a(r).jqGrid("setGridParam",{search:u}).trigger("reloadGrid",[{page:1}]);v&&a(r).jqGrid("setGridParam",{url:v});a.isFunction(b.p.afterSearch)&&
168
- b.p.afterSearch()},c=function(){var n={},m,p=0,r=a(b.p.gridid)[0],q;a.isFunction(b.p.beforeClear)&&b.p.beforeClear();a.each(b.p.filterModel,function(){q=this.index;m=this.defval?this.defval:"";if(!this.stype)this.stype="text";switch(this.stype){case "select":var w;a("select[name="+q+"] option",b).each(function(C){if(C==0)this.selected=true;if(a(this).text()==m){this.selected=true;w=a(this).val();return false}});if(w){n[q]=w;b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).addClass("dirty-cell");
169
- p++}else{b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).removeClass("dirty-cell");try{delete r.p.postData[this.index]}catch(z){}}break;case "text":a("input[name="+q+"]",b).val(m);if(m){n[q]=m;b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).addClass("dirty-cell");p++}else{b.p.marksearched&&a("#jqgh_"+this.name,r.grid.hDiv).removeClass("dirty-cell");try{delete r.p.postData[this.index]}catch(B){}}break}});var u=p>0?true:false;a.extend(r.p.postData,n);var v;if(b.p.url){v=a(r).jqGrid("getGridParam",
170
- "url");a(r).jqGrid("setGridParam",{url:b.p.url})}a(r).jqGrid("setGridParam",{search:u}).trigger("reloadGrid",[{page:1}]);v&&a(r).jqGrid("setGridParam",{url:v});a.isFunction(b.p.afterClear)&&b.p.afterClear()},l=a("<form name='SearchForm' style=display:inline;' class='"+this.p.formclass+"'></form>"),k=a("<table class='"+this.p.tableclass+"' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");a(l).append(k);(function(){var n=document.createElement("tr"),m,p,r,q;b.p.formtype=="horizontal"&&
171
- a(k).append(n);a.each(b.p.filterModel,function(u){r=document.createElement("td");a(r).append("<label for='"+this.name+"'>"+this.label+"</label>");q=document.createElement("td");var v=this;if(!this.stype)this.stype="text";switch(this.stype){case "select":if(this.surl)a(q).load(this.surl,function(){v.defval&&a("select",this).val(v.defval);a("select",this).attr({name:v.index||v.name,id:"sg_"+v.name});v.sopt&&a("select",this).attr(v.sopt);b.p.gridToolbar===true&&v.width&&a("select",this).width(v.width);
172
- b.p.autosearch===true&&a("select",this).change(function(){j();return false})});else if(v.sopt.value){var w=v.sopt.value,z=document.createElement("select");a(z).attr({name:v.index||v.name,id:"sg_"+v.name}).attr(v.sopt);if(typeof w==="string"){u=w.split(";");for(var B,C=0;C<u.length;C++){w=u[C].split(":");B=document.createElement("option");B.value=w[0];B.innerHTML=w[1];if(w[1]==v.defval)B.selected="selected";z.appendChild(B)}}else if(typeof w==="object")for(C in w){u++;B=document.createElement("option");
173
- B.value=C;B.innerHTML=w[C];if(w[C]==v.defval)B.selected="selected";z.appendChild(B)}b.p.gridToolbar===true&&v.width&&a(z).width(v.width);a(q).append(z);b.p.autosearch===true&&a(z).change(function(){j();return false})}break;case "text":z=this.defval?this.defval:"";a(q).append("<input type='text' name='"+(this.index||this.name)+"' id='sg_"+this.name+"' value='"+z+"'/>");v.sopt&&a("input",q).attr(v.sopt);if(b.p.gridToolbar===true&&v.width)a.browser.msie?a("input",q).width(v.width-4):a("input",q).width(v.width-
174
- 2);b.p.autosearch===true&&a("input",q).keypress(function(y){if((y.charCode?y.charCode:y.keyCode?y.keyCode:0)==13){j();return false}return this});break}if(b.p.formtype=="horizontal"){b.p.gridToolbar===true&&b.p.gridNames===false?a(n).append(q):a(n).append(r).append(q);a(n).append(q)}else{m=document.createElement("tr");a(m).append(r).append(q);a(k).append(m)}});q=document.createElement("td");if(b.p.enableSearch===true){p="<input type='button' id='sButton' class='"+b.p.buttonclass+"' value='"+b.p.searchButton+
175
- "'/>";a(q).append(p);a("input#sButton",q).click(function(){j();return false})}if(b.p.enableClear===true){p="<input type='button' id='cButton' class='"+b.p.buttonclass+"' value='"+b.p.clearButton+"'/>";a(q).append(p);a("input#cButton",q).click(function(){c();return false})}if(b.p.enableClear===true||b.p.enableSearch===true)if(b.p.formtype=="horizontal")a(n).append(q);else{m=document.createElement("tr");a(m).append("<td>&#160;</td>").append(q);a(k).append(m)}})();a(this).append(l);this.triggerSearch=
176
- j;this.clearSearch=c}else alert("Could not get grid colModel")}else alert("No target grid is set!")})},filterToolbar:function(d){d=a.extend({autosearch:true,searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND"},d||{});return this.each(function(){function e(k,n){var m=a(k);m[0]!=null&&jQuery.each(n,function(){this.data!=null?m.bind(this.type,this.data,this.fn):m.bind(this.type,this.fn)})}var b=this,f=function(){var k={},
177
- n=0,m,p,r={};a.each(b.p.colModel,function(){p=this.index||this.name;var B=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:"bw";switch(this.stype){case "select":if(m=a("select[name="+p+"]",b.grid.hDiv).val()){k[p]=m;r[p]=B;n++}else try{delete b.p.postData[p]}catch(C){}break;case "text":if(m=a("input[name="+p+"]",b.grid.hDiv).val()){k[p]=m;r[p]=B;n++}else try{delete b.p.postData[p]}catch(y){}break}});var q=n>0?true:false;if(d.stringResult){var u='{"groupOp":"'+d.groupOp+'","rules":[',
178
- v=0;a.each(k,function(B,C){if(v>0)u+=",";u+='{"field":"'+B+'",';u+='"op":"'+r[B]+'",';u+='"data":"'+C+'"}';v++});u+="]}";a.extend(b.p.postData,{filters:u})}else a.extend(b.p.postData,k);var w;if(b.p.searchurl){w=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var z=false;if(a.isFunction(d.beforeSearch))z=d.beforeSearch.call(b);z||a(b).jqGrid("setGridParam",{search:q}).trigger("reloadGrid",[{page:1}]);w&&a(b).jqGrid("setGridParam",{url:w});a.isFunction(d.afterSearch)&&d.afterSearch()},g=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),
179
- h,j,c,l;a.each(b.p.colModel,function(){var k=this;h=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+b.p.direction+"'></th>");j=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");this.hidden===true&&a(h).css("display","none");this.search=this.search===false?false:true;if(typeof this.stype=="undefined")this.stype="text";c=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":var n=this.surl||c.dataUrl;if(n)a.ajax(a.extend({url:n,
180
- dataType:"html",complete:function(u){if(c.buildSelect!=null)(u=c.buildSelect(u))&&a(j).append(u);else a(j).append(u.responseText);c.defaultValue&&a("select",j).val(c.defaultValue);a("select",j).attr({name:k.index||k.name,id:"gs_"+k.name});c.attr&&a("select",j).attr(c.attr);a("select",j).css({width:"100%"});c.dataInit!=null&&c.dataInit(a("select",j)[0]);c.dataEvents!=null&&e(a("select",j)[0],c.dataEvents);d.autosearch===true&&a("select",j).change(function(){f();return false})}},a.jgrid.ajaxOptions,
181
- b.p.ajaxSelectOptions||{}));else{var m;if(k.searchoptions&&k.searchoptions.value)m=k.searchoptions.value;else if(k.editoptions&&k.editoptions.value)m=k.editoptions.value;if(m){n=document.createElement("select");n.style.width="100%";a(n).attr({name:k.index||k.name,id:"gs_"+k.name});if(typeof m==="string"){m=m.split(";");for(var p,r,q=0;q<m.length;q++){p=m[q].split(":");r=document.createElement("option");r.value=p[0];r.innerHTML=p[1];n.appendChild(r)}}else if(typeof m==="object")for(p in m){r=document.createElement("option");
182
- r.value=p;r.innerHTML=m[p];n.appendChild(r)}c.defaultValue&&a(n).val(c.defaultValue);c.attr&&a(n).attr(c.attr);c.dataInit!=null&&c.dataInit(n);c.dataEvents!=null&&e(n,c.dataEvents);a(j).append(n);d.autosearch===true&&a(n).change(function(){f();return false})}}break;case "text":n=c.defaultValue?c.defaultValue:"";a(j).append("<input type='text' style='width:95%;padding:0px;' name='"+(k.index||k.name)+"' id='gs_"+k.name+"' value='"+n+"'/>");c.attr&&a("input",j).attr(c.attr);c.dataInit!=null&&c.dataInit(a("input",
183
- j)[0]);c.dataEvents!=null&&e(a("input",j)[0],c.dataEvents);if(d.autosearch===true)d.searchOnEnter?a("input",j).keypress(function(u){if((u.charCode?u.charCode:u.keyCode?u.keyCode:0)==13){f();return false}return this}):a("input",j).keydown(function(u){switch(u.which){case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:l&&clearTimeout(l);l=setTimeout(function(){f()},500)}});break}a(h).append(j);a(g).append(h)});a("table thead",b.grid.hDiv).append(g);this.triggerToolbar=f;this.clearToolbar=
184
- function(k){var n={},m,p=0,r;k=typeof k!="boolean"?true:k;a.each(b.p.colModel,function(){m=this.searchoptions&&this.searchoptions.defaultValue?this.searchoptions.defaultValue:"";r=this.index||this.name;switch(this.stype){case "select":var B;a("select[name="+r+"] option",b.grid.hDiv).each(function(F){if(F==0)this.selected=true;if(a(this).text()==m){this.selected=true;B=a(this).val();return false}});if(B){n[r]=B;p++}else try{delete b.p.postData[r]}catch(C){}break;case "text":a("input[name="+r+"]",b.grid.hDiv).val(m);
185
- if(m){n[r]=m;p++}else try{delete b.p.postData[r]}catch(y){}break}});var q=p>0?true:false;if(d.stringResult){var u='{"groupOp":"'+d.groupOp+'","rules":[',v=0;a.each(n,function(B,C){if(v>0)u+=",";u+='{"field":"'+B+'",';u+='"op":"eq",';u+='"data":"'+C+'"}';v++});u+="]}";a.extend(b.p.postData,{filters:u})}else a.extend(b.p.postData,n);var w;if(b.p.searchurl){w=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var z=false;if(a.isFunction(d.beforeClear))z=d.beforeClear.call(b);z||k&&a(b).jqGrid("setGridParam",
186
- {search:q}).trigger("reloadGrid",[{page:1}]);w&&a(b).jqGrid("setGridParam",{url:w});a.isFunction(d.afterClear)&&d.afterClear()};this.toggleToolbar=function(){var k=a("tr.ui-search-toolbar",b.grid.hDiv);k.css("display")=="none"?k.show():k.hide()}})}})})(jQuery);
187
- (function(a){var d=null;a.jgrid.extend({searchGrid:function(e){e=a.extend({recreateFilter:false,drag:true,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,closeAfterSearch:false,closeOnEscape:false,multipleSearch:false,sopt:null,onClose:null},a.jgrid.search,e||{});return this.each(function(){function b(z){var B=z!==undefined,C=a("#"+j.p.id),y={};if(e.multipleSearch===false){y[e.sField]=z.rules[0].field;
188
- y[e.sValue]=z.rules[0].data;y[e.sOper]=z.rules[0].op}else y[e.sFilter]=z;C[0].p.search=B;a.extend(C[0].p.postData,y);C.trigger("reloadGrid",[{page:1}]);e.closeAfterSearch&&g(a("#"+c))}function f(z){z=z!==undefined;var B=a("#"+j.p.id),C=[];B[0].p.search=z;if(e.multipleSearch===false)C[e.sField]=C[e.sValue]=C[e.sOper]="";else C[e.sFilter]="";a.extend(B[0].p.postData,C);B.trigger("reloadGrid",[{page:1}])}function g(z){if(e.onClose){var B=e.onClose(z);if(typeof B=="boolean"&&!B)return}z.hide();a(".jqgrid-overlay:first",
189
- "#gbox_"+j.p.id).hide()}function h(){var z=a(".ui-searchFilter").length;if(z>1){var B=a("#"+c).css("zIndex");a("#"+c).css({zIndex:parseInt(B)+z})}a("#"+c).show();a(".jqgrid-overlay:first","#gbox_"+j.p.id).show();try{a(":input:visible","#"+c)[0].focus()}catch(C){}}var j=this;if(j.grid)if(a.fn.searchFilter){var c="fbox_"+j.p.id;e.recreateFilter===true&&a("#"+c).remove();if(a("#"+c).html()!=null){a.isFunction(e.beforeShowSearch)&&e.beforeShowSearch(a("#"+c));h();a.isFunction(e.afterShowSearch)&&e.afterShowSearch(a("#"+
190
- c))}else{var l=[],k=a("#"+j.p.id).jqGrid("getGridParam","colNames"),n=a("#"+j.p.id).jqGrid("getGridParam","colModel"),m=["eq","ne","lt","le","gt","ge","bw","bn","in","ni","ew","en","cn","nc"],p,r,q,u;u=jQuery.fn.searchFilter.defaults.operators;if(e.sopt!=null){u=[];for(p=q=0;p<e.sopt.length;p++)if((r=a.inArray(e.sopt[p],m))!=-1){u[q]={op:e.sopt[p],text:e.odata[r]};q++}}var v;a.each(n,function(z,B){v=typeof B.search==="undefined"?true:B.search;hidden=B.hidden===true;soptions=a.extend({},{text:k[z],
191
- itemval:B.index||B.name},this.searchoptions);ignoreHiding=soptions.searchhidden===true;if(typeof soptions.sopt=="undefined")soptions.sopt=e.sopt||m;q=0;soptions.ops=[];if(soptions.sopt.length>0)for(p=0;p<soptions.sopt.length;p++)if((r=a.inArray(soptions.sopt[p],m))!=-1){soptions.ops[q]={op:soptions.sopt[p],text:e.odata[r]};q++}if(typeof this.stype==="undefined")this.stype="text";if(this.stype=="select")if(soptions.dataUrl==null){var C;if(soptions.value)C=soptions.value;else if(this.editoptions)C=
192
- this.editoptions.value;if(C){soptions.dataValues=[];if(typeof C==="string"){z=C.split(";");for(p=0;p<z.length;p++){B=z[p].split(":");soptions.dataValues[p]={value:B[0],text:B[1]}}}else if(typeof C==="object"){p=0;for(var y in C){soptions.dataValues[p]={value:y,text:C[y]};p++}}}}if(ignoreHiding&&v||v&&!hidden)l.push(soptions)});if(l.length>0){a("<div id='"+c+"' role='dialog' tabindex='-1'></div>").insertBefore("#gview_"+j.p.id);a("#"+c).searchFilter(l,{groupOps:e.groupOps,operators:u,onClose:g,resetText:e.Reset,
193
- searchText:e.Find,windowTitle:e.caption,rulesText:e.rulesText,matchText:e.matchText,onSearch:b,onReset:f,stringResult:e.multipleSearch,ajaxSelectOptions:a.extend({},a.jgrid.ajaxOptions,j.p.ajaxSelectOptions||{})});a(".ui-widget-overlay","#"+c).remove();j.p.direction=="rtl"&&a(".ui-closer","#"+c).css("float","left");if(e.drag===true){a("#"+c+" table thead tr:first td:first").css("cursor","move");if(jQuery.fn.jqDrag)a("#"+c).jqDrag(a("#"+c+" table thead tr:first td:first"));else try{a("#"+c).draggable({handle:a("#"+
194
- c+" table thead tr:first td:first")})}catch(w){}}if(e.multipleSearch===false){a(".ui-del, .ui-add, .ui-del, .ui-add-last, .matchText, .rulesText","#"+c).hide();a("select[name='groupOp']","#"+c).hide()}a.isFunction(e.onInitializeSearch)&&e.onInitializeSearch(a("#"+c));a.isFunction(e.beforeShowSearch)&&e.beforeShowSearch(a("#"+c));h();a.isFunction(e.afterShowSearch)&&e.afterShowSearch(a("#"+c));e.closeOnEscape===true&&a("#"+c).keydown(function(z){z.which==27&&g(a("#"+c))})}}}})},editGridRow:function(e,
195
- b){d=b=a.extend({top:0,left:0,width:300,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,url:null,mtype:"POST",clearAfterAdd:true,closeAfterEdit:false,reloadAfterSubmit:true,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:false,jqModal:true,closeOnEscape:false,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],
196
- closeicon:[],savekey:[false,13],navkeys:[false,38,40],checkOnSubmit:false,checkOnUpdate:false,_savedData:{},processing:false,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:true},a.jgrid.edit,b||{});return this.each(function(){function f(E,G){E==0?a("#pData","#"+q+"_2").addClass("ui-state-disabled"):a("#pData","#"+q+"_2").removeClass("ui-state-disabled");E==G?a("#nData","#"+q+"_2").addClass("ui-state-disabled"):a("#nData","#"+q+"_2").removeClass("ui-state-disabled")}function g(){var E=
197
- a(m).jqGrid("getDataIDs"),G=a("#id_g","#"+q).val();return[a.inArray(G,E),E]}function h(){var E=true;a("#FormError","#"+q).hide();if(d.checkOnUpdate){x={};M={};j();Y=a.extend({},x,M);if(da=n(Y,d._savedData)){a("#"+r).data("disabled",true);a(".confirm","#"+u.themodal).show();E=false}}return E}function j(){a(".FormElement","#"+q).each(function(){var E=a(".customelement",this);if(E.length){var G=E[0].name;a.each(m.p.colModel,function(){if(this.name==G&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{x[G]=
198
- this.editoptions.custom_value(a("#"+G,"#"+q),"get");if(x[G]===undefined)throw"e1";}catch(L){L=="e1"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,L.message,jQuery.jgrid.edit.bClose)}return true}})}else{switch(a(this).get(0).type){case "checkbox":if(a(this).attr("checked"))x[this.name]=a(this).val();else{E=a(this).attr("offval");x[this.name]=E}break;case "select-one":x[this.name]=a("option:selected",
199
- this).val();M[this.name]=a("option:selected",this).text();break;case "select-multiple":x[this.name]=a(this).val();x[this.name]=x[this.name]?x[this.name].join(","):"";var V=[];a("option:selected",this).each(function(L,W){V[L]=a(W).text()});M[this.name]=V.join(",");break;case "password":case "text":case "textarea":case "button":x[this.name]=a(this).val();break}if(m.p.autoencode)x[this.name]=a.jgrid.htmlEncode(x[this.name])}});return true}function c(E,G,V,L){for(var W,R,S,T=0,K,ba,Z,ka=[],aa=false,wa,
200
- ta,la="",ma=1;ma<=L;ma++)la+="<td class='CaptionTD ui-widget-content'>&#160;</td><td class='DataTD ui-widget-content' style='white-space:pre'>&#160;</td>";if(E!="_empty")aa=a(G).jqGrid("getInd",E);a(G.p.colModel).each(function(oa){W=this.name;ba=(R=this.editrules&&this.editrules.edithidden==true?false:this.hidden===true?true:false)?"style='display:none'":"";if(W!=="cb"&&W!=="subgrid"&&this.editable===true&&W!=="rn"){if(aa===false)K="";else if(W==G.p.ExpandColumn&&G.p.treeGrid===true)K=a("td:eq("+
201
- oa+")",G.rows[aa]).text();else try{K=a.unformat(a("td:eq("+oa+")",G.rows[aa]),{rowId:E,colModel:this},oa)}catch(Ia){K=a("td:eq("+oa+")",G.rows[aa]).html()}var xa=a.extend({},this.editoptions||{},{id:W,name:W});frmopt=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{});wa=parseInt(frmopt.rowpos)||T+1;ta=parseInt((parseInt(frmopt.colpos)||1)*2);if(E=="_empty"&&xa.defaultValue)K=a.isFunction(xa.defaultValue)?xa.defaultValue():xa.defaultValue;if(!this.edittype)this.edittype=
202
- "text";if(m.p.autoencode)K=a.jgrid.htmlDecode(K);Z=createEl(this.edittype,xa,K,false,a.extend({},a.jgrid.ajaxOptions,G.p.ajaxSelectOptions||{}));if(K==""&&this.edittype=="checkbox")K=a(Z).attr("offval");if(d.checkOnSubmit||d.checkOnUpdate)d._savedData[W]=K;a(Z).addClass("FormElement");S=a(V).find("tr[rowpos="+wa+"]");if(frmopt.rowabove){xa=a("<tr><td class='contentinfo' colspan='"+L*2+"'>"+frmopt.rowcontent+"</td></tr>");a(V).append(xa);xa[0].rp=wa}if(S.length==0){S=a("<tr "+ba+" rowpos='"+wa+"'></tr>").addClass("FormData").attr("id",
203
- "tr_"+W);a(S).append(la);a(V).append(S);S[0].rp=wa}a("td:eq("+(ta-2)+")",S[0]).html(typeof frmopt.label==="undefined"?G.p.colNames[oa]:frmopt.label);a("td:eq("+(ta-1)+")",S[0]).append(frmopt.elmprefix).append(Z).append(frmopt.elmsuffix);ka[T]=oa;T++}});if(T>0){ma=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(L*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+G.p.id+"_id' value='"+E+"'/></td></tr>");ma[0].rp=T+999;a(V).append(ma);
204
- if(d.checkOnSubmit||d.checkOnUpdate)d._savedData.id=E}return ka}function l(E,G,V){var L,W=0,R,S,T,K,ba;if(d.checkOnSubmit||d.checkOnUpdate){d._savedData={};d._savedData.id=E}var Z=G.p.colModel;if(E=="_empty"){a(Z).each(function(){L=this.name;T=a.extend({},this.editoptions||{});S=a("#"+a.jgrid.jqID(L),"#"+V);if(S[0]!=null){K="";if(T.defaultValue){K=a.isFunction(T.defaultValue)?T.defaultValue():T.defaultValue;if(S[0].type=="checkbox"){ba=K.toLowerCase();if(ba.search(/(false|0|no|off|undefined)/i)<0&&
205
- ba!==""){S[0].checked=true;S[0].defaultChecked=true;S[0].value=K}else S.attr({checked:"",defaultChecked:""})}else S.val(K)}else if(S[0].type=="checkbox"){S[0].checked=false;S[0].defaultChecked=false;K=a(S).attr("offval")}else if(S[0].type.substr(0,6)=="select")S[0].selectedIndex=0;else S.val(K);if(d.checkOnSubmit===true||d.checkOnUpdate)d._savedData[L]=K}});a("#id_g","#"+V).val(E)}else{var ka=a(G).jqGrid("getInd",E,true);if(ka){a("td",ka).each(function(aa){L=Z[aa].name;if(L!=="cb"&&L!=="subgrid"&&
206
- L!=="rn"&&Z[aa].editable===true){if(L==G.p.ExpandColumn&&G.p.treeGrid===true)R=a(this).text();else try{R=a.unformat(this,{rowId:E,colModel:Z[aa]},aa)}catch(wa){R=a(this).html()}if(m.p.autoencode)R=a.jgrid.htmlDecode(R);if(d.checkOnSubmit===true||d.checkOnUpdate)d._savedData[L]=R;L=a.jgrid.jqID(L);switch(Z[aa].edittype){case "password":case "text":case "button":case "image":a("#"+L,"#"+V).val(R);break;case "textarea":if(R=="&nbsp;"||R=="&#160;"||R.length==1&&R.charCodeAt(0)==160)R="";a("#"+L,"#"+V).val(R);
207
- break;case "select":var ta=R.split(",");ta=a.map(ta,function(ma){return a.trim(ma)});a("#"+L+" option","#"+V).each(function(){this.selected=!Z[aa].editoptions.multiple&&(ta[0]==a(this).text()||ta[0]==a(this).val())?true:Z[aa].editoptions.multiple?a.inArray(a(this).text(),ta)>-1||a.inArray(a(this).val(),ta)>-1?true:false:false});break;case "checkbox":R+="";R=R.toLowerCase();if(R.search(/(false|0|no|off|undefined)/i)<0&&R!==""){a("#"+L,"#"+V).attr("checked",true);a("#"+L,"#"+V).attr("defaultChecked",
208
- true)}else{a("#"+L,"#"+V).attr("checked",false);a("#"+L,"#"+V).attr("defaultChecked","")}break;case "custom":try{if(Z[aa].editoptions&&a.isFunction(Z[aa].editoptions.custom_value))Z[aa].editoptions.custom_value(a("#"+L,"#"+V),"set",R);else throw"e1";}catch(la){la=="e1"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,la.message,jQuery.jgrid.edit.bClose)}break}W++}});W>0&&a("#id_g","#"+q).val(E)}}}
209
- function k(){var E,G=[true,"",""],V={},L=m.p.prmNames,W,R;if(a.isFunction(d.beforeCheckValues)){var S=d.beforeCheckValues(x,a("#"+r),x[m.p.id+"_id"]=="_empty"?L.addoper:L.editoper);if(S&&typeof S==="object")x=S}for(var T in x){G=checkValues(x[T],T,m);if(G[0]==false)break}if(G[0]){if(a.isFunction(d.onclickSubmit))V=d.onclickSubmit(d,x)||{};if(a.isFunction(d.beforeSubmit))G=d.beforeSubmit(x,a("#"+r))}F=d.url?d.url:a(m).jqGrid("getGridParam","editurl");if(G[0])if(!F){G[0]=false;G[1]+=" "+a.jgrid.errors.nourl}if(G[0]===
210
- false){a("#FormError>td","#"+q).html(G[1]);a("#FormError","#"+q).show()}else if(!d.processing){d.processing=true;a("#sData","#"+q+"_2").addClass("ui-state-active");R=L.oper;W=L.id;x[R]=a.trim(x[m.p.id+"_id"])=="_empty"?L.addoper:L.editoper;if(x[R]!=L.addoper)x[W]=x[m.p.id+"_id"];else if(x[W]===undefined)x[W]=x[m.p.id+"_id"];delete x[m.p.id+"_id"];x=a.extend(x,d.editData,V);a.ajax(a.extend({url:F,type:d.mtype,data:a.isFunction(d.serializeEditData)?d.serializeEditData(x):x,complete:function(K,ba){if(ba!=
211
- "success"){G[0]=false;G[1]=a.isFunction(d.errorTextFormat)?d.errorTextFormat(K):ba+" Status: '"+K.statusText+"'. Error code: "+K.status}else if(a.isFunction(d.afterSubmit))G=d.afterSubmit(K,x);if(G[0]===false){a("#FormError>td","#"+q).html(G[1]);a("#FormError","#"+q).show()}else{a.each(m.p.colModel,function(){if(M[this.name]&&this.formatter&&this.formatter=="select")try{delete M[this.name]}catch(ka){}});x=a.extend(x,M);m.p.autoencode&&a.each(x,function(ka,aa){x[ka]=a.jgrid.htmlDecode(aa)});if(x[R]==
212
- L.addoper){G[2]||(G[2]=parseInt(m.p.records)+1);x[W]=G[2];if(d.closeAfterAdd){if(d.reloadAfterSubmit)a(m).trigger("reloadGrid");else{a(m).jqGrid("addRowData",G[2],x,b.addedrow);a(m).jqGrid("setSelection",G[2])}hideModal("#"+u.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:d.onClose})}else if(d.clearAfterAdd){d.reloadAfterSubmit?a(m).trigger("reloadGrid"):a(m).jqGrid("addRowData",G[2],x,b.addedrow);l("_empty",m,r)}else d.reloadAfterSubmit?a(m).trigger("reloadGrid"):a(m).jqGrid("addRowData",G[2],x,b.addedrow)}else{if(d.reloadAfterSubmit){a(m).trigger("reloadGrid");
213
- d.closeAfterEdit||setTimeout(function(){a(m).jqGrid("setSelection",x[W])},1E3)}else m.p.treeGrid===true?a(m).jqGrid("setTreeRow",x[W],x):a(m).jqGrid("setRowData",x[W],x);d.closeAfterEdit&&hideModal("#"+u.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:d.onClose})}if(a.isFunction(d.afterComplete)){E=K;setTimeout(function(){d.afterComplete(E,x,a("#"+r));E=null},500)}}d.processing=false;if(d.checkOnSubmit||d.checkOnUpdate){a("#"+r).data("disabled",false);if(d._savedData.id!="_empty")d._savedData=x}a("#sData",
214
- "#"+q+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+r)[0].focus()}catch(Z){}},error:function(K,ba,Z){a("#FormError>td","#"+q).html(ba+" : "+Z);a("#FormError","#"+q).show();d.processing=false;a("#"+r).data("disabled",false);a("#sData","#"+q+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,d.ajaxEditOptions))}}function n(E,G){var V=false,L;for(L in E)if(E[L]!=G[L]){V=true;break}return V}var m=this;if(m.grid&&e){var p=m.p.id,r="FrmGrid_"+p,q="TblGrid_"+p,u={themodal:"editmod"+
215
- p,modalhead:"edithd"+p,modalcontent:"editcnt"+p,scrollelm:r},v=a.isFunction(d.beforeShowForm)?d.beforeShowForm:false,w=a.isFunction(d.afterShowForm)?d.afterShowForm:false,z=a.isFunction(d.beforeInitData)?d.beforeInitData:false,B=a.isFunction(d.onInitializeForm)?d.onInitializeForm:false,C=1,y=0,F,x,M,Y,da;if(e=="new"){e="_empty";b.caption=b.addCaption}else b.caption=b.editCaption;b.recreateForm===true&&a("#"+u.themodal).html()!=null&&a("#"+u.themodal).remove();var Q=true;if(b.checkOnUpdate&&b.jqModal&&
216
- !b.modal)Q=false;if(a("#"+u.themodal).html()!=null){a(".ui-jqdialog-title","#"+u.modalhead).html(b.caption);a("#FormError","#"+q).hide();if(d.topinfo){a(".topinfo","#"+q+"_2").html(d.topinfo);a(".tinfo","#"+q+"_2").show()}else a(".tinfo","#"+q+"_2").hide();if(d.bottominfo){a(".bottominfo","#"+q+"_2").html(d.bottominfo);a(".binfo","#"+q+"_2").show()}else a(".binfo","#"+q+"_2").hide();z&&z(a("#"+r));l(e,m,r);e=="_empty"||!d.viewPagerButtons?a("#pData, #nData","#"+q+"_2").hide():a("#pData, #nData","#"+
217
- q+"_2").show();if(d.processing===true){d.processing=false;a("#sData","#"+q+"_2").removeClass("ui-state-active")}if(a("#"+r).data("disabled")===true){a(".confirm","#"+u.themodal).hide();a("#"+r).data("disabled",false)}v&&v(a("#"+r));a("#"+u.themodal).data("onClose",d.onClose);viewModal("#"+u.themodal,{gbox:"#gbox_"+p,jqm:b.jqModal,jqM:false,closeoverlay:Q,modal:b.modal});Q||a(".jqmOverlay").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:d.onClose});
218
- return false});w&&w(a("#"+r))}else{a(m.p.colModel).each(function(){var E=this.formoptions;C=Math.max(C,E?E.colpos||0:0);y=Math.max(y,E?E.rowpos||0:0)});var ea=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",U;ea=a("<form name='FormPost' id='"+r+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+ea+";'></form>").data("disabled",false);var ga=a("<table id='"+q+"' class='EditTable' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");a(ea).append(ga);U=a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+
219
- C*2+"'></td></tr>");U[0].rp=0;a(ga).append(U);U=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+C*2+"'>"+d.topinfo+"</td></tr>");U[0].rp=0;a(ga).append(U);z&&z(a("#"+r));U=(z=m.p.direction=="rtl"?true:false)?"nData":"pData";var sa=z?"pData":"nData";c(e,m,ga,C);U="<a href='javascript:void(0)' id='"+U+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>";sa="<a href='javascript:void(0)' id='"+sa+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>";
220
- var za="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>",Ca="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>";U="<table border='0' class='EditTable' id='"+q+"_2'><tbody><tr id='Act_Buttons'><td class='navButton ui-widget-content'>"+(z?sa+U:U+sa)+"</td><td class='EditButton ui-widget-content'>"+za+Ca+"</td></tr>";U+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+
221
- d.bottominfo+"</td></tr>";U+="</tbody></table>";if(y>0){var va=[];a.each(a(ga)[0].rows,function(E,G){va[E]=G});va.sort(function(E,G){if(E.rp>G.rp)return 1;if(E.rp<G.rp)return-1;return 0});a.each(va,function(E,G){a("tbody",ga).append(G)})}b.gbox="#gbox_"+p;var Ga=false;if(b.closeOnEscape===true){b.closeOnEscape=false;Ga=true}ea=a("<span></span>").append(ea).append(U);createModal(u,ea,b,"#gview_"+m.p.id,a("#gview_"+m.p.id)[0]);if(z){a("#pData, #nData","#"+q+"_2").css("float","right");a(".EditButton",
222
- "#"+q+"_2").css("text-align","left")}d.topinfo&&a(".tinfo","#"+q+"_2").show();d.bottominfo&&a(".binfo","#"+q+"_2").show();U=ea=null;a("#"+u.themodal).keydown(function(E){var G=E.target;if(a("#"+r).data("disabled")===true)return false;if(d.savekey[0]===true&&E.which==d.savekey[1])if(G.tagName!="TEXTAREA"){a("#sData","#"+q+"_2").trigger("click");return false}if(E.which===27){if(!h())return false;Ga&&hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:d.onClose});return false}if(d.navkeys[0]===true){if(a("#id_g",
223
- "#"+q).val()=="_empty")return true;if(E.which==d.navkeys[1]){a("#pData","#"+q+"_2").trigger("click");return false}if(E.which==d.navkeys[2]){a("#nData","#"+q+"_2").trigger("click");return false}}});if(b.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+u.themodal).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+u.themodal).unbind("click").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:d.onClose});return false})}b.saveicon=a.extend([true,
224
- "left","ui-icon-disk"],b.saveicon);b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.saveicon[0]==true)a("#sData","#"+q+"_2").addClass(b.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.saveicon[2]+"'></span>");if(b.closeicon[0]==true)a("#cData","#"+q+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");if(d.checkOnSubmit||d.checkOnUpdate){za=
225
- "<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bYes+"</a>";sa="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bNo+"</a>";Ca="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bExit+"</a>";ea=b.zIndex||999;ea++;a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+ea+";display:none;'>&#160;"+
226
- (a.browser.msie&&a.browser.version==6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"")+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(ea+1)+"'>"+b.saveData+"<br/><br/>"+za+sa+Ca+"</div>").insertAfter("#"+r);a("#sNew","#"+u.themodal).click(function(){k();a("#"+r).data("disabled",false);a(".confirm","#"+u.themodal).hide();return false});a("#nNew","#"+u.themodal).click(function(){a(".confirm",
227
- "#"+u.themodal).hide();a("#"+r).data("disabled",false);setTimeout(function(){a(":input","#"+r)[0].focus()},0);return false});a("#cNew","#"+u.themodal).click(function(){a(".confirm","#"+u.themodal).hide();a("#"+r).data("disabled",false);hideModal("#"+u.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:d.onClose});return false})}B&&B(a("#"+r));e=="_empty"||!d.viewPagerButtons?a("#pData,#nData","#"+q+"_2").hide():a("#pData,#nData","#"+q+"_2").show();v&&v(a("#"+r));a("#"+u.themodal).data("onClose",d.onClose);
228
- viewModal("#"+u.themodal,{gbox:"#gbox_"+p,jqm:b.jqModal,closeoverlay:Q,modal:b.modal});Q||a(".jqmOverlay").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:d.onClose});return false});w&&w(a("#"+r));a(".fm-button","#"+u.themodal).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a("#sData","#"+q+"_2").click(function(){x={};M={};a("#FormError","#"+q).hide();j();if(x[m.p.id+"_id"]=="_empty")k();else if(b.checkOnSubmit===
229
- true){Y=a.extend({},x,M);if(da=n(Y,d._savedData)){a("#"+r).data("disabled",true);a(".confirm","#"+u.themodal).show()}else k()}else k();return false});a("#cData","#"+q+"_2").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:d.onClose});return false});a("#nData","#"+q+"_2").click(function(){if(!h())return false;a("#FormError","#"+q).hide();var E=g();E[0]=parseInt(E[0]);if(E[0]!=-1&&E[1][E[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",
230
- a("#"+r),E[1][E[0]]);l(E[1][E[0]+1],m,r);a(m).jqGrid("setSelection",E[1][E[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",a("#"+r),E[1][E[0]+1]);f(E[0]+1,E[1].length-1)}return false});a("#pData","#"+q+"_2").click(function(){if(!h())return false;a("#FormError","#"+q).hide();var E=g();if(E[0]!=-1&&E[1][E[0]-1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("prev",a("#"+r),E[1][E[0]]);l(E[1][E[0]-1],m,r);a(m).jqGrid("setSelection",E[1][E[0]-1]);a.isFunction(b.afterclickPgButtons)&&
231
- b.afterclickPgButtons("prev",a("#"+r),E[1][E[0]-1]);f(E[0]-1,E[1].length-1)}return false})}v=g();f(v[0],v[1].length-1)}})},viewGridRow:function(e,b){b=a.extend({top:0,left:0,width:0,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,jqModal:true,closeOnEscape:false,labelswidth:"30%",closeicon:[],navkeys:[false,38,40],onClose:null,beforeShowForm:null,viewPagerButtons:true},a.jgrid.view,b||{});return this.each(function(){function f(){if(b.closeOnEscape===true||b.navkeys[0]===true)setTimeout(function(){a(".ui-jqdialog-titlebar-close",
232
- "#"+p.modalhead).focus()},0)}function g(x,M){x==0?a("#pData","#"+m+"_2").addClass("ui-state-disabled"):a("#pData","#"+m+"_2").removeClass("ui-state-disabled");x==M?a("#nData","#"+m+"_2").addClass("ui-state-disabled"):a("#nData","#"+m+"_2").removeClass("ui-state-disabled")}function h(){var x=a(l).jqGrid("getDataIDs"),M=a("#id_g","#"+m).val();return[a.inArray(M,x),x]}function j(x,M,Y,da){for(var Q,ea,U,ga=0,sa,za,Ca=[],va=false,Ga="<td class='CaptionTD form-view-label ui-widget-content' width='"+b.labelswidth+
233
- "'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",E="",G=["integer","number","currency"],V=0,L=0,W,R,S,T=1;T<=da;T++)E+=T==1?Ga:"<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";a(M.p.colModel).each(function(){ea=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false;if(!ea&&this.align==="right")if(this.formatter&&a.inArray(this.formatter,G)!==
234
- -1)V=Math.max(V,parseInt(this.width,10));else L=Math.max(L,parseInt(this.width,10))});W=V!==0?V:L!==0?L:0;va=a(M).jqGrid("getInd",x);a(M.p.colModel).each(function(K){Q=this.name;R=false;za=(ea=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";S=typeof this.viewable!="boolean"?true:this.viewable;if(Q!=="cb"&&Q!=="subgrid"&&Q!=="rn"&&S){sa=va===false?"":Q==M.p.ExpandColumn&&M.p.treeGrid===true?a("td:eq("+K+")",M.rows[va]).text():a("td:eq("+
235
- K+")",M.rows[va]).html();R=this.align==="right"&&W!==0?true:false;a.extend({},this.editoptions||{},{id:Q,name:Q});var ba=a.extend({},{rowabove:false,rowcontent:""},this.formoptions||{}),Z=parseInt(ba.rowpos)||ga+1,ka=parseInt((parseInt(ba.colpos)||1)*2);if(ba.rowabove){var aa=a("<tr><td class='contentinfo' colspan='"+da*2+"'>"+ba.rowcontent+"</td></tr>");a(Y).append(aa);aa[0].rp=Z}U=a(Y).find("tr[rowpos="+Z+"]");if(U.length==0){U=a("<tr "+za+" rowpos='"+Z+"'></tr>").addClass("FormData").attr("id",
236
- "trv_"+Q);a(U).append(E);a(Y).append(U);U[0].rp=Z}a("td:eq("+(ka-2)+")",U[0]).html("<b>"+(typeof ba.label==="undefined"?M.p.colNames[K]:ba.label)+"</b>");a("td:eq("+(ka-1)+")",U[0]).append("<span>"+sa+"</span>").attr("id","v_"+Q);R&&a("td:eq("+(ka-1)+") span",U[0]).css({"text-align":"right",width:W+"px"});Ca[ga]=K;ga++}});if(ga>0){x=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(da*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+
237
- x+"'/></td></tr>");x[0].rp=ga+99;a(Y).append(x)}return Ca}function c(x,M){var Y,da,Q=0,ea,U;if(U=a(M).jqGrid("getInd",x,true)){a("td",U).each(function(ga){Y=M.p.colModel[ga].name;da=M.p.colModel[ga].editrules&&M.p.colModel[ga].editrules.edithidden===true?false:M.p.colModel[ga].hidden===true?true:false;if(Y!=="cb"&&Y!=="subgrid"&&Y!=="rn"){ea=Y==M.p.ExpandColumn&&M.p.treeGrid===true?a(this).text():a(this).html();a.extend({},M.p.colModel[ga].editoptions||{});Y=a.jgrid.jqID("v_"+Y);a("#"+Y+" span","#"+
238
- m).html(ea);da&&a("#"+Y,"#"+m).parents("tr:first").hide();Q++}});Q>0&&a("#id_g","#"+m).val(x)}}var l=this;if(l.grid&&e){if(!b.imgpath)b.imgpath=l.p.imgpath;var k=l.p.id,n="ViewGrid_"+k,m="ViewTbl_"+k,p={themodal:"viewmod"+k,modalhead:"viewhd"+k,modalcontent:"viewcnt"+k,scrollelm:n},r=1,q=0;if(a("#"+p.themodal).html()!=null){a(".ui-jqdialog-title","#"+p.modalhead).html(b.caption);a("#FormError","#"+m).hide();c(e,l);a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+n));viewModal("#"+p.themodal,
239
- {gbox:"#gbox_"+k,jqm:b.jqModal,jqM:false,modal:b.modal});f()}else{a(l.p.colModel).each(function(){var x=this.formoptions;r=Math.max(r,x?x.colpos||0:0);q=Math.max(q,x?x.rowpos||0:0)});var u=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",v=a("<form name='FormPost' id='"+n+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+u+";'></form>"),w=a("<table id='"+m+"' class='EditTable' cellspacing='1' cellpading='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
240
- a(v).append(w);j(e,l,w,r);u=l.p.direction=="rtl"?true:false;var z="<a href='javascript:void(0)' id='"+(u?"nData":"pData")+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>",B="<a href='javascript:void(0)' id='"+(u?"pData":"nData")+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>",C="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bClose+
241
- "</a>";if(q>0){var y=[];a.each(a(w)[0].rows,function(x,M){y[x]=M});y.sort(function(x,M){if(x.rp>M.rp)return 1;if(x.rp<M.rp)return-1;return 0});a.each(y,function(x,M){a("tbody",w).append(M)})}b.gbox="#gbox_"+k;var F=false;if(b.closeOnEscape===true){b.closeOnEscape=false;F=true}v=a("<span></span>").append(v).append("<table border='0' class='EditTable' id='"+m+"_2'><tbody><tr id='Act_Buttons'><td class='navButton ui-widget-content' width='"+b.labelswidth+"'>"+(u?B+z:z+B)+"</td><td class='EditButton ui-widget-content'>"+
242
- C+"</td></tr></tbody></table>");createModal(p,v,b,"#gview_"+l.p.id,a("#gview_"+l.p.id)[0]);if(u){a("#pData, #nData","#"+m+"_2").css("float","right");a(".EditButton","#"+m+"_2").css("text-align","left")}b.viewPagerButtons||a("#pData, #nData","#"+m+"_2").hide();v=null;a("#"+p.themodal).keydown(function(x){if(x.which===27){F&&hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:b.onClose});return false}if(b.navkeys[0]===true){if(x.which===b.navkeys[1]){a("#pData","#"+m+"_2").trigger("click");return false}if(x.which===
243
- b.navkeys[2]){a("#nData","#"+m+"_2").trigger("click");return false}}});b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.closeicon[0]==true)a("#cData","#"+m+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+n));viewModal("#"+p.themodal,{gbox:"#gbox_"+k,jqm:b.jqModal,modal:b.modal});a(".fm-button:not(.ui-state-disabled)","#"+m+"_2").hover(function(){a(this).addClass("ui-state-hover")},
244
- function(){a(this).removeClass("ui-state-hover")});f();a("#cData","#"+m+"_2").click(function(){hideModal("#"+p.themodal,{gb:"#gbox_"+k,jqm:b.jqModal,onClose:b.onClose});return false});a("#nData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var x=h();x[0]=parseInt(x[0]);if(x[0]!=-1&&x[1][x[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",a("#"+n),x[1][x[0]]);c(x[1][x[0]+1],l);a(l).jqGrid("setSelection",x[1][x[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",
245
- a("#"+n),x[1][x[0]+1]);g(x[0]+1,x[1].length-1)}f();return false});a("#pData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var x=h();if(x[0]!=-1&&x[1][x[0]-1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("prev",a("#"+n),x[1][x[0]]);c(x[1][x[0]-1],l);a(l).jqGrid("setSelection",x[1][x[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+n),x[1][x[0]-1]);g(x[0]-1,x[1].length-1)}f();return false})}u=h();g(u[0],u[1].length-1)}})},delGridRow:function(e,b){d=
246
- b=a.extend({top:0,left:0,width:240,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,url:"",mtype:"POST",reloadAfterSubmit:true,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:true,closeOnEscape:false,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:false,serializeDelData:null},a.jgrid.del,b||{});return this.each(function(){var f=this;if(f.grid)if(e){var g=typeof b.beforeShowForm==="function"?true:false,
247
- h=typeof b.afterShowForm==="function"?true:false,j=f.p.id,c={},l="DelTbl_"+j,k,n,m,p,r={themodal:"delmod"+j,modalhead:"delhd"+j,modalcontent:"delcnt"+j,scrollelm:l};if(isArray(e))e=e.join();if(a("#"+r.themodal).html()!=null){a("#DelData>td","#"+l).text(e);a("#DelError","#"+l).hide();if(d.processing===true){d.processing=false;a("#dData","#"+l).removeClass("ui-state-active")}g&&b.beforeShowForm(a("#"+l));viewModal("#"+r.themodal,{gbox:"#gbox_"+j,jqm:b.jqModal,jqM:false,modal:b.modal})}else{var q=isNaN(b.dataheight)?
248
- b.dataheight:b.dataheight+"px";q="<div id='"+l+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+q+";'>";q+="<table class='DelTable'><tbody>";q+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";q+="<tr id='DelData' style='display:none'><td >"+e+"</td></tr>";q+='<tr><td class="delmsg" style="white-space:pre;">'+b.msg+"</td></tr><tr><td >&#160;</td></tr>";q+="</tbody></table></div>";q+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+
249
- l+"_2'><tbody><tr><td class='DataTD ui-widget-content'></td></tr><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DelButton EditButton'>"+("<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>")+"</td></tr></tbody></table>";b.gbox="#gbox_"+j;createModal(r,q,b,"#gview_"+f.p.id,a("#gview_"+f.p.id)[0]);a(".fm-button",
250
- "#"+l+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});b.delicon=a.extend([true,"left","ui-icon-scissors"],b.delicon);b.cancelicon=a.extend([true,"left","ui-icon-cancel"],b.cancelicon);if(b.delicon[0]==true)a("#dData","#"+l+"_2").addClass(b.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.delicon[2]+"'></span>");if(b.cancelicon[0]==true)a("#eData","#"+l+"_2").addClass(b.cancelicon[1]=="right"?
251
- "fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.cancelicon[2]+"'></span>");a("#dData","#"+l+"_2").click(function(){var u=[true,""];c={};var v=a("#DelData>td","#"+l).text();if(typeof b.onclickSubmit==="function")c=b.onclickSubmit(d)||{};if(typeof b.beforeSubmit==="function")u=b.beforeSubmit(v);if(u[0]){var w=d.url?d.url:a(f).jqGrid("getGridParam","editurl");if(!w){u[0]=false;u[1]+=" "+a.jgrid.errors.nourl}}if(u[0]===false){a("#DelError>td","#"+l).html(u[1]);a("#DelError",
252
- "#"+l).show()}else if(!d.processing){d.processing=true;a(this).addClass("ui-state-active");m=f.p.prmNames;k=a.extend({},d.delData,c);p=m.oper;k[p]=m.deloper;n=m.id;k[n]=v;a.ajax(a.extend({url:w,type:b.mtype,data:a.isFunction(b.serializeDelData)?b.serializeDelData(k):k,complete:function(z,B){if(B!="success"){u[0]=false;u[1]=a.isFunction(d.errorTextFormat)?d.errorTextFormat(z):B+" Status: '"+z.statusText+"'. Error code: "+z.status}else if(typeof d.afterSubmit==="function")u=d.afterSubmit(z,k);if(u[0]===
253
- false){a("#DelError>td","#"+l).html(u[1]);a("#DelError","#"+l).show()}else{if(d.reloadAfterSubmit)a(f).trigger("reloadGrid");else{B=[];B=v.split(",");if(f.p.treeGrid===true)try{a(f).jqGrid("delTreeNode",B[0])}catch(C){}else for(var y=0;y<B.length;y++)a(f).jqGrid("delRowData",B[y]);f.p.selrow=null;f.p.selarrrow=[]}a.isFunction(d.afterComplete)&&setTimeout(function(){d.afterComplete(z,v)},500)}d.processing=false;a("#dData","#"+l+"_2").removeClass("ui-state-active");u[0]&&hideModal("#"+r.themodal,{gb:"#gbox_"+
254
- j,jqm:b.jqModal,onClose:d.onClose})},error:function(z,B,C){a("#DelError>td","#"+l).html(B+" : "+C);a("#DelError","#"+l).show();d.processing=false;a("#dData","#"+l+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,b.ajaxDelOptions))}return false});a("#eData","#"+l+"_2").click(function(){hideModal("#"+r.themodal,{gb:"#gbox_"+j,jqm:b.jqModal,onClose:d.onClose});return false});g&&b.beforeShowForm(a("#"+l));viewModal("#"+r.themodal,{gbox:"#gbox_"+j,jqm:b.jqModal,modal:b.modal})}h&&b.afterShowForm(a("#"+
255
- l));b.closeOnEscape===true&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+r.modalhead).focus()},0)}})},navGrid:function(e,b,f,g,h,j,c){b=a.extend({edit:true,editicon:"ui-icon-pencil",add:true,addicon:"ui-icon-plus",del:true,delicon:"ui-icon-trash",search:true,searchicon:"ui-icon-search",refresh:true,refreshicon:"ui-icon-refresh",refreshstate:"firstpage",view:false,viewicon:"ui-icon-document",position:"left",closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false},a.jgrid.nav,
256
- b||{});return this.each(function(){var l={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},k=this,n,m,p;if(!(!k.grid||typeof e!="string")){if(a("#"+l.themodal).html()==null){if(typeof window.innerWidth!="undefined"){n=window.innerWidth;m=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){n=document.documentElement.clientWidth;m=document.documentElement.clientHeight}else{n=
257
- 1024;m=768}createModal(l,"<div>"+b.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+k.p.id,jqModal:true,drag:true,resize:true,caption:b.alertcap,top:m/2-25,left:n/2-100,width:200,height:"auto",closeOnEscape:b.closeOnEscape},"","",true)}n=1;if(b.cloneToTop&&k.p.toppager)n=2;for(m=0;m<n;m++){var r=a("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
258
- q,u;if(m==0){q=e;u=k.p.id;if(q==k.p.toppager){u+="_top";n=1}}else{q=k.p.toppager;u=k.p.id+"_top"}k.p.direction=="rtl"&&a(r).attr("dir","rtl").css("float","right");if(b.add){g=g||{};p=a("<td class='ui-pg-button ui-corner-all'></td>");a(p).append("<div class='ui-pg-div'><span class='ui-icon "+b.addicon+"'></span>"+b.addtext+"</div>");a("tr",r).append(p);a(p,r).attr({title:b.addtitle||"",id:g.id||"add_"+u}).click(function(){typeof b.addfunc=="function"?b.addfunc():a(k).jqGrid("editGridRow","new",g);
259
- return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});p=null}if(b.edit){p=a("<td class='ui-pg-button ui-corner-all'></td>");f=f||{};a(p).append("<div class='ui-pg-div'><span class='ui-icon "+b.editicon+"'></span>"+b.edittext+"</div>");a("tr",r).append(p);a(p,r).attr({title:b.edittitle||"",id:f.id||"edit_"+u}).click(function(){var v=k.p.selrow;if(v)typeof b.editfunc=="function"?b.editfunc(v):a(k).jqGrid("editGridRow",v,f);else{viewModal("#"+
260
- l.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});p=null}if(b.view){p=a("<td class='ui-pg-button ui-corner-all'></td>");c=c||{};a(p).append("<div class='ui-pg-div'><span class='ui-icon "+b.viewicon+"'></span>"+b.viewtext+"</div>");a("tr",r).append(p);a(p,r).attr({title:b.viewtitle||"",id:c.id||"view_"+u}).click(function(){var v=k.p.selrow;if(v)a(k).jqGrid("viewGridRow",
261
- v,c);else{viewModal("#"+l.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});p=null}if(b.del){p=a("<td class='ui-pg-button ui-corner-all'></td>");h=h||{};a(p).append("<div class='ui-pg-div'><span class='ui-icon "+b.delicon+"'></span>"+b.deltext+"</div>");a("tr",r).append(p);a(p,r).attr({title:b.deltitle||"",id:h.id||"del_"+u}).click(function(){var v;if(k.p.multiselect){v=
262
- k.p.selarrrow;if(v.length==0)v=null}else v=k.p.selrow;if(v)a(k).jqGrid("delGridRow",v,h);else{viewModal("#"+l.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});p=null}if(b.add||b.edit||b.del||b.view)a("tr",r).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");if(b.search){p=a("<td class='ui-pg-button ui-corner-all'></td>");
263
- j=j||{};a(p).append("<div class='ui-pg-div'><span class='ui-icon "+b.searchicon+"'></span>"+b.searchtext+"</div>");a("tr",r).append(p);a(p,r).attr({title:b.searchtitle||"",id:j.id||"search_"+u}).click(function(){a(k).jqGrid("searchGrid",j);return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});p=null}if(b.refresh){p=a("<td class='ui-pg-button ui-corner-all'></td>");a(p).append("<div class='ui-pg-div'><span class='ui-icon "+b.refreshicon+
264
- "'></span>"+b.refreshtext+"</div>");a("tr",r).append(p);a(p,r).attr({title:b.refreshtitle||"",id:"refresh_"+u}).click(function(){a.isFunction(b.beforeRefresh)&&b.beforeRefresh();k.p.search=false;try{a("#fbox_"+k.p.id).searchFilter().reset();k.clearToolbar(false)}catch(v){}switch(b.refreshstate){case "firstpage":a(k).trigger("reloadGrid",[{page:1}]);break;case "current":a(k).trigger("reloadGrid",[{current:true}]);break}a.isFunction(b.afterRefresh)&&b.afterRefresh();return false}).hover(function(){a(this).addClass("ui-state-hover")},
265
- function(){a(this).removeClass("ui-state-hover")});p=null}p=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+p+";visibility:hidden;' ></div>");p=a(r).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(q+"_"+b.position,q).append(r);if(k.p._nvtd){if(p>k.p._nvtd[0]){a(q+"_"+b.position,q).width(p);k.p._nvtd[0]=p}k.p._nvtd[1]=p}r=p=p=null}}})},navButtonAdd:function(e,b){b=a.extend({caption:"newButton",
266
- title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!=0)e="#"+e;var f=a(".navtable",e)[0],g=this;if(f){var h=a("<td></td>");a(h).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+b.buttonicon+"'></span>"+b.caption+"</div>");b.id&&a(h).attr("id",b.id);if(b.position=="first")f.rows[0].cells.length===0?a("tr",f).append(h):a("tr td:eq(0)",f).before(h);else a("tr",
267
- f).append(h);a(h,f).attr("title",b.title||"").click(function(j){a.isFunction(b.onClickButton)&&b.onClickButton.call(g,j);return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).css("cursor",b.cursor?b.cursor:"normal")}}})},navSeparatorAdd:function(e,b){b=a.extend({sepclass:"ui-separator",sepcontent:""},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!=0)e="#"+e;var f=a(".navtable",e)[0];if(f){var g="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+
268
- b.sepclass+"'></span>"+b.sepcontent+"</td>";a("tr",f).append(g)}}})},GridToForm:function(e,b){return this.each(function(){var f=this;if(f.grid){var g=a(f).jqGrid("getRowData",e);if(g)for(var h in g)a("[name="+h+"]",b).is("input:radio")||a("[name="+h+"]",b).is("input:checkbox")?a("[name="+h+"]",b).each(function(){a(this).val()==g[h]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+h+"]",b).val(g[h])}})},FormToGrid:function(e,b,f,g){return this.each(function(){var h=this;if(h.grid){f||
269
- (f="set");g||(g="first");var j=a(b).serializeArray(),c={};a.each(j,function(l,k){c[k.name]=k.value});if(f=="add")a(h).jqGrid("addRowData",e,c,g);else f=="set"&&a(h).jqGrid("setRowData",e,c)}})}})})(jQuery);
270
- (function(a){a.jgrid.extend({jqGridImport:function(d){d=a.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},d||{});return this.each(function(){var e=this,b=function(h,j){var c=a(j.xmlGrid.config,h)[0];j=a(j.xmlGrid.data,h)[0];if(xmlJsonClass.xml2json&&a.jgrid.parse){c=xmlJsonClass.xml2json(c," ");c=a.jgrid.parse(c);for(var l in c)var k=c[l];if(j){l=c.grid.datatype;c.grid.datatype=
271
- "xmlstring";c.grid.datastr=h;a(e).jqGrid(k).jqGrid("setGridParam",{datatype:l})}else a(e).jqGrid(k)}else alert("xml2json or parse are not present")},f=function(h,j){if(h&&typeof h=="string"){var c=a.jgrid.parse(h);h=c[j.jsonGrid.config];if(j=c[j.jsonGrid.data]){c=h.datatype;h.datatype="jsonstring";h.datastr=j;a(e).jqGrid(h).jqGrid("setGridParam",{datatype:c})}else a(e).jqGrid(h)}};switch(d.imptype){case "xml":a.ajax(a.extend({url:d.impurl,type:d.mtype,data:d.impData,dataType:"xml",complete:function(h,
272
- j){if(j=="success"){b(h.responseXML,d);a.isFunction(d.importComplete)&&d.importComplete(h)}}},d.ajaxOptions));break;case "xmlstring":if(d.impstring&&typeof d.impstring=="string"){var g=a.jgrid.stringToDoc(d.impstring);if(g){b(g,d);a.isFunction(d.importComplete)&&d.importComplete(g);d.impstring=null}g=null}break;case "json":a.ajax(a.extend({url:d.impurl,type:d.mtype,data:d.impData,dataType:"json",complete:function(h,j){if(j=="success"){f(h.responseText,d);a.isFunction(d.importComplete)&&d.importComplete(h)}}},
273
- d.ajaxOptions));break;case "jsonstring":if(d.impstring&&typeof d.impstring=="string"){f(d.impstring,d);a.isFunction(d.importComplete)&&d.importComplete(d.impstring);d.impstring=null}break}})},jqGridExport:function(d){d=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},d||{});var e=null;this.each(function(){if(this.grid){var b=a.extend({},a(this).jqGrid("getGridParam"));if(b.rownumbers){b.colNames.splice(0,1);b.colModel.splice(0,1)}if(b.multiselect){b.colNames.splice(0,1);b.colModel.splice(0,1)}if(b.subgrid){b.colNames.splice(0,
274
- 1);b.colModel.splice(0,1)}if(b.treeGrid)for(var f in b.treeReader){b.colNames.splice(b.colNames.length-1);b.colModel.splice(b.colModel.length-1)}switch(d.exptype){case "xmlstring":e="<"+d.root+">"+xmlJsonClass.json2xml(b,d.ident)+"</"+d.root+">";break;case "jsonstring":e="{"+xmlJsonClass.toJson(b,d.root,d.ident)+"}";break}}});return e},excelExport:function(d){d=a.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},d||{});return this.each(function(){$t=this;if(this.grid)if(d.exptype==
275
- "remote"){var e=a.extend({},this.p.postData);e[d.oper]=d.tag;e=jQuery.param(e);window.location=d.url+"?"+e}})}})})(jQuery);
276
- (function(a){a.jgrid.extend({editRow:function(d,e,b,f,g,h,j,c,l){return this.each(function(){var k=this,n,m,p=0,r=null,q={},u,v;if(k.grid){u=a(k).jqGrid("getInd",d,true);if(u!=false)if((a(u).attr("editable")||"0")=="0"&&!a(u).hasClass("not-editable-row")){v=k.p.colModel;a("td",u).each(function(w){n=v[w].name;var z=k.p.treeGrid===true&&n==k.p.ExpandColumn;if(z)m=a("span:first",this).html();else try{m=a.unformat(this,{rowId:d,colModel:v[w]},w)}catch(B){m=a(this).html()}if(n!="cb"&&n!="subgrid"&&n!=
277
- "rn"){if(k.p.autoencode)m=a.jgrid.htmlDecode(m);q[n]=m;if(v[w].editable===true){if(r===null)r=w;z?a("span:first",this).html(""):a(this).html("");var C=a.extend({},v[w].editoptions||{},{id:d+"_"+n,name:n});if(!v[w].edittype)v[w].edittype="text";C=createEl(v[w].edittype,C,m,true,a.extend({},a.jgrid.ajaxOptions,k.p.ajaxSelectOptions||{}));a(C).addClass("editable");z?a("span:first",this).append(C):a(this).append(C);v[w].edittype=="select"&&v[w].editoptions.multiple===true&&a.browser.msie&&a(C).width(a(C).width());
278
- p++}}});if(p>0){q.id=d;k.p.savedRow.push(q);a(u).attr("editable","1");a("td:eq("+r+") input",u).focus();e===true&&a(u).bind("keydown",function(w){w.keyCode===27&&a(k).jqGrid("restoreRow",d,l);if(w.keyCode===13){if(w.target.tagName=="TEXTAREA")return true;a(k).jqGrid("saveRow",d,f,g,h,j,c,l);return false}w.stopPropagation()});a.isFunction(b)&&b(d)}}}})},saveRow:function(d,e,b,f,g,h,j){return this.each(function(){var c=this,l,k={},n={},m,p,r,q;if(c.grid){q=a(c).jqGrid("getInd",d,true);if(q!=false){m=
279
- a(q).attr("editable");b=b?b:c.p.editurl;if(m==="1"&&b){var u;a("td",q).each(function(B){u=c.p.colModel[B];l=u.name;if(l!="cb"&&l!="subgrid"&&u.editable===true&&l!="rn"){switch(u.edittype){case "checkbox":var C=["Yes","No"];if(u.editoptions)C=u.editoptions.value.split(":");k[l]=a("input",this).attr("checked")?C[0]:C[1];break;case "text":case "password":case "textarea":case "button":k[l]=a("input, textarea",this).val();break;case "select":if(u.editoptions.multiple){C=a("select",this);var y=[];k[l]=
280
- a(C).val();k[l]=k[l]?k[l].join(","):"";a("select > option:selected",this).each(function(x,M){y[x]=a(M).text()});n[l]=y.join(",")}else{k[l]=a("select>option:selected",this).val();n[l]=a("select>option:selected",this).text()}if(u.formatter&&u.formatter=="select")n={};break;case "custom":try{if(u.editoptions&&a.isFunction(u.editoptions.custom_value)){k[l]=u.editoptions.custom_value(a(".customelement",this),"get");if(k[l]===undefined)throw"e2";}else throw"e1";}catch(F){F=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,
281
- "function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);F=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,F.message,jQuery.jgrid.edit.bClose)}break}r=checkValues(k[l],B,c);if(r[0]===false){r[1]=k[l]+" "+r[1];return false}if(c.p.autoencode)k[l]=a.jgrid.htmlEncode(k[l])}});if(r[0]===false)try{var v=findPos(a("#"+d)[0]);info_dialog(a.jgrid.errors.errcap,r[1],a.jgrid.edit.bClose,
282
- {left:v[0],top:v[1]})}catch(w){alert(r[1])}else{if(k){var z;v=c.p.prmNames;z=v.oper;m=v.id;k[z]=v.editoper;k[m]=d;if(f)k=a.extend({},k,f)}if(b=="clientArray"){k=a.extend({},k,n);c.p.autoencode&&a.each(k,function(B,C){k[B]=a.jgrid.htmlDecode(C)});m=a(c).jqGrid("setRowData",d,k);a(q).attr("editable","0");for(v=0;v<c.p.savedRow.length;v++)if(c.p.savedRow[v].id==d){p=v;break}p>=0&&c.p.savedRow.splice(p,1);a.isFunction(g)&&g(d,m)}else{a("#lui_"+c.p.id).show();a.ajax(a.extend({url:b,data:a.isFunction(c.p.serializeRowData)?
283
- c.p.serializeRowData(k):k,type:"POST",complete:function(B,C){a("#lui_"+c.p.id).hide();if(C==="success")if((a.isFunction(e)?e(B):true)===true){c.p.autoencode&&a.each(k,function(y,F){k[y]=a.jgrid.htmlDecode(F)});k=a.extend({},k,n);a(c).jqGrid("setRowData",d,k);a(q).attr("editable","0");for(C=0;C<c.p.savedRow.length;C++)if(c.p.savedRow[C].id==d){p=C;break}p>=0&&c.p.savedRow.splice(p,1);a.isFunction(g)&&g(d,B)}else a(c).jqGrid("restoreRow",d,j)},error:function(B,C){a("#lui_"+c.p.id).hide();a.isFunction(h)?
284
- h(d,B,C):alert("Error Row: "+d+" Result: "+B.status+":"+B.statusText+" Status: "+C)}},a.jgrid.ajaxOptions,c.p.ajaxRowOptions||{}))}a(q).unbind("keydown")}}}}})},restoreRow:function(d,e){return this.each(function(){var b=this,f,g,h={};if(b.grid){g=a(b).jqGrid("getInd",d,true);if(g!=false){for(var j=0;j<b.p.savedRow.length;j++)if(b.p.savedRow[j].id==d){f=j;break}if(f>=0){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+g.id).datepicker("hide")}catch(c){}a.each(b.p.colModel,function(){if(this.editable==
285
- true&&this.name in b.p.savedRow[f])h[this.name]=b.p.savedRow[f][this.name]});a(b).jqGrid("setRowData",d,h);a(g).attr("editable","0").unbind("keydown");b.p.savedRow.splice(f,1)}a.isFunction(e)&&e(d)}}})}})})(jQuery);
286
- (function(a){if(a.browser.msie&&a.browser.version==8)a.expr[":"].hidden=function(e){return e.offsetWidth===0||e.offsetHeight===0||e.style.display=="none"};if(a.ui&&a.ui.multiselect&&a.ui.multiselect.prototype._setSelected){var d=a.ui.multiselect.prototype._setSelected;a.ui.multiselect.prototype._setSelected=function(e,b){e=d.call(this,e,b);if(b&&this.selectedList){var f=this.element;this.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(f)})}return e}}a.jgrid.extend({sortableColumns:function(e){return this.each(function(){function b(){f.p.disableClick=
287
- true}var f=this,g={tolerance:"pointer",axis:"x",items:">th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)",placeholder:{element:function(j){return a(document.createElement(j[0].nodeName)).addClass(j[0].className+" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(j,c){c.height(j.currentItem.innerHeight()-parseInt(j.currentItem.css("paddingTop")||0,10)-parseInt(j.currentItem.css("paddingBottom")||0,10));c.width(j.currentItem.innerWidth()-parseInt(j.currentItem.css("paddingLeft")||
288
- 0,10)-parseInt(j.currentItem.css("paddingRight")||0,10))}},update:function(j,c){j=a(c.item).parent();j=a(">th",j);var l={};a.each(f.p.colModel,function(n){l[this.name]=n});var k=[];j.each(function(){var n=a(">div",this).get(0).id.replace(/^jqgh_/,"");n in l&&k.push(l[n])});a(f).jqGrid("remapColumns",k,true,true);a.isFunction(f.p.sortable.update)&&f.p.sortable.update(k);setTimeout(function(){f.p.disableClick=false},50)}};if(f.p.sortable.options)a.extend(g,f.p.sortable.options);else if(a.isFunction(f.p.sortable))f.p.sortable=
289
- {update:f.p.sortable};if(g.start){var h=g.start;g.start=function(j,c){b();h.call(this,j,c)}}else g.start=b;if(f.p.sortable.exclude)g.items+=":not("+f.p.sortable.exclude+")";e.sortable(g).data("sortable").floating=true})},columnChooser:function(e){function b(m,p){if(m)if(typeof m=="string")a.fn[m]&&a.fn[m].apply(p,a.makeArray(arguments).slice(2));else a.isFunction(m)&&m.apply(p,a.makeArray(arguments).slice(2))}var f=this;if(!a("#colchooser_"+f[0].p.id).length){var g=a('<div id="colchooser_'+f[0].p.id+
290
- '" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),h=a("select",g);e=a.extend({width:420,height:240,classname:null,done:function(m){m&&f.jqGrid("remapColumns",m,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(m){var p={};p[m.bSubmit]=function(){m.apply_perm();m.cleanup(false)};p[m.bCancel]=function(){m.cleanup(true)};return{buttons:p,close:function(){m.cleanup(true)},modal:false,resizable:false,width:m.width+20}},apply_perm:function(){a("option",
291
- h).each(function(){this.selected?f.jqGrid("showCol",j[this.value].name):f.jqGrid("hideCol",j[this.value].name)});var m=k.slice(0);a("option[selected]",h).each(function(){m.push(parseInt(this.value))});a.each(m,function(){delete l[j[this].name]});a.each(l,function(){m.push(parseInt(this))});e.done&&e.done.call(f,m)},cleanup:function(m){b(e.dlog,g,"destroy");b(e.msel,h,"destroy");g.remove();m&&e.done&&e.done.call(f)}},a.jgrid.col,e||{});e.caption&&g.attr("title",e.caption);if(e.classname){g.addClass(classname);
292
- h.addClass(classname)}if(e.width){a(">div",g).css({width:e.width,margin:"0 auto"});h.css("width",e.width)}if(e.height){a(">div",g).css("height",e.height);h.css("height",e.height-10)}var j=f.jqGrid("getGridParam","colModel"),c=f.jqGrid("getGridParam","colNames"),l={},k=[];h.empty();a.each(j,function(m){l[this.name]=m;if(this.hidedlg)this.hidden||k.push(m);else h.append("<option value='"+m+"' "+(this.hidden?"":"selected='selected'")+">"+c[m]+"</option>")});var n=a.isFunction(e.dlog_opts)?e.dlog_opts.call(f,
293
- e):e.dlog_opts;b(e.dlog,g,n);a.isFunction(e.msel_opts)&&e.msel_opts.call(f,e);b(e.msel,h,e.msel_opts)}},sortableRows:function(e){return this.each(function(){var b=this;if(b.grid)if(!b.p.treeGrid)if(a.fn.sortable){e=a.extend({cursor:"move",axis:"y",items:".jqgrow"},e||{});if(e.start&&a.isFunction(e.start)){e._start_=e.start;delete e.start}else e._start_=false;if(e.update&&a.isFunction(e.update)){e._update_=e.update;delete e.update}else e._update_=false;e.start=function(f,g){a(g.item).css("border-width",
294
- "0px");a("td",g.item).each(function(c){this.style.width=b.grid.cols[c].style.width});if(b.p.subGrid){var h=a(g.item).attr("id");try{a(b).jqGrid("collapseSubGridRow",h)}catch(j){}}e._start_&&e._start_.apply(this,[f,g])};e.update=function(f,g){a(g.item).css("border-width","");b.updateColumns();b.p.rownumbers===true&&a("td.jqgrid-rownum",b.rows).each(function(h){a(this).html(h+1)});e._update_&&e._update_.apply(this,[f,g])};a("tbody:first",b).sortable(e)}})},gridDnD:function(e){return this.each(function(){function b(){var h=
295
- a.data(f,"dnd");a("tr.jqgrow:not(.ui-draggable)",f).draggable(a.isFunction(h.drag)?h.drag.call(a(f),h):h.drag)}var f=this;if(f.grid)if(!f.p.treeGrid)if(a.fn.draggable&&a.fn.droppable){a("#jqgrid_dnd").html()==null&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof e=="string"&&e=="updateDnD"&&f.p.jqgdnd==true)b();else{e=a.extend({drag:function(h){return a.extend({start:function(j,c){if(f.p.subGrid){var l=a(c.helper).attr("id");try{a(f).jqGrid("collapseSubGridRow",
296
- l)}catch(k){}}for(l=0;l<a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(f,"dnd").connectWith[l]).jqGrid("addRowData","jqg_empty_row",{});c.helper.addClass("ui-state-highlight");a("td",c.helper).each(function(n){this.style.width=f.grid.headers[n].width+"px"});h.onstart&&a.isFunction(h.onstart)&&h.onstart.call(a(f),j,c)},stop:function(j,c){if(c.helper.dropped){var l=a(c.helper).attr("id");a(f).jqGrid("delRowData",l)}for(l=0;l<
297
- a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("delRowData","jqg_empty_row");h.onstop&&a.isFunction(h.onstop)&&h.onstop.call(a(f),j,c)}},h.drag_opts||{})},drop:function(h){return a.extend({accept:function(j){var c=a(j).closest("table.ui-jqgrid-btable");if(a.data(c[0],"dnd")!=undefined){j=a.data(c[0],"dnd").connectWith;return a.inArray("#"+this.id,j)!=-1?true:false}return j},drop:function(j,c){var l=a(c.draggable).attr("id");l=a("#"+f.id).jqGrid("getRowData",l);if(!h.dropbyname){var k=
298
- 0,n={},m,p=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(key in l){if(p[k]){m=p[k].name;n[m]=l[key]}k++}l=n}catch(r){}}c.helper.dropped=true;if(h.beforedrop&&a.isFunction(h.beforedrop)){m=h.beforedrop.call(this,j,c,l,a("#"+f.id),a(this));if(typeof m!="undefined"&&m!==null&&typeof m=="object")l=m}if(c.helper.dropped){var q;if(h.autoid)if(a.isFunction(h.autoid))q=h.autoid.call(this,l);else{q=Math.ceil(Math.random()*1E3);q=h.autoidprefix+q}a("#"+this.id).jqGrid("addRowData",q,l,h.droppos)}h.ondrop&&
299
- a.isFunction(h.ondrop)&&h.ondrop.call(this,j,c,l)}},h.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",hoverClass:"ui-state-hover"},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},e||{});if(e.connectWith){e.connectWith=e.connectWith.split(",");e.connectWith=a.map(e.connectWith,function(h){return a.trim(h)});a.data(f,"dnd",e);f.p.reccount!=
300
- "0"&&!f.p.jqgdnd&&b();f.p.jqgdnd=true;for(var g=0;g<e.connectWith.length;g++)a(e.connectWith[g]).droppable(a.isFunction(e.drop)?e.drop.call(a(f),e):e.drop)}}}})},gridResize:function(e){return this.each(function(){var b=this;if(b.grid&&a.fn.resizable){e=a.extend({},e||{});if(e.alsoResize){e._alsoResize_=e.alsoResize;delete e.alsoResize}else e._alsoResize_=false;if(e.stop&&a.isFunction(e.stop)){e._stop_=e.stop;delete e.stop}else e._stop_=false;e.stop=function(f,g){a(b).jqGrid("setGridParam",{height:a("#gview_"+
301
- b.p.id+" .ui-jqgrid-bdiv").height()});a(b).jqGrid("setGridWidth",g.size.width,e.shrinkToFit);e._stop_&&e._stop_.call(b,f,g)};e.alsoResize=e._alsoResize_?eval("("+("{'#gview_"+b.p.id+" .ui-jqgrid-bdiv':true,'"+e._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+b.p.id);delete e._alsoResize_;a("#gbox_"+b.p.id).resizable(e)}})}})})(jQuery);
302
- (function(a){a.jgrid.extend({getPostData:function(){var d=this[0];if(d.grid)return d.p.postData},setPostData:function(d){var e=this[0];if(e.grid)if(typeof d==="object")e.p.postData=d;else alert("Error: cannot add a non-object postData value. postData unchanged.")},appendPostData:function(d){var e=this[0];if(e.grid)typeof d==="object"?a.extend(e.p.postData,d):alert("Error: cannot append a non-object postData value. postData unchanged.")},setPostDataItem:function(d,e){var b=this[0];if(b.grid)b.p.postData[d]=
303
- e},getPostDataItem:function(d){var e=this[0];if(e.grid)return e.p.postData[d]},removePostDataItem:function(d){var e=this[0];e.grid&&delete e.p.postData[d]},getUserData:function(){var d=this[0];if(d.grid)return d.p.userData},getUserDataItem:function(d){var e=this[0];if(e.grid)return e.p.userData[d]}})})(jQuery);
304
- (function(a){a.jgrid.extend({setColumns:function(d){d=a.extend({top:0,left:0,width:200,height:"auto",dataheight:"auto",modal:false,drag:true,beforeShowForm:null,afterShowForm:null,afterSubmitForm:null,closeOnEscape:true,ShrinkToFit:false,jqModal:false,saveicon:[true,"left","ui-icon-disk"],closeicon:[true,"left","ui-icon-close"],onClose:null,colnameview:true,closeAfterSubmit:true,updateAfterCheck:false,recreateForm:false},a.jgrid.col,d||{});return this.each(function(){var e=this;if(e.grid){var b=typeof d.beforeShowForm===
305
- "function"?true:false,f=typeof d.afterShowForm==="function"?true:false,g=typeof d.afterSubmitForm==="function"?true:false,h=e.p.id,j="ColTbl_"+h,c={themodal:"colmod"+h,modalhead:"colhd"+h,modalcontent:"colcnt"+h,scrollelm:j};d.recreateForm===true&&a("#"+c.themodal).html()!=null&&a("#"+c.themodal).remove();if(a("#"+c.themodal).html()!=null){b&&d.beforeShowForm(a("#"+j));viewModal("#"+c.themodal,{gbox:"#gbox_"+h,jqm:d.jqModal,jqM:false,modal:d.modal})}else{var l=isNaN(d.dataheight)?d.dataheight:d.dataheight+
306
- "px";l="<div id='"+j+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+l+";'>";l+="<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";for(i=0;i<this.p.colNames.length;i++)e.p.colModel[i].hidedlg||(l+="<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_"+this.p.colModel[i].name+"' class='cbox' value='T' "+(this.p.colModel[i].hidden===false?"checked":"")+"/><label for='col_"+this.p.colModel[i].name+"'>"+this.p.colNames[i]+
307
- (d.colnameview?" ("+this.p.colModel[i].name+")":"")+"</label></td></tr>");l+="</tbody></table></div>";l+="<table border='0' class='EditTable' id='"+j+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+(!d.updateAfterCheck?"<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+d.bSubmit+"</a>":"")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+
308
- d.bCancel+"</a>")+"</td></tr></tbody></table>";d.gbox="#gbox_"+h;createModal(c,l,d,"#gview_"+e.p.id,a("#gview_"+e.p.id)[0]);if(d.saveicon[0]==true)a("#dData","#"+j+"_2").addClass(d.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.saveicon[2]+"'></span>");if(d.closeicon[0]==true)a("#eData","#"+j+"_2").addClass(d.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.closeicon[2]+"'></span>");d.updateAfterCheck?
309
- a(":input","#"+j).click(function(){var k=this.id.substr(4);if(k){this.checked?a(e).jqGrid("showCol",k):a(e).jqGrid("hideCol",k);d.ShrinkToFit===true&&a(e).jqGrid("setGridWidth",e.grid.width-0.0010,true)}return this}):a("#dData","#"+j+"_2").click(function(){for(i=0;i<e.p.colModel.length;i++)if(!e.p.colModel[i].hidedlg){var k=e.p.colModel[i].name.replace(".","\\.");if(a("#col_"+k,"#"+j).attr("checked")){a(e).jqGrid("showCol",e.p.colModel[i].name);a("#col_"+k,"#"+j).attr("defaultChecked",true)}else{a(e).jqGrid("hideCol",
310
- e.p.colModel[i].name);a("#col_"+k,"#"+j).attr("defaultChecked","")}}d.ShrinkToFit===true&&a(e).jqGrid("setGridWidth",e.grid.width-0.0010,true);d.closeAfterSubmit&&hideModal("#"+c.themodal,{gb:"#gbox_"+h,jqm:d.jqModal,onClose:d.onClose});g&&d.afterSubmitForm(a("#"+j));return false});a("#eData","#"+j+"_2").click(function(){hideModal("#"+c.themodal,{gb:"#gbox_"+h,jqm:d.jqModal,onClose:d.onClose});return false});a("#dData, #eData","#"+j+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
311
- b&&d.beforeShowForm(a("#"+j));viewModal("#"+c.themodal,{gbox:"#gbox_"+h,jqm:d.jqModal,jqM:true,modal:d.modal})}f&&d.afterShowForm(a("#"+j))}})}})})(jQuery);
312
- (function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var d=this;d.p.colNames.unshift("");d.p.colModel.unshift({name:"subgrid",width:a.browser.safari?d.p.subGridWidth+d.p.cellLayout:d.p.subGridWidth,sortable:false,resizable:false,hidedlg:true,search:false,fixed:true});d=d.p.subGridModel;if(d[0]){d[0].align=a.extend([],d[0].align||[]);for(i=0;i<d[0].name.length;i++)d[0].align[i]=d[0].align[i]||"left"}})},addSubGridCell:function(d,e){var b="",f;this.each(function(){b=this.formatCol(d,
313
- e);f=this.p.gridview});return f===false?"<td role='grid' class='ui-sgcollapsed sgcollapsed' "+b+"><a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a></td>":"<td role='grid' "+b+"></td>"},addSubGrid:function(d,e){return this.each(function(){var b=this;if(b.grid){var f,g,h,j,c,l,k;a("td:eq("+e+")",d).click(function(){if(a(this).hasClass("sgcollapsed")){h=b.p.id;f=a(this).parent();j=e>=1?"<td colspan='"+e+"'>&#160;</td>":"";g=a(f).attr("id");k=true;if(a.isFunction(b.p.subGridBeforeExpand))k=
314
- b.p.subGridBeforeExpand(h+"_"+g,g);if(k===false)return false;c=0;a.each(b.p.colModel,function(){if(this.hidden===true||this.name=="rn"||this.name=="cb")c++});l="<tr role='row' class='ui-subgrid'>"+j+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon ui-icon-carat-1-sw'/></td><td colspan='"+parseInt(b.p.colNames.length-1-c)+"' class='ui-widget-content subgrid-data'><div id="+h+"_"+g+" class='tablediv'>";a(this).parent().after(l+"</div></td></tr>");a.isFunction(b.p.subGridRowExpanded)?
315
- b.p.subGridRowExpanded(h+"_"+g,g):n(f);a(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-minus'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded")}else if(a(this).hasClass("sgexpanded")){k=true;if(a.isFunction(b.p.subGridRowColapsed)){f=a(this).parent();g=a(f).attr("id");k=b.p.subGridRowColapsed(h+"_"+g,g)}if(k===false)return false;a(this).parent().next().remove(".ui-subgrid");a(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}return false});
316
- var n=function(q){var u,v,w,z;u=a(q).attr("id");v={nd_:(new Date).getTime()};v[b.p.idName]=u;if(!b.p.subGridModel[0])return false;if(b.p.subGridModel[0].params)for(z=0;z<b.p.subGridModel[0].params.length;z++)for(w=0;w<b.p.colModel.length;w++)if(b.p.colModel[w].name==b.p.subGridModel[0].params[z])v[b.p.colModel[w].name]=a("td:eq("+w+")",q).text().replace(/\&#160\;/ig,"");if(!b.grid.hDiv.loading){b.grid.hDiv.loading=true;a("#load_"+b.p.id).show();if(!b.p.subgridtype)b.p.subgridtype=b.p.datatype;if(a.isFunction(b.p.subgridtype))b.p.subgridtype(v);
317
- else b.p.subgridtype=b.p.subgridtype.toLowerCase();switch(b.p.subgridtype){case "xml":case "json":a.ajax(a.extend({type:b.p.mtype,url:b.p.subGridUrl,dataType:b.p.subgridtype,data:a.isFunction(b.p.serializeSubGridData)?b.p.serializeSubGridData(v):v,complete:function(B){b.p.subgridtype=="xml"?p(B.responseXML,u):r(a.jgrid.parse(B.responseText),u)}},a.jgrid.ajaxOptions,b.p.ajaxSubgridOptions||{}));break}}return false},m=function(q,u,v){u=a("<td align='"+b.p.subGridModel[0].align[v]+"'></td>").html(u);
318
- a(q).append(u)},p=function(q,u){var v,w,z,B=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),C=a("<tr></tr>");for(w=0;w<b.p.subGridModel[0].name.length;w++){v=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+b.p.direction+"'></th>");a(v).html(b.p.subGridModel[0].name[w]);a(v).width(b.p.subGridModel[0].width[w]);a(C).append(v)}a(B).append(C);if(q){z=b.p.xmlReader.subgrid;a(z.root+" "+z.row,q).each(function(){C=a("<tr class='ui-widget-content ui-subtblcell'></tr>");
319
- if(z.repeatitems===true)a(z.cell,this).each(function(F){m(C,a(this).text()||"&#160;",F)});else{var y=b.p.subGridModel[0].mapping||b.p.subGridModel[0].name;if(y)for(w=0;w<y.length;w++)m(C,a(y[w],this).text()||"&#160;",w)}a(B).append(C)})}q=a("table:first",b.grid.bDiv).attr("id")+"_";a("#"+q+u).append(B);b.grid.hDiv.loading=false;a("#load_"+b.p.id).hide();return false},r=function(q,u){var v,w,z,B=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),C=a("<tr></tr>");for(w=0;w<
320
- b.p.subGridModel[0].name.length;w++){v=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+b.p.direction+"'></th>");a(v).html(b.p.subGridModel[0].name[w]);a(v).width(b.p.subGridModel[0].width[w]);a(C).append(v)}a(B).append(C);if(q){v=b.p.jsonReader.subgrid;q=q[v.root];if(typeof q!=="undefined")for(w=0;w<q.length;w++){z=q[w];C=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(v.repeatitems===true){if(v.cell)z=z[v.cell];for(var y=0;y<z.length;y++)m(C,z[y]||"&#160;",y)}else{var F=
321
- b.p.subGridModel[0].mapping||b.p.subGridModel[0].name;if(F.length)for(y=0;y<F.length;y++)m(C,z[F[y]]||"&#160;",y)}a(B).append(C)}}w=a("table:first",b.grid.bDiv).attr("id")+"_";a("#"+w+u).append(B);b.grid.hDiv.loading=false;a("#load_"+b.p.id).hide();return false};b.subGridXml=function(q,u){p(q,u)};b.subGridJson=function(q,u){r(q,u)}}})},expandSubGridRow:function(d){return this.each(function(){var e=this;if(e.grid||d)if(e.p.subGrid===true)if(e=a(this).jqGrid("getInd",d,true))(e=a("td.sgcollapsed",e)[0])&&
322
- a(e).trigger("click")})},collapseSubGridRow:function(d){return this.each(function(){var e=this;if(e.grid||d)if(e.p.subGrid===true)if(e=a(this).jqGrid("getInd",d,true))(e=a("td.sgexpanded",e)[0])&&a(e).trigger("click")})},toggleSubGridRow:function(d){return this.each(function(){var e=this;if(e.grid||d)if(e.p.subGrid===true)if(e=a(this).jqGrid("getInd",d,true)){var b=a("td.sgcollapsed",e)[0];if(b)a(b).trigger("click");else(b=a("td.sgexpanded",e)[0])&&a(b).trigger("click")}})}})})(jQuery);
323
- function tableToGrid(a,d){jQuery(a).each(function(){if(!this.grid){jQuery(this).width("99%");var e=jQuery(this).width(),b=jQuery("input[type=checkbox]:first",jQuery(this)),f=jQuery("input[type=radio]:first",jQuery(this)),g=b.length>0,h=!g&&f.length>0,j=g||h;b=b.attr("name")||f.attr("name");var c=[],l=[];jQuery("th",jQuery(this)).each(function(){if(c.length==0&&j){c.push({name:"__selection__",index:"__selection__",width:0,hidden:true});l.push("__selection__")}else{c.push({name:jQuery(this).attr("id")||
324
- jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),index:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),width:jQuery(this).width()||150});l.push(jQuery(this).html())}});var k=[],n=[],m=[];jQuery("tbody > tr",jQuery(this)).each(function(){var p={},r=0;jQuery("td",jQuery(this)).each(function(){if(r==0&&j){var q=jQuery("input",jQuery(this)),u=q.attr("value");n.push(u||k.length);q.attr("checked")&&m.push(u);p[c[r].name]=
325
- q.attr("value")}else p[c[r].name]=jQuery(this).html();r++});r>0&&k.push(p)});jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid($.extend({datatype:"local",width:e,colNames:l,colModel:c,multiselect:g},d||{}));for(e=0;e<k.length;e++){g=null;if(n.length>0)if((g=n[e])&&g.replace)g=encodeURIComponent(g).replace(/[.\-%]/g,"_");if(g==null)g=e+1;jQuery(this).jqGrid("addRowData",g,k[e])}for(e=0;e<m.length;e++)jQuery(this).jqGrid("setSelection",m[e])}})}
326
- (function(a){a.jgrid.extend({setTreeNode:function(d,e){return this.each(function(){var b=this;if(b.grid&&b.p.treeGrid){var f=b.p.expColInd,g=b.p.treeReader.expanded_field,h=b.p.treeReader.leaf_field,j=b.p.treeReader.level_field;e.level=d[j];if(b.p.treeGridModel=="nested"){e.lft=d[b.p.treeReader.left_field];e.rgt=d[b.p.treeReader.right_field];d[h]||(d[h]=parseInt(e.rgt,10)===parseInt(e.lft,10)+1?"true":"false")}else e.parent_id=d[b.p.treeReader.parent_id_field];var c=parseInt(e.level,10),l;if(b.p.tree_root_level===
327
- 0){l=c+1;c=c}else{l=c;c=c-1}l="<div class='tree-wrap tree-wrap-"+b.p.direction+"' style='width:"+l*18+"px;'>";l+="<div style='"+(b.p.direction=="rtl"?"right:":"left:")+c*18+"px;' class='ui-icon ";if(d[h]=="true"||d[h]==true){l+=b.p.treeIcons.leaf+" tree-leaf'";e.isLeaf=true}else{if(d[g]=="true"||d[g]==true){l+=b.p.treeIcons.minus+" tree-minus treeclick'";e.expanded=true}else{l+=b.p.treeIcons.plus+" tree-plus treeclick'";e.expanded=false}e.isLeaf=false}l+="</div></div>";if(parseInt(d[j],10)!==parseInt(b.p.tree_root_level,
328
- 10))a(b).jqGrid("isVisibleNode",e)||a(e).css("display","none");a("td:eq("+f+")",e).wrapInner("<span></span>").prepend(l);a(".treeclick",e).bind("click",function(k){k=a(k.target||k.srcElement,b.rows).parents("tr.jqgrow")[0].rowIndex;if(!b.rows[k].isLeaf)if(b.rows[k].expanded){a(b).jqGrid("collapseRow",b.rows[k]);a(b).jqGrid("collapseNode",b.rows[k])}else{a(b).jqGrid("expandRow",b.rows[k]);a(b).jqGrid("expandNode",b.rows[k])}return false});b.p.ExpandColClick===true&&a("span",e).css("cursor","pointer").bind("click",
329
- function(k){k=a(k.target||k.srcElement,b.rows).parents("tr.jqgrow")[0].rowIndex;if(!b.rows[k].isLeaf)if(b.rows[k].expanded){a(b).jqGrid("collapseRow",b.rows[k]);a(b).jqGrid("collapseNode",b.rows[k])}else{a(b).jqGrid("expandRow",b.rows[k]);a(b).jqGrid("expandNode",b.rows[k])}a(b).jqGrid("setSelection",b.rows[k].id);return false})}})},setTreeGrid:function(){return this.each(function(){var d=this,e=0;if(d.p.treeGrid){d.p.treedatatype||a.extend(d.p,{treedatatype:d.p.datatype});d.p.subGrid=false;d.p.altRows=
330
- false;d.p.pgbuttons=false;d.p.pginput=false;d.p.multiselect=false;d.p.rowList=[];d.p.treeIcons=a.extend({plus:"ui-icon-triangle-1-"+(d.p.direction=="rtl"?"w":"e"),minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off"},d.p.treeIcons||{});if(d.p.treeGridModel=="nested")d.p.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded"},d.p.treeReader);else if(d.p.treeGridModel=="adjacency")d.p.treeReader=a.extend({level_field:"level",parent_id_field:"parent",
331
- leaf_field:"isLeaf",expanded_field:"expanded"},d.p.treeReader);for(var b in d.p.colModel){if(d.p.colModel[b].name==d.p.ExpandColumn){d.p.expColInd=e;break}e++}if(!d.p.expColInd)d.p.expColInd=0;a.each(d.p.treeReader,function(f,g){if(g){d.p.colNames.push(g);d.p.colModel.push({name:g,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})}})},expandRow:function(d){this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var b=a(e).jqGrid("getNodeChildren",d);a(b).each(function(){a(this).css("display",
332
- "");this.expanded&&a(e).jqGrid("expandRow",this)})}})},collapseRow:function(d){this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var b=a(e).jqGrid("getNodeChildren",d);a(b).each(function(){a(this).css("display","none");this.expanded&&a(e).jqGrid("collapseRow",this)})}})},getRootNodes:function(){var d=[];this.each(function(){var e=this;if(e.grid&&e.p.treeGrid)switch(e.p.treeGridModel){case "nested":var b=e.p.treeReader.level_field;a(e.rows).each(function(){parseInt(this[b],10)===parseInt(e.p.tree_root_level,
333
- 10)&&d.push(this)});break;case "adjacency":a(e.rows).each(function(){if(this.parent_id==null||this.parent_id.toLowerCase()=="null")d.push(this)});break}});return d},getNodeDepth:function(d){var e=null;this.each(function(){var b=this;if(this.grid&&this.p.treeGrid)switch(b.p.treeGridModel){case "nested":e=parseInt(d.level,10)-parseInt(this.p.tree_root_level,10);break;case "adjacency":e=a(b).jqGrid("getNodeAncestors",d).length;break}});return e},getNodeParent:function(d){var e=null;this.each(function(){var b=
334
- this;if(b.grid&&b.p.treeGrid)switch(b.p.treeGridModel){case "nested":var f=parseInt(d.lft,10),g=parseInt(d.rgt,10),h=parseInt(d.level,10);a(this.rows).each(function(){if(parseInt(this.level,10)===h-1&&parseInt(this.lft)<f&&parseInt(this.rgt)>g){e=this;return false}});break;case "adjacency":a(this.rows).each(function(){if(this.id==d.parent_id){e=this;return false}});break}});return e},getNodeChildren:function(d){var e=[];this.each(function(){var b=this;if(b.grid&&b.p.treeGrid)switch(b.p.treeGridModel){case "nested":var f=
335
- parseInt(d.lft,10),g=parseInt(d.rgt,10),h=parseInt(d.level,10);a(this.rows).each(function(){parseInt(this.level,10)===h+1&&parseInt(this.lft,10)>f&&parseInt(this.rgt,10)<g&&e.push(this)});break;case "adjacency":a(this.rows).each(function(){this.parent_id==d.id&&e.push(this)});break}});return e},getFullTreeNode:function(d){var e=[];this.each(function(){var b=this;if(b.grid&&b.p.treeGrid)switch(b.p.treeGridModel){case "nested":var f=parseInt(d.lft,10),g=parseInt(d.rgt,10),h=parseInt(d.level,10);a(this.rows).each(function(){parseInt(this.level,
336
- 10)>=h&&parseInt(this.lft,10)>=f&&parseInt(this.lft,10)<=g&&e.push(this)});break;case "adjacency":e.push(d);a(this.rows).each(function(j){len=e.length;for(j=0;j<len;j++)if(e[j].id==this.parent_id){e.push(this);break}});break}});return e},getNodeAncestors:function(d){var e=[];this.each(function(){if(this.grid&&this.p.treeGrid)for(var b=a(this).jqGrid("getNodeParent",d);b;){e.push(b);b=a(this).jqGrid("getNodeParent",b)}});return e},isVisibleNode:function(d){var e=true;this.each(function(){var b=this;
337
- if(b.grid&&b.p.treeGrid){b=a(b).jqGrid("getNodeAncestors",d);a(b).each(function(){e=e&&this.expanded;if(!e)return false})}});return e},isNodeLoaded:function(d){var e;this.each(function(){var b=this;if(b.grid&&b.p.treeGrid)e=d.loaded!==undefined?d.loaded:d.isLeaf||a(b).jqGrid("getNodeChildren",d).length>0?true:false});return e},expandNode:function(d){return this.each(function(){if(this.grid&&this.p.treeGrid)if(!d.expanded)if(a(this).jqGrid("isNodeLoaded",d)){d.expanded=true;a("div.treeclick",d).removeClass(this.p.treeIcons.plus+
338
- " tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{d.expanded=true;a("div.treeclick",d).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=d.rowIndex;this.p.datatype=this.p.treedatatype;this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:d.id,n_left:d.lft,n_right:d.rgt,n_level:d.level}}):a(this).jqGrid("setGridParam",{postData:{nodeid:d.id,parentid:d.parent_id,n_level:d.level}});a(this).trigger("reloadGrid");
339
- this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}}):a(this).jqGrid("setGridParam",{postData:{nodeid:"",parentid:"",n_level:""}})}})},collapseNode:function(d){return this.each(function(){if(this.grid&&this.p.treeGrid)if(d.expanded){d.expanded=false;a("div.treeclick",d).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(d){return this.each(function(){if(this.grid&&this.p.treeGrid){var e,
340
- b,f,g=[],h=this,j=a(this).jqGrid("getRootNodes");j.sort(function(c,l){if(c.sortKey<l.sortKey)return-d;if(c.sortKey>l.sortKey)return d;return 0});if(j[0]){a("td",j[0]).each(function(c){a(this).css("width",h.grid.headers[c].width+"px")});h.grid.cols=j[0].cells}e=0;for(b=j.length;e<b;e++){f=j[e];g.push(f);a(this).jqGrid("collectChildrenSortTree",g,f,d)}a.each(g,function(c,l){a("tbody",h.grid.bDiv).append(l);l.sortKey=null})}})},collectChildrenSortTree:function(d,e,b){return this.each(function(){if(this.grid&&
341
- this.p.treeGrid){var f,g,h,j=a(this).jqGrid("getNodeChildren",e);j.sort(function(c,l){if(c.sortKey<l.sortKey)return-b;if(c.sortKey>l.sortKey)return b;return 0});f=0;for(g=j.length;f<g;f++){h=j[f];d.push(h);a(this).jqGrid("collectChildrenSortTree",d,h,b)}}})},setTreeRow:function(d,e){var b=false;this.each(function(){var f=this;if(f.grid&&f.p.treeGrid)b=a(f).jqGrid("setRowData",d,e)});return b},delTreeNode:function(d){return this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var b=a(e).jqGrid("getInd",
342
- d,true);if(b){var f=a(e).jqGrid("getNodeChildren",b);if(f.length>0)for(var g=0;g<f.length;g++)a(e).jqGrid("delRowData",f[g].id);a(e).jqGrid("delRowData",b.id)}}})}})})(jQuery);
343
- (function(a){a.fn.jqDrag=function(j){return g(this,j,"d")};a.fn.jqResize=function(j,c){return g(this,j,"r",c)};a.jqDnR={dnr:{},e:0,drag:function(j){if(e.k=="d")b.css({left:e.X+j.pageX-e.pX,top:e.Y+j.pageY-e.pY});else{b.css({width:Math.max(j.pageX-e.pX+e.W,0),height:Math.max(j.pageY-e.pY+e.H,0)});M1&&f.css({width:Math.max(j.pageX-M1.pX+M1.W,0),height:Math.max(j.pageY-M1.pY+M1.H,0)})}return false},stop:function(){a().unbind("mousemove",d.drag).unbind("mouseup",d.stop)}};var d=a.jqDnR,e=d.dnr,b=d.e,
344
- f,g=function(j,c,l,k){return j.each(function(){c=c?a(c,j):j;c.bind("mousedown",{e:j,k:l},function(n){var m=n.data,p={};b=m.e;f=k?a(k):false;if(b.css("position")!="relative")try{b.position(p)}catch(r){}e={X:p.left||h("left")||0,Y:p.top||h("top")||0,W:h("width")||b[0].scrollWidth||0,H:h("height")||b[0].scrollHeight||0,pX:n.pageX,pY:n.pageY,k:m.k};M1=f&&m.k!="d"?{X:p.left||f1("left")||0,Y:p.top||f1("top")||0,W:f[0].offsetWidth||f1("width")||0,H:f[0].offsetHeight||f1("height")||0,pX:n.pageX,pY:n.pageY,
345
- k:m.k}:false;a().mousemove(a.jqDnR.drag).mouseup(a.jqDnR.stop);return false})})},h=function(j){return parseInt(b.css(j))||false};f1=function(j){return parseInt(f.css(j))||false}})(jQuery);
346
- (function(a){a.fn.jqm=function(n){var m={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:g,ajaxText:"",target:g,modal:g,toTop:g,onShow:g,onHide:g,onLoad:g};return this.each(function(){if(this._jqm)return e[this._jqm].c=a.extend({},e[this._jqm].c,n);d++;this._jqm=d;e[d]={c:a.extend(m,a.jqm.params,n),a:g,w:a(this).addClass("jqmID"+d),s:d};m.trigger&&a(this).jqmAddTrigger(m.trigger)})};a.fn.jqmAddClose=function(n){return k(this,n,"jqmHide")};a.fn.jqmAddTrigger=
347
- function(n){return k(this,n,"jqmShow")};a.fn.jqmShow=function(n){return this.each(function(){a.jqm.open(this._jqm,n)})};a.fn.jqmHide=function(n){return this.each(function(){a.jqm.close(this._jqm,n)})};a.jqm={hash:{},open:function(n,m){var p=e[n],r=p.c,q="."+r.closeClass,u=parseInt(p.w.css("z-index"));u=u>0?u:3E3;var v=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":u-1,opacity:r.overlay/100});if(p.a)return g;p.t=m;p.a=true;p.w.css("z-index",u);if(r.modal){b[0]||
348
- setTimeout(function(){c("bind")},1);b.push(n)}else if(r.overlay>0)r.closeoverlay&&p.w.jqmAddClose(v);else v=g;p.o=v?v.addClass(r.overlayClass).prependTo("body"):g;if(f){a("html,body").css({height:"100%",width:"100%"});if(v){v=v.css({position:"absolute"})[0];for(var w in{Top:1,Left:1})v.style.setExpression(w.toLowerCase(),"(_=(document.documentElement.scroll"+w+" || document.body.scroll"+w+"))+'px'")}}if(r.ajax){n=r.target||p.w;u=r.ajax;n=typeof n=="string"?a(n,p.w):a(n);u=u.substr(0,1)=="@"?a(m).attr(u.substring(1)):
349
- u;n.html(r.ajaxText).load(u,function(){r.onLoad&&r.onLoad.call(this,p);q&&p.w.jqmAddClose(a(q,p.w));h(p)})}else q&&p.w.jqmAddClose(a(q,p.w));r.toTop&&p.o&&p.w.before('<span id="jqmP'+p.w[0]._jqm+'"></span>').insertAfter(p.o);r.onShow?r.onShow(p):p.w.show();h(p);return g},close:function(n){n=e[n];if(!n.a)return g;n.a=g;if(b[0]){b.pop();b[0]||c("unbind")}n.c.toTop&&n.o&&a("#jqmP"+n.w[0]._jqm).after(n.w).remove();if(n.c.onHide)n.c.onHide(n);else{n.w.hide();n.o&&n.o.remove()}return g},params:{}};var d=
350
- 0,e=a.jqm.hash,b=[],f=a.browser.msie&&a.browser.version=="6.0",g=false,h=function(n){var m=a('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(f)if(n.o)n.o.html('<p style="width:100%;height:100%"/>').prepend(m);else a("iframe.jqm",n.w)[0]||n.w.prepend(m);j(n)},j=function(n){try{a(":input:visible",n.w)[0].focus()}catch(m){}},c=function(n){a()[n]("keypress",l)[n]("keydown",l)[n]("mousedown",l)},l=function(n){var m=e[b[b.length-1]];(n=!a(n.target).parents(".jqmID"+
351
- m.s)[0])&&j(m);return!n},k=function(n,m,p){return n.each(function(){var r=this._jqm;a(m).each(function(){if(!this[p]){this[p]=[];a(this).click(function(){for(var q in{jqmShow:1,jqmHide:1})for(var u in this[q])e[this[q][u]]&&e[this[q][u]].w[q](this);return g})}this[p].push(r)})})}})(jQuery);
352
- (function(a){function d(e,b,f,g,h){var j=b;if(a.fn.fmatter[e])j=a.fn.fmatter[e](b,f,g,h);return j}a.fmatter={};a.fn.fmatter=function(e,b,f,g,h){f=a.extend({},a.jgrid.formatter,f);return d(e,b,f,g,h)};a.fmatter.util={NumberFormat:function(e,b){isNumber(e)||(e*=1);if(isNumber(e)){var f=e<0,g=e+"",h=b.decimalSeparator?b.decimalSeparator:".";if(isNumber(b.decimalPlaces)){var j=b.decimalPlaces;g=Math.pow(10,j);g=Math.round(e*g)/g+"";e=g.lastIndexOf(".");if(j>0){if(e<0){g+=h;e=g.length-1}else if(h!==".")g=
353
- g.replace(".",h);for(;g.length-1-e<j;)g+="0"}}if(b.thousandsSeparator){j=b.thousandsSeparator;e=g.lastIndexOf(h);e=e>-1?e:g.length;h=g.substring(e);for(var c=-1,l=e;l>0;l--){c++;if(c%3===0&&l!==e&&(!f||l>1))h=j+h;h=g.charAt(l-1)+h}g=h}g=b.prefix?b.prefix+g:g;return g=b.suffix?g+b.suffix:g}else return e},DateFormat:function(e,b,f,g){var h=function(z,B){z=String(z);for(B=parseInt(B)||2;z.length<B;)z="0"+z;return z},j={m:1,d:1,y:1970,h:0,i:0,s:0},c=0,l,k,n=["i18n"];n.i18n={dayNames:g.dayNames,monthNames:g.monthNames};
354
- if(e in g.masks)e=g.masks[e];b=b.split(/[\\\/:_;.\t\T\s-]/);e=e.split(/[\\\/:_;.\t\T\s-]/);l=0;for(k=e.length;l<k;l++){if(e[l]=="M"){c=a.inArray(b[l],n.i18n.monthNames);if(c!==-1&&c<12)b[l]=c+1}if(e[l]=="F"){c=a.inArray(b[l],n.i18n.monthNames);if(c!==-1&&c>11)b[l]=c+1-12}j[e[l].toLowerCase()]=parseInt(b[l],10)}j.m=parseInt(j.m)-1;c=j.y;if(c>=70&&c<=99)j.y=1900+j.y;else if(c>=0&&c<=69)j.y=2E3+j.y;c=new Date(j.y,j.m,j.d,j.h,j.i,j.s,0);if(f in g.masks)f=g.masks[f];else f||(f="Y-m-d");j=c.getHours();
355
- e=c.getMinutes();b=c.getDate();l=c.getMonth()+1;k=c.getTimezoneOffset();var m=c.getSeconds(),p=c.getMilliseconds(),r=c.getDay(),q=c.getFullYear(),u=(r+6)%7+1,v=(new Date(q,l-1,b)-new Date(q,0,1))/864E5,w={d:h(b),D:n.i18n.dayNames[r],j:b,l:n.i18n.dayNames[r+7],N:u,S:g.S(b),w:r,z:v,W:u<5?Math.floor((v+u-1)/7)+1:Math.floor((v+u-1)/7)||(((new Date(q-1,0,1)).getDay()+6)%7<4?53:52),F:n.i18n.monthNames[l-1+12],m:h(l),M:n.i18n.monthNames[l-1],n:l,t:"?",L:"?",o:"?",Y:q,y:String(q).substring(2),a:j<12?g.AmPm[0]:
356
- g.AmPm[1],A:j<12?g.AmPm[2]:g.AmPm[3],B:"?",g:j%12||12,G:j,h:h(j%12||12),H:h(j),i:h(e),s:h(m),u:p,e:"?",I:"?",O:(k>0?"-":"+")+h(Math.floor(Math.abs(k)/60)*100+Math.abs(k)%60,4),P:"?",T:(String(c).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g)||[""]).pop().replace(/[^-+\dA-Z]/g,""),Z:"?",c:"?",r:"?",U:Math.floor(c/1E3)};return f.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(z){return z in
357
- w?w[z]:z.substring(1)})}};a.fn.fmatter.defaultFormat=function(e,b){return isValue(e)&&e!==""?e:b.defaultValue?b.defaultValue:"&#160;"};a.fn.fmatter.email=function(e,b){return isEmpty(e)?a.fn.fmatter.defaultFormat(e,b):'<a href="mailto:'+e+'">'+e+"</a>"};a.fn.fmatter.checkbox=function(e,b){var f=a.extend({},b.checkbox);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));b=f.disabled===true?"disabled":"";if(isEmpty(e)||isUndefined(e))e=a.fn.fmatter.defaultFormat(e,f);
358
- e+="";e=e.toLowerCase();return'<input type="checkbox" '+(e.search(/(false|0|no|off)/i)<0?" checked='checked' ":"")+' value="'+e+'" offval="no" '+b+"/>"};a.fn.fmatter.link=function(e,b){var f={target:b.target},g="";isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(f.target)g="target="+f.target;return isEmpty(e)?a.fn.fmatter.defaultFormat(e,b):"<a "+g+' href="'+e+'">'+e+"</a>"};a.fn.fmatter.showlink=function(e,b){var f={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,
359
- addParam:b.addParam||"",target:b.target,idName:b.idName},g="";isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(f.target)g="target="+f.target;idUrl=f.baseLinkUrl+f.showAction+"?"+f.idName+"="+b.rowId+f.addParam;return isString(e)?"<a "+g+' href="'+idUrl+'">'+e+"</a>":a.fn.fmatter.defaultFormat(e,b)};a.fn.fmatter.integer=function(e,b){var f=a.extend({},b.integer);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(isEmpty(e))return f.defaultValue;
360
- return a.fmatter.util.NumberFormat(e,f)};a.fn.fmatter.number=function(e,b){var f=a.extend({},b.number);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(isEmpty(e))return f.defaultValue;return a.fmatter.util.NumberFormat(e,f)};a.fn.fmatter.currency=function(e,b){var f=a.extend({},b.currency);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(isEmpty(e))return f.defaultValue;return a.fmatter.util.NumberFormat(e,f)};a.fn.fmatter.date=
361
- function(e,b,f,g){f=a.extend({},b.date);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));return!f.reformatAfterEdit&&g=="edit"?a.fn.fmatter.defaultFormat(e,b):isEmpty(e)?a.fn.fmatter.defaultFormat(e,b):a.fmatter.util.DateFormat(f.srcformat,e,f.newformat,f)};a.fn.fmatter.select=function(e,b){e+="";var f=false,g=[];if(!isUndefined(b.colModel.editoptions))f=b.colModel.editoptions.value;if(f){var h=b.colModel.editoptions.multiple===true?true:false,j=[],c;if(h){j=e.split(",");
362
- j=a.map(j,function(m){return a.trim(m)})}if(isString(f))for(var l=f.split(";"),k=0,n=0;n<l.length;n++){c=l[n].split(":");if(c.length>2)c[1]=jQuery.map(c,function(m,p){if(p>0)return m}).join(":");if(h){if(jQuery.inArray(c[0],j)>-1){g[k]=c[1];k++}}else if(a.trim(c[0])==a.trim(e)){g[0]=c[1];break}}else if(isObject(f))if(h)g=jQuery.map(j,function(m){return f[m]});else g[0]=f[e]||""}e=g.join(", ");return e==""?a.fn.fmatter.defaultFormat(e,b):e};a.fn.fmatter.rowactions=function(e,b,f,g){switch(f){case "edit":f=
363
- function(){a(".ui-inline-edit, .ui-inline-del","#"+e).show();a(".ui-inline-save, .ui-inline-cancel","#"+e).hide()};a("#"+b).jqGrid("editRow",e,g,null,null,null,{oper:"edit"},f,null,f);a(".ui-inline-edit, .ui-inline-del","#"+e).hide();a(".ui-inline-save, .ui-inline-cancel","#"+e).show();break;case "save":a("#"+b).jqGrid("saveRow",e,null,null,{oper:"edit"});a(".ui-inline-edit, .ui-inline-del","#"+e).show();a(".ui-inline-save, .ui-inline-cancel","#"+e).hide();break;case "cancel":a("#"+b).jqGrid("restoreRow",
364
- e);a(".ui-inline-edit, .ui-inline-del","#"+e).show();a(".ui-inline-save, .ui-inline-cancel","#"+e).hide();break}};a.fn.fmatter.actions=function(e,b){var f={keys:false};isUndefined(b.colModel.formatoptions)||(f=a.extend(f,b.colModel.formatoptions));e=b.rowId;if(typeof e=="undefined"||isEmpty(e))return"";f="onclick=$.fn.fmatter.rowactions('"+e+"','"+b.gid+"','edit',"+f.keys+");";var g="<div style='margin-left:8px;'><div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+
365
- f+"><span class='ui-icon ui-icon-pencil'></span></div>";f="onclick=jQuery('#"+b.gid+"').jqGrid('delGridRow','"+e+"');";g=g+"<div title='"+a.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+f+"><span class='ui-icon ui-icon-trash'></span></div>";f="onclick=$.fn.fmatter.rowactions('"+e+"','"+b.gid+"','save',false);";g=g+"<div title='"+a.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save'><span class='ui-icon ui-icon-disk' "+
366
- f+"></span></div>";f="onclick=$.fn.fmatter.rowactions('"+e+"','"+b.gid+"','cancel',false);";return g=g+"<div title='"+a.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel'><span class='ui-icon ui-icon-cancel' "+f+"></span></div></div>"};a.unformat=function(e,b,f,g){var h,j=b.colModel.formatter,c=b.colModel.formatoptions||{},l=/([\.\*\_\'\(\)\{\}\+\?\\])/g;unformatFunc=b.colModel.unformat||a.fn.fmatter[j]&&a.fn.fmatter[j].unformat;if(typeof unformatFunc!==
367
- "undefined"&&isFunction(unformatFunc))h=unformatFunc(a(e).text(),b,e);else if(typeof j!=="undefined"&&isString(j)){h=a.jgrid.formatter||{};switch(j){case "integer":c=a.extend({},h.integer,c);b=c.thousandsSeparator.replace(l,"\\$1");b=new RegExp(b,"g");h=a(e).text().replace(b,"");break;case "number":c=a.extend({},h.number,c);b=c.thousandsSeparator.replace(l,"\\$1");b=new RegExp(b,"g");h=a(e).text().replace(b,"").replace(c.decimalSeparator,".");break;case "currency":c=a.extend({},h.currency,c);b=c.thousandsSeparator.replace(l,
368
- "\\$1");b=new RegExp(b,"g");h=a(e).text().replace(b,"").replace(c.decimalSeparator,".").replace(c.prefix,"").replace(c.suffix,"");break;case "checkbox":c=b.colModel.editoptions?b.colModel.editoptions.value.split(":"):["Yes","No"];h=a("input",e).attr("checked")?c[0]:c[1];break;case "select":h=a.unformat.select(e,b,f,g);break;case "actions":return"";default:h=a(e).text()}}return h?h:g===true?a(e).text():a.jgrid.htmlDecode(a(e).html())};a.unformat.select=function(e,b,f,g){f=[];e=a(e).text();if(g==true)return e;
369
- b=a.extend({},b.colModel.editoptions);if(b.value){var h=b.value;b=b.multiple===true?true:false;g=[];var j;if(b){g=e.split(",");g=a.map(g,function(n){return a.trim(n)})}if(isString(h))for(var c=h.split(";"),l=0,k=0;k<c.length;k++){j=c[k].split(":");if(b){if(jQuery.inArray(j[1],g)>-1){f[l]=j[0];l++}}else if(a.trim(j[1])==a.trim(e)){f[0]=j[0];break}}else if(isObject(h)){b||(g[0]=e);f=jQuery.map(g,function(n){var m;a.each(h,function(p,r){if(r==n){m=p;return false}});if(m)return m})}return f.join(", ")}else return e||
370
- ""};isValue=function(e){return isObject(e)||isString(e)||isNumber(e)||isBoolean(e)};isBoolean=function(e){return typeof e==="boolean"};isNull=function(e){return e===null};isNumber=function(e){return typeof e==="number"&&isFinite(e)};isString=function(e){return typeof e==="string"};isEmpty=function(e){if(!isString(e)&&isValue(e))return false;else if(!isValue(e))return true;e=a.trim(e).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,"");return e===""};isUndefined=function(e){return typeof e==="undefined"};
371
- isObject=function(e){return e&&(typeof e==="object"||isFunction(e))||false};isFunction=function(e){return typeof e==="function"}})(jQuery);
372
- jQuery.fn.searchFilter=function(a,d){function e(b,f,g){this.$=b;this.add=function(y){y==null?b.find(".ui-add-last").click():b.find(".sf:eq("+y+") .ui-add").click();return this};this.del=function(y){y==null?b.find(".sf:last .ui-del").click():b.find(".sf:eq("+y+") .ui-del").click();return this};this.search=function(){b.find(".ui-search").click();return this};this.reset=function(){b.find(".ui-reset").click();return this};this.close=function(){b.find(".ui-closer").click();return this};if(f!=null){function h(){jQuery(this).toggleClass("ui-state-hover");
373
- return false}function j(y){jQuery(this).toggleClass("ui-state-active",y.type=="mousedown");return false}function c(y,F){return"<option value='"+y+"'>"+F+"</option>"}function l(y,F,x){return"<select class='"+y+"'"+(x?" style='display:none;'":"")+">"+F+"</select>"}function k(y,F){y=b.find("tr.sf td.data "+y);y[0]!=null&&F(y)}function n(y,F){var x=b.find("tr.sf td.data "+y);x[0]!=null&&jQuery.each(F,function(){this.data!=null?x.bind(this.type,this.data,this.fn):x.bind(this.type,this.fn)})}var m=jQuery.extend({},
374
- jQuery.fn.searchFilter.defaults,g),p=-1,r="";jQuery.each(m.groupOps,function(){r+=c(this.op,this.text)});r="<select name='groupOp'>"+r+"</select>";b.html("").addClass("ui-searchFilter").append("<div class='ui-widget-overlay' style='z-index: -1'>&#160;</div><table class='ui-widget-content ui-corner-all'><thead><tr><td colspan='5' class='ui-widget-header ui-corner-all' style='line-height: 18px;'><div class='ui-closer ui-state-default ui-corner-all ui-helper-clearfix' style='float: right;'><span class='ui-icon ui-icon-close'></span></div>"+
375
- m.windowTitle+"</td></tr></thead><tbody><tr class='sf'><td class='fields'></td><td class='ops'></td><td class='data'></td><td><div class='ui-del ui-state-default ui-corner-all'><span class='ui-icon ui-icon-minus'></span></div></td><td><div class='ui-add ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plus'></span></div></td></tr><tr><td colspan='5' class='divider'><div>&#160;</div></td></tr></tbody><tfoot><tr><td colspan='3'><span class='ui-reset ui-state-default ui-corner-all' style='display: inline-block; float: left;'><span class='ui-icon ui-icon-arrowreturnthick-1-w' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+
376
- m.resetText+"</span></span><span class='ui-search ui-state-default ui-corner-all' style='display: inline-block; float: right;'><span class='ui-icon ui-icon-search' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+m.searchText+"</span></span><span class='matchText'>"+m.matchText+"</span> "+r+" <span class='rulesText'>"+m.rulesText+"</span></td><td>&#160;</td><td><div class='ui-add-last ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plusthick'></span></div></td></tr></tfoot></table>");
377
- g=b.find("tr.sf");var q=g.find("td.fields"),u=g.find("td.ops"),v=g.find("td.data"),w="";jQuery.each(m.operators,function(){w+=c(this.op,this.text)});w=l("default",w,true);u.append(w);v.append("<input type='text' class='default' style='display:none;' />");var z="",B=false,C=false;jQuery.each(f,function(y){z+=c(this.itemval,this.text);if(this.ops!=null){B=true;var F="";jQuery.each(this.ops,function(){F+=c(this.op,this.text)});F=l("field"+y,F,true);u.append(F)}if(this.dataUrl!=null){if(y>p)p=y;C=true;
378
- var x=this.dataEvents,M=this.dataInit,Y=this.buildSelect;jQuery.ajax(jQuery.extend({url:this.dataUrl,complete:function(Q){Q=Y!=null?jQuery("<div />").append(Y(Q)):jQuery("<div />").append(Q.responseText);Q.find("select").addClass("field"+y).hide();v.append(Q.html());M&&k(".field"+y,M);x&&n(".field"+y,x);y==p&&b.find("tr.sf td.fields select[name='field']").change()}},m.ajaxSelectOptions))}else if(this.dataValues!=null){C=true;var da="";jQuery.each(this.dataValues,function(){da+=c(this.value,this.text)});
379
- da=l("field"+y,da,true);v.append(da)}else if(this.dataEvents!=null||this.dataInit!=null){C=true;da="<input type='text' class='field"+y+"' />";v.append(da)}this.dataInit!=null&&y!=p&&k(".field"+y,this.dataInit);this.dataEvents!=null&&y!=p&&n(".field"+y,this.dataEvents)});z="<select name='field'>"+z+"</select>";q.append(z);f=q.find("select[name='field']");B?f.change(function(y){var F=y.target.selectedIndex;y=jQuery(y.target).parents("tr.sf").find("td.ops");y.find("select").removeAttr("name").hide();
380
- F=y.find(".field"+F);if(F[0]==null)F=y.find(".default");F.attr("name","op").show()}):u.find(".default").attr("name","op").show();C?f.change(function(y){var F=y.target.selectedIndex;y=jQuery(y.target).parents("tr.sf").find("td.data");y.find("select,input").removeClass("vdata").hide();F=y.find(".field"+F);if(F[0]==null)F=y.find(".default");F.show().addClass("vdata")}):v.find(".default").show().addClass("vdata");if(B||C)f.change();b.find(".ui-state-default").hover(h,h).mousedown(j).mouseup(j);b.find(".ui-closer").click(function(){m.onClose(jQuery(b.selector));
381
- return false});b.find(".ui-del").click(function(y){y=jQuery(y.target).parents(".sf");if(y.siblings(".sf").length>0){m.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&y.find(".hasDatepicker").datepicker("destroy");y.remove()}else{y.find("select[name='field']")[0].selectedIndex=0;y.find("select[name='op']")[0].selectedIndex=0;y.find(".data input").val("");y.find(".data select").each(function(){this.selectedIndex=0});y.find("select[name='field']").change()}return false});b.find(".ui-add").click(function(y){y=
382
- jQuery(y.target).parents(".sf");var F=y.clone(true).insertAfter(y);F.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");if(m.clone){F.find("select[name='field']")[0].selectedIndex=y.find("select[name='field']")[0].selectedIndex;if(F.find("select[name='op']")[0]!=null)F.find("select[name='op']").focus()[0].selectedIndex=y.find("select[name='op']")[0].selectedIndex;var x=F.find("select.vdata");if(x[0]!=null)x[0].selectedIndex=y.find("select.vdata")[0].selectedIndex}else{F.find(".data input").val("");
383
- F.find("select[name='field']").focus()}m.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&y.find(".hasDatepicker").each(function(){var M=jQuery.data(this,"datepicker").settings;F.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(M)});F.find("select[name='field']").change();return false});b.find(".ui-search").click(function(){var y=jQuery(b.selector),F,x=y.find("select[name='groupOp'] :selected").val();F=m.stringResult?'{"groupOp":"'+x+'","rules":[':{groupOp:x,
384
- rules:[]};y.find(".sf").each(function(M){var Y=jQuery(this).find("select[name='field'] :selected").val(),da=jQuery(this).find("select[name='op'] :selected").val(),Q=jQuery(this).find("input.vdata,select.vdata :selected").val();Q+="";Q=Q.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');if(m.stringResult){if(M>0)F+=",";F+='{"field":"'+Y+'",';F+='"op":"'+da+'",';F+='"data":"'+Q+'"}'}else F.rules.push({field:Y,op:da,data:Q})});if(m.stringResult)F+="]}";m.onSearch(F);return false});b.find(".ui-reset").click(function(){var y=
385
- jQuery(b.selector);y.find(".ui-del").click();y.find("select[name='groupOp']")[0].selectedIndex=0;m.onReset();return false});b.find(".ui-add-last").click(function(){var y=jQuery(b.selector+" .sf:last"),F=y.clone(true).insertAfter(y);F.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");F.find(".data input").val("");F.find("select[name='field']").focus();m.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&y.find(".hasDatepicker").each(function(){var x=jQuery.data(this,"datepicker").settings;
386
- F.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(x)});F.find("select[name='field']").change();return false})}}return new e(this,a,d)};jQuery.fn.searchFilter.version="1.2.9";
387
- jQuery.fn.searchFilter.defaults={clone:true,datepickerFix:true,onReset:function(a){alert("Reset Clicked. Data Returned: "+a)},onSearch:function(a){alert("Search Clicked. Data Returned: "+a)},onClose:function(a){a.hide()},groupOps:[{op:"AND",text:"all"},{op:"OR",text:"any"}],operators:[{op:"eq",text:"is equal to"},{op:"ne",text:"is not equal to"},{op:"lt",text:"is less than"},{op:"le",text:"is less or equal to"},{op:"gt",text:"is greater than"},{op:"ge",text:"is greater or equal to"},{op:"in",text:"is in"},
388
- {op:"ni",text:"is not in"},{op:"bw",text:"begins with"},{op:"bn",text:"does not begin with"},{op:"ew",text:"ends with"},{op:"en",text:"does not end with"},{op:"cn",text:"contains"},{op:"nc",text:"does not contain"}],matchText:"match",rulesText:"rules",resetText:"Reset",searchText:"Search",stringResult:true,windowTitle:"Search Rules",ajaxSelectOptions:{}};
389
- var xmlJsonClass={xml2json:function(a,d){if(a.nodeType===9)a=a.documentElement;a=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+d+(d?a.replace(/\t/g,d):a.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,d){var e=function(g,h,j){var c="",l,k;if(g instanceof Array)if(g.length===0)c+=j+"<"+h+">__EMPTY_ARRAY_</"+h+">\n";else{l=0;for(k=g.length;l<k;l+=1){var n=j+e(g[l],h,j+"\t")+"\n";c+=n}}else if(typeof g==="object"){l=false;c+=j+"<"+h;for(k in g)if(g.hasOwnProperty(k))if(k.charAt(0)===
390
- "@")c+=" "+k.substr(1)+'="'+g[k].toString()+'"';else l=true;c+=l?">":"/>";if(l){for(k in g)if(g.hasOwnProperty(k))if(k==="#text")c+=g[k];else if(k==="#cdata")c+="<![CDATA["+g[k]+"]]\>";else if(k.charAt(0)!=="@")c+=e(g[k],k,j+"\t");c+=(c.charAt(c.length-1)==="\n"?j:"")+"</"+h+">"}}else c+=typeof g==="function"?j+"<"+h+"><![CDATA["+g+"]]\></"+h+">":g.toString()==='""'||g.toString().length===0?j+"<"+h+">__EMPTY_STRING_</"+h+">":j+"<"+h+">"+g.toString()+"</"+h+">";return c},b="",f;for(f in a)if(a.hasOwnProperty(f))b+=
391
- e(a[f],f,"");return d?b.replace(/\t/g,d):b.replace(/\t|\n/g,"")},toObj:function(a){var d={},e=/function/i;if(a.nodeType===1){if(a.attributes.length){var b;for(b=0;b<a.attributes.length;b+=1)d["@"+a.attributes[b].nodeName]=(a.attributes[b].nodeValue||"").toString()}if(a.firstChild){var f=b=0,g=false,h;for(h=a.firstChild;h;h=h.nextSibling)if(h.nodeType===1)g=true;else if(h.nodeType===3&&h.nodeValue.match(/[^ \f\n\r\t\v]/))b+=1;else if(h.nodeType===4)f+=1;if(g)if(b<2&&f<2){this.removeWhite(a);for(h=
392
- a.firstChild;h;h=h.nextSibling)if(h.nodeType===3)d["#text"]=this.escape(h.nodeValue);else if(h.nodeType===4)if(e.test(h.nodeValue))d[h.nodeName]=[d[h.nodeName],h.nodeValue];else d["#cdata"]=this.escape(h.nodeValue);else if(d[h.nodeName])if(d[h.nodeName]instanceof Array)d[h.nodeName][d[h.nodeName].length]=this.toObj(h);else d[h.nodeName]=[d[h.nodeName],this.toObj(h)];else d[h.nodeName]=this.toObj(h)}else if(a.attributes.length)d["#text"]=this.escape(this.innerXml(a));else d=this.escape(this.innerXml(a));
393
- else if(b)if(a.attributes.length)d["#text"]=this.escape(this.innerXml(a));else{d=this.escape(this.innerXml(a));if(d==="__EMPTY_ARRAY_")d="[]";else if(d==="__EMPTY_STRING_")d=""}else if(f)if(f>1)d=this.escape(this.innerXml(a));else for(h=a.firstChild;h;h=h.nextSibling)if(e.test(a.firstChild.nodeValue)){d=a.firstChild.nodeValue;break}else d["#cdata"]=this.escape(h.nodeValue)}if(!a.attributes.length&&!a.firstChild)d=null}else if(a.nodeType===9)d=this.toObj(a.documentElement);else alert("unhandled node type: "+
394
- a.nodeType);return d},toJson:function(a,d,e){var b=d?'"'+d+'"':"";if(a==="[]")b+=d?":[]":"[]";else if(a instanceof Array){var f,g,h=[];g=0;for(f=a.length;g<f;g+=1)h[g]=this.toJson(a[g],"",e+"\t");b+=(d?":[":"[")+(h.length>1?"\n"+e+"\t"+h.join(",\n"+e+"\t")+"\n"+e:h.join(""))+"]"}else if(a===null)b+=(d&&":")+"null";else if(typeof a==="object"){f=[];for(g in a)if(a.hasOwnProperty(g))f[f.length]=this.toJson(a[g],g,e+"\t");b+=(d?":{":"{")+(f.length>1?"\n"+e+"\t"+f.join(",\n"+e+"\t")+"\n"+e:f.join(""))+
395
- "}"}else if(typeof a==="string"){e=/function/i;f=a.toString();b+=/(^-?\d+\.?\d*$)/.test(f)||e.test(f)||f==="false"||f==="true"?(d&&":")+f:(d&&":")+'"'+a+'"'}else b+=(d&&":")+a.toString();return b},innerXml:function(a){var d="";if("innerHTML"in a)d=a.innerHTML;else{var e=function(b){var f="",g;if(b.nodeType===1){f+="<"+b.nodeName;for(g=0;g<b.attributes.length;g+=1)f+=" "+b.attributes[g].nodeName+'="'+(b.attributes[g].nodeValue||"").toString()+'"';if(b.firstChild){f+=">";for(g=b.firstChild;g;g=g.nextSibling)f+=
396
- e(g);f+="</"+b.nodeName+">"}else f+="/>"}else if(b.nodeType===3)f+=b.nodeValue;else if(b.nodeType===4)f+="<![CDATA["+b.nodeValue+"]]\>";return f};for(a=a.firstChild;a;a=a.nextSibling)d+=e(a)}return d},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();var d;for(d=a.firstChild;d;)if(d.nodeType===3)if(d.nodeValue.match(/[^ \f\n\r\t\v]/))d=d.nextSibling;else{var e=d.nextSibling;a.removeChild(d);
397
- d=e}else{d.nodeType===1&&this.removeWhite(d);d=d.nextSibling}return a}};
398
- (function(a){function d(l,k,n){var m=h[l];g=a("#"+m.id).find("ul:first").clone(true);g.css(m.menuStyle).find("li").css(m.itemStyle).hover(function(){a(this).css(m.itemHoverStyle)},function(){a(this).css(m.itemStyle)}).find("img").css({verticalAlign:"middle",paddingRight:"2px"});b.html(g);if(m.onShowMenu)b=m.onShowMenu(n,b);a.each(m.bindings,function(p,r){a("#"+p,b).bind("click",function(){e();r(k,j)})});b.css({left:n[m.eventPosX],top:n[m.eventPosY]}).show();m.shadow&&f.css({width:b.width(),height:b.height(),
399
- left:n.pageX+2,top:n.pageY+2}).show();a(document).one("click",e)}function e(){b.hide();f.hide()}var b,f,g,h,j,c={menuStyle:{listStyle:"none",padding:"1px",margin:"0px",backgroundColor:"#fff",border:"1px solid #999",width:"100px"},itemStyle:{margin:"0px",color:"#000",display:"block",cursor:"default",padding:"3px",border:"1px solid #fff",backgroundColor:"transparent"},itemHoverStyle:{border:"1px solid #0a246a",backgroundColor:"#b6bdd2"},eventPosX:"pageX",eventPosY:"pageY",shadow:true,onContextMenu:null,
400
- onShowMenu:null};a.fn.contextMenu=function(l,k){b||(b=a('<div id="jqContextMenu"></div>').hide().css({position:"absolute",zIndex:"500"}).appendTo("body").bind("click",function(m){m.stopPropagation()}));f||(f=a("<div></div>").css({backgroundColor:"#000",position:"absolute",opacity:0.2,zIndex:499}).appendTo("body").hide());h=h||[];h.push({id:l,menuStyle:a.extend({},c.menuStyle,k.menuStyle||{}),itemStyle:a.extend({},c.itemStyle,k.itemStyle||{}),itemHoverStyle:a.extend({},c.itemHoverStyle,k.itemHoverStyle||
401
- {}),bindings:k.bindings||{},shadow:k.shadow||k.shadow===false?k.shadow:c.shadow,onContextMenu:k.onContextMenu||c.onContextMenu,onShowMenu:k.onShowMenu||c.onShowMenu,eventPosX:k.eventPosX||c.eventPosX,eventPosY:k.eventPosY||c.eventPosY});var n=h.length-1;a(this).bind("contextmenu",function(m){(h[n].onContextMenu?h[n].onContextMenu(m):true)&&d(n,this,m,k);return false});return this};a.contextMenu={defaults:function(l){a.each(l,function(k,n){if(typeof n=="object"&&c[k])a.extend(c[k],n);else c[k]=n})}}})(jQuery);
402
- $(function(){$("div.contextMenu").hide()});
403
- jQuery.tableDnD={currentTable:null,dragObject:null,mouseOffset:null,oldY:0,build:function(a){this.each(function(){this.tableDnDConfig=jQuery.extend({onDragStyle:null,onDropStyle:null,onDragClass:"tDnD_whileDrag",onDrop:null,onDragStart:null,scrollAmount:5,serializeRegexp:/[^\-]*$/,serializeParamName:null,dragHandle:null},a||{});jQuery.tableDnD.makeDraggable(this)});jQuery(document).bind("mousemove",jQuery.tableDnD.mousemove).bind("mouseup",jQuery.tableDnD.mouseup);return this},makeDraggable:function(a){var d=
404
- a.tableDnDConfig;a.tableDnDConfig.dragHandle?jQuery("td."+a.tableDnDConfig.dragHandle,a).each(function(){jQuery(this).mousedown(function(e){jQuery.tableDnD.dragObject=this.parentNode;jQuery.tableDnD.currentTable=a;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,e);d.onDragStart&&d.onDragStart(a,this);return false})}):jQuery("tr",a).each(function(){var e=jQuery(this);e.hasClass("nodrag")||e.mousedown(function(b){if(b.target.tagName=="TD"){jQuery.tableDnD.dragObject=this;jQuery.tableDnD.currentTable=
405
- a;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,b);d.onDragStart&&d.onDragStart(a,this);return false}}).css("cursor","move")})},updateTables:function(){this.each(function(){this.tableDnDConfig&&jQuery.tableDnD.makeDraggable(this)})},mouseCoords:function(a){if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};return{x:a.clientX+document.body.scrollLeft-document.body.clientLeft,y:a.clientY+document.body.scrollTop-document.body.clientTop}},getMouseOffset:function(a,d){d=d||window.event;
406
- a=this.getPosition(a);d=this.mouseCoords(d);return{x:d.x-a.x,y:d.y-a.y}},getPosition:function(a){var d=0,e=0;if(a.offsetHeight==0)a=a.firstChild;if(a&&a.offsetParent){for(;a.offsetParent;){d+=a.offsetLeft;e+=a.offsetTop;a=a.offsetParent}d+=a.offsetLeft;e+=a.offsetTop}return{x:d,y:e}},mousemove:function(a){if(jQuery.tableDnD.dragObject!=null){var d=jQuery(jQuery.tableDnD.dragObject),e=jQuery.tableDnD.currentTable.tableDnDConfig,b=jQuery.tableDnD.mouseCoords(a);a=b.y-jQuery.tableDnD.mouseOffset.y;var f=
407
- window.pageYOffset;if(document.all)if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")f=document.documentElement.scrollTop;else if(typeof document.body!="undefined")f=document.body.scrollTop;if(b.y-f<e.scrollAmount)window.scrollBy(0,-e.scrollAmount);else(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-(b.y-f)<e.scrollAmount&&window.scrollBy(0,e.scrollAmount);if(a!=jQuery.tableDnD.oldY){b=
408
- a>jQuery.tableDnD.oldY;jQuery.tableDnD.oldY=a;e.onDragClass?d.addClass(e.onDragClass):d.css(e.onDragStyle);if(d=jQuery.tableDnD.findDropTargetRow(d,a))if(b&&jQuery.tableDnD.dragObject!=d)jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,d.nextSibling);else!b&&jQuery.tableDnD.dragObject!=d&&jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,d)}return false}},findDropTargetRow:function(a,d){for(var e=jQuery.tableDnD.currentTable.rows,b=0;b<e.length;b++){var f=
409
- e[b],g=this.getPosition(f).y,h=parseInt(f.offsetHeight)/2;if(f.offsetHeight==0){g=this.getPosition(f.firstChild).y;h=parseInt(f.firstChild.offsetHeight)/2}if(d>g-h&&d<g+h){if(f==a)return null;d=jQuery.tableDnD.currentTable.tableDnDConfig;return d.onAllowDrop?d.onAllowDrop(a,f)?f:null:jQuery(f).hasClass("nodrop")?null:f}}return null},mouseup:function(){if(jQuery.tableDnD.currentTable&&jQuery.tableDnD.dragObject){var a=jQuery.tableDnD.dragObject,d=jQuery.tableDnD.currentTable.tableDnDConfig;d.onDragClass?
410
- jQuery(a).removeClass(d.onDragClass):jQuery(a).css(d.onDropStyle);jQuery.tableDnD.dragObject=null;d.onDrop&&d.onDrop(jQuery.tableDnD.currentTable,a);jQuery.tableDnD.currentTable=null}},serialize:function(){return jQuery.tableDnD.currentTable?jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable):"Error: No Table id set, you need to set an id on your table and every row"},serializeTable:function(a){for(var d="",e=a.id,b=a.rows,f=0;f<b.length;f++){if(d.length>0)d+="&";var g=b[f].id;if(g&&g&&a.tableDnDConfig&&
411
- a.tableDnDConfig.serializeRegexp)g=g.match(a.tableDnDConfig.serializeRegexp)[0];d+=e+"[]="+g}return d},serializeTables:function(){var a="";this.each(function(){a+=jQuery.tableDnD.serializeTable(this)});return a}};jQuery.fn.extend({tableDnD:jQuery.tableDnD.build,tableDnDUpdate:jQuery.tableDnD.updateTables,tableDnDSerialize:jQuery.tableDnD.serializeTables});
412
- (function(a){a.widget("ui.multiselect",{_init:function(){this.element.hide();this.id=this.element.attr("id");this.container=a('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);this.count=0;this.selectedContainer=a('<div class="selected"></div>').appendTo(this.container);this.availableContainer=a('<div class="available"></div>').appendTo(this.container);this.selectedActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+
413
- a.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+a.ui.multiselect.locale.removeAll+"</a></div>").appendTo(this.selectedContainer);this.availableActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+a.ui.multiselect.locale.addAll+"</a></div>").appendTo(this.availableContainer);this.selectedList=a('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",
414
- function(){return false}).appendTo(this.selectedContainer);this.availableList=a('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",function(){return false}).appendTo(this.availableContainer);var d=this;this.container.width(this.element.width()+1);this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));this.selectedList.height(Math.max(this.element.height()-
415
- this.selectedActions.height(),1));this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));if(!this.options.animated){this.options.show="show";this.options.hide="hide"}this._populateLists(this.element.find("option"));this.options.sortable&&a("ul.selected").sortable({placeholder:"ui-state-highlight",axis:"y",update:function(){d.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(d.element)})},receive:function(e,
416
- b){b.item.data("optionLink").attr("selected",true);d.count+=1;d._updateCount();d.selectedList.children(".ui-draggable").each(function(){a(this).removeClass("ui-draggable");a(this).data("optionLink",b.item.data("optionLink"));a(this).data("idx",b.item.data("idx"));d._applyItemState(a(this),true)});setTimeout(function(){b.item.remove()},1)}});this.options.searchable?this._registerSearchEvents(this.availableContainer.find("input.search")):a(".search").hide();a(".remove-all").click(function(){d._populateLists(d.element.find("option").removeAttr("selected"));
417
- return false});a(".add-all").click(function(){d._populateLists(d.element.find("option").attr("selected","selected"));return false})},destroy:function(){this.element.show();this.container.remove();a.widget.prototype.destroy.apply(this,arguments)},_populateLists:function(d){this.selectedList.children(".ui-element").remove();this.availableList.children(".ui-element").remove();this.count=0;var e=this;a(d.map(function(b){var f=e._getOptionNode(this).appendTo(this.selected?e.selectedList:e.availableList).show();
418
- if(this.selected)e.count+=1;e._applyItemState(f,this.selected);f.data("idx",b);return f[0]}));this._updateCount()},_updateCount:function(){this.selectedContainer.find("span.count").text(this.count+" "+a.ui.multiselect.locale.itemsCount)},_getOptionNode:function(d){d=a(d);var e=a('<li class="ui-state-default ui-element" title="'+d.text()+'"><span class="ui-icon"/>'+d.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();e.data("optionLink",d);return e},_cloneWithData:function(d){var e=
419
- d.clone();e.data("optionLink",d.data("optionLink"));e.data("idx",d.data("idx"));return e},_setSelected:function(d,e){d.data("optionLink").attr("selected",e);if(e){e=this._cloneWithData(d);d[this.options.hide](this.options.animated,function(){a(this).remove()});e.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);this._applyItemState(e,true);return e}else{var b=this.availableList.find("li"),f=this.options.nodeComparator;e=null;var g=d.data("idx"),h=f(d,a(b[g]));if(h)for(;g>=
420
- 0&&g<b.length;){h>0?g++:g--;if(h!=f(d,a(b[g]))){e=b[h>0?g:g+1];break}}else e=b[g];b=this._cloneWithData(d);e?b.insertBefore(a(e)):b.appendTo(this.availableList);d[this.options.hide](this.options.animated,function(){a(this).remove()});b.hide()[this.options.show](this.options.animated);this._applyItemState(b,false);return b}},_applyItemState:function(d,e){if(e){this.options.sortable?d.children("span").addClass("ui-icon-arrowthick-2-n-s").removeClass("ui-helper-hidden").addClass("ui-icon"):d.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");
421
- d.find("a.action span").addClass("ui-icon-minus").removeClass("ui-icon-plus");this._registerRemoveEvents(d.find("a.action"))}else{d.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");d.find("a.action span").addClass("ui-icon-plus").removeClass("ui-icon-minus");this._registerAddEvents(d.find("a.action"))}this._registerHoverEvents(d)},_filter:function(d){var e=a(this),b=d.children("li");d=b.map(function(){return a(this).text().toLowerCase()});
422
- var f=a.trim(e.val().toLowerCase()),g=[];if(f){b.hide();d.each(function(h){this.indexOf(f)>-1&&g.push(h)});a.each(g,function(){a(b[this]).show()})}else b.show()},_registerHoverEvents:function(d){d.removeClass("ui-state-hover");d.mouseover(function(){a(this).addClass("ui-state-hover")});d.mouseout(function(){a(this).removeClass("ui-state-hover")})},_registerAddEvents:function(d){var e=this;d.click(function(){e._setSelected(a(this).parent(),true);e.count+=1;e._updateCount();return false}).each(function(){a(this).parent().draggable({connectToSortable:"ul.selected",
423
- helper:function(){var b=e._cloneWithData(a(this)).width(a(this).width()-50);b.width(a(this).width());return b},appendTo:".ui-multiselect",containment:".ui-multiselect",revert:"invalid"})})},_registerRemoveEvents:function(d){var e=this;d.click(function(){e._setSelected(a(this).parent(),false);e.count-=1;e._updateCount();return false})},_registerSearchEvents:function(d){var e=this;d.focus(function(){a(this).addClass("ui-state-active")}).blur(function(){a(this).removeClass("ui-state-active")}).keypress(function(b){if(b.keyCode==
424
- 13)return false}).keyup(function(){e._filter.apply(this,[e.availableList])})}});a.extend(a.ui.multiselect,{defaults:{sortable:true,searchable:true,animated:"fast",show:"slideDown",hide:"slideUp",dividerLocation:0.6,nodeComparator:function(d,e){d=d.text();e=e.text();return d==e?0:d<e?-1:1}},locale:{addAll:"Add all",removeAll:"Remove all",itemsCount:"items selected"}})})(jQuery);
1
+ (function(a){a.jgrid=a.jgrid||{};a.extend(a.jgrid,{htmlDecode:function(d){if(d=="&nbsp;"||d=="&#160;"||d.length==1&&d.charCodeAt(0)==160)return"";return!d?d:String(d).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(d){return!d?d:String(d).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(d){var e=a.makeArray(arguments).slice(1);if(d===undefined)d="";return d.replace(/\{(\d+)\}/g,function(b,
2
+ f){return e[f]})},getCellIndex:function(d){d=a(d);d=(!d.is("td")&&!d.is("th")?d.closest("td,th"):d)[0];if(a.browser.msie)return a.inArray(d,d.parentNode.cells);return d.cellIndex},stripHtml:function(d){d+="";var e=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(d)return(d=d.replace(e,""))&&d!=="&nbsp;"&&d!=="&#160;"?d:"";else return d},stringToDoc:function(d){var e;if(typeof d!=="string")return d;try{e=(new DOMParser).parseFromString(d,"text/xml")}catch(b){e=new ActiveXObject("Microsoft.XMLDOM");e.async=false;
3
+ e.loadXML(d)}return e&&e.documentElement&&e.documentElement.tagName!="parsererror"?e:null},parse:function(d){d=d;if(d.substr(0,9)=="while(1);")d=d.substr(9);if(d.substr(0,2)=="/*")d=d.substr(2,d.length-4);d||(d="{}");d=a.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(d):eval("("+d+")");return d.hasOwnProperty("d")?d.d:d},empty:function(){for(;this.firstChild;)this.removeChild(this.firstChild)},jqID:function(d){d+="";return d.replace(/([\.\:\[\]])/g,"\\$1")},
4
+ ajaxOptions:{},extend:function(d){a.extend(a.fn.jqGrid,d);this.no_legacy_api||a.fn.extend(d)}});a.fn.jqGrid=function(d){if(typeof d=="string"){var e=a.fn.jqGrid[d];if(!e)throw"jqGrid - No such method: "+d;var b=a.makeArray(arguments).slice(1);return e.apply(this,b)}return this.each(function(){if(!this.grid){var f=a.extend(true,{url:"",height:150,page:1,rowNum:20,records:0,pager:"",pgbuttons:true,pginput:true,colModel:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",
5
+ altRows:false,selarrrow:[],savedRow:[],shrinkToFit:true,xmlReader:{},jsonReader:{},subGrid:false,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,onHeaderClick:null,viewrecords:false,loadonce:false,multiselect:false,multikey:false,editurl:null,search:false,
6
+ caption:"",hidegrid:true,hiddengrid:false,postData:{},userData:{},treeGrid:false,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del"},forceFit:false,gridstate:"visible",cellEdit:false,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[false,""],scroll:false,multiboxonly:false,deselectAfterSort:true,scrollrows:false,autowidth:false,
7
+ scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:false,rownumWidth:25,rownumbers:false,pagerpos:"center",recordpos:"right",footerrow:false,userDataOnFooter:false,hoverrows:true,altclass:"ui-priority-secondary",viewsortcols:[false,"vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false},a.jgrid.defaults,d||{}),g={headers:[],cols:[],footers:[],dragStart:function(p,s,t){this.resizing={idx:p,startX:s.clientX,sOL:t[0]};
8
+ this.hDiv.style.cursor="col-resize";this.curGbox=a("#rs_m"+f.id,"#gbox_"+f.id);this.curGbox.css({display:"block",left:t[0],top:t[1],height:t[2]});a.isFunction(f.resizeStart)&&f.resizeStart.call(this,s,p);document.onselectstart=new Function("return false")},dragMove:function(p){if(this.resizing){var s=p.clientX-this.resizing.startX;p=this.headers[this.resizing.idx];var t=f.direction==="ltr"?p.width+s:p.width-s,A;if(t>33){this.curGbox.css({left:this.resizing.sOL+s});if(f.forceFit===true){A=this.headers[this.resizing.idx+
9
+ f.nv];s=f.direction==="ltr"?A.width-s:A.width+s;if(s>33){p.newWidth=t;A.newWidth=s}}else{this.newWidth=f.direction==="ltr"?f.tblwidth+s:f.tblwidth-s;p.newWidth=t}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var p=this.resizing.idx,s=this.headers[p].newWidth||this.headers[p].width;s=parseInt(s,10);this.resizing=false;a("#rs_m"+f.id).css("display","none");f.colModel[p].width=s;this.headers[p].width=s;this.headers[p].el.style.width=s+"px";if(this.cols.length>0)this.cols[p].style.width=
10
+ s+"px";if(this.footers.length>0)this.footers[p].style.width=s+"px";if(f.forceFit===true){s=this.headers[p+f.nv].newWidth||this.headers[p+f.nv].width;this.headers[p+f.nv].width=s;this.headers[p+f.nv].el.style.width=s+"px";if(this.cols.length>0)this.cols[p+f.nv].style.width=s+"px";if(this.footers.length>0)this.footers[p+f.nv].style.width=s+"px";f.colModel[p+f.nv].width=s}else{f.tblwidth=this.newWidth||f.tblwidth;a("table:first",this.bDiv).css("width",f.tblwidth+"px");a("table:first",this.hDiv).css("width",
11
+ f.tblwidth+"px");this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(f.footerrow){a("table:first",this.sDiv).css("width",f.tblwidth+"px");this.sDiv.scrollLeft=this.bDiv.scrollLeft}}a.isFunction(f.resizeStop)&&f.resizeStop.call(this,s,p)}this.curGbox=null;document.onselectstart=new Function("return true")},populateVisible:function(){g.timer&&clearTimeout(g.timer);g.timer=null;var p=a(g.bDiv).height();if(p){var s=a("table:first",g.bDiv),t=a("> tbody > tr:visible:first",s).outerHeight()||g.prevRowHeight;if(t){g.prevRowHeight=
12
+ t;var A=f.rowNum,D=g.scrollTop=g.bDiv.scrollTop,M=Math.round(s.position().top)-D,I=M+s.height();t=t*A;var P,J,H;if(M<=0&&I<p&&(f.lastpage==null||parseInt((I+D+t-1)/t,10)<f.lastpage)){J=parseInt((p-I+t-1)/t,10);if(I>=0||J<2||f.scroll===true){P=Math.round((I+D)/t)+1;M=-1}else M=1}if(M>0){P=parseInt(D/t,10)+1;J=parseInt((D+p)/t,10)+2-P;H=true}if(J)if(!(f.lastpage&&P>f.lastpage))if(g.hDiv.loading)g.timer=setTimeout(g.populateVisible,200);else{f.page=P;if(H){g.selectionPreserver(s[0]);g.emptyRows(g.bDiv)}g.populate(J)}}}},
13
+ scrollGrid:function(){if(f.scroll){var p=g.bDiv.scrollTop;if(p!=g.scrollTop){g.scrollTop=p;g.timer&&clearTimeout(g.timer);g.timer=setTimeout(g.populateVisible,200)}}g.hDiv.scrollLeft=g.bDiv.scrollLeft;if(f.footerrow)g.sDiv.scrollLeft=g.bDiv.scrollLeft},selectionPreserver:function(p){var s=p.p,t=s.selrow,A=s.selarrrow?a.makeArray(s.selarrrow):null,D=p.grid.bDiv.scrollLeft,M=s.gridComplete;s.gridComplete=function(){s.selrow=null;s.selarrrow=[];if(s.multiselect&&A&&A.length>0)for(var I=0;I<A.length;I++)A[I]!=
14
+ t&&a(p).jqGrid("setSelection",A[I],false);t&&a(p).jqGrid("setSelection",t,false);p.grid.bDiv.scrollLeft=D;if(s.gridComplete=M)M()}}};this.p=f;var h,j,c;if(this.p.colNames.length===0)for(h=0;h<this.p.colModel.length;h++)this.p.colNames[h]=this.p.colModel[h].label||this.p.colModel[h].name;if(this.p.colNames.length!==this.p.colModel.length)alert(a.jgrid.errors.model);else{var l=a("<div class='ui-jqgrid-view'></div>"),k,o=a.browser.msie?true:false,m=a.browser.safari?true:false;c=this;c.p.direction=a.trim(c.p.direction.toLowerCase());
15
+ if(a.inArray(c.p.direction,["ltr","rtl"])==-1)c.p.direction="ltr";j=c.p.direction;a(l).insertBefore(this);a(this).appendTo(l).removeClass("scroll");var n=a("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");a(n).insertBefore(l).attr({id:"gbox_"+this.id,dir:j});a(l).appendTo(n).attr("id","gview_"+this.id);k=o&&a.browser.version<=6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"";a("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+
16
+ this.id+"'></div>").append(k).insertBefore(l);a("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(l);a(this).attr({cellSpacing:"0",cellPadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var q=function(p,s){p=parseInt(p,10);return isNaN(p)?s?s:0:p},r=function(p,s){var t=c.p.colModel[p].align,A='style="',D=c.p.colModel[p].classes;if(t)A+="text-align:"+t+";";if(c.p.colModel[p].hidden===
17
+ true)A+="display:none;";if(s===0)A+="width: "+g.headers[p].width+"px;";return A+'"'+(D!==undefined?' class="'+D+'"':"")},u=function(p,s,t,A,D){p=v(p,s,t,D,"add");return'<td role="gridcell" '+r(t,A)+' title="'+a.jgrid.stripHtml(p)+'">'+p+"</td>"},v=function(p,s,t,A,D){t=c.p.colModel[t];if(typeof t.formatter!=="undefined"){p={rowId:p,colModel:t,gid:c.p.id};s=a.isFunction(t.formatter)?t.formatter.call(c,s,p,A,D):a.fmatter?a.fn.fmatter(t.formatter,s,p,A,D):w(s)}else s=w(s);return s},w=function(p){return p===
18
+ undefined||p===null||p===""?"&#160;":c.p.autoencode?a.jgrid.htmlEncode(p):p+""},z=function(p,s,t){p='<input type="checkbox" id="jqg_'+p+'" class="cbox" name="jqg_'+p+'"/>';return"<td role='gridcell' "+r(s,t)+">"+p+"</td>"},B=function(p,s,t,A){t=(parseInt(t,10)-1)*parseInt(A,10)+1+s;return'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+r(p,s)+">"+t+"</td>"},C=function(p){var s,t=[],A=0,D;for(D=0;D<c.p.colModel.length;D++){s=c.p.colModel[D];if(s.name!=="cb"&&s.name!=="subgrid"&&s.name!==
19
+ "rn"){t[A]=p=="xml"?s.xmlmap||s.name:s.jsonmap||s.name;A++}}return t},y=function(p){var s=c.p.remapColumns;if(!s||!s.length)s=a.map(c.p.colModel,function(t,A){return A});if(p)s=a.map(s,function(t){return t<p?null:t-p});return s},F=function(p,s){var t=a("tbody:first",p);if(!c.p.gridview||c.p.jqgdnd)a("*",t).children().unbind();if(o)a.jgrid.empty.apply(t[0]);else t[0].innerHTML="";if(s&&c.p.scroll){a(">div:first",p).css({height:"auto"}).children("div:first").css({height:0,display:"none"});p.scrollTop=
20
+ 0}},x=function(p,s){var t,A,D;t=p[s];if(t===undefined){if(typeof s==="string")D=s.split(".");try{if(D.length)for(t=p;t&&D.length;){A=D.shift();t=t[A]}}catch(M){}}return t},N=function(p,s,t,A,D){var M=new Date;c.p.reccount=0;if(a.isXMLDoc(p)){if(c.p.treeANode===-1&&!c.p.scroll){F(s);t=0}else t=t>0?t:0;var I,P=0,J,H,O=0,X=0,ca=0,ha,pa,na=[],ra,ja={},Da=c.rows.length,ia,Aa,fa=[],ua=0,Ea=c.p.altRows===true?" "+c.p.altclass:"";c.p.xmlReader.repeatitems||(na=C("xml"));ha=c.p.keyIndex===false?c.p.xmlReader.id:
21
+ c.p.keyIndex;if(na.length>0&&!isNaN(ha)){if(c.p.remapColumns&&c.p.remapColumns.length)ha=a.inArray(ha,c.p.remapColumns);ha=na[ha]}pa=(ha+"").indexOf("[")===-1?na.length?function(Ba,ya){return a(ha,Ba).text()||ya}:function(Ba,ya){return a(c.p.xmlReader.cell,Ba).eq(ha).text()||ya}:function(Ba,ya){return Ba.getAttribute(ha.replace(/[\[\]]/g,""))||ya};a(c.p.xmlReader.page,p).each(function(){c.p.page=this.textContent||this.text||1});a(c.p.xmlReader.total,p).each(function(){c.p.lastpage=this.textContent||
22
+ this.text;if(c.p.lastpage===undefined)c.p.lastpage=1});a(c.p.xmlReader.records,p).each(function(){c.p.records=this.textContent||this.text||0});a(c.p.xmlReader.userdata,p).each(function(){c.p.userData[this.getAttribute("name")]=this.textContent||this.text});p=a(c.p.xmlReader.root+" "+c.p.xmlReader.row,p);var Fa=p.length,qa=0;if(p&&Fa){var Ha=parseInt(c.p.rowNum,10),Ja=c.p.scroll?(parseInt(c.p.page,10)-1)*Ha+1:1;if(D)Ha*=D+1;for(D=a.isFunction(c.p.afterInsertRow);qa<Fa;){ia=p[qa];Aa=pa(ia,Ja+qa);I=
23
+ t==0?0:t+1;I=(I+qa)%2==1?Ea:"";fa[ua++]='<tr id="'+Aa+'" role="row" class ="ui-widget-content jqgrow ui-row-'+c.p.direction+""+I+'">';if(c.p.rownumbers===true){fa[ua++]=B(0,qa,c.p.page,c.p.rowNum);ca=1}if(c.p.multiselect===true){fa[ua++]=z(Aa,ca,qa);O=1}if(c.p.subGrid===true){fa[ua++]=a(c).jqGrid("addSubGridCell",O+ca,qa+t);X=1}if(c.p.xmlReader.repeatitems){ra||(ra=y(O+X+ca));var Ka=a(c.p.xmlReader.cell,ia);a.each(ra,function(Ba){var ya=Ka[this];if(!ya)return false;J=ya.textContent||ya.text;ja[c.p.colModel[Ba+
24
+ O+X+ca].name]=J;fa[ua++]=u(Aa,J,Ba+O+X+ca,qa+t,ia)})}else for(I=0;I<na.length;I++){J=a(na[I],ia).text();ja[c.p.colModel[I+O+X+ca].name]=J;fa[ua++]=u(Aa,J,I+O+X+ca,qa+t,ia)}fa[ua++]="</tr>";if(c.p.gridview===false){if(c.p.treeGrid===true){I=c.p.treeANode>=-1?c.p.treeANode:0;H=a(fa.join(""))[0];try{a(c).jqGrid("setTreeNode",ja,H)}catch(La){}Da===0?a("tbody:first",s).append(H):a(c.rows[qa+I+t]).after(H)}else a("tbody:first",s).append(fa.join(""));if(c.p.subGrid===true)try{a(c).jqGrid("addSubGrid",c.rows[c.rows.length-
25
+ 1],O+ca)}catch(Ma){}D&&c.p.afterInsertRow.call(c,Aa,ja,ia);fa=[];ua=0}ja={};P++;qa++;if(P==Ha)break}}c.p.gridview===true&&a("tbody:first",s).append(fa.join(""));c.p.totaltime=new Date-M;if(P>0){c.grid.cols=c.rows[0].cells;if(c.p.records===0)c.p.records=Fa}fa=null;if(!c.p.treeGrid&&!c.p.scroll)c.grid.bDiv.scrollTop=0;c.p.reccount=P;c.p.treeANode=-1;c.p.userDataOnFooter&&a(c).jqGrid("footerData","set",c.p.userData,true);A||da(false,true)}},Y=function(p,s,t,A,D){var M=new Date;c.p.reccount=0;if(p){if(c.p.treeANode===
26
+ -1&&!c.p.scroll){F(s);t=0}else t=t>0?t:0;var I=0,P,J,H,O=[],X,ca=0,ha=0,pa=0,na,ra,ja,Da={},ia,Aa=c.rows.length,fa;H=[];ia=0;var ua=c.p.altRows===true?" "+c.p.altclass:"";c.p.page=x(p,c.p.jsonReader.page)||1;ja=x(p,c.p.jsonReader.total);c.p.lastpage=ja===undefined?1:ja;c.p.records=x(p,c.p.jsonReader.records)||0;c.p.userData=x(p,c.p.jsonReader.userdata)||{};c.p.jsonReader.repeatitems||(X=O=C("json"));ja=c.p.keyIndex===false?c.p.jsonReader.id:c.p.keyIndex;if(O.length>0&&!isNaN(ja)){if(c.p.remapColumns&&
27
+ c.p.remapColumns.length)ja=a.inArray(ja,c.p.remapColumns);ja=O[ja]}if(ra=x(p,c.p.jsonReader.root)){na=ra.length;p=0;var Ea=parseInt(c.p.rowNum,10),Fa=c.p.scroll?(parseInt(c.p.page,10)-1)*Ea+1:1;if(D)Ea*=D+1;for(var qa=a.isFunction(c.p.afterInsertRow);p<na;){D=ra[p];fa=D[ja];if(fa===undefined){fa=Fa+p;if(O.length===0)if(c.p.jsonReader.cell)fa=D[c.p.jsonReader.cell][ja]||fa}P=t==0?0:t+1;P=(P+p)%2==1?ua:"";H[ia++]='<tr id="'+fa+'" role="row" class= "ui-widget-content jqgrow ui-row-'+c.p.direction+""+
28
+ P+'">';if(c.p.rownumbers===true){H[ia++]=B(0,p,c.p.page,c.p.rowNum);pa=1}if(c.p.multiselect){H[ia++]=z(fa,pa,p);ca=1}if(c.p.subGrid){H[ia++]=a(c).jqGrid("addSubGridCell",ca+pa,p+t);ha=1}if(c.p.jsonReader.repeatitems){if(c.p.jsonReader.cell)D=x(D,c.p.jsonReader.cell);X||(X=y(ca+ha+pa))}for(J=0;J<X.length;J++){P=x(D,X[J]);H[ia++]=u(fa,P,J+ca+ha+pa,p+t,D);Da[c.p.colModel[J+ca+ha+pa].name]=P}H[ia++]="</tr>";if(c.p.gridview===false){if(c.p.treeGrid===true){ia=c.p.treeANode>=-1?c.p.treeANode:0;H=a(H.join(""))[0];
29
+ try{a(c).jqGrid("setTreeNode",Da,H)}catch(Ha){}Aa===0?a("tbody:first",s).append(H):a(c.rows[p+ia+t]).after(H)}else a("tbody:first",s).append(H.join(""));if(c.p.subGrid===true)try{a(c).jqGrid("addSubGrid",c.rows[c.rows.length-1],ca+pa)}catch(Ja){}qa&&c.p.afterInsertRow.call(c,fa,Da,D);H=[];ia=0}Da={};I++;p++;if(I==Ea)break}c.p.gridview===true&&a("tbody:first",s).append(H.join(""));c.p.totaltime=new Date-M;if(I>0){c.grid.cols=c.rows[0].cells;if(c.p.records===0)c.p.records=na}}if(!c.p.treeGrid&&!c.p.scroll)c.grid.bDiv.scrollTop=
30
+ 0;c.p.reccount=I;c.p.treeANode=-1;c.p.userDataOnFooter&&a(c).jqGrid("footerData","set",c.p.userData,true);A||da(false,true)}},da=function(p,s){var t,A,D,M,I,P,J,H="";D=(parseInt(c.p.page,10)-1)*parseInt(c.p.rowNum,10);I=D+c.p.reccount;if(c.p.scroll){t=a("tbody:first > tr",c.grid.bDiv);D=I-t.length;if(A=t.outerHeight()){t=D*A;A=parseInt(c.p.records,10)*A;a(">div:first",c.grid.bDiv).css({height:A}).children("div:first").css({height:t,display:t?"":"none"})}}H=c.p.pager?c.p.pager:"";H+=c.p.toppager?H?
31
+ ","+c.p.toppager:c.p.toppager:"";if(H){J=a.jgrid.formatter.integer||{};if(c.p.loadonce){t=A=1;c.p.lastpage=c.page=1;a(".selbox",H).attr("disabled",true)}else{t=q(c.p.page,1);A=q(c.p.lastpage,1);a(".selbox",H).attr("disabled",false)}if(c.p.pginput===true){a(".ui-pg-input",H).val(c.p.page);a("#sp_1",H).html(a.fmatter?a.fmatter.util.NumberFormat(c.p.lastpage,J):c.p.lastpage)}if(c.p.viewrecords)if(c.p.reccount===0)a(".ui-paging-info",H).html(c.p.emptyrecords);else{M=D+1;P=c.p.records;if(a.fmatter){M=
32
+ a.fmatter.util.NumberFormat(M,J);I=a.fmatter.util.NumberFormat(I,J);P=a.fmatter.util.NumberFormat(P,J)}a(".ui-paging-info",H).html(a.jgrid.format(c.p.recordtext,M,I,P))}if(c.p.pgbuttons===true){if(t<=0)t=A=1;if(t==1){a("#first, #prev",c.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");c.p.toppager&&a("#first_t, #prev_t",c.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#first, #prev",c.p.pager).removeClass("ui-state-disabled");c.p.toppager&&a("#first_t, #prev_t",
33
+ c.p.toppager).removeClass("ui-state-disabled")}if(t==A){a("#next, #last",c.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");c.p.toppager&&a("#next_t, #last_t",c.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#next, #last",c.p.pager).removeClass("ui-state-disabled");c.p.toppager&&a("#next_t, #last_t",c.p.toppager).removeClass("ui-state-disabled")}}}p===true&&c.p.rownumbers===true&&a("td.jqgrid-rownum",c.rows).each(function(O){a(this).html(D+1+O)});
34
+ s&&c.p.jqgdnd&&a(c).jqGrid("gridDnD","updateDnD");a.isFunction(c.p.gridComplete)&&c.p.gridComplete.call(c)},Q=function(p){if(!c.grid.hDiv.loading){var s=c.p.scroll&&p==false,t={},A,D=c.p.prmNames;if(D.search!==null)t[D.search]=c.p.search;if(D.nd!=null)t[D.nd]=(new Date).getTime();if(D.rows!==null)t[D.rows]=c.p.rowNum;if(D.page!==null)t[D.page]=c.p.page;if(D.sort!==null)t[D.sort]=c.p.sortname;if(D.order!==null)t[D.order]=c.p.sortorder;var M=c.p.loadComplete,I=a.isFunction(M);I||(M=null);var P=0;p=
35
+ p||1;if(p>1)if(D.npage!=null){t[D.npage]=p;P=p-1;p=1}else M=function(H){I&&c.p.loadComplete.call(c,H);c.grid.hDiv.loading=false;c.p.page++;Q(p-1)};else D.npage!=null&&delete c.p.postData[D.npage];a.extend(c.p.postData,t);var J=!c.p.scroll?0:c.rows.length-1;if(a.isFunction(c.p.datatype))c.p.datatype.call(c,c.p.postData,"load_"+c.p.id);else{a.isFunction(c.p.beforeRequest)&&c.p.beforeRequest.call(c);A=c.p.datatype.toLowerCase();switch(A){case "json":case "jsonp":case "xml":case "script":a.ajax(a.extend({url:c.p.url,
36
+ type:c.p.mtype,dataType:A,data:a.isFunction(c.p.serializeGridData)?c.p.serializeGridData.call(c,c.p.postData):c.p.postData,complete:function(H,O){if(O=="success"||H.statusText=="OK"&&H.status=="200"){A==="xml"?N(H.responseXML,c.grid.bDiv,J,p>1,P):Y(a.jgrid.parse(H.responseText),c.grid.bDiv,J,p>1,P);M&&M.call(c,H);s&&c.grid.populateVisible()}U()},error:function(H,O,X){a.isFunction(c.p.loadError)&&c.p.loadError.call(c,H,O,X);U()},beforeSend:function(H){ea();a.isFunction(c.p.loadBeforeSend)&&c.p.loadBeforeSend.call(c,
37
+ H)}},a.jgrid.ajaxOptions,c.p.ajaxGridOptions));if(c.p.loadonce||c.p.treeGrid)c.p.datatype="local";break;case "xmlstring":ea();t=a.jgrid.stringToDoc(c.p.datastr);I&&c.p.loadComplete.call(c,t);N(t,c.grid.bDiv);c.p.datatype="local";c.p.datastr=null;U();break;case "jsonstring":ea();t=typeof c.p.datastr=="string"?a.jgrid.parse(c.p.datastr):c.p.datastr;I&&c.p.loadComplete.call(c,t);Y(t,c.grid.bDiv);c.p.datatype="local";c.p.datastr=null;U();break;case "local":case "clientside":ea();c.p.datatype="local";
38
+ I&&c.p.loadComplete.call(c,"");ga();da(true,true);U();break}}}},ea=function(){c.grid.hDiv.loading=true;if(!c.p.hiddengrid)switch(c.p.loadui){case "disable":break;case "enable":a("#load_"+c.p.id).show();break;case "block":a("#lui_"+c.p.id).show();a("#load_"+c.p.id).show();break}},U=function(){c.grid.hDiv.loading=false;switch(c.p.loadui){case "disable":break;case "enable":a("#load_"+c.p.id).hide();break;case "block":a("#lui_"+c.p.id).hide();a("#load_"+c.p.id).hide();break}},ga=function(){var p=/[\$,%]/g,
39
+ s=[],t=0,A,D,M,I=c.p.sortorder=="asc"?1:-1;a.each(c.p.colModel,function(J){if(this.index==c.p.sortname||this.name==c.p.sortname){t=c.p.lastsort=J;A=this.sorttype;return false}});M=A=="float"||A=="number"||A=="currency"?function(J){J=parseFloat(J.replace(p,""));return isNaN(J)?0:J}:A=="int"||A=="integer"?function(J){return q(J.replace(p,""),0)}:A=="date"||A=="datetime"?function(J){return sa(c.p.colModel[t].datefmt||"Y-m-d",J).getTime()}:function(J){return a.trim(J.toUpperCase())};a.each(c.rows,function(J,
40
+ H){try{D=a.unformat(a(H).children("td").eq(t),{rowId:H.id,colModel:c.p.colModel[t]},t,true)}catch(O){D=a(H).children("td").eq(t).text()}H.sortKey=M(D);s[J]=this});if(c.p.treeGrid)a(c).jqGrid("SortTree",I);else{s.sort(function(J,H){if(J.sortKey<H.sortKey)return-I;if(J.sortKey>H.sortKey)return I;return 0});if(s[0]){a("td",s[0]).each(function(J){a(this).css("width",g.headers[J].width+"px")});c.grid.cols=s[0].cells}var P="";if(c.p.altRows)P=c.p.altclass;a.each(s,function(J,H){if(P)J%2==1?a(H).addClass(P):
41
+ a(H).removeClass(P);a("tbody",c.grid.bDiv).append(H);H.sortKey=null})}c.grid.bDiv.scrollTop=0},sa=function(p,s){var t={m:1,d:1,y:1970,h:0,i:0,s:0},A,D,M;s=s.split(/[\\\/:_;.\t\T\s-]/);p=p.split(/[\\\/:_;.\t\T\s-]/);var I=a.jgrid.formatter.date.monthNames;A=0;for(D=p.length;A<D;A++){if(p[A]=="M"){M=a.inArray(s[A],I);if(M!==-1&&M<12)s[A]=M+1}if(p[A]=="F"){M=a.inArray(s[A],I);if(M!==-1&&M>11)s[A]=M+1-12}t[p[A].toLowerCase()]=parseInt(s[A],10)}t.m=parseInt(t.m,10)-1;p=t.y;if(p>=70&&p<=99)t.y=1900+t.y;
42
+ else if(p>=0&&p<=69)t.y=2E3+t.y;return new Date(t.y,t.m,t.d,t.h,t.i,t.s,0)};k=function(p,s){var t="",A="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",D="",M,I,P,J,H=function(O){c.p.selrow=null;if(c.p.multiselect){c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}c.p.savedRow=[];if(a.isFunction(c.p.onPaging))if(c.p.onPaging.call(c,O)=="stop")return false;return true};p=p.substr(1);M="pg_"+p;I=p+"_left";
43
+ P=p+"_center";J=p+"_right";a("#"+p).append("<div id='"+M+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;' role='row'><tbody><tr><td id='"+I+"' align='left'></td><td id='"+P+"' align='center' style='white-space:pre;'></td><td id='"+J+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(c.p.rowList.length>0){D="<td dir='"+j+"'>";D+="<select class='ui-pg-selbox' role='listbox'>";for(I=
44
+ 0;I<c.p.rowList.length;I++)D+="<option role='option' value='"+c.p.rowList[I]+"'"+(c.p.rowNum==c.p.rowList[I]?" selected":"")+">"+c.p.rowList[I]+"</option>";D+="</select></td>"}if(j=="rtl")A+=D;if(c.p.pginput===true)t="<td dir='"+j+"'>"+a.jgrid.format(c.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1'></span>")+"</td>";if(c.p.pgbuttons===true){I=["first"+s,"prev"+s,"next"+s,"last"+s];j=="rtl"&&I.reverse();A+="<td id='"+I[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";
45
+ A+="<td id='"+I[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";A+=t!=""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+t+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":"";A+="<td id='"+I[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";A+="<td id='"+I[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else if(t!=
46
+ "")A+=t;if(j=="ltr")A+=D;A+="</tr></tbody></table>";c.p.viewrecords===true&&a("td#"+p+"_"+c.p.recordpos,"#"+M).append("<div dir='"+j+"' style='text-align:"+c.p.recordpos+"' class='ui-paging-info'></div>");a("td#"+p+"_"+c.p.pagerpos,"#"+M).append(A);D=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+D+";visibility:hidden;' ></div>");A=a(A).clone().appendTo("#testpg").width();a("#testpg").remove();if(A>0){if(t!=
47
+ "")A+=50;a("td#"+p+"_"+c.p.pagerpos,"#"+M).width(A)}c.p._nvtd=[];c.p._nvtd[0]=A?Math.floor((c.p.width-A)/2):Math.floor(c.p.width/3);c.p._nvtd[1]=0;A=null;a(".ui-pg-selbox","#"+M).bind("change",function(){c.p.page=Math.round(c.p.rowNum*(c.p.page-1)/this.value-0.5)+1;c.p.rowNum=this.value;if(s)a(".ui-pg-selbox",c.p.pager).val(this.value);else c.p.toppager&&a(".ui-pg-selbox",c.p.toppager).val(this.value);if(!H("records"))return false;Q();return false});if(c.p.pgbuttons===true){a(".ui-pg-button","#"+
48
+ M).hover(function(){if(a(this).hasClass("ui-state-disabled"))this.style.cursor="default";else{a(this).addClass("ui-state-hover");this.style.cursor="pointer"}},function(){if(!a(this).hasClass("ui-state-disabled")){a(this).removeClass("ui-state-hover");this.style.cursor="default"}});a("#first"+s+", #prev"+s+", #next"+s+", #last"+s,"#"+p).click(function(){var O=q(c.p.page,1),X=q(c.p.lastpage,1),ca=false,ha=true,pa=true,na=true,ra=true;if(X===0||X===1)ra=na=pa=ha=false;else if(X>1&&O>=1)if(O===1)pa=ha=
49
+ false;else{if(!(O>1&&O<X))if(O===X)ra=na=false}else if(X>1&&O===0){ra=na=false;O=X-1}if(this.id==="first"+s&&ha){c.p.page=1;ca=true}if(this.id==="prev"+s&&pa){c.p.page=O-1;ca=true}if(this.id==="next"+s&&na){c.p.page=O+1;ca=true}if(this.id==="last"+s&&ra){c.p.page=X;ca=true}if(ca){if(!H(this.id))return false;Q()}return false})}c.p.pginput===true&&a("input.ui-pg-input","#"+M).keypress(function(O){if((O.charCode?O.charCode:O.keyCode?O.keyCode:0)==13){c.p.page=a(this).val()>0?a(this).val():c.p.page;if(!H("user"))return false;
50
+ Q();return false}return this})};var za=function(p,s,t,A){if(c.p.colModel[s].sortable)if(!(c.p.savedRow.length>0)){if(!t){if(c.p.lastsort==s)if(c.p.sortorder=="asc")c.p.sortorder="desc";else{if(c.p.sortorder=="desc")c.p.sortorder="asc"}else c.p.sortorder="asc";c.p.page=1}if(A)if(c.p.lastsort==s&&c.p.sortorder==A)return;else c.p.sortorder=A;t=a("thead:first",c.grid.hDiv).get(0);a("tr th:eq("+c.p.lastsort+") span.ui-grid-ico-sort",t).addClass("ui-state-disabled");a("tr th:eq("+c.p.lastsort+")",t).attr("aria-selected",
51
+ "false");a("tr th:eq("+s+") span.ui-icon-"+c.p.sortorder,t).removeClass("ui-state-disabled");a("tr th:eq("+s+")",t).attr("aria-selected","true");if(!c.p.viewsortcols[0])if(c.p.lastsort!=s){a("tr th:eq("+c.p.lastsort+") span.s-ico",t).hide();a("tr th:eq("+s+") span.s-ico",t).show()}c.p.lastsort=s;p=p.substring(5);c.p.sortname=c.p.colModel[s].index||p;t=c.p.sortorder;if(a.isFunction(c.p.onSortCol))if(c.p.onSortCol.call(c,p,s,t)=="stop")return;if(c.p.datatype=="local")c.p.deselectAfterSort&&a(c).jqGrid("resetSelection");
52
+ else{c.p.selrow=null;c.p.multiselect&&a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false);c.p.selarrrow=[];c.p.savedRow=[];c.p.scroll&&F(c.grid.bDiv,true)}c.p.subGrid&&c.p.datatype=="local"&&a("td.sgexpanded","#"+c.p.id).each(function(){a(this).trigger("click")});Q();if(c.p.sortname!=p&&s)c.p.lastsort=s}},Ca=function(p){var s=p,t;for(t=p+1;t<c.p.colModel.length;t++)if(c.p.colModel[t].hidden!==true){s=t;break}return s-p},va=function(p){var s,t={},A=m?0:c.p.cellLayout;for(s=t[0]=t[1]=t[2]=
53
+ 0;s<=p;s++)if(c.p.colModel[s].hidden===false)t[0]+=c.p.colModel[s].width+A;if(c.p.direction=="rtl")t[0]=c.p.width-t[0];t[0]-=c.grid.bDiv.scrollLeft;if(a(c.grid.cDiv).is(":visible"))t[1]+=a(c.grid.cDiv).height()+parseInt(a(c.grid.cDiv).css("padding-top"),10)+parseInt(a(c.grid.cDiv).css("padding-bottom"),10);if(c.p.toolbar[0]==true&&(c.p.toolbar[1]=="top"||c.p.toolbar[1]=="both"))t[1]+=a(c.grid.uDiv).height()+parseInt(a(c.grid.uDiv).css("border-top-width"),10)+parseInt(a(c.grid.uDiv).css("border-bottom-width"),
54
+ 10);if(c.p.toppager)t[1]+=a(c.grid.topDiv).height()+parseInt(a(c.grid.topDiv).css("border-bottom-width"),10);t[2]+=a(c.grid.bDiv).height()+a(c.grid.hDiv).height();return t};this.p.id=this.id;if(a.inArray(c.p.multikey,["shiftKey","altKey","ctrlKey"])==-1)c.p.multikey=false;c.p.keyIndex=false;for(h=0;h<c.p.colModel.length;h++)if(c.p.colModel[h].key===true){c.p.keyIndex=h;break}c.p.sortorder=c.p.sortorder.toLowerCase();if(this.p.treeGrid===true)try{a(this).jqGrid("setTreeGrid")}catch(Ga){}if(this.p.subGrid)try{a(c).jqGrid("setSubGrid")}catch(E){}if(this.p.multiselect){this.p.colNames.unshift("<input id='cb_"+
55
+ this.p.id+"' class='cbox' type='checkbox'/>");this.p.colModel.unshift({name:"cb",width:m?c.p.multiselectWidth+c.p.cellLayout:c.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}if(this.p.rownumbers){this.p.colNames.unshift("");this.p.colModel.unshift({name:"rn",width:c.p.rownumWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}c.p.xmlReader=a.extend(true,{root:"rows",row:"row",page:"rows>page",total:"rows>total",
56
+ records:"rows>records",repeatitems:true,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:true,cell:"cell"}},c.p.xmlReader);c.p.jsonReader=a.extend(true,{root:"rows",page:"page",total:"total",records:"records",repeatitems:true,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:true,cell:"cell"}},c.p.jsonReader);if(c.p.scroll){c.p.pgbuttons=false;c.p.pginput=false;c.p.rowList=[]}var G="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",V,
57
+ L,W,R,S,T,K,ba;L=ba="";if(c.p.shrinkToFit===true&&c.p.forceFit===true)for(h=c.p.colModel.length-1;h>=0;h--)if(!c.p.colModel[h].hidden){c.p.colModel[h].resizable=false;break}if(c.p.viewsortcols[1]=="horizontal"){ba=" ui-i-asc";L=" ui-i-desc"}V=o?"class='ui-th-div-ie'":"";ba="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+ba+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+j+"'></span>";ba+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+
58
+ L+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+j+"'></span></span>";for(h=0;h<this.p.colNames.length;h++){G+="<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+j+"'>";L=c.p.colModel[h].index||c.p.colModel[h].name;G+="<div id='jqgh_"+c.p.colModel[h].name+"' "+V+">"+c.p.colNames[h];if(L==c.p.sortname)c.p.lastsort=h;G+=ba+"</div></th>"}G+="</tr></thead>";a(this).append(G);a("thead tr:first th",this).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
59
+ if(this.p.multiselect){var Z=true,ka=[],aa;if(typeof c.p.onSelectAll!=="function")Z=false;a("#cb_"+a.jgrid.jqID(c.p.id),this).bind("click",function(){if(this.checked){a("[id^=jqg_]",c.rows).attr("checked",true);a(c.rows).each(function(p){if(!a(this).hasClass("subgrid")){a(this).addClass("ui-state-highlight").attr("aria-selected","true");c.p.selarrrow[p]=c.p.selrow=this.id}});aa=true;ka=[]}else{a("[id^=jqg_]",c.rows).attr("checked",false);a(c.rows).each(function(p){if(!a(this).hasClass("subgrid")){a(this).removeClass("ui-state-highlight").attr("aria-selected",
60
+ "false");ka[p]=this.id}});c.p.selarrrow=[];c.p.selrow=null;aa=false}if(Z)c.p.onSelectAll.call(c,aa?c.p.selarrrow:ka,aa)})}a.each(c.p.colModel,function(){if(!this.width)this.width=150;this.width=parseInt(this.width,10)});if(c.p.autowidth===true){G=a(n).innerWidth();c.p.width=G>0?G:"nw"}(function(){var p=0,s=c.p.cellLayout,t=0,A,D=c.p.scrollOffset,M,I=false,P,J=0,H=0,O=0,X;if(m)s=0;a.each(c.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){p+=q(this.width,
61
+ 0);if(this.fixed){J+=this.width;H+=this.width+s}else t++;O++}});if(isNaN(c.p.width))c.p.width=g.width=p;else g.width=c.p.width;c.p.tblwidth=p;if(c.p.shrinkToFit===false&&c.p.forceFit===true)c.p.forceFit=false;if(c.p.shrinkToFit===true&&t>0){P=g.width-s*t-H;if(!isNaN(c.p.height)){P-=D;I=true}p=0;a.each(c.p.colModel,function(ca){if(this.hidden===false&&!this.fixed){this.width=M=Math.floor(P/(c.p.tblwidth-J)*this.width);p+=M;A=ca}});X=0;if(I){if(g.width-H-(p+s*t)!==D)X=g.width-H-(p+s*t)-D}else if(!I&&
62
+ Math.abs(g.width-H-(p+s*t))!==1)X=g.width-H-(p+s*t);c.p.colModel[A].width+=X;c.p.tblwidth=p+X+J+O*s}})();a(n).css("width",g.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+c.p.id+"'>&#160;</div>");a(l).css("width",g.width+"px");G=a("thead:first",c).get(0);var wa="<table role='grid' style='width:"+c.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+j+"'>";l=a("tr:first",G);c.p.disableClick=
63
+ false;a("th",l).each(function(p){a("div",this);W=c.p.colModel[p].width;if(typeof c.p.colModel[p].resizable==="undefined")c.p.colModel[p].resizable=true;if(c.p.colModel[p].resizable){R=document.createElement("span");a(R).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+j);!a.browser.opera&&a(R).css("cursor","col-resize");a(this).addClass(c.p.resizeclass)}else R="";a(this).css("width",W+"px").prepend(R);c.p.colModel[p].hidden&&a(this).css("display","none");g.headers[p]={width:W,el:this};
64
+ S=c.p.colModel[p].sortable;if(typeof S!=="boolean")S=c.p.colModel[p].sortable=true;var s=c.p.colModel[p].name;s=="cb"||s=="subgrid"||s=="rn"||c.p.viewsortcols[2]&&a("div",this).addClass("ui-jqgrid-sortable");if(S)if(c.p.viewsortcols[0]){a("div span.s-ico",this).show();p==c.p.lastsort&&a("div span.ui-icon-"+c.p.sortorder,this).removeClass("ui-state-disabled")}else if(p==c.p.lastsort){a("div span.s-ico",this).show();a("div span.ui-icon-"+c.p.sortorder,this).removeClass("ui-state-disabled")}wa+="<td role='gridcell' "+
65
+ r(p,0)+">&#160;</td>"}).mousedown(function(p){if(a(p.target).closest("th>span.ui-jqgrid-resize").length==1){var s=a.jgrid.getCellIndex(this);if(c.p.forceFit===true)c.p.nv=Ca(s);g.dragStart(s,p,va(s));return false}}).click(function(p){if(c.p.disableClick)return c.p.disableClick=false;var s="th>div.ui-jqgrid-sortable",t,A;c.p.viewsortcols[2]||(s="th>div>span>span.ui-grid-ico-sort");p=a(p.target).closest(s);if(p.length==1){s=a.jgrid.getCellIndex(this);if(!c.p.viewsortcols[2]){t=true;A=p.attr("sort")}za(a("div",
66
+ this)[0].id,s,t,A);return false}});if(c.p.sortable&&a.fn.sortable)try{a(c).jqGrid("sortableColumns",l)}catch(ta){}wa+="</tr></tbody></table>";this.appendChild(document.createElement("tbody"));a(this).addClass("ui-jqgrid-btable");l=a("<table class='ui-jqgrid-htable' style='width:"+c.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(G);var la=c.p.caption&&c.p.hiddengrid===true?true:false;G=a("<div class='ui-jqgrid-hbox"+(j=="rtl"?
67
+ "-rtl":"")+"'></div>");g.hDiv=document.createElement("div");a(g.hDiv).css({width:g.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(G);a(G).append(l);la&&a(g.hDiv).hide();if(c.p.pager){if(typeof c.p.pager=="string"){if(c.p.pager.substr(0,1)!="#")c.p.pager="#"+c.p.pager}else c.p.pager="#"+a(c.p.pager).attr("id");a(c.p.pager).css({width:g.width+"px"}).appendTo(n).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom");la&&a(c.p.pager).hide();k(c.p.pager,"")}c.p.cellEdit===false&&
68
+ c.p.hoverrows===true&&a(c).bind("mouseover",function(p){K=a(p.target).closest("tr.jqgrow");a(K).attr("class")!=="subgrid"&&a(K).addClass("ui-state-hover");return false}).bind("mouseout",function(p){K=a(p.target).closest("tr.jqgrow");a(K).removeClass("ui-state-hover");return false});var ma,oa;a(c).before(g.hDiv).click(function(p){T=p.target;var s=a(T).hasClass("cbox");K=a(T,c.rows).closest("tr.jqgrow");if(a(K).length===0)return this;var t=true;if(a.isFunction(c.p.beforeSelectRow))t=c.p.beforeSelectRow.call(c,
69
+ K[0].id,p);if(T.tagName=="A"||(T.tagName=="INPUT"||T.tagName=="TEXTAREA"||T.tagName=="OPTION"||T.tagName=="SELECT")&&!s)return true;if(t===true){if(c.p.cellEdit===true)if(c.p.multiselect&&s)a(c).jqGrid("setSelection",K[0].id,true);else{ma=K[0].rowIndex;oa=a.jgrid.getCellIndex(T);try{a(c).jqGrid("editCell",ma,oa,true)}catch(A){}}else if(c.p.multikey)if(p[c.p.multikey])a(c).jqGrid("setSelection",K[0].id,true);else{if(c.p.multiselect&&s){s=a("[id^=jqg_]",K).attr("checked");a("[id^=jqg_]",K).attr("checked",
70
+ !s)}}else{if(c.p.multiselect&&c.p.multiboxonly)if(!s){a(c.p.selarrrow).each(function(D,M){D=c.rows.namedItem(M);a(D).removeClass("ui-state-highlight");a("#jqg_"+a.jgrid.jqID(M),D).attr("checked",false)});c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}a(c).jqGrid("setSelection",K[0].id,true)}if(a.isFunction(c.p.onCellSelect)){ma=K[0].id;oa=a.jgrid.getCellIndex(T);c.p.onCellSelect.call(c,ma,oa,a(T).html(),p)}}p.stopPropagation()}).bind("reloadGrid",function(p,s){if(c.p.treeGrid===
71
+ true)c.p.datatype=c.p.treedatatype;s&&s.current&&c.grid.selectionPreserver(c);if(c.p.datatype=="local")a(c).jqGrid("resetSelection");else if(!c.p.treeGrid){c.p.selrow=null;if(c.p.multiselect){c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}c.p.savedRow=[];c.p.scroll&&F(c.grid.bDiv)}if(s&&s.page){p=s.page;if(p>c.p.lastpage)p=c.p.lastpage;if(p<1)p=1;c.p.page=p;c.grid.bDiv.scrollTop=c.grid.prevRowHeight?(p-1)*c.grid.prevRowHeight*c.p.rowNum:0}if(c.grid.prevRowHeight&&
72
+ c.p.scroll){delete c.p.lastpage;c.grid.populateVisible()}else c.grid.populate();return false});a.isFunction(this.p.ondblClickRow)&&a(this).dblclick(function(p){T=p.target;K=a(T,c.rows).closest("tr.jqgrow");if(a(K).length===0)return false;ma=K[0].rowIndex;oa=a.jgrid.getCellIndex(T);c.p.ondblClickRow.call(c,a(K).attr("id"),ma,oa,p);return false});a.isFunction(this.p.onRightClickRow)&&a(this).bind("contextmenu",function(p){T=p.target;K=a(T,c.rows).closest("tr.jqgrow");if(a(K).length===0)return false;
73
+ c.p.multiselect||a(c).jqGrid("setSelection",K[0].id,true);ma=K[0].rowIndex;oa=a.jgrid.getCellIndex(T);c.p.onRightClickRow.call(c,a(K).attr("id"),ma,oa,p);return false});g.bDiv=document.createElement("div");a(g.bDiv).append(a('<div style="position:relative;'+(o&&a.browser.version<8?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:c.p.height+(isNaN(c.p.height)?"":"px"),width:g.width+"px"}).scroll(g.scrollGrid);a("table:first",g.bDiv).css({width:c.p.tblwidth+
74
+ "px"});if(o){a("tbody",this).size()==2&&a("tbody:first",this).remove();c.p.multikey&&a(g.bDiv).bind("selectstart",function(){return false})}else c.p.multikey&&a(g.bDiv).bind("mousedown",function(){return false});la&&a(g.bDiv).hide();g.cDiv=document.createElement("div");var Ia=c.p.hidegrid===true?a("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){Ia.addClass("ui-state-hover")},function(){Ia.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css(j==
75
+ "rtl"?"left":"right","0px"):"";a(g.cDiv).append(Ia).append("<span class='ui-jqgrid-title"+(j=="rtl"?"-rtl":"")+"'>"+c.p.caption+"</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");a(g.cDiv).insertBefore(g.hDiv);if(c.p.toolbar[0]){g.uDiv=document.createElement("div");if(c.p.toolbar[1]=="top")a(g.uDiv).insertBefore(g.hDiv);else c.p.toolbar[1]=="bottom"&&a(g.uDiv).insertAfter(g.hDiv);if(c.p.toolbar[1]=="both"){g.ubDiv=document.createElement("div");a(g.uDiv).insertBefore(g.hDiv).addClass("ui-userdata ui-state-default").attr("id",
76
+ "t_"+this.id);a(g.ubDiv).insertAfter(g.hDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id);la&&a(g.ubDiv).hide()}else a(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);la&&a(g.uDiv).hide()}if(c.p.toppager){c.p.toppager=c.p.id+"_toppager";g.topDiv=a("<div id='"+c.p.toppager+"'></div>")[0];c.p.toppager="#"+c.p.toppager;a(g.topDiv).insertBefore(g.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width);k(c.p.toppager,"_t")}if(c.p.footerrow){g.sDiv=
77
+ a("<div class='ui-jqgrid-sdiv'></div>")[0];G=a("<div class='ui-jqgrid-hbox"+(j=="rtl"?"-rtl":"")+"'></div>");a(g.sDiv).append(G).insertAfter(g.hDiv).width(g.width);a(G).append(wa);g.footers=a(".ui-jqgrid-ftable",g.sDiv)[0].rows[0].cells;if(c.p.rownumbers)g.footers[0].className="ui-state-default jqgrid-rownum";la&&a(g.sDiv).hide()}if(c.p.caption){var xa=c.p.datatype;if(c.p.hidegrid===true){a(".ui-jqgrid-titlebar-close",g.cDiv).click(function(p){var s=a.isFunction(c.p.onHeaderClick);if(c.p.gridstate==
78
+ "visible"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+c.p.id).slideUp("fast");c.p.pager&&a(c.p.pager).slideUp("fast");c.p.toppager&&a(c.p.toppager).slideUp("fast");if(c.p.toolbar[0]===true){c.p.toolbar[1]=="both"&&a(g.ubDiv).slideUp("fast");a(g.uDiv).slideUp("fast")}c.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+c.p.id).slideUp("fast");a("span",this).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");c.p.gridstate="hidden";if(s)la||c.p.onHeaderClick.call(c,c.p.gridstate,
79
+ p)}else if(c.p.gridstate=="hidden"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+c.p.id).slideDown("fast");c.p.pager&&a(c.p.pager).slideDown("fast");c.p.toppager&&a(c.p.toppager).slideDown("fast");if(c.p.toolbar[0]===true){c.p.toolbar[1]=="both"&&a(g.ubDiv).slideDown("fast");a(g.uDiv).slideDown("fast")}c.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+c.p.id).slideDown("fast");a("span",this).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(la){c.p.datatype=xa;Q();la=false}c.p.gridstate=
80
+ "visible";s&&c.p.onHeaderClick.call(c,c.p.gridstate,p)}return false});if(la){c.p.datatype="local";a(".ui-jqgrid-titlebar-close",g.cDiv).trigger("click")}}}else a(g.cDiv).hide();a(g.hDiv).after(g.bDiv).mousemove(function(p){if(g.resizing){g.dragMove(p);return false}});a(".ui-jqgrid-labels",g.hDiv).bind("selectstart",function(){return false});a(document).mouseup(function(){if(g.resizing){g.dragEnd();return false}return true});this.updateColumns=function(){var p=this.rows[0],s=this;if(p){a("td",p).each(function(t){a(this).css("width",
81
+ s.grid.headers[t].width+"px")});this.grid.cols=p.cells}return this};c.formatCol=r;c.sortData=za;c.updatepager=da;c.formatter=function(p,s,t,A,D){return v(p,s,t,A,D)};a.extend(g,{populate:Q,emptyRows:F});this.grid=g;c.addXmlData=function(p){N(p,c.grid.bDiv)};c.addJSONData=function(p){Y(p,c.grid.bDiv)};Q();c.p.hiddengrid=false;a(window).unload(function(){a(this).empty();this.p=this.grid=null})}}})};a.jgrid.extend({getGridParam:function(d){var e=this[0];if(e.grid)return d?typeof e.p[d]!="undefined"?
82
+ e.p[d]:null:e.p},setGridParam:function(d){return this.each(function(){this.grid&&typeof d==="object"&&a.extend(true,this.p,d)})},getDataIDs:function(){var d=[],e=0,b;this.each(function(){if((b=this.rows.length)&&b>0)for(;e<b;){d[e]=this.rows[e].id;e++}});return d},setSelection:function(d,e){return this.each(function(){function b(c,l){var k=a(f.grid.bDiv)[0].clientHeight,o=a(f.grid.bDiv)[0].scrollTop,m=f.rows[c].offsetTop+f.rows[c].clientHeight;c=f.rows[c].offsetTop;if(l=="d")if(m>=k)a(f.grid.bDiv)[0].scrollTop=
83
+ o+m-c;if(l=="u")if(c<o)a(f.grid.bDiv)[0].scrollTop=o-m+c}var f=this,g,h,j;if(d!==undefined){e=e===false?false:true;h=f.rows.namedItem(d+"");if(h!==null){if(f.p.selrow&&f.p.scrollrows===true){g=f.rows.namedItem(f.p.selrow).rowIndex;j=f.rows.namedItem(d).rowIndex;if(j>=0)j>g?b(j,"d"):b(j,"u")}if(f.p.multiselect){f.p.selrow=h.id;j=a.inArray(f.p.selrow,f.p.selarrrow);if(j===-1){h.className!=="ui-subgrid"&&a(h).addClass("ui-state-highlight").attr("aria-selected","true");g=true;a("#jqg_"+a.jgrid.jqID(f.p.selrow),
84
+ f.rows[h.rowIndex]).attr("checked",g);f.p.selarrrow.push(f.p.selrow);f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,f.p.selrow,g)}else{h.className!=="ui-subgrid"&&a(h).removeClass("ui-state-highlight").attr("aria-selected","false");g=false;a("#jqg_"+a.jgrid.jqID(f.p.selrow),f.rows[h.rowIndex]).attr("checked",g);f.p.selarrrow.splice(j,1);f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,f.p.selrow,g);h=f.p.selarrrow[0];f.p.selrow=h===undefined?null:h}}else if(h.className!=="ui-subgrid"){f.p.selrow&&a("tr#"+a.jgrid.jqID(f.p.selrow),
85
+ f.grid.bDiv).removeClass("ui-state-highlight").attr("aria-selected","false");f.p.selrow=h.id;a(h).addClass("ui-state-highlight").attr("aria-selected","true");f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,f.p.selrow,true)}}}})},resetSelection:function(){return this.each(function(){var d=this,e;if(d.p.multiselect){a(d.p.selarrrow).each(function(b,f){e=d.rows.namedItem(f);a(e).removeClass("ui-state-highlight").attr("aria-selected","false");a("#jqg_"+a.jgrid.jqID(f),e).attr("checked",false)});a("#cb_"+a.jgrid.jqID(d.p.id),
86
+ d.grid.hDiv).attr("checked",false);d.p.selarrrow=[]}else if(d.p.selrow){a("tr#"+a.jgrid.jqID(d.p.selrow),d.grid.bDiv).removeClass("ui-state-highlight").attr("aria-selected","false");d.p.selrow=null}d.p.savedRow=[]})},getRowData:function(d){var e={},b,f=false,g,h=0;this.each(function(){var j=this,c,l;if(typeof d=="undefined"){f=true;b=[];g=j.rows.length}else{l=j.rows.namedItem(d);if(!l)return e;g=1}for(;h<g;){if(f)l=j.rows[h];a("td",l).each(function(k){c=j.p.colModel[k].name;if(c!=="cb"&&c!=="subgrid")if(j.p.treeGrid===
87
+ true&&c==j.p.ExpandColumn)e[c]=a.jgrid.htmlDecode(a("span:first",this).html());else try{e[c]=a.unformat(this,{rowId:l.id,colModel:j.p.colModel[k]},k)}catch(o){e[c]=a.jgrid.htmlDecode(a(this).html())}});h++;if(f){b.push(e);e={}}}});return b?b:e},delRowData:function(d){var e=false,b,f,g;this.each(function(){var h=this;if(b=h.rows.namedItem(d)){g=b.rowIndex;a(b).remove();h.p.records--;h.p.reccount--;h.updatepager(true,false);e=true;if(h.p.multiselect){f=a.inArray(d,h.p.selarrrow);f!=-1&&h.p.selarrrow.splice(f,
88
+ 1)}if(d==h.p.selrow)h.p.selrow=null}else return false;g==0&&e&&h.updateColumns();if(h.p.altRows===true&&e){var j=h.p.altclass;a(h.rows).each(function(c){c%2==1?a(this).addClass(j):a(this).removeClass(j)})}});return e},setRowData:function(d,e,b){var f,g=false;this.each(function(){var h=this,j,c,l=typeof b;if(!h.grid)return false;c=h.rows.namedItem(d);if(!c)return false;e&&a(this.p.colModel).each(function(k){f=this.name;if(e[f]!=undefined){j=h.formatter(d,e[f],k,e,"edit");h.p.treeGrid===true&&f==h.p.ExpandColumn?
89
+ a("td:eq("+k+") > span:first",c).html(j).attr("title",a.jgrid.stripHtml(j)):a("td:eq("+k+")",c).html(j).attr("title",a.jgrid.stripHtml(j));g=true}});if(l==="string")a(c).addClass(b);else l==="object"&&a(c).css(b)});return g},addRowData:function(d,e,b,f){b||(b="last");var g=false,h,j,c,l,k,o,m,n,q="",r,u,v;if(e){if(a.isArray(e)){r=true;b="last";u=d}else{e=[e];r=false}this.each(function(){var w=this,z=e.length;k=w.p.rownumbers===true?1:0;c=w.p.multiselect===true?1:0;l=w.p.subGrid===true?1:0;if(!r)if(typeof d!=
90
+ "undefined")d+="";else{d=w.p.records+1+"";if(w.p.keyIndex!==false){cmn=w.p.colModel[w.p.keyIndex+c+l+k].name;if(typeof e[0][cmn]!="undefined")d=e[0][cmn]}}v=w.p.altclass;for(var B=0,C=a.isFunction(w.p.afterInsertRow)?true:false;B<z;){data=e[B];j="";if(r){try{d=data[u]}catch(y){d=w.p.records+1}var F=w.p.altRows===true?(w.rows.length-1)%2==0?v:"":""}if(k){q=w.formatCol(k,1);j+='<td role="gridcell" class="ui-state-default jqgrid-rownum" '+q+">0</td>"}if(c){n='<input type="checkbox" id="jqg_'+d+'" class="cbox"/>';
91
+ q=w.formatCol(k,1);j+='<td role="gridcell" '+q+">"+n+"</td>"}if(l)j+=a(w).jqGrid("addSubGridCell",c+k,1);for(m=c+l+k;m<this.p.colModel.length;m++){h=this.p.colModel[m].name;n=w.formatter(d,data[h],m,data,"add");q=w.formatCol(m,1);j+='<td role="gridcell" '+q+' title="'+a.jgrid.stripHtml(n)+'">'+n+"</td>"}j='<tr id="'+d+'" role="row" class="ui-widget-content jqgrow ui-row-'+w.p.direction+" "+F+'">'+j+"</tr>";if(w.p.subGrid===true){j=a(j)[0];a(w).jqGrid("addSubGrid",j,c+k)}if(w.rows.length===0)a("table:first",
92
+ w.grid.bDiv).append(j);else switch(b){case "last":a(w.rows[w.rows.length-1]).after(j);break;case "first":a(w.rows[0]).before(j);break;case "after":if(o=w.rows.namedItem(f))a(w.rows[o.rowIndex+1]).hasClass("ui-subgrid")?a(w.rows[o.rowIndex+1]).after(j):a(o).after(j);break;case "before":if(o=w.rows.namedItem(f)){a(o).before(j);o=o.rowIndex}break}w.p.records++;w.p.reccount++;if(!w.grid.cols||!w.grid.cols.length)w.grid.cols=w.rows[0].cells;if(b==="first"||b==="before"&&o<=1||w.rows.length===1)w.updateColumns();
93
+ C&&w.p.afterInsertRow(w,d,data);B++}if(w.p.altRows===true&&!r)if(b=="last")(w.rows.length-1)%2==1&&a(w.rows[w.rows.length-1]).addClass(v);else a(w.rows).each(function(x){x%2==1?a(this).addClass(v):a(this).removeClass(v)});w.updatepager(true,true);g=true})}return g},footerData:function(d,e,b){function f(c){for(var l in c)return false;return true}var g,h=false,j={};if(typeof d=="undefined")d="get";if(typeof b!="boolean")b=true;d=d.toLowerCase();this.each(function(){var c=this,l;if(!c.grid||!c.p.footerrow)return false;
94
+ if(d=="set")if(f(e))return false;h=true;a(this.p.colModel).each(function(k){g=this.name;if(d=="set"){if(e[g]!=undefined){l=b?c.formatter("",e[g],k,e,"edit"):e[g];a("tr.footrow td:eq("+k+")",c.grid.sDiv).html(l).attr("title",a.jgrid.stripHtml(l));h=true}}else if(d=="get")j[g]=a("tr.footrow td:eq("+k+")",c.grid.sDiv).html()})});return d=="get"?j:h},ShowHideCol:function(d,e){return this.each(function(){var b=this,f=false;if(b.grid){if(typeof d==="string")d=[d];e=e!="none"?"":"none";var g=e==""?true:
95
+ false;a(this.p.colModel).each(function(h){if(a.inArray(this.name,d)!==-1&&this.hidden===g){a("tr",b.grid.hDiv).each(function(){a("th:eq("+h+")",this).css("display",e)});a(b.rows).each(function(j){a("td:eq("+h+")",b.rows[j]).css("display",e)});b.p.footerrow&&a("td:eq("+h+")",b.grid.sDiv).css("display",e);if(e=="none")b.p.tblwidth-=this.width;else b.p.tblwidth+=this.width;this.hidden=!g;f=true}});if(f===true){a("table:first",b.grid.hDiv).width(b.p.tblwidth);a("table:first",b.grid.bDiv).width(b.p.tblwidth);
96
+ b.grid.hDiv.scrollLeft=b.grid.bDiv.scrollLeft;if(b.p.footerrow){a("table:first",b.grid.sDiv).width(b.p.tblwidth);b.grid.sDiv.scrollLeft=b.grid.bDiv.scrollLeft}}}})},hideCol:function(d){return this.each(function(){a(this).jqGrid("ShowHideCol",d,"none")})},showCol:function(d){return this.each(function(){a(this).jqGrid("ShowHideCol",d,"")})},remapColumns:function(d,e,b){function f(j){var c;c=j.length?a.makeArray(j):a.extend({},j);a.each(d,function(l){j[l]=c[this]})}function g(j,c){a(">tr"+(c||""),j).each(function(){var l=
97
+ this,k=a.makeArray(l.cells);a.each(d,function(){var o=k[this];o&&l.appendChild(o)})})}var h=this.get(0);f(h.p.colModel);f(h.p.colNames);f(h.grid.headers);g(a("thead:first",h.grid.hDiv),b&&":not(.ui-jqgrid-labels)");e&&g(a("tbody:first",h.grid.bDiv),".jqgrow");h.p.footerrow&&g(a("tbody:first",h.grid.sDiv));if(h.p.remapColumns)if(h.p.remapColumns.length)f(h.p.remapColumns);else h.p.remapColumns=a.makeArray(d);h.p.lastsort=a.inArray(h.p.lastsort,d);if(h.p.treeGrid)h.p.expColInd=a.inArray(h.p.expColInd,
98
+ d)},setGridWidth:function(d,e){return this.each(function(){var b=this,f,g=0,h=b.p.cellLayout,j,c=0,l=false,k=b.p.scrollOffset,o,m=0,n=0,q=0,r;if(b.grid){if(typeof e!="boolean")e=b.p.shrinkToFit;if(!isNaN(d)){d=parseInt(d,10);b.grid.width=b.p.width=d;a("#gbox_"+b.p.id).css("width",d+"px");a("#gview_"+b.p.id).css("width",d+"px");a(b.grid.bDiv).css("width",d+"px");a(b.grid.hDiv).css("width",d+"px");b.p.pager&&a(b.p.pager).css("width",d+"px");if(b.p.toolbar[0]===true){a(b.grid.uDiv).css("width",d+"px");
99
+ b.p.toolbar[1]=="both"&&a(b.grid.ubDiv).css("width",d+"px")}b.p.footerrow&&a(b.grid.sDiv).css("width",d+"px");if(e===false&&b.p.forceFit==true)b.p.forceFit=false;if(e===true){if(a.browser.safari)h=0;a.each(b.p.colModel,function(){if(this.hidden===false){g+=parseInt(this.width,10);if(this.fixed){n+=this.width;m+=this.width+h}else c++;q++}});if(c!=0){b.p.tblwidth=g;o=d-h*c-m;if(!isNaN(b.p.height))if(a(b.grid.bDiv)[0].clientHeight<a(b.grid.bDiv)[0].scrollHeight){l=true;o-=k}g=0;var u=b.grid.cols.length>
100
+ 0;a.each(b.p.colModel,function(v){if(this.hidden===false&&!this.fixed){this.width=f=Math.floor(o/(b.p.tblwidth-n)*this.width);g+=f;b.grid.headers[v].width=f;b.grid.headers[v].el.style.width=f+"px";if(b.p.footerrow)b.grid.footers[v].style.width=f+"px";if(u)b.grid.cols[v].style.width=f+"px";j=v}});r=0;if(l){if(d-m-(g+h*c)!==k)r=d-m-(g+h*c)-k}else if(Math.abs(d-m-(g+h*c))!==1)r=d-m-(g+h*c);b.p.colModel[j].width+=r;f=b.p.colModel[j].width;b.grid.headers[j].width=f;b.grid.headers[j].el.style.width=f+"px";
101
+ if(u)b.grid.cols[j].style.width=f+"px";b.p.tblwidth=g+r+n+h*q;a("table:first",b.grid.bDiv).css("width",b.p.tblwidth+"px");a("table:first",b.grid.hDiv).css("width",b.p.tblwidth+"px");b.grid.hDiv.scrollLeft=b.grid.bDiv.scrollLeft;if(b.p.footerrow){b.grid.footers[j].style.width=f+"px";a("table:first",b.grid.sDiv).css("width",b.p.tblwidth+"px")}}}}}})},setGridHeight:function(d){return this.each(function(){var e=this;if(e.grid){a(e.grid.bDiv).css({height:d+(isNaN(d)?"":"px")});e.p.height=d;e.p.scroll&&
102
+ e.grid.populateVisible()}})},setCaption:function(d){return this.each(function(){this.p.caption=d;a("span.ui-jqgrid-title",this.grid.cDiv).html(d);a(this.grid.cDiv).show()})},setLabel:function(d,e,b,f){return this.each(function(){var g=this,h=-1;if(g.grid){if(isNaN(d))a(g.p.colModel).each(function(l){if(this.name==d){h=l;return false}});else h=parseInt(d,10);if(h>=0){var j=a("tr.ui-jqgrid-labels th:eq("+h+")",g.grid.hDiv);if(e){var c=a(".s-ico",j);a("[id^=jqgh_]",j).empty().html(e).append(c);g.p.colNames[h]=
103
+ e}if(b)typeof b==="string"?a(j).addClass(b):a(j).css(b);typeof f==="object"&&a(j).attr(f)}}})},setCell:function(d,e,b,f,g){return this.each(function(){var h=this,j=-1,c;if(h.grid){if(isNaN(e))a(h.p.colModel).each(function(k){if(this.name==e){j=k;return false}});else j=parseInt(e,10);if(j>=0)if(c=h.rows.namedItem(d)){var l=a("td:eq("+j+")",c);if(b!==""){c=h.formatter(d,b,j,c,"edit");h.p.treeGrid&&a(".tree-wrap",a(l)).length>0?a("span",a(l)).html(c).attr("title",a.jgrid.stripHtml(c)):a(l).html(c).attr("title",
104
+ a.jgrid.stripHtml(c))}if(typeof f==="string")f?a(l).addClass(f):a(l).removeClass();else f&&a(l).css(f);typeof g==="object"&&a(l).attr(g)}}})},getCell:function(d,e){var b=false;this.each(function(){var f=this,g=-1;if(f.grid){if(isNaN(e))a(f.p.colModel).each(function(c){if(this.name===e){g=c;return false}});else g=parseInt(e,10);if(g>=0){var h=f.rows.namedItem(d);if(h)try{b=a.unformat(a("td:eq("+g+")",h),{rowId:h.id,colModel:f.p.colModel[g]},g)}catch(j){b=a.jgrid.htmlDecode(a("td:eq("+g+")",h).html())}}}});
105
+ return b},getCol:function(d,e,b){var f=[],g,h=0;e=typeof e!="boolean"?false:e;if(typeof b=="undefined")b=false;this.each(function(){var j=this,c=-1;if(j.grid){if(isNaN(d))a(j.p.colModel).each(function(m){if(this.name===d){c=m;return false}});else c=parseInt(d,10);if(c>=0){var l=j.rows.length,k=0;if(l&&l>0){for(;k<l;){try{g=a.unformat(a(j.rows[k].cells[c]),{rowId:j.rows[k].id,colModel:j.p.colModel[c]},c)}catch(o){g=a.jgrid.htmlDecode(j.rows[k].cells[c].innerHTML)}b?(h+=parseFloat(g)):e?f.push({id:j.rows[k].id,
106
+ value:g}):(f[k]=g);k++}if(b)switch(b.toLowerCase()){case "sum":f=h;break;case "avg":f=h/l;break;case "count":f=l;break}}}}});return f},clearGridData:function(d){return this.each(function(){var e=this;if(e.grid){if(typeof d!="boolean")d=false;a("tbody:first tr",e.grid.bDiv).remove();e.p.footerrow&&d&&a(".ui-jqgrid-ftable td",e.grid.sDiv).html("&#160;");e.p.selrow=null;e.p.selarrrow=[];e.p.savedRow=[];e.p.records=0;e.p.page="0";e.p.lastpage="0";e.p.reccount=0;e.updatepager(true,false)}})},getInd:function(d,
107
+ e){var b=false,f;this.each(function(){if(f=this.rows.namedItem(d))b=e===true?f:f.rowIndex});return b}})})(jQuery);
108
+ (function(a){a.jgrid.extend({editCell:function(d,e,b){return this.each(function(){var f=this,g,h,j;if(!(!f.grid||f.p.cellEdit!==true)){e=parseInt(e,10);f.p.selrow=f.rows[d].id;f.p.knv||a(f).jqGrid("GridNav");if(f.p.savedRow.length>0){if(b===true)if(d==f.p.iRow&&e==f.p.iCol)return;a(f).jqGrid("saveCell",f.p.savedRow[0].id,f.p.savedRow[0].ic)}else window.setTimeout(function(){a("#"+f.p.knv).attr("tabindex","-1").focus()},0);g=f.p.colModel[e].name;if(!(g=="subgrid"||g=="cb"||g=="rn")){j=a("td:eq("+e+
109
+ ")",f.rows[d]);if(f.p.colModel[e].editable===true&&b===true&&!j.hasClass("not-editable-cell")){if(parseInt(f.p.iCol)>=0&&parseInt(f.p.iRow)>=0){a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight");a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover")}a(j).addClass("edit-cell ui-state-highlight");a(f.rows[d]).addClass("selected-row ui-state-hover");try{h=a.unformat(j,{rowId:f.rows[d].id,colModel:f.p.colModel[e]},e)}catch(c){h=a(j).html()}if(f.p.autoencode)h=
110
+ a.jgrid.htmlDecode(h);if(!f.p.colModel[e].edittype)f.p.colModel[e].edittype="text";f.p.savedRow.push({id:d,ic:e,name:g,v:h});if(a.isFunction(f.p.formatCell)){var l=f.p.formatCell(f.rows[d].id,g,h,d,e);if(l!=undefined)h=l}l=a.extend({},f.p.colModel[e].editoptions||{},{id:d+"_"+g,name:g});var k=createEl(f.p.colModel[e].edittype,l,h,true,a.extend({},a.jgrid.ajaxOptions,f.p.ajaxSelectOptions||{}));a.isFunction(f.p.beforeEditCell)&&f.p.beforeEditCell(f.rows[d].id,g,h,d,e);a(j).html("").append(k).attr("tabindex",
111
+ "0");window.setTimeout(function(){a(k).focus()},0);a("input, select, textarea",j).bind("keydown",function(o){if(o.keyCode===27)if(a("input.hasDatepicker",j).length>0)a(".ui-datepicker").is(":hidden")?a(f).jqGrid("restoreCell",d,e):a("input.hasDatepicker",j).datepicker("hide");else a(f).jqGrid("restoreCell",d,e);o.keyCode===13&&a(f).jqGrid("saveCell",d,e);if(o.keyCode==9)if(f.grid.hDiv.loading)return false;else o.shiftKey?a(f).jqGrid("prevCell",d,e):a(f).jqGrid("nextCell",d,e);o.stopPropagation()});
112
+ a.isFunction(f.p.afterEditCell)&&f.p.afterEditCell(f.rows[d].id,g,h,d,e)}else{if(parseInt(f.p.iCol)>=0&&parseInt(f.p.iRow)>=0){a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight");a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover")}j.addClass("edit-cell ui-state-highlight");a(f.rows[d]).addClass("selected-row ui-state-hover");if(a.isFunction(f.p.onSelectCell)){h=j.html().replace(/\&#160\;/ig,"");f.p.onSelectCell(f.rows[d].id,g,h,d,e)}}f.p.iCol=e;f.p.iRow=
113
+ d}}})},saveCell:function(d,e){return this.each(function(){var b=this,f;if(!(!b.grid||b.p.cellEdit!==true)){f=b.p.savedRow.length>=1?0:null;if(f!=null){var g=a("td:eq("+e+")",b.rows[d]),h,j,c=b.p.colModel[e],l=c.name,k=a.jgrid.jqID(l);switch(c.edittype){case "select":if(c.editoptions.multiple){k=a("#"+d+"_"+k,b.rows[d]);var o=[];if(h=a(k).val())h.join(",");else h="";a("option:selected",k).each(function(w,z){o[w]=a(z).text()});j=o.join(",")}else{h=a("#"+d+"_"+k+">option:selected",b.rows[d]).val();j=
114
+ a("#"+d+"_"+k+">option:selected",b.rows[d]).text()}if(c.formatter)j=h;break;case "checkbox":var m=["Yes","No"];if(c.editoptions)m=c.editoptions.value.split(":");j=h=a("#"+d+"_"+k,b.rows[d]).attr("checked")?m[0]:m[1];break;case "password":case "text":case "textarea":case "button":j=h=a("#"+d+"_"+k,b.rows[d]).val();break;case "custom":try{if(c.editoptions&&a.isFunction(c.editoptions.custom_value)){h=c.editoptions.custom_value(a(".customelement",g),"get");if(h===undefined)throw"e2";else j=h}else throw"e1";
115
+ }catch(n){n=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);n=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,n.message,jQuery.jgrid.edit.bClose)}break}if(j!=b.p.savedRow[f].v){if(a.isFunction(b.p.beforeSaveCell))if(f=b.p.beforeSaveCell(b.rows[d].id,l,h,d,e))h=f;var q=checkValues(h,e,b);if(q[0]===true){f={};
116
+ if(a.isFunction(b.p.beforeSubmitCell))(f=b.p.beforeSubmitCell(b.rows[d].id,l,h,d,e))||(f={});if(j=="")j=" ";a("input.hasDatepicker",g).length>0&&a("input.hasDatepicker",g).datepicker("hide");if(b.p.cellsubmit=="remote")if(b.p.cellurl){var r={};if(b.p.autoencode)h=a.jgrid.htmlEncode(h);r[l]=h;m=b.p.prmNames;c=m.id;k=m.oper;r[c]=b.rows[d].id;r[k]=m.editoper;r=a.extend(f,r);a("#lui_"+b.p.id).show();b.grid.hDiv.loading=true;a.ajax(a.extend({url:b.p.cellurl,data:a.isFunction(b.p.serializeCellData)?b.p.serializeCellData(r):
117
+ r,type:"POST",complete:function(w,z){a("#lui_"+b.p.id).hide();b.grid.hDiv.loading=false;if(z=="success")if(a.isFunction(b.p.afterSubmitCell)){w=b.p.afterSubmitCell(w,r.id,l,h,d,e);if(w[0]===true){a(g).empty();a(b).jqGrid("setCell",b.rows[d].id,e,j);a(g).addClass("dirty-cell");a(b.rows[d]).addClass("edited");a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell(b.rows[d].id,l,h,d,e);b.p.savedRow.splice(0,1)}else{info_dialog(a.jgrid.errors.errcap,w[1],a.jgrid.edit.bClose);a(b).jqGrid("restoreCell",d,e)}}else{a(g).empty();
118
+ a(b).jqGrid("setCell",b.rows[d].id,e,j);a(g).addClass("dirty-cell");a(b.rows[d]).addClass("edited");a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell(b.rows[d].id,l,h,d,e);b.p.savedRow.splice(0,1)}},error:function(w,z){a("#lui_"+b.p.id).hide();b.grid.hDiv.loading=false;a.isFunction(b.p.errorCell)?b.p.errorCell(w,z):info_dialog(a.jgrid.errors.errcap,w.status+" : "+w.statusText+"<br/>"+z,a.jgrid.edit.bClose);a(b).jqGrid("restoreCell",d,e)}},a.jgrid.ajaxOptions,b.p.ajaxCellOptions||{}))}else try{info_dialog(a.jgrid.errors.errcap,
119
+ a.jgrid.errors.nourl,a.jgrid.edit.bClose);a(b).jqGrid("restoreCell",d,e)}catch(u){}if(b.p.cellsubmit=="clientArray"){a(g).empty();a(b).jqGrid("setCell",b.rows[d].id,e,j);a(g).addClass("dirty-cell");a(b.rows[d]).addClass("edited");a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell(b.rows[d].id,l,h,d,e);b.p.savedRow.splice(0,1)}}else try{window.setTimeout(function(){info_dialog(a.jgrid.errors.errcap,h+" "+q[1],a.jgrid.edit.bClose)},100);a(b).jqGrid("restoreCell",d,e)}catch(v){}}else a(b).jqGrid("restoreCell",
120
+ d,e)}a.browser.opera?a("#"+b.p.knv).attr("tabindex","-1").focus():window.setTimeout(function(){a("#"+b.p.knv).attr("tabindex","-1").focus()},0)}})},restoreCell:function(d,e){return this.each(function(){var b=this,f;if(!(!b.grid||b.p.cellEdit!==true)){f=b.p.savedRow.length>=1?0:null;if(f!=null){var g=a("td:eq("+e+")",b.rows[d]);if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker",g).datepicker("hide")}catch(h){}a(g).empty().attr("tabindex","-1");a(b).jqGrid("setCell",b.rows[d].id,e,b.p.savedRow[f].v);
121
+ b.p.savedRow.splice(0,1)}window.setTimeout(function(){a("#"+b.p.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(d,e){return this.each(function(){var b=this,f=false;if(!(!b.grid||b.p.cellEdit!==true)){for(var g=e+1;g<b.p.colModel.length;g++)if(b.p.colModel[g].editable===true){f=g;break}if(f!==false)a(b).jqGrid("editCell",d,f,true);else b.p.savedRow.length>0&&a(b).jqGrid("saveCell",d,e)}})},prevCell:function(d,e){return this.each(function(){var b=this,f=false;if(!(!b.grid||b.p.cellEdit!==
122
+ true)){for(var g=e-1;g>=0;g--)if(b.p.colModel[g].editable===true){f=g;break}if(f!==false)a(b).jqGrid("editCell",d,f,true);else b.p.savedRow.length>0&&a(b).jqGrid("saveCell",d,e)}})},GridNav:function(){return this.each(function(){function d(j,c,l){if(l.substr(0,1)=="v"){var k=a(b.grid.bDiv)[0].clientHeight,o=a(b.grid.bDiv)[0].scrollTop,m=b.rows[j].offsetTop+b.rows[j].clientHeight,n=b.rows[j].offsetTop;if(l=="vd")if(m>=k)a(b.grid.bDiv)[0].scrollTop=a(b.grid.bDiv)[0].scrollTop+b.rows[j].clientHeight;
123
+ if(l=="vu")if(n<o)a(b.grid.bDiv)[0].scrollTop=a(b.grid.bDiv)[0].scrollTop-b.rows[j].clientHeight}if(l=="h"){l=a(b.grid.bDiv)[0].clientWidth;k=a(b.grid.bDiv)[0].scrollLeft;o=b.rows[j].cells[c].offsetLeft;if(b.rows[j].cells[c].offsetLeft+b.rows[j].cells[c].clientWidth>=l+parseInt(k))a(b.grid.bDiv)[0].scrollLeft=a(b.grid.bDiv)[0].scrollLeft+b.rows[j].cells[c].clientWidth;else if(o<k)a(b.grid.bDiv)[0].scrollLeft=a(b.grid.bDiv)[0].scrollLeft-b.rows[j].cells[c].clientWidth}}function e(j,c){var l,k;if(c==
124
+ "lft"){l=j+1;for(k=j;k>=0;k--)if(b.p.colModel[k].hidden!==true){l=k;break}}if(c=="rgt"){l=j-1;for(k=j;k<b.p.colModel.length;k++)if(b.p.colModel[k].hidden!==true){l=k;break}}return l}var b=this;if(!(!b.grid||b.p.cellEdit!==true)){b.p.knv=b.p.id+"_kn";var f=a("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span tabindex='-1' style='width:0px;height:0px;background-color:grey' id='"+b.p.knv+"'></span></span>"),g,h;a(f).insertBefore(b.grid.cDiv);a("#"+b.p.knv).focus().keydown(function(j){h=
125
+ j.keyCode;if(b.p.direction=="rtl")if(h==37)h=39;else if(h==39)h=37;switch(h){case 38:if(b.p.iRow-1>=0){d(b.p.iRow-1,b.p.iCol,"vu");a(b).jqGrid("editCell",b.p.iRow-1,b.p.iCol,false)}break;case 40:if(b.p.iRow+1<=b.rows.length-1){d(b.p.iRow+1,b.p.iCol,"vd");a(b).jqGrid("editCell",b.p.iRow+1,b.p.iCol,false)}break;case 37:if(b.p.iCol-1>=0){g=e(b.p.iCol-1,"lft");d(b.p.iRow,g,"h");a(b).jqGrid("editCell",b.p.iRow,g,false)}break;case 39:if(b.p.iCol+1<=b.p.colModel.length-1){g=e(b.p.iCol+1,"rgt");d(b.p.iRow,
126
+ g,"h");a(b).jqGrid("editCell",b.p.iRow,g,false)}break;case 13:parseInt(b.p.iCol,10)>=0&&parseInt(b.p.iRow,10)>=0&&a(b).jqGrid("editCell",b.p.iRow,b.p.iCol,true);break}return false})}})},getChangedCells:function(d){var e=[];d||(d="all");this.each(function(){var b=this,f;!b.grid||b.p.cellEdit!==true||a(b.rows).each(function(g){var h={};if(a(this).hasClass("edited")){a("td",this).each(function(j){f=b.p.colModel[j].name;if(f!=="cb"&&f!=="subgrid")if(d=="dirty"){if(a(this).hasClass("dirty-cell"))try{h[f]=
127
+ a.unformat(this,{rowId:b.rows[g].id,colModel:b.p.colModel[j]},j)}catch(c){h[f]=a.jgrid.htmlDecode(a(this).html())}}else try{h[f]=a.unformat(this,{rowId:b.rows[g].id,colModel:b.p.colModel[j]},j)}catch(l){h[f]=a.jgrid.htmlDecode(a(this).html())}});h.id=this.id;e.push(h)}})});return e}})})(jQuery);
128
+ var showModal=function(a){a.w.show()},closeModal=function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},createModal=function(a,d,e,b,f,g){var h=document.createElement("div"),j;j=jQuery(e.gbox).attr("dir")=="rtl"?true:false;h.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";h.id=a.themodal;var c=document.createElement("div");c.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";c.id=a.modalhead;jQuery(c).append("<span class='ui-jqdialog-title'>"+
129
+ e.caption+"</span>");var l=jQuery("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){l.addClass("ui-state-hover")},function(){l.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");jQuery(c).append(l);if(j){h.dir="rtl";jQuery(".ui-jqdialog-title",c).css("float","right");jQuery(".ui-jqdialog-titlebar-close",c).css("left","0.3em")}else{h.dir="ltr";jQuery(".ui-jqdialog-title",c).css("float","left");jQuery(".ui-jqdialog-titlebar-close",
130
+ c).css("right","0.3em")}var k=document.createElement("div");jQuery(k).addClass("ui-jqdialog-content ui-widget-content").attr("id",a.modalcontent);jQuery(k).append(d);h.appendChild(k);jQuery(h).prepend(c);g===true?jQuery("body").append(h):jQuery(h).insertBefore(b);if(typeof e.jqModal==="undefined")e.jqModal=true;d={};if(jQuery.fn.jqm&&e.jqModal===true){if(e.left==0&&e.top==0){b=[];b=findPos(f);e.left=b[0]+4;e.top=b[1]+4}d.top=e.top+"px";d.left=e.left}else if(e.left!=0||e.top!=0){d.left=e.left;d.top=
131
+ e.top+"px"}jQuery("a.ui-jqdialog-titlebar-close",c).click(function(){var n=jQuery("#"+a.themodal).data("onClose")||e.onClose,q=jQuery("#"+a.themodal).data("gbox")||e.gbox;hideModal("#"+a.themodal,{gb:q,jqm:e.jqModal,onClose:n});return false});if(e.width==0||!e.width)e.width=300;if(e.height==0||!e.height)e.height=200;if(!e.zIndex)e.zIndex=950;f=0;if(j&&d.left&&!g){f=jQuery(e.gbox).width()-(!isNaN(e.width)?parseInt(e.width):0)-8;d.left=parseInt(d.left)+parseInt(f)}if(d.left)d.left+="px";jQuery(h).css(jQuery.extend({width:isNaN(e.width)?
132
+ "auto":e.width+"px",height:isNaN(e.height)?"auto":e.height+"px",zIndex:e.zIndex,overflow:"hidden"},d)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":a.modalhead,"aria-hidden":"true"});if(typeof e.drag=="undefined")e.drag=true;if(typeof e.resize=="undefined")e.resize=true;if(e.drag){jQuery(c).css("cursor","move");if(jQuery.fn.jqDrag)jQuery(h).jqDrag(c);else try{jQuery(h).draggable({handle:jQuery("#"+c.id)})}catch(o){}}if(e.resize)if(jQuery.fn.jqResize){jQuery(h).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>");
133
+ jQuery("#"+a.themodal).jqResize(".jqResize",a.scrollelm?"#"+a.scrollelm:false)}else try{jQuery(h).resizable({handles:"se, sw",alsoResize:a.scrollelm?"#"+a.scrollelm:false})}catch(m){}e.closeOnEscape===true&&jQuery(h).keydown(function(n){if(n.which==27){n=jQuery("#"+a.themodal).data("onClose")||e.onClose;hideModal(this,{gb:e.gbox,jqm:e.jqModal,onClose:n})}})},viewModal=function(a,d){d=jQuery.extend({toTop:true,overlay:10,modal:false,onShow:showModal,onHide:closeModal,gbox:"",jqm:true,jqM:true},d||
134
+ {});if(jQuery.fn.jqm&&d.jqm==true)d.jqM?jQuery(a).attr("aria-hidden","false").jqm(d).jqmShow():jQuery(a).attr("aria-hidden","false").jqmShow();else{if(d.gbox!=""){jQuery(".jqgrid-overlay:first",d.gbox).show();jQuery(a).data("gbox",d.gbox)}jQuery(a).show().attr("aria-hidden","false");try{jQuery(":input:visible",a)[0].focus()}catch(e){}}},hideModal=function(a,d){d=jQuery.extend({jqm:true,gb:""},d||{});if(d.onClose){var e=d.onClose(a);if(typeof e=="boolean"&&!e)return}if(jQuery.fn.jqm&&d.jqm===true)jQuery(a).attr("aria-hidden",
135
+ "true").jqmHide();else{if(d.gb!="")try{jQuery(".jqgrid-overlay:first",d.gb).hide()}catch(b){}jQuery(a).hide().attr("aria-hidden","true")}};
136
+ function info_dialog(a,d,e,b){var f={width:290,height:"auto",dataheight:"auto",drag:true,resize:false,caption:"<b>"+a+"</b>",left:250,top:170,zIndex:1E3,jqModal:true,modal:false,closeOnEscape:true,align:"center",buttonalign:"center",buttons:[]};jQuery.extend(f,b||{});var g=f.jqModal;if(jQuery.fn.jqm&&!g)g=false;a="";if(f.buttons.length>0)for(b=0;b<f.buttons.length;b++){if(typeof f.buttons[b].id=="undefined")f.buttons[b].id="info_button_"+b;a+="<a href='javascript:void(0)' id='"+f.buttons[b].id+"' class='fm-button ui-state-default ui-corner-all'>"+
137
+ f.buttons[b].text+"</a>"}b=isNaN(f.dataheight)?f.dataheight:f.dataheight+"px";var h="<div id='info_id'>";h+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+b+";"+("text-align:"+f.align+";")+"'>"+d+"</div>";h+=e?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+f.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+
138
+ e+"</a>"+a+"</div>":"";h+="</div>";try{jQuery("#info_dialog").attr("aria-hidden")=="false"&&hideModal("#info_dialog",{jqm:g});jQuery("#info_dialog").remove()}catch(j){}createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},h,f,"","",true);a&&jQuery.each(f.buttons,function(l){jQuery("#"+this.id,"#info_id").bind("click",function(){f.buttons[l].onClick.call(jQuery("#info_dialog"));return false})});jQuery("#closedialog","#info_id").click(function(){hideModal("#info_dialog",
139
+ {jqm:g});return false});jQuery(".fm-button","#info_dialog").hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")});viewModal("#info_dialog",{onHide:function(l){l.w.hide().remove();l.o&&l.o.remove()},modal:f.modal,jqm:g});try{$("#info_dialog").focus()}catch(c){}}function findPos(a){var d=curtop=0;if(a.offsetParent){do{d+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent)}return[d,curtop]}
140
+ function isArray(a){return a.constructor.toString().indexOf("Array")==-1?false:true}
141
+ function createEl(a,d,e,b,f){function g(q,r){if(jQuery.isFunction(r.dataInit)){q.id=r.id;r.dataInit(q);delete r.id;delete r.dataInit}if(r.dataEvents){jQuery.each(r.dataEvents,function(){this.data!=null?jQuery(q).bind(this.type,this.data,this.fn):jQuery(q).bind(this.type,this.fn)});delete r.dataEvents}return r}var h="";d.defaultValue&&delete d.defaultValue;switch(a){case "textarea":h=document.createElement("textarea");if(b)d.cols||jQuery(h).css({width:"98%"});else if(!d.cols)d.cols=20;if(!d.rows)d.rows=
142
+ 2;if(e=="&nbsp;"||e=="&#160;"||e.length==1&&e.charCodeAt(0)==160)e="";h.value=e;d=g(h,d);jQuery(h).attr(d);break;case "checkbox":h=document.createElement("input");h.type="checkbox";if(d.value){var j=d.value.split(":");if(e===j[0]){h.checked=true;h.defaultChecked=true}h.value=j[0];jQuery(h).attr("offval",j[1]);try{delete d.value}catch(c){}}else{j=e.toLowerCase();if(j.search(/(false|0|no|off|undefined)/i)<0&&j!==""){h.checked=true;h.defaultChecked=true;h.value=e}else h.value="on";jQuery(h).attr("offval",
143
+ "off")}d=g(h,d);jQuery(h).attr(d);break;case "select":h=document.createElement("select");var l,k=[];if(d.multiple===true){l=true;h.multiple="multiple"}else l=false;if(d.dataUrl!=null)jQuery.ajax(jQuery.extend({url:d.dataUrl,type:"GET",complete:function(q){try{delete d.dataUrl;delete d.value}catch(r){}if(d.buildSelect!=null){q=d.buildSelect(q);q=jQuery(q).html();delete d.buildSelect}else q=jQuery(q.responseText).html();if(q){jQuery(h).append(q);d=g(h,d);if(typeof d.size==="undefined")d.size=l?3:1;
144
+ if(l){k=e.split(",");k=jQuery.map(k,function(u){return jQuery.trim(u)})}else k[0]=e;jQuery(h).attr(d);setTimeout(function(){jQuery("option",h).each(function(u){if(u==0)this.selected="";if(jQuery.inArray(jQuery(this).text(),k)>-1||jQuery.inArray(jQuery(this).val(),k)>-1){this.selected="selected";if(!l)return false}})},0)}}},f||{}));else if(d.value){if(l){k=e.split(",");k=jQuery.map(k,function(q){return jQuery.trim(q)});if(typeof d.size==="undefined")d.size=3}else d.size=1;if(typeof d.value==="function")d.value=
145
+ d.value();if(typeof d.value==="string"){b=d.value.split(";");for(j=0;j<b.length;j++){f=b[j].split(":");if(f.length>2)f[1]=jQuery.map(f,function(q,r){if(r>0)return q}).join(":");a=document.createElement("option");a.value=f[0];a.innerHTML=f[1];if(!l&&(f[0]==e||f[1]==e))a.selected="selected";if(l&&(jQuery.inArray(f[1],k)>-1||jQuery.inArray(f[0],k)>-1))a.selected="selected";h.appendChild(a)}}else if(typeof d.value==="object"){b=d.value;for(j in b){a=document.createElement("option");a.value=j;a.innerHTML=
146
+ b[j];if(!l&&(j==e||b[j]==e))a.selected="selected";if(l&&(jQuery.inArray(b[j],k)>-1||jQuery.inArray(j,k)>-1))a.selected="selected";h.appendChild(a)}}d=g(h,d);try{delete d.value}catch(o){}jQuery(h).attr(d)}break;case "text":case "password":case "button":h=document.createElement("input");h.type=a;h.value=e;d=g(h,d);if(a!="button")if(b)d.size||jQuery(h).css({width:"98%"});else if(!d.size)d.size=20;jQuery(h).attr(d);break;case "image":case "file":h=document.createElement("input");h.type=a;d=g(h,d);jQuery(h).attr(d);
147
+ break;case "custom":h=document.createElement("span");try{if(jQuery.isFunction(d.custom_element)){var m=d.custom_element.call(this,e,d);if(m){m=jQuery(m).addClass("customelement").attr({id:d.id,name:d.name});jQuery(h).empty().append(m)}else throw"e2";}else throw"e1";}catch(n){n=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_element' "+jQuery.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);n=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_element' "+jQuery.jgrid.edit.msg.novalue,
148
+ jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,n.message,jQuery.jgrid.edit.bClose)}break}return h}
149
+ function checkValues(a,d,e){var b,f,g;if(typeof d=="string"){f=0;for(len=e.p.colModel.length;f<len;f++)if(e.p.colModel[f].name==d){b=e.p.colModel[f].editrules;d=f;try{g=e.p.colModel[f].formoptions.label}catch(h){}break}}else if(d>=0)b=e.p.colModel[d].editrules;if(b){g||(g=e.p.colNames[d]);if(b.required===true)if(a.match(/^s+$/)||a=="")return[false,g+": "+jQuery.jgrid.edit.msg.required,""];f=b.required===false?false:true;if(b.number===true)if(!(f===false&&isEmpty(a)))if(isNaN(a))return[false,g+": "+
150
+ jQuery.jgrid.edit.msg.number,""];if(typeof b.minValue!="undefined"&&!isNaN(b.minValue))if(parseFloat(a)<parseFloat(b.minValue))return[false,g+": "+jQuery.jgrid.edit.msg.minValue+" "+b.minValue,""];if(typeof b.maxValue!="undefined"&&!isNaN(b.maxValue))if(parseFloat(a)>parseFloat(b.maxValue))return[false,g+": "+jQuery.jgrid.edit.msg.maxValue+" "+b.maxValue,""];var j;if(b.email===true)if(!(f===false&&isEmpty(a))){j=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
151
+ if(!j.test(a))return[false,g+": "+jQuery.jgrid.edit.msg.email,""]}if(b.integer===true)if(!(f===false&&isEmpty(a))){if(isNaN(a))return[false,g+": "+jQuery.jgrid.edit.msg.integer,""];if(a%1!=0||a.indexOf(".")!=-1)return[false,g+": "+jQuery.jgrid.edit.msg.integer,""]}if(b.date===true)if(!(f===false&&isEmpty(a))){d=e.p.colModel[d].datefmt||"Y-m-d";if(!checkDate(d,a))return[false,g+": "+jQuery.jgrid.edit.msg.date+" - "+d,""]}if(b.time===true)if(!(f===false&&isEmpty(a)))if(!checkTime(a))return[false,g+
152
+ ": "+jQuery.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(b.url===true)if(!(f===false&&isEmpty(a))){j=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!j.test(a))return[false,g+": "+jQuery.jgrid.edit.msg.url,""]}if(b.custom===true)if(!(f===false&&isEmpty(a)))if(jQuery.isFunction(b.custom_func)){a=b.custom_func.call(e,a,g);return jQuery.isArray(a)?a:[false,jQuery.jgrid.edit.msg.customarray,""]}else return[false,jQuery.jgrid.edit.msg.customfcheck,
153
+ ""]}return[true,"",""]}
154
+ function checkDate(a,d){var e={},b;a=a.toLowerCase();b=a.indexOf("/")!=-1?"/":a.indexOf("-")!=-1?"-":a.indexOf(".")!=-1?".":"/";a=a.split(b);d=d.split(b);if(d.length!=3)return false;b=-1;for(var f,g=-1,h=-1,j=0;j<a.length;j++){f=isNaN(d[j])?0:parseInt(d[j],10);e[a[j]]=f;f=a[j];if(f.indexOf("y")!=-1)b=j;if(f.indexOf("m")!=-1)h=j;if(f.indexOf("d")!=-1)g=j}f=a[b]=="y"||a[b]=="yyyy"?4:a[b]=="yy"?2:-1;j=DaysArray(12);var c;if(b===-1)return false;else{c=e[a[b]].toString();if(f==2&&c.length==1)f=1;if(c.length!=
155
+ f||e[a[b]]==0&&d[b]!="00")return false}if(h===-1)return false;else{c=e[a[h]].toString();if(c.length<1||e[a[h]]<1||e[a[h]]>12)return false}if(g===-1)return false;else{c=e[a[g]].toString();if(c.length<1||e[a[g]]<1||e[a[g]]>31||e[a[h]]==2&&e[a[g]]>daysInFebruary(e[a[b]])||e[a[g]]>j[e[a[h]]])return false}return true}function daysInFebruary(a){return a%4==0&&(a%100!=0||a%400==0)?29:28}
156
+ function DaysArray(a){for(var d=1;d<=a;d++){this[d]=31;if(d==4||d==6||d==9||d==11)this[d]=30;if(d==2)this[d]=29}return this}function isEmpty(a){return a.match(/^s+$/)||a==""?true:false}function checkTime(a){var d=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!isEmpty(a))if(a=a.match(d)){if(a[3]){if(a[1]<1||a[1]>12)return false}else if(a[1]>23)return false;if(a[2]>59)return false}else return false;return true}
157
+ (function(a){a.jgrid.extend({getColProp:function(d){var e={},b=this[0];if(b.grid){b=b.p.colModel;for(var f=0;f<b.length;f++)if(b[f].name==d){e=b[f];break}return e}},setColProp:function(d,e){return this.each(function(){if(this.grid)if(e)for(var b=this.p.colModel,f=0;f<b.length;f++)if(b[f].name==d){a.extend(this.p.colModel[f],e);break}})},sortGrid:function(d,e,b){return this.each(function(){var f=this,g=-1;if(f.grid){if(!d)d=f.p.sortname;for(var h=0;h<f.p.colModel.length;h++)if(f.p.colModel[h].index==
158
+ d||f.p.colModel[h].name==d){g=h;break}if(g!=-1){h=f.p.colModel[g].sortable;if(typeof h!=="boolean")h=true;if(typeof e!=="boolean")e=false;h&&f.sortData("jqgh_"+d,g,e,b)}}})},GridDestroy:function(){return this.each(function(){if(this.grid){this.p.pager&&a(this.p.pager).remove();var d=this.id;try{a("#gbox_"+d).remove()}catch(e){}}})},GridUnload:function(){return this.each(function(){if(this.grid){var d={id:a(this).attr("id"),cl:a(this).attr("class")};this.p.pager&&a(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom");
159
+ var e=document.createElement("table");a(e).attr({id:d.id});e.className=d.cl;d=this.id;a(e).removeClass("ui-jqgrid-btable");if(a(this.p.pager).parents("#gbox_"+d).length===1){a(e).insertBefore("#gbox_"+d).show();a(this.p.pager).insertBefore("#gbox_"+d)}else a(e).insertBefore("#gbox_"+d).show();a("#gbox_"+d).remove()}})},setGridState:function(d){return this.each(function(){if(this.grid){$t=this;if(d=="hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+$t.p.id).slideUp("fast");$t.p.pager&&a($t.p.pager).slideUp("fast");
160
+ if($t.p.toolbar[0]===true){$t.p.toolbar[1]=="both"&&a($t.grid.ubDiv).slideUp("fast");a($t.grid.uDiv).slideUp("fast")}$t.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+$s.p.id).slideUp("fast");a(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");$t.p.gridstate="hidden"}else if(d=="visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+$t.p.id).slideDown("fast");$t.p.pager&&a($t.p.pager).slideDown("fast");if($t.p.toolbar[0]===true){$t.p.toolbar[1]==
161
+ "both"&&a($t.grid.ubDiv).slideDown("fast");a($t.grid.uDiv).slideDown("fast")}$t.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+$t.p.id).slideDown("fast");a(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");$t.p.gridstate="visible"}}})},updateGridRows:function(d,e,b){var f,g=false;this.each(function(){var h=this,j,c,l,k;if(!h.grid)return false;e||(e="id");d&&d.length>0&&a(d).each(function(){l=this;if(c=h.rows.namedItem(l[e])){k=
162
+ l[e];if(b===true)if(h.p.jsonReader.repeatitems===true){if(h.p.jsonReader.cell)l=l[h.p.jsonReader.cell];for(var o=0;o<l.length;o++){j=h.formatter(k,l[o],o,l,"edit");h.p.treeGrid===true&&f==h.p.ExpandColumn?a("td:eq("+o+") > span:first",c).html(j).attr("title",a.jgrid.stripHtml(j)):a("td:eq("+o+")",c).html(j).attr("title",a.jgrid.stripHtml(j))}return g=true}a(h.p.colModel).each(function(m){f=b===true?this.jsonmap||this.name:this.name;if(l[f]!=undefined){j=h.formatter(k,l[f],m,l,"edit");h.p.treeGrid===
163
+ true&&f==h.p.ExpandColumn?a("td:eq("+m+") > span:first",c).html(j).attr("title",a.jgrid.stripHtml(j)):a("td:eq("+m+")",c).html(j).attr("title",a.jgrid.stripHtml(j));g=true}})}})});return g},filterGrid:function(d,e){e=a.extend({gridModel:false,gridNames:false,gridToolbar:false,filterModel:[],formtype:"horizontal",autosearch:true,formclass:"filterform",tableclass:"filtertable",buttonclass:"filterbutton",searchButton:"Search",clearButton:"Clear",enableSearch:false,enableClear:false,beforeSearch:null,
164
+ afterSearch:null,beforeClear:null,afterClear:null,url:"",marksearched:true},e||{});return this.each(function(){var b=this;this.p=e;if(this.p.filterModel.length==0&&this.p.gridModel===false)alert("No filter is set");else if(d){this.p.gridid=d.indexOf("#")!=-1?d:"#"+d;var f=a(this.p.gridid).jqGrid("getGridParam","colModel");if(f){if(this.p.gridModel===true){var g=a(this.p.gridid)[0],h;a.each(f,function(o){var m=[];this.search=this.search===false?false:true;h=this.editrules&&this.editrules.searchhidden===
165
+ true?true:this.hidden===true?false:true;if(this.search===true&&h===true){m.label=b.p.gridNames===true?g.p.colNames[o]:"";m.name=this.name;m.index=this.index||this.name;m.stype=this.edittype||"text";if(m.stype!="select")m.stype="text";m.defval=this.defval||"";m.surl=this.surl||"";m.sopt=this.editoptions||{};m.width=this.width;b.p.filterModel.push(m)}})}else a.each(b.p.filterModel,function(){for(var o=0;o<f.length;o++)if(this.name==f[o].name){this.index=f[o].index||this.name;break}if(!this.index)this.index=
166
+ this.name});var j=function(){var o={},m=0,n,q=a(b.p.gridid)[0],r;q.p.searchdata={};a.isFunction(b.p.beforeSearch)&&b.p.beforeSearch();a.each(b.p.filterModel,function(){r=this.index;switch(this.stype){case "select":if(n=a("select[name="+r+"]",b).val()){o[r]=n;b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).addClass("dirty-cell");m++}else{b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).removeClass("dirty-cell");try{delete q.p.postData[this.index]}catch(w){}}break;default:if(n=a("input[name="+
167
+ r+"]",b).val()){o[r]=n;b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).addClass("dirty-cell");m++}else{b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).removeClass("dirty-cell");try{delete q.p.postData[this.index]}catch(z){}}}});var u=m>0?true:false;a.extend(q.p.postData,o);var v;if(b.p.url){v=a(q).jqGrid("getGridParam","url");a(q).jqGrid("setGridParam",{url:b.p.url})}a(q).jqGrid("setGridParam",{search:u}).trigger("reloadGrid",[{page:1}]);v&&a(q).jqGrid("setGridParam",{url:v});a.isFunction(b.p.afterSearch)&&
168
+ b.p.afterSearch()},c=function(){var o={},m,n=0,q=a(b.p.gridid)[0],r;a.isFunction(b.p.beforeClear)&&b.p.beforeClear();a.each(b.p.filterModel,function(){r=this.index;m=this.defval?this.defval:"";if(!this.stype)this.stype="text";switch(this.stype){case "select":var w;a("select[name="+r+"] option",b).each(function(C){if(C==0)this.selected=true;if(a(this).text()==m){this.selected=true;w=a(this).val();return false}});if(w){o[r]=w;b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).addClass("dirty-cell");
169
+ n++}else{b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).removeClass("dirty-cell");try{delete q.p.postData[this.index]}catch(z){}}break;case "text":a("input[name="+r+"]",b).val(m);if(m){o[r]=m;b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).addClass("dirty-cell");n++}else{b.p.marksearched&&a("#jqgh_"+this.name,q.grid.hDiv).removeClass("dirty-cell");try{delete q.p.postData[this.index]}catch(B){}}break}});var u=n>0?true:false;a.extend(q.p.postData,o);var v;if(b.p.url){v=a(q).jqGrid("getGridParam",
170
+ "url");a(q).jqGrid("setGridParam",{url:b.p.url})}a(q).jqGrid("setGridParam",{search:u}).trigger("reloadGrid",[{page:1}]);v&&a(q).jqGrid("setGridParam",{url:v});a.isFunction(b.p.afterClear)&&b.p.afterClear()},l=a("<form name='SearchForm' style=display:inline;' class='"+this.p.formclass+"'></form>"),k=a("<table class='"+this.p.tableclass+"' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");a(l).append(k);(function(){var o=document.createElement("tr"),m,n,q,r;b.p.formtype=="horizontal"&&
171
+ a(k).append(o);a.each(b.p.filterModel,function(u){q=document.createElement("td");a(q).append("<label for='"+this.name+"'>"+this.label+"</label>");r=document.createElement("td");var v=this;if(!this.stype)this.stype="text";switch(this.stype){case "select":if(this.surl)a(r).load(this.surl,function(){v.defval&&a("select",this).val(v.defval);a("select",this).attr({name:v.index||v.name,id:"sg_"+v.name});v.sopt&&a("select",this).attr(v.sopt);b.p.gridToolbar===true&&v.width&&a("select",this).width(v.width);
172
+ b.p.autosearch===true&&a("select",this).change(function(){j();return false})});else if(v.sopt.value){var w=v.sopt.value,z=document.createElement("select");a(z).attr({name:v.index||v.name,id:"sg_"+v.name}).attr(v.sopt);if(typeof w==="string"){u=w.split(";");for(var B,C=0;C<u.length;C++){w=u[C].split(":");B=document.createElement("option");B.value=w[0];B.innerHTML=w[1];if(w[1]==v.defval)B.selected="selected";z.appendChild(B)}}else if(typeof w==="object")for(C in w){u++;B=document.createElement("option");
173
+ B.value=C;B.innerHTML=w[C];if(w[C]==v.defval)B.selected="selected";z.appendChild(B)}b.p.gridToolbar===true&&v.width&&a(z).width(v.width);a(r).append(z);b.p.autosearch===true&&a(z).change(function(){j();return false})}break;case "text":z=this.defval?this.defval:"";a(r).append("<input type='text' name='"+(this.index||this.name)+"' id='sg_"+this.name+"' value='"+z+"'/>");v.sopt&&a("input",r).attr(v.sopt);if(b.p.gridToolbar===true&&v.width)a.browser.msie?a("input",r).width(v.width-4):a("input",r).width(v.width-
174
+ 2);b.p.autosearch===true&&a("input",r).keypress(function(y){if((y.charCode?y.charCode:y.keyCode?y.keyCode:0)==13){j();return false}return this});break}if(b.p.formtype=="horizontal"){b.p.gridToolbar===true&&b.p.gridNames===false?a(o).append(r):a(o).append(q).append(r);a(o).append(r)}else{m=document.createElement("tr");a(m).append(q).append(r);a(k).append(m)}});r=document.createElement("td");if(b.p.enableSearch===true){n="<input type='button' id='sButton' class='"+b.p.buttonclass+"' value='"+b.p.searchButton+
175
+ "'/>";a(r).append(n);a("input#sButton",r).click(function(){j();return false})}if(b.p.enableClear===true){n="<input type='button' id='cButton' class='"+b.p.buttonclass+"' value='"+b.p.clearButton+"'/>";a(r).append(n);a("input#cButton",r).click(function(){c();return false})}if(b.p.enableClear===true||b.p.enableSearch===true)if(b.p.formtype=="horizontal")a(o).append(r);else{m=document.createElement("tr");a(m).append("<td>&#160;</td>").append(r);a(k).append(m)}})();a(this).append(l);this.triggerSearch=
176
+ j;this.clearSearch=c}else alert("Could not get grid colModel")}else alert("No target grid is set!")})},filterToolbar:function(d){d=a.extend({autosearch:true,searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND"},d||{});return this.each(function(){function e(k,o){var m=a(k);m[0]!=null&&jQuery.each(o,function(){this.data!=null?m.bind(this.type,this.data,this.fn):m.bind(this.type,this.fn)})}var b=this,f=function(){var k={},
177
+ o=0,m,n,q={};a.each(b.p.colModel,function(){n=this.index||this.name;var B=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:"bw";switch(this.stype){case "select":if(m=a("select[name="+n+"]",b.grid.hDiv).val()){k[n]=m;q[n]=B;o++}else try{delete b.p.postData[n]}catch(C){}break;case "text":if(m=a("input[name="+n+"]",b.grid.hDiv).val()){k[n]=m;q[n]=B;o++}else try{delete b.p.postData[n]}catch(y){}break}});var r=o>0?true:false;if(d.stringResult){var u='{"groupOp":"'+d.groupOp+'","rules":[',
178
+ v=0;a.each(k,function(B,C){if(v>0)u+=",";u+='{"field":"'+B+'",';u+='"op":"'+q[B]+'",';u+='"data":"'+C+'"}';v++});u+="]}";a.extend(b.p.postData,{filters:u})}else a.extend(b.p.postData,k);var w;if(b.p.searchurl){w=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var z=false;if(a.isFunction(d.beforeSearch))z=d.beforeSearch.call(b);z||a(b).jqGrid("setGridParam",{search:r}).trigger("reloadGrid",[{page:1}]);w&&a(b).jqGrid("setGridParam",{url:w});a.isFunction(d.afterSearch)&&d.afterSearch()},g=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),
179
+ h,j,c,l;a.each(b.p.colModel,function(){var k=this;h=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+b.p.direction+"'></th>");j=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");this.hidden===true&&a(h).css("display","none");this.search=this.search===false?false:true;if(typeof this.stype=="undefined")this.stype="text";c=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":var o=this.surl||c.dataUrl;if(o)a.ajax(a.extend({url:o,
180
+ dataType:"html",complete:function(u){if(c.buildSelect!=null)(u=c.buildSelect(u))&&a(j).append(u);else a(j).append(u.responseText);c.defaultValue&&a("select",j).val(c.defaultValue);a("select",j).attr({name:k.index||k.name,id:"gs_"+k.name});c.attr&&a("select",j).attr(c.attr);a("select",j).css({width:"100%"});c.dataInit!=null&&c.dataInit(a("select",j)[0]);c.dataEvents!=null&&e(a("select",j)[0],c.dataEvents);d.autosearch===true&&a("select",j).change(function(){f();return false})}},a.jgrid.ajaxOptions,
181
+ b.p.ajaxSelectOptions||{}));else{var m;if(k.searchoptions&&k.searchoptions.value)m=k.searchoptions.value;else if(k.editoptions&&k.editoptions.value)m=k.editoptions.value;if(m){o=document.createElement("select");o.style.width="100%";a(o).attr({name:k.index||k.name,id:"gs_"+k.name});if(typeof m==="string"){m=m.split(";");for(var n,q,r=0;r<m.length;r++){n=m[r].split(":");q=document.createElement("option");q.value=n[0];q.innerHTML=n[1];o.appendChild(q)}}else if(typeof m==="object")for(n in m){q=document.createElement("option");
182
+ q.value=n;q.innerHTML=m[n];o.appendChild(q)}c.defaultValue&&a(o).val(c.defaultValue);c.attr&&a(o).attr(c.attr);c.dataInit!=null&&c.dataInit(o);c.dataEvents!=null&&e(o,c.dataEvents);a(j).append(o);d.autosearch===true&&a(o).change(function(){f();return false})}}break;case "text":o=c.defaultValue?c.defaultValue:"";a(j).append("<input type='text' style='width:95%;padding:0px;' name='"+(k.index||k.name)+"' id='gs_"+k.name+"' value='"+o+"'/>");c.attr&&a("input",j).attr(c.attr);c.dataInit!=null&&c.dataInit(a("input",
183
+ j)[0]);c.dataEvents!=null&&e(a("input",j)[0],c.dataEvents);if(d.autosearch===true)d.searchOnEnter?a("input",j).keypress(function(u){if((u.charCode?u.charCode:u.keyCode?u.keyCode:0)==13){f();return false}return this}):a("input",j).keydown(function(u){switch(u.which){case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:l&&clearTimeout(l);l=setTimeout(function(){f()},500)}});break}a(h).append(j);a(g).append(h)});a("table thead",b.grid.hDiv).append(g);this.triggerToolbar=f;this.clearToolbar=
184
+ function(k){var o={},m,n=0,q;k=typeof k!="boolean"?true:k;a.each(b.p.colModel,function(){m=this.searchoptions&&this.searchoptions.defaultValue?this.searchoptions.defaultValue:"";q=this.index||this.name;switch(this.stype){case "select":var B;a("select[name="+q+"] option",b.grid.hDiv).each(function(F){if(F==0)this.selected=true;if(a(this).text()==m){this.selected=true;B=a(this).val();return false}});if(B){o[q]=B;n++}else try{delete b.p.postData[q]}catch(C){}break;case "text":a("input[name="+q+"]",b.grid.hDiv).val(m);
185
+ if(m){o[q]=m;n++}else try{delete b.p.postData[q]}catch(y){}break}});var r=n>0?true:false;if(d.stringResult){var u='{"groupOp":"'+d.groupOp+'","rules":[',v=0;a.each(o,function(B,C){if(v>0)u+=",";u+='{"field":"'+B+'",';u+='"op":"eq",';u+='"data":"'+C+'"}';v++});u+="]}";a.extend(b.p.postData,{filters:u})}else a.extend(b.p.postData,o);var w;if(b.p.searchurl){w=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var z=false;if(a.isFunction(d.beforeClear))z=d.beforeClear.call(b);z||k&&a(b).jqGrid("setGridParam",
186
+ {search:r}).trigger("reloadGrid",[{page:1}]);w&&a(b).jqGrid("setGridParam",{url:w});a.isFunction(d.afterClear)&&d.afterClear()};this.toggleToolbar=function(){var k=a("tr.ui-search-toolbar",b.grid.hDiv);k.css("display")=="none"?k.show():k.hide()}})}})})(jQuery);
187
+ (function(a){var d=null;a.jgrid.extend({searchGrid:function(e){e=a.extend({recreateFilter:false,drag:true,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,closeAfterSearch:false,closeOnEscape:false,multipleSearch:false,sopt:null,onClose:null},a.jgrid.search,e||{});return this.each(function(){function b(z){var B=z!==undefined,C=a("#"+j.p.id),y={};if(e.multipleSearch===false){y[e.sField]=z.rules[0].field;
188
+ y[e.sValue]=z.rules[0].data;y[e.sOper]=z.rules[0].op}else y[e.sFilter]=z;C[0].p.search=B;a.extend(C[0].p.postData,y);C.trigger("reloadGrid",[{page:1}]);e.closeAfterSearch&&g(a("#"+c))}function f(z){z=z!==undefined;var B=a("#"+j.p.id),C=[];B[0].p.search=z;if(e.multipleSearch===false)C[e.sField]=C[e.sValue]=C[e.sOper]="";else C[e.sFilter]="";a.extend(B[0].p.postData,C);B.trigger("reloadGrid",[{page:1}])}function g(z){if(e.onClose){var B=e.onClose(z);if(typeof B=="boolean"&&!B)return}z.hide();a(".jqgrid-overlay:first",
189
+ "#gbox_"+j.p.id).hide()}function h(){var z=a(".ui-searchFilter").length;if(z>1){var B=a("#"+c).css("zIndex");a("#"+c).css({zIndex:parseInt(B)+z})}a("#"+c).show();a(".jqgrid-overlay:first","#gbox_"+j.p.id).show();try{a(":input:visible","#"+c)[0].focus()}catch(C){}}var j=this;if(j.grid)if(a.fn.searchFilter){var c="fbox_"+j.p.id;e.recreateFilter===true&&a("#"+c).remove();if(a("#"+c).html()!=null){a.isFunction(e.beforeShowSearch)&&e.beforeShowSearch(a("#"+c));h();a.isFunction(e.afterShowSearch)&&e.afterShowSearch(a("#"+
190
+ c))}else{var l=[],k=a("#"+j.p.id).jqGrid("getGridParam","colNames"),o=a("#"+j.p.id).jqGrid("getGridParam","colModel"),m=["eq","ne","lt","le","gt","ge","bw","bn","in","ni","ew","en","cn","nc"],n,q,r,u;u=jQuery.fn.searchFilter.defaults.operators;if(e.sopt!=null){u=[];for(n=r=0;n<e.sopt.length;n++)if((q=a.inArray(e.sopt[n],m))!=-1){u[r]={op:e.sopt[n],text:e.odata[q]};r++}}var v;a.each(o,function(z,B){v=typeof B.search==="undefined"?true:B.search;hidden=B.hidden===true;soptions=a.extend({},{text:k[z],
191
+ itemval:B.index||B.name},this.searchoptions);ignoreHiding=soptions.searchhidden===true;if(typeof soptions.sopt=="undefined")soptions.sopt=e.sopt||m;r=0;soptions.ops=[];if(soptions.sopt.length>0)for(n=0;n<soptions.sopt.length;n++)if((q=a.inArray(soptions.sopt[n],m))!=-1){soptions.ops[r]={op:soptions.sopt[n],text:e.odata[q]};r++}if(typeof this.stype==="undefined")this.stype="text";if(this.stype=="select")if(soptions.dataUrl==null){var C;if(soptions.value)C=soptions.value;else if(this.editoptions)C=
192
+ this.editoptions.value;if(C){soptions.dataValues=[];if(typeof C==="string"){z=C.split(";");for(n=0;n<z.length;n++){B=z[n].split(":");soptions.dataValues[n]={value:B[0],text:B[1]}}}else if(typeof C==="object"){n=0;for(var y in C){soptions.dataValues[n]={value:y,text:C[y]};n++}}}}if(ignoreHiding&&v||v&&!hidden)l.push(soptions)});if(l.length>0){a("<div id='"+c+"' role='dialog' tabindex='-1'></div>").insertBefore("#gview_"+j.p.id);a("#"+c).searchFilter(l,{groupOps:e.groupOps,operators:u,onClose:g,resetText:e.Reset,
193
+ searchText:e.Find,windowTitle:e.caption,rulesText:e.rulesText,matchText:e.matchText,onSearch:b,onReset:f,stringResult:e.multipleSearch,ajaxSelectOptions:a.extend({},a.jgrid.ajaxOptions,j.p.ajaxSelectOptions||{})});a(".ui-widget-overlay","#"+c).remove();j.p.direction=="rtl"&&a(".ui-closer","#"+c).css("float","left");if(e.drag===true){a("#"+c+" table thead tr:first td:first").css("cursor","move");if(jQuery.fn.jqDrag)a("#"+c).jqDrag(a("#"+c+" table thead tr:first td:first"));else try{a("#"+c).draggable({handle:a("#"+
194
+ c+" table thead tr:first td:first")})}catch(w){}}if(e.multipleSearch===false){a(".ui-del, .ui-add, .ui-del, .ui-add-last, .matchText, .rulesText","#"+c).hide();a("select[name='groupOp']","#"+c).hide()}a.isFunction(e.onInitializeSearch)&&e.onInitializeSearch(a("#"+c));a.isFunction(e.beforeShowSearch)&&e.beforeShowSearch(a("#"+c));h();a.isFunction(e.afterShowSearch)&&e.afterShowSearch(a("#"+c));e.closeOnEscape===true&&a("#"+c).keydown(function(z){z.which==27&&g(a("#"+c))})}}}})},editGridRow:function(e,
195
+ b){d=b=a.extend({top:0,left:0,width:300,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,url:null,mtype:"POST",clearAfterAdd:true,closeAfterEdit:false,reloadAfterSubmit:true,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:false,jqModal:true,closeOnEscape:false,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],
196
+ closeicon:[],savekey:[false,13],navkeys:[false,38,40],checkOnSubmit:false,checkOnUpdate:false,_savedData:{},processing:false,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:true},a.jgrid.edit,b||{});return this.each(function(){function f(E,G){E==0?a("#pData","#"+r+"_2").addClass("ui-state-disabled"):a("#pData","#"+r+"_2").removeClass("ui-state-disabled");E==G?a("#nData","#"+r+"_2").addClass("ui-state-disabled"):a("#nData","#"+r+"_2").removeClass("ui-state-disabled")}function g(){var E=
197
+ a(m).jqGrid("getDataIDs"),G=a("#id_g","#"+r).val();return[a.inArray(G,E),E]}function h(){var E=true;a("#FormError","#"+r).hide();if(d.checkOnUpdate){x={};N={};j();Y=a.extend({},x,N);if(da=o(Y,d._savedData)){a("#"+q).data("disabled",true);a(".confirm","#"+u.themodal).show();E=false}}return E}function j(){a(".FormElement","#"+r).each(function(){var E=a(".customelement",this);if(E.length){var G=E[0].name;a.each(m.p.colModel,function(){if(this.name==G&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{x[G]=
198
+ this.editoptions.custom_value(a("#"+G,"#"+r),"get");if(x[G]===undefined)throw"e1";}catch(L){L=="e1"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,L.message,jQuery.jgrid.edit.bClose)}return true}})}else{switch(a(this).get(0).type){case "checkbox":if(a(this).attr("checked"))x[this.name]=a(this).val();else{E=a(this).attr("offval");x[this.name]=E}break;case "select-one":x[this.name]=a("option:selected",
199
+ this).val();N[this.name]=a("option:selected",this).text();break;case "select-multiple":x[this.name]=a(this).val();x[this.name]=x[this.name]?x[this.name].join(","):"";var V=[];a("option:selected",this).each(function(L,W){V[L]=a(W).text()});N[this.name]=V.join(",");break;case "password":case "text":case "textarea":case "button":x[this.name]=a(this).val();break}if(m.p.autoencode)x[this.name]=a.jgrid.htmlEncode(x[this.name])}});return true}function c(E,G,V,L){for(var W,R,S,T=0,K,ba,Z,ka=[],aa=false,wa,
200
+ ta,la="",ma=1;ma<=L;ma++)la+="<td class='CaptionTD ui-widget-content'>&#160;</td><td class='DataTD ui-widget-content' style='white-space:pre'>&#160;</td>";if(E!="_empty")aa=a(G).jqGrid("getInd",E);a(G.p.colModel).each(function(oa){W=this.name;ba=(R=this.editrules&&this.editrules.edithidden==true?false:this.hidden===true?true:false)?"style='display:none'":"";if(W!=="cb"&&W!=="subgrid"&&this.editable===true&&W!=="rn"){if(aa===false)K="";else if(W==G.p.ExpandColumn&&G.p.treeGrid===true)K=a("td:eq("+
201
+ oa+")",G.rows[aa]).text();else try{K=a.unformat(a("td:eq("+oa+")",G.rows[aa]),{rowId:E,colModel:this},oa)}catch(Ia){K=a("td:eq("+oa+")",G.rows[aa]).html()}var xa=a.extend({},this.editoptions||{},{id:W,name:W});frmopt=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{});wa=parseInt(frmopt.rowpos)||T+1;ta=parseInt((parseInt(frmopt.colpos)||1)*2);if(E=="_empty"&&xa.defaultValue)K=a.isFunction(xa.defaultValue)?xa.defaultValue():xa.defaultValue;if(!this.edittype)this.edittype=
202
+ "text";if(m.p.autoencode)K=a.jgrid.htmlDecode(K);Z=createEl(this.edittype,xa,K,false,a.extend({},a.jgrid.ajaxOptions,G.p.ajaxSelectOptions||{}));if(K==""&&this.edittype=="checkbox")K=a(Z).attr("offval");if(d.checkOnSubmit||d.checkOnUpdate)d._savedData[W]=K;a(Z).addClass("FormElement");S=a(V).find("tr[rowpos="+wa+"]");if(frmopt.rowabove){xa=a("<tr><td class='contentinfo' colspan='"+L*2+"'>"+frmopt.rowcontent+"</td></tr>");a(V).append(xa);xa[0].rp=wa}if(S.length==0){S=a("<tr "+ba+" rowpos='"+wa+"'></tr>").addClass("FormData").attr("id",
203
+ "tr_"+W);a(S).append(la);a(V).append(S);S[0].rp=wa}a("td:eq("+(ta-2)+")",S[0]).html(typeof frmopt.label==="undefined"?G.p.colNames[oa]:frmopt.label);a("td:eq("+(ta-1)+")",S[0]).append(frmopt.elmprefix).append(Z).append(frmopt.elmsuffix);ka[T]=oa;T++}});if(T>0){ma=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(L*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+G.p.id+"_id' value='"+E+"'/></td></tr>");ma[0].rp=T+999;a(V).append(ma);
204
+ if(d.checkOnSubmit||d.checkOnUpdate)d._savedData.id=E}return ka}function l(E,G,V){var L,W=0,R,S,T,K,ba;if(d.checkOnSubmit||d.checkOnUpdate){d._savedData={};d._savedData.id=E}var Z=G.p.colModel;if(E=="_empty"){a(Z).each(function(){L=this.name;T=a.extend({},this.editoptions||{});S=a("#"+a.jgrid.jqID(L),"#"+V);if(S[0]!=null){K="";if(T.defaultValue){K=a.isFunction(T.defaultValue)?T.defaultValue():T.defaultValue;if(S[0].type=="checkbox"){ba=K.toLowerCase();if(ba.search(/(false|0|no|off|undefined)/i)<0&&
205
+ ba!==""){S[0].checked=true;S[0].defaultChecked=true;S[0].value=K}else S.attr({checked:"",defaultChecked:""})}else S.val(K)}else if(S[0].type=="checkbox"){S[0].checked=false;S[0].defaultChecked=false;K=a(S).attr("offval")}else if(S[0].type.substr(0,6)=="select")S[0].selectedIndex=0;else S.val(K);if(d.checkOnSubmit===true||d.checkOnUpdate)d._savedData[L]=K}});a("#id_g","#"+V).val(E)}else{var ka=a(G).jqGrid("getInd",E,true);if(ka){a("td",ka).each(function(aa){L=Z[aa].name;if(L!=="cb"&&L!=="subgrid"&&
206
+ L!=="rn"&&Z[aa].editable===true){if(L==G.p.ExpandColumn&&G.p.treeGrid===true)R=a(this).text();else try{R=a.unformat(this,{rowId:E,colModel:Z[aa]},aa)}catch(wa){R=a(this).html()}if(m.p.autoencode)R=a.jgrid.htmlDecode(R);if(d.checkOnSubmit===true||d.checkOnUpdate)d._savedData[L]=R;L=a.jgrid.jqID(L);switch(Z[aa].edittype){case "password":case "text":case "button":case "image":a("#"+L,"#"+V).val(R);break;case "textarea":if(R=="&nbsp;"||R=="&#160;"||R.length==1&&R.charCodeAt(0)==160)R="";a("#"+L,"#"+V).val(R);
207
+ break;case "select":var ta=R.split(",");ta=a.map(ta,function(ma){return a.trim(ma)});a("#"+L+" option","#"+V).each(function(){this.selected=!Z[aa].editoptions.multiple&&(ta[0]==a(this).text()||ta[0]==a(this).val())?true:Z[aa].editoptions.multiple?a.inArray(a(this).text(),ta)>-1||a.inArray(a(this).val(),ta)>-1?true:false:false});break;case "checkbox":R+="";R=R.toLowerCase();if(R.search(/(false|0|no|off|undefined)/i)<0&&R!==""){a("#"+L,"#"+V).attr("checked",true);a("#"+L,"#"+V).attr("defaultChecked",
208
+ true)}else{a("#"+L,"#"+V).attr("checked",false);a("#"+L,"#"+V).attr("defaultChecked","")}break;case "custom":try{if(Z[aa].editoptions&&a.isFunction(Z[aa].editoptions.custom_value))Z[aa].editoptions.custom_value(a("#"+L,"#"+V),"set",R);else throw"e1";}catch(la){la=="e1"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,la.message,jQuery.jgrid.edit.bClose)}break}W++}});W>0&&a("#id_g","#"+r).val(E)}}}
209
+ function k(){var E,G=[true,"",""],V={},L=m.p.prmNames,W,R;if(a.isFunction(d.beforeCheckValues)){var S=d.beforeCheckValues(x,a("#"+q),x[m.p.id+"_id"]=="_empty"?L.addoper:L.editoper);if(S&&typeof S==="object")x=S}for(var T in x){G=checkValues(x[T],T,m);if(G[0]==false)break}if(G[0]){if(a.isFunction(d.onclickSubmit))V=d.onclickSubmit(d,x)||{};if(a.isFunction(d.beforeSubmit))G=d.beforeSubmit(x,a("#"+q))}F=d.url?d.url:a(m).jqGrid("getGridParam","editurl");if(G[0])if(!F){G[0]=false;G[1]+=" "+a.jgrid.errors.nourl}if(G[0]===
210
+ false){a("#FormError>td","#"+r).html(G[1]);a("#FormError","#"+r).show()}else if(!d.processing){d.processing=true;a("#sData","#"+r+"_2").addClass("ui-state-active");R=L.oper;W=L.id;x[R]=a.trim(x[m.p.id+"_id"])=="_empty"?L.addoper:L.editoper;if(x[R]!=L.addoper)x[W]=x[m.p.id+"_id"];else if(x[W]===undefined)x[W]=x[m.p.id+"_id"];delete x[m.p.id+"_id"];x=a.extend(x,d.editData,V);a.ajax(a.extend({url:F,type:d.mtype,data:a.isFunction(d.serializeEditData)?d.serializeEditData(x):x,complete:function(K,ba){if(ba!=
211
+ "success"){G[0]=false;G[1]=a.isFunction(d.errorTextFormat)?d.errorTextFormat(K):ba+" Status: '"+K.statusText+"'. Error code: "+K.status}else if(a.isFunction(d.afterSubmit))G=d.afterSubmit(K,x);if(G[0]===false){a("#FormError>td","#"+r).html(G[1]);a("#FormError","#"+r).show()}else{a.each(m.p.colModel,function(){if(N[this.name]&&this.formatter&&this.formatter=="select")try{delete N[this.name]}catch(ka){}});x=a.extend(x,N);m.p.autoencode&&a.each(x,function(ka,aa){x[ka]=a.jgrid.htmlDecode(aa)});if(x[R]==
212
+ L.addoper){G[2]||(G[2]=parseInt(m.p.records)+1);x[W]=G[2];if(d.closeAfterAdd){if(d.reloadAfterSubmit)a(m).trigger("reloadGrid");else{a(m).jqGrid("addRowData",G[2],x,b.addedrow);a(m).jqGrid("setSelection",G[2])}hideModal("#"+u.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:d.onClose})}else if(d.clearAfterAdd){d.reloadAfterSubmit?a(m).trigger("reloadGrid"):a(m).jqGrid("addRowData",G[2],x,b.addedrow);l("_empty",m,q)}else d.reloadAfterSubmit?a(m).trigger("reloadGrid"):a(m).jqGrid("addRowData",G[2],x,b.addedrow)}else{if(d.reloadAfterSubmit){a(m).trigger("reloadGrid");
213
+ d.closeAfterEdit||setTimeout(function(){a(m).jqGrid("setSelection",x[W])},1E3)}else m.p.treeGrid===true?a(m).jqGrid("setTreeRow",x[W],x):a(m).jqGrid("setRowData",x[W],x);d.closeAfterEdit&&hideModal("#"+u.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:d.onClose})}if(a.isFunction(d.afterComplete)){E=K;setTimeout(function(){d.afterComplete(E,x,a("#"+q));E=null},500)}}d.processing=false;if(d.checkOnSubmit||d.checkOnUpdate){a("#"+q).data("disabled",false);if(d._savedData.id!="_empty")d._savedData=x}a("#sData",
214
+ "#"+r+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+q)[0].focus()}catch(Z){}},error:function(K,ba,Z){a("#FormError>td","#"+r).html(ba+" : "+Z);a("#FormError","#"+r).show();d.processing=false;a("#"+q).data("disabled",false);a("#sData","#"+r+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,d.ajaxEditOptions))}}function o(E,G){var V=false,L;for(L in E)if(E[L]!=G[L]){V=true;break}return V}var m=this;if(m.grid&&e){var n=m.p.id,q="FrmGrid_"+n,r="TblGrid_"+n,u={themodal:"editmod"+
215
+ n,modalhead:"edithd"+n,modalcontent:"editcnt"+n,scrollelm:q},v=a.isFunction(d.beforeShowForm)?d.beforeShowForm:false,w=a.isFunction(d.afterShowForm)?d.afterShowForm:false,z=a.isFunction(d.beforeInitData)?d.beforeInitData:false,B=a.isFunction(d.onInitializeForm)?d.onInitializeForm:false,C=1,y=0,F,x,N,Y,da;if(e=="new"){e="_empty";b.caption=b.addCaption}else b.caption=b.editCaption;b.recreateForm===true&&a("#"+u.themodal).html()!=null&&a("#"+u.themodal).remove();var Q=true;if(b.checkOnUpdate&&b.jqModal&&
216
+ !b.modal)Q=false;if(a("#"+u.themodal).html()!=null){a(".ui-jqdialog-title","#"+u.modalhead).html(b.caption);a("#FormError","#"+r).hide();if(d.topinfo){a(".topinfo","#"+r+"_2").html(d.topinfo);a(".tinfo","#"+r+"_2").show()}else a(".tinfo","#"+r+"_2").hide();if(d.bottominfo){a(".bottominfo","#"+r+"_2").html(d.bottominfo);a(".binfo","#"+r+"_2").show()}else a(".binfo","#"+r+"_2").hide();z&&z(a("#"+q));l(e,m,q);e=="_empty"||!d.viewPagerButtons?a("#pData, #nData","#"+r+"_2").hide():a("#pData, #nData","#"+
217
+ r+"_2").show();if(d.processing===true){d.processing=false;a("#sData","#"+r+"_2").removeClass("ui-state-active")}if(a("#"+q).data("disabled")===true){a(".confirm","#"+u.themodal).hide();a("#"+q).data("disabled",false)}v&&v(a("#"+q));a("#"+u.themodal).data("onClose",d.onClose);viewModal("#"+u.themodal,{gbox:"#gbox_"+n,jqm:b.jqModal,jqM:false,closeoverlay:Q,modal:b.modal});Q||a(".jqmOverlay").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:d.onClose});
218
+ return false});w&&w(a("#"+q))}else{a(m.p.colModel).each(function(){var E=this.formoptions;C=Math.max(C,E?E.colpos||0:0);y=Math.max(y,E?E.rowpos||0:0)});var ea=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",U;ea=a("<form name='FormPost' id='"+q+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+ea+";'></form>").data("disabled",false);var ga=a("<table id='"+r+"' class='EditTable' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");a(ea).append(ga);U=a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+
219
+ C*2+"'></td></tr>");U[0].rp=0;a(ga).append(U);U=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+C*2+"'>"+d.topinfo+"</td></tr>");U[0].rp=0;a(ga).append(U);z&&z(a("#"+q));U=(z=m.p.direction=="rtl"?true:false)?"nData":"pData";var sa=z?"pData":"nData";c(e,m,ga,C);U="<a href='javascript:void(0)' id='"+U+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>";sa="<a href='javascript:void(0)' id='"+sa+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>";
220
+ var za="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>",Ca="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>";U="<table border='0' class='EditTable' id='"+r+"_2'><tbody><tr id='Act_Buttons'><td class='navButton ui-widget-content'>"+(z?sa+U:U+sa)+"</td><td class='EditButton ui-widget-content'>"+za+Ca+"</td></tr>";U+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+
221
+ d.bottominfo+"</td></tr>";U+="</tbody></table>";if(y>0){var va=[];a.each(a(ga)[0].rows,function(E,G){va[E]=G});va.sort(function(E,G){if(E.rp>G.rp)return 1;if(E.rp<G.rp)return-1;return 0});a.each(va,function(E,G){a("tbody",ga).append(G)})}b.gbox="#gbox_"+n;var Ga=false;if(b.closeOnEscape===true){b.closeOnEscape=false;Ga=true}ea=a("<span></span>").append(ea).append(U);createModal(u,ea,b,"#gview_"+m.p.id,a("#gview_"+m.p.id)[0]);if(z){a("#pData, #nData","#"+r+"_2").css("float","right");a(".EditButton",
222
+ "#"+r+"_2").css("text-align","left")}d.topinfo&&a(".tinfo","#"+r+"_2").show();d.bottominfo&&a(".binfo","#"+r+"_2").show();U=ea=null;a("#"+u.themodal).keydown(function(E){var G=E.target;if(a("#"+q).data("disabled")===true)return false;if(d.savekey[0]===true&&E.which==d.savekey[1])if(G.tagName!="TEXTAREA"){a("#sData","#"+r+"_2").trigger("click");return false}if(E.which===27){if(!h())return false;Ga&&hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:d.onClose});return false}if(d.navkeys[0]===true){if(a("#id_g",
223
+ "#"+r).val()=="_empty")return true;if(E.which==d.navkeys[1]){a("#pData","#"+r+"_2").trigger("click");return false}if(E.which==d.navkeys[2]){a("#nData","#"+r+"_2").trigger("click");return false}}});if(b.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+u.themodal).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+u.themodal).unbind("click").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:d.onClose});return false})}b.saveicon=a.extend([true,
224
+ "left","ui-icon-disk"],b.saveicon);b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.saveicon[0]==true)a("#sData","#"+r+"_2").addClass(b.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.saveicon[2]+"'></span>");if(b.closeicon[0]==true)a("#cData","#"+r+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");if(d.checkOnSubmit||d.checkOnUpdate){za=
225
+ "<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bYes+"</a>";sa="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bNo+"</a>";Ca="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bExit+"</a>";ea=b.zIndex||999;ea++;a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+ea+";display:none;'>&#160;"+
226
+ (a.browser.msie&&a.browser.version==6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"")+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(ea+1)+"'>"+b.saveData+"<br/><br/>"+za+sa+Ca+"</div>").insertAfter("#"+q);a("#sNew","#"+u.themodal).click(function(){k();a("#"+q).data("disabled",false);a(".confirm","#"+u.themodal).hide();return false});a("#nNew","#"+u.themodal).click(function(){a(".confirm",
227
+ "#"+u.themodal).hide();a("#"+q).data("disabled",false);setTimeout(function(){a(":input","#"+q)[0].focus()},0);return false});a("#cNew","#"+u.themodal).click(function(){a(".confirm","#"+u.themodal).hide();a("#"+q).data("disabled",false);hideModal("#"+u.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:d.onClose});return false})}B&&B(a("#"+q));e=="_empty"||!d.viewPagerButtons?a("#pData,#nData","#"+r+"_2").hide():a("#pData,#nData","#"+r+"_2").show();v&&v(a("#"+q));a("#"+u.themodal).data("onClose",d.onClose);
228
+ viewModal("#"+u.themodal,{gbox:"#gbox_"+n,jqm:b.jqModal,closeoverlay:Q,modal:b.modal});Q||a(".jqmOverlay").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:d.onClose});return false});w&&w(a("#"+q));a(".fm-button","#"+u.themodal).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a("#sData","#"+r+"_2").click(function(){x={};N={};a("#FormError","#"+r).hide();j();if(x[m.p.id+"_id"]=="_empty")k();else if(b.checkOnSubmit===
229
+ true){Y=a.extend({},x,N);if(da=o(Y,d._savedData)){a("#"+q).data("disabled",true);a(".confirm","#"+u.themodal).show()}else k()}else k();return false});a("#cData","#"+r+"_2").click(function(){if(!h())return false;hideModal("#"+u.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:d.onClose});return false});a("#nData","#"+r+"_2").click(function(){if(!h())return false;a("#FormError","#"+r).hide();var E=g();E[0]=parseInt(E[0]);if(E[0]!=-1&&E[1][E[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",
230
+ a("#"+q),E[1][E[0]]);l(E[1][E[0]+1],m,q);a(m).jqGrid("setSelection",E[1][E[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",a("#"+q),E[1][E[0]+1]);f(E[0]+1,E[1].length-1)}return false});a("#pData","#"+r+"_2").click(function(){if(!h())return false;a("#FormError","#"+r).hide();var E=g();if(E[0]!=-1&&E[1][E[0]-1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("prev",a("#"+q),E[1][E[0]]);l(E[1][E[0]-1],m,q);a(m).jqGrid("setSelection",E[1][E[0]-1]);a.isFunction(b.afterclickPgButtons)&&
231
+ b.afterclickPgButtons("prev",a("#"+q),E[1][E[0]-1]);f(E[0]-1,E[1].length-1)}return false})}v=g();f(v[0],v[1].length-1)}})},viewGridRow:function(e,b){b=a.extend({top:0,left:0,width:0,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,jqModal:true,closeOnEscape:false,labelswidth:"30%",closeicon:[],navkeys:[false,38,40],onClose:null,beforeShowForm:null,viewPagerButtons:true},a.jgrid.view,b||{});return this.each(function(){function f(){if(b.closeOnEscape===true||b.navkeys[0]===true)setTimeout(function(){a(".ui-jqdialog-titlebar-close",
232
+ "#"+n.modalhead).focus()},0)}function g(x,N){x==0?a("#pData","#"+m+"_2").addClass("ui-state-disabled"):a("#pData","#"+m+"_2").removeClass("ui-state-disabled");x==N?a("#nData","#"+m+"_2").addClass("ui-state-disabled"):a("#nData","#"+m+"_2").removeClass("ui-state-disabled")}function h(){var x=a(l).jqGrid("getDataIDs"),N=a("#id_g","#"+m).val();return[a.inArray(N,x),x]}function j(x,N,Y,da){for(var Q,ea,U,ga=0,sa,za,Ca=[],va=false,Ga="<td class='CaptionTD form-view-label ui-widget-content' width='"+b.labelswidth+
233
+ "'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",E="",G=["integer","number","currency"],V=0,L=0,W,R,S,T=1;T<=da;T++)E+=T==1?Ga:"<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";a(N.p.colModel).each(function(){ea=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false;if(!ea&&this.align==="right")if(this.formatter&&a.inArray(this.formatter,G)!==
234
+ -1)V=Math.max(V,parseInt(this.width,10));else L=Math.max(L,parseInt(this.width,10))});W=V!==0?V:L!==0?L:0;va=a(N).jqGrid("getInd",x);a(N.p.colModel).each(function(K){Q=this.name;R=false;za=(ea=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";S=typeof this.viewable!="boolean"?true:this.viewable;if(Q!=="cb"&&Q!=="subgrid"&&Q!=="rn"&&S){sa=va===false?"":Q==N.p.ExpandColumn&&N.p.treeGrid===true?a("td:eq("+K+")",N.rows[va]).text():a("td:eq("+
235
+ K+")",N.rows[va]).html();R=this.align==="right"&&W!==0?true:false;a.extend({},this.editoptions||{},{id:Q,name:Q});var ba=a.extend({},{rowabove:false,rowcontent:""},this.formoptions||{}),Z=parseInt(ba.rowpos)||ga+1,ka=parseInt((parseInt(ba.colpos)||1)*2);if(ba.rowabove){var aa=a("<tr><td class='contentinfo' colspan='"+da*2+"'>"+ba.rowcontent+"</td></tr>");a(Y).append(aa);aa[0].rp=Z}U=a(Y).find("tr[rowpos="+Z+"]");if(U.length==0){U=a("<tr "+za+" rowpos='"+Z+"'></tr>").addClass("FormData").attr("id",
236
+ "trv_"+Q);a(U).append(E);a(Y).append(U);U[0].rp=Z}a("td:eq("+(ka-2)+")",U[0]).html("<b>"+(typeof ba.label==="undefined"?N.p.colNames[K]:ba.label)+"</b>");a("td:eq("+(ka-1)+")",U[0]).append("<span>"+sa+"</span>").attr("id","v_"+Q);R&&a("td:eq("+(ka-1)+") span",U[0]).css({"text-align":"right",width:W+"px"});Ca[ga]=K;ga++}});if(ga>0){x=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(da*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+
237
+ x+"'/></td></tr>");x[0].rp=ga+99;a(Y).append(x)}return Ca}function c(x,N){var Y,da,Q=0,ea,U;if(U=a(N).jqGrid("getInd",x,true)){a("td",U).each(function(ga){Y=N.p.colModel[ga].name;da=N.p.colModel[ga].editrules&&N.p.colModel[ga].editrules.edithidden===true?false:N.p.colModel[ga].hidden===true?true:false;if(Y!=="cb"&&Y!=="subgrid"&&Y!=="rn"){ea=Y==N.p.ExpandColumn&&N.p.treeGrid===true?a(this).text():a(this).html();a.extend({},N.p.colModel[ga].editoptions||{});Y=a.jgrid.jqID("v_"+Y);a("#"+Y+" span","#"+
238
+ m).html(ea);da&&a("#"+Y,"#"+m).parents("tr:first").hide();Q++}});Q>0&&a("#id_g","#"+m).val(x)}}var l=this;if(l.grid&&e){if(!b.imgpath)b.imgpath=l.p.imgpath;var k=l.p.id,o="ViewGrid_"+k,m="ViewTbl_"+k,n={themodal:"viewmod"+k,modalhead:"viewhd"+k,modalcontent:"viewcnt"+k,scrollelm:o},q=1,r=0;if(a("#"+n.themodal).html()!=null){a(".ui-jqdialog-title","#"+n.modalhead).html(b.caption);a("#FormError","#"+m).hide();c(e,l);a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+o));viewModal("#"+n.themodal,
239
+ {gbox:"#gbox_"+k,jqm:b.jqModal,jqM:false,modal:b.modal});f()}else{a(l.p.colModel).each(function(){var x=this.formoptions;q=Math.max(q,x?x.colpos||0:0);r=Math.max(r,x?x.rowpos||0:0)});var u=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",v=a("<form name='FormPost' id='"+o+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+u+";'></form>"),w=a("<table id='"+m+"' class='EditTable' cellspacing='1' cellpading='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
240
+ a(v).append(w);j(e,l,w,q);u=l.p.direction=="rtl"?true:false;var z="<a href='javascript:void(0)' id='"+(u?"nData":"pData")+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>",B="<a href='javascript:void(0)' id='"+(u?"pData":"nData")+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>",C="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bClose+
241
+ "</a>";if(r>0){var y=[];a.each(a(w)[0].rows,function(x,N){y[x]=N});y.sort(function(x,N){if(x.rp>N.rp)return 1;if(x.rp<N.rp)return-1;return 0});a.each(y,function(x,N){a("tbody",w).append(N)})}b.gbox="#gbox_"+k;var F=false;if(b.closeOnEscape===true){b.closeOnEscape=false;F=true}v=a("<span></span>").append(v).append("<table border='0' class='EditTable' id='"+m+"_2'><tbody><tr id='Act_Buttons'><td class='navButton ui-widget-content' width='"+b.labelswidth+"'>"+(u?B+z:z+B)+"</td><td class='EditButton ui-widget-content'>"+
242
+ C+"</td></tr></tbody></table>");createModal(n,v,b,"#gview_"+l.p.id,a("#gview_"+l.p.id)[0]);if(u){a("#pData, #nData","#"+m+"_2").css("float","right");a(".EditButton","#"+m+"_2").css("text-align","left")}b.viewPagerButtons||a("#pData, #nData","#"+m+"_2").hide();v=null;a("#"+n.themodal).keydown(function(x){if(x.which===27){F&&hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:b.onClose});return false}if(b.navkeys[0]===true){if(x.which===b.navkeys[1]){a("#pData","#"+m+"_2").trigger("click");return false}if(x.which===
243
+ b.navkeys[2]){a("#nData","#"+m+"_2").trigger("click");return false}}});b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.closeicon[0]==true)a("#cData","#"+m+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+o));viewModal("#"+n.themodal,{gbox:"#gbox_"+k,jqm:b.jqModal,modal:b.modal});a(".fm-button:not(.ui-state-disabled)","#"+m+"_2").hover(function(){a(this).addClass("ui-state-hover")},
244
+ function(){a(this).removeClass("ui-state-hover")});f();a("#cData","#"+m+"_2").click(function(){hideModal("#"+n.themodal,{gb:"#gbox_"+k,jqm:b.jqModal,onClose:b.onClose});return false});a("#nData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var x=h();x[0]=parseInt(x[0]);if(x[0]!=-1&&x[1][x[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",a("#"+o),x[1][x[0]]);c(x[1][x[0]+1],l);a(l).jqGrid("setSelection",x[1][x[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",
245
+ a("#"+o),x[1][x[0]+1]);g(x[0]+1,x[1].length-1)}f();return false});a("#pData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var x=h();if(x[0]!=-1&&x[1][x[0]-1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("prev",a("#"+o),x[1][x[0]]);c(x[1][x[0]-1],l);a(l).jqGrid("setSelection",x[1][x[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+o),x[1][x[0]-1]);g(x[0]-1,x[1].length-1)}f();return false})}u=h();g(u[0],u[1].length-1)}})},delGridRow:function(e,b){d=
246
+ b=a.extend({top:0,left:0,width:240,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,url:"",mtype:"POST",reloadAfterSubmit:true,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:true,closeOnEscape:false,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:false,serializeDelData:null},a.jgrid.del,b||{});return this.each(function(){var f=this;if(f.grid)if(e){var g=typeof b.beforeShowForm==="function"?true:false,
247
+ h=typeof b.afterShowForm==="function"?true:false,j=f.p.id,c={},l="DelTbl_"+j,k,o,m,n,q={themodal:"delmod"+j,modalhead:"delhd"+j,modalcontent:"delcnt"+j,scrollelm:l};if(isArray(e))e=e.join();if(a("#"+q.themodal).html()!=null){a("#DelData>td","#"+l).text(e);a("#DelError","#"+l).hide();if(d.processing===true){d.processing=false;a("#dData","#"+l).removeClass("ui-state-active")}g&&b.beforeShowForm(a("#"+l));viewModal("#"+q.themodal,{gbox:"#gbox_"+j,jqm:b.jqModal,jqM:false,modal:b.modal})}else{var r=isNaN(b.dataheight)?
248
+ b.dataheight:b.dataheight+"px";r="<div id='"+l+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+r+";'>";r+="<table class='DelTable'><tbody>";r+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";r+="<tr id='DelData' style='display:none'><td >"+e+"</td></tr>";r+='<tr><td class="delmsg" style="white-space:pre;">'+b.msg+"</td></tr><tr><td >&#160;</td></tr>";r+="</tbody></table></div>";r+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+
249
+ l+"_2'><tbody><tr><td class='DataTD ui-widget-content'></td></tr><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DelButton EditButton'>"+("<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>")+"</td></tr></tbody></table>";b.gbox="#gbox_"+j;createModal(q,r,b,"#gview_"+f.p.id,a("#gview_"+f.p.id)[0]);a(".fm-button",
250
+ "#"+l+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});b.delicon=a.extend([true,"left","ui-icon-scissors"],b.delicon);b.cancelicon=a.extend([true,"left","ui-icon-cancel"],b.cancelicon);if(b.delicon[0]==true)a("#dData","#"+l+"_2").addClass(b.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.delicon[2]+"'></span>");if(b.cancelicon[0]==true)a("#eData","#"+l+"_2").addClass(b.cancelicon[1]=="right"?
251
+ "fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.cancelicon[2]+"'></span>");a("#dData","#"+l+"_2").click(function(){var u=[true,""];c={};var v=a("#DelData>td","#"+l).text();if(typeof b.onclickSubmit==="function")c=b.onclickSubmit(d)||{};if(typeof b.beforeSubmit==="function")u=b.beforeSubmit(v);if(u[0]){var w=d.url?d.url:a(f).jqGrid("getGridParam","editurl");if(!w){u[0]=false;u[1]+=" "+a.jgrid.errors.nourl}}if(u[0]===false){a("#DelError>td","#"+l).html(u[1]);a("#DelError",
252
+ "#"+l).show()}else if(!d.processing){d.processing=true;a(this).addClass("ui-state-active");m=f.p.prmNames;k=a.extend({},d.delData,c);n=m.oper;k[n]=m.deloper;o=m.id;k[o]=v;a.ajax(a.extend({url:w,type:b.mtype,data:a.isFunction(b.serializeDelData)?b.serializeDelData(k):k,complete:function(z,B){if(B!="success"){u[0]=false;u[1]=a.isFunction(d.errorTextFormat)?d.errorTextFormat(z):B+" Status: '"+z.statusText+"'. Error code: "+z.status}else if(typeof d.afterSubmit==="function")u=d.afterSubmit(z,k);if(u[0]===
253
+ false){a("#DelError>td","#"+l).html(u[1]);a("#DelError","#"+l).show()}else{if(d.reloadAfterSubmit)a(f).trigger("reloadGrid");else{B=[];B=v.split(",");if(f.p.treeGrid===true)try{a(f).jqGrid("delTreeNode",B[0])}catch(C){}else for(var y=0;y<B.length;y++)a(f).jqGrid("delRowData",B[y]);f.p.selrow=null;f.p.selarrrow=[]}a.isFunction(d.afterComplete)&&setTimeout(function(){d.afterComplete(z,v)},500)}d.processing=false;a("#dData","#"+l+"_2").removeClass("ui-state-active");u[0]&&hideModal("#"+q.themodal,{gb:"#gbox_"+
254
+ j,jqm:b.jqModal,onClose:d.onClose})},error:function(z,B,C){a("#DelError>td","#"+l).html(B+" : "+C);a("#DelError","#"+l).show();d.processing=false;a("#dData","#"+l+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,b.ajaxDelOptions))}return false});a("#eData","#"+l+"_2").click(function(){hideModal("#"+q.themodal,{gb:"#gbox_"+j,jqm:b.jqModal,onClose:d.onClose});return false});g&&b.beforeShowForm(a("#"+l));viewModal("#"+q.themodal,{gbox:"#gbox_"+j,jqm:b.jqModal,modal:b.modal})}h&&b.afterShowForm(a("#"+
255
+ l));b.closeOnEscape===true&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+q.modalhead).focus()},0)}})},navGrid:function(e,b,f,g,h,j,c){b=a.extend({edit:true,editicon:"ui-icon-pencil",add:true,addicon:"ui-icon-plus",del:true,delicon:"ui-icon-trash",search:true,searchicon:"ui-icon-search",refresh:true,refreshicon:"ui-icon-refresh",refreshstate:"firstpage",view:false,viewicon:"ui-icon-document",position:"left",closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false},a.jgrid.nav,
256
+ b||{});return this.each(function(){var l={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},k=this,o,m,n;if(!(!k.grid||typeof e!="string")){if(a("#"+l.themodal).html()==null){if(typeof window.innerWidth!="undefined"){o=window.innerWidth;m=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){o=document.documentElement.clientWidth;m=document.documentElement.clientHeight}else{o=
257
+ 1024;m=768}createModal(l,"<div>"+b.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+k.p.id,jqModal:true,drag:true,resize:true,caption:b.alertcap,top:m/2-25,left:o/2-100,width:200,height:"auto",closeOnEscape:b.closeOnEscape},"","",true)}o=1;if(b.cloneToTop&&k.p.toppager)o=2;for(m=0;m<o;m++){var q=a("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
258
+ r,u;if(m==0){r=e;u=k.p.id;if(r==k.p.toppager){u+="_top";o=1}}else{r=k.p.toppager;u=k.p.id+"_top"}k.p.direction=="rtl"&&a(q).attr("dir","rtl").css("float","right");if(b.add){g=g||{};n=a("<td class='ui-pg-button ui-corner-all'></td>");a(n).append("<div class='ui-pg-div'><span class='ui-icon "+b.addicon+"'></span>"+b.addtext+"</div>");a("tr",q).append(n);a(n,q).attr({title:b.addtitle||"",id:g.id||"add_"+u}).click(function(){typeof b.addfunc=="function"?b.addfunc():a(k).jqGrid("editGridRow","new",g);
259
+ return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});n=null}if(b.edit){n=a("<td class='ui-pg-button ui-corner-all'></td>");f=f||{};a(n).append("<div class='ui-pg-div'><span class='ui-icon "+b.editicon+"'></span>"+b.edittext+"</div>");a("tr",q).append(n);a(n,q).attr({title:b.edittitle||"",id:f.id||"edit_"+u}).click(function(){var v=k.p.selrow;if(v)typeof b.editfunc=="function"?b.editfunc(v):a(k).jqGrid("editGridRow",v,f);else{viewModal("#"+
260
+ l.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});n=null}if(b.view){n=a("<td class='ui-pg-button ui-corner-all'></td>");c=c||{};a(n).append("<div class='ui-pg-div'><span class='ui-icon "+b.viewicon+"'></span>"+b.viewtext+"</div>");a("tr",q).append(n);a(n,q).attr({title:b.viewtitle||"",id:c.id||"view_"+u}).click(function(){var v=k.p.selrow;if(v)a(k).jqGrid("viewGridRow",
261
+ v,c);else{viewModal("#"+l.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});n=null}if(b.del){n=a("<td class='ui-pg-button ui-corner-all'></td>");h=h||{};a(n).append("<div class='ui-pg-div'><span class='ui-icon "+b.delicon+"'></span>"+b.deltext+"</div>");a("tr",q).append(n);a(n,q).attr({title:b.deltitle||"",id:h.id||"del_"+u}).click(function(){var v;if(k.p.multiselect){v=
262
+ k.p.selarrrow;if(v.length==0)v=null}else v=k.p.selrow;if(v)a(k).jqGrid("delGridRow",v,h);else{viewModal("#"+l.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});n=null}if(b.add||b.edit||b.del||b.view)a("tr",q).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");if(b.search){n=a("<td class='ui-pg-button ui-corner-all'></td>");
263
+ j=j||{};a(n).append("<div class='ui-pg-div'><span class='ui-icon "+b.searchicon+"'></span>"+b.searchtext+"</div>");a("tr",q).append(n);a(n,q).attr({title:b.searchtitle||"",id:j.id||"search_"+u}).click(function(){a(k).jqGrid("searchGrid",j);return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});n=null}if(b.refresh){n=a("<td class='ui-pg-button ui-corner-all'></td>");a(n).append("<div class='ui-pg-div'><span class='ui-icon "+b.refreshicon+
264
+ "'></span>"+b.refreshtext+"</div>");a("tr",q).append(n);a(n,q).attr({title:b.refreshtitle||"",id:"refresh_"+u}).click(function(){a.isFunction(b.beforeRefresh)&&b.beforeRefresh();k.p.search=false;try{a("#fbox_"+k.p.id).searchFilter().reset();k.clearToolbar(false)}catch(v){}switch(b.refreshstate){case "firstpage":a(k).trigger("reloadGrid",[{page:1}]);break;case "current":a(k).trigger("reloadGrid",[{current:true}]);break}a.isFunction(b.afterRefresh)&&b.afterRefresh();return false}).hover(function(){a(this).addClass("ui-state-hover")},
265
+ function(){a(this).removeClass("ui-state-hover")});n=null}n=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+n+";visibility:hidden;' ></div>");n=a(q).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(r+"_"+b.position,r).append(q);if(k.p._nvtd){if(n>k.p._nvtd[0]){a(r+"_"+b.position,r).width(n);k.p._nvtd[0]=n}k.p._nvtd[1]=n}q=n=n=null}}})},navButtonAdd:function(e,b){b=a.extend({caption:"newButton",
266
+ title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!=0)e="#"+e;var f=a(".navtable",e)[0],g=this;if(f){var h=a("<td></td>");a(h).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+b.buttonicon+"'></span>"+b.caption+"</div>");b.id&&a(h).attr("id",b.id);if(b.position=="first")f.rows[0].cells.length===0?a("tr",f).append(h):a("tr td:eq(0)",f).before(h);else a("tr",
267
+ f).append(h);a(h,f).attr("title",b.title||"").click(function(j){a.isFunction(b.onClickButton)&&b.onClickButton.call(g,j);return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).css("cursor",b.cursor?b.cursor:"normal")}}})},navSeparatorAdd:function(e,b){b=a.extend({sepclass:"ui-separator",sepcontent:""},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!=0)e="#"+e;var f=a(".navtable",e)[0];if(f){var g="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+
268
+ b.sepclass+"'></span>"+b.sepcontent+"</td>";a("tr",f).append(g)}}})},GridToForm:function(e,b){return this.each(function(){var f=this;if(f.grid){var g=a(f).jqGrid("getRowData",e);if(g)for(var h in g)a("[name="+h+"]",b).is("input:radio")||a("[name="+h+"]",b).is("input:checkbox")?a("[name="+h+"]",b).each(function(){a(this).val()==g[h]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+h+"]",b).val(g[h])}})},FormToGrid:function(e,b,f,g){return this.each(function(){var h=this;if(h.grid){f||
269
+ (f="set");g||(g="first");var j=a(b).serializeArray(),c={};a.each(j,function(l,k){c[k.name]=k.value});if(f=="add")a(h).jqGrid("addRowData",e,c,g);else f=="set"&&a(h).jqGrid("setRowData",e,c)}})}})})(jQuery);
270
+ (function(a){a.jgrid.extend({jqGridImport:function(d){d=a.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},d||{});return this.each(function(){var e=this,b=function(h,j){var c=a(j.xmlGrid.config,h)[0];j=a(j.xmlGrid.data,h)[0];if(xmlJsonClass.xml2json&&a.jgrid.parse){c=xmlJsonClass.xml2json(c," ");c=a.jgrid.parse(c);for(var l in c)var k=c[l];if(j){l=c.grid.datatype;c.grid.datatype=
271
+ "xmlstring";c.grid.datastr=h;a(e).jqGrid(k).jqGrid("setGridParam",{datatype:l})}else a(e).jqGrid(k)}else alert("xml2json or parse are not present")},f=function(h,j){if(h&&typeof h=="string"){var c=a.jgrid.parse(h);h=c[j.jsonGrid.config];if(j=c[j.jsonGrid.data]){c=h.datatype;h.datatype="jsonstring";h.datastr=j;a(e).jqGrid(h).jqGrid("setGridParam",{datatype:c})}else a(e).jqGrid(h)}};switch(d.imptype){case "xml":a.ajax(a.extend({url:d.impurl,type:d.mtype,data:d.impData,dataType:"xml",complete:function(h,
272
+ j){if(j=="success"){b(h.responseXML,d);a.isFunction(d.importComplete)&&d.importComplete(h)}}},d.ajaxOptions));break;case "xmlstring":if(d.impstring&&typeof d.impstring=="string"){var g=a.jgrid.stringToDoc(d.impstring);if(g){b(g,d);a.isFunction(d.importComplete)&&d.importComplete(g);d.impstring=null}g=null}break;case "json":a.ajax(a.extend({url:d.impurl,type:d.mtype,data:d.impData,dataType:"json",complete:function(h,j){if(j=="success"){f(h.responseText,d);a.isFunction(d.importComplete)&&d.importComplete(h)}}},
273
+ d.ajaxOptions));break;case "jsonstring":if(d.impstring&&typeof d.impstring=="string"){f(d.impstring,d);a.isFunction(d.importComplete)&&d.importComplete(d.impstring);d.impstring=null}break}})},jqGridExport:function(d){d=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},d||{});var e=null;this.each(function(){if(this.grid){var b=a.extend({},a(this).jqGrid("getGridParam"));if(b.rownumbers){b.colNames.splice(0,1);b.colModel.splice(0,1)}if(b.multiselect){b.colNames.splice(0,1);b.colModel.splice(0,1)}if(b.subgrid){b.colNames.splice(0,
274
+ 1);b.colModel.splice(0,1)}if(b.treeGrid)for(var f in b.treeReader){b.colNames.splice(b.colNames.length-1);b.colModel.splice(b.colModel.length-1)}switch(d.exptype){case "xmlstring":e="<"+d.root+">"+xmlJsonClass.json2xml(b,d.ident)+"</"+d.root+">";break;case "jsonstring":e="{"+xmlJsonClass.toJson(b,d.root,d.ident)+"}";break}}});return e},excelExport:function(d){d=a.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},d||{});return this.each(function(){$t=this;if(this.grid)if(d.exptype==
275
+ "remote"){var e=a.extend({},this.p.postData);e[d.oper]=d.tag;e=jQuery.param(e);window.location=d.url+"?"+e}})}})})(jQuery);
276
+ (function(a){a.jgrid.extend({editRow:function(d,e,b,f,g,h,j,c,l){return this.each(function(){var k=this,o,m,n=0,q=null,r={},u,v;if(k.grid){u=a(k).jqGrid("getInd",d,true);if(u!=false)if((a(u).attr("editable")||"0")=="0"&&!a(u).hasClass("not-editable-row")){v=k.p.colModel;a("td",u).each(function(w){o=v[w].name;var z=k.p.treeGrid===true&&o==k.p.ExpandColumn;if(z)m=a("span:first",this).html();else try{m=a.unformat(this,{rowId:d,colModel:v[w]},w)}catch(B){m=a(this).html()}if(o!="cb"&&o!="subgrid"&&o!=
277
+ "rn"){if(k.p.autoencode)m=a.jgrid.htmlDecode(m);r[o]=m;if(v[w].editable===true){if(q===null)q=w;z?a("span:first",this).html(""):a(this).html("");var C=a.extend({},v[w].editoptions||{},{id:d+"_"+o,name:o});if(!v[w].edittype)v[w].edittype="text";C=createEl(v[w].edittype,C,m,true,a.extend({},a.jgrid.ajaxOptions,k.p.ajaxSelectOptions||{}));a(C).addClass("editable");z?a("span:first",this).append(C):a(this).append(C);v[w].edittype=="select"&&v[w].editoptions.multiple===true&&a.browser.msie&&a(C).width(a(C).width());
278
+ n++}}});if(n>0){r.id=d;k.p.savedRow.push(r);a(u).attr("editable","1");a("td:eq("+q+") input",u).focus();e===true&&a(u).bind("keydown",function(w){w.keyCode===27&&a(k).jqGrid("restoreRow",d,l);if(w.keyCode===13){if(w.target.tagName=="TEXTAREA")return true;a(k).jqGrid("saveRow",d,f,g,h,j,c,l);return false}w.stopPropagation()});a.isFunction(b)&&b(d)}}}})},saveRow:function(d,e,b,f,g,h,j){return this.each(function(){var c=this,l,k={},o={},m,n,q,r;if(c.grid){r=a(c).jqGrid("getInd",d,true);if(r!=false){m=
279
+ a(r).attr("editable");b=b?b:c.p.editurl;if(m==="1"&&b){var u;a("td",r).each(function(B){u=c.p.colModel[B];l=u.name;if(l!="cb"&&l!="subgrid"&&u.editable===true&&l!="rn"){switch(u.edittype){case "checkbox":var C=["Yes","No"];if(u.editoptions)C=u.editoptions.value.split(":");k[l]=a("input",this).attr("checked")?C[0]:C[1];break;case "text":case "password":case "textarea":case "button":k[l]=a("input, textarea",this).val();break;case "select":if(u.editoptions.multiple){C=a("select",this);var y=[];k[l]=
280
+ a(C).val();k[l]=k[l]?k[l].join(","):"";a("select > option:selected",this).each(function(x,N){y[x]=a(N).text()});o[l]=y.join(",")}else{k[l]=a("select>option:selected",this).val();o[l]=a("select>option:selected",this).text()}if(u.formatter&&u.formatter=="select")o={};break;case "custom":try{if(u.editoptions&&a.isFunction(u.editoptions.custom_value)){k[l]=u.editoptions.custom_value(a(".customelement",this),"get");if(k[l]===undefined)throw"e2";}else throw"e1";}catch(F){F=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,
281
+ "function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);F=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,F.message,jQuery.jgrid.edit.bClose)}break}q=checkValues(k[l],B,c);if(q[0]===false){q[1]=k[l]+" "+q[1];return false}if(c.p.autoencode)k[l]=a.jgrid.htmlEncode(k[l])}});if(q[0]===false)try{var v=findPos(a("#"+d)[0]);info_dialog(a.jgrid.errors.errcap,q[1],a.jgrid.edit.bClose,
282
+ {left:v[0],top:v[1]})}catch(w){alert(q[1])}else{if(k){var z;v=c.p.prmNames;z=v.oper;m=v.id;k[z]=v.editoper;k[m]=d;if(f)k=a.extend({},k,f)}if(b=="clientArray"){k=a.extend({},k,o);c.p.autoencode&&a.each(k,function(B,C){k[B]=a.jgrid.htmlDecode(C)});m=a(c).jqGrid("setRowData",d,k);a(r).attr("editable","0");for(v=0;v<c.p.savedRow.length;v++)if(c.p.savedRow[v].id==d){n=v;break}n>=0&&c.p.savedRow.splice(n,1);a.isFunction(g)&&g(d,m)}else{a("#lui_"+c.p.id).show();a.ajax(a.extend({url:b,data:a.isFunction(c.p.serializeRowData)?
283
+ c.p.serializeRowData(k):k,type:"POST",complete:function(B,C){a("#lui_"+c.p.id).hide();if(C==="success")if((a.isFunction(e)?e(B):true)===true){c.p.autoencode&&a.each(k,function(y,F){k[y]=a.jgrid.htmlDecode(F)});k=a.extend({},k,o);a(c).jqGrid("setRowData",d,k);a(r).attr("editable","0");for(C=0;C<c.p.savedRow.length;C++)if(c.p.savedRow[C].id==d){n=C;break}n>=0&&c.p.savedRow.splice(n,1);a.isFunction(g)&&g(d,B)}else a(c).jqGrid("restoreRow",d,j)},error:function(B,C){a("#lui_"+c.p.id).hide();a.isFunction(h)?
284
+ h(d,B,C):alert("Error Row: "+d+" Result: "+B.status+":"+B.statusText+" Status: "+C)}},a.jgrid.ajaxOptions,c.p.ajaxRowOptions||{}))}a(r).unbind("keydown")}}}}})},restoreRow:function(d,e){return this.each(function(){var b=this,f,g,h={};if(b.grid){g=a(b).jqGrid("getInd",d,true);if(g!=false){for(var j=0;j<b.p.savedRow.length;j++)if(b.p.savedRow[j].id==d){f=j;break}if(f>=0){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+g.id).datepicker("hide")}catch(c){}a.each(b.p.colModel,function(){if(this.editable==
285
+ true&&this.name in b.p.savedRow[f])h[this.name]=b.p.savedRow[f][this.name]});a(b).jqGrid("setRowData",d,h);a(g).attr("editable","0").unbind("keydown");b.p.savedRow.splice(f,1)}a.isFunction(e)&&e(d)}}})}})})(jQuery);
286
+ (function(a){if(a.browser.msie&&a.browser.version==8)a.expr[":"].hidden=function(e){return e.offsetWidth===0||e.offsetHeight===0||e.style.display=="none"};if(a.ui&&a.ui.multiselect&&a.ui.multiselect.prototype._setSelected){var d=a.ui.multiselect.prototype._setSelected;a.ui.multiselect.prototype._setSelected=function(e,b){e=d.call(this,e,b);if(b&&this.selectedList){var f=this.element;this.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(f)})}return e}}a.jgrid.extend({sortableColumns:function(e){return this.each(function(){function b(){f.p.disableClick=
287
+ true}var f=this,g={tolerance:"pointer",axis:"x",items:">th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)",placeholder:{element:function(j){return a(document.createElement(j[0].nodeName)).addClass(j[0].className+" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(j,c){c.height(j.currentItem.innerHeight()-parseInt(j.currentItem.css("paddingTop")||0,10)-parseInt(j.currentItem.css("paddingBottom")||0,10));c.width(j.currentItem.innerWidth()-parseInt(j.currentItem.css("paddingLeft")||
288
+ 0,10)-parseInt(j.currentItem.css("paddingRight")||0,10))}},update:function(j,c){j=a(c.item).parent();j=a(">th",j);var l={};a.each(f.p.colModel,function(o){l[this.name]=o});var k=[];j.each(function(){var o=a(">div",this).get(0).id.replace(/^jqgh_/,"");o in l&&k.push(l[o])});a(f).jqGrid("remapColumns",k,true,true);a.isFunction(f.p.sortable.update)&&f.p.sortable.update(k);setTimeout(function(){f.p.disableClick=false},50)}};if(f.p.sortable.options)a.extend(g,f.p.sortable.options);else if(a.isFunction(f.p.sortable))f.p.sortable=
289
+ {update:f.p.sortable};if(g.start){var h=g.start;g.start=function(j,c){b();h.call(this,j,c)}}else g.start=b;if(f.p.sortable.exclude)g.items+=":not("+f.p.sortable.exclude+")";e.sortable(g).data("sortable").floating=true})},columnChooser:function(e){function b(n,q,r){if(q>=0){var u=n.slice(),v=u.splice(q);if(q>n.length)q=n.length;u[q]=r;return u.concat(v)}}function f(n,q){if(n)if(typeof n=="string")a.fn[n]&&a.fn[n].apply(q,a.makeArray(arguments).slice(2));else a.isFunction(n)&&n.apply(q,a.makeArray(arguments).slice(2))}
290
+ var g=this;if(!a("#colchooser_"+g[0].p.id).length){var h=a('<div id="colchooser_'+g[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),j=a("select",h);e=a.extend({width:420,height:240,classname:null,done:function(n){n&&g.jqGrid("remapColumns",n,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(n){var q={};q[n.bSubmit]=function(){n.apply_perm();n.cleanup(false)};q[n.bCancel]=function(){n.cleanup(true)};return{buttons:q,close:function(){n.cleanup(true)},
291
+ modal:false,resizable:false,width:n.width+20}},apply_perm:function(){a("option",j).each(function(){this.selected?g.jqGrid("showCol",c[this.value].name):g.jqGrid("hideCol",c[this.value].name)});var n=[];a("option[selected]",j).each(function(){n.push(parseInt(this.value))});a.each(n,function(){delete k[c[parseInt(this)].name]});a.each(k,function(){var q=parseInt(this);n=b(n,q,q)});e.done&&e.done.call(g,n)},cleanup:function(n){f(e.dlog,h,"destroy");f(e.msel,j,"destroy");h.remove();n&&e.done&&e.done.call(g)},
292
+ msel_opts:{}},a.jgrid.col,e||{});e.caption&&h.attr("title",e.caption);if(e.classname){h.addClass(classname);j.addClass(classname)}if(e.width){a(">div",h).css({width:e.width,margin:"0 auto"});j.css("width",e.width)}if(e.height){a(">div",h).css("height",e.height);j.css("height",e.height-10)}var c=g.jqGrid("getGridParam","colModel"),l=g.jqGrid("getGridParam","colNames"),k={},o=[];j.empty();a.each(c,function(n){k[this.name]=n;if(this.hidedlg)this.hidden||o.push(n);else j.append("<option value='"+n+"' "+
293
+ (this.hidden?"":"selected='selected'")+">"+l[n]+"</option>")});var m=a.isFunction(e.dlog_opts)?e.dlog_opts.call(g,e):e.dlog_opts;f(e.dlog,h,m);m=a.isFunction(e.msel_opts)?e.msel_opts.call(g,e):e.msel_opts;f(e.msel,j,m)}},sortableRows:function(e){return this.each(function(){var b=this;if(b.grid)if(!b.p.treeGrid)if(a.fn.sortable){e=a.extend({cursor:"move",axis:"y",items:".jqgrow"},e||{});if(e.start&&a.isFunction(e.start)){e._start_=e.start;delete e.start}else e._start_=false;if(e.update&&a.isFunction(e.update)){e._update_=
294
+ e.update;delete e.update}else e._update_=false;e.start=function(f,g){a(g.item).css("border-width","0px");a("td",g.item).each(function(c){this.style.width=b.grid.cols[c].style.width});if(b.p.subGrid){var h=a(g.item).attr("id");try{a(b).jqGrid("collapseSubGridRow",h)}catch(j){}}e._start_&&e._start_.apply(this,[f,g])};e.update=function(f,g){a(g.item).css("border-width","");b.updateColumns();b.p.rownumbers===true&&a("td.jqgrid-rownum",b.rows).each(function(h){a(this).html(h+1)});e._update_&&e._update_.apply(this,
295
+ [f,g])};a("tbody:first",b).sortable(e)}})},gridDnD:function(e){return this.each(function(){function b(){var h=a.data(f,"dnd");a("tr.jqgrow:not(.ui-draggable)",f).draggable(a.isFunction(h.drag)?h.drag.call(a(f),h):h.drag)}var f=this;if(f.grid)if(!f.p.treeGrid)if(a.fn.draggable&&a.fn.droppable){a("#jqgrid_dnd").html()==null&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof e=="string"&&e=="updateDnD"&&f.p.jqgdnd==true)b();else{e=a.extend({drag:function(h){return a.extend({start:function(j,
296
+ c){if(f.p.subGrid){var l=a(c.helper).attr("id");try{a(f).jqGrid("collapseSubGridRow",l)}catch(k){}}for(l=0;l<a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(f,"dnd").connectWith[l]).jqGrid("addRowData","jqg_empty_row",{});c.helper.addClass("ui-state-highlight");a("td",c.helper).each(function(o){this.style.width=f.grid.headers[o].width+"px"});h.onstart&&a.isFunction(h.onstart)&&h.onstart.call(a(f),j,c)},stop:function(j,c){if(c.helper.dropped){var l=
297
+ a(c.helper).attr("id");a(f).jqGrid("delRowData",l)}for(l=0;l<a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("delRowData","jqg_empty_row");h.onstop&&a.isFunction(h.onstop)&&h.onstop.call(a(f),j,c)}},h.drag_opts||{})},drop:function(h){return a.extend({accept:function(j){var c=a(j).closest("table.ui-jqgrid-btable");if(a.data(c[0],"dnd")!=undefined){j=a.data(c[0],"dnd").connectWith;return a.inArray("#"+this.id,j)!=-1?true:false}return j},drop:function(j,c){var l=a(c.draggable).attr("id");
298
+ l=a("#"+f.id).jqGrid("getRowData",l);if(!h.dropbyname){var k=0,o={},m,n=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(key in l){if(n[k]){m=n[k].name;o[m]=l[key]}k++}l=o}catch(q){}}c.helper.dropped=true;if(h.beforedrop&&a.isFunction(h.beforedrop)){m=h.beforedrop.call(this,j,c,l,a("#"+f.id),a(this));if(typeof m!="undefined"&&m!==null&&typeof m=="object")l=m}if(c.helper.dropped){var r;if(h.autoid)if(a.isFunction(h.autoid))r=h.autoid.call(this,l);else{r=Math.ceil(Math.random()*1E3);r=h.autoidprefix+
299
+ r}a("#"+this.id).jqGrid("addRowData",r,l,h.droppos)}h.ondrop&&a.isFunction(h.ondrop)&&h.ondrop.call(this,j,c,l)}},h.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",hoverClass:"ui-state-hover"},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},e||{});if(e.connectWith){e.connectWith=e.connectWith.split(",");e.connectWith=a.map(e.connectWith,
300
+ function(h){return a.trim(h)});a.data(f,"dnd",e);f.p.reccount!="0"&&!f.p.jqgdnd&&b();f.p.jqgdnd=true;for(var g=0;g<e.connectWith.length;g++)a(e.connectWith[g]).droppable(a.isFunction(e.drop)?e.drop.call(a(f),e):e.drop)}}}})},gridResize:function(e){return this.each(function(){var b=this;if(b.grid&&a.fn.resizable){e=a.extend({},e||{});if(e.alsoResize){e._alsoResize_=e.alsoResize;delete e.alsoResize}else e._alsoResize_=false;if(e.stop&&a.isFunction(e.stop)){e._stop_=e.stop;delete e.stop}else e._stop_=
301
+ false;e.stop=function(f,g){a(b).jqGrid("setGridParam",{height:a("#gview_"+b.p.id+" .ui-jqgrid-bdiv").height()});a(b).jqGrid("setGridWidth",g.size.width,e.shrinkToFit);e._stop_&&e._stop_.call(b,f,g)};e.alsoResize=e._alsoResize_?eval("("+("{'#gview_"+b.p.id+" .ui-jqgrid-bdiv':true,'"+e._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+b.p.id);delete e._alsoResize_;a("#gbox_"+b.p.id).resizable(e)}})}})})(jQuery);
302
+ (function(a){a.jgrid.extend({getPostData:function(){var d=this[0];if(d.grid)return d.p.postData},setPostData:function(d){var e=this[0];if(e.grid)if(typeof d==="object")e.p.postData=d;else alert("Error: cannot add a non-object postData value. postData unchanged.")},appendPostData:function(d){var e=this[0];if(e.grid)typeof d==="object"?a.extend(e.p.postData,d):alert("Error: cannot append a non-object postData value. postData unchanged.")},setPostDataItem:function(d,e){var b=this[0];if(b.grid)b.p.postData[d]=
303
+ e},getPostDataItem:function(d){var e=this[0];if(e.grid)return e.p.postData[d]},removePostDataItem:function(d){var e=this[0];e.grid&&delete e.p.postData[d]},getUserData:function(){var d=this[0];if(d.grid)return d.p.userData},getUserDataItem:function(d){var e=this[0];if(e.grid)return e.p.userData[d]}})})(jQuery);
304
+ (function(a){a.jgrid.extend({setColumns:function(d){d=a.extend({top:0,left:0,width:200,height:"auto",dataheight:"auto",modal:false,drag:true,beforeShowForm:null,afterShowForm:null,afterSubmitForm:null,closeOnEscape:true,ShrinkToFit:false,jqModal:false,saveicon:[true,"left","ui-icon-disk"],closeicon:[true,"left","ui-icon-close"],onClose:null,colnameview:true,closeAfterSubmit:true,updateAfterCheck:false,recreateForm:false},a.jgrid.col,d||{});return this.each(function(){var e=this;if(e.grid){var b=typeof d.beforeShowForm===
305
+ "function"?true:false,f=typeof d.afterShowForm==="function"?true:false,g=typeof d.afterSubmitForm==="function"?true:false,h=e.p.id,j="ColTbl_"+h,c={themodal:"colmod"+h,modalhead:"colhd"+h,modalcontent:"colcnt"+h,scrollelm:j};d.recreateForm===true&&a("#"+c.themodal).html()!=null&&a("#"+c.themodal).remove();if(a("#"+c.themodal).html()!=null){b&&d.beforeShowForm(a("#"+j));viewModal("#"+c.themodal,{gbox:"#gbox_"+h,jqm:d.jqModal,jqM:false,modal:d.modal})}else{var l=isNaN(d.dataheight)?d.dataheight:d.dataheight+
306
+ "px";l="<div id='"+j+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+l+";'>";l+="<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";for(i=0;i<this.p.colNames.length;i++)e.p.colModel[i].hidedlg||(l+="<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_"+this.p.colModel[i].name+"' class='cbox' value='T' "+(this.p.colModel[i].hidden===false?"checked":"")+"/><label for='col_"+this.p.colModel[i].name+"'>"+this.p.colNames[i]+
307
+ (d.colnameview?" ("+this.p.colModel[i].name+")":"")+"</label></td></tr>");l+="</tbody></table></div>";l+="<table border='0' class='EditTable' id='"+j+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+(!d.updateAfterCheck?"<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+d.bSubmit+"</a>":"")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+
308
+ d.bCancel+"</a>")+"</td></tr></tbody></table>";d.gbox="#gbox_"+h;createModal(c,l,d,"#gview_"+e.p.id,a("#gview_"+e.p.id)[0]);if(d.saveicon[0]==true)a("#dData","#"+j+"_2").addClass(d.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.saveicon[2]+"'></span>");if(d.closeicon[0]==true)a("#eData","#"+j+"_2").addClass(d.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.closeicon[2]+"'></span>");d.updateAfterCheck?
309
+ a(":input","#"+j).click(function(){var k=this.id.substr(4);if(k){this.checked?a(e).jqGrid("showCol",k):a(e).jqGrid("hideCol",k);d.ShrinkToFit===true&&a(e).jqGrid("setGridWidth",e.grid.width-0.0010,true)}return this}):a("#dData","#"+j+"_2").click(function(){for(i=0;i<e.p.colModel.length;i++)if(!e.p.colModel[i].hidedlg){var k=e.p.colModel[i].name.replace(".","\\.");if(a("#col_"+k,"#"+j).attr("checked")){a(e).jqGrid("showCol",e.p.colModel[i].name);a("#col_"+k,"#"+j).attr("defaultChecked",true)}else{a(e).jqGrid("hideCol",
310
+ e.p.colModel[i].name);a("#col_"+k,"#"+j).attr("defaultChecked","")}}d.ShrinkToFit===true&&a(e).jqGrid("setGridWidth",e.grid.width-0.0010,true);d.closeAfterSubmit&&hideModal("#"+c.themodal,{gb:"#gbox_"+h,jqm:d.jqModal,onClose:d.onClose});g&&d.afterSubmitForm(a("#"+j));return false});a("#eData","#"+j+"_2").click(function(){hideModal("#"+c.themodal,{gb:"#gbox_"+h,jqm:d.jqModal,onClose:d.onClose});return false});a("#dData, #eData","#"+j+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
311
+ b&&d.beforeShowForm(a("#"+j));viewModal("#"+c.themodal,{gbox:"#gbox_"+h,jqm:d.jqModal,jqM:true,modal:d.modal})}f&&d.afterShowForm(a("#"+j))}})}})})(jQuery);
312
+ (function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var d=this;d.p.colNames.unshift("");d.p.colModel.unshift({name:"subgrid",width:a.browser.safari?d.p.subGridWidth+d.p.cellLayout:d.p.subGridWidth,sortable:false,resizable:false,hidedlg:true,search:false,fixed:true});d=d.p.subGridModel;if(d[0]){d[0].align=a.extend([],d[0].align||[]);for(i=0;i<d[0].name.length;i++)d[0].align[i]=d[0].align[i]||"left"}})},addSubGridCell:function(d,e){var b="",f;this.each(function(){b=this.formatCol(d,
313
+ e);f=this.p.gridview});return f===false?"<td role='grid' class='ui-sgcollapsed sgcollapsed' "+b+"><a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a></td>":"<td role='grid' "+b+"></td>"},addSubGrid:function(d,e){return this.each(function(){var b=this;if(b.grid){var f,g,h,j,c,l,k;a("td:eq("+e+")",d).click(function(){if(a(this).hasClass("sgcollapsed")){h=b.p.id;f=a(this).parent();j=e>=1?"<td colspan='"+e+"'>&#160;</td>":"";g=a(f).attr("id");k=true;if(a.isFunction(b.p.subGridBeforeExpand))k=
314
+ b.p.subGridBeforeExpand(h+"_"+g,g);if(k===false)return false;c=0;a.each(b.p.colModel,function(){if(this.hidden===true||this.name=="rn"||this.name=="cb")c++});l="<tr role='row' class='ui-subgrid'>"+j+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon ui-icon-carat-1-sw'/></td><td colspan='"+parseInt(b.p.colNames.length-1-c)+"' class='ui-widget-content subgrid-data'><div id="+h+"_"+g+" class='tablediv'>";a(this).parent().after(l+"</div></td></tr>");a.isFunction(b.p.subGridRowExpanded)?
315
+ b.p.subGridRowExpanded(h+"_"+g,g):o(f);a(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-minus'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded")}else if(a(this).hasClass("sgexpanded")){k=true;if(a.isFunction(b.p.subGridRowColapsed)){f=a(this).parent();g=a(f).attr("id");k=b.p.subGridRowColapsed(h+"_"+g,g)}if(k===false)return false;a(this).parent().next().remove(".ui-subgrid");a(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}return false});
316
+ var o=function(r){var u,v,w,z;u=a(r).attr("id");v={nd_:(new Date).getTime()};v[b.p.idName]=u;if(!b.p.subGridModel[0])return false;if(b.p.subGridModel[0].params)for(z=0;z<b.p.subGridModel[0].params.length;z++)for(w=0;w<b.p.colModel.length;w++)if(b.p.colModel[w].name==b.p.subGridModel[0].params[z])v[b.p.colModel[w].name]=a("td:eq("+w+")",r).text().replace(/\&#160\;/ig,"");if(!b.grid.hDiv.loading){b.grid.hDiv.loading=true;a("#load_"+b.p.id).show();if(!b.p.subgridtype)b.p.subgridtype=b.p.datatype;if(a.isFunction(b.p.subgridtype))b.p.subgridtype(v);
317
+ else b.p.subgridtype=b.p.subgridtype.toLowerCase();switch(b.p.subgridtype){case "xml":case "json":a.ajax(a.extend({type:b.p.mtype,url:b.p.subGridUrl,dataType:b.p.subgridtype,data:a.isFunction(b.p.serializeSubGridData)?b.p.serializeSubGridData(v):v,complete:function(B){b.p.subgridtype=="xml"?n(B.responseXML,u):q(a.jgrid.parse(B.responseText),u)}},a.jgrid.ajaxOptions,b.p.ajaxSubgridOptions||{}));break}}return false},m=function(r,u,v){u=a("<td align='"+b.p.subGridModel[0].align[v]+"'></td>").html(u);
318
+ a(r).append(u)},n=function(r,u){var v,w,z,B=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),C=a("<tr></tr>");for(w=0;w<b.p.subGridModel[0].name.length;w++){v=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+b.p.direction+"'></th>");a(v).html(b.p.subGridModel[0].name[w]);a(v).width(b.p.subGridModel[0].width[w]);a(C).append(v)}a(B).append(C);if(r){z=b.p.xmlReader.subgrid;a(z.root+" "+z.row,r).each(function(){C=a("<tr class='ui-widget-content ui-subtblcell'></tr>");
319
+ if(z.repeatitems===true)a(z.cell,this).each(function(F){m(C,a(this).text()||"&#160;",F)});else{var y=b.p.subGridModel[0].mapping||b.p.subGridModel[0].name;if(y)for(w=0;w<y.length;w++)m(C,a(y[w],this).text()||"&#160;",w)}a(B).append(C)})}r=a("table:first",b.grid.bDiv).attr("id")+"_";a("#"+r+u).append(B);b.grid.hDiv.loading=false;a("#load_"+b.p.id).hide();return false},q=function(r,u){var v,w,z,B=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),C=a("<tr></tr>");for(w=0;w<
320
+ b.p.subGridModel[0].name.length;w++){v=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+b.p.direction+"'></th>");a(v).html(b.p.subGridModel[0].name[w]);a(v).width(b.p.subGridModel[0].width[w]);a(C).append(v)}a(B).append(C);if(r){v=b.p.jsonReader.subgrid;r=r[v.root];if(typeof r!=="undefined")for(w=0;w<r.length;w++){z=r[w];C=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(v.repeatitems===true){if(v.cell)z=z[v.cell];for(var y=0;y<z.length;y++)m(C,z[y]||"&#160;",y)}else{var F=
321
+ b.p.subGridModel[0].mapping||b.p.subGridModel[0].name;if(F.length)for(y=0;y<F.length;y++)m(C,z[F[y]]||"&#160;",y)}a(B).append(C)}}w=a("table:first",b.grid.bDiv).attr("id")+"_";a("#"+w+u).append(B);b.grid.hDiv.loading=false;a("#load_"+b.p.id).hide();return false};b.subGridXml=function(r,u){n(r,u)};b.subGridJson=function(r,u){q(r,u)}}})},expandSubGridRow:function(d){return this.each(function(){var e=this;if(e.grid||d)if(e.p.subGrid===true)if(e=a(this).jqGrid("getInd",d,true))(e=a("td.sgcollapsed",e)[0])&&
322
+ a(e).trigger("click")})},collapseSubGridRow:function(d){return this.each(function(){var e=this;if(e.grid||d)if(e.p.subGrid===true)if(e=a(this).jqGrid("getInd",d,true))(e=a("td.sgexpanded",e)[0])&&a(e).trigger("click")})},toggleSubGridRow:function(d){return this.each(function(){var e=this;if(e.grid||d)if(e.p.subGrid===true)if(e=a(this).jqGrid("getInd",d,true)){var b=a("td.sgcollapsed",e)[0];if(b)a(b).trigger("click");else(b=a("td.sgexpanded",e)[0])&&a(b).trigger("click")}})}})})(jQuery);
323
+ function tableToGrid(a,d){jQuery(a).each(function(){if(!this.grid){jQuery(this).width("99%");var e=jQuery(this).width(),b=jQuery("input[type=checkbox]:first",jQuery(this)),f=jQuery("input[type=radio]:first",jQuery(this)),g=b.length>0,h=!g&&f.length>0,j=g||h;b=b.attr("name")||f.attr("name");var c=[],l=[];jQuery("th",jQuery(this)).each(function(){if(c.length==0&&j){c.push({name:"__selection__",index:"__selection__",width:0,hidden:true});l.push("__selection__")}else{c.push({name:jQuery(this).attr("id")||
324
+ jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),index:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),width:jQuery(this).width()||150});l.push(jQuery(this).html())}});var k=[],o=[],m=[];jQuery("tbody > tr",jQuery(this)).each(function(){var n={},q=0;jQuery("td",jQuery(this)).each(function(){if(q==0&&j){var r=jQuery("input",jQuery(this)),u=r.attr("value");o.push(u||k.length);r.attr("checked")&&m.push(u);n[c[q].name]=
325
+ r.attr("value")}else n[c[q].name]=jQuery(this).html();q++});q>0&&k.push(n)});jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid($.extend({datatype:"local",width:e,colNames:l,colModel:c,multiselect:g},d||{}));for(e=0;e<k.length;e++){g=null;if(o.length>0)if((g=o[e])&&g.replace)g=encodeURIComponent(g).replace(/[.\-%]/g,"_");if(g==null)g=e+1;jQuery(this).jqGrid("addRowData",g,k[e])}for(e=0;e<m.length;e++)jQuery(this).jqGrid("setSelection",m[e])}})}
326
+ (function(a){a.jgrid.extend({setTreeNode:function(d,e){return this.each(function(){var b=this;if(b.grid&&b.p.treeGrid){var f=b.p.expColInd,g=b.p.treeReader.expanded_field,h=b.p.treeReader.leaf_field,j=b.p.treeReader.level_field;e.level=d[j];if(b.p.treeGridModel=="nested"){e.lft=d[b.p.treeReader.left_field];e.rgt=d[b.p.treeReader.right_field];d[h]||(d[h]=parseInt(e.rgt,10)===parseInt(e.lft,10)+1?"true":"false")}else e.parent_id=d[b.p.treeReader.parent_id_field];var c=parseInt(e.level,10),l;if(b.p.tree_root_level===
327
+ 0){l=c+1;c=c}else{l=c;c=c-1}l="<div class='tree-wrap tree-wrap-"+b.p.direction+"' style='width:"+l*18+"px;'>";l+="<div style='"+(b.p.direction=="rtl"?"right:":"left:")+c*18+"px;' class='ui-icon ";if(d[h]=="true"||d[h]==true){l+=b.p.treeIcons.leaf+" tree-leaf'";e.isLeaf=true}else{if(d[g]=="true"||d[g]==true){l+=b.p.treeIcons.minus+" tree-minus treeclick'";e.expanded=true}else{l+=b.p.treeIcons.plus+" tree-plus treeclick'";e.expanded=false}e.isLeaf=false}l+="</div></div>";if(parseInt(d[j],10)!==parseInt(b.p.tree_root_level,
328
+ 10))a(b).jqGrid("isVisibleNode",e)||a(e).css("display","none");a("td:eq("+f+")",e).wrapInner("<span></span>").prepend(l);a(".treeclick",e).bind("click",function(k){k=a(k.target||k.srcElement,b.rows).parents("tr.jqgrow")[0].rowIndex;if(!b.rows[k].isLeaf)if(b.rows[k].expanded){a(b).jqGrid("collapseRow",b.rows[k]);a(b).jqGrid("collapseNode",b.rows[k])}else{a(b).jqGrid("expandRow",b.rows[k]);a(b).jqGrid("expandNode",b.rows[k])}return false});b.p.ExpandColClick===true&&a("span",e).css("cursor","pointer").bind("click",
329
+ function(k){k=a(k.target||k.srcElement,b.rows).parents("tr.jqgrow")[0].rowIndex;if(!b.rows[k].isLeaf)if(b.rows[k].expanded){a(b).jqGrid("collapseRow",b.rows[k]);a(b).jqGrid("collapseNode",b.rows[k])}else{a(b).jqGrid("expandRow",b.rows[k]);a(b).jqGrid("expandNode",b.rows[k])}a(b).jqGrid("setSelection",b.rows[k].id);return false})}})},setTreeGrid:function(){return this.each(function(){var d=this,e=0;if(d.p.treeGrid){d.p.treedatatype||a.extend(d.p,{treedatatype:d.p.datatype});d.p.subGrid=false;d.p.altRows=
330
+ false;d.p.pgbuttons=false;d.p.pginput=false;d.p.multiselect=false;d.p.rowList=[];d.p.treeIcons=a.extend({plus:"ui-icon-triangle-1-"+(d.p.direction=="rtl"?"w":"e"),minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off"},d.p.treeIcons||{});if(d.p.treeGridModel=="nested")d.p.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded"},d.p.treeReader);else if(d.p.treeGridModel=="adjacency")d.p.treeReader=a.extend({level_field:"level",parent_id_field:"parent",
331
+ leaf_field:"isLeaf",expanded_field:"expanded"},d.p.treeReader);for(var b in d.p.colModel){if(d.p.colModel[b].name==d.p.ExpandColumn){d.p.expColInd=e;break}e++}if(!d.p.expColInd)d.p.expColInd=0;a.each(d.p.treeReader,function(f,g){if(g){d.p.colNames.push(g);d.p.colModel.push({name:g,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})}})},expandRow:function(d){this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var b=a(e).jqGrid("getNodeChildren",d);a(b).each(function(){a(this).css("display",
332
+ "");this.expanded&&a(e).jqGrid("expandRow",this)})}})},collapseRow:function(d){this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var b=a(e).jqGrid("getNodeChildren",d);a(b).each(function(){a(this).css("display","none");this.expanded&&a(e).jqGrid("collapseRow",this)})}})},getRootNodes:function(){var d=[];this.each(function(){var e=this;if(e.grid&&e.p.treeGrid)switch(e.p.treeGridModel){case "nested":var b=e.p.treeReader.level_field;a(e.rows).each(function(){parseInt(this[b],10)===parseInt(e.p.tree_root_level,
333
+ 10)&&d.push(this)});break;case "adjacency":a(e.rows).each(function(){if(this.parent_id==null||this.parent_id.toLowerCase()=="null")d.push(this)});break}});return d},getNodeDepth:function(d){var e=null;this.each(function(){var b=this;if(this.grid&&this.p.treeGrid)switch(b.p.treeGridModel){case "nested":e=parseInt(d.level,10)-parseInt(this.p.tree_root_level,10);break;case "adjacency":e=a(b).jqGrid("getNodeAncestors",d).length;break}});return e},getNodeParent:function(d){var e=null;this.each(function(){var b=
334
+ this;if(b.grid&&b.p.treeGrid)switch(b.p.treeGridModel){case "nested":var f=parseInt(d.lft,10),g=parseInt(d.rgt,10),h=parseInt(d.level,10);a(this.rows).each(function(){if(parseInt(this.level,10)===h-1&&parseInt(this.lft)<f&&parseInt(this.rgt)>g){e=this;return false}});break;case "adjacency":a(this.rows).each(function(){if(this.id==d.parent_id){e=this;return false}});break}});return e},getNodeChildren:function(d){var e=[];this.each(function(){var b=this;if(b.grid&&b.p.treeGrid)switch(b.p.treeGridModel){case "nested":var f=
335
+ parseInt(d.lft,10),g=parseInt(d.rgt,10),h=parseInt(d.level,10);a(this.rows).each(function(){parseInt(this.level,10)===h+1&&parseInt(this.lft,10)>f&&parseInt(this.rgt,10)<g&&e.push(this)});break;case "adjacency":a(this.rows).each(function(){this.parent_id==d.id&&e.push(this)});break}});return e},getFullTreeNode:function(d){var e=[];this.each(function(){var b=this;if(b.grid&&b.p.treeGrid)switch(b.p.treeGridModel){case "nested":var f=parseInt(d.lft,10),g=parseInt(d.rgt,10),h=parseInt(d.level,10);a(this.rows).each(function(){parseInt(this.level,
336
+ 10)>=h&&parseInt(this.lft,10)>=f&&parseInt(this.lft,10)<=g&&e.push(this)});break;case "adjacency":e.push(d);a(this.rows).each(function(j){len=e.length;for(j=0;j<len;j++)if(e[j].id==this.parent_id){e.push(this);break}});break}});return e},getNodeAncestors:function(d){var e=[];this.each(function(){if(this.grid&&this.p.treeGrid)for(var b=a(this).jqGrid("getNodeParent",d);b;){e.push(b);b=a(this).jqGrid("getNodeParent",b)}});return e},isVisibleNode:function(d){var e=true;this.each(function(){var b=this;
337
+ if(b.grid&&b.p.treeGrid){b=a(b).jqGrid("getNodeAncestors",d);a(b).each(function(){e=e&&this.expanded;if(!e)return false})}});return e},isNodeLoaded:function(d){var e;this.each(function(){var b=this;if(b.grid&&b.p.treeGrid)e=d.loaded!==undefined?d.loaded:d.isLeaf||a(b).jqGrid("getNodeChildren",d).length>0?true:false});return e},expandNode:function(d){return this.each(function(){if(this.grid&&this.p.treeGrid)if(!d.expanded)if(a(this).jqGrid("isNodeLoaded",d)){d.expanded=true;a("div.treeclick",d).removeClass(this.p.treeIcons.plus+
338
+ " tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{d.expanded=true;a("div.treeclick",d).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=d.rowIndex;this.p.datatype=this.p.treedatatype;this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:d.id,n_left:d.lft,n_right:d.rgt,n_level:d.level}}):a(this).jqGrid("setGridParam",{postData:{nodeid:d.id,parentid:d.parent_id,n_level:d.level}});a(this).trigger("reloadGrid");
339
+ this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}}):a(this).jqGrid("setGridParam",{postData:{nodeid:"",parentid:"",n_level:""}})}})},collapseNode:function(d){return this.each(function(){if(this.grid&&this.p.treeGrid)if(d.expanded){d.expanded=false;a("div.treeclick",d).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(d){return this.each(function(){if(this.grid&&this.p.treeGrid){var e,
340
+ b,f,g=[],h=this,j=a(this).jqGrid("getRootNodes");j.sort(function(c,l){if(c.sortKey<l.sortKey)return-d;if(c.sortKey>l.sortKey)return d;return 0});if(j[0]){a("td",j[0]).each(function(c){a(this).css("width",h.grid.headers[c].width+"px")});h.grid.cols=j[0].cells}e=0;for(b=j.length;e<b;e++){f=j[e];g.push(f);a(this).jqGrid("collectChildrenSortTree",g,f,d)}a.each(g,function(c,l){a("tbody",h.grid.bDiv).append(l);l.sortKey=null})}})},collectChildrenSortTree:function(d,e,b){return this.each(function(){if(this.grid&&
341
+ this.p.treeGrid){var f,g,h,j=a(this).jqGrid("getNodeChildren",e);j.sort(function(c,l){if(c.sortKey<l.sortKey)return-b;if(c.sortKey>l.sortKey)return b;return 0});f=0;for(g=j.length;f<g;f++){h=j[f];d.push(h);a(this).jqGrid("collectChildrenSortTree",d,h,b)}}})},setTreeRow:function(d,e){var b=false;this.each(function(){var f=this;if(f.grid&&f.p.treeGrid)b=a(f).jqGrid("setRowData",d,e)});return b},delTreeNode:function(d){return this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var b=a(e).jqGrid("getInd",
342
+ d,true);if(b){var f=a(e).jqGrid("getNodeChildren",b);if(f.length>0)for(var g=0;g<f.length;g++)a(e).jqGrid("delRowData",f[g].id);a(e).jqGrid("delRowData",b.id)}}})}})})(jQuery);
343
+ (function(a){a.fn.jqDrag=function(j){return g(this,j,"d")};a.fn.jqResize=function(j,c){return g(this,j,"r",c)};a.jqDnR={dnr:{},e:0,drag:function(j){if(e.k=="d")b.css({left:e.X+j.pageX-e.pX,top:e.Y+j.pageY-e.pY});else{b.css({width:Math.max(j.pageX-e.pX+e.W,0),height:Math.max(j.pageY-e.pY+e.H,0)});M1&&f.css({width:Math.max(j.pageX-M1.pX+M1.W,0),height:Math.max(j.pageY-M1.pY+M1.H,0)})}return false},stop:function(){a(document).unbind("mousemove",d.drag).unbind("mouseup",d.stop)}};var d=a.jqDnR,e=d.dnr,
344
+ b=d.e,f,g=function(j,c,l,k){return j.each(function(){c=c?a(c,j):j;c.bind("mousedown",{e:j,k:l},function(o){var m=o.data,n={};b=m.e;f=k?a(k):false;if(b.css("position")!="relative")try{b.position(n)}catch(q){}e={X:n.left||h("left")||0,Y:n.top||h("top")||0,W:h("width")||b[0].scrollWidth||0,H:h("height")||b[0].scrollHeight||0,pX:o.pageX,pY:o.pageY,k:m.k};M1=f&&m.k!="d"?{X:n.left||f1("left")||0,Y:n.top||f1("top")||0,W:f[0].offsetWidth||f1("width")||0,H:f[0].offsetHeight||f1("height")||0,pX:o.pageX,pY:o.pageY,
345
+ k:m.k}:false;a(document).mousemove(a.jqDnR.drag).mouseup(a.jqDnR.stop);return false})})},h=function(j){return parseInt(b.css(j))||false};f1=function(j){return parseInt(f.css(j))||false}})(jQuery);
346
+ (function(a){a.fn.jqm=function(o){var m={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:g,ajaxText:"",target:g,modal:g,toTop:g,onShow:g,onHide:g,onLoad:g};return this.each(function(){if(this._jqm)return e[this._jqm].c=a.extend({},e[this._jqm].c,o);d++;this._jqm=d;e[d]={c:a.extend(m,a.jqm.params,o),a:g,w:a(this).addClass("jqmID"+d),s:d};m.trigger&&a(this).jqmAddTrigger(m.trigger)})};a.fn.jqmAddClose=function(o){return k(this,o,"jqmHide")};a.fn.jqmAddTrigger=
347
+ function(o){return k(this,o,"jqmShow")};a.fn.jqmShow=function(o){return this.each(function(){a.jqm.open(this._jqm,o)})};a.fn.jqmHide=function(o){return this.each(function(){a.jqm.close(this._jqm,o)})};a.jqm={hash:{},open:function(o,m){var n=e[o],q=n.c,r="."+q.closeClass,u=parseInt(n.w.css("z-index"));u=u>0?u:3E3;var v=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":u-1,opacity:q.overlay/100});if(n.a)return g;n.t=m;n.a=true;n.w.css("z-index",u);if(q.modal){b[0]||
348
+ setTimeout(function(){c("bind")},1);b.push(o)}else if(q.overlay>0)q.closeoverlay&&n.w.jqmAddClose(v);else v=g;n.o=v?v.addClass(q.overlayClass).prependTo("body"):g;if(f){a("html,body").css({height:"100%",width:"100%"});if(v){v=v.css({position:"absolute"})[0];for(var w in{Top:1,Left:1})v.style.setExpression(w.toLowerCase(),"(_=(document.documentElement.scroll"+w+" || document.body.scroll"+w+"))+'px'")}}if(q.ajax){o=q.target||n.w;u=q.ajax;o=typeof o=="string"?a(o,n.w):a(o);u=u.substr(0,1)=="@"?a(m).attr(u.substring(1)):
349
+ u;o.html(q.ajaxText).load(u,function(){q.onLoad&&q.onLoad.call(this,n);r&&n.w.jqmAddClose(a(r,n.w));h(n)})}else r&&n.w.jqmAddClose(a(r,n.w));q.toTop&&n.o&&n.w.before('<span id="jqmP'+n.w[0]._jqm+'"></span>').insertAfter(n.o);q.onShow?q.onShow(n):n.w.show();h(n);return g},close:function(o){o=e[o];if(!o.a)return g;o.a=g;if(b[0]){b.pop();b[0]||c("unbind")}o.c.toTop&&o.o&&a("#jqmP"+o.w[0]._jqm).after(o.w).remove();if(o.c.onHide)o.c.onHide(o);else{o.w.hide();o.o&&o.o.remove()}return g},params:{}};var d=
350
+ 0,e=a.jqm.hash,b=[],f=a.browser.msie&&a.browser.version=="6.0",g=false,h=function(o){var m=a('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(f)if(o.o)o.o.html('<p style="width:100%;height:100%"/>').prepend(m);else a("iframe.jqm",o.w)[0]||o.w.prepend(m);j(o)},j=function(o){try{a(":input:visible",o.w)[0].focus()}catch(m){}},c=function(o){a(document)[o]("keypress",l)[o]("keydown",l)[o]("mousedown",l)},l=function(o){var m=e[b[b.length-1]];(o=!a(o.target).parents(".jqmID"+
351
+ m.s)[0])&&j(m);return!o},k=function(o,m,n){return o.each(function(){var q=this._jqm;a(m).each(function(){if(!this[n]){this[n]=[];a(this).click(function(){for(var r in{jqmShow:1,jqmHide:1})for(var u in this[r])e[this[r][u]]&&e[this[r][u]].w[r](this);return g})}this[n].push(q)})})}})(jQuery);
352
+ (function(a){function d(e,b,f,g,h){var j=b;if(a.fn.fmatter[e])j=a.fn.fmatter[e](b,f,g,h);return j}a.fmatter={};a.fn.fmatter=function(e,b,f,g,h){f=a.extend({},a.jgrid.formatter,f);return d(e,b,f,g,h)};a.fmatter.util={NumberFormat:function(e,b){isNumber(e)||(e*=1);if(isNumber(e)){var f=e<0,g=e+"",h=b.decimalSeparator?b.decimalSeparator:".";if(isNumber(b.decimalPlaces)){var j=b.decimalPlaces;g=Math.pow(10,j);g=Math.round(e*g)/g+"";e=g.lastIndexOf(".");if(j>0){if(e<0){g+=h;e=g.length-1}else if(h!==".")g=
353
+ g.replace(".",h);for(;g.length-1-e<j;)g+="0"}}if(b.thousandsSeparator){j=b.thousandsSeparator;e=g.lastIndexOf(h);e=e>-1?e:g.length;h=g.substring(e);for(var c=-1,l=e;l>0;l--){c++;if(c%3===0&&l!==e&&(!f||l>1))h=j+h;h=g.charAt(l-1)+h}g=h}g=b.prefix?b.prefix+g:g;return g=b.suffix?g+b.suffix:g}else return e},DateFormat:function(e,b,f,g){var h=function(z,B){z=String(z);for(B=parseInt(B)||2;z.length<B;)z="0"+z;return z},j={m:1,d:1,y:1970,h:0,i:0,s:0},c=0,l,k,o=["i18n"];o.i18n={dayNames:g.dayNames,monthNames:g.monthNames};
354
+ if(e in g.masks)e=g.masks[e];b=b.split(/[\\\/:_;.\t\T\s-]/);e=e.split(/[\\\/:_;.\t\T\s-]/);l=0;for(k=e.length;l<k;l++){if(e[l]=="M"){c=a.inArray(b[l],o.i18n.monthNames);if(c!==-1&&c<12)b[l]=c+1}if(e[l]=="F"){c=a.inArray(b[l],o.i18n.monthNames);if(c!==-1&&c>11)b[l]=c+1-12}j[e[l].toLowerCase()]=parseInt(b[l],10)}j.m=parseInt(j.m)-1;c=j.y;if(c>=70&&c<=99)j.y=1900+j.y;else if(c>=0&&c<=69)j.y=2E3+j.y;c=new Date(j.y,j.m,j.d,j.h,j.i,j.s,0);if(f in g.masks)f=g.masks[f];else f||(f="Y-m-d");j=c.getHours();
355
+ e=c.getMinutes();b=c.getDate();l=c.getMonth()+1;k=c.getTimezoneOffset();var m=c.getSeconds(),n=c.getMilliseconds(),q=c.getDay(),r=c.getFullYear(),u=(q+6)%7+1,v=(new Date(r,l-1,b)-new Date(r,0,1))/864E5,w={d:h(b),D:o.i18n.dayNames[q],j:b,l:o.i18n.dayNames[q+7],N:u,S:g.S(b),w:q,z:v,W:u<5?Math.floor((v+u-1)/7)+1:Math.floor((v+u-1)/7)||(((new Date(r-1,0,1)).getDay()+6)%7<4?53:52),F:o.i18n.monthNames[l-1+12],m:h(l),M:o.i18n.monthNames[l-1],n:l,t:"?",L:"?",o:"?",Y:r,y:String(r).substring(2),a:j<12?g.AmPm[0]:
356
+ g.AmPm[1],A:j<12?g.AmPm[2]:g.AmPm[3],B:"?",g:j%12||12,G:j,h:h(j%12||12),H:h(j),i:h(e),s:h(m),u:n,e:"?",I:"?",O:(k>0?"-":"+")+h(Math.floor(Math.abs(k)/60)*100+Math.abs(k)%60,4),P:"?",T:(String(c).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g)||[""]).pop().replace(/[^-+\dA-Z]/g,""),Z:"?",c:"?",r:"?",U:Math.floor(c/1E3)};return f.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(z){return z in
357
+ w?w[z]:z.substring(1)})}};a.fn.fmatter.defaultFormat=function(e,b){return isValue(e)&&e!==""?e:b.defaultValue?b.defaultValue:"&#160;"};a.fn.fmatter.email=function(e,b){return isEmpty(e)?a.fn.fmatter.defaultFormat(e,b):'<a href="mailto:'+e+'">'+e+"</a>"};a.fn.fmatter.checkbox=function(e,b){var f=a.extend({},b.checkbox);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));b=f.disabled===true?"disabled":"";if(isEmpty(e)||isUndefined(e))e=a.fn.fmatter.defaultFormat(e,f);
358
+ e+="";e=e.toLowerCase();return'<input type="checkbox" '+(e.search(/(false|0|no|off)/i)<0?" checked='checked' ":"")+' value="'+e+'" offval="no" '+b+"/>"};a.fn.fmatter.link=function(e,b){var f={target:b.target},g="";isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(f.target)g="target="+f.target;return isEmpty(e)?a.fn.fmatter.defaultFormat(e,b):"<a "+g+' href="'+e+'">'+e+"</a>"};a.fn.fmatter.showlink=function(e,b){var f={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,
359
+ addParam:b.addParam||"",target:b.target,idName:b.idName},g="";isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(f.target)g="target="+f.target;idUrl=f.baseLinkUrl+f.showAction+"?"+f.idName+"="+b.rowId+f.addParam;return isString(e)?"<a "+g+' href="'+idUrl+'">'+e+"</a>":a.fn.fmatter.defaultFormat(e,b)};a.fn.fmatter.integer=function(e,b){var f=a.extend({},b.integer);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(isEmpty(e))return f.defaultValue;
360
+ return a.fmatter.util.NumberFormat(e,f)};a.fn.fmatter.number=function(e,b){var f=a.extend({},b.number);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(isEmpty(e))return f.defaultValue;return a.fmatter.util.NumberFormat(e,f)};a.fn.fmatter.currency=function(e,b){var f=a.extend({},b.currency);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));if(isEmpty(e))return f.defaultValue;return a.fmatter.util.NumberFormat(e,f)};a.fn.fmatter.date=
361
+ function(e,b,f,g){f=a.extend({},b.date);isUndefined(b.colModel.formatoptions)||(f=a.extend({},f,b.colModel.formatoptions));return!f.reformatAfterEdit&&g=="edit"?a.fn.fmatter.defaultFormat(e,b):isEmpty(e)?a.fn.fmatter.defaultFormat(e,b):a.fmatter.util.DateFormat(f.srcformat,e,f.newformat,f)};a.fn.fmatter.select=function(e,b){e+="";var f=false,g=[];if(!isUndefined(b.colModel.editoptions))f=b.colModel.editoptions.value;if(f){var h=b.colModel.editoptions.multiple===true?true:false,j=[],c;if(h){j=e.split(",");
362
+ j=a.map(j,function(m){return a.trim(m)})}if(isString(f))for(var l=f.split(";"),k=0,o=0;o<l.length;o++){c=l[o].split(":");if(c.length>2)c[1]=jQuery.map(c,function(m,n){if(n>0)return m}).join(":");if(h){if(jQuery.inArray(c[0],j)>-1){g[k]=c[1];k++}}else if(a.trim(c[0])==a.trim(e)){g[0]=c[1];break}}else if(isObject(f))if(h)g=jQuery.map(j,function(m){return f[m]});else g[0]=f[e]||""}e=g.join(", ");return e==""?a.fn.fmatter.defaultFormat(e,b):e};a.fn.fmatter.rowactions=function(e,b,f,g){switch(f){case "edit":f=
363
+ function(){a(".ui-inline-edit, .ui-inline-del","#"+e).show();a(".ui-inline-save, .ui-inline-cancel","#"+e).hide()};a("#"+b).jqGrid("editRow",e,g,null,null,null,{oper:"edit"},f,null,f);a(".ui-inline-edit, .ui-inline-del","#"+e).hide();a(".ui-inline-save, .ui-inline-cancel","#"+e).show();break;case "save":a("#"+b).jqGrid("saveRow",e,null,null,{oper:"edit"});a(".ui-inline-edit, .ui-inline-del","#"+e).show();a(".ui-inline-save, .ui-inline-cancel","#"+e).hide();break;case "cancel":a("#"+b).jqGrid("restoreRow",
364
+ e);a(".ui-inline-edit, .ui-inline-del","#"+e).show();a(".ui-inline-save, .ui-inline-cancel","#"+e).hide();break}};a.fn.fmatter.actions=function(e,b){var f={keys:false};isUndefined(b.colModel.formatoptions)||(f=a.extend(f,b.colModel.formatoptions));e=b.rowId;if(typeof e=="undefined"||isEmpty(e))return"";f="onclick=$.fn.fmatter.rowactions('"+e+"','"+b.gid+"','edit',"+f.keys+");";var g="<div style='margin-left:8px;'><div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+
365
+ f+"><span class='ui-icon ui-icon-pencil'></span></div>";f="onclick=jQuery('#"+b.gid+"').jqGrid('delGridRow','"+e+"');";g=g+"<div title='"+a.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+f+"><span class='ui-icon ui-icon-trash'></span></div>";f="onclick=$.fn.fmatter.rowactions('"+e+"','"+b.gid+"','save',false);";g=g+"<div title='"+a.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save'><span class='ui-icon ui-icon-disk' "+
366
+ f+"></span></div>";f="onclick=$.fn.fmatter.rowactions('"+e+"','"+b.gid+"','cancel',false);";return g=g+"<div title='"+a.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel'><span class='ui-icon ui-icon-cancel' "+f+"></span></div></div>"};a.unformat=function(e,b,f,g){var h,j=b.colModel.formatter,c=b.colModel.formatoptions||{},l=/([\.\*\_\'\(\)\{\}\+\?\\])/g;unformatFunc=b.colModel.unformat||a.fn.fmatter[j]&&a.fn.fmatter[j].unformat;if(typeof unformatFunc!==
367
+ "undefined"&&isFunction(unformatFunc))h=unformatFunc(a(e).text(),b,e);else if(typeof j!=="undefined"&&isString(j)){h=a.jgrid.formatter||{};switch(j){case "integer":c=a.extend({},h.integer,c);b=c.thousandsSeparator.replace(l,"\\$1");b=new RegExp(b,"g");h=a(e).text().replace(b,"");break;case "number":c=a.extend({},h.number,c);b=c.thousandsSeparator.replace(l,"\\$1");b=new RegExp(b,"g");h=a(e).text().replace(b,"").replace(c.decimalSeparator,".");break;case "currency":c=a.extend({},h.currency,c);b=c.thousandsSeparator.replace(l,
368
+ "\\$1");b=new RegExp(b,"g");h=a(e).text().replace(b,"").replace(c.decimalSeparator,".").replace(c.prefix,"").replace(c.suffix,"");break;case "checkbox":c=b.colModel.editoptions?b.colModel.editoptions.value.split(":"):["Yes","No"];h=a("input",e).attr("checked")?c[0]:c[1];break;case "select":h=a.unformat.select(e,b,f,g);break;case "actions":return"";default:h=a(e).text()}}return h?h:g===true?a(e).text():a.jgrid.htmlDecode(a(e).html())};a.unformat.select=function(e,b,f,g){f=[];e=a(e).text();if(g==true)return e;
369
+ b=a.extend({},b.colModel.editoptions);if(b.value){var h=b.value;b=b.multiple===true?true:false;g=[];var j;if(b){g=e.split(",");g=a.map(g,function(o){return a.trim(o)})}if(isString(h))for(var c=h.split(";"),l=0,k=0;k<c.length;k++){j=c[k].split(":");if(b){if(jQuery.inArray(j[1],g)>-1){f[l]=j[0];l++}}else if(a.trim(j[1])==a.trim(e)){f[0]=j[0];break}}else if(isObject(h)){b||(g[0]=e);f=jQuery.map(g,function(o){var m;a.each(h,function(n,q){if(q==o){m=n;return false}});if(m)return m})}return f.join(", ")}else return e||
370
+ ""};isValue=function(e){return isObject(e)||isString(e)||isNumber(e)||isBoolean(e)};isBoolean=function(e){return typeof e==="boolean"};isNull=function(e){return e===null};isNumber=function(e){return typeof e==="number"&&isFinite(e)};isString=function(e){return typeof e==="string"};isEmpty=function(e){if(!isString(e)&&isValue(e))return false;else if(!isValue(e))return true;e=a.trim(e).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,"");return e===""};isUndefined=function(e){return typeof e==="undefined"};
371
+ isObject=function(e){return e&&(typeof e==="object"||isFunction(e))||false};isFunction=function(e){return typeof e==="function"}})(jQuery);
372
+ jQuery.fn.searchFilter=function(a,d){function e(b,f,g){this.$=b;this.add=function(y){y==null?b.find(".ui-add-last").click():b.find(".sf:eq("+y+") .ui-add").click();return this};this.del=function(y){y==null?b.find(".sf:last .ui-del").click():b.find(".sf:eq("+y+") .ui-del").click();return this};this.search=function(){b.find(".ui-search").click();return this};this.reset=function(){b.find(".ui-reset").click();return this};this.close=function(){b.find(".ui-closer").click();return this};if(f!=null){function h(){jQuery(this).toggleClass("ui-state-hover");
373
+ return false}function j(y){jQuery(this).toggleClass("ui-state-active",y.type=="mousedown");return false}function c(y,F){return"<option value='"+y+"'>"+F+"</option>"}function l(y,F,x){return"<select class='"+y+"'"+(x?" style='display:none;'":"")+">"+F+"</select>"}function k(y,F){y=b.find("tr.sf td.data "+y);y[0]!=null&&F(y)}function o(y,F){var x=b.find("tr.sf td.data "+y);x[0]!=null&&jQuery.each(F,function(){this.data!=null?x.bind(this.type,this.data,this.fn):x.bind(this.type,this.fn)})}var m=jQuery.extend({},
374
+ jQuery.fn.searchFilter.defaults,g),n=-1,q="";jQuery.each(m.groupOps,function(){q+=c(this.op,this.text)});q="<select name='groupOp'>"+q+"</select>";b.html("").addClass("ui-searchFilter").append("<div class='ui-widget-overlay' style='z-index: -1'>&#160;</div><table class='ui-widget-content ui-corner-all'><thead><tr><td colspan='5' class='ui-widget-header ui-corner-all' style='line-height: 18px;'><div class='ui-closer ui-state-default ui-corner-all ui-helper-clearfix' style='float: right;'><span class='ui-icon ui-icon-close'></span></div>"+
375
+ m.windowTitle+"</td></tr></thead><tbody><tr class='sf'><td class='fields'></td><td class='ops'></td><td class='data'></td><td><div class='ui-del ui-state-default ui-corner-all'><span class='ui-icon ui-icon-minus'></span></div></td><td><div class='ui-add ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plus'></span></div></td></tr><tr><td colspan='5' class='divider'><div>&#160;</div></td></tr></tbody><tfoot><tr><td colspan='3'><span class='ui-reset ui-state-default ui-corner-all' style='display: inline-block; float: left;'><span class='ui-icon ui-icon-arrowreturnthick-1-w' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+
376
+ m.resetText+"</span></span><span class='ui-search ui-state-default ui-corner-all' style='display: inline-block; float: right;'><span class='ui-icon ui-icon-search' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+m.searchText+"</span></span><span class='matchText'>"+m.matchText+"</span> "+q+" <span class='rulesText'>"+m.rulesText+"</span></td><td>&#160;</td><td><div class='ui-add-last ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plusthick'></span></div></td></tr></tfoot></table>");
377
+ g=b.find("tr.sf");var r=g.find("td.fields"),u=g.find("td.ops"),v=g.find("td.data"),w="";jQuery.each(m.operators,function(){w+=c(this.op,this.text)});w=l("default",w,true);u.append(w);v.append("<input type='text' class='default' style='display:none;' />");var z="",B=false,C=false;jQuery.each(f,function(y){z+=c(this.itemval,this.text);if(this.ops!=null){B=true;var F="";jQuery.each(this.ops,function(){F+=c(this.op,this.text)});F=l("field"+y,F,true);u.append(F)}if(this.dataUrl!=null){if(y>n)n=y;C=true;
378
+ var x=this.dataEvents,N=this.dataInit,Y=this.buildSelect;jQuery.ajax(jQuery.extend({url:this.dataUrl,complete:function(Q){Q=Y!=null?jQuery("<div />").append(Y(Q)):jQuery("<div />").append(Q.responseText);Q.find("select").addClass("field"+y).hide();v.append(Q.html());N&&k(".field"+y,N);x&&o(".field"+y,x);y==n&&b.find("tr.sf td.fields select[name='field']").change()}},m.ajaxSelectOptions))}else if(this.dataValues!=null){C=true;var da="";jQuery.each(this.dataValues,function(){da+=c(this.value,this.text)});
379
+ da=l("field"+y,da,true);v.append(da)}else if(this.dataEvents!=null||this.dataInit!=null){C=true;da="<input type='text' class='field"+y+"' />";v.append(da)}this.dataInit!=null&&y!=n&&k(".field"+y,this.dataInit);this.dataEvents!=null&&y!=n&&o(".field"+y,this.dataEvents)});z="<select name='field'>"+z+"</select>";r.append(z);f=r.find("select[name='field']");B?f.change(function(y){var F=y.target.selectedIndex;y=jQuery(y.target).parents("tr.sf").find("td.ops");y.find("select").removeAttr("name").hide();
380
+ F=y.find(".field"+F);if(F[0]==null)F=y.find(".default");F.attr("name","op").show()}):u.find(".default").attr("name","op").show();C?f.change(function(y){var F=y.target.selectedIndex;y=jQuery(y.target).parents("tr.sf").find("td.data");y.find("select,input").removeClass("vdata").hide();F=y.find(".field"+F);if(F[0]==null)F=y.find(".default");F.show().addClass("vdata")}):v.find(".default").show().addClass("vdata");if(B||C)f.change();b.find(".ui-state-default").hover(h,h).mousedown(j).mouseup(j);b.find(".ui-closer").click(function(){m.onClose(jQuery(b.selector));
381
+ return false});b.find(".ui-del").click(function(y){y=jQuery(y.target).parents(".sf");if(y.siblings(".sf").length>0){m.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&y.find(".hasDatepicker").datepicker("destroy");y.remove()}else{y.find("select[name='field']")[0].selectedIndex=0;y.find("select[name='op']")[0].selectedIndex=0;y.find(".data input").val("");y.find(".data select").each(function(){this.selectedIndex=0});y.find("select[name='field']").change()}return false});b.find(".ui-add").click(function(y){y=
382
+ jQuery(y.target).parents(".sf");var F=y.clone(true).insertAfter(y);F.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");if(m.clone){F.find("select[name='field']")[0].selectedIndex=y.find("select[name='field']")[0].selectedIndex;if(F.find("select[name='op']")[0]!=null)F.find("select[name='op']").focus()[0].selectedIndex=y.find("select[name='op']")[0].selectedIndex;var x=F.find("select.vdata");if(x[0]!=null)x[0].selectedIndex=y.find("select.vdata")[0].selectedIndex}else{F.find(".data input").val("");
383
+ F.find("select[name='field']").focus()}m.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&y.find(".hasDatepicker").each(function(){var N=jQuery.data(this,"datepicker").settings;F.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(N)});F.find("select[name='field']").change();return false});b.find(".ui-search").click(function(){var y=jQuery(b.selector),F,x=y.find("select[name='groupOp'] :selected").val();F=m.stringResult?'{"groupOp":"'+x+'","rules":[':{groupOp:x,
384
+ rules:[]};y.find(".sf").each(function(N){var Y=jQuery(this).find("select[name='field'] :selected").val(),da=jQuery(this).find("select[name='op'] :selected").val(),Q=jQuery(this).find("input.vdata,select.vdata :selected").val();Q+="";Q=Q.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');if(m.stringResult){if(N>0)F+=",";F+='{"field":"'+Y+'",';F+='"op":"'+da+'",';F+='"data":"'+Q+'"}'}else F.rules.push({field:Y,op:da,data:Q})});if(m.stringResult)F+="]}";m.onSearch(F);return false});b.find(".ui-reset").click(function(){var y=
385
+ jQuery(b.selector);y.find(".ui-del").click();y.find("select[name='groupOp']")[0].selectedIndex=0;m.onReset();return false});b.find(".ui-add-last").click(function(){var y=jQuery(b.selector+" .sf:last"),F=y.clone(true).insertAfter(y);F.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");F.find(".data input").val("");F.find("select[name='field']").focus();m.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&y.find(".hasDatepicker").each(function(){var x=jQuery.data(this,"datepicker").settings;
386
+ F.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(x)});F.find("select[name='field']").change();return false})}}return new e(this,a,d)};jQuery.fn.searchFilter.version="1.2.9";
387
+ jQuery.fn.searchFilter.defaults={clone:true,datepickerFix:true,onReset:function(a){alert("Reset Clicked. Data Returned: "+a)},onSearch:function(a){alert("Search Clicked. Data Returned: "+a)},onClose:function(a){a.hide()},groupOps:[{op:"AND",text:"all"},{op:"OR",text:"any"}],operators:[{op:"eq",text:"is equal to"},{op:"ne",text:"is not equal to"},{op:"lt",text:"is less than"},{op:"le",text:"is less or equal to"},{op:"gt",text:"is greater than"},{op:"ge",text:"is greater or equal to"},{op:"in",text:"is in"},
388
+ {op:"ni",text:"is not in"},{op:"bw",text:"begins with"},{op:"bn",text:"does not begin with"},{op:"ew",text:"ends with"},{op:"en",text:"does not end with"},{op:"cn",text:"contains"},{op:"nc",text:"does not contain"}],matchText:"match",rulesText:"rules",resetText:"Reset",searchText:"Search",stringResult:true,windowTitle:"Search Rules",ajaxSelectOptions:{}};
389
+ var xmlJsonClass={xml2json:function(a,d){if(a.nodeType===9)a=a.documentElement;a=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+d+(d?a.replace(/\t/g,d):a.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,d){var e=function(g,h,j){var c="",l,k;if(g instanceof Array)if(g.length===0)c+=j+"<"+h+">__EMPTY_ARRAY_</"+h+">\n";else{l=0;for(k=g.length;l<k;l+=1){var o=j+e(g[l],h,j+"\t")+"\n";c+=o}}else if(typeof g==="object"){l=false;c+=j+"<"+h;for(k in g)if(g.hasOwnProperty(k))if(k.charAt(0)===
390
+ "@")c+=" "+k.substr(1)+'="'+g[k].toString()+'"';else l=true;c+=l?">":"/>";if(l){for(k in g)if(g.hasOwnProperty(k))if(k==="#text")c+=g[k];else if(k==="#cdata")c+="<![CDATA["+g[k]+"]]\>";else if(k.charAt(0)!=="@")c+=e(g[k],k,j+"\t");c+=(c.charAt(c.length-1)==="\n"?j:"")+"</"+h+">"}}else c+=typeof g==="function"?j+"<"+h+"><![CDATA["+g+"]]\></"+h+">":g.toString()==='""'||g.toString().length===0?j+"<"+h+">__EMPTY_STRING_</"+h+">":j+"<"+h+">"+g.toString()+"</"+h+">";return c},b="",f;for(f in a)if(a.hasOwnProperty(f))b+=
391
+ e(a[f],f,"");return d?b.replace(/\t/g,d):b.replace(/\t|\n/g,"")},toObj:function(a){var d={},e=/function/i;if(a.nodeType===1){if(a.attributes.length){var b;for(b=0;b<a.attributes.length;b+=1)d["@"+a.attributes[b].nodeName]=(a.attributes[b].nodeValue||"").toString()}if(a.firstChild){var f=b=0,g=false,h;for(h=a.firstChild;h;h=h.nextSibling)if(h.nodeType===1)g=true;else if(h.nodeType===3&&h.nodeValue.match(/[^ \f\n\r\t\v]/))b+=1;else if(h.nodeType===4)f+=1;if(g)if(b<2&&f<2){this.removeWhite(a);for(h=
392
+ a.firstChild;h;h=h.nextSibling)if(h.nodeType===3)d["#text"]=this.escape(h.nodeValue);else if(h.nodeType===4)if(e.test(h.nodeValue))d[h.nodeName]=[d[h.nodeName],h.nodeValue];else d["#cdata"]=this.escape(h.nodeValue);else if(d[h.nodeName])if(d[h.nodeName]instanceof Array)d[h.nodeName][d[h.nodeName].length]=this.toObj(h);else d[h.nodeName]=[d[h.nodeName],this.toObj(h)];else d[h.nodeName]=this.toObj(h)}else if(a.attributes.length)d["#text"]=this.escape(this.innerXml(a));else d=this.escape(this.innerXml(a));
393
+ else if(b)if(a.attributes.length)d["#text"]=this.escape(this.innerXml(a));else{d=this.escape(this.innerXml(a));if(d==="__EMPTY_ARRAY_")d="[]";else if(d==="__EMPTY_STRING_")d=""}else if(f)if(f>1)d=this.escape(this.innerXml(a));else for(h=a.firstChild;h;h=h.nextSibling)if(e.test(a.firstChild.nodeValue)){d=a.firstChild.nodeValue;break}else d["#cdata"]=this.escape(h.nodeValue)}if(!a.attributes.length&&!a.firstChild)d=null}else if(a.nodeType===9)d=this.toObj(a.documentElement);else alert("unhandled node type: "+
394
+ a.nodeType);return d},toJson:function(a,d,e){var b=d?'"'+d+'"':"";if(a==="[]")b+=d?":[]":"[]";else if(a instanceof Array){var f,g,h=[];g=0;for(f=a.length;g<f;g+=1)h[g]=this.toJson(a[g],"",e+"\t");b+=(d?":[":"[")+(h.length>1?"\n"+e+"\t"+h.join(",\n"+e+"\t")+"\n"+e:h.join(""))+"]"}else if(a===null)b+=(d&&":")+"null";else if(typeof a==="object"){f=[];for(g in a)if(a.hasOwnProperty(g))f[f.length]=this.toJson(a[g],g,e+"\t");b+=(d?":{":"{")+(f.length>1?"\n"+e+"\t"+f.join(",\n"+e+"\t")+"\n"+e:f.join(""))+
395
+ "}"}else if(typeof a==="string"){e=/function/i;f=a.toString();b+=/(^-?\d+\.?\d*$)/.test(f)||e.test(f)||f==="false"||f==="true"?(d&&":")+f:(d&&":")+'"'+a+'"'}else b+=(d&&":")+a.toString();return b},innerXml:function(a){var d="";if("innerHTML"in a)d=a.innerHTML;else{var e=function(b){var f="",g;if(b.nodeType===1){f+="<"+b.nodeName;for(g=0;g<b.attributes.length;g+=1)f+=" "+b.attributes[g].nodeName+'="'+(b.attributes[g].nodeValue||"").toString()+'"';if(b.firstChild){f+=">";for(g=b.firstChild;g;g=g.nextSibling)f+=
396
+ e(g);f+="</"+b.nodeName+">"}else f+="/>"}else if(b.nodeType===3)f+=b.nodeValue;else if(b.nodeType===4)f+="<![CDATA["+b.nodeValue+"]]\>";return f};for(a=a.firstChild;a;a=a.nextSibling)d+=e(a)}return d},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();var d;for(d=a.firstChild;d;)if(d.nodeType===3)if(d.nodeValue.match(/[^ \f\n\r\t\v]/))d=d.nextSibling;else{var e=d.nextSibling;a.removeChild(d);
397
+ d=e}else{d.nodeType===1&&this.removeWhite(d);d=d.nextSibling}return a}};
398
+ (function(a){function d(l,k,o){var m=h[l];g=a("#"+m.id).find("ul:first").clone(true);g.css(m.menuStyle).find("li").css(m.itemStyle).hover(function(){a(this).css(m.itemHoverStyle)},function(){a(this).css(m.itemStyle)}).find("img").css({verticalAlign:"middle",paddingRight:"2px"});b.html(g);if(m.onShowMenu)b=m.onShowMenu(o,b);a.each(m.bindings,function(n,q){a("#"+n,b).bind("click",function(){e();q(k,j)})});b.css({left:o[m.eventPosX],top:o[m.eventPosY]}).show();m.shadow&&f.css({width:b.width(),height:b.height(),
399
+ left:o.pageX+2,top:o.pageY+2}).show();a(document).one("click",e)}function e(){b.hide();f.hide()}var b,f,g,h,j,c={menuStyle:{listStyle:"none",padding:"1px",margin:"0px",backgroundColor:"#fff",border:"1px solid #999",width:"100px"},itemStyle:{margin:"0px",color:"#000",display:"block",cursor:"default",padding:"3px",border:"1px solid #fff",backgroundColor:"transparent"},itemHoverStyle:{border:"1px solid #0a246a",backgroundColor:"#b6bdd2"},eventPosX:"pageX",eventPosY:"pageY",shadow:true,onContextMenu:null,
400
+ onShowMenu:null};a.fn.contextMenu=function(l,k){b||(b=a('<div id="jqContextMenu"></div>').hide().css({position:"absolute",zIndex:"500"}).appendTo("body").bind("click",function(m){m.stopPropagation()}));f||(f=a("<div></div>").css({backgroundColor:"#000",position:"absolute",opacity:0.2,zIndex:499}).appendTo("body").hide());h=h||[];h.push({id:l,menuStyle:a.extend({},c.menuStyle,k.menuStyle||{}),itemStyle:a.extend({},c.itemStyle,k.itemStyle||{}),itemHoverStyle:a.extend({},c.itemHoverStyle,k.itemHoverStyle||
401
+ {}),bindings:k.bindings||{},shadow:k.shadow||k.shadow===false?k.shadow:c.shadow,onContextMenu:k.onContextMenu||c.onContextMenu,onShowMenu:k.onShowMenu||c.onShowMenu,eventPosX:k.eventPosX||c.eventPosX,eventPosY:k.eventPosY||c.eventPosY});var o=h.length-1;a(this).bind("contextmenu",function(m){(h[o].onContextMenu?h[o].onContextMenu(m):true)&&d(o,this,m,k);return false});return this};a.contextMenu={defaults:function(l){a.each(l,function(k,o){if(typeof o=="object"&&c[k])a.extend(c[k],o);else c[k]=o})}}})(jQuery);
402
+ $(function(){$("div.contextMenu").hide()});
403
+ jQuery.tableDnD={currentTable:null,dragObject:null,mouseOffset:null,oldY:0,build:function(a){this.each(function(){this.tableDnDConfig=jQuery.extend({onDragStyle:null,onDropStyle:null,onDragClass:"tDnD_whileDrag",onDrop:null,onDragStart:null,scrollAmount:5,serializeRegexp:/[^\-]*$/,serializeParamName:null,dragHandle:null},a||{});jQuery.tableDnD.makeDraggable(this)});jQuery(document).bind("mousemove",jQuery.tableDnD.mousemove).bind("mouseup",jQuery.tableDnD.mouseup);return this},makeDraggable:function(a){var d=
404
+ a.tableDnDConfig;a.tableDnDConfig.dragHandle?jQuery("td."+a.tableDnDConfig.dragHandle,a).each(function(){jQuery(this).mousedown(function(e){jQuery.tableDnD.dragObject=this.parentNode;jQuery.tableDnD.currentTable=a;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,e);d.onDragStart&&d.onDragStart(a,this);return false})}):jQuery("tr",a).each(function(){var e=jQuery(this);e.hasClass("nodrag")||e.mousedown(function(b){if(b.target.tagName=="TD"){jQuery.tableDnD.dragObject=this;jQuery.tableDnD.currentTable=
405
+ a;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,b);d.onDragStart&&d.onDragStart(a,this);return false}}).css("cursor","move")})},updateTables:function(){this.each(function(){this.tableDnDConfig&&jQuery.tableDnD.makeDraggable(this)})},mouseCoords:function(a){if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};return{x:a.clientX+document.body.scrollLeft-document.body.clientLeft,y:a.clientY+document.body.scrollTop-document.body.clientTop}},getMouseOffset:function(a,d){d=d||window.event;
406
+ a=this.getPosition(a);d=this.mouseCoords(d);return{x:d.x-a.x,y:d.y-a.y}},getPosition:function(a){var d=0,e=0;if(a.offsetHeight==0)a=a.firstChild;if(a&&a.offsetParent){for(;a.offsetParent;){d+=a.offsetLeft;e+=a.offsetTop;a=a.offsetParent}d+=a.offsetLeft;e+=a.offsetTop}return{x:d,y:e}},mousemove:function(a){if(jQuery.tableDnD.dragObject!=null){var d=jQuery(jQuery.tableDnD.dragObject),e=jQuery.tableDnD.currentTable.tableDnDConfig,b=jQuery.tableDnD.mouseCoords(a);a=b.y-jQuery.tableDnD.mouseOffset.y;var f=
407
+ window.pageYOffset;if(document.all)if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")f=document.documentElement.scrollTop;else if(typeof document.body!="undefined")f=document.body.scrollTop;if(b.y-f<e.scrollAmount)window.scrollBy(0,-e.scrollAmount);else(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-(b.y-f)<e.scrollAmount&&window.scrollBy(0,e.scrollAmount);if(a!=jQuery.tableDnD.oldY){b=
408
+ a>jQuery.tableDnD.oldY;jQuery.tableDnD.oldY=a;e.onDragClass?d.addClass(e.onDragClass):d.css(e.onDragStyle);if(d=jQuery.tableDnD.findDropTargetRow(d,a))if(b&&jQuery.tableDnD.dragObject!=d)jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,d.nextSibling);else!b&&jQuery.tableDnD.dragObject!=d&&jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,d)}return false}},findDropTargetRow:function(a,d){for(var e=jQuery.tableDnD.currentTable.rows,b=0;b<e.length;b++){var f=
409
+ e[b],g=this.getPosition(f).y,h=parseInt(f.offsetHeight)/2;if(f.offsetHeight==0){g=this.getPosition(f.firstChild).y;h=parseInt(f.firstChild.offsetHeight)/2}if(d>g-h&&d<g+h){if(f==a)return null;d=jQuery.tableDnD.currentTable.tableDnDConfig;return d.onAllowDrop?d.onAllowDrop(a,f)?f:null:jQuery(f).hasClass("nodrop")?null:f}}return null},mouseup:function(){if(jQuery.tableDnD.currentTable&&jQuery.tableDnD.dragObject){var a=jQuery.tableDnD.dragObject,d=jQuery.tableDnD.currentTable.tableDnDConfig;d.onDragClass?
410
+ jQuery(a).removeClass(d.onDragClass):jQuery(a).css(d.onDropStyle);jQuery.tableDnD.dragObject=null;d.onDrop&&d.onDrop(jQuery.tableDnD.currentTable,a);jQuery.tableDnD.currentTable=null}},serialize:function(){return jQuery.tableDnD.currentTable?jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable):"Error: No Table id set, you need to set an id on your table and every row"},serializeTable:function(a){for(var d="",e=a.id,b=a.rows,f=0;f<b.length;f++){if(d.length>0)d+="&";var g=b[f].id;if(g&&g&&a.tableDnDConfig&&
411
+ a.tableDnDConfig.serializeRegexp)g=g.match(a.tableDnDConfig.serializeRegexp)[0];d+=e+"[]="+g}return d},serializeTables:function(){var a="";this.each(function(){a+=jQuery.tableDnD.serializeTable(this)});return a}};jQuery.fn.extend({tableDnD:jQuery.tableDnD.build,tableDnDUpdate:jQuery.tableDnD.updateTables,tableDnDSerialize:jQuery.tableDnD.serializeTables});
412
+ (function(a){a.widget("ui.multiselect",{_init:function(){this.element.hide();this.id=this.element.attr("id");this.container=a('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);this.count=0;this.selectedContainer=a('<div class="selected"></div>').appendTo(this.container);this.availableContainer=a('<div class="available"></div>').appendTo(this.container);this.selectedActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+
413
+ a.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+a.ui.multiselect.locale.removeAll+"</a></div>").appendTo(this.selectedContainer);this.availableActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+a.ui.multiselect.locale.addAll+"</a></div>").appendTo(this.availableContainer);this.selectedList=a('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",
414
+ function(){return false}).appendTo(this.selectedContainer);this.availableList=a('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",function(){return false}).appendTo(this.availableContainer);var d=this;this.container.width(this.element.width()+1);this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));this.selectedList.height(Math.max(this.element.height()-
415
+ this.selectedActions.height(),1));this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));if(!this.options.animated){this.options.show="show";this.options.hide="hide"}this._populateLists(this.element.find("option"));this.options.sortable&&a("ul.selected").sortable({placeholder:"ui-state-highlight",axis:"y",update:function(){d.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(d.element)})},receive:function(e,
416
+ b){b.item.data("optionLink").attr("selected",true);d.count+=1;d._updateCount();d.selectedList.children(".ui-draggable").each(function(){a(this).removeClass("ui-draggable");a(this).data("optionLink",b.item.data("optionLink"));a(this).data("idx",b.item.data("idx"));d._applyItemState(a(this),true)});setTimeout(function(){b.item.remove()},1)}});this.options.searchable?this._registerSearchEvents(this.availableContainer.find("input.search")):a(".search").hide();a(".remove-all").click(function(){d._populateLists(d.element.find("option").removeAttr("selected"));
417
+ return false});a(".add-all").click(function(){d._populateLists(d.element.find("option").attr("selected","selected"));return false})},destroy:function(){this.element.show();this.container.remove();a.widget.prototype.destroy.apply(this,arguments)},_populateLists:function(d){this.selectedList.children(".ui-element").remove();this.availableList.children(".ui-element").remove();this.count=0;var e=this;a(d.map(function(b){var f=e._getOptionNode(this).appendTo(this.selected?e.selectedList:e.availableList).show();
418
+ if(this.selected)e.count+=1;e._applyItemState(f,this.selected);f.data("idx",b);return f[0]}));this._updateCount()},_updateCount:function(){this.selectedContainer.find("span.count").text(this.count+" "+a.ui.multiselect.locale.itemsCount)},_getOptionNode:function(d){d=a(d);var e=a('<li class="ui-state-default ui-element" title="'+d.text()+'"><span class="ui-icon"/>'+d.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();e.data("optionLink",d);return e},_cloneWithData:function(d){var e=
419
+ d.clone();e.data("optionLink",d.data("optionLink"));e.data("idx",d.data("idx"));return e},_setSelected:function(d,e){d.data("optionLink").attr("selected",e);if(e){e=this._cloneWithData(d);d[this.options.hide](this.options.animated,function(){a(this).remove()});e.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);this._applyItemState(e,true);return e}else{var b=this.availableList.find("li"),f=this.options.nodeComparator;e=null;var g=d.data("idx"),h=f(d,a(b[g]));if(h)for(;g>=
420
+ 0&&g<b.length;){h>0?g++:g--;if(h!=f(d,a(b[g]))){e=b[h>0?g:g+1];break}}else e=b[g];b=this._cloneWithData(d);e?b.insertBefore(a(e)):b.appendTo(this.availableList);d[this.options.hide](this.options.animated,function(){a(this).remove()});b.hide()[this.options.show](this.options.animated);this._applyItemState(b,false);return b}},_applyItemState:function(d,e){if(e){this.options.sortable?d.children("span").addClass("ui-icon-arrowthick-2-n-s").removeClass("ui-helper-hidden").addClass("ui-icon"):d.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");
421
+ d.find("a.action span").addClass("ui-icon-minus").removeClass("ui-icon-plus");this._registerRemoveEvents(d.find("a.action"))}else{d.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");d.find("a.action span").addClass("ui-icon-plus").removeClass("ui-icon-minus");this._registerAddEvents(d.find("a.action"))}this._registerHoverEvents(d)},_filter:function(d){var e=a(this),b=d.children("li");d=b.map(function(){return a(this).text().toLowerCase()});
422
+ var f=a.trim(e.val().toLowerCase()),g=[];if(f){b.hide();d.each(function(h){this.indexOf(f)>-1&&g.push(h)});a.each(g,function(){a(b[this]).show()})}else b.show()},_registerHoverEvents:function(d){d.removeClass("ui-state-hover");d.mouseover(function(){a(this).addClass("ui-state-hover")});d.mouseout(function(){a(this).removeClass("ui-state-hover")})},_registerAddEvents:function(d){var e=this;d.click(function(){e._setSelected(a(this).parent(),true);e.count+=1;e._updateCount();return false}).each(function(){a(this).parent().draggable({connectToSortable:"ul.selected",
423
+ helper:function(){var b=e._cloneWithData(a(this)).width(a(this).width()-50);b.width(a(this).width());return b},appendTo:".ui-multiselect",containment:".ui-multiselect",revert:"invalid"})})},_registerRemoveEvents:function(d){var e=this;d.click(function(){e._setSelected(a(this).parent(),false);e.count-=1;e._updateCount();return false})},_registerSearchEvents:function(d){var e=this;d.focus(function(){a(this).addClass("ui-state-active")}).blur(function(){a(this).removeClass("ui-state-active")}).keypress(function(b){if(b.keyCode==
424
+ 13)return false}).keyup(function(){e._filter.apply(this,[e.availableList])})}});a.extend(a.ui.multiselect,{defaults:{sortable:true,searchable:true,animated:"fast",show:"slideDown",hide:"slideUp",dividerLocation:0.6,nodeComparator:function(d,e){d=d.text();e=e.text();return d==e?0:d<e?-1:1}},locale:{addAll:"Add all",removeAll:"Remove all",itemsCount:"items selected"}})})(jQuery);