text: /*
   jqGrid 4.13.0 - free jqGrid: https://github.com/free-jqgrid/jqGrid
   Copyright (c) 2008-2014, Tony Tomov, tony@trirand.com
   Copyright (c) 2014-2016, Oleg Kiriljuk, oleg.kiriljuk@ok-soft-gmbh.com
   Dual licensed under the MIT and GPL licenses
   http://www.opensource.org/licenses/mit-license.php
   http://www.gnu.org/licenses/gpl-2.0.html
   Date: 2016-02-20
  */
  (function(a){"function"===typeof define&&define.amd?define(["jquery"],a):"object"===typeof exports?a(require("jquery")):a(jQuery)})(function(a){function oa(a,c,d){if(!(this instanceof oa))return new oa(a);this.aggregator=a;this.finilized=!1;this.context=c;this.pivotOptions=d}function pa(b,c,d,e,f){var g=e.length,h=function(a,b){var c=a,d=b;null==c&&(c="");null==d&&(d="");c=String(c);d=String(d);this.caseSensitive||(c=c.toUpperCase(),d=d.toUpperCase());if(c===d){if(a===b)return 0;if(void 0===a)return-1;
  if(void 0===b)return 1;if(null===a)return-1;if(null===b)return 1}return c<d?-1:1},m=function(a,b){a=Number(a);b=Number(b);return a===b?0:a<b?-1:1},l=function(a,b){a=Math.floor(Number(a));b=Math.floor(Number(b));return a===b?0:a<b?-1:1};this.items=[];this.indexesOfSourceData=[];this.trimByCollect=b;this.caseSensitive=c;this.skipSort=d;this.fieldLength=g;this.fieldNames=Array(g);this.fieldSortDirection=Array(g);this.fieldCompare=Array(g);for(b=0;b<g;b++){c=e[b];this.fieldNames[b]=c[f||"dataName"];switch(c.sorttype){case "integer":case "int":this.fieldCompare[b]=
  l;break;case "number":case "currency":case "float":this.fieldCompare[b]=m;break;default:this.fieldCompare[b]=a.isFunction(c.compare)?c.compare:h}this.fieldSortDirection[b]="desc"===c.sortorder?-1:1}}var Cb={name:"English (United States)",nameEnglish:"English (United States)",isRTL:!1,defaults:{recordtext:"View {0} - {1} of {2}",emptyrecords:"No records to view",loadtext:"Loading...",pgtext:"Page {0} of {1}",pgfirst:"First Page",pglast:"Last Page",pgnext:"Next Page",pgprev:"Previous Page",pgrecs:"Records per Page",
  showhide:"Toggle Expand Collapse Grid",savetext:"Saving..."},search:{caption:"Search...",Find:"Find",Reset:"Reset",odata:[{oper:"eq",text:"equal"},{oper:"ne",text:"not equal"},{oper:"lt",text:"less"},{oper:"le",text:"less or equal"},{oper:"gt",text:"greater"},{oper:"ge",text:"greater or equal"},{oper:"bw",text:"begins with"},{oper:"bn",text:"does not begin with"},{oper:"in",text:"is in"},{oper:"ni",text:"is not in"},{oper:"ew",text:"ends with"},{oper:"en",text:"does not end with"},{oper:"cn",text:"contains"},
  {oper:"nc",text:"does not contain"},{oper:"nu",text:"is null"},{oper:"nn",text:"is not null"}],groupOps:[{op:"AND",text:"all"},{op:"OR",text:"any"}],addGroupTitle:"Add subgroup",deleteGroupTitle:"Delete group",addRuleTitle:"Add rule",deleteRuleTitle:"Delete rule",operandTitle:"Click to select search operation.",resetTitle:"Reset Search Value"},edit:{addCaption:"Add Record",editCaption:"Edit Record",bSubmit:"Submit",bCancel:"Cancel",bClose:"Close",saveData:"Data has been changed! Save changes?",bYes:"Yes",
  bNo:"No",bExit:"Cancel",msg:{required:"Field is required",number:"Please, enter valid number",minValue:"value must be greater than or equal to ",maxValue:"value must be less than or equal to",email:"is not a valid e-mail",integer:"Please, enter valid integer value",date:"Please, enter valid date value",url:"is not a valid URL. Prefix required ('http://' or 'https://')",nodefined:" is not defined!",novalue:" return value is required!",customarray:"Custom function should return array!",customfcheck:"Custom function should be present in case of custom checking!"}},
  view:{caption:"View Record",bClose:"Close"},del:{caption:"Delete",msg:"Delete selected record(s)?",bSubmit:"Delete",bCancel:"Cancel"},nav:{edittext:"",edittitle:"Edit selected row",addtext:"",addtitle:"Add new row",deltext:"",deltitle:"Delete selected row",searchtext:"",searchtitle:"Find records",refreshtext:"",refreshtitle:"Reload Grid",alertcap:"Warning",alerttext:"Please, select row",viewtext:"",viewtitle:"View selected row",savetext:"",savetitle:"Save row",canceltext:"",canceltitle:"Cancel row editing"},
  col:{caption:"Select columns",bSubmit:"Ok",bCancel:"Cancel"},errors:{errcap:"Error",nourl:"No url is set",norecords:"No records to process",model:"Length of colNames <> colModel!"},formatter:{integer:{thousandsSeparator:",",defaultValue:"0"},number:{decimalSeparator:".",thousandsSeparator:",",decimalPlaces:2,defaultValue:"0.00"},currency:{decimalSeparator:".",thousandsSeparator:",",decimalPlaces:2,prefix:"",suffix:"",defaultValue:"0.00"},date:{dayNames:"Sun Mon Tue Wed Thr Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
  monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" "),AmPm:["am","pm","AM","PM"],S:function(a){var c=["st","nd","rd","th"];return 11>a||13<a?c[Math.min((a-1)%10,3)]:"th"},srcformat:"Y-m-d",newformat:"n/j/Y",masks:{ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",YearMonth:"F, Y"}}}};a.jgrid=a.jgrid||{};var u=a.jgrid;u.locales=
  u.locales||{};var Ia=u.locales;if(null==u.defaults||a.isEmptyObject(Ia)||void 0===Ia["en-US"])void 0===Ia["en-US"]&&a.extend(!0,u,{locales:{"en-US":Cb}}),u.defaults=u.defaults||{},void 0===u.defaults.locale&&(u.defaults.locale="en-US");u.defaults=u.defaults||{};var Ja=u.defaults;a.extend(!0,u,{version:"4.13.0",productName:"free jqGrid",defaults:{},search:{},edit:{},view:{},del:{},nav:{},col:{},errors:{},formatter:{unused:""},icons:{jQueryUI:{common:"ui-icon",pager:{first:"ui-icon-seek-first",prev:"ui-icon-seek-prev",
  next:"ui-icon-seek-next",last:"ui-icon-seek-end"},sort:{asc:"ui-icon-triangle-1-n",desc:"ui-icon-triangle-1-s"},gridMinimize:{visible:"ui-icon-circle-triangle-n",hidden:"ui-icon-circle-triangle-s"},nav:{edit:"ui-icon-pencil",add:"ui-icon-plus",del:"ui-icon-trash",search:"ui-icon-search",refresh:"ui-icon-refresh",view:"ui-icon-document",save:"ui-icon-disk",cancel:"ui-icon-cancel",newbutton:"ui-icon-newwin"},actions:{edit:"ui-icon-pencil",del:"ui-icon-trash",save:"ui-icon-disk",cancel:"ui-icon-cancel"},
  form:{close:"ui-icon-closethick",prev:"ui-icon-triangle-1-w",next:"ui-icon-triangle-1-e",save:"ui-icon-disk",undo:"ui-icon-close",del:"ui-icon-scissors",cancel:"ui-icon-cancel",resizableLtr:"ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"},search:{search:"ui-icon-search",reset:"ui-icon-arrowreturnthick-1-w",query:"ui-icon-comment"},subgrid:{plus:"ui-icon-plus",minus:"ui-icon-minus",openLtr:"ui-icon-carat-1-sw",openRtl:"ui-icon-carat-1-se"},grouping:{plus:"ui-icon-circlesmall-plus",minus:"ui-icon-circlesmall-minus"},
  treeGrid:{minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off",plusLtr:"ui-icon-triangle-1-e",plusRtl:"ui-icon-triangle-1-w"}},fontAwesome:{common:"fa",pager:{common:"fa-fw",first:"fa-step-backward",prev:"fa-backward",next:"fa-forward",last:"fa-step-forward"},sort:{common:"fa-lg",asc:"fa-sort-asc",desc:"fa-sort-desc"},gridMinimize:{visible:"fa-chevron-circle-up",hidden:"fa-chevron-circle-down"},nav:{common:"fa-lg fa-fw",edit:"fa-pencil",add:"fa-plus",del:"fa-trash-o",search:"fa-search",refresh:"fa-refresh",
  view:"fa-file-o",save:"fa-floppy-o",cancel:"fa-ban",newbutton:"fa-external-link"},actions:{common:"fa-fw",edit:"fa-pencil",del:"fa-trash-o",save:"fa-floppy-o",cancel:"fa-ban"},form:{close:"fa-times",prev:"fa-caret-left",next:"fa-caret-right",save:"fa-floppy-o",undo:"fa-undo",del:"fa-trash-o",cancel:"fa-ban",resizableLtr:"fa-rss fa-rotate-270"},search:{search:"fa-search",reset:"fa-undo",query:"fa-comments-o"},subgrid:{common:"fa-fw",plus:"fa-plus",minus:"fa-minus",openLtr:"fa-reply fa-rotate-180",
  openRtl:"fa-share fa-rotate-180"},grouping:{common:"fa-fw",plus:"fa-plus-square-o",minus:"fa-minus-square-o"},treeGrid:{common:"fa-fw",minus:"fa-lg fa-sort-desc",leaf:"fa-dot-circle-o",plusLtr:"fa-lg fa-caret-right",plusRtl:"fa-lg fa-caret-left"}},glyph:{common:"glyphicon",pager:{common:"",first:"glyphicon-step-backward",prev:"glyphicon-backward",next:"glyphicon-forward",last:"glyphicon-step-forward"},sort:{common:"",asc:"glyphicon-triangle-top",desc:"glyphicon-triangle-bottom"},gridMinimize:{visible:"glyphicon-circle-arrow-up",
  hidden:"glyphicon-circle-arrow-down"},nav:{common:"",edit:"glyphicon-edit",add:"glyphicon-plus",del:"glyphicon-trash",search:"glyphicon-search",refresh:"glyphicon-refresh",view:"glyphicon-file",save:"glyphicon-save",cancel:"glyphicon-ban-circle",newbutton:"glyphicon-new-window"},actions:{common:"",edit:"glyphicon-edit",del:"glyphicon-trash",save:"glyphicon-save",cancel:"glyphicon-ban-circle"},form:{close:"glyphicon-remove-circle",prev:"glyphicon-step-backward",next:"glyphicon-step-forward",save:"glyphicon-save",
  undo:"glyphicon-repeat",del:"glyphicon-trash",cancel:"glyphicon-ban-circle",resizableLtr:"glyphicon-import"},search:{search:"glyphicon-search",reset:"glyphicon-repeat",query:"glyphicon-cog"},subgrid:{common:"",plus:"glyphicon-zoom-in",minus:"glyphicon-zoom-out",openLtr:"glyphicon-indent-left",openRtl:"glyphicon-indent-left"},grouping:{common:"",plus:"glyphicon-expand",minus:"glyphicon-collapse-down"},treeGrid:{common:"",minus:"glyphicon-triangle-bottom",leaf:"glyphicon-record",plusLtr:"glyphicon-triangle-right",
  plusRtl:"glyphicon-triangle-left"}}},guiStyles:{jQueryUI:{gBox:"ui-jqgrid-jquery-ui ui-widget ui-widget-content ui-corner-all",gView:"",overlay:"ui-widget-overlay",loading:"ui-state-default ui-state-active",hDiv:"ui-state-default ui-corner-top",hTable:"",colHeaders:"ui-state-default",states:{select:"ui-state-highlight",disabled:"ui-state-disabled ui-jqgrid-disablePointerEvents",hover:"ui-state-hover",error:"ui-state-error",active:"ui-state-active",textOfClickable:"ui-state-default"},dialog:{header:"ui-widget-header ui-dialog-titlebar ui-corner-all ui-helper-clearfix",
  window:"ui-jqgrid-jquery-ui ui-widget ui-widget-content ui-corner-all ui-front",document:"",subdocument:"",body:"",footer:"",content:"ui-widget-content",hr:"ui-widget-content",closeButton:"ui-corner-all",fmButton:"ui-state-default",dataField:"ui-widget-content ui-corner-all",viewLabel:"ui-widget-content",viewData:"ui-widget-content",leftCorner:"ui-corner-left",rightCorner:"ui-corner-right",defaultCorner:"ui-corner-all"},filterToolbar:{dataField:"ui-widget-content"},subgrid:{thSubgrid:"ui-state-default",
  rowSubTable:"ui-widget-content",row:"ui-widget-content",tdStart:"",tdWithIcon:"ui-widget-content",buttonDiv:"",button:"",tdData:"ui-widget-content"},grid:"",gridRow:"ui-widget-content",rowNum:"ui-state-default",gridFooter:"",rowFooter:"ui-widget-content",gridTitle:"ui-widget-header ui-corner-top",gridError:"ui-state-error",titleButton:"ui-corner-all",toolbarUpper:"ui-state-default",toolbarBottom:"ui-state-default",actionsDiv:"ui-widget-content",actionsButton:"ui-corner-all",pager:{pager:"ui-state-default",
  pagerButton:"ui-corner-all",pagerInput:"ui-widget-content",pagerSelect:"ui-widget-content"},navButton:"ui-corner-all",searchDialog:{operator:"ui-corner-all",label:"ui-corner-all",elem:"ui-corner-all",operationGroup:"",addRuleButton:"ui-corner-all",deleteRuleButton:"ui-corner-all",operationSelect:"ui-corner-all",addGroupButton:"ui-corner-all",deleteGroupButton:"ui-corner-all"},searchToolbar:{menu:"ui-menu-jqueryui",operButton:"ui-corner-all",clearButton:"ui-corner-all"},top:"ui-corner-top",bottom:"ui-corner-bottom",
  resizer:"ui-widget-header"},bootstrap:{gBox:"ui-jqgrid-bootstrap",gView:"panel-info",overlay:"modal-backdrop",loading:"",hDiv:"",hTable:"table table-hover table-condensed table-bordered",colHeaders:"",states:{select:"success",disabled:"disabled ui-jqgrid-disablePointerEvents",hover:"active",error:"danger",active:"active",textOfClickable:""},dialog:{header:"modal-header",window:"modal ui-jqgrid-bootstrap",document:"modal-dialog",subdocument:"modal-content",body:"modal-body",footer:"modal-footer",content:"modal-content",
  hr:"hidden",closeButton:"btn btn-xs btn-default",fmButton:"btn btn-default",dataField:"form-control",viewLabel:"",viewData:"form-control",leftCorner:"",rightCorner:"",defaultCorner:""},filterToolbar:{dataField:"form-control"},subgrid:{thSubgrid:"",rowSubTable:"",row:"",tdStart:"",tdWithIcon:"",buttonDiv:"",button:"btn btn-xs",tdData:""},grid:"table table-condensed table-hover table-bordered",gridRow:"",rowNum:"",gridFooter:"table table-hover table-condensed table-bordered",rowFooter:"",gridTitle:"",
  gridError:"",titleButton:"btn btn-xs btn-default",actionsDiv:"",actionsButton:"btn btn-xs btn-default",toolbarUpper:"",toolbarBottom:"",pager:{pager:"panel-footer",pagerButton:"btn btn-xs",pagerInput:"form-control",pagerSelect:"form-control"},navButton:"btn btn-xs",searchDialog:{operator:"form-control",label:"form-control",elem:"form-control",operationGroup:"form-inline",addRuleButton:"btn btn-xs btn-default",deleteRuleButton:"btn btn-xs btn-default",operationSelect:"form-control",addGroupButton:"btn btn-xs btn-default",
  deleteGroupButton:"btn btn-xs btn-default"},searchToolbar:{menu:"dropdown-menu",operButton:"btn btn-xs btn-default",clearButton:"btn btn-xs btn-default"},top:"ui-jqgrid-bootstrap-corner-top",bottom:"ui-jqgrid-bootstrap-corner-bottom",resizer:"ui-jqgrid-bootstrap"},bootstrapPrimary:{baseGuiStyle:"bootstrap",dialog:{closeButton:"btn btn-xs close",fmButton:"btn btn-primary"},searchDialog:{addRuleButton:"btn btn-xs btn-primary",deleteRuleButton:"btn btn-xs btn-primary",addGroupButton:"btn btn-xs btn-primary",
  deleteGroupButton:"btn btn-xs btn-primary"}}},htmlDecode:function(a){return a&&("&nbsp;"===a||"&#160;"===a||1===a.length&&160===a.charCodeAt(0))?"":a?String(a).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&#39;/g,"'").replace(/&#47;/g,"/").replace(/&quot;/g,'"').replace(/&amp;/g,"&"):a},htmlEncode:function(a){return a?String(a).replace(/&/g,"&amp;").replace(/\"/g,"&quot;").replace(/\'/g,"&#39;").replace(/\//g,"&#47;").replace(/</g,"&lt;").replace(/>/g,
  "&gt;"):a},oldEncodePostedData:function(a){return a?String(a).replace(/&/g,"&amp;").replace(/\"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):a},oldDecodePostedData:function(a){return a&&("&nbsp;"===a||"&#160;"===a||1===a.length&&160===a.charCodeAt(0))?"":a?String(a).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&"):a},clearArray:function(a){for(;0<a.length;)a.pop()},format:function(b){var c=a.makeArray(arguments).slice(1);null==b&&(b="");return b.replace(/\{(\d+)\}/g,
  function(a,b){return c[b]})},template:function(b){var c=a.makeArray(arguments).slice(1),d,e=c.length;null==b&&(b="");return b.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((\.*?)?\))?)?\}/g,function(b,g){var h,m;if(!isNaN(parseInt(g,10)))return c[parseInt(g,10)];for(d=0;d<e;d++)if(a.isArray(c[d]))for(h=c[d],m=h.length;m--;)if(g===h[m].nm)return h[m].v})},msie:"Microsoft Internet Explorer"===navigator.appName,msiever:function(){var a=-1,c=/(MSIE) ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent);null!=c&&
  3===c.length&&(a=parseFloat(c[2]||-1));return a},fixMaxHeightOfDiv:function(a){return"Microsoft Internet Explorer"===navigator.appName?Math.min(a,1533917):null!=/(Firefox)/.exec(navigator.userAgent)?Math.min(a,17895696):a},getCellIndex:function(b){b=a(b);if(b.is("tr"))return-1;b=(b.is("td")||b.is("th")?b:b.closest("td,th"))[0];return null==b?-1:u.msie?a.inArray(b,b.parentNode.cells):b.cellIndex},stripHtml:function(a){return(a=String(a))?(a=a.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi,""))&&"&nbsp;"!==
  a&&"&#160;"!==a?a.replace(/\"/g,"'"):"":a},stripPref:function(b,c){var d=a.type(b);if("string"===d||"number"===d)b=String(b),c=""!==b?String(c).replace(String(b),""):c;return c},getRes:function(a,c){var d=c.split("."),e=d.length,f;if(null!=a){for(f=0;f<e;f++){if(!d[f])return null;a=a[d[f]];if(void 0===a)break;if("string"===typeof a)break}return a}},parseDate:function(b,c,d,e){var f,g,h,m=0,l=0;f="string"===typeof c?c.match(/^\/Date\((([\-+])?[0-9]+)(([\-+])([0-9]{2})([0-9]{2}))?\)\/$/):null;var n=
  function(a,b){a=String(a);for(b=parseInt(b,10)||2;a.length<b;)a="0"+a;return a},m={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},p=function(a,b){0===a?12===b&&(b=0):12!==b&&(b+=12);return b};e=function(a,b){var c="AmPm dayNames masks monthNames userLocalTime parseRe S srcformat".split(" "),d=b||{},e=(u.formatter||{}).date||{},k=null==a||null==a.locale?{}:((Ia[a.locale]||{}).formatter||{}).date,f,g=c.length,h={},l;for(f=0;f<g;f++)l=c[f],void 0!==d[l]?h[l]=d[l]:void 0!==e[l]?h[l]=e[l]:void 0!==k[l]&&(h[l]=k[l]);
  return h}(this.p,e);void 0===e.parseRe&&(e.parseRe=/[#%\\\/:_;.,\t\s\-]/);e.masks.hasOwnProperty(b)&&(b=e.masks[b]);if(c&&null!=c)if(isNaN(c)||"u"!==String(b).toLowerCase())if(isNaN(c)||"u1000"!==String(b).toLowerCase())if(c.constructor===Date)m=c;else if(null!==f)m=new Date(parseInt(f[1],10)),f[3]&&(l=60*Number(f[5])+Number(f[6]),l*="-"===f[4]?1:-1,l-=m.getTimezoneOffset(),m.setTime(Number(Number(m)+6E4*l)));else{"ISO8601Long"===e.srcformat&&"Z"===c.charAt(c.length-1)&&(l-=(new Date).getTimezoneOffset());
  c=String(c).replace(/\T/g,"#").replace(/\t/,"%").split(e.parseRe);b=b.replace(/\T/g,"#").replace(/\t/,"%").split(e.parseRe);g=0;for(h=Math.min(b.length,c.length);g<h;g++){switch(b[g]){case "M":f=a.inArray(c[g],e.monthNames);-1!==f&&12>f&&(c[g]=f+1,m.m=c[g]);break;case "F":f=a.inArray(c[g],e.monthNames,12);-1!==f&&11<f&&(c[g]=f+1-12,m.m=c[g]);break;case "n":m.m=parseInt(c[g],10);break;case "j":m.d=parseInt(c[g],10);break;case "g":m.h=parseInt(c[g],10);break;case "a":f=a.inArray(c[g],e.AmPm);-1!==f&&
  2>f&&c[g]===e.AmPm[f]&&(c[g]=f,m.h=p(c[g],m.h));break;case "A":f=a.inArray(c[g],e.AmPm),-1!==f&&1<f&&c[g]===e.AmPm[f]&&(c[g]=f-2,m.h=p(c[g],m.h))}void 0!==c[g]&&(m[b[g].toLowerCase()]=parseInt(c[g],10))}m.f&&(m.m=m.f);if(0===m.m&&0===m.y&&0===m.d)return"&#160;";m.m=parseInt(m.m,10)-1;b=m.y;70<=b&&99>=b?m.y=1900+m.y:0<=b&&69>=b&&(m.y=2E3+m.y);m=new Date(m.y,m.m,m.d,m.h,m.i,m.s,m.u);0<l&&m.setTime(Number(Number(m)+6E4*l))}else m=new Date(parseFloat(c));else m=new Date(1E3*parseFloat(c));else m=new Date(m.y,
  m.m,m.d,m.h,m.i,m.s,m.u);e.userLocalTime&&0===l&&(l-=(new Date).getTimezoneOffset(),0<l&&m.setTime(Number(Number(m)+6E4*l)));if(void 0===d)return m;e.masks.hasOwnProperty(d)?d=e.masks[d]:d||(d="Y-m-d");l=m.getHours();b=m.getMinutes();c=m.getDate();p=m.getMonth()+1;f=m.getTimezoneOffset();g=m.getSeconds();h=m.getMilliseconds();var q=m.getDay(),r=m.getFullYear(),t=(q+6)%7+1,w=(new Date(r,p-1,c)-new Date(r,0,1))/864E5,y=5>t?Math.floor((w+t-1)/7)+1:Math.floor((w+t-1)/7)||(4>((new Date(r-1,0,1)).getDay()+
  6)%7?53:52),x={d:n(c),D:e.dayNames[q],j:c,l:e.dayNames[q+7],N:t,S:e.S(c),w:q,z:w,W:y,F:e.monthNames[p-1+12],m:n(p),M:e.monthNames[p-1],n:p,t:"?",L:"?",o:"?",Y:r,y:String(r).substring(2),a:12>l?e.AmPm[0]:e.AmPm[1],A:12>l?e.AmPm[2]:e.AmPm[3],B:"?",g:l%12||12,G:l,h:n(l%12||12),H:n(l),i:n(b),s:n(g),u:h,e:"?",I:"?",O:(0<f?"-":"+")+n(100*Math.floor(Math.abs(f)/60)+Math.abs(f)%60,4),P:"?",T:(String(m).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(m/1E3)};return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(a){return x.hasOwnProperty(a)?x[a]:a.substring(1)})},parseDateToNumber:function(a,c){var d=u.parseDate.call(this,a,c);return d instanceof Date?d.getTime():0},jqID:function(a){return String(a).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g,"\\$&")},getGridComponentId:function(a){if(null==this.p||!this.p.id)return"";var c=this.p.id;switch(a){case 21:return c;
  case 0:return"gbox_"+c;case 8:return"gview_"+c;case 3:return"alertmod_"+c;case 43:return"rs_m"+c;case 45:return"cb_"+c;case 46:return"sopt_menu";default:return""}},getGridComponentIdSelector:function(a){return(a=u.getGridComponentId.call(this,a))?"#"+u.jqID(a):""},isHTMLElement:function(a){return"object"===typeof HTMLElement||"function"===typeof HTMLElement?a instanceof HTMLElement:null!=a&&"object"===typeof a&&1===a.nodeType&&"string"===typeof a.nodeName},getGridComponent:function(b,c){var d;if(c instanceof
  a||0<c.length)d=c[0];else if(u.isHTMLElement(c))d=c,c=a(d);else return a();switch(b){case 21:return c.hasClass("ui-jqgrid-bdiv")?c.find(">div>.ui-jqgrid-btable"):a();case 14:return c.hasClass("ui-jqgrid-hdiv")?c.find(">div>.ui-jqgrid-htable"):a();case 27:return c.hasClass("ui-jqgrid-sdiv")?c.find(">div>.ui-jqgrid-ftable"):a();case 31:return c.hasClass("ui-jqgrid-hdiv")?c.children(".ui-jqgrid-htable"):a();case 36:return c.hasClass("ui-jqgrid-sdiv")?c.children(".ui-jqgrid-ftable"):a();case 18:return c.hasClass("ui-jqgrid-btable")&&
  null!=d.grid?a(d.grid.bDiv):a();case 12:return c.hasClass("ui-jqgrid-btable")&&null!=d.grid?a(d.grid.hDiv):a();case 25:return c.hasClass("ui-jqgrid-btable")&&null!=d.grid?a(d.grid.sDiv):a();default:return a()}},fixScrollOffsetAndhBoxPadding:function(){var b=this.grid;if(b){var c=this.p,d=b.bDiv,e=function(b){var e=a(b).children("div").first();e.css(e.hasClass("ui-jqgrid-hbox-rtl")?"padding-left":"padding-right",c.scrollOffset);b.scrollLeft=d.scrollLeft};0<a(d).width()&&(c.scrollOffset=d.offsetWidth-
  d.clientWidth,e(b.hDiv),b.sDiv&&e(b.sDiv))}},mergeCssClasses:function(){var b=a.makeArray(arguments),c={},d,e,f,g,h=[];for(d=0;d<b.length;d++)for(f=String(b[d]).replace(/[\t\r\n\f]/g," ").split(" "),e=0;e<f.length;e++)g=f[e],""===g||c.hasOwnProperty(g)||(c[g]=!0,h.push(g));return h.join(" ")},hasOneFromClasses:function(b,c){var d=a(b),e=String(c).replace(/[\t\r\n\f]/g," ").split(" "),f=e.length,g;for(g=0;g<f;g++)if(d.hasClass(e[g]))return!0;return!1},hasAllClasses:function(b,c){var d=a(b),e=String(c).replace(/[\t\r\n\f]/g,
  " ").split(" "),f=e.length,g;for(g=0;g<f;g++)if(!d.hasClass(e[g]))return!1;return!0},detectRowEditing:function(b){var c,d,e,f=this.rows,g=this.p,h=a.isFunction;if(!this.grid||null==f||null==g||void 0===g.savedRow||0===g.savedRow.length)return null;for(c=0;c<g.savedRow.length;c++)if(d=g.savedRow[c],"number"===typeof d.id&&"number"===typeof d.ic&&void 0!==d.name&&void 0!==d.v&&null!=f[d.id]&&f[d.id].id===b&&h(a.fn.jqGrid.restoreCell)){if(e=f[d.id],null!=e&&e.id===b)return{mode:"cellEditing",savedRow:d}}else if(d.id===
  b&&h(a.fn.jqGrid.restoreRow))return{mode:"inlineEditing",savedRow:d};return null},getCell:function(b,c){var d=this.grid,e=this.p;if(!d||!e)return a();if(b instanceof a||0<b.length)b=b[0];if("object"!==typeof HTMLTableRowElement&&"function"!==typeof HTMLTableRowElement||!(b instanceof HTMLTableRowElement)||null==b.cells)return a();e=a(b.cells[c]);d=d.fbRows;return null!=d&&c<d[0].cells.length?e.add(d[b.rowIndex].cells[c]):e},getDataFieldOfCell:function(a,c){var d=this.p,e=u.getCell.call(this,a,c);
  d.treeGrid&&0<e.children("div.tree-wrap").length&&(e=e.children("span.cell-wrapperleaf,span.cell-wrapper"));return d.colModel[c].autoResizable?e.children("span."+d.autoResizing.wrapperClassName):e},enumEditableCells:function(b,c,d){var e=this.grid,f=this.rows,g=this.p;if(null==e||null==f||null==g||null==b||null==b.rowIndex||!b.id||!a.isFunction(d))return null;var h,f=g.colModel,m=f.length,l,n,p=b.rowIndex,q,r,t;h=e.fbRows;var w=(e=null!=h)?h[p]:null;e&&(b=this.rows[p]);for(h=0;h<m;h++)if(l=f[h],n=
  l.name,"cb"!==n&&"subgrid"!==n&&"rn"!==n&&(e&&!l.frozen&&(e=!1),q=(e?w:b).cells[h],r=a(q),!r.hasClass("not-editable-cell")&&(t=r.width(),!0===g.treeGrid&&n===g.ExpandColumn?(t-=r.children("div.tree-wrap").outerWidth(),r=r.children("span.cell-wrapperleaf,span.cell-wrapper").first()):t=0,n={rowid:b.id,iCol:h,iRow:p,cmName:n,cm:l,mode:c,td:q,tr:b,trFrozen:w,dataElement:r[0],dataWidth:t},l.edittype||(l.edittype="text"),l=l.editable,l=a.isFunction(l)?l.call(this,n):l,!0===l||"hidden"===l)))if(n.editable=
  l,!1===d.call(this,n))break},getEditedValue:function(b,c,d,e){var f,g,h,m,l,n=c.formatoptions||{};g=c.editoptions||{};var p=g.custom_value,q="[name="+u.jqID(c.name)+"]",r=a(this);if("hidden"===e||"readonly"===e)return a(this).jqGrid("getCell",b.closest("tr.jqgrow").attr("id"),c.name);switch(c.edittype){case "checkbox":f=["Yes","No"];"string"===typeof g.value&&(f=g.value.split(":"));f=b.find("input[type=checkbox]").is(":checked")?f[0]:f[1];break;case "text":case "password":case "textarea":case "button":h=
  b.find("input"+q+",textarea"+q);f=h.val();"date"===h.prop("type")&&3===String(f).split("-").length&&(g=n.newformat||r.jqGrid("getGridRes","formatter.date.newformat"),f=u.parseDate.call(this,"Y-m-d",f,g));break;case "select":h=b.find("select option:selected");g.multiple?(m=[],l=[],h.each(function(){m.push(a(this).val());l.push(a(this).text())}),f=m.join(","),d.text=l.join(",")):(f=h.val(),d.text=h.text());d.value=f;break;case "custom":try{if(a.isFunction(p)){if(f=p.call(this,b.find(".customelement"),
  "get"),void 0===f)throw"e2";}else throw"e1";}catch(t){g=u.info_dialog;b=function(a){r.jqGrid("getGridRes",a)};switch(String(t)){case "e1":h="function 'custom_value' "+b("edit.msg.nodefined");break;case "e2":break;default:h=t.message}g&&a.isFunction(g)?g.call(this,b("errors.errcap"),h,b("edit.bClose")):alert(h)}break;default:f=b.find("*"+q).text()}return f},guid:1,uidPref:"jqg",randId:function(a){return(a||u.uidPref)+u.guid++},getAccessor:function(b,c){var d,e,f=[],g;if(a.isFunction(c))return c(b);
  d=b[c];if(void 0===d)try{if("string"===typeof c&&(f=c.split(".")),g=f.length)for(d=b;d&&g--;)e=f.shift(),d=d[e]}catch(h){}return d},getXmlData:function(b,c,d){var e="string"===typeof c?c.match(/^(.*)\[(\w+)\]$/):null;if(a.isFunction(c))return c(b);if(e&&e[2])return e[1]?a(e[1],b).attr(e[2]):a(b).attr(e[2]);void 0===b&&alert("expr");b=a(b).find(c);return d?b:0<b.length?a(b).text():void 0},cellWidth:function(){var b=a("<div class='ui-jqgrid' style='left:10000px'><div class='ui-jqgrid-view'><div class='ui-jqgrid-bdiv'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;display:block;'></td></tr></table></div></div></div>"),
  c=b.appendTo("body").find("td").width();b.remove();return.1<Math.abs(c-5)},isCellClassHidden:function(b){b=a("<div class='ui-jqgrid' style='left:10000px'><div class='ui-jqgrid-view'><div class='ui-jqgrid-bdiv'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;' class='"+(b||"")+"'></td></tr></table></div></div></div>");var c=b.appendTo("body").find("td").is(":hidden");b.remove();return c},cell_width:!0,ajaxOptions:{},from:function(b){var c=this;return new function(b,
  e){var f=this,g=b,h=!0,m=!1,l=e,n=/[\$,%]/g,p=null,q=null,r=0,t=!1,w="",y=[],x=Object.prototype.toString,B=!0;if("object"===typeof b&&b.push)0<b.length&&(B="object"!==typeof b[0]?!1:!0);else throw"data provides is not an array";this._hasData=function(){return null===g?!1:0===g.length?!1:!0};this._getStr=function(a){var b=[];m&&b.push("jQuery.trim(");b.push("String("+a+")");m&&b.push(")");h||b.push(".toUpperCase()");return b.join("")};this._strComp=function(a){return"string"===typeof a?".toString()":
  ""};this._group=function(a,b){return{field:a.toString(),unique:b,items:[]}};this._toStr=function(b){m&&(b=a.trim(b));b=b.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"');return h?b:b.toUpperCase()};this._funcLoop=function(b){var c=[];a.each(g,function(a,d){c.push(b(d))});return c};this._append=function(a){var b;l=null===l?"":l+(""===w?" && ":w);for(b=0;b<r;b++)l+="(";t&&(l+="!");l+="("+a+")";t=!1;w="";r=0};this._setCommand=function(a,b){p=a;q=b};this._resetNegate=function(){t=!1};this._repeatCommand=
  function(a,b){return null===p?f:null!==a&&null!==b?p(a,b):null!==q&&B?p(q,a):p(a)};this._equals=function(a,b){return 0===f._compare(a,b,1)};this._compare=function(a,b,c){void 0===c&&(c=1);void 0===a&&(a=null);void 0===b&&(b=null);if(null===a&&null===b)return 0;if(null===a&&null!==b)return 1;if(null!==a&&null===b)return-1;if("[object Date]"===x.call(a)&&"[object Date]"===x.call(b))return a<b?-c:a>b?c:0;h||"number"===typeof a||"number"===typeof b||(a=String(a),b=String(b));return a<b?-c:a>b?c:0};this._performSort=
  function(){0!==y.length&&(g=f._doSort(g,0))};this._doSort=function(a,b){var c=y[b].by,d=y[b].dir,e=y[b].type,g=y[b].datefmt,h=y[b].sfunc;if(b===y.length-1)return f._getOrder(a,c,d,e,g,h);b++;c=f._getGroup(a,c,d,e,g);d=[];for(e=0;e<c.length;e++)for(h=f._doSort(c[e].items,b),g=0;g<h.length;g++)d.push(h[g]);return d};this._getOrder=function(b,d,e,g,k,l){var m=[],p=[],r="a"===e?1:-1,q,w;void 0===g&&(g="text");w="float"===g||"number"===g||"currency"===g||"numeric"===g?function(a){a=parseFloat(String(a).replace(n,
  ""));return isNaN(a)?Number.NEGATIVE_INFINITY:a}:"int"===g||"integer"===g?function(a){return a?parseFloat(String(a).replace(n,"")):Number.NEGATIVE_INFINITY}:"date"===g||"datetime"===g?function(a){return u.parseDateToNumber.call(c,k,a)}:a.isFunction(g)?g:function(b){b=null!=b?a.trim(String(b)):"";return h?b:b.toUpperCase()};a.each(b,function(a,b){q=""!==d?u.getAccessor(b,d):b;void 0===q&&(q="");q=w(q,b);p.push({vSort:q,data:b,index:a})});a.isFunction(l)?p.sort(function(a,b){return l.call(c,a.vSort,
  b.vSort,r,a.data,b.data)}):p.sort(function(a,b){return f._compare(a.vSort,b.vSort,r)});g=0;for(var t=b.length;g<t;)e=p[g].index,m.push(b[e]),g++;return m};this._getGroup=function(b,c,d,e,k){var g=[],h=null,l=null;a.each(f._getOrder(b,c,d,e,k),function(a,b){var d=u.getAccessor(b,c);null==d&&(d="");f._equals(l,d)||(l=d,null!==h&&g.push(h),h=f._group(c,d));h.items.push(b)});null!==h&&g.push(h);return g};this.ignoreCase=function(){h=!1;return f};this.useCase=function(){h=!0;return f};this.trim=function(){m=
  !0;return f};this.noTrim=function(){m=!1;return f};this.execute=function(){var b=l,c=[];if(null===b)return f;a.each(g,function(){eval(b)&&c.push(this)});g=c;return f};this.data=function(){return g};this.select=function(b){f._performSort();if(!f._hasData())return[];f.execute();if(a.isFunction(b)){var c=[];a.each(g,function(a,d){c.push(b(d))});return c}return g};this.hasMatch=function(){if(!f._hasData())return!1;f.execute();return 0<g.length};this.andNot=function(a,b,c){t=!t;return f.and(a,b,c)};this.orNot=
  function(a,b,c){t=!t;return f.or(a,b,c)};this.not=function(a,b,c){return f.andNot(a,b,c)};this.and=function(a,b,c){w=" && ";return void 0===a?f:f._repeatCommand(a,b,c)};this.or=function(a,b,c){w=" || ";return void 0===a?f:f._repeatCommand(a,b,c)};this.orBegin=function(){r++;return f};this.orEnd=function(){null!==l&&(l+=")");return f};this.isNot=function(a){t=!t;return f.is(a)};this.is=function(a){f._append("this."+a);f._resetNegate();return f};this._compareValues=function(a,b,d,e,k){var g;g=B?b:"this";
  void 0===d&&(d=null);var h=d,l=void 0===k.stype?"text":k.stype;if(null!==d)switch(l){case "int":case "integer":h=String(h).replace(n,"");h=isNaN(Number(h))||""===h?"0":Number(h);g="parseInt("+g+",10)";h=String(parseInt(h,10));break;case "float":case "number":case "currency":case "numeric":h=String(h).replace(n,"");h=isNaN(Number(h))||""===h?"0":Number(h);g="parseFloat("+g+")";h=String(h);break;case "date":case "datetime":h=String(u.parseDateToNumber.call(c,k.newfmt||"Y-m-d",h));g='jQuery.jgrid.parseDateToNumber.call(jQuery("'+
  c.p.idSel+'")[0],"'+k.srcfmt+'",'+g+")";break;default:g=f._getStr(g),h=f._getStr('"'+f._toStr(h)+'"')}f._append(g+" "+e+" "+h);f._setCommand(a,b);f._resetNegate();return f};this.equals=function(a,b,c){return f._compareValues(f.equals,a,b,"==",c)};this.notEquals=function(a,b,c){return f._compareValues(f.equals,a,b,"!==",c)};this.isNull=function(a,b,c){return f._compareValues(f.equals,a,null,"===",c)};this.greater=function(a,b,c){return f._compareValues(f.greater,a,b,">",c)};this.less=function(a,b,
  c){return f._compareValues(f.less,a,b,"<",c)};this.greaterOrEquals=function(a,b,c){return f._compareValues(f.greaterOrEquals,a,b,">=",c)};this.lessOrEquals=function(a,b,c){return f._compareValues(f.lessOrEquals,a,b,"<=",c)};this.startsWith=function(b,c){var d=null==c?b:c,d=m?a.trim(d.toString()).length:d.toString().length;B?f._append(f._getStr(b)+".substr(0,"+d+") == "+f._getStr('"'+f._toStr(c)+'"')):(null!=c&&(d=m?a.trim(c.toString()).length:c.toString().length),f._append(f._getStr("this")+".substr(0,"+
  d+") == "+f._getStr('"'+f._toStr(b)+'"')));f._setCommand(f.startsWith,b);f._resetNegate();return f};this.endsWith=function(b,c){var d=null==c?b:c,d=m?a.trim(d.toString()).length:d.toString().length;B?f._append(f._getStr(b)+".substr("+f._getStr(b)+".length-"+d+","+d+') == "'+f._toStr(c)+'"'):f._append(f._getStr("this")+".substr("+f._getStr("this")+'.length-"'+f._toStr(b)+'".length,"'+f._toStr(b)+'".length) == "'+f._toStr(b)+'"');f._setCommand(f.endsWith,b);f._resetNegate();return f};this.contains=
  function(a,b){B?f._append(f._getStr(a)+'.indexOf("'+f._toStr(b)+'",0) > -1'):f._append(f._getStr("this")+'.indexOf("'+f._toStr(a)+'",0) > -1');f._setCommand(f.contains,a);f._resetNegate();return f};this.groupBy=function(a,b,c,d){return f._hasData()?f._getGroup(g,a,b,c,d):null};this.orderBy=function(b,c,d,e,k){c=null==c?"a":a.trim(c.toString().toLowerCase());null==d&&(d="text");null==e&&(e="Y-m-d");null==k&&(k=!1);if("desc"===c||"descending"===c)c="d";if("asc"===c||"ascending"===c)c="a";y.push({by:b,
  dir:c,type:d,datefmt:e,sfunc:k});return f};this.custom=function(a,b,d){f._append('jQuery("'+c.p.idSel+'")[0].p.customSortOperations.'+a+'.filter.call(jQuery("'+c.p.idSel+'")[0],{item:this,cmName:"'+b+'",searchValue:"'+d+'"})');f._setCommand(f.custom,b);f._resetNegate();return f};return f}("string"===typeof b?a.data(b):b,null)},serializeFeedback:function(b,c,d){var e=this;e instanceof a&&0<e.length&&(e=e[0]);if("string"===typeof d)return d;c=a(e).triggerHandler(c,d);if("string"===typeof c)return c;
  if(null==c||"object"!==typeof c)c=d;return a.isFunction(b)?b.call(e,c):c},fullBoolFeedback:function(b,c){var d=a.makeArray(arguments).slice(2),e=a(this).triggerHandler(c,d),e=!1===e||"stop"===e?!1:!0;a.isFunction(b)&&(d=b.apply(this,d),!1===d||"stop"===d)&&(e=!1);return e},feedback:function(b,c,d,e){var f=this;f instanceof a&&0<f.length&&(f=f[0]);if(null==b||"string"!==typeof e||2>e.length)return null;var g="on"===e.substring(0,2)?"jqGrid"+c+e.charAt(2).toUpperCase()+e.substring(3):"jqGrid"+c+e.charAt(0).toUpperCase()+
  e.substring(1),h=a.makeArray(arguments).slice(4),m=b[e+d];h.unshift(g);h.unshift(m);return u.fullBoolFeedback.apply(f,h)},builderSortIcons:function(){var b=this,c=b.p,d=a(this).jqGrid("getGuiStyles","states.disabled"),e=function(e){return u.mergeCssClasses("ui-grid-ico-sort","ui-icon-"+e,"horizontal"===c.viewsortcols[1]?"ui-i-"+e:"",d,a(b).jqGrid("getIconRes","sort."+e),"ui-sort-"+c.direction)};return"<span class='s-ico"+(c.sortIconsBeforeText?" jqgrid-icons-first":"")+"' style='display:none'><span class='"+
  e("asc")+"'></span><span class='"+e("desc")+"'></span></span>"},builderFmButon:function(b,c,d,e,f){var g=this.p,h=a(this);return null==g?"":"<a id='"+b+"' class='"+u.mergeCssClasses("fm-button",h.jqGrid("getGuiStyles","dialog.fmButton"),h.jqGrid("getGuiStyles","dialog."+("right"===f?"rightCorner":"left"===f?"leftCorner":"defaultCorner")),"right"===e?"fm-button-icon-right":"left"===e?"fm-button-icon-left":"")+"' role='button' tabindex='0'>"+(d?"<span class='fm-button-icon "+(h.jqGrid("getIconRes",
  d)||d)+"'></span>":"")+(c?"<span class='fm-button-text'>"+c+"</span>":"")+"</a>"},convertOnSaveLocally:function(b,c,d,e,f,g){if(null==this.p)return b;if(a.isFunction(c.convertOnSave))return c.convertOnSave.call(this,{newValue:b,cm:c,oldValue:d,id:e,item:f,iCol:g});if("boolean"!==typeof d&&"number"!==typeof d)return b;"boolean"!==typeof d||"checkbox"!==c.edittype&&"checkbox"!==c.formatter?"number"!==typeof d||isNaN(b)||("number"===c.formatter||"currency"===c.formatter?b=parseFloat(b):"integer"===c.formatter&&
  (b=parseInt(b,10))):(d=String(b).toLowerCase(),c=null!=c.editoptions&&"string"===typeof c.editoptions.value?c.editoptions.value.split(":"):["yes","no"],0<=a.inArray(d,["1","true",c[0].toLowerCase()])?b=!0:0<=a.inArray(d,["0","false",c[1].toLowerCase()])&&(b=!1));return b},parseDataToHtml:function(b,c,d,e,f,g,h){var m=this,l=m.p,n=a(m),p,q,r,t,w,y,x,B=!1,v=[],E=[],A=!0!==l.altRows||n.jqGrid("isBootstrapGuiStyle")?"":l.altclass,F=l.grouping?!0===l.groupingView.groupCollapse:!1,k=parseInt(l.rowNum,10),
  C,K=a.fn.jqGrid,I=!0===l.treeGrid&&-1<l.treeANode?m.rows[l.treeANode].rowIndex+1:m.rows.length,H=m.formatCol,J=function(a,b,c,d,e,k){b=m.formatter(a,b,c,e,"add",k);return"<td role='gridcell' "+H(c,d,b,e,a,k)+">"+b+"</td>"},Y=function(b,c,d,e,k){var f="&nbsp;",g=!0;a.isFunction(l.hasMultiselectCheckBox)&&(g=l.hasMultiselectCheckBox.call(m,{rowid:b,iRow:d,iCol:c,data:k}));g&&(f="<input type='checkbox' id='jqg_"+l.id+"_"+b+"' class='cbox' name='jqg_"+l.id+"_"+b+"'"+(e?" checked='checked' aria-checked='true'":
  " aria-checked='false'")+"/>");return"<td role='gridcell' "+H(c,d,"",null,b,!0)+">"+f+"</td>"},D=function(a,b,c,d){c=(parseInt(c,10)-1)*parseInt(d,10)+1+b;return"<td role='gridcell' class='"+K.getGuiStyles.call(n,"rowNum","jqgrid-rownum")+"' "+H(a,b,c,null,b,!0)+">"+c+"</td>"};1>=I&&(l.rowIndexes={});if("local"===l.datatype&&!l.deselectAfterSort||l.multiPageSelection)B=!0;g&&(k*=g+1);for(g=0;g<Math.min(b,k);g++){t=c[g];w=d[g];y=null!=e?e[g]:w;p=1===f?0:f;q=1===(p+g)%2?A:"";B&&(l.multiselect?(r=-1!==
  a.inArray(t,l.selarrrow))&&null===l.selrow&&(l.selrow=t):r=t===l.selrow);x=v.length;v.push("");for(p=0;p<l.colModel.length;p++)switch(C=l.colModel[p].name,C){case "rn":v.push(D(p,g,l.page,l.rowNum));break;case "cb":v.push(Y(t,p,g,r,w));break;case "subgrid":v.push(K.addSubGridCell.call(n,p,g+f,t,w));break;default:v.push(J(t,w[C],p,g+f,y,w))}v[x]=m.constructTr(t,F,q,w,y,r);v.push("</tr>");l.rowIndexes[t]=I;I++;l.grouping&&K.groupingPrepare&&(E.push(v),l.groupingView._locgr||K.groupingPrepare.call(n,
  w,g),v=[]);v.length>l.maxItemsToJoin&&(v=[v.join("")])}l.grouping&&K.groupingRender&&(h&&(l.groupingView._locgr=!0),v=[K.groupingRender.call(n,E,k)],u.clearArray(E));return v},getMethod:function(b){return this.getAccessor(a.fn.jqGrid,b)},extend:function(b){a.extend(a.fn.jqGrid,b);this.no_legacy_api||a.fn.extend(b)}});var ba=u.clearArray,G=u.jqID,hb=u.getGridComponentIdSelector,ib=u.getGridComponentId,$a=u.getGridComponent,Oa=u.stripPref,Ea=u.randId,qa=u.getAccessor,ab=u.convertOnSaveLocally,lb=u.stripHtml,
  pb=u.htmlEncode,Aa=u.htmlDecode,va=u.mergeCssClasses,da=u.hasOneFromClasses,R=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("");b.unshift(this.p);return u.feedback.apply(this,b)};a.fn.jqGrid=function(b){var c=a.fn.jqGrid,d;if("string"===typeof b){d=c[b];if(!d)throw"jqGrid - No such method: "+b;return d.apply(this,a.makeArray(arguments).slice(1))}return this.each(function(){if(!this.grid){var d=this,f,g,h=a(d),m=a.isFunction,l=a.isArray,n=a.extend,p=a.inArray,q=a.trim,r=a.each,t=
  c.setSelection,w=c.getGridRes,y=m(Ja.fatalError)?Ja.fatalError:alert,x=b.locale||Ja.locale||"en-US",B=null!=Ia[x]&&"boolean"===typeof Ia[x].isRTL?Ia[x].isRTL?"rtl":"ltr":"ltr",v=b.iconSet||Ja.iconSet||("bootstrap"===(b.guiStyle||Ja.guiStyle)||"bootstrapPrimary"===(b.guiStyle||Ja.guiStyle)?"glyph":"jQueryUI"),E=b.guiStyle||Ja.guiStyle||"jQueryUI",A=function(a){return c.getIconRes.call(d,a)},F=function(a,b){return h.jqGrid("getGuiStyles",a,b)};null==b&&(b={datatype:"local"});void 0!==b.datastr&&l(b.datastr)&&
  (g=b.datastr,b.datastr=[]);void 0!==b.data&&(f=b.data,b.data=[]);null!=u.formatter&&null!=u.formatter.unused||y("CRITICAL ERROR!!!\n\n\nOne uses probably\n\n\t$.extend($.jgrid.defaults, {...});\n\nto set default settings of jqGrid instead of the usage the DEEP version of jQuery.extend (with true as the first parameter):\n\n\t$.extend(true, $.jgrid.defaults, {...});\n\nOne other possible reason:\n\nyou included some OLD version of language file (grid.locale-en.js for example) AFTER jquery.jqGrid.min.js. For example all language files of jqGrid 4.7.0 uses non-deep call of jQuery.extend.\n\n\nSome options of jqGrid could still work, but another one will be broken.");
  void 0===b.datatype&&void 0!==b.dataType&&(b.datatype=b.dataType,delete b.dataType);void 0===b.mtype&&void 0!==b.type&&(b.mtype=b.type,delete b.type);d.p={iconSet:v};var k=n(!0,{height:"auto",page:1,rowNum:20,maxRowNum:1E4,autoresizeOnLoad:!1,columnsToReResizing:[],autoResizing:{wrapperClassName:"ui-jqgrid-cell-wrapper",minColWidth:33,maxColWidth:300,adjustGridWidth:!0,compact:!1,fixWidthOnShrink:!1},doubleClickSensitivity:250,minResizingWidth:10,rowTotal:null,records:0,pager:"",pgbuttons:!0,pginput:!0,
  colModel:[],additionalProperties:[],arrayReader:[],rowList:[],colNames:[],sortorder:"asc",threeStateSort:!1,sortname:"",mtype:"GET",altRows:!1,selarrrow:[],savedRow:[],shrinkToFit:!0,xmlReader:{},subGrid:!1,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,singleSelectClickMode:"toggle",beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,onInitGrid:null,loadComplete:null,gridComplete:null,loadError:function(b,c,d){if("abort"!==
  c&&"abort"!==d){var e=a(this.grid.eDiv),f=b.getResponseHeader("Content-Type"),g=e.children(".ui-jqgrid-error"),h=b.responseText||"",l=function(b){var c=document.createElement("div"),d;d=/<body[^>]*>([\s\S]*)<\/body\s*>/gim.exec(b);c.innerHTML=null!=d&&2===d.length?d[1]:b;b=c.getElementsByTagName("script");for(d=b.length;d--;)b[d].parentNode.removeChild(b[d]);b=c.innerHTML;try{""===a.trim(a(b).text())&&(b="")}catch(e){}return b},m=function(b){try{var c=a.parseJSON(b),d=[],e;for(e in c)c.hasOwnProperty(e)&&
  "StackTrace"!==e&&d.push(e+": "+c[e]);b=d.join("<br />")}catch(k){}return b};"text/html"===f?h=l(h):"application/json"===f?h=m(h):"text/plain"===f&&(h=m(h));500!==b.status&&0!==b.status&&(h=(c||d)+(d&&d!==c?": "+d:"")+" "+b.status+" "+b.statusText+(""!==h?"<hr />":"")+h);g.html(h||c||d);e.show();k.errorDisplayTimeout&&setTimeout(function(){g.empty();e.hide()},k.errorDisplayTimeout)}},loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,beforeProcessing:null,onHeaderClick:null,viewrecords:!1,
  loadonce:!1,forceClientSorting:!1,multiselect:!1,multikey:!1,editurl:"clientArray",search:!1,caption:"",hidegrid:!0,hiddengrid:!1,useUnformattedDataForCellAttr:!0,postData:{},userData:{},treeGrid:!1,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",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:!1,gridstate:"visible",
  cellEdit:!1,iCol:-1,iRow:-1,nv:0,loadui:"enable",toolbar:[!1,""],scroll:!1,multiboxonly:!1,deselectAfterSort:!0,multiPageSelection:!1,scrollrows:!1,autowidth:!1,scrollOffset:18,cellLayout:5,subGridWidth:16,multiselectWidth:16,multiselectPosition:"left",gridview:!0,rownumWidth:25,rownumbers:!1,pagerpos:"center",footerrow:!1,userDataOnFooter:!1,hoverrows:!0,altclass:"ui-priority-secondary",viewsortcols:[!1,"vertical",!0],resizeclass:"",autoencode:!1,autoEncodeOnEdit:!1,remapColumns:[],cmNamesInputOrder:[],
  ajaxGridOptions:{},direction:B,toppager:!1,headertitles:!1,scrollTimeout:40,maxItemsToJoin:32768,data:[],lastSelectedData:[],quickEmpty:"quickest",_index:{},iColByName:{},iPropByName:{},reservedColumnNames:["rn","cb","subgrid"],grouping:!1,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:!1,sortitems:[],sortnames:[],summary:[],summaryval:[],displayField:[],groupSummaryPos:[],formatDisplayField:[],_locgr:!1,commonIconClass:A("grouping.common"),
  plusicon:A("grouping.plus"),minusicon:A("grouping.minus")},ignoreCase:!0,cmTemplate:{},idPrefix:"",iconSet:v,guiStyle:E,locale:x,multiSort:!1,treeIcons:{commonIconClass:A("treeGrid.common"),plusLtr:A("treeGrid.plusLtr"),plusRtl:A("treeGrid.plusRtl"),minus:A("treeGrid.minus"),leaf:A("treeGrid.leaf")},subGridOptions:{commonIconClass:A("subgrid.common"),plusicon:A("subgrid.plus"),minusicon:A("subgrid.minus")}},Ja,{navOptions:n(!0,{commonIconClass:A("nav.common"),editicon:A("nav.edit"),addicon:A("nav.add"),
  delicon:A("nav.del"),searchicon:A("nav.search"),refreshicon:A("nav.refresh"),viewicon:A("nav.view"),saveicon:A("nav.save"),cancelicon:A("nav.cancel"),buttonicon:A("nav.newbutton")},u.nav||{}),actionsNavOptions:n(!0,{commonIconClass:A("actions.common"),editicon:A("actions.edit"),delicon:A("actions.del"),saveicon:A("actions.save"),cancelicon:A("actions.cancel")},u.actionsNav||{}),formEditing:n(!0,{commonIconClass:A("form.common"),prevIcon:A("form.prev"),nextIcon:A("form.next"),saveicon:[!0,"left",A("form.save")],
  closeicon:[!0,"left",A("form.undo")]},u.edit||{}),searching:n(!0,{commonIconClass:A("search.common"),findDialogIcon:A("search.search"),resetDialogIcon:A("search.reset"),queryDialogIcon:A("search.query")},u.search||{}),formViewing:n(!0,{commonIconClass:A("form.common"),prevIcon:A("form.prev"),nextIcon:A("form.next"),closeicon:[!0,"left",A("form.cancel")]},u.view||{}),formDeleting:n(!0,{commonIconClass:A("form.common"),delicon:[!0,"left",A("form.del")],cancelicon:[!0,"left",A("form.cancel")]},u.del||
  {})},b||{}),C=function(a){var b=u.getRes(k,a);return void 0!==b?b:w.call(h,"defaults."+a)};k.recordpos=k.recordpos||("rtl"===k.direction?"left":"right");k.subGridOptions.openicon="rtl"===k.direction?A("subgrid.openRtl"):A("subgrid.openLtr");k.autoResizing.widthOfVisiblePartOfSortIcon=void 0!==k.autoResizing.widthOfVisiblePartOfSortIcon?k.autoResizing.widthOfVisiblePartOfSortIcon:"fontAwesome"===k.iconSet?13:12;k.datatype=void 0!==k.datatype?k.datatype:void 0!==f||null==k.url?"local":null!=k.jsonReader&&
  "object"===typeof k.jsonReader?"json":"xml";k.jsonReader=k.jsonReader||{};k.url=k.url||"";k.cellsubmit=void 0!==k.cellsubmit?k.cellsubmit:void 0===k.cellurl?"clientArray":"remote";k.gridview=void 0!==k.gridview?k.gridview:null==k.afterInsertRow;void 0!==f&&(k.data=f,b.data=f);void 0!==g&&(k.datastr=g,b.datastr=g);if("TABLE"!==d.tagName.toUpperCase())y("Element is not a table!");else if(""===d.id&&h.attr("id",Ea()),void 0!==document.documentMode&&5>=document.documentMode)y("Grid can not be used in this ('quirks') mode!");
  else{h.empty().attr("tabindex","0");d.p=k;k.id=d.id;k.idSel="#"+G(d.id);k.gBoxId=ib.call(d,0);k.gBox=hb.call(d,0);k.gViewId=ib.call(d,8);k.gView=hb.call(d,8);k.rsId=ib.call(d,43);k.rs=hb.call(d,43);k.cbId=ib.call(d,45);k.cb=hb.call(d,45);var K=u.fixScrollOffsetAndhBoxPadding,I=function(a){var b={},c,d=a.length;for(c=0;c<d;c++)b[a[c].name]=c;return b},H=function(a){var b={},c,d=a.length,e;for(c=0;c<d;c++)e=a[c],b["string"===typeof e?e:e.name]=c;return b},J=function(){var b={},c,d;this.p.rowIndexes=
  b;for(d=0;d<this.rows.length;d++)c=this.rows[d],a(c).hasClass("jqgrow")&&(b[c.id]=c.rowIndex)},Y=function(){var b,c=k.colModel;b=k.cmNamesInputOrder;var d=k.additionalProperties,e=b.length,f,g,h,l;k.arrayReaderInfos={};f=k.arrayReaderInfos;for(l=0;l<e;l++)g=b[l],0>p(g,k.reservedColumnNames)&&!f.hasOwnProperty(g)&&(h=k.iColByName[g],void 0!==h?f[g]={name:c[h].name,index:h,order:l,type:0}:(h=k.iPropByName[g],void 0!==h?f[g]={name:c[h].name,index:h,order:l,type:1}:g===(k.prmNames.rowidName||"rowid")&&
  (f[g]={index:h,type:2})));e=c.length;for(b=0;b<e;b++)g=c[b].name,0>p(g,k.reservedColumnNames)&&!f.hasOwnProperty(g)&&(f[g]={name:g,index:b,order:l,type:0},l++);e=d.length;for(b=0;b<e;b++)g=d[b],null==g||f.hasOwnProperty(g)||("object"===typeof g&&"string"===a.type(g.name)&&(g=g.name),f[g]={name:g,index:b,order:l,type:1},l++)},D=function(b){var c=a(this).data("pageX");c?(c=String(c).split(";"),c=c[c.length-1],a(this).data("pageX",c+";"+b.pageX)):a(this).data("pageX",b.pageX)},O=function(a,b){a=parseInt(a,
  10);return isNaN(a)?b||0:a},z={headers:[],cols:[],footers:[],dragStart:function(b,c,d,e){var f=a(this.bDiv),g=f.closest(k.gBox).offset();e=e.offset().left+("rtl"===k.direction?0:this.headers[b].width+(u.cell_width?0:O(k.cellLayout,0))-2);this.resizing={idx:b,startX:e,sOL:e,moved:!1,delta:e-c.pageX};this.curGbox=a(k.rs);this.curGbox.prependTo("body");this.curGbox.css({display:"block",left:e,top:d[1]+g.top+1,height:d[2]});this.curGbox.css("height",d[2]-(this.curGbox.outerHeight()-this.curGbox.height())+
  "px");this.curGbox.data("idx",b);this.curGbox.data("delta",e-c.pageX);D.call(this.curGbox,c);R.call($a(21,f)[0],"resizeStart",c,b);document.onselectstart=function(){return!1};a(document).bind("mousemove.jqGrid",function(a){if(z.resizing)return z.dragMove(a),!1}).bind("mouseup.jqGrid"+k.id,function(){if(z.resizing)return z.dragEnd(),!1})},dragMove:function(b){var c=this.resizing;if(c){var d=b.pageX+c.delta-c.startX,e=this.headers;b=e[c.idx];var f="ltr"===k.direction?b.width+d:b.width-d,g=((k.colModel[c.idx]||
  {}).autoResizing||{}).minColWidth||k.minResizingWidth;c.moved=!0;f>g&&(null==this.curGbox&&(this.curGbox=a(k.rs)),this.curGbox.css({left:c.sOL+d}),!0===k.forceFit?(c=e[c.idx+k.nv],d="ltr"===k.direction?c.width-d:c.width+d,d>k.autoResizing.minColWidth&&(b.newWidth=f,c.newWidth=d)):(this.newWidth="ltr"===k.direction?k.tblwidth+d:k.tblwidth-d,b.newWidth=f))}},resizeColumn:function(b,d,e){var f=this.headers,g=this.footers,h=f[b],l=h.newWidth||h.width,m=$a(21,this.bDiv),n=$a(14,this.hDiv).children("thead").children("tr").first()[0].cells,
  l=parseInt(l,10);k.colModel[b].width=l;h.width=l;n[b].style.width=l+"px";this.cols[b].style.width=l+"px";this.fbRows&&(a(this.fbRows[0].cells[b]).css("width",l),a($a(31,this.fhDiv)[0].rows[0].cells[b]).css("width",l));0<g.length&&(g[b].style.width=l+"px");!0!==e&&K.call(m[0]);!0===k.forceFit?(f=f[b+k.nv],l=f.newWidth||f.width,f.width=l,n[b+k.nv].style.width=l+"px",this.cols[b+k.nv].style.width=l+"px",0<g.length&&(g[b+k.nv].style.width=l+"px"),k.colModel[b+k.nv].width=l):(k.tblwidth=this.newWidth||
  k.tblwidth,!0!==e&&(this.hDiv.scrollLeft=this.bDiv.scrollLeft,k.footerrow&&(this.sDiv.scrollLeft=this.bDiv.scrollLeft)));k.autowidth||void 0!==k.widthOrg&&"auto"!==k.widthOrg&&"100%"!==k.widthOrg||!0===e||c.setGridWidth.call(m,this.newWidth+k.scrollOffset,!1);d||R.call(m[0],"resizeStop",l,b)},dragEnd:function(){this.hDiv.style.cursor="default";this.resizing&&(null!==this.resizing&&!0===this.resizing.moved&&(a(this.headers[this.resizing.idx].el).removeData("autoResized"),this.resizeColumn(this.resizing.idx,
  !1)),a(k.rs).removeData("pageX"),this.resizing=!1,setTimeout(function(){a(k.rs).css("display","none").prependTo(k.gBox)},k.doubleClickSensitivity));this.curGbox=null;document.onselectstart=function(){return!0};a(document).unbind("mousemove.jqGrid").unbind("mouseup.jqGrid"+k.id)},populateVisible:function(){var b=this,c=a(b),d=b.grid,e=d.bDiv,f=a(e);d.timer&&clearTimeout(d.timer);d.timer=null;if(f=f.height()){var g,h;if(b.rows.length)try{h=(g=b.rows[1])?a(g).outerHeight()||d.prevRowHeight:d.prevRowHeight}catch(l){h=
  d.prevRowHeight}if(h){d.prevRowHeight=h;g=k.rowNum;d.scrollTop=e.scrollTop;var e=d.scrollTop,m=Math.round(c.position().top)-e,c=m+c.height();h*=g;var n,p,r;c<f&&0>=m&&(void 0===k.lastpage||(parseInt((c+e+h-1)/h,10)||0)<=k.lastpage)&&(p=parseInt((f-c+h-1)/h,10)||1,0<=c||2>p||!0===k.scroll?(n=(Math.round((c+e)/h)||0)+1,m=-1):m=1);0<m&&(n=(parseInt(e/h,10)||0)+1,p=(parseInt((e+f)/h,10)||0)+2-n,r=!0);!p||k.lastpage&&(n>k.lastpage||1===k.lastpage||n===k.page&&n===k.lastpage)||(d.hDiv.loading?d.timer=setTimeout(function(){d.populateVisible.call(b)},
  k.scrollTimeout):(k.page=n,r&&(d.selectionPreserver.call(b),d.emptyRows.call(b,!1,!1)),d.populate.call(b,p)))}}},scrollGrid:function(a){var b=$a(21,this);a&&a.stopPropagation();if(0===b.length)return!0;var c=b[0].grid;k.scroll&&(a=this.scrollTop,void 0===c.scrollTop&&(c.scrollTop=0),a!==c.scrollTop&&(c.scrollTop=a,c.timer&&clearTimeout(c.timer),c.timer=setTimeout(function(){c.populateVisible.call(b[0])},k.scrollTimeout)));c.hDiv.scrollLeft=this.scrollLeft;k.footerrow&&(c.sDiv.scrollLeft=this.scrollLeft)},
  selectionPreserver:function(){var b=a(this),c=k.selrow,d=k.selarrrow?a.makeArray(k.selarrrow):null,e=this.grid.bDiv,f=e.scrollLeft,g=function(){var a;k.selrow=null;if(!k.multiPageSelection){ba(k.selarrrow);if(k.multiselect&&d&&0<d.length)for(a=0;a<d.length;a++)d[a]!==c&&t.call(b,d[a],!1,null);c&&t.call(b,c,!1,null)}e.scrollLeft=f;b.unbind(".selectionPreserver",g)};b.bind("jqGridGridComplete.selectionPreserver",g)}};d.grid=z;R.call(d,"beforeInitGrid");k.iColByName=I(k.colModel);k.iPropByName=H(k.additionalProperties);
  var za=a("<div class='"+F("gView","ui-jqgrid-view")+"' role='grid' aria-multiselectable='"+!!k.multiselect+"'></div>"),L=u.msie,Q;k.direction=q(k.direction.toLowerCase());-1===p(k.direction,["ltr","rtl"])&&(k.direction="ltr");Q=k.direction;a(za).insertBefore(d);h.removeClass("scroll").appendTo(za);var U=a("<div class='"+F("gBox","ui-jqgrid")+"'></div>");a(U).attr({id:k.gBoxId,dir:Q}).insertBefore(za);a(za).attr("id",k.gViewId).appendTo(U);a("<div class='"+F("overlay","jqgrid-overlay")+"' id='lui_"+
  k.id+"'></div>").insertBefore(za);a("<div class='"+F("loading","loading")+"' id='load_"+k.id+"'>"+C("loadtext")+"</div>").insertBefore(za);h.attr({role:"presentation","aria-labelledby":"gbox_"+d.id});var ja=function(){var a=k.remapColumns,b=k.colModel,c=b.length,d=[],e,f;for(e=0;e<c;e++)f=b[e].name,0>p(f,k.reservedColumnNames)&&d.push(f);if(null!=a)for(b=d.slice(),e=0;e<a.length;e++)d[e]=b[a[e]];k.cmNamesInputOrder=d},S=function(a,b,c,f,g,h){var l=k.colModel[a],n=c,p=l.classes,r=l.align?"text-align:"+
  l.align+";":"",q,w=function(a){return"string"===typeof a?a.replace(/\'/g,"&#39;"):a},t=" aria-describedby='"+k.id+"_"+l.name+"'";!0===l.hidden&&(r+="display:none;");if(0===b)r+="width: "+z.headers[a].width+"px;";else if(m(l.cellattr)||"string"===typeof l.cellattr&&null!=u.cellattr&&m(u.cellattr[l.cellattr]))if(a=m(l.cellattr)?l.cellattr:u.cellattr[l.cellattr],k.useUnformattedDataForCellAttr&&null!=h?n=h[l.name]:l.autoResizable&&(n="<span class='"+k.autoResizing.wrapperClassName+"'>",n=c.substring(n.length,
  c.length-7)),f=a.call(d,g,n,f,l,h),"string"===typeof f)for(f=f.replace(/\n/g,"&#xA;");;){c=/^\s*(\w+[\w|\-]*)\s*=\s*([\"|\'])(.*?)\2(.*)/.exec(f);if(null===c||5>c.length)return!q&&l.title&&(q=n),t+" style='"+w(r)+"'"+(p?" class='"+w(p)+"'":"")+(q?" title='"+w(q)+"'":"");g=c[3];f=c[4];switch(c[1].toLowerCase()){case "class":p=p?p+(" "+g):g;break;case "title":q=g;break;case "style":r+=g;break;default:t+=" "+c[1]+"="+c[2]+g+c[2]}}l=(""!==r?"style='"+r+"'":"")+((void 0!==p?" class='"+p+"'":"")+(l.title&&
  n?" title='"+lb(c).replace(/\'/g,"&apos;")+"'":""));return l+=t},V=function(a){return null==a||""===a?"&#160;":k.autoencode?pb(a):String(a)},W=function(a){var b=k.treeReader,c=b.loaded,d=b.leaf_field,e=b.expanded_field,f=function(a){return!0===a||"true"===a||"1"===a};if("nested"===k.treeGridModel&&!a[d]){var g=parseInt(a[b.left_field],10),b=parseInt(a[b.right_field],10);a[d]=b===g+1?!0:!1}void 0!==a[c]&&(a[c]=f(a[c]));a[d]=f(a[d]);a[e]=f(a[e])},M=function(b,c,f,g,h,l){var n=k.colModel[f];if(void 0!==
  n.formatter){b=""!==String(k.idPrefix)?Oa(k.idPrefix,b):b;var p={rowId:b,colModel:n,gid:k.id,pos:f,rowData:l};c=m(n.cellBuilder)?n.cellBuilder.call(d,c,p,g,h):m(n.formatter)?n.formatter.call(d,c,p,g,h):a.fmatter?a.fn.fmatter.call(d,n.formatter,c,p,g,h):V(c)}else c=V(c);c=n.autoResizable&&"actions"!==n.formatter?"<span class='"+k.autoResizing.wrapperClassName+"'>"+c+"</span>":c;k.treeGrid&&"edit"!==h&&(void 0===k.ExpandColumn&&0===f||k.ExpandColumn===n.name)&&(null==l&&(l=k.data[k._index[b]]),b=parseInt(l[k.treeReader.level_field]||
  0,10),b=0===parseInt(k.tree_root_level,10)?b:b-1,f=l[k.treeReader.leaf_field],h=l[k.treeReader.expanded_field],l=l[k.treeReader.icon_field],c="<div class='tree-wrap' style='width:"+18*(b+1)+"px;'><div class='"+va(k.treeIcons.commonIconClass,f?(null!=l&&""!==l?l:k.treeIcons.leaf)+" tree-leaf":h?k.treeIcons.minus+" tree-minus":k.treeIcons.plus+" tree-plus","treeclick")+"' style='"+(!0===k.ExpandColClick?"cursor:pointer;":"")+("rtl"===k.direction?"margin-right:":"margin-left:")+18*b+"px;'></div></div><span class='cell-wrapper"+
  (f?"leaf":"")+"'"+(k.ExpandColClick?" style='cursor:pointer;'":"")+">"+c+"</span>");return c},N=function(b,c){var d=z.bDiv,e=null!=z.fbDiv?z.fbDiv.children(".ui-jqgrid-btable")[0]:null,f=function(b){if(b){var c=b.rows,d=c[0];if(k.deepempty)c&&a(c).slice(1).remove();else if(k.quickEmpty)if("quickest"===k.quickEmpty)b.replaceChild(document.createElement("tbody"),b.tBodies[0]),b.firstChild.appendChild(d);else for(;1<c.length;)b.deleteRow(c.length-1);else a(b.firstChild).empty().append(d)}};a(this).unbind(".jqGridFormatter");
  f(this);f(e);b&&k.scroll&&(a(d.firstChild).css({height:"auto"}),a(d.firstChild.firstChild).css({height:0,display:"none"}),0!==d.scrollTop&&(d.scrollTop=0));!0===c&&k.treeGrid&&(ba(k.data),ba(k.lastSelectedData),k._index={});k.rowIndexes={};k.iRow=-1;k.iCol=-1},wa=function(){var a=k.data,b=a.length,c,f,g,h,p,r,q,w=k.localReader,t=k.additionalProperties,u=w.cell,x,v,C,z=k.arrayReaderInfos;if("local"!==k.datatype||!0!==w.repeatitems){if(k.treeGrid)for(c=0;c<b;c++)W(a[c])}else for(h=!1===k.keyName?m(w.id)?
  w.id.call(d,a):w.id:k.keyName,isNaN(h)?m(h)||null==k.arrayReaderInfos[h]||(p=k.arrayReaderInfos[h].order):p=Number(h),c=0;c<b;c++){f=a[c];g=u?qa(f,u)||f:f;v=l(g);q={};for(x in z)z.hasOwnProperty(x)&&(C=z[x],r=qa(g,v?C.order:C.name),1===C.type&&(C=t[C.index],null!=C&&m(C.convert)&&(r=C.convert(r,g))),void 0!==r&&(q[x]=r));void 0!==q[h]?f=void 0!==q[h]?q[h]:Ea():(f=qa(f,l(f)?p:h),void 0===f&&(f=qa(g,l(g)?p:h)),void 0===f&&(f=Ea()));f=String(f);q[w.id]=f;k.treeGrid&&W(q);n(a[c],q)}},Ka=function(){var a=
  k.data.length,b,c,d,e;b=!1===k.keyName||k.loadonce?k.localReader.id:k.keyName;k._index={};for(c=0;c<a;c++)e=k.data[c],d=qa(e,b),void 0===d&&(d=String(Ea()),void 0===e[b]&&(e[b]=d)),k._index[d]=c},Pa=function(b,d,e,f,g,h){var l="-1",n="",p,r=d?"display:none;":"";e=F("gridRow","jqgrow ui-row-"+k.direction)+(e?" "+e:"")+(h?" "+F("states.select"):"");h=a(this).triggerHandler("jqGridRowAttr",[f,g,b]);"object"!==typeof h&&(h=m(k.rowattr)?k.rowattr.call(this,f,g,b):"string"===typeof k.rowattr&&null!=u.rowattr&&
  m(u.rowattr[k.rowattr])?u.rowattr[k.rowattr].call(this,f,g,b):{});if(null!=h&&!a.isEmptyObject(h)){h.hasOwnProperty("id")&&(b=h.id,delete h.id);h.hasOwnProperty("tabindex")&&(l=h.tabindex,delete h.tabindex);h.hasOwnProperty("style")&&(r+=h.style,delete h.style);h.hasOwnProperty("class")&&(e+=" "+h["class"],delete h["class"]);try{delete h.role}catch(q){}for(p in h)h.hasOwnProperty(p)&&(n+=" "+p+"="+h[p])}k.treeGrid&&parseInt(f[k.treeReader.level_field],10)!==parseInt(k.tree_root_level,10)&&(((f=c.getNodeParent.call(a(this),
  f))&&f.hasOwnProperty(k.treeReader.expanded_field)?f[k.treeReader.expanded_field]:1)||d||(r+="display:none;"));return"<tr role='row' id='"+b+"' tabindex='"+l+"' class='"+e+"'"+(""===r?"":" style='"+r+"'")+n+">"},Fa=function(){var b,c,d=a.fn.fmatter;for(b=0;b<k.colModel.length;b++)c=k.colModel[b].formatter,"string"===typeof c&&null!=d&&m(d[c])&&m(d[c].pageFinalization)&&d[c].pageFinalization.call(this,b)},Z=function(b,c){var f,g,h=k.colModel,l=h.length,n,p=function(a){return null==a||""===a?"&#160;":
  pb(a)},r=function(a){return null==a||""===a?"&#160;":String(a)};for(f=0;f<l;f++)g=h[f],g.cellBuilder=null,b||(n={colModel:g,gid:k.id,pos:f},void 0===g.formatter?g.cellBuilder=k.autoencode?p:r:"string"===typeof g.formatter&&null!=a.fn.fmatter&&m(a.fn.fmatter.getCellBuilder)?g.cellBuilder=a.fn.fmatter.getCellBuilder.call(d,g.formatter,n,c||"add"):m(g.getCellBuilder)&&(g.cellBuilder=g.getCellBuilder.call(d,n,c||"add")))},Ga=function(b,d,e,f){var g=a(this),h=new Date,n=k.datatype,p="local"!==n&&k.loadonce||
  "xmlstring"===n||"jsonstring"===n,r=("xmlstring"===n||"xml"===n)&&a.isXMLDoc(b),q=k.localReader,w=qa;if(b&&("xml"!==n||r)){-1!==k.treeANode||k.scroll?d=1<d?d:1:(z.emptyRows.call(this,!1,!0),d=1);p&&(ba(k.data),ba(k.lastSelectedData),k._index={},k.grouping&&null!=k.groupingView&&(k.groupingView.groups=[],k.groupingView._locgr=!1),k.localReader.id="_id_");k.reccount=0;switch(n){case "xml":case "xmlstring":q=k.xmlReader;w=u.getXmlData;break;case "json":case "jsonp":case "jsonstring":q=k.jsonReader}var t,
  x,v,C,E,y={},K,B=k.colModel,A=B.length,F,H,ea,I,L,Y=k.arrayReaderInfos,D={},Q=function(a){return function(b){b=b.getAttribute(a);return null!==b?b:void 0}},Qa=function(a){return function(){var b=D[a];if(null!=b)return b=b.childNodes,0<b.length?b[0].nodeValue:void 0}};k.page=O(w(b,q.page),k.page);k.lastpage=O(w(b,q.total),1);k.records=O(w(b,q.records));m(q.userdata)?k.userData=q.userdata.call(this,b)||{}:r?w(b,q.userdata,!0).each(function(){k.userData[this.getAttribute("name")]=a(this).text()}):k.userData=
  w(b,q.userdata)||{};Z();var aa={},za=k.additionalProperties,Ba=function(a,b){r&&"string"===typeof b&&(/^\w+$/.test(b)?aa[a]=Qa(b):/^\[\w+\]$/.test(b)&&(aa[a]=Q(b.substring(1,b.length-1))))},G=function(a){var b=a.name,c=r?a.xmlmap||b:"local"===n&&!k.dataTypeOrg||"json"===n||"jsonp"===n?a.jsonmap||b:b;!1!==k.keyName&&!0===a.key&&(k.keyName=b);if("string"===typeof c||m(c))aa[b]=c;m(c)||Ba(b,c)};for(t=0;t<A;t++)G(B[t]);A=za.length;for(t=0;t<A;t++)H=za[t],"object"===typeof H&&null!=H?G(H):Ba(H,H);C=!1===
  k.keyName?m(q.id)?q.id.call(this,b):q.id:k.keyName;isNaN(C)?m(C)||(Y[C]&&(E=Y[C].order),r&&("string"===typeof C&&/^\[\w+\]$/.test(C)?C=Q(C.substring(1,C.length-1)):"string"===typeof C&&/^\w+$/.test(C)&&(C=Qa(C)))):E=Number(C);v=w(b,q.root,!0);if(q.row)if(1===v.length&&"string"===typeof q.row&&/^\w+$/.test(q.row)){A=[];ea=v[0].childNodes;I=ea.length;for(H=0;H<I;H++)L=ea[H],1===L.nodeType&&L.nodeName===q.row&&A.push(L);v=A}else v=w(v,q.row,!0);null==v&&l(b)&&(v=b);v||(v=[]);b=v.length;0<b&&0>=k.page&&
  (k.page=1);G=parseInt(k.rowNum,10);f&&(G*=f+1);var B=[],U=[],fa,A=[];for(t=0;t<b;t++){fa=v[t];x=q.repeatitems&&q.cell?w(fa,q.cell,!0)||fa:fa;K=q.repeatitems&&(r||l(x));y={};D={};if(r&&!K&&null!=x)for(ea=x.childNodes,I=ea.length,H=0;H<I;H++)L=ea[H],1===L.nodeType&&(D[L.nodeName]=L);for(F in Y)Y.hasOwnProperty(F)&&(H=Y[F],K?(ea=x[H.order],r&&null!=ea&&(ea=ea.textContent||ea.text)):ea=null!=aa[F]&&"string"!==typeof aa[F]?aa[F](x):w(x,"string"===typeof aa[F]?aa[F]:H.name),1===H.type&&(H=za[H.index],null!=
  H&&m(H.convert)&&(ea=H.convert(ea,x))),void 0!==ea&&(y[F]=ea));void 0!==y[C]?fa=void 0!==y[C]?y[C]:Ea():(fa=w(fa,l(fa)?E:C),void 0===fa&&(fa=w(x,l(x)?E:C)),void 0===fa&&(fa=Ea()));void 0===y[C]&&(y[C]=fa);fa=String(fa);K=k.idPrefix+fa;k.treeGrid&&W(y);if(t<G)U.push(K),B.push(x),A.push(y);else if(!p)break;if(p||!0===k.treeGrid)y._id_=fa,k.data.push(y),k._index[y._id_]=k.data.length-1}if(!p||!k.forceClientSorting||!0===k.treeGrid){d=u.parseDataToHtml.call(this,b,U,A,B,d,f,p);Z(!0);f=-1<k.treeANode?
  k.treeANode:0;q=a(this.tBodies[0]);!0===k.treeGrid&&0<f?a(this.rows[f]).after(d.join("")):k.scroll?q.append(d.join("")):(null==this.firstElementChild||void 0!==document.documentMode&&9>=document.documentMode?q.html(q.html()+d.join("")):this.firstElementChild.innerHTML+=d.join(""),this.grid.cols=this.rows[0].cells);k.grouping&&J.call(this);if(!0===k.subGrid)try{c.addSubGrid.call(g,k.iColByName.subgrid)}catch(P){}if(!1===k.gridview||m(k.afterInsertRow))for(t=0;t<Math.min(b,G);t++)R.call(this,"afterInsertRow",
  U[t],A[t],B[t]);k.totaltime=new Date-h;0<t&&0===k.records&&(k.records=b);ba(d);if(!0===k.treeGrid)try{c.setTreeNode.call(g,f+1,t+f+1)}catch(P){}k.reccount=Math.min(b,G);k.treeANode=-1;k.userDataOnFooter&&c.footerData.call(g,"set",k.userData,!0);p&&(k.records=b,k.lastpage=Math.ceil(b/G));e||this.updatepager(!1,!0);Fa.call(this)}}},db=function(){function b(a){var c=0,d,e,f,g,h,l,p;if(null!=a.groups){(e=a.groups.length&&"OR"===a.groupOp.toString().toUpperCase())&&A.orBegin();for(d=0;d<a.groups.length;d++){0<
  c&&e&&A.or();try{b(a.groups[d])}catch(r){y(r)}c++}e&&A.orEnd()}if(null!=a.rules)try{(f=a.rules.length&&"OR"===a.groupOp.toString().toUpperCase())&&A.orBegin();for(d=0;d<a.rules.length;d++)h=a.rules[d],g=a.groupOp.toString().toUpperCase(),K[h.op]&&h.field?(0<c&&g&&"OR"===g&&(A=A.or()),p=n[h.field],l=p.reader,A=K[h.op](A,g)(m(l)?'jQuery.jgrid.getAccessor(this,jQuery("'+k.idSel+'")[0].p.colModel['+p.iCol+"].jsonmap)":"jQuery.jgrid.getAccessor(this,'"+l+"')",h.data,n[h.field])):null!=k.customSortOperations&&
  null!=k.customSortOperations[h.op]&&m(k.customSortOperations[h.op].filter)&&(A=A.custom(h.op,h.field,h.data)),c++;f&&A.orEnd()}catch(r){y(r)}}var d=a(this),e=k.multiSort?[]:"",f={},g=!1,n={},p=[],q=[],t=w.call(h,"formatter.date.srcformat"),C=w.call(h,"formatter.date.newformat");if(!l(k.data))return{};k.multiSort&&rb(e,f);var x=k.grouping?k.groupingView:!1,v,z,E=function(a,b,c){var d=a.index||a.name,f=a.sorttype||"text";n[a.name]={reader:k.dataTypeOrg?a.name:a.jsonmap||a.name,iCol:b,stype:f,srcfmt:"",
  newfmt:"",sfunc:a.sortfunc||null,isAddProp:!0===c?!0:!1};if("date"===f||"datetime"===f)a.formatter&&"string"===typeof a.formatter&&"date"===a.formatter?(b=a.formatoptions&&a.formatoptions.srcformat?a.formatoptions.srcformat:t,c=a.formatoptions&&a.formatoptions.newformat?a.formatoptions.newformat:C):b=c=a.datefmt||"Y-m-d",n[a.name].srcfmt=b,n[a.name].newfmt=c;if(k.grouping)for(z=0,v=x.groupField.length;z<v;z++)a.name===x.groupField[z]&&(p[z]=n[d],q[z]=d);k.multiSort||g||a.index!==k.sortname&&a.name!==
  k.sortname||(e=a.name,g=!0)};r(k.colModel,function(a){E(this,a)});r(k.additionalProperties,function(a){E("string"===typeof this?{name:this}:this,a,!0)});if(k.treeGrid)return c.SortTree.call(d,e,k.sortorder,null!=n[e]&&n[e].stype?n[e].stype:"text",null!=n[e]&&n[e].srcfmt?n[e].srcfmt:""),!1;var K={eq:function(a){return a.equals},ne:function(a){return a.notEquals},lt:function(a){return a.less},le:function(a){return a.lessOrEquals},gt:function(a){return a.greater},ge:function(a){return a.greaterOrEquals},
  cn:function(a){return a.contains},nc:function(a,b){return"OR"===b?a.orNot().contains:a.andNot().contains},bw:function(a){return a.startsWith},bn:function(a,b){return"OR"===b?a.orNot().startsWith:a.andNot().startsWith},en:function(a,b){return"OR"===b?a.orNot().endsWith:a.andNot().endsWith},ew:function(a){return a.endsWith},ni:function(a,b){return"OR"===b?a.orNot().equals:a.andNot().equals},"in":function(a){return a.equals},nu:function(a){return a.isNull},nn:function(a,b){return"OR"===b?a.orNot().isNull:
  a.andNot().isNull}},A=u.from.call(this,k.data);k.ignoreCase&&(A=A.ignoreCase());if(!0===k.search){var B=k.postData.filters;if(B)"string"===typeof B&&(B=a.parseJSON(B)),b(B);else try{var H=n[k.postData.searchField],A=K[k.postData.searchOper](A)(m(H.reader)?'jQuery.jgrid.getAccessor(this,jQuery("'+k.idSel+'")[0].p.colModel['+H.iCol+"].jsonmap)":"jQuery.jgrid.getAccessor(this,'"+H.reader+"')",k.postData.searchString,n[k.postData.searchField])}catch(ea){}}if(k.grouping)for(z=0;z<v;z++)A.orderBy(q[z],
  x.groupOrder[z],p[z].stype,p[z].srcfmt);k.multiSort?r(e,function(){A.orderBy(this,f[this],n[this].stype,n[this].srcfmt,n[this].sfunc)}):e&&k.sortorder&&g&&A.orderBy(k.sortname,"DESC"===k.sortorder.toUpperCase()?"d":"a",n[e].stype,n[e].srcfmt,n[e].sfunc);k.lastSelectedData=A.select();var B=parseInt(k.rowNum,10),H=k.lastSelectedData.length,F=parseInt(k.page,10),J=Math.ceil(H/B),L={};if(k.grouping&&k.groupingView._locgr){k.groupingView.groups=[];var I,Y,D;if(k.footerrow&&k.userDataOnFooter){for(Y in k.userData)k.userData.hasOwnProperty(Y)&&
  (k.userData[Y]=0);D=!0}for(I=0;I<H;I++){if(D)for(Y in k.userData)k.userData.hasOwnProperty(Y)&&(k.userData[Y]+=parseFloat(k.lastSelectedData[I][Y]||0));c.groupingPrepare.call(d,k.lastSelectedData[I],I,B)}}n=A=null;d=k.localReader;L[d.total]=J;L[d.page]=F;L[d.records]=H;L[d.root]=k.lastSelectedData.slice((F-1)*B,F*B);L[d.userdata]=k.userData;return L},bb=function(b){var c=b.outerWidth();0>=c&&(c=a(this).closest(".ui-jqgrid>.ui-jqgrid-view").css("font-size")||"11px",a(document.body).append("<div id='testpg' class='"+
  F("gBox","ui-jqgrid")+"' style='font-size:"+c+";visibility:hidden;margin:0;padding:0;' ></div>"),a(b).clone().appendTo("#testpg"),c=a("#testpg>.ui-pg-table").width(),a("#testpg").remove());0<c&&b.parent().width(c);return c},jb=function(b,c){var d=this,e=a(d),f=d.grid,g,l,m,n,p,r,q=k.pager||"",t=k.pager?"_"+k.pager.substr(1):"";g=f.bDiv;var x=a.fmatter?a.fmatter.NumberFormat:null,v=k.toppager?"_"+k.toppager.substr(1):"",z=F("states.hover"),A=F("states.disabled");l=parseInt(k.page,10)-1;0>l&&(l=0);
  l*=parseInt(k.rowNum,10);n=l+k.reccount;if(k.scroll){r=a($a(21,g)[0].rows).slice(1);l=n-r.length;k.reccount=r.length;if(r=r.outerHeight()||f.prevRowHeight)m=l*r,p=u.fixMaxHeightOfDiv.call(d,parseInt(k.records,10)*r),a(g).children("div").first().css({height:p+"px"}).children("div").first().css({height:m+"px",display:m+"px"?"":"none"}),0===g.scrollTop&&1<k.page&&(g.scrollTop=k.rowNum*(k.page-1)*r);g.scrollLeft=f.hDiv.scrollLeft}if(q+=k.toppager?(q?",":"")+k.toppager:"")r=w.call(h,"formatter.integer")||
  {},f=O(k.page),g=O(k.lastpage),a(".selbox",q).prop("disabled",!1),!0===k.pginput&&(a(".ui-pg-input",q).val(k.page),m=k.toppager?"#sp_1"+t+",#sp_1"+v:"#sp_1"+t,a(m).html(a.fmatter?x(k.lastpage,r):k.lastpage).closest(".ui-pg-table").each(function(){bb.call(d,a(this))})),k.viewrecords&&(0===k.reccount?a(".ui-paging-info",q).html(C("emptyrecords")):(m=l+1,p=k.records,a.fmatter&&(m=x(m,r),n=x(n,r),p=x(p,r)),a(".ui-paging-info",q).html(u.format(C("recordtext"),m,n,p)))),!0===k.pgbuttons&&(0>=g&&(f=0),0>=
  f&&(f=g=0),1===f||0===f?(a("#first"+t+", #prev"+t).addClass(A).removeClass(z),k.toppager&&a("#first_t"+v+", #prev_t"+v).addClass(A).removeClass(z)):(a("#first"+t+", #prev"+t).removeClass(A),k.toppager&&a("#first_t"+v+", #prev_t"+v).removeClass(A)),f===g||0===f?(a("#next"+t+", #last"+t).addClass(A).removeClass(z),k.toppager&&a("#next_t"+v+", #last_t"+v).addClass(A).removeClass(z)):(a("#next"+t+", #last"+t).removeClass(A),k.toppager&&a("#next_t"+v+", #last_t"+v).removeClass(A)));!0===b&&!0===k.rownumbers&&
  a(">td.jqgrid-rownum",d.rows).each(function(b){a(this).html(l+1+b)});c&&k.jqgdnd&&e.jqGrid("gridDnD","updateDnD");R.call(d,"gridComplete");e.triggerHandler("jqGridAfterGridComplete")},ea=function(){this.grid.hDiv.loading=!0;k.hiddengrid||c.progressBar.call(a(this),{method:"show",loadtype:k.loadui,htmlcontent:C("loadtext")})},Qa=function(){this.grid.hDiv.loading=!1;c.progressBar.call(a(this),{method:"hide",loadtype:k.loadui})},Ba=function(b){var f=this,g=a(f),h=f.grid;if(!h.hDiv.loading){var l=k.scroll&&
  !1===b,p={},r,q=k.prmNames;0>=k.page&&(k.page=Math.min(1,k.lastpage));null!==q.search&&(p[q.search]=k.search);null!==q.nd&&(p[q.nd]=(new Date).getTime());if(isNaN(parseInt(k.rowNum,10))||0>=parseInt(k.rowNum,10))k.rowNum=k.maxRowNum;null!==q.rows&&(p[q.rows]=k.rowNum);null!==q.page&&(p[q.page]=k.page);null!==q.sort&&(p[q.sort]=k.sortname);null!==q.order&&(p[q.order]=k.sortorder);null!==k.rowTotal&&null!==q.totalrows&&(p[q.totalrows]=k.rowTotal);var t=m(k.loadComplete),w=t?k.loadComplete:null,v=0;
  b=b||1;1<b?null!==q.npage?(p[q.npage]=b,v=b-1,b=1):w=function(a){k.page++;h.hDiv.loading=!1;t&&k.loadComplete.call(f,a);Ba.call(f,b-1)}:null!==q.npage&&delete k.postData[q.npage];if(k.grouping&&c.groupingSetup){c.groupingSetup.call(g);var x=k.groupingView,C,A="",E,y,B;for(C=0;C<x.groupField.length;C++){E=x.groupField[C];for(y=0;y<k.colModel.length;y++)B=k.colModel[y],B.name===E&&B.index&&(E=B.index);A+=E+" "+x.groupOrder[C]+", "}p[q.sort]=A+p[q.sort]}n(k.postData,p);var H=k.scroll?f.rows.length-1:
  1,F=function(){K.call(f);var a=g.width(),b=g.closest(".ui-jqgrid-view").width(),d=g.css("height");b<a&&0===k.reccount?g.css("height","1px"):"0"!==d&&"0px"!==d&&g.css("height","");k.autowidth||void 0!==k.widthOrg&&"auto"!==k.widthOrg&&"100%"!==k.widthOrg||c.setGridWidth.call(g,k.tblwidth+k.scrollOffset,!1)},L=function(){var a;if(k.autoresizeOnLoad)c.autoResizeAllColumns.call(g);else for(a=0;a<k.columnsToReResizing.length;a++)c.autoResizeColumn.call(g,k.columnsToReResizing[a]);ba(k.columnsToReResizing)},
  q=function(){R.call(f,"loadComplete",r);L();g.triggerHandler("jqGridAfterLoadComplete",[r]);Qa.call(f);k.datatype="local";k.datastr=null;F()},I=function(a){g.triggerHandler("jqGridLoadComplete",[a]);w&&w.call(f,a);L();g.triggerHandler("jqGridAfterLoadComplete",[a]);l&&h.populateVisible.call(f);1===b&&Qa.call(f);F()},J=function(){var a=db.call(f);Ga.call(f,a,H,1<b,v);I(a)};if(R.call(f,"beforeRequest"))if(m(k.datatype))k.datatype.call(f,k.postData,"load_"+k.id,H,b,v);else switch(p=k.datatype.toLowerCase(),
  p){case "json":case "jsonp":case "xml":case "script":a.ajax(n({url:k.url,type:k.mtype,dataType:p,data:u.serializeFeedback.call(d,k.serializeGridData,"jqGridSerializeGridData",k.postData),success:function(c,d,e){k.jqXhr=null;a(z.eDiv).hide();if(m(k.beforeProcessing)&&!1===k.beforeProcessing.call(f,c,d,e))Qa.call(f);else if(Ga.call(f,c,H,1<b,v),I(c),k.loadonce||k.treeGrid)k.dataTypeOrg=k.datatype,k.datatype="local",k.forceClientSorting&&J()},error:function(a,c,d){k.jqXhr=null;m(k.loadError)&&k.loadError.call(f,
  a,c,d);1===b&&Qa.call(f)},beforeSend:function(a,b){var c=!0;m(k.loadBeforeSend)&&(c=k.loadBeforeSend.call(f,a,b));void 0===c&&(c=!0);if(!1===c)return!1;k.jqXhr=a;ea.call(f)}},u.ajaxOptions,k.ajaxGridOptions));break;case "xmlstring":ea.call(f);r="string"===typeof k.datastr?a.parseXML(k.datastr):k.datastr;Ga.call(f,r);q();k.forceClientSorting&&J();break;case "jsonstring":ea.call(f);r="string"===typeof k.datastr?a.parseJSON(k.datastr):k.datastr;Ga.call(f,r);q();k.forceClientSorting&&J();break;case "local":case "clientside":ea.call(f),
  k.datatype="local",J()}}},fa=function(b){var c=this.grid;a(k.cb,c.hDiv).prop("checked",b);k.frozenColumns&&a(k.cb,c.fhDiv).prop("checked",b)},sb=function(b,c){var f=F("states.hover"),g=F("states.disabled"),h="<td class='ui-pg-button "+g+"'><span class='ui-separator'></span></td>",l="",m="<table style='table-layout:auto;white-space: pre;"+("left"===k.pagerpos?"margin-right:auto;":"right"===k.pagerpos?"margin-left:auto;":"margin-left:auto;margin-right:auto;")+"' class='ui-pg-table'><tbody><tr>",n="",
  p,q,r,t,w=function(a,b,c){if(!R.call(d,"onPaging",a,{newPage:b,currentPage:O(k.page,1),lastPage:O(k.lastpage,1),currentRowNum:O(k.rowNum,10),newRowNum:c}))return!1;k.selrow=null;k.multiselect&&(k.multiPageSelection||ba(k.selarrrow),fa.call(d,!1));ba(k.savedRow);return!0};c+="_"+b;p="pg_"+b;q=b+"_left";r=b+"_center";t=b+"_right";a("#"+G(b)).append("<div id='"+p+"' class='ui-pager-control' role='group'><table class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;'><tbody><tr><td id='"+
  q+"' style='text-align:left;"+(void 0!==k.pagerLeftWidth?"width:"+k.pagerLeftWidth+"px;":"")+"'></td><td id='"+r+"' style='text-align:center;white-space:pre;"+(void 0!==k.pagerCenterWidth?"width:"+k.pagerCenterWidth+"px;":"")+"'></td><td id='"+t+"' style='text-align:right;"+(void 0!==k.pagerRightWidth?"width:"+k.pagerRightWidth+"px;":"")+"'></td></tr></tbody></table></div>").attr("dir","ltr");p="#"+G(p);if(0<k.rowList.length){n="<td dir='"+Q+"'>";q=C("pgrecs");n+="<select class='"+F("pager.pagerSelect",
  "ui-pg-selbox")+"' "+(q?"title='"+q+"'":"")+">";for(q=0;q<k.rowList.length;q++)r=k.rowList[q].toString().split(":"),1===r.length&&(r[1]=r[0]),n+="<option value='"+r[0]+"'"+(O(k.rowNum,0)===O(r[0],0)?" selected='selected'":"")+">"+r[1]+"</option>";n+="</select></td>"}"rtl"===Q&&(m+=n);!0===k.pginput&&(l="<td dir='"+Q+"'>"+u.format(C("pgtext")||"","<input class='"+F("pager.pagerInput","ui-pg-input")+"' type='text' size='2' maxlength='7' value='0'/>","<span id='sp_1_"+b+"'>0</span>")+"</td>");b="#"+
  G(b);if(!0===k.pgbuttons){r=["first","prev","next","last"];var v=F("pager.pagerButton","ui-pg-button");t=function(a){var b=C("pg"+a);return"<td role='button' tabindex='0' id='"+a+c+"' class='"+v+"' "+(b?"title='"+b+"'":"")+"><span class='"+A("pager."+a)+"'></span></td>"};"rtl"===Q&&r.reverse();for(q=0;q<r.length;q++)m+=t(r[q]),1===q&&(m+=""!==l?h+l+h:"")}else""!==l&&(m+=l);"ltr"===Q&&(m+=n);m+="</tr></tbody></table>";!0===k.viewrecords&&a("td"+b+"_"+k.recordpos,p).append("<span dir='"+Q+"' style='text-align:"+
  k.recordpos+"' class='ui-paging-info'></span>");var x=a("td"+b+"_"+k.pagerpos,p);x.append(m);h=bb.call(this,x.children(".ui-pg-table"));k._nvtd=[];k._nvtd[0]=h?Math.floor((k.width-h)/2):Math.floor(k.width/3);k._nvtd[1]=0;m=null;a(".ui-pg-selbox",p).bind("change",function(){var b=O(this.value,10),c=Math.round(k.rowNum*(k.page-1)/b-.5)+1;if(!w("records",c,b))return!1;k.page=c;k.rowNum=b;k.pager&&a(".ui-pg-selbox",k.pager).val(b);k.toppager&&a(".ui-pg-selbox",k.toppager).val(b);Ba.call(d);return!1});
  !0===k.pgbuttons&&(a(".ui-pg-button",p).hover(function(){da(this,g)?this.style.cursor="default":(a(this).addClass(f),this.style.cursor="pointer")},function(){da(this,g)||(a(this).removeClass(f),this.style.cursor="default")}),a("#first"+G(c)+", #prev"+G(c)+", #next"+G(c)+", #last"+G(c)).click(function(){if(da(this,g))return!1;var a=O(k.page,1),b=a,f=this.id,h=O(k.lastpage,1),l=!1,m=!0,n=!0,p=!0,q=!0;0===h||1===h?(1>=a&&(n=m=!1),q=p=!1):1<h&&1<=a?1===a?n=m=!1:a===h&&(q=p=!1):1<h&&0===a&&(q=p=!1,a=h-
  1);this.id==="first"+c&&m&&(f="first",b=1,l=!0);this.id==="prev"+c&&n&&(f="prev",b=a-1,l=!0);this.id==="next"+c&&p&&(f="next",b=a+1,l=!0);this.id==="last"+c&&q&&(f="last",b=h,l=!0);if(!w(f,b,O(k.rowNum,10)))return!1;k.page=b;l&&Ba.call(d);return!1}));!0===k.pginput&&a("input.ui-pg-input",p).bind("keypress.jqGrid",function(b){b=b.charCode||b.keyCode||0;var c=O(a(this).val(),1);if(13===b){if(!w("user",c,O(k.rowNum,10)))return!1;a(this).val(c);k.page=0<a(this).val()?a(this).val():k.page;Ba.call(d);return!1}return this});
  x.children(".ui-pg-table").bind("keydown.jqGrid",function(a){13===a.which&&(a=x.find(":focus"),0<a.length&&a.trigger("click"))})},rb=function(b,c,d){r((k.sortname+" "+k.sortorder).split(","),function(){var c=a.trim(this).split(" ");2===c.length&&b.push(c[0])});if(null!=d){var e=a.inArray(d.index||d.name,b);""!==d.lso&&0>e?b.push(d.index||d.name):""===d.lso&&0<=e&&b.splice(e,1)}r(k.colModel,function(){var d=this.index||this.name,e;this.lso&&(e=this.lso.split("-"),0>a.inArray(d,b)&&b.push(d),c[d]=e[e.length-
  1])})},Db=function(b,c){var f="",g=k.colModel[b],h,l=F("states.disabled"),m=k.frozenColumns?a(c):a(d.grid.headers[b].el);h=m.find("span.s-ico");var n=h.children("span.ui-icon-asc"),p=h.children("span.ui-icon-desc"),q=n,t=p,w=[],v={};m.find("span.ui-grid-ico-sort").addClass(l);m.attr("aria-selected","false");g.lso?(h.show(),h=g.lso.split("-"),h=h[h.length-1],"desc"===h&&(q=p,t=n),q.removeClass(l).css("display",""),k.showOneSortIcon&&t.hide(),m.attr("aria-selected","true")):k.viewsortcols[0]||h.hide();
  rb(w,v,g);r(w,function(){0<f.length&&(f+=", ");f+=this+" "+v[this];k.sortorder=v[this]});k.sortname=f.substring(0,f.length-k.sortorder.length-1)},tb=function(b,d,e,f,g){var h=this.grid,l=k.colModel[d],m=F("states.disabled");if(null!=l&&l.sortable&&!(0<k.savedRow.length)){e||(k.lastsort===d&&""!==k.sortname?(k.sortorder="asc"===k.sortorder?"desc":"desc"===k.sortorder?"asc":l.firstsortorder||"asc",l.lso?"asc"===l.lso?l.lso+="-desc":"desc"===l.lso?l.lso+="-asc":"asc-desc"!==l.lso&&"desc-asc"!==l.lso||
  !k.threeStateSort&&!k.multiSort||(l.lso=""):l.lso=l.firstsortorder||"asc"):l.lso=k.sortorder=l.firstsortorder||"asc",k.page=1);if(k.multiSort)Db(d,g);else{if(f){if(k.lastsort===d&&k.sortorder===f&&!e)return;k.sortorder=f}l=h.headers;e=h.fhDiv;f=l[k.lastsort]?a(l[k.lastsort].el):a();g=k.frozenColumns?a(g):a(l[d].el);var n=g.find("span.s-ico"),p=n.children("span.ui-icon-"+k.sortorder),q=n.children("span.ui-icon-"+("asc"===k.sortorder?"desc":"asc")),l=k.colModel[k.lastsort];f.find("span.ui-grid-ico-sort").addClass(m);
  f.attr("aria-selected","false");k.frozenColumns&&(e.find("span.ui-grid-ico-sort").addClass(m),e.find("th").attr("aria-selected","false"));k.viewsortcols[0]||(k.lastsort!==d?(k.frozenColumns&&e.find("span.s-ico").hide(),f.find("span.s-ico").hide(),n.show()):""===k.sortname&&n.show());k.lastsort!==d&&"true"===f.data("autoResized")&&(null!=l&&null!=l.autoResizing&&l.autoResizing.compact||k.autoResizing.compact)&&k.columnsToReResizing.push(k.lastsort);l=k.colModel[d];n.css("display","");""!==l.lso?(p.removeClass(m).css("display",
  ""),k.showOneSortIcon&&q.removeClass(m).hide(),g.attr("aria-selected","true")):(g.attr("aria-selected","false"),k.threeStateSort&&(k.sortorder="",k.viewsortcols[0]||n.hide()));k.lastsort!==d&&"true"===g.data("autoResized")&&(null!=l&&null!=l.autoResizing&&l.autoResizing.compact||k.autoResizing.compact)&&k.columnsToReResizing.push(d);b=b.substring(5+k.id.length+1);k.sortname=l.index||b}R.call(this,"onSortCol",k.sortname,d,k.sortorder)?("local"===k.datatype?k.deselectAfterSort&&!k.multiPageSelection&&
  c.resetSelection.call(a(this)):k.multiPageSelection||(k.selrow=null,k.multiselect&&(fa.call(this,!1),ba(k.selarrrow))),ba(k.savedRow),k.scroll&&(m=h.bDiv.scrollLeft,z.emptyRows.call(this,!0,!1),h.hDiv.scrollLeft=m),k.subGrid&&"local"===k.datatype&&a("td.sgexpanded","#"+G(k.id)).each(function(){a(this).trigger("click")}),Ba.call(this),k.lastsort=d,k.sortname!==b&&d&&(k.lastsort=d)):k.lastsort=d}},Eb=function(){var a=0,b=u.cell_width?0:O(k.cellLayout,0),c=0,d,e=O(k.scrollOffset,0),f,g=!1,h,l=0,m,n=
  u.isCellClassHidden;r(k.colModel,function(){void 0===this.hidden&&(this.hidden=!1);if(k.grouping&&k.autowidth){var d=p(this.name,k.groupingView.groupField);0<=d&&k.groupingView.groupColumnShow.length>d&&(this.hidden=!k.groupingView.groupColumnShow[d])}this.widthOrg=f=O(this.width,0);!1!==this.hidden||n(this.classes)||(a+=f+b,this.fixed?l+=f+b:c++)});isNaN(k.width)&&(k.width=a+(!1!==k.shrinkToFit||isNaN(k.height)?0:e));z.width=k.width;k.tblwidth=a;!1===k.shrinkToFit&&!0===k.forceFit&&(k.forceFit=!1);
  !0===k.shrinkToFit&&0<c&&(h=z.width-b*c-l,isNaN(k.height)||(h-=e,g=!0),a=0,r(k.colModel,function(e){!1!==this.hidden||n(this.classes)||this.fixed||(this.width=f=Math.round(h*this.width/(k.tblwidth-b*c-l)),a+=f,d=e)}),m=0,g?z.width-l-(a+b*c)!==e&&(m=z.width-l-(a+b*c)-e):g||1===Math.abs(z.width-l-(a+b*c))||(m=z.width-l-(a+b*c)),k.colModel[d].width+=m,k.tblwidth=a+m+b*c+l,k.tblwidth>k.width&&(k.colModel[d].width-=k.tblwidth-parseInt(k.width,10),k.tblwidth=k.width))},Fb=function(a){var b=a,c;for(c=a+
  1;c<k.colModel.length;c++)if(!0!==k.colModel[c].hidden){b=c;break}return b-a},eb;-1===p(k.multikey,["shiftKey","altKey","ctrlKey"])&&(k.multikey=!1);k.keyName=!1;k.sortorder=k.sortorder.toLowerCase();u.cell_width=u.cellWidth();var kb=u.cmTemplate,X,P;for(X=0;X<k.colModel.length;X++)P=k.colModel[X],eb="string"===typeof P.template?null==kb||"object"!==typeof kb[P.template]&&!a.isFunction(kb[P.template])?{}:kb[P.template]:P.template,m(eb)&&(eb=eb.call(d,{cm:P,iCol:X})),P=n(!0,{},k.cmTemplate,eb||{},
  P),!1===k.keyName&&!0===P.key&&(k.keyName=P.name),k.colModel[X]=P;for(X=0;X<k.additionalProperties.length;X++)P=k.additionalProperties[X],!1===k.keyName&&!0===P.key&&(k.keyName=P.name);if(0===k.colNames.length)for(X=0;X<k.colModel.length;X++)k.colNames[X]=void 0!==k.colModel[X].label?k.colModel[X].label:k.colModel[X].name;if(k.colNames.length!==k.colModel.length)y(w.call(h,"errors.model"));else{!0===k.grouping&&(k.scroll=!1,k.rownumbers=!1,k.treeGrid=!1,k.gridview=!0);if(k.subGrid)try{c.setSubGrid.call(h)}catch(qb){}if(k.multiselect&&
  ("left"===k.multiselectPosition||"right"===k.multiselectPosition)){var ub="left"===k.multiselectPosition?"unshift":"push";k.colNames[ub]("<input id='"+k.cbId+"' class='cbox' type='checkbox' aria-checked='false'/>");k.colModel[ub]({name:"cb",width:u.cell_width?k.multiselectWidth+k.cellLayout:k.multiselectWidth,labelClasses:"jqgh_cbox",classes:"td_cbox",sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0,frozen:!0})}k.rownumbers&&(k.colNames.unshift(""),k.colModel.unshift({name:"rn",
  width:u.cell_width?k.rownumWidth+k.cellLayout:k.rownumWidth,labelClasses:"jqgh_rn",sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0,frozen:!0}));k.iColByName=I(k.colModel);k.xmlReader=n(!0,{root:"rows",row:"row",page:"rows>page",total:"rows>total",records:"rows>records",repeatitems:!0,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:!0,cell:"cell"}},k.xmlReader);k.jsonReader=n(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!0,
  cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:!0,cell:"cell"}},k.jsonReader);k.localReader=n(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!1,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:!0,cell:"cell"}},k.localReader);k.scroll&&(k.pgbuttons=!1,k.pginput=!1,k.rowList=[]);if(!0===k.treeGrid){try{c.setTreeGrid.call(h)}catch(qb){}"local"!==k.datatype&&(k.localReader={id:"_id_"});k.iPropByName=H(k.additionalProperties)}ja();
  Y();k.data.length&&(wa.call(d),Ka());if(!0===k.shrinkToFit&&!0===k.forceFit)for(X=k.colModel.length-1;0<=X;X--)if(!0!==k.colModel[X].hidden){k.colModel[X].resizable=!1;break}var T,ga,fb,ha,ma,ia,na,pa=[],Da=[],la=[],ka="<thead><tr class='ui-jqgrid-labels' role='row'>",ya,ta="<tbody><tr style='display:none;'>",oa=F("states.hover"),sa=F("states.disabled");if(k.multiSort){var pa=k.sortname.split(","),ua;for(ua=0;ua<pa.length;ua++)la=q(pa[ua]).split(" "),pa[ua]=q(la[0]),Da[ua]=la[1]?q(la[1]):k.sortorder||
  "asc"}for(X=0;X<k.colNames.length;X++){P=k.colModel[X];ma=k.headertitles||P.headerTitle?" title='"+lb("string"===typeof P.headerTitle?P.headerTitle:k.colNames[X])+"'":"";ka+="<th id='"+k.id+"_"+P.name+"' class='"+F("colHeaders","ui-th-column ui-th-"+Q+" "+(P.labelClasses||""))+"'"+ma+">";T=P.index||P.name;switch(P.labelAlign){case "left":ia="text-align:left;";break;case "right":ia="text-align:right;"+(!1===P.sortable?"":"padding-right:"+k.autoResizing.widthOfVisiblePartOfSortIcon+"px;");break;case "likeData":ia=
  void 0===P.align||"left"===P.align?"text-align:left;":"right"===P.align?"text-align:right;"+(!1===P.sortable?"":"padding-right:"+k.autoResizing.widthOfVisiblePartOfSortIcon+"px;"):"";break;default:ia=""}ka+="<div id='jqgh_"+k.id+"_"+P.name+"'"+(L?" class='ui-th-div-ie'":"")+(""===ia?"":" style='"+ia+"'")+">";ya=P.autoResizable&&"actions"!==P.formatter?"<span class='"+k.autoResizing.wrapperClassName+"'>"+k.colNames[X]+"</span>":k.colNames[X];k.sortIconsBeforeText?(ka+=(k.builderSortIcons||u.builderSortIcons).call(d,
  X),ka+=ya):(ka+=ya,ka+=(k.builderSortIcons||u.builderSortIcons).call(d,X));ka+="</div></th>";ta+="<td></td>";P.width=P.width?parseInt(P.width,10):150;"boolean"!==typeof P.title&&(P.title=!0);P.lso="";T===k.sortname&&(k.lastsort=X,P.lso=k.sortorder||P.firstsortorder||"asc");k.multiSort&&(la=p(T,pa),-1!==la&&(P.lso=Da[la]))}var ka=ka+"</tr></thead>",ta=ta+"</tr></tbody>",xa=a("<table class='"+F("hTable","ui-jqgrid-htable")+"' style='width:1px' role='presentation' aria-labelledby='gbox_"+k.id+"'>"+ka+
  ta+"</table>");a(xa[0].tHead).children("tr").children("th").hover(function(){a(this).addClass(oa)},function(){a(this).removeClass(oa)});k.multiselect&&a(k.cb,xa).bind("click",function(){var b=F("states.select"),c,f=[],g=k.iColByName.cb,h=function(c,d){a(c)[d?"addClass":"removeClass"](b).attr(d?{"aria-selected":"true",tabindex:"0"}:{"aria-selected":"false",tabindex:"-1"});void 0!==g&&a(c.cells[g]).children("input.cbox").prop("checked",d)},l=z.fbRows,m=sa+" ui-subgrid jqgroup jqfoot jqgfirstrow jqgskipselect",
  n,p=k._index;ba(k.selarrrow);if(this.checked){if(c=!0,k.selrow=1<d.rows.length?d.rows[d.rows.length-1].id:null,k.multiPageSelection&&("local"===k.datatype||k.treeGrid)&&null!=k.data&&0<k.data.length&&null!=p)for(n in p)p.hasOwnProperty(n)&&k.selarrrow.push(k.idPrefix+n)}else c=!1,k.selrow=null;var q=c?k.selarrrow:f;a(d.rows).each(function(b){da(this,m)||(h(this,c),0>a.inArray(this.id,q)&&q.push(this.id),l&&h(l[b],c))});R.call(d,"onSelectAll",c?k.selarrrow:f,c)});if(!0===k.autowidth){var La=Math.floor(a(U).innerWidth());
  k.width=0<La?La:"nw"}isNaN(k.width)?isNaN(parseFloat(k.width))||(k.width=parseFloat(k.width)):k.width=Number(k.width);k.widthOrg=k.width;Eb();a(U).css("width",z.width+"px").append("<div class='"+F("resizer","ui-jqgrid-resize-mark")+"' id='"+k.rsId+"'>&#160;</div>");a(k.rs).bind("selectstart",function(){return!1}).click(D).dblclick(function(b){var f=a(this).data("idx"),g=a(this).data("pageX"),l=k.colModel[f];if(null==g||null==l)return!1;var g=String(g).split(";"),m=parseFloat(g[0]),n=parseFloat(g[1]);
  if(2===g.length&&(5<Math.abs(m-n)||5<Math.abs(b.pageX-m)||5<Math.abs(b.pageX-n)))return!1;R.call(d,"resizeDblClick",f,l,b)&&l.autoResizable&&c.autoResizeColumn.call(h,f);R.call(d,"afterResizeDblClick",{iCol:f,cm:l,cmName:l.name});return!1});a(za).css("width",z.width+"px");var Wa="";k.footerrow&&(Wa+="<table role='presentation' style='width:1px' class='"+F("gridFooter","ui-jqgrid-ftable")+"'><tbody><tr role='row' class='"+F("rowFooter","footrow footrow-"+Q)+"'>");var Aa="<tr class='jqgfirstrow' role='row' style='height:auto'>";
  k.disableClick=!1;a("th",xa[0].tHead.rows[0]).each(function(b){var c=k.colModel[b],d=c.name,e=a(this),f=e.children("div"),g=f.children("span.s-ico"),h=k.showOneSortIcon;ga=c.width;void 0===c.resizable&&(c.resizable=!0);c.resizable?(fb=document.createElement("span"),a(fb).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+Q).bind("selectstart",function(){return!1}),e.addClass(k.resizeclass)):fb="";e.css("width",ga+"px").prepend(fb);fb=null;var l="";!0===c.hidden&&(e.css("display","none"),
  l="display:none;");Aa+="<td role='gridcell' "+(c.classes?"class='"+c.classes+"' ":"")+"style='height:0;width:"+ga+"px;"+l+"'></td>";z.headers[b]={width:ga,el:this};ha=c.sortable;"boolean"!==typeof ha&&(ha=c.sortable=!0);"cb"!==d&&"subgrid"!==d&&"rn"!==d&&ha&&k.viewsortcols[2]&&f.addClass("ui-jqgrid-sortable");ha&&(k.multiSort?(d="desc"===c.lso?"asc":"desc",k.viewsortcols[0]?(g.css("display",""),c.lso&&(g.children("span.ui-icon-"+c.lso).removeClass(sa),h&&g.children("span.ui-icon-"+d).hide())):c.lso&&
  (g.css("display",""),g.children("span.ui-icon-"+c.lso).removeClass(sa),h&&g.children("span.ui-icon-"+d).hide())):(d="desc"===k.sortorder?"asc":"desc",k.viewsortcols[0]?(g.css("display",""),b===k.lastsort&&(g.children("span.ui-icon-"+k.sortorder).removeClass(sa),h&&g.children("span.ui-icon-"+d).hide())):b===k.lastsort&&""!==c.lso&&(g.css("display",""),g.children("span.ui-icon-"+k.sortorder).removeClass(sa),h&&g.children("span.ui-icon-"+d).hide())));k.footerrow&&(Wa+="<td role='gridcell' "+S(b,0,"",
  null,"",!1)+">&#160;</td>")}).mousedown(function(b){var c=a(this),d=c.closest(".ui-jqgrid-hdiv").hasClass("frozen-div"),e=function(){var b=[c.position().left+c.outerWidth()];"rtl"===k.direction&&(b[0]=k.width-b[0]);b[0]-=d?0:z.bDiv.scrollLeft;b.push(a(z.hDiv).position().top);b.push(a(z.bDiv).offset().top-a(z.hDiv).offset().top+a(z.bDiv).height()+(z.sDiv?a(z.sDiv).height():0));return b},f;if(1===a(b.target).closest("th>span.ui-jqgrid-resize").length)return f=k.iColByName[(this.id||"").substring(k.id.length+
  1)],null!=f&&(!0===k.forceFit&&(k.nv=Fb(f)),z.dragStart(f,b,e(),c)),!1}).click(function(b){if(k.disableClick)return k.disableClick=!1;var c="th.ui-th-column>div",f,g,c=k.viewsortcols[2]?c+".ui-jqgrid-sortable":c+">span.s-ico>span.ui-grid-ico-sort";b=a(b.target).closest(c);if(1===b.length)return k.viewsortcols[2]||(f=!0,g=b.hasClass("ui-icon-desc")?"desc":"asc"),b=k.iColByName[(this.id||"").substring(k.id.length+1)],null!=b&&tb.call(d,a("div",this)[0].id,b,f,g,this),!1});if(k.sortable&&a.fn.sortable)try{c.sortableColumns.call(h,
  a(xa[0].tHead.rows[0]))}catch(qb){}k.footerrow&&(Wa+="</tr></tbody></table>");Aa+="</tr>";h.html("<tbody>"+Aa+"</tbody>");h.addClass(F("grid","ui-jqgrid-btable"+(h.jqGrid("isBootstrapGuiStyle")?" table-striped":"")));var Ca=k.caption&&!0===k.hiddengrid?!0:!1,cb=a("<div class='ui-jqgrid-hbox"+("rtl"===Q?"-rtl":"")+"'></div>"),Ta=F("top"),Ha=F("bottom");z.hDiv=document.createElement("div");a(z.hDiv).css({width:z.width+"px"}).addClass(F("hDiv","ui-jqgrid-hdiv")).append(cb).scroll(function(){var b=a(this).next(".ui-jqgrid-bdiv")[0];
  b&&(b.scrollLeft=this.scrollLeft)});a(cb).append(xa);xa=null;Ca&&a(z.hDiv).hide();k.rowNum=parseInt(k.rowNum,10);if(isNaN(k.rowNum)||0>=k.rowNum)k.rowNum=k.maxRowNum;if(k.pager){var Ra,Xa;"string"===typeof k.pager&&"#"!==k.pager.substr(0,1)?(Xa=k.pager,Ra=a("#"+G(k.pager))):!0===k.pager?(Xa=Ea(),Ra=a("<div id='"+Xa+"'></div>"),Ra.appendTo("body"),k.pager="#"+G(Xa)):(Ra=a(k.pager),Xa=Ra.attr("id"));0<Ra.length?(Ra.css({width:z.width+"px"}).addClass(F("pager.pager","ui-jqgrid-pager "+Ha)).appendTo(U),
  Ca&&Ra.hide(),sb.call(d,Xa,""),k.pager="#"+G(Xa)):k.pager=""}!1===k.cellEdit&&!0===k.hoverrows&&h.bind("mouseover",function(b){na=a(b.target).closest("tr.jqgrow");"ui-subgrid"!==a(na).attr("class")&&a(na).addClass(oa)}).bind("mouseout",function(b){na=a(b.target).closest("tr.jqgrow");a(na).removeClass(oa)});var ra,Ma,Ua,Na=function(b){var c,d;do if(c=a(b).closest("td"),0<c.length){b=c.parent();d=b.parent().parent();if(b.is(".jqgrow")&&(d[0]===this||d.is("table.ui-jqgrid-btable")&&(d[0].id||"").replace("_frozen",
  "")===this.id))break;b=c.parent()}while(0<c.length);return c};h.before(z.hDiv).click(function(b){var f=F("states.select"),g=b.target,l=Na.call(this,g),m=l.parent();if(0!==m.length&&!da(m,sa)){ra=m[0].id;var n=a(g).hasClass("cbox"),p=R.call(d,"beforeSelectRow",ra,b),q=u.detectRowEditing.call(d,ra),q=null!=q&&"cellEditing"!==q.mode;if("A"!==g.tagName&&(!q||n))if(Ma=l[0].cellIndex,Ua=l.html(),R.call(d,"onCellSelect",ra,Ma,Ua,b),!0===k.cellEdit)if(k.multiselect&&n&&p)t.call(h,ra,!0,b);else{ra=m[0].rowIndex;
  try{c.editCell.call(h,ra,Ma,!0)}catch(r){}}else if(p)if(k.multikey)b[k.multikey]?t.call(h,ra,!0,b):k.multiselect&&n&&(n=a("#jqg_"+G(k.id)+"_"+ra).is(":checked"),a("#jqg_"+G(k.id)+"_"+ra).prop("checked",!n));else if(k.multiselect&&k.multiboxonly){if(!n){var w=k.frozenColumns?k.id+"_frozen":"";a(k.selarrrow).each(function(b,d){var e=c.getGridRowById.call(h,d);e&&a(e).removeClass(f);a("#jqg_"+G(k.id)+"_"+G(d)).prop("checked",!1);w&&(a("#"+G(d),"#"+G(w)).removeClass(f),a("#jqg_"+G(k.id)+"_"+G(d),"#"+
  G(w)).prop("checked",!1))});ba(k.selarrrow)}t.call(h,ra,!0,b)}else g=k.selrow,t.call(h,ra,!0,b),"toggle"!==k.singleSelectClickMode||k.multiselect||g!==ra||(this.grid.fbRows&&(m=m.add(this.grid.fbRows[ra])),m.removeClass(f).attr({"aria-selected":"false",tabindex:"-1"}),k.selrow=null);else n&&a(g).prop("checked",!1)}}).bind("reloadGrid",function(b,d){var e=this.grid,f=a(this);!0===k.treeGrid&&(k.datatype=k.treedatatype);d=n({},Ja.reloadGridOptions||{},k.reloadGridOptions||{},d||{});"local"===k.datatype&&
  k.dataTypeOrg&&k.loadonce&&d.fromServer&&(k.datatype=k.dataTypeOrg,delete k.dataTypeOrg);d.current&&e.selectionPreserver.call(this);"local"===k.datatype?(k.multiPageSelection||c.resetSelection.call(f),k.data.length&&(wa.call(this),Ka())):k.treeGrid||k.multiPageSelection||(k.selrow=null,k.multiselect&&(ba(k.selarrrow),fa.call(this,!1)),ba(k.savedRow));k.iRow=-1;k.iCol=-1;k.scroll&&z.emptyRows.call(this,!0,!1);if(d.page){var g=parseInt(d.page,10);g>k.lastpage&&(g=k.lastpage);1>g&&(g=1);k.page=g;e.bDiv.scrollTop=
  e.prevRowHeight?(g-1)*e.prevRowHeight*k.rowNum:0}e.prevRowHeight&&k.scroll&&void 0===d.page?(delete k.lastpage,e.populateVisible.call(this)):e.populate.call(this);!0===k._inlinenav&&f.jqGrid("showAddEditButtons",!1);return!1}).dblclick(function(a){var b=Na.call(this,a.target),c=b.parent();if(0<b.length&&!R.call(d,"ondblClickRow",c.attr("id"),c[0].rowIndex,b[0].cellIndex,a))return!1}).bind("contextmenu",function(a){var b=Na.call(this,a.target),c=b.parent(),f=c.attr("id");if(0!==b.length&&(k.multiselect||
  t.call(h,f,!0,a),!R.call(d,"onRightClickRow",f,c[0].rowIndex,b[0].cellIndex,a)))return!1});z.bDiv=document.createElement("div");L&&"auto"===String(k.height).toLowerCase()&&(k.height="100%");a(z.bDiv).append(a("<div style='position:relative;'></div>").append("<div></div>").append(d)).addClass("ui-jqgrid-bdiv").css({height:k.height+(isNaN(k.height)?"":"px"),width:z.width+"px"}).scroll(z.scrollGrid);k.maxHeight&&a(z.bDiv).css("max-height",k.maxHeight+(isNaN(k.maxHeight)?"":"px"));h.css({width:"1px"});
  a.support.tbody||2===a(">tbody",d).length&&a(">tbody:gt(0)",d).remove();k.multikey&&a(z.bDiv).bind(u.msie?"selectstart":"mousedown",function(){return!1});Ca&&a(z.bDiv).hide();z.cDiv=document.createElement("div");var Sa=A("gridMinimize.visible"),Ya=A("gridMinimize.hidden"),Za=C("showhide"),Va=!0===k.hidegrid?a("<a role='link' class='"+F("titleButton","ui-jqgrid-titlebar-close")+"'"+(Za?" title='"+Za+"'":"")+"/>").hover(function(){Va.addClass(oa)},function(){Va.removeClass(oa)}).append("<span class='"+
  Sa+"'></span>"):"";a(z.cDiv).append("<span class='ui-jqgrid-title'>"+k.caption+"</span>").append(Va).addClass(F("gridTitle","ui-jqgrid-titlebar ui-jqgrid-caption"+("rtl"===Q?"-rtl ":" ")+Ta));a(z.cDiv).insertBefore(z.hDiv);if(k.toolbar[0]){z.uDiv=document.createElement("div");"top"===k.toolbar[1]?a(z.uDiv).insertBefore(z.hDiv):"bottom"===k.toolbar[1]&&a(z.uDiv).insertAfter(z.hDiv);var ab=F("toolbarUpper","ui-userdata");"both"===k.toolbar[1]?(z.ubDiv=document.createElement("div"),a(z.uDiv).addClass(ab).attr("id",
  "t_"+k.id).insertBefore(z.hDiv),a(z.ubDiv).addClass(F("toolbarBottom","ui-userdata")).attr("id","tb_"+k.id).insertAfter(z.hDiv),Ca&&a(z.ubDiv).hide()):a(z.uDiv).width(z.width).addClass(ab).attr("id","t_"+k.id);Ca&&a(z.uDiv).hide()}"string"===typeof k.datatype&&(k.datatype=k.datatype.toLowerCase());k.toppager?(k.toppager=k.id+"_toppager",z.topDiv=a("<div id='"+k.toppager+"'></div>")[0],a(z.topDiv).addClass(F("pager.pager","ui-jqgrid-toppager"+(k.caption?"":" "+Ta))).css({width:z.width+"px"}).insertBefore(z.hDiv),
  sb.call(d,k.toppager,"_t"),k.toppager="#"+G(k.toppager)):""!==k.pager||k.scroll||(k.rowNum=k.maxRowNum);k.footerrow&&(z.sDiv=a("<div class='ui-jqgrid-sdiv'></div>")[0],cb=a("<div class='ui-jqgrid-hbox"+("rtl"===Q?"-rtl":"")+"'></div>"),a(z.sDiv).append(cb).width(z.width).insertAfter(z.hDiv),a(cb).append(Wa),z.footers=a(".ui-jqgrid-ftable",z.sDiv)[0].rows[0].cells,k.rownumbers&&(z.footers[0].className=F("rowNum","jqgrid-rownum")),Ca&&a(z.sDiv).hide());cb=null;if(k.caption){var gb=k.datatype;!0===k.hidegrid&&
  (a(".ui-jqgrid-titlebar-close",z.cDiv).click(function(b){var c=".ui-jqgrid-bdiv,.ui-jqgrid-hdiv,.ui-jqgrid-pager,.ui-jqgrid-sdiv",f=this;!0===k.toolbar[0]&&("both"===k.toolbar[1]&&(c+=",#"+G(a(z.ubDiv).attr("id"))),c+=",#"+G(a(z.uDiv).attr("id")));var g=a(c,k.gView).length;k.toppager&&(c+=","+k.toppager);"visible"===k.gridstate?a(c,k.gBox).slideUp("fast",function(){g--;0===g&&(a("span",f).removeClass(Sa).addClass(Ya),k.gridstate="hidden",a(k.gBox).hasClass("ui-resizable")&&a(".ui-resizable-handle",
  k.gBox).hide(),a(z.cDiv).addClass(Ha),Ca||R.call(d,"onHeaderClick",k.gridstate,b))}):"hidden"===k.gridstate&&(a(z.cDiv).removeClass(Ha),a(c,k.gBox).slideDown("fast",function(){g--;0===g&&(a("span",f).removeClass(Ya).addClass(Sa),Ca&&(k.datatype=gb,Ba.call(d),Ca=!1),k.gridstate="visible",a(k.gBox).hasClass("ui-resizable")&&a(".ui-resizable-handle",k.gBox).show(),Ca||R.call(d,"onHeaderClick",k.gridstate,b))}));return!1}),Ca&&(k.datatype="local",a(".ui-jqgrid-titlebar-close",z.cDiv).trigger("click")))}else a(z.cDiv).hide(),
  a(z.cDiv).nextAll("div:visible").first().addClass("ui-corner-top");a(z.hDiv).after(z.bDiv);z.eDiv=a("<div class='"+F("gridError","ui-jqgrid-errorbar ui-jqgrid-errorbar-"+Q)+"' style='display:none;'><span class='ui-jqgrid-error'></span></div>")[0];a(z.hDiv).after(z.eDiv);a(U).click(D).dblclick(function(b){var f=a(k.rs),g=f.offset(),l=f.data("idx"),m=f.data("delta"),n=k.colModel[l],p=a(this).data("pageX")||f.data("pageX");if(null==p||null==n)return!1;var p=String(p).split(";"),q=parseFloat(p[0]),r=
  parseFloat(p[1]);if(2===p.length&&(5<Math.abs(q-r)||5<Math.abs(b.pageX-q)||5<Math.abs(b.pageX-r)))return!1;R.call(d,"resizeDblClick",l,n)&&g.left-1<=b.pageX+m&&b.pageX+m<=g.left+f.outerWidth()+1&&n.autoResizable&&c.autoResizeColumn.call(h,l);R.call(d,"afterResizeDblClick",{iCol:l,cm:n,cmName:n.name});return!1});k.pager||a(z.cDiv).nextAll("div:visible").filter(":last").addClass(Ha);a(".ui-jqgrid-labels",z.hDiv).bind("selectstart",function(){return!1});d.formatCol=S;d.sortData=tb;d.updatepager=jb;d.refreshIndex=
  Ka;d.setHeadCheckBox=fa;d.fixScrollOffsetAndhBoxPadding=K;d.constructTr=Pa;d.formatter=M;n(z,{populate:Ba,emptyRows:N,beginReq:ea,endReq:Qa});d.addXmlData=Ga;d.addJSONData=Ga;d.rebuildRowIndexes=J;d.grid.cols=d.rows[0].cells;R.call(d,"onInitGrid");k.treeGrid&&"local"===k.datatype&&null!=k.data&&0<k.data.length&&(k.datatype="jsonstring",k.datastr=k.data,k.data=[]);Ba.call(d);k.hiddengrid=!1}}}})};var D=a.fn.jqGrid;u.extend({getGridRes:function(b){var c=this[0];if(!c||!c.grid||!c.p)return null;c=u.getRes(Ia[c.p.locale],
  b)||u.getRes(Ia["en-US"],b);b=u.getRes(u,b);return"object"!==typeof c||null===c||a.isArray(c)?void 0!==b?b:c:a.extend(!0,{},c,b||{})},getGuiStyles:function(b,c){var d=this instanceof a&&0<this.length?this[0]:this;if(!d||!d.grid||!d.p)return"";var e=d.p.guiStyle||u.defaults.guiStyle||"jQueryUI",d=u.getRes(u.guiStyles[e],b);void 0===d&&(e=u.getRes(u.guiStyles[e],"baseGuiStyle"),"string"===typeof e&&(d=u.getRes(u.guiStyles[e],b)));return u.mergeCssClasses(d||"",c||"")},isBootstrapGuiStyle:function(){return 0<=
  a.inArray("ui-jqgrid-bootstrap",a(this).jqGrid("getGuiStyles","gBox").split(" "))},getIconRes:function(b){var c=this instanceof a&&0<this.length?this[0]:this;if(!c||!c.p)return"";var d=c.p,c=u.icons[d.iconSet],e=function(a,b){var c=b.split("."),d,e=c.length,n,p,q=[];a="string"===typeof a?u.icons[a]:a;if(null==a)return"";d=a;d.common&&q.push(d.common);for(p=0;p<e;p++){n=c[p];if(!n)break;d=d[n];if(void 0===d){if("common"===n)break;return""}if("string"===typeof d){q.push(d);break}null!=d&&d.common&&
  q.push(d.common)}return u.mergeCssClasses.apply(this,q)};if(null==c)return"";d=e(d.iconSet,b);""===d&&null!=c.baseIconSet&&(d=e(c.baseIconSet,b));return d||""},isInCommonIconClass:function(b){var c=this instanceof a&&0<this.length?this[0]:this;if(!c||!c.p)return"";c=u.icons[c.p.iconSet];if(null==c)return!1;var d=c.common;if(void 0===d){if(null==c.baseIconSet)return!1;c=u.icons[c.baseIconSet];if(null==c)return!1;d=c.common}return"string"===typeof d&&0<=a.inArray(b,d.split(" "))},getGridParam:function(a){var c=
  this[0];return c&&c.grid?a?void 0!==c.p[a]?c.p[a]:null:c.p:null},setGridParam:function(b,c){return this.each(function(){null==c&&(c=!1);this.grid&&"object"===typeof b&&(!0===c?this.p=a.extend({},this.p,b):a.extend(!0,this.p,b))})},abortAjaxRequest:function(){return this.each(function(){null!=this.p.jqXhr&&this.p.jqXhr.abort();this.grid.endReq.call(this)})},getGridRowById:function(b){if(null==b)return null;var c,d=b.toString();this.each(function(){var e,f=this.rows,g;null!=this.p.rowIndexes&&(g=this.p.rowIndexes[d],
  (g=f[g])&&g.id===d&&(c=g));if(!c)try{for(e=f.length;e--;)if(g=f[e],d===g.id){c=g;break}}catch(h){c=a(this.grid.bDiv).find("#"+G(b)),c=0<c.length?c[0]:null}});return c},getDataIDs:function(){var b=[];this.each(function(){var c=this.rows,d=c.length,e,f;if(d&&0<d)for(e=0;e<d;e++)f=c[e],a(f).hasClass("jqgrow")&&b.push(f.id)});return b},setSelection:function(b,c,d){return this.each(function(){function e(b,c){var d=c.clientHeight,e=c.scrollTop,f=a(b).position().top,g=b.clientHeight;f+g>=d+e?c.scrollTop=
  f-(d+e)+g+e:f<d+e&&f<e&&(c.scrollTop=f)}var f=a(this),g=this.p,h,m,l,n=D.getGuiStyles;l=D.getGridRowById;var p=n.call(f,"states.select"),q=n.call(f,"states.disabled"),r=this.grid.fbRows,n=function(b,c){var d=c?"addClass":"removeClass",e=g.iColByName.cb,f=c?{"aria-selected":"true",tabindex:"0"}:{"aria-selected":"false",tabindex:"-1"},h=function(b){a(b)[d](p).attr(f);void 0!==e&&a(b.cells[e]).children("input.cbox").prop("checked",c)};h(b);r&&h(r[b.rowIndex])};void 0!==b&&(c=!1===c?!1:!0,null!=d&&(m=
  a(d.target).closest("tr.jqgrow"),0<m.length&&(h=m[0],r&&(h=this.rows[h.rowIndex]))),null==h&&(h=l.call(f,b)),!h||!h.className||-1<h.className.indexOf(q)||(!0===g.scrollrows&&(m=l.call(f,b),null!=m&&(m=m.rowIndex,0<=m&&e(this.rows[m],this.grid.bDiv))),g.multiselect?(this.setHeadCheckBox(!1),g.selrow=h.id,l=a.inArray(g.selrow,g.selarrrow),-1===l?(f=!0,g.selarrrow.push(g.selrow)):null!==u.detectRowEditing.call(this,h.id)?f=!0:(f=!1,g.selarrrow.splice(l,1),l=g.selarrrow[0],g.selrow=void 0===l?null:l),
  "ui-subgrid"!==h.className&&n(h,f),c&&R.call(this,"onSelectRow",h.id,f,d)):"ui-subgrid"!==h.className&&(g.selrow!==h.id?(null!==g.selrow&&(f=l.call(f,g.selrow))&&n(f,!1),n(h,!0),f=!0):f=!1,g.selrow=h.id,c&&R.call(this,"onSelectRow",h.id,f,d))))})},resetSelection:function(b){return this.each(function(){var c=a(this),d=this.p,e=D.getGuiStyles,f=D.getGridRowById,g=e.call(c,"states.select"),h="edit-cell "+g,e="selected-row "+e.call(c,"states.hover"),m=d.iColByName.cb,l=void 0!==m,n=this.grid.fbRows,p=
  function(b){var c={"aria-selected":"false",tabindex:"-1"};a(b).removeClass(g).attr(c);l&&a(b.cells[m]).children("input.cbox").prop("checked",!1);n&&(b=n[b.rowIndex],a(b).removeClass(g).attr(c),l&&a(b.cells[m]).children("input.cbox").prop("checked",!1))};void 0!==b?(c=f.call(c,b),p(c),l&&(this.setHeadCheckBox(!1),c=a.inArray(b,d.selarrrow),-1!==c&&d.selarrrow.splice(c,1))):d.multiselect?(a(this.rows).each(function(){var b=a.inArray(this.id,d.selarrrow);-1!==b&&(p(this),d.selarrrow.splice(b,1))}),this.setHeadCheckBox(!1),
  d.multiPageSelection||ba(d.selarrrow),d.selrow=null):d.selrow&&(c=f.call(c,d.selrow),p(c),d.selrow=null);!0===d.cellEdit&&0<=parseInt(d.iCol,10)&&0<=parseInt(d.iRow,10)&&(c=this.rows[d.iRow],null!=c&&(a(c.cells[d.iCol]).removeClass(h),a(c).removeClass(e)),n&&(c=n[d.iRow],null!=c&&(a(c.cells[d.iCol]).removeClass(h),a(c).removeClass(e))));ba(d.savedRow)})},getRowData:function(b,c){var d={},e;"object"===typeof b&&(c=b,b=void 0);c=c||{};this.each(function(){var f=this.p,g=!1,h,m=2,l=0,n=this.rows,p,q,
  r,t,w;if(void 0===b)g=!0,e=[],m=n.length;else if(h=D.getGridRowById.call(a(this),b),!h)return d;for(;l<m;){g&&(h=n[l]);if(a(h).hasClass("jqgrow")){q=a("td[role=gridcell]",h);for(p=0;p<q.length;p++)if(r=f.colModel[p],t=r.name,!("cb"===t||"subgrid"===t||"rn"===t||"actions"===r.formatter||c.skipHidden&&r.hidden))if(w=q[p],!0===f.treeGrid&&t===f.ExpandColumn)d[t]=Aa(a("span",w).first().html());else try{d[t]=a.unformat.call(this,w,{rowId:h.id,colModel:r},p)}catch(u){d[t]=Aa(a(w).html())}!c.includeId||
  !1!==f.keyName&&null!=d[f.keyName]||(d[f.prmNames.id]=Oa(f.idPrefix,h.id));g&&(e.push(d),d={})}l++}});return e||d},delRowData:function(b){var c=!1,d,e,f;this.each(function(){var g=this.p;d=D.getGridRowById.call(a(this),b);if(!d)return!1;g.subGrid&&(f=a(d).next(),f.hasClass("ui-subgrid")&&f.remove());a(d).remove();g.records--;g.reccount--;this.updatepager(!0,!1);c=!0;g.multiselect&&(e=a.inArray(b,g.selarrrow),-1!==e&&g.selarrrow.splice(e,1));g.multiselect&&0<g.selarrrow.length?g.selrow=g.selarrrow[g.selarrrow.length-
  1]:g.selrow===b&&(g.selrow=null);if("local"===g.datatype){var h=Oa(g.idPrefix,b),h=g._index[h];void 0!==h&&(g.data.splice(h,1),this.refreshIndex())}this.rebuildRowIndexes();if(!0===g.altRows&&c&&!a(this).jqGrid("isBootstrapGuiStyle")){var m=g.altclass,l=this.grid.fbRows;a(this.rows).each(function(b){var c=a(this);l&&(c=c.add(l[this.rowIndex]));c[0===b%2?"addClass":"removeClass"](m)})}R.call(this,"afterDelRow",b)});return c},setRowData:function(b,c,d){var e=!0;this.each(function(){var f=this,g=f.p,
  h,m=typeof d,l={};if(!f.grid)return!1;h=D.getGridRowById.call(a(f),b);if(!h)return!1;if(c)try{var n=Oa(g.idPrefix,b),p,q=g._index[n],r={},t=null!=q?g.data[q]:void 0;a(g.colModel).each(function(b){var d=this.name,e=qa(c,d);void 0!==e&&("local"===g.datatype&&null!=t&&(e=ab.call(f,e,this,t[d],n,t,b),a.isFunction(this.saveLocally)?this.saveLocally.call(f,{newValue:e,newItem:l,oldItem:t,id:n,cm:this,cmName:d,iCol:b}):l[d]=e),r[d]=e)});a(g.colModel).each(function(d){var e=this.name,m,n=qa(c,e),p=a(h.cells[d]);
  if(void 0!==n){"local"===g.datatype&&null!=t&&(n=l[e]);m=this.title?{title:n}:{};var n=f.formatter(b,n,d,c,"edit",r),q=p;!0===g.treeGrid&&e===g.ExpandColumn&&(q=q.children("span.cell-wrapperleaf,span.cell-wrapper").first());q.html(n);p.attr(m);g.frozenColumns&&(q=a(f.grid.fbRows[h.rowIndex].cells[d]),!0===g.treeGrid&&e===g.ExpandColumn&&(q=q.children("span.cell-wrapperleaf,span.cell-wrapper").first()),q.html(n).attr(m))}});if("local"===g.datatype){if(g.treeGrid)for(p in g.treeReader)g.treeReader.hasOwnProperty(p)&&
  delete l[g.treeReader[p]];void 0!==t&&(g.data[q]=a.extend(!0,t,l))}R.call(f,"afterSetRow",{rowid:b,inputData:c,iData:q,iRow:h.rowIndex,tr:h,localData:l,cssProp:d})}catch(w){e=!1}e&&("string"===m?a(h).addClass(d):null!==d&&"object"===m&&a(h).css(d))});return e},addRowData:function(b,c,d,e){0>a.inArray(d,"first last before after afterSelected beforeSelected".split(" "))&&(d="last");var f=!1,g,h,m,l,n,p,q,r,t,w,y;c&&(a.isArray(c)?(p=!0,q=b):(c=[c],p=!1),this.each(function(){var x=this.p,B=c.length,v=
  a(this),E=this.rows,A=0,F=D.getGridRowById,k=x.colModel,C,K=x.additionalProperties;p||(void 0!==b?b=String(b):(b=Ea(),!1!==x.keyName&&(q=x.keyName,void 0!==c[0][q]&&(b=c[0][q]))));for(r=x.altclass;A<B;){t=c[A];h=[];if(p)try{b=t[q],void 0===b&&(b=Ea())}catch(I){b=Ea()}y=b;C={};for(l=0;l<k.length;l++)w=k[l],g=w.name,"rn"!==g&&"cb"!==g&&"subgrid"!==g&&(n=ab.call(this,t[g],w,void 0,y,{},l),a.isFunction(w.saveLocally)?w.saveLocally.call(this,{newValue:n,newItem:C,oldItem:{},id:y,cm:w,cmName:g,iCol:l}):
  void 0!==n&&(C[g]=n));for(l=0;l<K.length;l++)g=K[l],"object"===typeof g&&g.hasOwnProperty("name")&&(g=g.name),n=qa(t,g),void 0!==n&&(C[g]=n);"local"===x.datatype&&(C[x.localReader.id]=y,x._index[y]=x.data.length,x.data.push(C));h=u.parseDataToHtml.call(this,1,[b],[t]);h=h.join("");if(0===E.length)a(this.tBodies[0]).append(h);else{if("afterSelected"===d||"beforeSelected"===d)void 0===e&&null!==x.selrow?(e=x.selrow,d="afterSelected"===d?"after":"before"):d="afterSelected"===d?"last":"first";switch(d){case "last":a(E[E.length-
  1]).after(h);m=E.length-1;break;case "first":a(E[0]).after(h);m=1;break;case "after":if(m=F.call(v,e))a(E[m.rowIndex+1]).hasClass("ui-subgrid")?(a(E[m.rowIndex+1]).after(h),m=m.rowIndex+2):(a(m).after(h),m=m.rowIndex+1);break;case "before":if(m=F.call(v,e))a(m).before(h),m=m.rowIndex-1}}!0===x.subGrid&&D.addSubGrid.call(v,x.iColByName.subgrid,m);x.records++;x.reccount++;0===x.lastpage&&(x.lastpage=1);R.call(this,"afterAddRow",{rowid:b,inputData:c,position:d,srcRowid:e,iRow:m,localData:C,iData:x.data.length-
  1});A++}!0!==x.altRows||p||v.jqGrid("isBootstrapGuiStyle")||("last"===d?0===(E.length-1)%2&&a(E[E.length-1]).addClass(r):a(E).each(function(b){1===b%2?a(this).addClass(r):a(this).removeClass(r)}));this.rebuildRowIndexes();this.updatepager(!0,!0);f=!0}));return f},footerData:function(b,c,d){function e(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var f,g=!1,h={},m;null==b&&(b="get");"boolean"!==typeof d&&(d=!0);b=b.toLowerCase();this.each(function(){var l=this,n=l.p,p;if(!l.grid||!n.footerrow||
  "set"===b&&e(c))return!1;g=!0;a(n.colModel).each(function(e){f=this.name;"set"===b?void 0!==c[f]&&(p=d?l.formatter("",c[f],e,c,"edit"):c[f],m=this.title?{title:lb(p)}:{},a("tr.footrow td:eq("+e+")",l.grid.sDiv).html(p).attr(m),g=!0):"get"===b&&(h[f]=a("tr.footrow td:eq("+e+")",l.grid.sDiv).html())})});return"get"===b?h:g},showHideCol:function(b,c,d){return this.each(function(){var e=this,f=a(e),g=e.grid,h=!1,m=e.p,l=u.cell_width?0:m.cellLayout,n;if(g){"string"===typeof b&&(b=[b]);c="none"!==c&&!1!==
  c?"":"none";d=d||{};var p=""===c?!0:!1,q=m.groupHeader;(q=q&&("object"===typeof q||a.isFunction(q)))&&!d.skipSetGroupHeaders&&D.destroyGroupHeader.call(f,!1);a(m.colModel).each(function(f){if(-1!==a.inArray(this.name,b)&&this.hidden===p){if(!0===m.frozenColumns&&!0===this.frozen)return!0;a("tr[role=row]",g.hDiv).each(function(){a(this.cells[f]).css("display",c)});a(e.rows).each(function(){var b=this.cells[f];(!a(this).hasClass("jqgroup")||null!=b&&1===b.colSpan)&&a(b).css("display",c)});m.footerrow&&
  a("tr.footrow td:eq("+f+")",g.sDiv).css("display",c);n=parseInt(this.width,10);m.tblwidth="none"===c?m.tblwidth-(n+l):m.tblwidth+(n+l);this.hidden=!p;h=!0;d.skipFeedback?(d.toReport=d.toReport||{},d.toReport[this.name]=p):R.call(e,"onShowHideCol",p,this.name,f)}});if(!0===h){var r=m.autowidth||void 0!==m.widthOrg&&"auto"!==m.widthOrg&&"100%"!==m.widthOrg?m.width:m.tblwidth+parseInt(m.scrollOffset,10);d.skipSetGridWidth?d.newGridWidth=r:D.setGridWidth.call(f,r)}if(q&&!d.skipSetGroupHeaders)if(null!=
  m.pivotOptions&&null!=m.pivotOptions.colHeaders&&1<m.pivotOptions.colHeaders.length)for(r=m.pivotOptions.colHeaders,q=0;q<r.length;q++)r[q]&&r[q].groupHeaders.length&&D.setGroupHeaders.call(f,r[q]);else D.setGroupHeaders.call(f,m.groupHeader)}})},hideCol:function(b,c){return this.each(function(){D.showHideCol.call(a(this),b,"none",c)})},showCol:function(b,c){return this.each(function(){D.showHideCol.call(a(this),b,"",c)})},remapColumns:function(b,c,d){function e(c){var d=c.length?n(c):a.extend({},
  c);a.each(b,function(a){c[a]=d[this]})}function f(c,d){(d?c.children(d):c.children()).each(function(){var c=this,d=n(c.cells);a.each(b,function(a){var b=d[this],e=c.cells[a];b.cellIndex!==a&&b.parentNode.insertBefore(b,e)})})}var g=this[0],h=g.p,m=g.grid,l,n=a.makeArray;if(null!=m&&null!=h){e(h.colModel);e(h.colNames);e(m.headers);f(a(m.hDiv).find(">div>.ui-jqgrid-htable>thead"),d&&":not(.ui-jqgrid-labels)");c&&f(a(g.tBodies[0]),"tr.jqgfirstrow,tr.jqgrow,tr.jqfoot");h.footerrow&&f(a(m.sDiv).find(">div>.ui-jqgrid-ftable>tbody").first());
  h.remapColumns&&(h.remapColumns.length?e(h.remapColumns):h.remapColumns=n(b));h.lastsort=a.inArray(h.lastsort,b);h.iColByName={};m=0;for(l=h.colModel.length;m<l;m++)h.iColByName[h.colModel[m].name]=m;R.call(g,"onRemapColumns",b,c,d)}},remapColumnsByName:function(b,c,d){var e=this[0].p,f=[],g,h;b=b.slice();g=a.inArray;e.subGrid&&0>g("subgrid",b)&&b.unshift("subgrid");e.multiselect&&0>g("cb",b)&&b.unshift("cb");e.rownumbers&&0>g("rn",b)&&b.unshift("rn");g=0;for(h=b.length;g<h;g++)f.push(e.iColByName[b[g]]);
  D.remapColumns.call(this,f,c,d);return this},setGridWidth:function(b,c){return this.each(function(){var d=this.p,e,f=this.grid,g=0,h,m=0,l=!1,n,p=0,q=u.isCellClassHidden,r=b;if(f&&null!=d){this.fixScrollOffsetAndhBoxPadding();var t=d.colModel,w=d.scrollOffset,y=u.cell_width?0:d.cellLayout,x=f.headers,B=f.footers,v=f.bDiv,E=f.hDiv,A=f.sDiv,F=f.cols,k,C,K=a(E).find(">div>.ui-jqgrid-htable>thead>tr").first()[0].cells,I=function(b){f.width=d.width=b;a(d.gBox).css("width",b+"px");a(d.gView).css("width",
  b+"px");a(v).css("width",b+"px");a(E).css("width",b+"px");d.pager&&a(d.pager).css("width",b+"px");d.toppager&&a(d.toppager).css("width",b+"px");!0===d.toolbar[0]&&(a(f.uDiv).css("width",b+"px"),"both"===d.toolbar[1]&&a(f.ubDiv).css("width",b+"px"));d.footerrow&&a(A).css("width",b+"px")};"boolean"!==typeof c&&(c=d.shrinkToFit);if(!isNaN(r)){r=parseInt(r,10);I(r);!1===c&&!0===d.forceFit&&(d.forceFit=!1);if(!0===c){a.each(t,function(){!1!==this.hidden||q(this.classes)||(e=this.widthOrg,g+=e+y,this.fixed?
  p+=this.width+y:m++)});if(0===m)return;d.tblwidth=parseInt(g,10);n=r-y*m-p;!isNaN(d.height)&&(v.clientHeight<v.scrollHeight||1===this.rows.length)&&(l=!0,n-=w);C=n/(d.tblwidth-y*m-p);if(0>C)return;g=0;k=0<F.length;a.each(t,function(a){!1!==this.hidden||q(this.classes)||this.fixed||(this.width=e=Math.round(this.widthOrg*C),g+=e,x[a].width=e,K[a].style.width=e+"px",d.footerrow&&(B[a].style.width=e+"px"),k&&(F[a].style.width=e+"px"),h=a)});if(!h)return;n=0;l?r-p-(g+y*m)!==w&&(n=r-p-(g+y*m)-w):1!==Math.abs(r-
  p-(g+y*m))&&(n=r-p-(g+y*m));t=t[h];t.width+=n;d.tblwidth=parseInt(g+n+y*m+p,10);d.tblwidth>r&&(n=d.tblwidth-parseInt(r,10),d.tblwidth=r,t.width-=n);e=t.width;r=x[h];r.width=e;K[h].style.width=e+"px";k&&(F[h].style.width=e+"px");d.footerrow&&(B[h].style.width=e+"px");d.tblwidth+(l?w:0)<d.width&&I(d.tblwidth+(l?w:0));v.offsetWidth>v.clientWidth&&(d.autowidth||void 0!==d.widthOrg&&"auto"!==d.widthOrg&&"100%"!==d.widthOrg||I(v.offsetWidth))}d.tblwidth&&(d.tblwidth=parseInt(d.tblwidth,10),r=d.tblwidth,
  E.scrollLeft=v.scrollLeft,n=Math.abs(r-d.width),d.shrinkToFit&&!c&&3>n&&0<n&&(r<d.width&&I(r),v.offsetWidth>v.clientWidth&&(d.autowidth||void 0!==d.widthOrg&&"auto"!==d.widthOrg&&"100%"!==d.widthOrg||I(v.offsetWidth))));this.fixScrollOffsetAndhBoxPadding();l={resizeDiv:!0,resizedRows:{iRowStart:c?0:-1,iRowEnd:-1}};a(this).triggerHandler("jqGridResetFrozenHeights",[{header:l,resizeFooter:!0,body:l}])}}})},setGridHeight:function(b){return this.each(function(){var c=this.grid,d=this.p;if(c){var e=a(c.bDiv);
  e.css({height:b+(isNaN(b)?"":"px")});!0===d.frozenColumns&&a(d.idSel+"_frozen").parent().height(e.height()-16);d.height=b;d.scroll&&c.populateVisible.call(this);this.fixScrollOffsetAndhBoxPadding();a(this).triggerHandler("jqGridResetFrozenHeights")}})},setCaption:function(b){return this.each(function(){var c=this.grid.cDiv;this.p.caption=b;a("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",c).html(b);a(c).show();a(c).nextAll("div").removeClass(D.getGuiStyles.call(this,"top"));a(this).triggerHandler("jqGridResetFrozenHeights")})},
  setLabel:function(b,c,d,e){return this.each(function(){var f,g=this.p;if(this.grid){if(isNaN(b)){if(f=g.iColByName[b],void 0===f)return}else f=parseInt(b,10);if(0<=f){var h=a("tr.ui-jqgrid-labels th:eq("+f+")",this.grid.hDiv);if(c){var m=a(".s-ico",h);a("[id^=jqgh_]",h).empty().html(c).append(m);g.colNames[f]=c}d&&("string"===typeof d?a(h).addClass(d):a(h).css(d));"object"===typeof e&&a(h).attr(e)}}})},setCell:function(b,c,d,e,f,g){return this.each(function(){var h=this.p,m=-1,l=h.colModel,n,p,q,
  r,t,w,y,x={},B;if(this.grid&&(m=isNaN(c)?h.iColByName[c]:parseInt(c,10),0<=m&&(r=D.getGridRowById.call(a(this),b)))){t=u.getCell.call(this,r,m);if(""!==d||!0===g){p=l[m];"local"===h.datatype&&(B=Oa(h.idPrefix,b),n=h._index[B],void 0!==n&&(q=h.data[n]));if(null==q)for(n=0;n<r.cells.length;n++){if(n!==m&&(w=u.getDataFieldOfCell.call(this,r,n),0<w.length)){try{y=a.unformat.call(this,w,{rowId:b,colModel:l[n]},n)}catch(v){y=Aa(w[0].innerHTML)}x[l[n].name]=y}}else x=q;x[p.name]=d;l=this.formatter(b,d,m,
  x,"edit");y=t;!0===h.treeGrid&&p.name===h.ExpandColumn&&(y=y.children("span.cell-wrapperleaf,span.cell-wrapper").first());y.html(l);p.title&&t.attr({title:d});null!=q&&(l=ab.call(this,d,p,q[p.name],B,q,m),a.isFunction(p.saveLocally)?p.saveLocally.call(this,{newValue:l,newItem:q,oldItem:q,id:B,cm:p,cmName:p.name,iCol:m}):q[p.name]=l)}if(e||f){t=u.getCell.call(this,r,m);if(e)t["string"===typeof e?"addClass":"css"](e);"object"===typeof f&&t.attr(f)}}})},getCell:function(b,c){var d=!1;this.each(function(){var e,
  f=this.p,g,h;if(this.grid&&(e=isNaN(c)?f.iColByName[c]:parseInt(c,10),0<=e&&(g=D.getGridRowById.call(a(this),b)))){h=u.getDataFieldOfCell.call(this,g,e).first();try{d=a.unformat.call(this,h,{rowId:g.id,colModel:f.colModel[e]},e)}catch(m){d=Aa(h.html())}}});return d},getCol:function(b,c,d){var e=[],f,g=0,h,m,l;c="boolean"!==typeof c?!1:c;void 0===d&&(d=!1);this.each(function(){var n,p=this.p,q;if(this.grid&&(n=isNaN(b)?p.iColByName[b]:parseInt(b,10),0<=n)){var r=this.rows,t=r.length,w=0,y=0,x;if(t&&
  0<t){for(;w<t;){x=r[w];if(a(x).hasClass("jqgrow")){q=u.getDataFieldOfCell.call(this,x,n).first();try{f=a.unformat.call(this,q,{rowId:x.id,colModel:p.colModel[n]},n)}catch(B){f=Aa(q.html())}d?(l=parseFloat(f),isNaN(l)||(g+=l,void 0===m&&(m=h=l),h=Math.min(h,l),m=Math.max(m,l),y++)):c?e.push({id:x.id,value:f}):e.push(f)}w++}if(d)switch(d.toLowerCase()){case "sum":e=g;break;case "avg":e=g/y;break;case "count":e=t-1;break;case "min":e=h;break;case "max":e=m}}}});return e},clearGridData:function(b){return this.each(function(){var c=
  this.p,d=this.rows,e=this.grid;e&&c&&d&&("boolean"!==typeof b&&(b=!1),a(this).unbind(".jqGridFormatter"),e.emptyRows.call(this,!1,!0),c.footerrow&&b&&a(".ui-jqgrid-ftable td",e.sDiv).html("&#160;"),c.selrow=null,ba(c.selarrrow),ba(c.savedRow),ba(c.data),ba(c.lastSelectedData),c._index={},c.rowIndexes={},c.records=0,c.page=1,c.lastpage=0,c.reccount=0,this.updatepager(!0,!1))})},getInd:function(b,c){var d=D.getGridRowById.call(a(this),b);return d?!0===c?d:d.rowIndex:!1},bindKeys:function(b){var c=a.extend({onEnter:null,
  onSpace:null,onLeftKey:null,onRightKey:null,scrollingRows:!0},b||{});return this.each(function(){var b=this,e=b.p,f=a(b);e.scrollrows=c.scrollingRows;f.bind("keydown.jqGrid",function(g){var h=a(this).find("tr[tabindex=0]")[0],m=u.detectRowEditing.call(b,a(g.target).closest("tr.jqgrow").attr("id")),l=function(b){do if(h=h[b],null===h)return;while(a(h).is(":hidden")||!a(h).hasClass("jqgrow"));D.setSelection.call(f,h.id,!0);g.preventDefault()},n=function(g,h){var l=c["on"+g+(h||"")];f.triggerHandler("jqGridKey"+
  g,[e.selrow]);a.isFunction(l)&&l.call(b,e.selrow)},p=function(b){if(e.treeGrid){var c=e.data[e._index[Oa(e.idPrefix,h.id)]][e.treeReader.expanded_field];"Right"===b&&(c=!c);c&&a(h).find("div.treeclick").trigger("click")}n(b,"Key")};if(h&&null===m)switch(g.keyCode){case 38:l("previousSibling");break;case 40:l("nextSibling");break;case 37:p("Left");break;case 39:p("Right");break;case 13:n("Enter");break;case 32:n("Space")}})})},unbindKeys:function(){return this.each(function(){a(this).unbind("keydown.jqGrid")})},
  getLocalRow:function(a){var c=!1,d;this.each(function(){void 0!==a&&(d=this.p._index[Oa(this.p.idPrefix,a)],0<=d&&(c=this.p.data[d]))});return c},progressBar:function(b){b=a.extend({htmlcontent:"",method:"hide",loadtype:"disable"},b||{});return this.each(function(){var c="show"===b.method?!0:!1,d=G(this.p.id),e=a("#load_"+d);""!==b.htmlcontent&&e.html(b.htmlcontent);switch(b.loadtype){case "enable":e.toggle(c);break;case "block":a("#lui_"+d).toggle(c),e.toggle(c)}})},setColWidth:function(b,c,d,e){return this.each(function(){var f=
  a(this),g=this.grid,h=this.p,m;if("string"===typeof b){if(b=h.iColByName[b],void 0===b)return}else if("number"!==typeof b)return;m=g.headers[b];null!=m&&(m.newWidth=c,g.newWidth=h.tblwidth+c-m.width,g.resizeColumn(b,!h.frozenColumns,e),!1===d||e||(this.fixScrollOffsetAndhBoxPadding(),D.setGridWidth.call(f,g.newWidth+h.scrollOffset,!1)))})},getAutoResizableWidth:function(b){var c=this;if(0===c.length)return-1;var c=c[0],d=c.rows,e,f,g,h=c.p,m=h.colModel[b],l=a(c.grid.headers[b].el),d=l.find(">div");
  g=parseFloat(l.css("padding-left")||0);e=parseFloat(l.css("padding-right")||0);f=d.find("span.s-ico");var n=d.find(">."+h.autoResizing.wrapperClassName),p=n.outerWidth(),q=parseFloat(n.css("width")||0),r=l=0,t=null!=m.autoResizing&&void 0!==m.autoResizable.compact?m.autoResizable.compact:h.autoResizing.compact,w=h.autoResizing.wrapperClassName;if(null==m||!m.autoResizable||0===n.length||m.hidden||u.isCellClassHidden(m.classes)||m.fixed)return-1;if(!t||f.is(":visible")||"none"!==f.css("display"))r=
  f.outerWidth(!0),h.sortIconsBeforeText||(r-="rtl"===h.direction?parseFloat(f.css("padding-left")||0)+parseFloat(f.css("margin-left")||0):parseFloat(f.css("padding-right")||0)+parseFloat(f.css("margin-right")||0));r+=p+g+(q===p?g+e:0)+parseFloat(d.css("margin-left")||0)+parseFloat(d.css("margin-right")||0);g=0;for(d=c.rows;g<d.length;g++)e=d[g],f=e.cells[b],c=a(e.cells[b]),null!=f&&(a(e).hasClass("jqgrow")||a(e).hasClass("jqgroup")&&1===f.colSpan)?(e=a(f.firstChild),e.hasClass(w)?r=Math.max(r,e.outerWidth()+
  l):h.treeGrid&&h.ExpandColumn===m.name&&(e=c.children(".cell-wrapper,.cell-wrapperleaf"),r=Math.max(r,e.outerWidth()+l+c.children(".tree-wrap").outerWidth()))):a(e).hasClass("jqgfirstrow")&&(l=(u.cell_width?parseFloat(c.css("padding-left")||0)+parseFloat(c.css("padding-right")||0):0)+parseFloat(c.css("border-right")||0)+parseFloat(c.css("border-left")||0));r=Math.max(r,null!=m.autoResizing&&void 0!==m.autoResizing.minColWidth?m.autoResizing.minColWidth:h.autoResizing.minColWidth);return Math.min(r,
  null!=m.autoResizing&&void 0!==m.autoResizing.maxColWidth?m.autoResizing.maxColWidth:h.autoResizing.maxColWidth)},autoResizeColumn:function(b,c){return this.each(function(){var d=a(this),e=this.p,f=e.colModel[b],g,h=a(this.grid.headers[b].el);g=D.getAutoResizableWidth.call(d,b);null==f||0>g||g===f.width||(D.setColWidth.call(d,b,g,e.autoResizing.adjustGridWidth&&!e.autoResizing.fixWidthOnShrink&&!c,c),e.autoResizing.fixWidthOnShrink&&e.shrinkToFit&&!c&&(f.fixed=!0,g=f.widthOrg,f.widthOrg=f.width,D.setGridWidth.call(d,
  e.width,!0),f.widthOrg=g,f.fixed=!1),h.data("autoResized","true"))})},autoResizeAllColumns:function(){return this.each(function(){var b=a(this),c=this.p,d=c.colModel,e=d.length,f,g,h=c.shrinkToFit,m=c.autoResizing.adjustGridWidth,l=c.autoResizing.fixWidthOnShrink,n=parseInt(c.widthOrg,10),p=this.grid,q=D.autoResizeColumn;c.shrinkToFit=!1;c.autoResizing.adjustGridWidth=!0;c.autoResizing.fixWidthOnShrink=!1;for(f=0;f<e;f++)g=d[f],g.autoResizable&&"actions"!==g.formatter&&q.call(b,f,!0);p.hDiv.scrollLeft=
  p.bDiv.scrollLeft;c.footerrow&&(p.sDiv.scrollLeft=p.bDiv.scrollLeft);this.fixScrollOffsetAndhBoxPadding();isNaN(n)?m&&D.setGridWidth.call(b,p.newWidth+c.scrollOffset,!1):D.setGridWidth.call(b,n,!1);c.autoResizing.fixWidthOnShrink=l;c.autoResizing.adjustGridWidth=m;c.shrinkToFit=h})}});var xa=function(b,c){var d=this.grid.fbRows;return a((null!=d&&d[0].cells.length>c?d[b.rowIndex]:b).cells[c])};u.extend({editCell:function(b,c,d){return this.each(function(){var e=this,f=a(e),g=e.p,h,m,l,n;h=e.rows;
  if(e.grid&&!0===g.cellEdit&&null!=h&&null!=h[b]&&(b=parseInt(b,10),c=parseInt(c,10),!isNaN(b)&&!isNaN(c))){var p=h[b],q=null!=p?p.id:null,r=a(p),t=parseInt(g.iCol,10),w=parseInt(g.iRow,10),y=a(h[w]),x=g.savedRow;if(null!=q){g.selrow=q;g.knv||f.jqGrid("GridNav");if(0<x.length){if(!0===d&&b===w&&c===t)return;f.jqGrid("saveCell",x[0].id,x[0].ic)}else setTimeout(function(){a("#"+u.jqID(g.knv)).attr("tabindex","-1").focus()},1);n=g.colModel[c];h=n.name;if("subgrid"!==h&&"cb"!==h&&"rn"!==h){l=xa.call(e,
  p,c);p=n.editable;a.isFunction(p)&&(p=p.call(e,{rowid:q,iCol:c,iRow:b,name:h,cm:n,mode:"cell"}));var B=f.jqGrid("getGuiStyles","select","edit-cell"),v=f.jqGrid("getGuiStyles","hover","selected-row");if(!0!==p||!0!==d||l.hasClass("not-editable-cell"))0<=t&&0<=w&&(xa.call(e,y[0],t).removeClass(B),y.removeClass(v)),l.addClass(B),r.addClass(v),m=l.html().replace(/&#160;/ig,""),R.call(e,"onSelectCell",q,h,m,b,c);else{0<=t&&0<=w&&(xa.call(e,y[0],t).removeClass(B),y.removeClass(v));l.addClass(B);r.addClass(v);
  n.edittype||(n.edittype="text");r=n.edittype;try{m=a.unformat.call(e,l,{rowId:q,colModel:n},c)}catch(A){m="textarea"===r?l.text():l.html()}g.autoEncodeOnEdit&&(m=u.oldDecodePostedData(m));x.push({id:b,ic:c,name:h,v:m});if("&nbsp;"===m||"&#160;"===m||1===m.length&&160===m.charCodeAt(0))m="";a.isFunction(g.formatCell)&&(t=g.formatCell.call(e,q,h,m,b,c),void 0!==t&&(m=t));R.call(e,"beforeEditCell",q,h,m,b,c);n=a.extend({},n.editoptions||{},{id:b+"_"+h,name:h,rowId:q,mode:"cell"});var E=u.createEl.call(e,
  r,n,m,!0,a.extend({},u.ajaxOptions,g.ajaxSelectOptions||{})),r=l;(t=!0===g.treeGrid&&h===g.ExpandColumn)&&(r=l.children("span.cell-wrapperleaf,span.cell-wrapper"));r.html("").append(E).attr("tabindex","0");t&&a(E).width(l.width()-l.children("div.tree-wrap").outerWidth());u.bindEv.call(e,E,n);setTimeout(function(){a(E).focus()},1);a("input, select, textarea",l).bind("keydown",function(d){27===d.keyCode&&(0<a("input.hasDatepicker",l).length?a(".ui-datepicker").is(":hidden")?f.jqGrid("restoreCell",b,
  c):a("input.hasDatepicker",l).datepicker("hide"):f.jqGrid("restoreCell",b,c));if(13===d.keyCode&&!d.shiftKey)return f.jqGrid("saveCell",b,c),!1;if(9===d.keyCode){if(e.grid.hDiv.loading)return!1;d.shiftKey?f.jqGrid("prevCell",b,c):f.jqGrid("nextCell",b,c)}d.stopPropagation()});R.call(e,"afterEditCell",q,h,m,b,c);f.triggerHandler("jqGridAfterEditCell",[q,h,m,b,c])}g.iCol=c;g.iRow=b}}}})},saveCell:function(b,c){return this.each(function(){var d=this,e=a(d),f=d.p,g=u.info_dialog,h=u.jqID;if(d.grid&&!0===
  f.cellEdit){var m=e.jqGrid("getGridRes","errors"),l=m.errcap,n=e.jqGrid("getGridRes","edit").bClose,p=f.savedRow,q=1<=p.length?0:null;if(null!==q){var r=d.rows[b],t=r.id,w=a(r),y=f.colModel[c],x=y.name,B,v=xa.call(d,r,c),E={},A=u.getEditedValue.call(d,v,y,E);if(A!==p[q].v){B=e.triggerHandler("jqGridBeforeSaveCell",[t,x,A,b,c]);void 0!==B&&(A=B);a.isFunction(f.beforeSaveCell)&&(B=f.beforeSaveCell.call(d,t,x,A,b,c),void 0!==B&&(A=B));var F=u.checkValues.call(d,A,c,void 0,void 0,{oldValue:p[q].v,newValue:A,
  cmName:x,rowid:t,iCol:c,iRow:b,cm:y,tr:r,td:v,mode:"cell"}),r=y.formatoptions||{};if(!0===F[0]){q=e.triggerHandler("jqGridBeforeSubmitCell",[t,x,A,b,c])||{};a.isFunction(f.beforeSubmitCell)&&((q=f.beforeSubmitCell.call(d,t,x,A,b,c))||(q={}));0<a("input.hasDatepicker",v).length&&a("input.hasDatepicker",v).datepicker("hide");"date"===y.formatter&&!0!==r.sendFormatted&&(A=a.unformat.date.call(d,A,y));if("remote"===f.cellsubmit)if(f.cellurl){var k={};k[x]=A;var m=f.prmNames,r=m.oper,C=d.grid.hDiv;k[m.id]=
  u.stripPref(f.idPrefix,t);k[r]=m.editoper;k=a.extend(q,k);f.autoEncodeOnEdit&&a.each(k,function(b,c){a.isFunction(c)||(k[b]=u.oldEncodePostedData(c))});e.jqGrid("progressBar",{method:"show",loadtype:f.loadui,htmlcontent:u.defaults.savetext||"Saving..."});C.loading=!0;a.ajax(a.extend({url:a.isFunction(f.cellurl)?f.cellurl.call(d,f.cellurl,b,c,t,A,x):f.cellurl,data:u.serializeFeedback.call(d,f.serializeCellData,"jqGridSerializeCellData",k),type:"POST",complete:function(h){e.jqGrid("progressBar",{method:"hide",
  loadtype:f.loadui});C.loading=!1;if((300>h.status||304===h.status)&&(0!==h.status||4!==h.readyState)){var m=e.triggerHandler("jqGridAfterSubmitCell",[d,h,k.id,x,A,b,c])||[!0,""];!0===m[0]&&a.isFunction(f.afterSubmitCell)&&(m=f.afterSubmitCell.call(d,h,k.id,x,A,b,c));!0===m[0]?(e.jqGrid("setCell",t,c,A,!1,!1,!0),v.addClass("dirty-cell"),w.addClass("edited"),R.call(d,"afterSaveCell",t,x,A,b,c),p.splice(0,1)):(g.call(d,l,m[1],n),e.jqGrid("restoreCell",b,c))}},error:function(k,m,p){a("#lui_"+h(f.id)).hide();
  C.loading=!1;e.triggerHandler("jqGridErrorCell",[k,m,p]);a.isFunction(f.errorCell)?f.errorCell.call(d,k,m,p):g.call(d,l,k.status+" : "+k.statusText+"<br/>"+m,n);e.jqGrid("restoreCell",b,c)}},u.ajaxOptions,f.ajaxCellOptions||{}))}else try{g.call(d,l,m.nourl,n),e.jqGrid("restoreCell",b,c)}catch(K){}"clientArray"===f.cellsubmit&&(e.jqGrid("setCell",t,c,"select"===y.edittype&&"select"!==y.formatter?E.text:A,!1,!1,!0),v.addClass("dirty-cell"),w.addClass("edited"),R.call(d,"afterSaveCell",t,x,A,b,c),p.splice(0,
  1))}else try{setTimeout(function(){g.call(d,l,A+" "+F[1],n)},100),e.jqGrid("restoreCell",b,c)}catch(K){}}else e.jqGrid("restoreCell",b,c)}setTimeout(function(){a("#"+h(f.knv)).attr("tabindex","-1").focus()},0)}})},restoreCell:function(b,c){return this.each(function(){var d=this.p,e=this.rows[b],f=e.id,g,h;if(this.grid&&!0===d.cellEdit){var m=d.savedRow;g=xa.call(this,e,c);if(1<=m.length){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker",g).datepicker("hide")}catch(l){}e=d.colModel[c];!0===
  d.treeGrid&&e.name===d.ExpandColumn?g.children("span.cell-wrapperleaf,span.cell-wrapper").empty():g.empty();g.attr("tabindex","-1");g=m[0].v;h=e.formatoptions||{};"date"===e.formatter&&!0!==h.sendFormatted&&(g=a.unformat.date.call(this,g,e));a(this).jqGrid("setCell",f,c,g,!1,!1,!0);R.call(this,"afterRestoreCell",f,g,b,c);m.splice(0,1)}setTimeout(function(){a("#"+d.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(b,c){return this.each(function(){var d=a(this),e=this.p,f=!1,g,h,m,l=this.rows;
  if(this.grid&&!0===e.cellEdit&&null!=l&&null!=l[b]){for(g=c+1;g<e.colModel.length;g++)if(m=e.colModel[g],h=m.editable,a.isFunction(h)&&(h=h.call(this,{rowid:l[b].id,iCol:g,iRow:b,name:m.name,cm:m,mode:"cell"})),!0===h){f=g;break}!1!==f?d.jqGrid("editCell",b,f,!0):0<e.savedRow.length&&d.jqGrid("saveCell",b,c)}})},prevCell:function(b,c){return this.each(function(){var d=a(this),e=this.p,f=!1,g,h,m,l=this.rows;if(this.grid&&!0===e.cellEdit&&null!=l&&null!=l[b]){for(g=c-1;0<=g;g--)if(m=e.colModel[g],
  h=m.editable,a.isFunction(h)&&(h=h.call(this,{rowid:l[b].id,iCol:g,iRow:b,name:m.name,cm:m,mode:"cell"})),!0===h){f=g;break}!1!==f?d.jqGrid("editCell",b,f,!0):0<e.savedRow.length&&d.jqGrid("saveCell",b,c)}})},GridNav:function(){return this.each(function(){function b(a,b,c){a=d.rows[a];if("v"===c.substr(0,1)){var e=l.clientHeight,f=l.scrollTop,g=a.offsetTop+a.clientHeight,h=a.offsetTop;"vd"===c&&g>=e&&(l.scrollTop+=a.clientHeight);"vu"===c&&h<f&&(l.scrollTop-=a.clientHeight)}"h"===c&&(c=l.scrollLeft,
  b=a.cells[b],a=b.offsetLeft,b.offsetLeft+b.clientWidth>=l.clientWidth+parseInt(c,10)?l.scrollLeft+=b.clientWidth:a<c&&(l.scrollLeft-=b.clientWidth))}function c(a,b){var c=0,d,e=f.colModel;if("lft"===b)for(c=a+1,d=a;0<=d;d--)if(!0!==e[d].hidden){c=d;break}if("rgt"===b)for(c=a-1,d=a;d<e.length;d++)if(!0!==e[d].hidden){c=d;break}return c}var d=this,e=a(d),f=d.p,g=d.grid,h,m;if(g&&!0===f.cellEdit){var l=g.bDiv;f.knv=f.id+"_kn";var n=a("<div style='position:fixed;top:0px;width:1px;height:1px;' tabindex='0'><div tabindex='-1' style='width:1px;height:1px;' id='"+
  f.knv+"'></div></div>");a(n).insertBefore(g.cDiv);a("#"+f.knv).focus().keydown(function(a){var g=parseInt(f.iRow,10),l=parseInt(f.iCol,10);m=a.keyCode;"rtl"===f.direction&&(37===m?m=39:39===m&&(m=37));switch(m){case 38:0<g-1&&(b(g-1,l,"vu"),e.jqGrid("editCell",g-1,l,!1));break;case 40:g+1<=d.rows.length-1&&(b(g+1,l,"vd"),e.jqGrid("editCell",g+1,l,!1));break;case 37:0<=l-1&&(h=c(l-1,"lft"),b(g,h,"h"),e.jqGrid("editCell",g,h,!1));break;case 39:l+1<=f.colModel.length-1&&(h=c(l+1,"rgt"),b(g,h,"h"),e.jqGrid("editCell",
  g,h,!1));break;case 13:0<=l&&0<=g&&e.jqGrid("editCell",g,l,!0);break;default:return!0}return!1})}})},getChangedCells:function(b){var c=[];b||(b="all");this.each(function(){var d=this,e=d.p,f=u.htmlDecode,g=d.rows;d.grid&&!0===e.cellEdit&&a(g).each(function(h){var m={};if(a(this).hasClass("edited")){var l=this;a(this.cells).each(function(c){var p=e.colModel[c],q=p.name,r=xa.call(d,l,c);if("cb"!==q&&"subgrid"!==q&&"rn"!==q&&("dirty"!==b||r.hasClass("dirty-cell")))try{m[q]=a.unformat.call(d,r[0],{rowId:g[h].id,
  colModel:p},c)}catch(t){m[q]=f(r.html())}});m.id=this.id;c.push(m)}})});return c}});var M=D.getGuiStyles,ma=D.getGridRes;u.jqModal=u.jqModal||{};a.extend(!0,u.jqModal,{toTop:!0});a.extend(u,{showModal:function(a){a.w.show()},closeModal:function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},hideModal:function(b,c){c=a.extend({jqm:!0,gb:"",removemodal:!1},c||{});var d=c.gb&&"string"===typeof c.gb&&"#gbox_"===c.gb.substr(0,6)?a("#"+c.gb.substr(6))[0]:!1,e=a(b);if(c.onClose&&(d=d?c.onClose.call(d,
  b):c.onClose(b),"boolean"===typeof d&&!d))return;if(a.fn.jqm&&!0===c.jqm)e.attr("aria-hidden","true").jqmHide();else{if(""!==c.gb)try{a(">.jqgrid-overlay",c.gb).first().hide()}catch(f){}e.hide().attr("aria-hidden","true")}c.removemodal&&e.remove()},findPos:function(a){var c=0,d=0;if(a.offsetParent){do c+=a.offsetLeft,d+=a.offsetTop,a=a.offsetParent;while(a)}return[c,d]},createModal:function(b,c,d,e,f,g,h){var m=u.jqID,l=this.p,l=null!=l?l.jqModal||{}:{};d=a.extend(!0,{resizingRightBottomIcon:D.getIconRes.call(this,
  "form.resizableLtr")},u.jqModal||{},l,d);var l=document.createElement("div"),n="#"+m(b.themodal),p="rtl"===a(d.gbox).attr("dir")?!0:!1,q=b.resizeAlso?"#"+m(b.resizeAlso):!1;h=a.extend({},h||{});l.className=M.call(this,"dialog.window","ui-jqdialog");l.id=b.themodal;l.dir=p?"rtl":"ltr";var r=document.createElement("div");r.className=M.call(this,"dialog.document");a(r).attr("role","document");var t=document.createElement("div");t.className=M.call(this,"dialog.subdocument");r.appendChild(t);l.appendChild(r);
  r=document.createElement("div");r.className=M.call(this,"dialog.header","ui-jqdialog-titlebar "+(p?"ui-jqdialog-titlebar-rtl":"ui-jqdialog-titlebar-ltr"));r.id=b.modalhead;a(r).append("<span class='ui-jqdialog-title'>"+d.caption+"</span>");var w=M.call(this,"states.hover"),y=a("<a class='"+M.call(this,"dialog.closeButton","ui-jqdialog-titlebar-close")+"'></a>").hover(function(){y.addClass(w)},function(){y.removeClass(w)}).append("<span class='"+D.getIconRes.call(this,"form.close")+"'></span>");a(r).append(y);
  p=document.createElement("div");a(p).addClass(M.call(this,"dialog.content","ui-jqdialog-content")).attr("id",b.modalcontent);a(p).append(c);t.appendChild(p);a(t).prepend(r);!0===g?a("body").append(l):"string"===typeof g?a(g).append(l):a(l).insertBefore(e);a(l).css(h);void 0===d.jqModal&&(d.jqModal=!0);c={};if(a.fn.jqm&&!0===d.jqModal)0===d.left&&0===d.top&&d.overlay&&(g=[],g=u.findPos(f),d.left=g[0]+4,d.top=g[1]+4),c.top=d.top+"px",c.left=d.left;else if(0!==d.left||0!==d.top)c.left=d.left,c.top=d.top+
  "px";a("a.ui-jqdialog-titlebar-close",r).click(function(){var b=a(n).data("onClose")||d.onClose,c=a(n).data("gbox")||d.gbox;u.hideModal(n,{gb:c,jqm:d.jqModal,onClose:b,removemodal:d.removemodal||!1});return!1});0!==d.width&&d.width||(d.width=300);0!==d.height&&d.height||(d.height=200);d.zIndex||((e=a(e).parents("*[role=dialog]").first().css("z-index"))?(d.zIndex=parseInt(e,10)+2,d.toTop=!0):d.zIndex=950);c.left&&(c.left+="px");a(l).css(a.extend({width:isNaN(d.width)?"auto":d.width+"px",height:isNaN(d.height)?
  "auto":d.height+"px",zIndex:d.zIndex},c)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":b.modalhead,"aria-hidden":"true"});void 0===d.drag&&(d.drag=!0);void 0===d.resize&&(d.resize=!0);if(d.drag)if(a.fn.jqDrag)a(r).css("cursor","move"),a(l).jqDrag(r);else try{a(l).draggable({handle:a("#"+m(r.id))})}catch(x){}if(d.resize)if(a.fn.jqResize)a(p).append("<div class='jqResize ui-resizable-handle ui-resizable-se "+d.resizingRightBottomIcon+"'></div>"),a(n).jqResize(".jqResize",q);else try{a(l).resizable({handles:"se, sw",
  alsoResize:q})}catch(x){}!0===d.closeOnEscape&&a(l).keydown(function(b){27===b.which&&(b=a(n).data("onClose")||d.onClose,u.hideModal(n,{gb:d.gbox,jqm:d.jqModal,onClose:b,removemodal:d.removemodal||!1,formprop:!d.recreateForm||!1,form:d.form||""}))})},viewModal:function(b,c){c=a.extend(!0,{overlay:30,modal:!1,overlayClass:M.call(this,"overlay"),onShow:u.showModal,onHide:u.closeModal,gbox:"",jqm:!0,jqM:!0},u.jqModal||{},c||{});if(a.fn.jqm&&!0===c.jqm)c.jqM?a(b).attr("aria-hidden","false").jqm(c).jqmShow():
  a(b).attr("aria-hidden","false").jqmShow();else{""!==c.gbox&&(a(">.jqgrid-overlay",c.gbox).first().show(),a(b).data("gbox",c.gbox));a(b).show().attr("aria-hidden","false");try{a(":input:visible",b)[0].focus()}catch(d){}}},info_dialog:function(b,c,d,e){var f=this,g=f.p,h=a.extend(!0,{width:290,height:"auto",dataheight:"auto",drag:!0,resize:!1,left:250,top:170,zIndex:1E3,jqModal:!0,modal:!1,closeOnEscape:!0,align:"center",buttonalign:"center",buttons:[]},u.jqModal||{},null!=g?g.jqModal||{}:{},{caption:"<b>"+
  b+"</b>"},e||{}),m=h.jqModal;a.fn.jqm&&!m&&(m=!1);b="";var l=M.call(f,"states.hover");if(0<h.buttons.length)for(e=0;e<h.buttons.length;e++)void 0===h.buttons[e].id&&(h.buttons[e].id="info_button_"+e),b+=u.builderFmButon.call(f,h.buttons[e].id,h.buttons[e].text);e=isNaN(h.dataheight)?h.dataheight:h.dataheight+"px";c="<div id='info_id'>"+("<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+e+";"+("text-align:"+h.align+";")+"'>"+c+"</div>");if(d||
  ""!==b)c+="<hr class='"+M.call(f,"dialog.hr")+"' style='margin:1px'/><div style='text-align:"+h.buttonalign+";padding:.8em 0 .5em 0;background-image:none;border-width: 1px 0 0 0;'>"+(d?u.builderFmButon.call(f,"closedialog",d):"")+b+"</div>";c+="</div>";try{"false"===a("#info_dialog").attr("aria-hidden")&&u.hideModal("#info_dialog",{jqm:m}),a("#info_dialog").remove()}catch(n){}u.createModal.call(f,{themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",resizeAlso:"infocnt"},c,h,"",
  "",!0);b&&a.each(h.buttons,function(b){a("#"+u.jqID(f.id),"#info_id").bind("click",function(){h.buttons[b].onClick.call(a("#info_dialog"));return!1})});a("#closedialog","#info_id").click(function(){u.hideModal("#info_dialog",{jqm:m,onClose:a("#info_dialog").data("onClose")||h.onClose,gb:a("#info_dialog").data("gbox")||h.gbox});return!1});a(".fm-button","#info_dialog").hover(function(){a(this).addClass(l)},function(){a(this).removeClass(l)});a.isFunction(h.beforeOpen)&&h.beforeOpen();u.viewModal.call(f,
  "#info_dialog",{onHide:function(a){a.w.hide().remove();a.o&&a.o.remove()},modal:h.modal,jqm:m});a.isFunction(h.afterOpen)&&h.afterOpen();try{a("#info_dialog").focus()}catch(n){}},bindEv:function(b,c){a.isFunction(c.dataInit)&&c.dataInit.call(this,b,c);c.dataEvents&&a.each(c.dataEvents,function(){void 0!==this.data?a(b).bind(this.type,this.data,this.fn):a(b).bind(this.type,this.fn)})},createEl:function(b,c,d,e,f){function g(b,c,d){var e="dataInit dataEvents dataUrl buildSelect sopt searchhidden defaultValue attr custom_element custom_value selectFilled rowId mode".split(" ");
  void 0!==d&&a.isArray(d)&&a.merge(e,d);a.each(c,function(c,d){-1===a.inArray(c,e)&&a(b).attr(c,d)});c.hasOwnProperty("id")||a(b).attr("id",u.randId())}var h="",m=this,l=m.p,n=u.info_dialog,p=ma.call(a(m),"errors.errcap"),q=ma.call(a(m),"edit"),r=q.msg,q=q.bClose;switch(b){case "textarea":h=document.createElement("textarea");e?c.cols||a(h).css({width:"100%","box-sizing":"border-box"}):c.cols||(c.cols=19);c.rows||(c.rows=2);if("&nbsp;"===d||"&#160;"===d||1===d.length&&160===d.charCodeAt(0))d="";h.value=
  d;g(h,c);a(h).attr({role:"textbox"});break;case "checkbox":h=document.createElement("input");h.type="checkbox";if(c.value){var t=c.value.split(":");d===t[0]&&(h.checked=!0,h.defaultChecked=!0);h.value=t[0];a(h).data("offval",t[1])}else t=String(d).toLowerCase(),0>t.search(/(false|f|0|no|n|off|undefined)/i)&&""!==t?(h.checked=!0,h.defaultChecked=!0,h.value=d):h.value="on",a(h).data("offval","off");g(h,c,["value"]);a(h).attr({role:"checkbox","aria-checked":h.checked?"true":"false"});break;case "select":h=
  document.createElement("select");b=[];e=l.iColByName[c.name];n=l.colModel[e];!0===c.multiple?(p=!0,h.multiple="multiple",a(h).attr("aria-multiselectable","true"),b=d.split(","),b=a.map(b,function(b){return a.trim(b)})):(p=!1,b[0]=a.trim(d));void 0===c.size&&(c.size=p?3:1);if(void 0!==c.dataUrl){var t=null,w=c.postData||f.postData,y={elem:h,options:c,cm:n,iCol:e,ovm:b};try{t=c.rowId}catch(v){}l&&l.idPrefix&&(t=u.stripPref(l.idPrefix,t));a.ajax(a.extend({url:a.isFunction(c.dataUrl)?c.dataUrl.call(m,
  t,d,String(c.name),y):c.dataUrl,type:"GET",dataType:"html",data:a.isFunction(w)?w.call(m,t,d,String(c.name)):w,context:y,success:function(b,c,d){var e=this.ovm,f=this.elem,h=this.cm,l=this.iCol,n=a.extend({},this.options);b=a.isFunction(n.buildSelect)?n.buildSelect.call(m,b,d,h,l):b;"string"===typeof b&&(b=a(a.trim(b)).html());b&&(a(f).append(b),g(f,n,w?["postData"]:void 0),setTimeout(function(){var b;a("option",f).each(function(c){0===c&&f.multiple&&(this.selected=!1);-1<a.inArray(a.trim(a(this).val()),
  e)&&(this.selected="selected",b=!0)});b||a("option",f).each(function(){-1<a.inArray(a.trim(a(this).text()),e)&&(this.selected="selected")});u.fullBoolFeedback.call(m,n.selectFilled,"jqGridSelectFilled",{elem:f,options:n,cm:h,cmName:h.name,iCol:l})},0))}},f||{}))}else if(c.value){"function"===typeof c.value&&(c.value=c.value());var x,B;f=[];l=void 0===c.separator?":":c.separator;B=void 0===c.delimiter?";":c.delimiter;r=function(a,b){if(0<b)return a};if("string"===typeof c.value)for(B=c.value.split(B),
  x=0;x<B.length;x++)q=B[x].split(l),2<q.length&&(q[1]=a.map(q,r).join(l)),f.push({value:q[0],innerHtml:q[1],selectValue:a.trim(q[0]),selectText:a.trim(q[1])});else if("object"===typeof c.value)for(x in l=c.value,l)l.hasOwnProperty(x)&&f.push({value:x,innerHtml:l[x],selectValue:a.trim(x),selectText:a.trim(l[x])});for(x=0;x<f.length;x++)l=f[x],y=document.createElement("option"),y.value=l.value,y.innerHTML=l.innerHtml,h.appendChild(y),p||l.selectValue!==a.trim(d)||(y.selected="selected",t=!0),p&&-1<a.inArray(l.selectValue,
  b)&&(y.selected="selected",t=!0);if(!t)for(x=0;x<f.length;x++)l=f[x],p||l.selectText!==a.trim(d)||(y.selected="selected"),p&&-1<a.inArray(l.selectText,b)&&(y.selected="selected");g(h,c,["value"]);u.fullBoolFeedback.call(m,c.selectFilled,"jqGridSelectFilled",{elem:h,options:c,cm:n,cmName:n.name,iCol:e})}break;case "text":case "password":case "button":t="button"===b?"button":"textbox";h=document.createElement("input");h.type=b;g(h,c);h.value=d;"button"!==b&&(e?c.size||a(h).css({width:"100%","box-sizing":"border-box"}):
  c.size||(c.size=20));a(h).attr("role",t);break;case "image":case "file":h=document.createElement("input");h.type=b;g(h,c);break;case "custom":h=document.createElement("span");try{if(a.isFunction(c.custom_element))if(B=c.custom_element.call(m,d,c),B instanceof jQuery||u.isHTMLElement(B)||"string"===typeof B)B=a(B).addClass("customelement").attr({id:c.id,name:c.name}),a(h).empty().append(B);else throw"editoptions.custom_element returns value of a wrong type";else throw"editoptions.custom_element is not a function";
  }catch(v){"e1"===v&&n.call(m,p,"function 'custom_element' "+r.nodefined,q),"e2"===v?n.call(m,p,"function 'custom_element' "+r.novalue,q):n.call(m,p,"string"===typeof v?v:v.message,q)}}return h},checkDate:function(a,c){var d={},e;a=a.toLowerCase();e=-1!==a.indexOf("/")?"/":-1!==a.indexOf("-")?"-":-1!==a.indexOf(".")?".":"/";a=a.split(e);c=c.split(e);if(3!==c.length)return!1;var f=-1,g,h=e=-1,m;for(m=0;m<a.length;m++)g=isNaN(c[m])?0:parseInt(c[m],10),d[a[m]]=g,g=a[m],-1!==g.indexOf("y")&&(f=m),-1!==
  g.indexOf("m")&&(h=m),-1!==g.indexOf("d")&&(e=m);g="y"===a[f]||"yyyy"===a[f]?4:"yy"===a[f]?2:-1;var l;m=[0,31,29,31,30,31,30,31,31,30,31,30,31];if(-1===f)return!1;l=d[a[f]].toString();2===g&&1===l.length&&(g=1);if(l.length!==g||0===d[a[f]]&&"00"!==c[f]||-1===h)return!1;l=d[a[h]].toString();if(1>l.length||1>d[a[h]]||12<d[a[h]]||-1===e)return!1;l=d[a[e]].toString();!(g=1>l.length||1>d[a[e]]||31<d[a[e]])&&(g=2===d[a[h]])&&(f=d[a[f]],g=d[a[e]]>(0!==f%4||0===f%100&&0!==f%400?28:29));return g||d[a[e]]>
  m[d[a[h]]]?!1:!0},isEmpty:function(a){return a.match(/^\s+$/)||""===a?!0:!1},checkTime:function(a){var c=/^(\d{1,2}):(\d{2})([apAP][Mm])?$/;if(!u.isEmpty(a))if(a=a.match(c)){if(a[3]){if(1>a[1]||12<a[1])return!1}else if(23<a[1])return!1;if(59<a[2])return!1}else return!1;return!0},checkValues:function(b,c,d,e,f){var g,h,m=this.p;h=m.colModel;var l=u.isEmpty,n=ma.call(a(this),"edit.msg"),p=ma.call(a(this),"formatter.date.masks");if(void 0===d){"string"===typeof c&&(c=m.iColByName[c]);if(void 0===c||
  0>c)return[!0,"",""];e=h[c];d=e.editrules;null!=e.formoptions&&(g=e.formoptions.label)}else g=void 0===e?"_":e,e=h[c];if(d){g||(g=null!=m.colNames?m.colNames[c]:e.label);if(!0===d.required&&l(b))return[!1,g+": "+n.required,""];m=!1===d.required?!1:!0;if(!0===d.number&&(!1!==m||!l(b))&&isNaN(b))return[!1,g+": "+n.number,""];if(void 0!==d.minValue&&!isNaN(d.minValue)&&parseFloat(b)<parseFloat(d.minValue))return[!1,g+": "+n.minValue+" "+d.minValue,""];if(void 0!==d.maxValue&&!isNaN(d.maxValue)&&parseFloat(b)>
  parseFloat(d.maxValue))return[!1,g+": "+n.maxValue+" "+d.maxValue,""];var q;if(!(!0!==d.email||!1===m&&l(b)||(q=/^((([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,
  q.test(b))))return[!1,g+": "+n.email,""];if(!(!0!==d.integer||!1===m&&l(b)||!isNaN(b)&&0===b%1&&-1===b.indexOf(".")))return[!1,g+": "+n.integer,""];if(!(!0!==d.date||!1===m&&l(b)||(e.formatoptions&&e.formatoptions.newformat?(h=e.formatoptions.newformat,p.hasOwnProperty(h)&&(h=p[h])):h=h[c].datefmt||"Y-m-d",u.checkDate(h,b))))return[!1,g+": "+n.date+" - "+h,""];if(!0===d.time&&!(!1===m&&l(b)||u.checkTime(b)))return[!1,g+": "+n.date+" - hh:mm (am/pm)",""];if(!(!0!==d.url||!1===m&&l(b)||(q=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i,
  q.test(b))))return[!1,g+": "+n.url,""];if(!0===d.custom){if(!1!==m||!l(b))return a.isFunction(d.custom_func)?(b=d.custom_func.call(this,b,g,c),a.isArray(b)?b:[!1,n.customarray,""]):[!1,n.customfcheck,""]}else if(a.isFunction(d.custom)&&(!1!==m||!l(b)))return b=d.custom.call(this,f),a.isArray(b)?b:[!1,n.customarray,""]}return[!0,"",""]}});u.extend({getColProp:function(a){var c=this[0];return null!=c&&c.grid&&(a=c.p.iColByName[a],void 0!==a)?c.p.colModel[a]:{}},setColProp:function(b,c){return this.each(function(){var d=
  this.p,e;this.grid&&null!=d&&c&&(e=d.iColByName[b],void 0!==e&&a.extend(!0,d.colModel[e],c))})},sortGrid:function(a,c,d){return this.each(function(){var e=this.grid,f=this.p,g=f.colModel,h=g.length,m,l,n=!1;if(e)for(a||(a=f.sortname),"boolean"!==typeof c&&(c=!1),l=0;l<h;l++)if(m=g[l],m.index===a||m.name===a){!0===f.frozenColumns&&!0===m.frozen&&(n=e.fhDiv.find("#"+f.id+"_"+a));n&&0!==n.length||(n=e.headers[l].el);e=m.sortable;("boolean"!==typeof e||e)&&this.sortData("jqgh_"+f.id+"_"+a,l,c,d,n);break}})},
  clearBeforeUnload:function(){return this.each(function(){var b=this.p,c=this.grid,d,e=u.clearArray,f=Object.prototype.hasOwnProperty;a.isFunction(c.emptyRows)&&c.emptyRows.call(this,!0,!0);a(document).unbind("mouseup.jqGrid"+b.id);a(c.hDiv).unbind("mousemove");a(this).unbind();var g,h=c.headers.length;for(g=0;g<h;g++)c.headers[g].el=null;for(d in c)c.hasOwnProperty(d)&&(c.propOrMethod=null);c="formatCol sortData updatepager refreshIndex setHeadCheckBox constructTr clearToolbar fixScrollOffsetAndhBoxPadding rebuildRowIndexes modalAlert toggleToolbar triggerToolbar formatter addXmlData addJSONData ftoolbar _inlinenav nav grid p".split(" ");
  h=c.length;for(g=0;g<h;g++)f.call(this,c[g])&&(this[c[g]]=null);this._index={};e(b.data);e(b.lastSelectedData);e(b.selarrrow);e(b.savedRow)})},GridDestroy:function(){return this.each(function(){var b=this.p;if(this.grid&&null!=b){b.pager&&a(b.pager).remove();try{a("#alertmod_"+b.idSel).remove(),a(this).jqGrid("clearBeforeUnload"),a(b.gBox).remove()}catch(c){}}})},GridUnload:function(){return this.each(function(){var b=a(this),c=this.p,d=a.fn.jqGrid;this.grid&&(b.removeClass(d.getGuiStyles.call(b,
  "grid","ui-jqgrid-btable")),c.pager&&a(c.pager).empty().removeClass(d.getGuiStyles.call(b,"pagerBottom","ui-jqgrid-pager")).removeAttr("style").removeAttr("dir"),b.jqGrid("clearBeforeUnload"),b.removeAttr("style").removeAttr("tabindex").removeAttr("role").removeAttr("aria-labelledby").removeAttr("style"),b.empty(),b.insertBefore(c.gBox).show(),a(c.pager).insertBefore(c.gBox).show(),a(c.gBox).remove())})},setGridState:function(b){return this.each(function(){var c=this.p,d=this.grid,e=d.cDiv,f=a(d.uDiv),
  g=a(d.ubDiv);if(d&&null!=c){var d=D.getIconRes.call(this,"gridMinimize.visible"),h=D.getIconRes.call(this,"gridMinimize.hidden");"hidden"===b?(a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv",c.gView).slideUp("fast"),c.pager&&a(c.pager).slideUp("fast"),c.toppager&&a(c.toppager).slideUp("fast"),!0===c.toolbar[0]&&("both"===c.toolbar[1]&&g.slideUp("fast"),f.slideUp("fast")),c.footerrow&&a(".ui-jqgrid-sdiv",c.gBox).slideUp("fast"),a(".ui-jqgrid-titlebar-close span",e).removeClass(d).addClass(h),c.gridstate="hidden"):
  "visible"===b&&(a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv",c.gView).slideDown("fast"),c.pager&&a(c.pager).slideDown("fast"),c.toppager&&a(c.toppager).slideDown("fast"),!0===c.toolbar[0]&&("both"===c.toolbar[1]&&g.slideDown("fast"),f.slideDown("fast")),c.footerrow&&a(".ui-jqgrid-sdiv",c.gBox).slideDown("fast"),a(".ui-jqgrid-titlebar-close span",e).removeClass(h).addClass(d),c.gridstate="visible")}})},filterToolbar:function(b){return this.each(function(){var c=this,d=c.grid,e=a(c),f=c.p,g=u.bindEv,h=u.info_dialog,
  m=u.htmlEncode;if(!this.ftoolbar){var l=a.extend(!0,{autosearch:!0,autosearchDelay:500,searchOnEnter:!0,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:!1,groupOp:"AND",defaultSearch:"bw",searchOperators:!1,resetIcon:"x",applyLabelClasses:!0,operands:{eq:"==",ne:"!",lt:"<",le:"<=",gt:">",ge:">=",bw:"^",bn:"!^","in":"=",ni:"!=",ew:"|",en:"!@",cn:"~",nc:"!~",nu:"#",nn:"!#"}},u.search,f.searching||{},b||{}),n=f.colModel,p=function(a){return ma.call(e,a)},
  q=p("errors.errcap"),r=p("edit.bClose"),t=p("edit.msg"),w=M.call(c,"states.hover"),y=M.call(c,"states.select"),x=M.call(c,"filterToolbar.dataField"),B=function(){var b={},g=0,k={};a.each(n,function(){var e=this,h=e.index||e.name,m,n;m=e.searchoptions||{};var q=a("#gs_"+G(e.name),!0===e.frozen&&!0===f.frozenColumns?d.fhDiv:d.hDiv),r=function(a,b){var c=e.formatoptions||{};return void 0!==c[a]?c[a]:p("formatter."+(b||e.formatter)+"."+a)},t=function(a){var b=r("thousandsSeparator").replace(/([\.\*\_\'\(\)\{\}\+\?\\])/g,
  "\\$1");return a.replace(new RegExp(b,"g"),"")};n=l.searchOperators?q.parent().prev().children("a").data("soper")||l.defaultSearch:m.sopt?m.sopt[0]:"select"===e.stype?"eq":l.defaultSearch;if("custom"===e.stype&&a.isFunction(m.custom_value)&&0<q.length&&"SPAN"===q[0].nodeName.toUpperCase())m=m.custom_value.call(c,q.children(".customelement").first(),"get");else if("select"===e.stype)m=q.val();else switch(m=a.trim(q.val()),e.formatter){case "integer":m=t(m).replace(r("decimalSeparator","number"),".");
  ""!==m&&(m=String(parseInt(m,10)));break;case "number":m=t(m).replace(r("decimalSeparator"),".");""!==m&&(m=String(parseFloat(m)));break;case "currency":var q=r("prefix"),w=r("suffix");q&&q.length&&(m=m.substr(q.length));w&&w.length&&(m=m.substr(0,m.length-w.length));m=t(m).replace(r("decimalSeparator"),".");""!==m&&(m=String(parseFloat(m)))}if(m||"nu"===n||"nn"===n)b[h]=m,k[h]=n,g++;else try{delete f.postData[h]}catch(u){}});var h=0<g?!0:!1;if(l.stringResult||l.searchOperators||"local"===f.datatype){var m=
  '{"groupOp":"'+l.groupOp+'","rules":[',q=0;a.each(b,function(a,b){0<q&&(m+=",");m+='{"field":"'+a+'",';m+='"op":"'+k[a]+'",';m+='"data":"'+(b+"").replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';q++});m+="]}";a.extend(f.postData,{filters:m});a.each(["searchField","searchString","searchOper"],function(a,b){f.postData.hasOwnProperty(b)&&delete f.postData[b]})}else a.extend(f.postData,b);var r;f.searchurl&&(r=f.url,e.jqGrid("setGridParam",{url:f.searchurl}));var t="stop"===e.triggerHandler("jqGridToolbarBeforeSearch")?
  !0:!1;!t&&a.isFunction(l.beforeSearch)&&(t=l.beforeSearch.call(c));t||e.jqGrid("setGridParam",{search:h}).trigger("reloadGrid",[a.extend({page:1},l.reloadGridSearchOptions||{})]);r&&e.jqGrid("setGridParam",{url:r});e.triggerHandler("jqGridToolbarAfterSearch");a.isFunction(l.afterSearch)&&l.afterSearch.call(c)},v=p("search.odata")||[],E=f.customSortOperations,A=function(b,d,g){a("#sopt_menu").remove();d=parseInt(d,10);g=parseInt(g,10)+18;var k,h=0,p=[],q=a(b).data("soper"),h=a(b).data("colname"),r=
  a(".ui-jqgrid-view").css("font-size")||"11px";d="<ul id='sopt_menu' class='"+M.call(c,"searchToolbar.menu","ui-search-menu")+"' role='menu' tabindex='0' style='z-index:9999;display:block;font-size:"+r+";left:"+d+"px;top:"+g+"px;'>";h=f.iColByName[h];if(void 0!==h){h=n[h];g=a.extend({},h.searchoptions);var t,u;g.sopt||(g.sopt=[],g.sopt[0]="select"===h.stype?"eq":l.defaultSearch);a.each(v,function(){p.push(this.oper)});null!=E&&a.each(E,function(a){p.push(a)});for(h=0;h<g.sopt.length;h++)r=g.sopt[h],
  k=a.inArray(r,p),-1!==k&&(k=v[k],void 0!==k?(u=l.operands[r],t=k.text):null!=E&&(t=E[r],u=t.operand,t=t.text),k=q===r?y:"",d+='<li class="ui-menu-item '+k+'" role="presentation"><a class="ui-corner-all g-menu-item" tabindex="0" role="menuitem" value="'+m(r)+'" data-oper="'+m(u)+'"><table><tr><td style="width:25px">'+m(u)+"</td><td>"+m(t)+"</td></tr></table></a></li>");d+="</ul>";a("body").append(d);a("#sopt_menu").addClass("ui-menu ui-widget ui-widget-content ui-corner-all");a("#sopt_menu > li > a").hover(function(){a(this).addClass(w)},
  function(){a(this).removeClass(w)}).click(function(){var c=a(this).attr("value"),d=a(this).data("oper");e.triggerHandler("jqGridToolbarSelectOper",[c,d,b]);a("#sopt_menu").hide();a(b).text(d).data("soper",c);!0===l.autosearch&&(d=a(b).parent().next().children()[0],(a(d).val()||"nu"===c||"nn"===c)&&B())})}},F,k=a("<tr></tr>",{"class":"ui-search-toolbar",role:"row"});a.each(n,function(b){var d,e;e="";var m,n,A=this.searchoptions,y=this.editoptions,D=a("<th></th>",{"class":M.call(c,"colHeaders","ui-th-column ui-th-"+
  f.direction+" "+(l.applyLabelClasses?this.labelClasses||"":""))}),z=a("<div></div>"),G=a("<table class='ui-search-table'><tr><td class='ui-search-oper'></td><td class='ui-search-input'></td><td class='ui-search-clear' style='width:1px'></td></tr></table>");!0===this.hidden&&a(D).css("display","none");this.search=!1===this.search?!1:!0;void 0===this.stype&&(this.stype="text");d=a.extend({mode:"filter"},A||{});if(this.search){if(l.searchOperators){e=d.sopt?d.sopt[0]:"select"===this.stype?"eq":l.defaultSearch;
  for(n=0;n<v.length;n++)if(v[n].oper===e){m=l.operands[e]||"";break}if(void 0===m&&null!=E)for(var L in E)if(E.hasOwnProperty(L)&&L===e){m=E[L].operand;break}void 0===m&&(m="=");e="<a title='"+(null!=d.searchtitle?d.searchtitle:p("search.operandTitle"))+"' data-soper='"+e+"' class='"+M.call(c,"searchToolbar.operButton","soptclass")+"' data-colname='"+this.name+"'>"+m+"</a>"}a("td",G).first().data("colindex",b).append(e);null!=d.sopt&&1!==d.sopt.length||a("td.ui-search-oper",G).hide();void 0===d.clearSearch&&
  (d.clearSearch="text"===this.stype?!0:!1);d.clearSearch?(e=p("search.resetTitle")||"Clear Search Value",a("td",G).eq(2).append("<a title='"+e+"' class='"+M.call(c,"searchToolbar.clearButton","clearsearchclass")+"'><span>"+l.resetIcon+"</span></a>")):a("td",G).eq(2).hide();switch(this.stype){case "select":if(e=this.surl||d.dataUrl)a(z).append(G),a.ajax(a.extend({url:e,context:{stbl:G,options:d,cm:this,iCol:b},dataType:"html",success:function(a,b,d){b=this.cm;var e=this.iCol,f=this.options,k=this.stbl.find(">tbody>tr>td.ui-search-input");
  void 0!==f.buildSelect?(a=f.buildSelect.call(c,a,d,b,e))&&k.append(a):k.append(a);a=k.children("select");void 0!==f.defaultValue&&a.val(f.defaultValue);a.attr({name:b.index||b.name,id:"gs_"+b.name});f.attr&&a.attr(f.attr);a.addClass(x);a.css({width:"100%"});g.call(c,a[0],f);u.fullBoolFeedback.call(c,f.selectFilled,"jqGridSelectFilled",{elem:a[0],options:f,cm:b,cmName:b.name,iCol:e,mode:"filter"});!0===l.autosearch&&a.change(function(){B();return!1})}},u.ajaxOptions,f.ajaxSelectOptions||{}));else{var Q,
  U,ja;A?(Q=void 0===A.value?"":A.value,U=void 0===A.separator?":":A.separator,ja=void 0===A.delimiter?";":A.delimiter):y&&(Q=void 0===y.value?"":y.value,U=void 0===y.separator?":":y.separator,ja=void 0===y.delimiter?";":y.delimiter);if(Q){var S=document.createElement("select");S.style.width="100%";a(S).attr({name:this.index||this.name,id:"gs_"+this.name});var V;if("string"===typeof Q)for(e=Q.split(ja),V=0;V<e.length;V++)Q=e[V].split(U),ja=document.createElement("option"),ja.value=Q[0],ja.innerHTML=
  Q[1],S.appendChild(ja);else if("object"===typeof Q)for(V in Q)Q.hasOwnProperty(V)&&(ja=document.createElement("option"),ja.value=V,ja.innerHTML=Q[V],S.appendChild(ja));void 0!==d.defaultValue&&a(S).val(d.defaultValue);d.attr&&a(S).attr(d.attr);a(S).addClass(x);a(z).append(G);g.call(c,S,d);a("td",G).eq(1).append(S);u.fullBoolFeedback.call(c,d.selectFilled,"jqGridSelectFilled",{elem:S,options:A||y||{},cm:this,cmName:this.name,iCol:b,mode:"filter"});!0===l.autosearch&&a(S).change(function(){B();return!1})}}break;
  case "text":b=void 0!==d.defaultValue?d.defaultValue:"";a("td",G).eq(1).append("<input type='text' class='"+x+"' name='"+(this.index||this.name)+"' id='gs_"+this.name+"' value='"+b+"'/>");a(z).append(G);d.attr&&a("input",z).attr(d.attr);g.call(c,a("input",z)[0],d);!0===l.autosearch&&(l.searchOnEnter?a("input",z).keypress(function(a){return 13===(a.charCode||a.keyCode||0)?(B(),!1):this}):a("input",z).keydown(function(a){switch(a.which){case 13:return!1;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;
  default:F&&clearTimeout(F),F=setTimeout(function(){B()},l.autosearchDelay)}}));break;case "custom":a("td",G).eq(1).append("<span style='width:100%;padding:0;box-sizing:border-box;' class='"+x+"' name='"+(this.index||this.name)+"' id='gs_"+this.name+"'/>");a(z).append(G);try{if(a.isFunction(d.custom_element))if(S=d.custom_element.call(c,void 0!==d.defaultValue?d.defaultValue:"",d))S=a(S).addClass("customelement"),a(z).find("span[name='"+(this.index||this.name)+"']").append(S);else throw"e2";else throw"e1";
  }catch(W){"e1"===W&&h.call(c,q,"function 'custom_element' "+t.nodefined,r),"e2"===W?h.call(c,q,"function 'custom_element' "+t.novalue,r):h.call(c,q,"string"===typeof W?W:W.message,r)}}}a(D).append(z);a(D).find(".ui-search-oper .soptclass,.ui-search-clear .clearsearchclass").hover(function(){a(this).addClass(w)},function(){a(this).removeClass(w)});a(k).append(D);l.searchOperators||a("td",G).eq(0).hide()});a(d.hDiv).find(">div>.ui-jqgrid-htable>thead").append(k);l.searchOperators&&(a(".soptclass",k).click(function(b){var c=
  a(this).offset();A(this,c.left,c.top);b.stopPropagation()}),a("body").on("click",function(b){"soptclass"!==b.target.className&&a("#sopt_menu").hide()}));a(".clearsearchclass",k).click(function(){var b=a(this).parents("tr").first(),c=parseInt(a("td.ui-search-oper",b).data("colindex"),10),d=a.extend({},n[c].searchoptions||{}).defaultValue||"";"select"===n[c].stype?d?a("td.ui-search-input select",b).val(d):a("td.ui-search-input select",b)[0].selectedIndex=0:a("td.ui-search-input input",b).val(d);!0===
  l.autosearch&&B()});c.ftoolbar=!0;c.triggerToolbar=B;c.clearToolbar=function(b){var g={},k=0,h;b="boolean"!==typeof b?!0:b;a.each(n,function(){var b,e=a("#gs_"+G(this.name),!0===this.frozen&&!0===f.frozenColumns?d.fhDiv:d.hDiv),l,m=this.searchoptions||{};void 0!==m.defaultValue&&(b=m.defaultValue);h=this.index||this.name;switch(this.stype){case "select":l=0<e.length?!e[0].multiple:!0;e.find("option").each(function(c){this.selected=0===c&&l;if(a(this).val()===b)return this.selected=!0,!1});if(void 0!==
  b)g[h]=b,k++;else try{delete f.postData[h]}catch(n){}break;case "text":e.val(b||"");if(void 0!==b)g[h]=b,k++;else try{delete f.postData[h]}catch(n){}break;case "custom":a.isFunction(m.custom_value)&&0<e.length&&"SPAN"===e[0].nodeName.toUpperCase()&&m.custom_value.call(c,e.children(".customelement").first(),"set",b||"")}});var m=0<k?!0:!1;f.resetsearch=!0;if(l.stringResult||l.searchOperators||"local"===f.datatype){var p='{"groupOp":"'+l.groupOp+'","rules":[',q=0;a.each(g,function(a,b){0<q&&(p+=",");
  p+='{"field":"'+a+'",';p+='"op":"eq",';p+='"data":"'+(b+"").replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';q++});p+="]}";a.extend(f.postData,{filters:p});a.each(["searchField","searchString","searchOper"],function(a,b){f.postData.hasOwnProperty(b)&&delete f.postData[b]})}else a.extend(f.postData,g);var r;f.searchurl&&(r=f.url,e.jqGrid("setGridParam",{url:f.searchurl}));var t="stop"===e.triggerHandler("jqGridToolbarBeforeClear")?!0:!1;!t&&a.isFunction(l.beforeClear)&&(t=l.beforeClear.call(c));t||
  b&&e.jqGrid("setGridParam",{search:m}).trigger("reloadGrid",[a.extend({page:1},l.reloadGridResetOptions||{})]);r&&e.jqGrid("setGridParam",{url:r});e.triggerHandler("jqGridToolbarAfterClear");a.isFunction(l.afterClear)&&l.afterClear()};c.toggleToolbar=function(){var b=a("tr.ui-search-toolbar",d.hDiv),c=!0===f.frozenColumns?a("tr.ui-search-toolbar",d.fhDiv):!1;"none"===b.css("display")?(b.show(),c&&c.show()):(b.hide(),c&&c.hide());!0===f.frozenColumns&&(e.jqGrid("destroyFrozenColumns"),e.jqGrid("setFrozenColumns"))};
  !0===f.frozenColumns&&(e.jqGrid("destroyFrozenColumns"),e.jqGrid("setFrozenColumns"))}})},destroyFilterToolbar:function(){return this.each(function(){this.ftoolbar&&(this.toggleToolbar=this.clearToolbar=this.triggerToolbar=null,this.ftoolbar=!1,a(this.grid.hDiv).find("table thead tr.ui-search-toolbar").remove(),!0===this.p.frozenColumns&&a(this).jqGrid("destroyFrozenColumns").jqGrid("setFrozenColumns"))})},destroyGroupHeader:function(b){void 0===b&&(b=!0);return this.each(function(){var c,d,e,f;c=
  this.grid;var g=this.p.colModel,h=a("table.ui-jqgrid-htable thead",c.hDiv);if(c){a(this).unbind(".setGroupHeaders");var m=a("<tr>",{role:"row"}).addClass("ui-jqgrid-labels"),l=c.headers;c=0;for(d=l.length;c<d;c++){e=g[c].hidden?"none":"";e=a(l[c].el).width(l[c].width).css("display",e);try{e.removeAttr("rowSpan")}catch(n){e.attr("rowSpan",1)}m.append(e);f=e.children("span.ui-jqgrid-resize");0<f.length&&(f[0].style.height="");e.children("div")[0].style.top=""}a(h).children("tr.ui-jqgrid-labels").remove();
  a(h).prepend(m);!0===b&&a(this).jqGrid("setGridParam",{groupHeader:null})}})},setGroupHeaders:function(b){b=a.extend({useColSpanStyle:!1,applyLabelClasses:!0,groupHeaders:[]},b||{});return this.each(function(){this.p.groupHeader=b;var c,d,e=0,f,g,h,m,l,n,p=this.p,q=p.colModel,r=q.length,t=this.grid.headers,w=a("table.ui-jqgrid-htable",this.grid.hDiv),y=u.isCellClassHidden,x=w.children("thead").children("tr.ui-jqgrid-labels"),B=x.last().addClass("jqg-second-row-header");f=w.children("thead");var v=
  w.find(".jqg-first-row-header");void 0===v[0]?v=a("<tr>",{role:"row","aria-hidden":"true"}).addClass("jqg-first-row-header").css("height","auto"):v.empty();var E=function(a,b){var c=b.length,d;for(d=0;d<c;d++)if(b[d].startColumnName===a)return d;return-1};a(this).prepend(f);f=a("<tr>",{role:"row"}).addClass("ui-jqgrid-labels jqg-third-row-header");for(c=0;c<r;c++)if(h=t[c].el,m=a(h),d=q[c],g={height:"0",width:t[c].width+"px",display:d.hidden?"none":""},a("<th>",{role:"gridcell"}).css(g).addClass("ui-first-th-"+
  p.direction+(b.applyLabelClasses?" "+(d.labelClasses||""):"")).appendTo(v),h.style.width="",g=M.call(this,"colHeaders","ui-th-column-header ui-th-"+p.direction+" "+(b.applyLabelClasses?d.labelClasses||"":"")),l=E(d.name,b.groupHeaders),0<=l){l=b.groupHeaders[l];e=l.numberOfColumns;n=l.titleText;for(l=d=0;l<e&&c+l<r;l++)q[c+l].hidden||y(q[c+l].classes)||a(t[c+l].el).is(":hidden")||d++;g=a("<th>").addClass(g).css({height:"22px","border-top":"0 none"}).html(n);0<d&&g.attr("colspan",String(d));p.headertitles&&
  g.attr("title",g.text());0===d&&g.hide();m.before(g);f.append(h);--e}else 0===e?b.useColSpanStyle?m.attr("rowspan",x.length+1):(a("<th>").addClass(g).css({display:d.hidden?"none":"","border-top":"0 none"}).insertBefore(m),f.append(h)):(f.append(h),e--);p=a(this).children("thead");p.prepend(v);f.insertAfter(B);w.prepend(p);b.useColSpanStyle&&(w.find("span.ui-jqgrid-resize").each(function(){var b=a(this).parent();b.is(":visible")&&(this.style.cssText="height:"+b.height()+"px !important;cursor:col-resize;")}),
  w.find(".ui-th-column>div").each(function(){var b=a(this),c=b.parent();c.is(":visible")&&c.is(":has(span.ui-jqgrid-resize)")&&!b.hasClass("ui-jqgrid-rotate")&&!b.hasClass("ui-jqgrid-rotateOldIE")&&b.css("top",(c.height()-b.outerHeight(!0))/2+"px")}));a(this).triggerHandler("jqGridAfterSetGroupHeaders")})},getNumberOfFrozenColumns:function(){var a=this;if(0===a.length)return 0;var a=a[0],a=a.p.colModel,c=a.length,d=-1,e;for(e=0;e<c&&!0===a[e].frozen;e++)d=e;return d+1},setFrozenColumns:function(){return this.each(function(){var b=
  this,c=a(b),d=b.p,e=b.grid;if(e&&null!=d&&!0!==d.frozenColumns){var f=d.colModel,g,h=f.length,m=-1,l=!1,n=[],p=G(d.id),q=M.call(b,"states.hover"),r=M.call(b,"states.disabled");if(!0!==d.subGrid&&!0!==d.treeGrid&&!d.scroll){for(g=0;g<h&&!0===f[g].frozen;g++)l=!0,m=g,n.push("#jqgh_"+p+"_"+G(f[g].name));d.sortable&&(f=a(e.hDiv).find(".ui-jqgrid-htable .ui-jqgrid-labels"),f.sortable("destroy"),c.jqGrid("setGridParam",{sortable:{options:{items:0<n.length?">th:not(:has("+n.join(",")+"),:hidden)":">th:not(:hidden)"}}}),
  c.jqGrid("sortableColumns",f));if(0<=m&&l){l=d.caption?a(e.cDiv).outerHeight():0;n=a(".ui-jqgrid-htable",d.gView).height();d.toppager&&(l+=a(e.topDiv).outerHeight());!0===d.toolbar[0]&&"bottom"!==d.toolbar[1]&&(l+=a(e.uDiv).outerHeight());e.fhDiv=a("<div style='position:absolute;overflow:hidden;"+("rtl"===d.direction?"right:0;border-top-left-radius:0;":"left:0;border-top-right-radius:0;")+"top:"+l+"px;height:"+n+"px;' class='"+M.call(b,"hDiv","frozen-div ui-jqgrid-hdiv")+"'></div>");e.fbDiv=a("<div style='position:absolute;overflow:hidden;"+
  ("rtl"===d.direction?"right:0;":"left:0;")+"top:"+(parseInt(l,10)+parseInt(n,10)+1)+"px;overflow:hidden;' class='frozen-bdiv ui-jqgrid-bdiv'></div>");a(d.gView).append(e.fhDiv);f=a(".ui-jqgrid-htable",d.gView).clone(!0);h=f[0].tHead.rows;if(d.groupHeader){a(h[0].cells).filter(":gt("+m+")").remove();a(h).filter(".jqg-third-row-header").each(function(){a(this).children("th[id]").each(function(){var c=a(this).attr("id");c&&c.substr(0,b.id.length+1)===b.id+"_"&&(c=c.substr(b.id.length+1),d.iColByName[c]>
  m&&a(this).remove())})});var t=-1,w=-1,u,x;a(h).filter(".jqg-second-row-header").children("th").each(function(){u=parseInt(a(this).attr("colspan")||1,10);x=parseInt(a(this).attr("rowspan")||1,10);1<x?(t++,w++):u&&(t+=u,w++);if(t===m)return!1});t!==m&&(w=m);a(h).filter(".jqg-second-row-header,.ui-search-toolbar").each(function(){a(this).children(":gt("+w+")").remove()})}else a(h).each(function(){a(this).children(":gt("+m+")").remove()});a(f).width(1);a(e.fhDiv).append(f).mousemove(function(a){if(e.resizing)return e.dragMove(a),
  !1}).scroll(function(){this.scrollLeft=0});d.footerrow&&(f=a(".ui-jqgrid-bdiv",d.gView).height(),e.fsDiv=a("<div style='position:absolute;"+("rtl"===d.direction?"right:0;":"left:0;")+"top:"+(parseInt(l,10)+parseInt(n,10)+parseInt(f,10)+1)+"px;' class='frozen-sdiv ui-jqgrid-sdiv'></div>"),a(d.gView).append(e.fsDiv),l=a(".ui-jqgrid-ftable",d.gView).clone(!0),a("tr",l).each(function(){a("td:gt("+m+")",this).remove()}),a(l).width(1),a(e.fsDiv).append(l));c.bind("jqGridSortCol.setFrozenColumns",function(b,
  c,f){b=a("tr.ui-jqgrid-labels:last th:eq("+d.lastsort+")",e.fhDiv);c=a("tr.ui-jqgrid-labels:last th:eq("+f+")",e.fhDiv);a("span.ui-grid-ico-sort",b).addClass(r);a(b).attr("aria-selected","false");a("span.ui-icon-"+d.sortorder,c).removeClass(r);a(c).attr("aria-selected","true");d.viewsortcols[0]||d.lastsort===f||(a("span.s-ico",b).hide(),a("span.s-ico",c).show())});a(d.gView).append(e.fbDiv);a(e.bDiv).scroll(function(){a(e.fbDiv).scrollTop(a(this).scrollTop())});!0===d.hoverrows&&a(d.idSel).unbind("mouseover").unbind("mouseout");
  var B=function(a,b){var c=a.height();1<=Math.abs(c-b)&&0<b&&(a.height(b),c=a.height(),1<=Math.abs(b-c)&&a.height(b+Math.round(b-c)))},v=function(a,b){var c=a.width();1<=Math.abs(c-b)&&(a.width(b),c=a.width(),1<=Math.abs(b-c)&&a.width(b+Math.round(b-c)))},E=function(b,c,e,f){var h,l,m,n,p,q,r;r=a(c).position().top;var t,w,u;if(null!=b&&0<b.length){b[0].scrollTop=c.scrollTop;b.css("rtl"===d.direction?{top:r,right:0}:{top:r,left:0});l=b.children("table").children("thead").children("tr");m=a(c).children("div").children("table").children("thead").children("tr");
  0===m.length&&(l=a(b.children("table")[0].rows),m=a(a(c).children("div").children("table")[0].rows));h=Math.min(l.length,m.length);t=0<h?a(l[0]).position().top:0;w=0<h?a(m[0]).position().top:0;if(0<=e)for(0<=f&&(h=Math.min(f+1,h));e<h;e++)if(n=a(m[e]),"none"!==n.css("display")&&n.is(":visible")){r=n.position().top;f=a(l[e]);p=f.position().top;q=n.height();if(null!=d.groupHeader&&d.groupHeader.useColSpanStyle)for(u=n[0].cells,g=0;g<u.length;g++)n=u[g],null!=n&&"TH"===n.nodeName.toUpperCase()&&(q=Math.max(q,
  a(n).height()));r=q+(r-w)+(t-p);B(f,r)}B(b,c.clientHeight)}},l={resizeDiv:!0,resizedRows:{iRowStart:0,iRowEnd:-1}},A={header:l,resizeFooter:!0,body:l};c.bind("jqGridAfterGridComplete.setFrozenColumns",function(){a(d.idSel+"_frozen").remove();a(e.fbDiv).height(e.hDiv.clientHeight);var b=a(this).clone(!0),f=b[0].rows,g=c[0].rows;a(f).filter("tr[role=row]").each(function(){a(this.cells).filter("td[role=gridcell]:gt("+m+")").remove()});e.fbRows=f;b.width(1).attr("id",d.id+"_frozen");b.appendTo(e.fbDiv);
  if(!0===d.hoverrows){var h=function(b,c,d){a(b)[c](q);a(d[b.rowIndex])[c](q)};a(f).filter(".jqgrow").hover(function(){h(this,"addClass",g)},function(){h(this,"removeClass",g)});a(g).filter(".jqgrow").hover(function(){h(this,"addClass",f)},function(){h(this,"removeClass",f)})}E(e.fhDiv,e.hDiv,0,-1);E(e.fbDiv,e.bDiv,0,-1);e.sDiv&&E(e.fsDiv,e.sDiv,0,-1)});var F=function(b){a(e.fbDiv).scrollTop(a(e.bDiv).scrollTop());b.header.resizeDiv&&E(e.fhDiv,e.hDiv,b.header.iRowStart,b.header.iRowEnd);b.body.resizeDiv&&
  E(e.fbDiv,e.bDiv,b.body.iRowStart,b.body.iRowEnd);b.resizeFooter&&e.sDiv&&b.resizeFooter&&E(e.fsDiv,e.sDiv,0,-1);var c=e.fhDiv[0].clientWidth;b.header.resizeDiv&&null!=e.fhDiv&&1<=e.fhDiv.length&&B(a(e.fhDiv),e.hDiv.clientHeight);b.body.resizeDiv&&null!=e.fbDiv&&0<e.fbDiv.length&&v(a(e.fbDiv),c);b.resizeFooter&&null!=e.fsDiv&&0<=e.fsDiv.length&&v(a(e.fsDiv),c)};a(d.gBox).bind("resizestop.setFrozenColumns",function(){setTimeout(function(){F(A)},50)});c.bind("jqGridInlineEditRow.setFrozenColumns jqGridInlineAfterRestoreRow.setFrozenColumns jqGridInlineAfterSaveRow.setFrozenColumns jqGridAfterEditCell.setFrozenColumns jqGridAfterRestoreCell.setFrozenColumns jqGridAfterSaveCell.setFrozenColumns jqGridResizeStop.setFrozenColumns",
  function(a,b){var d=c.jqGrid("getInd",b);F({header:{resizeDiv:!1,resizedRows:{iRowStart:-1,iRowEnd:-1}},resizeFooter:!0,body:{resizeDiv:!0,resizedRows:{iRowStart:d,iRowEnd:d}}})});c.bind("jqGridResizeStop.setFrozenColumns",function(){F(A)});c.bind("jqGridResetFrozenHeights.setFrozenColumns",function(a,b){F(b||A)});e.hDiv.loading||c.triggerHandler("jqGridAfterGridComplete");d.frozenColumns=!0}}}})},destroyFrozenColumns:function(){return this.each(function(){var b=a(this),c=this.grid,d=this.p,e=G(d.id);
  if(c&&!0===d.frozenColumns){a(c.fhDiv).remove();a(c.fbDiv).remove();c.fhDiv=null;c.fbDiv=null;c.fbRows=null;d.footerrow&&(a(c.fsDiv).remove(),c.fsDiv=null);b.unbind(".setFrozenColumns");if(!0===d.hoverrows){var f,g=M.call(this,"states.hover");b.bind("mouseover",function(b){f=a(b.target).closest("tr.jqgrow");"ui-subgrid"!==a(f).attr("class")&&a(f).addClass(g)}).bind("mouseout",function(b){f=a(b.target).closest("tr.jqgrow");a(f).removeClass(g)})}d.frozenColumns=!1;d.sortable&&(c=a(c.hDiv).find(".ui-jqgrid-htable .ui-jqgrid-labels"),
  c.sortable("destroy"),b.jqGrid("setGridParam",{sortable:{options:{items:">th:not(:has(#jqgh_"+e+"_cb,#jqgh_"+e+"_rn,#jqgh_"+e+"_subgrid),:hidden)"}}}),b.jqGrid("sortableColumns",c))}})}});a.fn.jqFilter=function(b){if("string"===typeof b){var c=a.fn.jqFilter[b];if(!c)throw"jqFilter - No such method: "+b;var d=a.makeArray(arguments).slice(1);return c.apply(this,d)}var e=a.extend(!0,{filter:null,columns:[],onChange:null,afterRedraw:null,checkValues:null,error:!1,errmsg:"",errorcheck:!0,showQuery:!0,
  sopt:null,ops:[],operands:null,numopts:"eq ne lt le gt ge nu nn in ni".split(" "),stropts:"eq ne bw bn ew en cn nc nu nn in ni".split(" "),strarr:["text","string","blob"],groupOps:[{op:"AND",text:"AND"},{op:"OR",text:"OR"}],groupButton:!0,ruleButtons:!0,direction:"ltr"},u.filter,b||{});return this.each(function(){if(!this.filter){this.p=e;if(null===e.filter||void 0===e.filter)e.filter={groupOp:e.groupOps[0].op,rules:[],groups:[]};var b,c=e.columns.length,d,m=/msie/i.test(navigator.userAgent)&&!window.opera,
  l=function(){return a("#"+u.jqID(e.id))[0]||null},n=function(b,c){return a(l()).jqGrid("getGuiStyles",b,c||"")},p=function(b){return a(l()).jqGrid("getGridRes","search."+b)},q=n("states.error"),r=n("dialog.content");e.initFilter=a.extend(!0,{},e.filter);if(c){for(b=0;b<c;b++)d=e.columns[b],d.stype?d.inputtype=d.stype:d.inputtype||(d.inputtype="text"),d.sorttype?d.searchtype=d.sorttype:d.searchtype||(d.searchtype="string"),void 0===d.hidden&&(d.hidden=!1),d.label||(d.label=d.name),d.index&&(d.name=
  d.index),d.hasOwnProperty("searchoptions")||(d.searchoptions={}),d.hasOwnProperty("searchrules")||(d.searchrules={});e.showQuery&&a(this).append("<table class='queryresult "+r+"' style='display:block;max-width:440px;border:0px none;' dir='"+e.direction+"'><tbody><tr><td class='query'></td></tr></tbody></table>");var t=function(b,c){var d=[!0,""],f=l();if(a.isFunction(c.searchrules))d=c.searchrules.call(f,b,c);else if(u&&u.checkValues)try{d=u.checkValues.call(f,b,-1,c.searchrules,c.label)}catch(g){}d&&
  d.length&&!1===d[0]&&(e.error=!d[0],e.errmsg=d[1])};this.onchange=function(){e.error=!1;e.errmsg="";return a.isFunction(e.onChange)?e.onChange.call(this,e):!1};this.reDraw=function(){a("table.group:first",this).remove();var b=this.createTableForGroup(e.filter,null);a(this).append(b);a.isFunction(e.afterRedraw)&&e.afterRedraw.call(this,e)};this.createTableForGroup=function(b,c){var d=this,f,g=a("<table class='"+n("searchDialog.operationGroup","group")+"' style='border:0px none;'><tbody></tbody></table>"),
  h="left";"rtl"===e.direction&&(h="right",g.attr("dir","rtl"));null===c&&g.append("<tr class='error' style='display:none;'><th colspan='5' class='"+q+"' align='"+h+"'></th></tr>");var l=a("<tr></tr>");g.append(l);h=a("<th colspan='5' align='"+h+"'></th>");l.append(h);if(!0===e.ruleButtons){var m=a("<select class='"+n("searchDialog.operationSelect","opsel")+"'></select>");h.append(m);var l="",k;for(f=0;f<e.groupOps.length;f++)k=b.groupOp===d.p.groupOps[f].op?" selected='selected'":"",l+="<option value='"+
  d.p.groupOps[f].op+"'"+k+">"+d.p.groupOps[f].text+"</option>";m.append(l).bind("change",function(){b.groupOp=a(m).val();d.onchange()})}l="<span></span>";e.groupButton&&(l=a("<input type='button' value='+ {}' title='"+p("addGroupTitle")+"' class='"+n("searchDialog.addGroupButton","add-group")+"'/>"),l.bind("click",function(){void 0===b.groups&&(b.groups=[]);b.groups.push({groupOp:e.groupOps[0].op,rules:[],groups:[]});d.reDraw();d.onchange();return!1}));h.append(l);if(!0===e.ruleButtons){var l=a("<input type='button' value='+' title='"+
  p("addRuleTitle")+"' class='"+n("searchDialog.addRuleButton","add-rule ui-add")+"'/>"),r;l.bind("click",function(){var c,e,g;void 0===b.rules&&(b.rules=[]);for(f=0;f<d.p.columns.length;f++)if(c=void 0===d.p.columns[f].search?!0:d.p.columns[f].search,e=!0===d.p.columns[f].hidden,(g=!0===d.p.columns[f].searchoptions.searchhidden)&&c||c&&!e){r=d.p.columns[f];break}c=r.searchoptions.sopt?r.searchoptions.sopt:d.p.sopt?d.p.sopt:-1!==a.inArray(r.searchtype,d.p.strarr)?d.p.stropts:d.p.numopts;b.rules.push({field:r.name,
  op:c[0],data:""});d.reDraw();return!1});h.append(l)}null!==c&&(l=a("<input type='button' value='-' title='"+p("deleteGroupTitle")+"' class='"+n("searchDialog.deleteGroupButton","delete-group")+"'/>"),h.append(l),l.bind("click",function(){for(f=0;f<c.groups.length;f++)if(c.groups[f]===b){c.groups.splice(f,1);break}d.reDraw();d.onchange();return!1}));if(void 0!==b.groups)for(f=0;f<b.groups.length;f++)h=a("<tr></tr>"),g.append(h),l=a("<td class='first'></td>"),h.append(l),l=a("<td colspan='4'></td>"),
  l.append(this.createTableForGroup(b.groups[f],b)),h.append(l);void 0===b.groupOp&&(b.groupOp=d.p.groupOps[0].op);if(void 0!==b.rules)for(f=0;f<b.rules.length;f++)g.append(this.createTableRowForRule(b.rules[f],b));return g};this.createTableRowForRule=function(b,c){var d=this,f=l(),g=a("<tr></tr>"),h,q,r,k="",t;g.append("<td class='first'></td>");var K=a("<td class='columns'></td>");g.append(K);var I=a("<select class='"+n("searchDialog.label","selectLabel")+"'></select>"),H,J=[];K.append(I);I.bind("change",
  function(){b.field=a(I).val();var c=a(this).parents("tr:first"),e,g;for(g=0;g<d.p.columns.length;g++)if(d.p.columns[g].name===b.field){e=d.p.columns[g];break}if(e){var h=a.extend({},e.searchoptions||{},{id:u.randId(),name:e.name,mode:"search"});m&&"text"===e.inputtype&&!h.size&&(h.size=10);var k=u.createEl.call(f,e.inputtype,h,"",!0,d.p.ajaxSelectOptions||{},!0);a(k).addClass(n("searchDialog.elem","input-elm"));q=h.sopt?h.sopt:d.p.sopt?d.p.sopt:-1!==a.inArray(e.searchtype,d.p.strarr)?d.p.stropts:
  d.p.numopts;e="";var l=0,p,r;J=[];a.each(d.p.ops,function(){J.push(this.oper)});d.p.cops&&a.each(d.p.cops,function(a){J.push(a)});for(g=0;g<q.length;g++)r=q[g],H=a.inArray(q[g],J),-1!==H&&(p=d.p.ops[H],p=void 0!==p?p.text:d.p.cops[r].text,0===l&&(b.op=r),e+="<option value='"+r+"'>"+p+"</option>",l++);a(".selectopts",c).empty().append(e);a(".selectopts",c)[0].selectedIndex=0;u.msie&&9>u.msiever()&&(g=parseInt(a("select.selectopts",c)[0].offsetWidth,10)+1,a(".selectopts",c).width(g),a(".selectopts",
  c).css("width","auto"));a(".data",c).empty().append(k);u.bindEv.call(f,k,h);a(".input-elm",c).bind("change",function(c){c=c.target;b.data="SPAN"===c.nodeName.toUpperCase()&&h&&a.isFunction(h.custom_value)?h.custom_value.call(f,a(c).children(".customelement:first"),"get"):c.value;d.onchange()});setTimeout(function(){b.data=a(k).val();d.onchange()},0)}});var K=0,D,G;for(h=0;h<d.p.columns.length;h++)if(t=void 0===d.p.columns[h].search?!0:d.p.columns[h].search,D=!0===d.p.columns[h].hidden,(G=!0===d.p.columns[h].searchoptions.searchhidden)&&
  t||t&&!D)t="",b.field===d.p.columns[h].name&&(t=" selected='selected'",K=h),k+="<option value='"+d.p.columns[h].name+"'"+t+">"+d.p.columns[h].label+"</option>";I.append(k);k=a("<td class='operators'></td>");g.append(k);r=e.columns[K];m&&"text"===r.inputtype&&!r.searchoptions.size&&(r.searchoptions.size=10);K=u.createEl.call(f,r.inputtype,a.extend({},r.searchoptions||{},{id:u.randId(),name:r.name}),b.data,!0,d.p.ajaxSelectOptions||{},!0);if("nu"===b.op||"nn"===b.op)a(K).attr("readonly","true"),a(K).attr("disabled",
  "true");var O=a("<select class='"+n("searchDialog.operator","selectopts")+"'></select>");k.append(O);O.bind("change",function(){b.op=a(O).val();var c=a(this).parents("tr:first"),c=a(".input-elm",c)[0];"nu"===b.op||"nn"===b.op?(b.data="","SELECT"!==c.tagName.toUpperCase()&&(c.value=""),c.setAttribute("readonly","true"),c.setAttribute("disabled","true")):("SELECT"===c.tagName.toUpperCase()&&(b.data=c.value),c.removeAttribute("readonly"),c.removeAttribute("disabled"));d.onchange()});q=r.searchoptions.sopt?
  r.searchoptions.sopt:d.p.sopt?d.p.sopt:-1!==a.inArray(r.searchtype,d.p.strarr)?d.p.stropts:d.p.numopts;k="";a.each(d.p.ops,function(){J.push(this.oper)});d.p.cops&&a.each(d.p.cops,function(a){J.push(a)});for(h=0;h<q.length;h++)G=q[h],H=a.inArray(q[h],J),-1!==H&&(D=d.p.ops[H],t=b.op===G?" selected='selected'":"",k+="<option value='"+G+"'"+t+">"+(void 0!==D?D.text:d.p.cops[G].text)+"</option>");O.append(k);k=a("<td class='data'></td>");g.append(k);k.append(K);u.bindEv.call(f,K,r.searchoptions);a(K).addClass(n("searchDialog.elem",
  "input-elm")).bind("change",function(){b.data="custom"===r.inputtype?r.searchoptions.custom_value.call(f,a(this).children(".customelement:first"),"get"):a(this).val();d.onchange()});k=a("<td></td>");g.append(k);!0===e.ruleButtons&&(K=a("<input type='button' value='-' title='"+p("deleteRuleTitle")+"' class='"+n("searchDialog.deleteRuleButton","delete-rule ui-del")+"'/>"),k.append(K),K.bind("click",function(){for(h=0;h<c.rules.length;h++)if(c.rules[h]===b){c.rules.splice(h,1);break}d.reDraw();d.onchange();
  return!1}));return g};this.getStringForGroup=function(a){var b="(",c;if(void 0!==a.groups)for(c=0;c<a.groups.length;c++){1<b.length&&(b+=" "+a.groupOp+" ");try{b+=this.getStringForGroup(a.groups[c])}catch(d){alert(d)}}if(void 0!==a.rules)try{for(c=0;c<a.rules.length;c++)1<b.length&&(b+=" "+a.groupOp+" "),b+=this.getStringForRule(a.rules[c])}catch(d){alert(d)}b+=")";return"()"===b?"":b};this.getStringForRule=function(b){var c="",d="",f,g,h=b.data,l;for(f=0;f<e.ops.length;f++)if(e.ops[f].oper===b.op){c=
  e.operands.hasOwnProperty(b.op)?e.operands[b.op]:"";d=e.ops[f].oper;break}if(""===d&&null!=e.cops)for(l in e.cops)if(e.cops.hasOwnProperty(l)&&(d=l,c=e.cops[l].operand,a.isFunction(e.cops[l].buildQueryValue)))return e.cops[l].buildQueryValue.call(e,{cmName:b.field,searchValue:h,operand:c});for(f=0;f<e.columns.length;f++)if(e.columns[f].name===b.field){g=e.columns[f];break}if(null==g)return"";if("bw"===d||"bn"===d)h+="%";if("ew"===d||"en"===d)h="%"+h;if("cn"===d||"nc"===d)h="%"+h+"%";if("in"===d||
  "ni"===d)h=" ("+h+")";e.errorcheck&&t(b.data,g);return-1!==a.inArray(g.searchtype,["int","integer","float","number","currency"])||"nn"===d||"nu"===d?b.field+" "+c+" "+h:b.field+" "+c+' "'+h+'"'};this.resetFilter=function(){e.filter=a.extend(!0,{},e.initFilter);this.reDraw();this.onchange()};this.hideError=function(){a("th."+q,this).html("");a("tr.error",this).hide()};this.showError=function(){a("th."+q,this).html(e.errmsg);a("tr.error",this).show()};this.toUserFriendlyString=function(){return this.getStringForGroup(e.filter)};
  this.toString=function(){function a(c){var d="(",e;if(void 0!==c.groups)for(e=0;e<c.groups.length;e++)1<d.length&&(d="OR"===c.groupOp?d+" || ":d+" && "),d+=a(c.groups[e]);if(void 0!==c.rules)for(e=0;e<c.rules.length;e++){1<d.length&&(d="OR"===c.groupOp?d+" || ":d+" && ");var f=c.rules[e];if(b.p.errorcheck){for(var g=void 0,h=void 0,g=0;g<b.p.columns.length;g++)if(b.p.columns[g].name===f.field){h=b.p.columns[g];break}h&&t(f.data,h)}d+=f.op+"(item."+f.field+",'"+f.data+"')"}d+=")";return"()"===d?"":
  d}var b=this;return a(e.filter)};this.reDraw();if(e.showQuery)this.onchange();this.filter=!0}}})};a.extend(a.fn.jqFilter,{toSQLString:function(){var a="";this.each(function(){a=this.toUserFriendlyString()});return a},filterData:function(){var a;this.each(function(){a=this.p.filter});return a},getParameter:function(a){return void 0!==a&&this.p.hasOwnProperty(a)?this.p[a]:this.p},resetFilter:function(){return this.each(function(){this.resetFilter()})},addFilter:function(b){"string"===typeof b&&(b=a.parseJSON(b));
  this.each(function(){this.p.filter=b;this.reDraw();this.onchange()})}});var La={xml2json:function(a,c){9===a.nodeType&&(a=a.documentElement);var d=this.removeWhite(a),d=this.toObj(d),d=this.toJson(d,a.nodeName,"\t");return"{\n"+c+(c?d.replace(/\t/g,c):d.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,c){var d=function(a,b,c){var e="",f,p,q;if(a instanceof Array)if(0===a.length)e+=c+"<"+b+">__EMPTY_ARRAY_</"+b+">\n";else for(f=0,p=a.length;f<p;f+=1)q=c+d(a[f],b,c+"\t")+"\n",e+=q;else if("object"===
  typeof a){f=!1;e+=c+"<"+b;for(p in a)a.hasOwnProperty(p)&&("@"===p.charAt(0)?e+=" "+p.substr(1)+'="'+a[p].toString()+'"':f=!0);e+=f?">":"/>";if(f){for(p in a)a.hasOwnProperty(p)&&("#text"===p?e+=a[p]:"#cdata"===p?e+="<![CDATA["+a[p]+"]]\x3e":"@"!==p.charAt(0)&&(e+=d(a[p],p,c+"\t")));e+=("\n"===e.charAt(e.length-1)?c:"")+"</"+b+">"}}else"function"===typeof a?e+=c+"<"+b+"><![CDATA["+a+"]]\x3e</"+b+">":(void 0===a&&(a=""),e='""'===a.toString()||0===a.toString().length?e+(c+"<"+b+">__EMPTY_STRING_</"+
  b+">"):e+(c+"<"+b+">"+a.toString()+"</"+b+">"));return e},e="",f;for(f in a)a.hasOwnProperty(f)&&(e+=d(a[f],f,""));return c?e.replace(/\t/g,c):e.replace(/\t|\n/g,"")},toObj:function(a){var c={},d=/function/i,e,f=0,g=0,h=!1;if(1===a.nodeType){if(a.attributes.length)for(e=0;e<a.attributes.length;e+=1)c["@"+a.attributes[e].nodeName]=(a.attributes[e].nodeValue||"").toString();if(a.firstChild){for(e=a.firstChild;e;e=e.nextSibling)1===e.nodeType?h=!0:3===e.nodeType&&e.nodeValue.match(/[^ \f\n\r\t\v]/)?
  f+=1:4===e.nodeType&&(g+=1);if(h)if(2>f&&2>g)for(this.removeWhite(a),e=a.firstChild;e;e=e.nextSibling)3===e.nodeType?c["#text"]=this.escape(e.nodeValue):4===e.nodeType?d.test(e.nodeValue)?c[e.nodeName]=[c[e.nodeName],e.nodeValue]:c["#cdata"]=this.escape(e.nodeValue):c[e.nodeName]?c[e.nodeName]instanceof Array?c[e.nodeName][c[e.nodeName].length]=this.toObj(e):c[e.nodeName]=[c[e.nodeName],this.toObj(e)]:c[e.nodeName]=this.toObj(e);else a.attributes.length?c["#text"]=this.escape(this.innerXml(a)):c=
  this.escape(this.innerXml(a));else if(f)a.attributes.length?c["#text"]=this.escape(this.innerXml(a)):(c=this.escape(this.innerXml(a)),"__EMPTY_ARRAY_"===c?c="[]":"__EMPTY_STRING_"===c&&(c=""));else if(g)if(1<g)c=this.escape(this.innerXml(a));else for(e=a.firstChild;e;e=e.nextSibling){if(d.test(a.firstChild.nodeValue)){c=a.firstChild.nodeValue;break}c["#cdata"]=this.escape(e.nodeValue)}}a.attributes.length||a.firstChild||(c=null)}else 9===a.nodeType?c=this.toObj(a.documentElement):alert("unhandled node type: "+
  a.nodeType);return c},toJson:function(a,c,d,e){void 0===e&&(e=!0);var f=c?'"'+c+'"':"",g="\t",h="\n",m,l,n=[];m=[];e||(h=g="");if("[]"===a)f+=c?":[]":"[]";else if(a instanceof Array){l=0;for(m=a.length;l<m;l+=1)n[l]=this.toJson(a[l],"",d+g,e);f+=(c?":[":"[")+(1<n.length?h+d+g+n.join(","+h+d+g)+h+d:n.join(""))+"]"}else if(null===a)f+=(c&&":")+"null";else if("object"===typeof a){for(l in a)a.hasOwnProperty(l)&&(m[m.length]=this.toJson(a[l],l,d+g,e));f+=(c?":{":"{")+(1<m.length?h+d+g+m.join(","+h+d+
  g)+h+d:m.join(""))+"}"}else f="string"===typeof a?f+((c&&":")+'"'+a.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"'):f+((c&&":")+a.toString());return f},innerXml:function(a){var c="",d=function(a){var b="",c;if(1===a.nodeType){b+="<"+a.nodeName;for(c=0;c<a.attributes.length;c+=1)b+=" "+a.attributes[c].nodeName+'="'+(a.attributes[c].nodeValue||"").toString()+'"';if(a.firstChild){b+=">";for(c=a.firstChild;c;c=c.nextSibling)b+=d(c);b+="</"+a.nodeName+">"}else b+="/>"}else 3===a.nodeType?b+=a.nodeValue:
  4===a.nodeType&&(b+="<![CDATA["+a.nodeValue+"]]\x3e");return b};if(a.hasOwnProperty("innerHTML"))c=a.innerHTML;else for(a=a.firstChild;a;a=a.nextSibling)c+=d(a);return c},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var c=a.firstChild,d;c;)3===c.nodeType?c.nodeValue.match(/[^ \f\n\r\t\v]/)?c=c.nextSibling:(d=c.nextSibling,a.removeChild(c),c=d):(1===c.nodeType&&this.removeWhite(c),
  c=c.nextSibling);return a}};window.xmlJsonClass=La;var Sa=u.feedback,Da=u.fullBoolFeedback,ga=u.builderFmButon,Ta=function(a,c,d){!0===c[0]&&(d="<span class='"+va("fm-button-icon",d,c[2])+"'></span>","right"===c[1]?a.addClass("fm-button-icon-right").append(d):a.addClass("fm-button-icon-left").prepend(d))},Z=function(a){return M.call(this,"states."+a)},Ha=function(a){return"&nbsp;"===a||"&#160;"===a||1===a.length&&160===a.charCodeAt(0)};u.extend({searchGrid:function(b){return this.each(function(){function c(b){w("beforeShow",
  b)&&(a(n).data("onClose",g.onClose),u.viewModal.call(d,n,{gbox:p,jqm:g.jqModal,overlay:g.overlay,modal:g.modal,overlayClass:g.overlayClass,toTop:g.toTop,onHide:function(a){a.w.remove();a.o&&a.o.remove()}}),w("afterShow",b))}var d=this,e=a(d),f=d.p;if(d.grid&&null!=f){var g=a.extend(!0,{drag:!0,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",loadDefaults:!0,beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,afterRedraw:null,afterChange:null,closeAfterSearch:!1,
  closeAfterReset:!1,closeOnEscape:!1,searchOnEnter:!1,multipleSearch:!1,multipleGroup:!1,top:0,left:0,removemodal:!0,resize:!0,width:450,height:"auto",dataheight:"auto",showQuery:!1,errorcheck:!0,sopt:null,stringResult:void 0,onClose:null,onSearch:null,onReset:null,columns:[],tmplNames:null,tmplFilters:null,tmplLabel:" Template: ",showOnLoad:!1,layer:null,operands:{eq:"=",ne:"<>",lt:"<",le:"<=",gt:">",ge:">=",bw:"LIKE",bn:"NOT LIKE","in":"IN",ni:"NOT IN",ew:"LIKE",en:"NOT LIKE",cn:"LIKE",nc:"NOT LIKE",
  nu:"IS NULL",nn:"IS NOT NULL"}},D.getGridRes.call(e,"search"),u.search||{},f.searching||{},b||{}),h="fbox_"+f.id,m=g.commonIconClass,l={themodal:"searchmod"+h,modalhead:"searchhd"+h,modalcontent:"searchcnt"+h,resizeAlso:h},n="#"+G(l.themodal),p=f.gBox,q=f.gView,r=a.each,t=f.postData[g.sFilter],w=function(){var b=a.makeArray(arguments);b.unshift("Search");b.unshift("Filter");b.unshift(g);return Sa.apply(d,b)},y=function(){u.hideModal(n,{gb:p,jqm:g.jqModal,onClose:g.onClose,removemodal:g.removemodal})};
  "string"===typeof t&&(t=""!==a.trim(t)?a.parseJSON(t):void 0);a(n).remove();if(void 0!==a(n)[0])c(a("#fbox_"+f.idSel));else{var x=a("<div><div id='"+h+"' class='"+M.call(d,"dialog.body","searchFilter")+"' style='overflow:auto'></div></div>").insertBefore(q);"rtl"===f.direction&&x.attr("dir","rtl");var B="",v="",E,A=!1,F,k=-1,C=a.extend([],f.colModel);F=ga.call(d,h+"_search",g.Find,va(m,g.findDialogIcon),"right");var K=ga.call(d,h+"_reset",g.Reset,va(m,g.resetDialogIcon),"left");g.showQuery&&(B=ga.call(d,
  h+"_query","Query",va(m,g.queryDialogIcon),"left")+"&#160;");g.searchForAdditionalProperties&&r(f.additionalProperties,function(){var a="string"===typeof this?{name:this}:this;a.label||(a.label=a.name);a.isAddProp=!0;C.push(a)});g.columns.length?(C=g.columns,k=0,E=C[0].index||C[0].name):r(C,function(a,b){b.label||(b.label=b.isAddProp?b.name:f.colNames[a]);if(!A){var c=void 0===b.search?!0:b.search,d=!0===b.hidden;if(b.searchoptions&&!0===b.searchoptions.searchhidden&&c||c&&!d)A=!0,E=b.index||b.name,
  k=a}});if(!t&&E||!1===g.multipleSearch)m="eq",0<=k&&C[k].searchoptions&&C[k].searchoptions.sopt?m=C[k].searchoptions.sopt[0]:g.sopt&&g.sopt.length&&(m=g.sopt[0]),t={groupOp:"AND",rules:[{field:E,op:m,data:""}]};A=!1;g.tmplNames&&g.tmplNames.length&&(A=!0,v=g.tmplLabel,v+="<select class='ui-template'>",v+="<option value='default'>Default</option>",r(g.tmplNames,function(a,b){v+="<option value='"+a+"'>"+b+"</option>"}),v+="</select>");F="<div class='"+M.call(d,"dialog.footer")+"'><table class='EditTable' style='border:0px none;margin-top:5px' id='"+
  h+"_2'><tbody><tr><td colspan='2'><hr class='"+M.call(d,"dialog.hr")+"' style='margin:1px'/></td></tr><tr><td class='EditButton EditButton-"+f.direction+"'  style='float:"+("rtl"===f.direction?"right":"left")+";'>"+K+v+"</td><td class='EditButton EditButton-"+f.direction+"'>"+B+F+"</td></tr></tbody></table></div>";h=G(h);g.gbox=p;g.height="auto";h="#"+h;a(h).jqFilter({columns:C,filter:g.loadDefaults?t:null,showQuery:g.showQuery,errorcheck:g.errorcheck,sopt:g.sopt,groupButton:g.multipleGroup,ruleButtons:g.multipleSearch,
  afterRedraw:g.afterRedraw,ops:g.odata,cops:f.customSortOperations,operands:g.operands,ajaxSelectOptions:f.ajaxSelectOptions,groupOps:g.groupOps,onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString());Da.call(d,g.afterChange,"jqGridFilterAfterChange",a(h),g)},direction:f.direction,id:f.id});x.append(F);A&&g.tmplFilters&&g.tmplFilters.length&&a(".ui-template",x).bind("change",function(){var b=a(this).val();"default"===b?a(h).jqFilter("addFilter",t):a(h).jqFilter("addFilter",
  g.tmplFilters[parseInt(b,10)]);return!1});!0===g.multipleGroup&&(g.multipleSearch=!0);w("onInitialize",a(h));g.layer?u.createModal.call(d,l,x,g,q,a(p)[0],"#"+G(g.layer),{position:"relative"}):u.createModal.call(d,l,x,g,q,a(p)[0]);(g.searchOnEnter||g.closeOnEscape)&&a(n).keydown(function(b){var c=a(b.target);if(!(!g.searchOnEnter||13!==b.which||c.hasClass("add-group")||c.hasClass("add-rule")||c.hasClass("delete-group")||c.hasClass("delete-rule")||c.hasClass("fm-button")&&c.is("[id$=_query]")))return a(h+
  "_search").click(),!1;if(g.closeOnEscape&&27===b.which)return a("#"+G(l.modalhead)).find(".ui-jqdialog-titlebar-close").click(),!1});B&&a(h+"_query").bind("click",function(){a(".queryresult",x).toggle();return!1});void 0===g.stringResult&&(g.stringResult=g.multipleSearch);a(h+"_search").bind("click",function(){var b={},c,k,l=a(h);k=l.find(".input-elm");k.filter(":focus")&&(k=k.filter(":focus"));k.change();k=l.jqFilter("filterData");if(g.errorcheck&&(l[0].hideError(),g.showQuery||l.jqFilter("toSQLString"),
  l[0].p.error))return l[0].showError(),!1;if(g.stringResult||"local"===f.datatype){try{c=La.toJson(k,"","",!1)}catch(m){try{c=JSON.stringify(k)}catch(n){}}"string"===typeof c&&(b[g.sFilter]=c,r([g.sField,g.sValue,g.sOper],function(){b[this]=""}))}else g.multipleSearch?(b[g.sFilter]=k,r([g.sField,g.sValue,g.sOper],function(){b[this]=""})):(b[g.sField]=k.rules[0].field,b[g.sValue]=k.rules[0].data,b[g.sOper]=k.rules[0].op,b[g.sFilter]="");f.search=!0;a.extend(f.postData,b);Da.call(d,g.onSearch,"jqGridFilterSearch",
  f.filters)&&e.trigger("reloadGrid",[a.extend({page:1},g.reloadGridSearchOptions||{})]);g.closeAfterSearch&&y();return!1});a(h+"_reset").bind("click",function(){var b={},c=a(h);f.search=!1;f.resetsearch=!0;!1===g.multipleSearch?b[g.sField]=b[g.sValue]=b[g.sOper]="":b[g.sFilter]="";c[0].resetFilter();A&&a(".ui-template",x).val("default");a.extend(f.postData,b);Da.call(d,g.onReset,"jqGridFilterReset")&&e.trigger("reloadGrid",[a.extend({page:1},g.reloadGridResetOptions||{})]);g.closeAfterReset&&y();return!1});
  c(a(h));var I=Z.call(d,"hover");a(".fm-button:not(."+Z.call(d,"disabled").split(" ").join(".")+")",x).hover(function(){a(this).addClass(I)},function(){a(this).removeClass(I)})}}})},editGridRow:function(b,c){return this.each(function(){function d(){a(k+" > tbody > tr > td .FormElement").each(function(){var b=a(".customelement",this),c=this.name;if(b.length){if(c=b.attr("name"),b=Y[c],void 0!==b&&(b=J[b],b=b.editoptions||{},a.isFunction(b.custom_value))){try{if(z[c]=b.custom_value.call(r,a("#"+G(c),
  k),"get"),void 0===z[c])throw"e1";}catch(d){"e1"===d?u.info_dialog.call(r,ja,"function 'custom_value' "+v.msg.novalue,v.bClose):u.info_dialog.call(r,ja,d.message,v.bClose)}return!0}}else switch(b=a(this)[0].type,b){case "checkbox":z[c]=a(this).is(":checked")?a(this).val():a(this).data("offval");break;case "select-one":z[c]=a("option:selected",this).val();break;case "select-multiple":z[c]=a(this).val();z[c]=z[c]?z[c].join(","):"";a("option:selected",this).each(function(b,c){a(c).text()});break;case "date":z[c]=
  a(this).val();3===String(z[c]).split("-").length&&(b=Y[c],void 0!==b&&(b=J[b],b=b.formatoptions||{},b=b.newformat||x.call(t,"formatter.date.newformat"),z[c]=u.parseDate.call(t[0],"Y-m-d",z[c],b)));break;default:void 0!==b&&0>a.inArray(b,v.skipPostTypes)&&(z[c]=a(this).val())}});return!0}function e(b,c,d){var e=0,f=[],g=!1,h="",k;for(k=1;k<=d;k++)h+="<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>";"_empty"!==b&&(g=D.getInd.call(t,b));a(J).each(function(k){var l=this.name,m,n,p,q,t;
  m=this.editable;var z=!1,A=!1;t="_empty"===b?"addForm":"editForm";a.isFunction(m)&&(m=m.call(r,{rowid:b,iCol:k,iRow:g,cmName:l,cm:this,mode:t}));q=(this.editrules&&!0===this.editrules.edithidden?0:!0===this.hidden||"hidden"===m)?"style='display:none'":"";switch(String(m).toLowerCase()){case "hidden":m=!0;break;case "disabled":z=m=!0;break;case "readonly":A=m=!0}if("cb"!==l&&"subgrid"!==l&&!0===m&&"rn"!==l){if(!1===g)p="";else{m=a(r.rows[g].cells[k]);try{p=a.unformat.call(r,m,{rowId:b,colModel:this},
  k)}catch(C){p=this.edittype&&"textarea"===this.edittype?m.text():m.html()}Ha(p)&&(p="")}m=a.extend({},this.editoptions||{},{id:l,name:l,rowId:b,mode:t});var y=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:!1,rowcontent:""},this.formoptions||{}),x=parseInt(y.rowpos,10)||e+1,F=parseInt(2*(parseInt(y.colpos,10)||1),10);"_empty"===b&&m.defaultValue&&(p=a.isFunction(m.defaultValue)?m.defaultValue.call(r):m.defaultValue);this.edittype||(this.edittype="text");w.autoEncodeOnEdit&&(p=u.oldDecodePostedData(p));
  t=u.createEl.call(r,this.edittype,m,p,!1,a.extend({},u.ajaxOptions,w.ajaxSelectOptions||{}));if(v.checkOnSubmit||v.checkOnUpdate)v._savedData[l]=p;a(t).addClass("FormElement");-1<a.inArray(this.edittype,["text","textarea","checkbox","password","select"])&&a(t).addClass(M.call(r,"dialog.dataField"));n=a(c).find("tr[data-rowpos="+x+"]");if(y.rowabove){var B=a("<tr><td class='contentinfo' colspan='"+2*d+"'>"+y.rowcontent+"</td></tr>");a(c).append(B);B[0].rp=x}0===n.length&&(n=a("<tr "+q+" data-rowpos='"+
  x+"'></tr>").addClass("FormData").attr("id","tr_"+l),a(n).append(h),a(c).append(n),n[0].rp=x);q=a("td:eq("+(F-2)+")",n[0]);n=a("td:eq("+(F-1)+")",n[0]);q.html(void 0===y.label?w.colNames[k]:y.label||"&#160;");n[Ha(n.html())?"html":"append"](y.elmprefix).append(t).append(y.elmsuffix);z?(q.addClass(W),n.addClass(W),a(t).prop("readonly",!0),a(t).prop("disabled",!0)):A&&a(t).prop("readonly",!0);"custom"===this.edittype&&a.isFunction(m.custom_value)&&m.custom_value.call(r,a("#"+G(l),E),"set",p);u.bindEv.call(r,
  t,m);f[e]=k;e++}});0<e&&(k=a("<tr class='FormData' style='display:none'><td class='CaptionTD'>&#160;</td><td colspan='"+(2*d-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+y+"_id' value='"+b+"'/></td></tr>"),k[0].rp=e+999,a(c).append(k),v.checkOnSubmit||v.checkOnUpdate)&&(v._savedData[y+"_id"]=b);return f}function f(b,c){var d,e=0,f,g,h,l;if(v.checkOnSubmit||v.checkOnUpdate)v._savedData={},v._savedData[y+"_id"]=b;var m=w.colModel;if("_empty"===b)a(m).each(function(){d=
  this.name;g=a.extend({},this.editoptions||{});(f=a("#"+G(d),c))&&f.length&&null!==f[0]&&(h="","custom"===this.edittype&&a.isFunction(g.custom_value)?g.custom_value.call(r,f,"set",h):g.defaultValue?(h=a.isFunction(g.defaultValue)?g.defaultValue.call(r):g.defaultValue,"checkbox"===f[0].type?(l=h.toLowerCase(),0>l.search(/(false|f|0|no|n|off|undefined)/i)&&""!==l?(f[0].checked=!0,f[0].defaultChecked=!0,f[0].value=h):(f[0].checked=!1,f[0].defaultChecked=!1)):f.val(h)):"checkbox"===f[0].type?(f[0].checked=
  !1,f[0].defaultChecked=!1,h=a(f).data("offval")):f[0].type&&"select"===f[0].type.substr(0,6)?f[0].selectedIndex=0:f.val(h),!0===v.checkOnSubmit||v.checkOnUpdate)&&(v._savedData[d]=h)}),a("#id_g",c).val(b);else{var n=D.getInd.call(t,b,!0);n&&(a(n.cells).filter("td[role=gridcell]").each(function(f){var g;d=m[f].name;if("cb"!==d&&"subgrid"!==d&&"rn"!==d&&!0===m[f].editable){try{g=a.unformat.call(r,a(this),{rowId:b,colModel:m[f]},f)}catch(h){g="textarea"===m[f].edittype?a(this).text():a(this).html()}w.autoEncodeOnEdit&&
  (g=u.oldDecodePostedData(g));if(!0===v.checkOnSubmit||v.checkOnUpdate)v._savedData[d]=g;d="#"+G(d);switch(m[f].edittype){case "password":case "text":case "button":case "image":case "textarea":Ha(g)&&(g="");a(d,c).val(g);break;case "select":var k=g.split(","),k=a.map(k,function(b){return a.trim(b)});a(d+" option",c).each(function(){var b=a(this),c=a.trim(b.val()),b=a.trim(b.text());m[f].editoptions.multiple||a.trim(g)!==b&&k[0]!==b&&k[0]!==c?m[f].editoptions.multiple?-1<a.inArray(b,k)||-1<a.inArray(c,
  k)?this.selected=!0:this.selected=!1:this.selected=!1:this.selected=!0});break;case "checkbox":g=String(g);m[f].editoptions&&m[f].editoptions.value?g=m[f].editoptions.value.split(":")[0]===g:(g=g.toLowerCase(),g=0>g.search(/(false|f|0|no|n|off|undefined)/i)&&""!==g);a(d,c).prop({checked:g,defaultChecked:g});break;case "custom":try{if(m[f].editoptions&&a.isFunction(m[f].editoptions.custom_value))m[f].editoptions.custom_value.call(r,a(d,c),"set",g);else throw"e1";}catch(h){"e1"===h?u.info_dialog.call(r,
  ja,"function 'custom_value' "+v.msg.nodefined,v.bClose):u.info_dialog.call(r,ja,h.message,v.bClose)}}e++}}),0<e&&a("#id_g",k).val(b))}}function g(){var b=v.url||w.editurl;a.each(J,function(c,d){var e=d.name,f=z[e];"date"!==d.formatter||null!=d.formatoptions&&!0===d.formatoptions.sendFormatted||(z[e]=a.unformat.date.call(r,f,d));"clientArray"!==b&&d.editoptions&&!0===d.editoptions.NullIfEmpty&&z.hasOwnProperty(e)&&""===f&&(z[e]="null")})}function h(){var c=[!0,"",""],d={},e=w.prmNames,h,l,m,n,p,q,
  A=D.getInd.call(t,b),x=!1===A?null:r.rows[A];(q=t.triggerHandler("jqGridAddEditBeforeCheckValues",[a(E),L]))&&"object"===typeof q&&(z=q);A=!1===A?-1:A;a.isFunction(v.beforeCheckValues)&&(q=v.beforeCheckValues.call(r,z,a(E),L))&&"object"===typeof q&&(z=q);for(m in z)if(z.hasOwnProperty(m)&&(q=w.iColByName[m],c=u.checkValues.call(r,z[m],m,void 0,void 0,{oldValue:"_empty"===b?null:D.getCell.call(t,b,q),newValue:z[m],cmName:m,rowid:b,cm:J[q],iCol:q,iRow:A,tr:x,td:null==x?null:x.cells[q],mode:"_empty"===
  b?"addForm":"editForm"}),!1===c[0]))break;g();c[0]&&(d=t.triggerHandler("jqGridAddEditClickSubmit",[v,z,L]),void 0===d&&a.isFunction(v.onclickSubmit)&&(d=v.onclickSubmit.call(r,v,z,L)||{}),c=t.triggerHandler("jqGridAddEditBeforeSubmit",[z,a(E),L]),null==c&&(c=[!0,"",""]),c[0]&&a.isFunction(v.beforeSubmit)&&(c=v.beforeSubmit.call(r,z,a(E),L),null==c&&(c=[!0,"",""])));if(c[0]&&!v.processing){v.processing=!0;a("#sData",C).addClass(ca);m=v.url||w.editurl;l=e.oper;h="clientArray"===m&&!1!==w.keyName?w.keyName:
  e.id;z[l]="_empty"===a.trim(z[y+"_id"])?e.addoper:e.editoper;z[l]!==e.addoper?z[h]=z[y+"_id"]:void 0===z[h]&&(z[h]=z[y+"_id"]);delete z[y+"_id"];z=a.extend(z,v.editData,d);if(!0===w.treeGrid)for(p in z[l]===e.addoper&&(n=w.selrow,z["adjacency"===w.treeGridModel?w.treeReader.parent_id_field:"parent_id"]=n),w.treeReader)w.treeReader.hasOwnProperty(p)&&(d=w.treeReader[p],!z.hasOwnProperty(d)||z[l]===e.addoper&&"parent_id_field"===p||delete z[d]);z[h]=u.stripPref(w.idPrefix,z[h]);w.autoEncodeOnEdit&&
  a.each(z,function(b,c){a.isFunction(c)||(z[b]=u.oldEncodePostedData(c))});p=a.extend({url:a.isFunction(m)?m.call(r,z[h],L,z,v):m,type:a.isFunction(v.mtype)?v.mtype.call(r,L,v,z[h],z):v.mtype,data:u.serializeFeedback.call(r,a.isFunction(v.serializeEditData)?v.serializeEditData:w.serializeEditData,"jqGridAddEditSerializeEditData",z),complete:function(b,d){a("#sData",C).removeClass(ca);z[h]=w.idPrefix+a("#id_g",k).val();300<=b.status&&304!==b.status||0===b.status&&4===b.readyState?(c[0]=!1,c[1]=t.triggerHandler("jqGridAddEditErrorTextFormat",
  [b,L]),a.isFunction(v.errorTextFormat)?c[1]=v.errorTextFormat.call(r,b,L):c[1]=d+" Status: '"+b.statusText+"'. Error code: "+b.status):(c=t.triggerHandler("jqGridAddEditAfterSubmit",[b,z,L]),null==c&&(c=[!0,"",""]),c[0]&&a.isFunction(v.afterSubmit)&&(c=v.afterSubmit.call(r,b,z,L),null==c&&(c=[!0,"",""])));if(!1===c[0])a("#FormError>td",k).html(c[1]),a("#FormError",k).show();else{w.autoEncodeOnEdit&&a.each(z,function(a,b){z[a]=u.oldDecodePostedData(b)});var g=[a.extend({},v.reloadGridOptions||{})];
  z[l]===e.addoper?(c[2]||(c[2]=u.randId()),null==z[h]||"_empty"===z[h]||z[l]===e.addoper?z[h]=c[2]:c[2]=z[h],v.reloadAfterSubmit?t.trigger("reloadGrid",g):!0===w.treeGrid?D.addChildNode.call(t,c[2],n,z):D.addRowData.call(t,c[2],z,v.addedrow),v.closeAfterAdd?(!0!==w.treeGrid&&B.call(t,c[2]),U()):v.clearAfterAdd&&f("_empty",E)):(v.reloadAfterSubmit?(t.trigger("reloadGrid",g),v.closeAfterEdit||setTimeout(function(){B.call(t,z[h])},1E3)):!0===w.treeGrid?D.setTreeRow.call(t,z[h],z):D.setRowData.call(t,
  z[h],z),v.closeAfterEdit&&U());if(a.isFunction(v.afterComplete)){var m=b;setTimeout(function(){t.triggerHandler("jqGridAddEditAfterComplete",[m,z,a(E),L]);v.afterComplete.call(r,m,z,a(E),L);m=null},50)}if(v.checkOnSubmit||v.checkOnUpdate)if(a(E).data("disabled",!1),"_empty"!==v._savedData[y+"_id"])for(var p in v._savedData)v._savedData.hasOwnProperty(p)&&z[p]&&(v._savedData[p]=z[p])}v.processing=!1;try{a(":input:visible",E)[0].focus()}catch(q){}}},u.ajaxOptions,v.ajaxEditOptions);p.url||v.useDataProxy||
  (a.isFunction(w.dataProxy)?v.useDataProxy=!0:(c[0]=!1,c[1]+=" "+u.errors.nourl));c[0]&&(v.useDataProxy?(d=w.dataProxy.call(r,p,"set_"+y),void 0===d&&(d=[!0,""]),!1===d[0]?(c[0]=!1,c[1]=d[1]||"Error deleting the selected row!"):(p.data.oper===e.addoper&&v.closeAfterAdd&&U(),p.data.oper===e.editoper&&v.closeAfterEdit&&U())):"clientArray"===p.url?(v.reloadAfterSubmit=!1,z=p.data,p.complete({status:200,statusText:""},"")):a.ajax(p))}!1===c[0]&&(a("#FormError>td",k).html(c[1]),a("#FormError",k).show())}
  function m(a,b){var c=!1,d;for(d in a)if(a.hasOwnProperty(d)&&String(a[d])!==String(b[d])){c=!0;break}return c}function l(){var b=!0;a("#FormError",k).hide();v.checkOnUpdate&&(z={},d(),N=m(z,v._savedData))&&(a(E).data("disabled",!0),a(".confirm",I).show(),b=!1);return b}function n(){var c=u.detectRowEditing.call(r,b);if(null!=c)if("inlineEditing"===c.mode)D.restoreRow.call(t,b);else{var c=c.savedRow,d=r.rows[c.id];D.restoreCell.call(t,c.id,c.ic);a(d.cells[c.ic]).removeClass("edit-cell "+R);a(d).addClass(R).attr({"aria-selected":"true",
  tabindex:"0"})}}function p(b,c){var d=c[1].length-1;0===b?a("#pData",C).addClass(W):void 0!==c[1][b-1]&&da(a("#"+G(c[1][b-1])),W)?a("#pData",C).addClass(W):a("#pData",C).removeClass(W);b===d?a("#nData",C).addClass(W):void 0!==c[1][b+1]&&da(a("#"+G(c[1][b+1])),W)?a("#nData",C).addClass(W):a("#nData",C).removeClass(W)}function q(){var b=D.getDataIDs.call(t),c=a("#id_g",k).val();return[a.inArray(c,b),b]}var r=this,t=a(r),w=r.p;if(r.grid&&null!=w&&b){var y=w.id,x=D.getGridRes,B=D.setSelection,v=a.extend(!0,
  {top:0,left:0,width:300,datawidth:"auto",height:"auto",dataheight:"auto",drag:!0,resize:!0,url:null,mtype:"POST",clearAfterAdd:!0,closeAfterEdit:!1,reloadAfterSubmit:!0,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},closeOnEscape:!1,addedrow:"first",topinfo:"",bottominfo:"",savekey:[!1,13],navkeys:[!1,38,40],checkOnSubmit:!1,checkOnUpdate:!1,
  _savedData:{},processing:!1,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:!0,overlayClass:M.call(this,"overlay"),removemodal:!0,skipPostTypes:["image","file"]},x.call(t,"edit"),u.edit,w.formEditing||{},c||{}),E="FrmGrid_"+y,A=E,F="TblGrid_"+y,k="#"+G(F),C=k+"_2",K={themodal:"editmod"+y,modalhead:"edithd"+y,modalcontent:"editcnt"+y,resizeAlso:E},I="#"+G(K.themodal),H=w.gBox,J=w.colModel,Y=w.iColByName,aa=1,O=0,z,N,L,Q=v.commonIconClass,U=function(){u.hideModal(I,{gb:H,jqm:v.jqModal,
  onClose:v.onClose,removemodal:v.removemodal})},ja=x.call(t,"errors.errcap"),S=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("AddEdit");b.unshift(v);return Sa.apply(r,b)},V=Z.call(r,"hover"),W=Z.call(r,"disabled"),R=Z.call(r,"select"),ca=Z.call(r,"active"),wa=Z.call(r,"error");a(I).remove();E="#"+G(E);"new"===b?(b="_empty",L="add",v.caption=v.addCaption):(v.caption=v.editCaption,L="edit");var Ka=!0;!v.checkOnUpdate||!0!==v.jqModal&&void 0!==v.jqModal||v.modal||(Ka=!1);var Pa=isNaN(v.dataheight)?
  v.dataheight:v.dataheight+"px",Fa=isNaN(v.datawidth)?v.datawidth:v.datawidth+"px",A=a("<form name='FormPost' id='"+A+"' class='FormGrid' onSubmit='return false;' style='width:"+Fa+";overflow:auto;position:relative;height:"+Pa+";'></form>").data("disabled",!1),T=a("<table id='"+F+"' class='EditTable'"+(u.msie&&8>u.msiever()?" cellspacing='0'":"")+"><tbody></tbody></table>");a(J).each(function(){var a=this.formoptions;aa=Math.max(aa,a?a.colpos||0:0);O=Math.max(O,a?a.rowpos||0:0)});a(A).append(T);wa=
  a("<tr id='FormError' style='display:none'><td class='"+wa+"' colspan='"+2*aa+"'>&#160;</td></tr>");wa[0].rp=0;a(T).append(wa);wa=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+2*aa+"'>"+(v.topinfo||"&#160;")+"</td></tr>");wa[0].rp=0;a(T).append(wa);if(S("beforeInitData",A,L)){n();Pa=(wa="rtl"===w.direction?!0:!1)?"nData":"pData";Fa=wa?"pData":"nData";e(b,T,aa);var Pa=ga.call(r,Pa,"",va(Q,v.prevIcon),"","left"),Fa=ga.call(r,Fa,"",va(Q,v.nextIcon),"","right"),Ga=ga.call(r,
  "sData",v.bSubmit),db=ga.call(r,"cData",v.bCancel),F="<div class='"+M.call(r,"dialog.footer")+"'><table"+(u.msie&&8>u.msiever()?" cellspacing='0'":"")+" class='EditTable' id='"+F+"_2'><tbody><tr><td colspan='2'><hr class='"+M.call(r,"dialog.hr")+"' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton navButton-"+w.direction+"'>"+(wa?Fa+Pa:Pa+Fa)+"</td><td class='EditButton EditButton-"+w.direction+"'>"+Ga+"&#160;"+db+"</td></tr>",F=F+("<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+
  (v.bottominfo||"&#160;")+"</td></tr>"),F=F+"</tbody></table></div>";if(0<O){var bb=[];a.each(a(T)[0].rows,function(a,b){bb[a]=b});bb.sort(function(a,b){return a.rp>b.rp?1:a.rp<b.rp?-1:0});a.each(bb,function(b,c){a("tbody",T).append(c)})}v.gbox=H;var jb=!1;!0===v.closeOnEscape&&(v.closeOnEscape=!1,jb=!0);F=a("<div></div>").append(a("<div class='"+M.call(r,"dialog.body")+"'></div>").append(A)).append(F);u.createModal.call(r,K,F,v,w.gView,a(H)[0]);v.topinfo&&a(".tinfo",k).show();v.bottominfo&&a(".binfo",
  C).show();F=F=null;a(I).keydown(function(b){var c=(b.target.tagName||"").toUpperCase(),d,e;if(!0===a(E).data("disabled"))return!1;if(13===b.which&&"TEXTAREA"!==c){d=a(C).find(":focus");e=d.attr("id");if(0<d.length&&0<=a.inArray(e,["pData","nData","cData"]))return d.trigger("click"),!1;if(!0===v.savekey[0]&&13===v.savekey[1])return a("#sData",C).trigger("click"),!1}if(!0===v.savekey[0]&&b.which===v.savekey[1]&&"TEXTAREA"!==c)return a("#sData",C).trigger("click"),!1;if(27===b.which){if(!l())return!1;
  jb&&U();return!1}if(!0===v.navkeys[0]){if("_empty"===a("#id_g",k).val())return!0;if(b.which===v.navkeys[1])return a("#pData",C).trigger("click"),!1;if(b.which===v.navkeys[2])return a("#nData",C).trigger("click"),!1}});v.checkOnUpdate&&(a("a.ui-jqdialog-titlebar-close span",I).removeClass("jqmClose"),a("a.ui-jqdialog-titlebar-close",I).unbind("click").click(function(){if(!l())return!1;U();return!1}));Ta(a("#sData",C),v.saveicon,Q);Ta(a("#cData",C),v.closeicon,Q);if(v.checkOnSubmit||v.checkOnUpdate)Ga=
  ga.call(r,"sNew",v.bYes),Fa=ga.call(r,"nNew",v.bNo),db=ga.call(r,"cNew",v.bExit),K=v.zIndex||999,K++,a("<div class='"+v.overlayClass+" jqgrid-overlay confirm' style='z-index:"+K+";display:none;'>&#160;</div><div class='"+M.call(r,"dialog.content","confirm ui-jqconfirm")+"' style='z-index:"+(K+1)+"'>"+v.saveData+"<br/><br/>"+Ga+Fa+db+"</div>").insertAfter(E),a("#sNew",I).click(function(){h();a(E).data("disabled",!1);a(".confirm",I).hide();return!1}),a("#nNew",I).click(function(){a(".confirm",I).hide();
  a(E).data("disabled",!1);setTimeout(function(){a(":input:visible",E)[0].focus()},0);return!1}),a("#cNew",I).click(function(){a(".confirm",I).hide();a(E).data("disabled",!1);U();return!1});S("onInitializeForm",a(E),L);"_empty"!==b&&v.viewPagerButtons?a("#pData,#nData",C).show():a("#pData,#nData",C).hide();S("beforeShowForm",a(E),L);a(I).data("onClose",v.onClose);u.viewModal.call(r,I,{gbox:H,jqm:v.jqModal,overlay:v.overlay,modal:v.modal,overlayClass:v.overlayClass,toTop:v.toTop,onHide:function(a){a.w.remove();
  a.o&&a.o.remove()}});Ka||a("."+G(v.overlayClass)).click(function(){if(!l())return!1;U();return!1});a(".fm-button",I).hover(function(){a(this).addClass(V)},function(){a(this).removeClass(V)});a("#sData",C).click(function(){z={};a("#FormError",k).hide();d();"_empty"===z[y+"_id"]?h():!0===v.checkOnSubmit?(N=m(z,v._savedData))?(a(E).data("disabled",!0),a(".confirm",I).show()):h():h();return!1});a("#cData",C).click(function(){if(!l())return!1;U();return!1});a("#nData",C).click(function(){if(!l())return!1;
  a("#FormError",k).hide();var b=q();b[0]=parseInt(b[0],10);if(-1!==b[0]&&b[1][b[0]+1]){if(!S("onclickPgButtons","next",a(E),b[1][b[0]]))return!1;f(b[1][b[0]+1],E);B.call(t,b[1][b[0]+1]);S("afterclickPgButtons","next",a(E),b[1][b[0]+1]);p(b[0]+1,b)}return!1});a("#pData",C).click(function(){if(!l())return!1;a("#FormError",k).hide();var b=q();if(-1!==b[0]&&b[1][b[0]-1]){if(!S("onclickPgButtons","prev",a(E),b[1][b[0]])||da(a("#"+G(b[1][b[0]-1])),W))return!1;f(b[1][b[0]-1],E);B.call(t,b[1][b[0]-1]);S("afterclickPgButtons",
  "prev",a(E),b[1][b[0]-1]);p(b[0]-1,b)}return!1});S("afterShowForm",a(E),L);Ka=q();p(Ka[0],Ka)}}})},viewGridRow:function(b,c){return this.each(function(){function d(){!0!==q.closeOnEscape&&!0!==q.navkeys[0]||setTimeout(function(){a("#cData").focus()},0)}function e(b,c,d){var e,f,g,h=0,k,p,r=[],t=D.getInd.call(l,b),w;w=M.call(m,"dialog.viewData","DataTD form-view-data");var v=M.call(m,"dialog.viewLabel","CaptionTD form-view-label"),z="<td class='"+v+"' width='"+q.labelswidth+"'>&#160;</td><td class='"+
  w+" ui-helper-reset'>&#160;</td>",C="",v="<td class='"+v+"'></td><td class='"+w+"'></td>",y=["integer","number","currency"],x=0,E=0,F,B,K;for(w=1;w<=d;w++)C+=1===w?z:v;a(A).each(function(){(f=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)||"right"!==this.align||(this.formatter&&-1!==a.inArray(this.formatter,y)?x=Math.max(x,parseInt(this.width,10)):E=Math.max(E,parseInt(this.width,10)))});F=0!==x?x:0!==E?E:0;a(A).each(function(b){e=this.name;B=!1;p=(f=this.editrules&&!0===
  this.editrules.edithidden?!1:!0===this.hidden?!0:!1)?"style='display:none'":"";K="boolean"!==typeof this.viewable?!0:this.viewable;if("cb"!==e&&"subgrid"!==e&&"rn"!==e&&K){k=!1===t?"":u.getDataFieldOfCell.call(m,m.rows[t],b).html();B="right"===this.align&&0!==F?!0:!1;var l=a.extend({},{rowabove:!1,rowcontent:""},this.formoptions||{}),q=parseInt(l.rowpos,10)||h+1,w=parseInt(2*(parseInt(l.colpos,10)||1),10);if(l.rowabove){var v=a("<tr><td class='contentinfo' colspan='"+2*d+"'>"+l.rowcontent+"</td></tr>");
  a(c).append(v);v[0].rp=q}g=a(c).find("tr[data-rowpos="+q+"]");0===g.length&&(g=a("<tr "+p+" data-rowpos='"+q+"'></tr>").addClass("FormData").attr("id","trv_"+e),a(g).append(C),a(c).append(g),g[0].rp=q);l=void 0===l.label?n.colNames[b]:l.label;q=a("td:eq("+(w-1)+")",g[0]);a("td:eq("+(w-2)+")",g[0]).html("<b>"+(l||"&nbsp;")+"</b>");q[Ha(q.html())?"html":"append"]("<span>"+(k||"&nbsp;")+"</span>").attr("id","v_"+e);B&&a("td:eq("+(w-1)+") span",g[0]).css({"text-align":"right",width:F+"px"});r[h]=b;h++}});
  0<h&&(b=a("<tr class='FormData' style='display:none'><td class='CaptionTD'>&#160;</td><td colspan='"+(2*d-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+b+"'/></td></tr>"),b[0].rp=h+99,a(c).append(b));return r}function f(b){var c,d,e=0,f=D.getInd.call(l,b,!0),g;f&&(a("td",f).each(function(b){g=A[b];c=g.name;d=g.editrules&&!0===g.editrules.edithidden?!1:!0===g.hidden?!0:!1;"cb"!==c&&"subgrid"!==c&&"rn"!==c&&(c=G("v_"+c),a("#"+c+" span",t).html(u.getDataFieldOfCell.call(m,
  f,b).html()),d&&a("#"+c,t).parents("tr:first").hide(),e++)}),0<e&&a("#id_g",t).val(b))}function g(b,c){var d=c[1].length-1;0===b?a("#pData",w).addClass(H):void 0!==c[1][b-1]&&da(a("#"+G(c[1][b-1])),H)?a("#pData",w).addClass(H):a("#pData",w).removeClass(H);b===d?a("#nData",w).addClass(H):void 0!==c[1][b+1]&&da(a("#"+G(c[1][b+1])),H)?a("#nData",w).addClass(H):a("#nData",w).removeClass(H)}function h(){var b=D.getDataIDs.call(l),c=a("#id_g",t).val();return[a.inArray(c,b),b]}var m=this,l=a(m),n=m.p;if(m.grid&&
  null!=n&&b){var p=n.id,q=a.extend(!0,{top:0,left:0,width:0,datawidth:"auto",height:"auto",dataheight:"auto",drag:!0,resize:!0,closeOnEscape:!1,labelswidth:"30%",navkeys:[!1,38,40],onClose:null,beforeShowForm:null,beforeInitData:null,viewPagerButtons:!0,removemodal:!0},D.getGridRes.call(l,"view"),u.view||{},n.formViewing||{},c||{}),r="#ViewGrid_"+G(p),t="#ViewTbl_"+G(p),w=t+"_2",y="ViewGrid_"+p,x="ViewTbl_"+p,B=q.commonIconClass,p={themodal:"viewmod"+p,modalhead:"viewhd"+p,modalcontent:"viewcnt"+p,
  resizeAlso:y},v="#"+G(p.themodal),E=n.gBox,A=n.colModel,F=1,k=0,C=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("View");b.unshift(q);return Sa.apply(m,b)},K=function(){u.hideModal(v,{gb:E,jqm:q.jqModal,onClose:q.onClose,removemodal:q.removemodal})},I=Z.call(m,"hover"),H=Z.call(m,"disabled"),J=isNaN(q.dataheight)?q.dataheight:q.dataheight+"px",Y=isNaN(q.datawidth)?q.datawidth:q.datawidth+"px",y=a("<div class='"+M.call(m,"dialog.body")+"'><form name='FormPost' id='"+y+"' class='FormGrid' style='width:"+
  Y+";overflow:auto;position:relative;height:"+J+";'></form></div>"),J=y.children("form.FormGrid"),aa=a("<table id='"+x+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");a(v).remove();a(A).each(function(){var a=this.formoptions;F=Math.max(F,a?a.colpos||0:0);k=Math.max(k,a?a.rowpos||0:0)});J.append(aa);if(C("beforeInitData",J)){e(b,aa,F);var O=(J="rtl"===n.direction?!0:!1)?"pData":"nData",Y=ga.call(m,J?"nData":"pData","",va(B,q.prevIcon),
  "","left"),O=ga.call(m,O,"",va(B,q.nextIcon),"","right"),z=ga.call(m,"cData",q.bClose);if(0<k){var N=[];a.each(a(aa)[0].rows,function(a,b){N[a]=b});N.sort(function(a,b){return a.rp>b.rp?1:a.rp<b.rp?-1:0});a.each(N,function(b,c){a("tbody",aa).append(c)})}q.gbox=E;x=a("<div></div>").append(y).append("<div class='"+M.call(m,"dialog.footer")+"'><table border='0' class='EditTable' id='"+x+"_2'><tbody><tr id='Act_Buttons'><td class='navButton navButton-"+n.direction+"' width='"+(q.labelswidth||"auto")+
  "'>"+(J?O+Y:Y+O)+"</td><td class='EditButton EditButton-"+n.direction+"'>"+z+"</td></tr></tbody></table></div>");u.createModal.call(m,p,x,q,n.gView,a(n.gView)[0]);q.viewPagerButtons||a("#pData, #nData",w).hide();x=null;a(v).keydown(function(b){var c,d;if(!0===a(r).data("disabled"))return!1;if(13===b.which&&(c=a(w).find(":focus"),d=c.attr("id"),0<c.length&&0<=a.inArray(d,["pData","nData","cData"])))return c.trigger("click"),!1;if(27===b.which)return q.closeOnEscape&&K(),!1;if(!0===q.navkeys[0]){if(b.which===
  q.navkeys[1])return a("#pData",w).trigger("click"),!1;if(b.which===q.navkeys[2])return a("#nData",w).trigger("click"),!1}});Ta(a("#cData",w),q.closeicon,B);C("beforeShowForm",a(r));u.viewModal.call(m,v,{gbox:E,jqm:q.jqModal,overlay:q.overlay,toTop:q.toTop,modal:q.modal,onHide:function(a){a.w.remove();a.o&&a.o.remove()}});a(".fm-button:not(."+H.split(" ").join(".")+")",w).hover(function(){a(this).addClass(I)},function(){a(this).removeClass(I)});d();a("#cData",w).click(function(){K();return!1});a("#nData",
  w).click(function(){a("#FormError",t).hide();var b=h();b[0]=parseInt(b[0],10);if(-1!==b[0]&&b[1][b[0]+1]){if(!C("onclickPgButtons","next",a(r),b[1][b[0]]))return!1;f(b[1][b[0]+1]);D.setSelection.call(l,b[1][b[0]+1]);C("afterclickPgButtons","next",a(r),b[1][b[0]+1]);g(b[0]+1,b)}d();return!1});a("#pData",w).click(function(){a("#FormError",t).hide();var b=h();if(-1!==b[0]&&b[1][b[0]-1]){if(!C("onclickPgButtons","prev",a(r),b[1][b[0]]))return!1;f(b[1][b[0]-1]);D.setSelection.call(l,b[1][b[0]-1]);C("afterclickPgButtons",
  "prev",a(r),b[1][b[0]-1]);g(b[0]-1,b)}d();return!1});B=h();g(B[0],B)}}})},delGridRow:function(b,c){return this.each(function(){var d=this,e=d.p,f=a(d);if(d.grid&&null!=e&&b){var g=e.id,h=a.extend(!0,{top:0,left:0,width:240,removemodal:!0,height:"auto",dataheight:"auto",datawidth:"auto",drag:!0,resize:!0,url:"",mtype:"POST",reloadAfterSubmit:!0,beforeShowForm:null,beforeInitData:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,closeOnEscape:!1,delData:{},onClose:null,ajaxDelOptions:{},
  processing:!1,serializeDelData:null,useDataProxy:!1},D.getGridRes.call(f,"del"),u.del||{},e.formDeleting||{},c||{}),m="DelTbl_"+g,l="#DelTbl_"+G(g),n,p,q,r,t={themodal:"delmod"+g,modalhead:"delhd"+g,modalcontent:"delcnt"+g,resizeAlso:m},w="#"+G(t.themodal),y=e.gBox,x=h.commonIconClass,B=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("Delete");b.unshift(h);return Sa.apply(d,b)},v=Z.call(d,"hover"),E=Z.call(d,"active"),A=Z.call(d,"error");a.isArray(b)||(b=[String(b)]);if(void 0!==a(w)[0]){if(!B("beforeInitData",
  a(l)))return;a("#DelData>td",l).text(b.join()).data("rowids",b);a("#DelError",l).hide();!0===h.processing&&(h.processing=!1,a("#dData",l).removeClass(E));B("beforeShowForm",a(l));u.viewModal.call(d,w,{gbox:y,jqm:h.jqModal,jqM:!1,overlay:h.overlay,toTop:h.toTop,modal:h.modal})}else{var F=isNaN(h.dataheight)?h.dataheight:h.dataheight+"px",k=isNaN(h.datawidth)?h.datawidth:h.datawidth+"px",F="<div class='"+M.call(d,"dialog.body")+"'><div id='"+m+"' class='formdata' style='width:"+k+";overflow:auto;position:relative;height:"+
  F+";'>",F=F+"<table class='DelTable'><tbody>"+("<tr id='DelError' style='display:none'><td class='"+A+"'></td></tr>"),F=F+("<tr id='DelData' style='display:none'><td >"+b.join()+"</td></tr>"),F=F+("<tr><td class='delmsg' style='white-space:pre;'>"+h.msg+"</td></tr>"),F=F+"</tbody></table></div></div>",A=ga.call(d,"dData",h.bSubmit),k=ga.call(d,"eData",h.bCancel),F=F+("<div class='"+M.call(d,"dialog.footer")+"'><table"+(u.msie&&8>u.msiever()?" cellspacing='0'":"")+" class='EditTable' id='"+m+"_2'><tbody><tr><td><hr class='"+
  M.call(d,"dialog.hr")+"' style='margin:1px'/></td></tr><tr><td class='DelButton EditButton EditButton-"+e.direction+"'>"+A+"&#160;"+k+"</td></tr></tbody></table></div>");h.gbox=y;u.createModal.call(d,t,F,h,e.gView,a(e.gView)[0]);a("#DelData>td",l).data("rowids",b);if(!B("beforeInitData",a(F)))return;a(".fm-button",l+"_2").hover(function(){a(this).addClass(v)},function(){a(this).removeClass(v)});Ta(a("#dData",l+"_2"),h.delicon,x);Ta(a("#eData",l+"_2"),h.cancelicon,x);a("#dData",l+"_2").click(function(){var b=
  [!0,""],c,k=a("#DelData>td",l),m=k.text(),t=k.data("rowids"),k={};a.isFunction(h.onclickSubmit)&&(k=h.onclickSubmit.call(d,h,m)||{});a.isFunction(h.beforeSubmit)&&(b=h.beforeSubmit.call(d,m)||b);if(b[0]&&!h.processing){h.processing=!0;q=e.prmNames;n=a.extend({},h.delData,k);r=q.oper;n[r]=q.deloper;p=q.id;m=t.slice();if(!m.length)return!1;for(c in m)m.hasOwnProperty(c)&&(m[c]=u.stripPref(e.idPrefix,m[c]));n[p]=m.join();a(this).addClass(E);c=h.url||e.editurl;c=a.extend({url:a.isFunction(c)?c.call(d,
  n[p],n,h):c,type:h.mtype,data:a.isFunction(h.serializeDelData)?h.serializeDelData.call(d,n):n,complete:function(c,g){var k;a("#dData",l+"_2").removeClass(E);300<=c.status&&304!==c.status||0===c.status&&4===c.readyState?(b[0]=!1,a.isFunction(h.errorTextFormat)?b[1]=h.errorTextFormat.call(d,c):b[1]=g+" Status: '"+c.statusText+"'. Error code: "+c.status):a.isFunction(h.afterSubmit)&&(b=h.afterSubmit.call(d,c,n)||[!0]);if(!1===b[0])a("#DelError>td",l).html(b[1]),a("#DelError",l).show();else{if(h.reloadAfterSubmit&&
  "local"!==e.datatype)f.trigger("reloadGrid",[a.extend({},h.reloadGridOptions||{})]);else if(!0===e.treeGrid)try{D.delTreeNode.call(f,t[0])}catch(p){}else for(t=t.slice(),k=0;k<t.length;k++)D.delRowData.call(f,t[k]);setTimeout(function(){B("afterComplete",c,m,a(l))},50)}h.processing=!1;b[0]&&u.hideModal(w,{gb:y,jqm:h.jqModal,onClose:h.onClose,removemodal:h.removemodal})}},u.ajaxOptions,h.ajaxDelOptions);c.url||h.useDataProxy||(a.isFunction(e.dataProxy)?h.useDataProxy=!0:(b[0]=!1,b[1]+=" "+u.errors.nourl));
  b[0]&&(h.useDataProxy?(c=e.dataProxy.call(d,c,"del_"+g),void 0===c&&(c=[!0,""]),!1===c[0]?(b[0]=!1,b[1]=c[1]||"Error deleting the selected row!"):u.hideModal(w,{gb:y,jqm:h.jqModal,onClose:h.onClose,removemodal:h.removemodal})):"clientArray"===c.url?(n=c.data,c.complete({status:200,statusText:""},"")):a.ajax(c))}!1===b[0]&&(a("#DelError>td",l).html(b[1]),a("#DelError",l).show());return!1});a("#eData",l+"_2").click(function(){u.hideModal(w,{gb:y,jqm:h.jqModal,onClose:h.onClose,removemodal:h.removemodal});
  return!1});B("beforeShowForm",a(l));u.viewModal.call(d,w,{gbox:y,jqm:h.jqModal,overlay:h.overlay,toTop:h.toTop,modal:h.modal})}B("afterShowForm",a(l));!0===h.closeOnEscape&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+G(t.modalhead)).attr("tabindex","-1").focus()},0)}})},navGrid:function(b,c,d,e,f,g,h){"object"===typeof b&&(h=g,g=f,f=e,e=d,d=c,c=b,b=void 0);e=e||{};d=d||{};h=h||{};f=f||{};g=g||{};return this.each(function(){var m=this,l=m.p,n=a(m);if(m.grid&&null!=l&&!(m.nav&&0<a(b).find(".navtable").length)){var p=
  l.id,q=a.extend({edit:!0,add:!0,del:!0,search:!0,refresh:!0,refreshstate:"firstpage",view:!1,closeOnEscape:!0,beforeRefresh:null,afterRefresh:null,cloneToTop:!1,hideEmptyPagerParts:!0,alertwidth:200,alertheight:"auto",alerttop:null,removemodal:!0,alertleft:null,alertzIndex:null,iconsOverText:!1},D.getGridRes.call(n,"nav"),u.nav||{},l.navOptions||{},c||{});q.position=q.position||("rtl"===l.direction?"right":"left");var r,t=l.idSel,w=l.gBox,y=q.commonIconClass,x={themodal:"alertmod_"+p,modalhead:"alerthd_"+
  p,modalcontent:"alertcnt_"+p},B=function(){return function(){var b=document.documentElement,c=window,d=1024,e=768,f=n.closest(".ui-jqgrid").offset();void 0===a("#"+G(x.themodal))[0]&&(q.alerttop||q.alertleft||(void 0!==c.innerWidth?(d=c.innerWidth,e=c.innerHeight):null!=b&&void 0!==b.clientWidth&&0!==b.clientWidth&&(d=b.clientWidth,e=b.clientHeight),d=d/2-parseInt(q.alertwidth,10)/2-f.left,e=e/2-25-f.top),u.createModal.call(m,x,"<div class='"+M.call(m,"dialog.body")+"'><div>"+q.alerttext+"</div></div>",
  {gbox:w,jqModal:q.jqModal,drag:!0,resize:!0,caption:q.alertcap,top:null!=q.alerttop?q.alerttop:e,left:null!=q.alertleft?q.alertleft:d,width:q.alertwidth,height:q.alertheight,closeOnEscape:q.closeOnEscape,zIndex:q.alertzIndex,removemodal:q.removemodal},l.gView,a(w)[0],!1));u.viewModal.call(m,"#"+G(x.themodal),{gbox:w,toTop:q.alertToTop,jqm:q.jqModal});var g=a("#"+G(x.modalhead)).find(".ui-jqdialog-titlebar-close");g.attr({tabindex:"0",href:"#",role:"button"});setTimeout(function(){g.focus()},50)}}(),
  v,E=function(b){if(13===b.which&&(b=a(this).find(".ui-pg-button").filter(":focus"),0<b.length)){var c=b[0].id,c=c.substr(0,0<a(this).closest(".ui-jqgrid-toppager").length?c.length-p.length-5:c.length-p.length-1)+"mod"+l.id,d=a(".ui-jqdialog").filter(":visible").map(function(){return this.id});if(0>a.inArray(c,d))return b.trigger("click"),!1}},A=Z.call(m,"hover"),F=Z.call(m,"disabled"),k=M.call(m,"navButton","ui-pg-button");if(m.grid){m.modalAlert=B;void 0===b&&(l.pager?(b=l.pager,l.toppager&&(q.cloneToTop=
  !0)):l.toppager&&(b=l.toppager));var C=1,K,I,H,J,Y,aa,O=["left","center","right"],z="<div class='"+M.call(m,"navButton","ui-pg-button "+Z.call(m,"disabled"))+"'><span class='ui-separator'></span></div>",N=function(){da(this,F)||a(this).addClass(A)},L=function(){a(this).removeClass(A)},Q=function(){da(this,F)||(a.isFunction(q.addfunc)?q.addfunc.call(m):D.editGridRow.call(n,"new",e));return!1},U=function(b,c,d){if(!da(this,F)){var e=l.selrow;e?a.isFunction(b)?b.call(m,e):D[c].call(n,e,d):B()}return!1},
  R=function(){return U.call(this,q.editfunc,"editGridRow",d)},S=function(){return U.call(this,q.viewfunc,"viewGridRow",h)},V=function(){var b;da(this,F)||(l.multiselect?(b=l.selarrrow,0===b.length&&(b=null)):b=l.selrow,b?a.isFunction(q.delfunc)?q.delfunc.call(m,b):D.delGridRow.call(n,b,f):B());return!1},W=function(){da(this,F)||(a.isFunction(q.searchfunc)?q.searchfunc.call(m,g):D.searchGrid.call(n,g));return!1},T=function(){if(!da(this,F)){a.isFunction(q.beforeRefresh)&&q.beforeRefresh.call(m);l.search=
  !1;l.resetsearch=!0;try{if("currentfilter"!==q.refreshstate){l.postData.filters="";try{a("#fbox_"+t).jqFilter("resetFilter")}catch(b){}a.isFunction(m.clearToolbar)&&m.clearToolbar(!1)}}catch(b){}switch(q.refreshstate){case "firstpage":n.trigger("reloadGrid",[a.extend({},q.reloadGridOptions||{},{page:1})]);break;case "current":case "currentfilter":n.trigger("reloadGrid",[a.extend({},q.reloadGridOptions||{},{current:!0})])}a.isFunction(q.afterRefresh)&&q.afterRefresh.call(m)}return!1},ca=function(b,
  c,d){var e=a("<div class='"+k+"' tabindex='0' role='button'></div>"),f=q[b+"icon"],g=a.trim(q[b+"text"]);e.append("<div class='ui-pg-div'><span class='"+(q.iconsOverText?va("ui-pg-button-icon-over-text",y,f):va(y,f))+"'></span>"+(g?"<span class='ui-pg-button-text"+(q.iconsOverText?" ui-pg-button-icon-over-text":"")+"'>"+g+"</span>":"")+"</div>");a(v).append(e);e.attr({title:q[b+"title"]||"",id:c||b+"_"+H}).click(d).hover(N,L);return e};q.cloneToTop&&l.toppager&&(C=2);for(K=0;K<C;K++){v=a("<div class='ui-pg-table navtable' role='toolbar' style='float:"+
  ("rtl"===l.direction?"right":"left")+";table-layout:auto;'></div>");0===K?(I=b,H=p,I===l.toppager&&(H+="_top",C=1)):(I=l.toppager,H=p+"_top");q.add&&ca("add",e.id,Q);q.edit&&ca("edit",d.id,R);q.view&&ca("view",h.id,S);q.del&&ca("del",f.id,V);(q.add||q.edit||q.del||q.view)&&a(v).append(z);q.search&&(r=ca("search",g.id,W),g.showOnLoad&&!0===g.showOnLoad&&a(r,v).click());q.refresh&&ca("refresh","",T);r=a(".ui-jqgrid>.ui-jqgrid-view").css("font-size")||"11px";a("body").append("<div id='testpg2' class='"+
  M.call(m,"gBox","ui-jqgrid")+"' style='font-size:"+r+";visibility:hidden;' ></div>");r=a(v).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(I+"_"+q.position,I).append(v);if(q.hideEmptyPagerParts)for(J=0;J<O.length;J++)O[J]!==q.position&&(aa=a(I+"_"+O[J],I),0===aa.length||0===aa[0].childNodes.length?aa.hide():1===aa[0].childNodes.length&&(Y=aa[0].firstChild,!a(Y).is("table.ui-pg-table")||0!==Y.rows&&0!==Y.rows[0].cells.length||aa.hide()));l._nvtd&&(r>l._nvtd[0]&&(a(I+"_"+q.position,I).width(r),
  l._nvtd[0]=r),l._nvtd[1]=r);m.nav=!0;v.bind("keydown.jqGrid",E)}n.triggerHandler("jqGridResetFrozenHeights")}}})},navButtonAdd:function(b,c){"object"===typeof b&&(c=b,b=void 0);return this.each(function(){var d=this,e=d.p;if(d.grid){var f=a.extend({caption:"newButton",title:"",onClickButton:null,position:"last",cursor:"pointer",iconsOverText:!1},D.getGridRes.call(a(d),"nav"),u.nav||{},e.navOptions||{},c||{}),g=Z.call(d,"hover"),h=Z.call(d,"disabled"),m=M.call(d,"navButton","ui-pg-button");if(void 0===
  b)if(e.pager)if(D.navButtonAdd.call(a(d),e.pager,f),e.toppager)b=e.toppager;else return;else e.toppager&&(b=e.toppager);"string"===typeof b&&0!==b.indexOf("#")&&(b="#"+G(b));var e=a(".navtable",b),l=f.commonIconClass;if(0<e.length&&!(f.id&&0<e.find("#"+G(f.id)).length)){var n=a("<div tabindex='0' role='button'></div>");"NONE"===f.buttonicon.toString().toUpperCase()?a(n).addClass(m).append("<div class='ui-pg-div'>"+(f.caption?"<span class='ui-pg-button-text"+(f.iconsOverText?" ui-pg-button-icon-over-text":
  "")+"'>"+f.caption+"</span>":"")+"</div>"):a(n).addClass(m).append("<div class='ui-pg-div'><span class='"+(f.iconsOverText?va("ui-pg-button-icon-over-text",l,f.buttonicon):va(l,f.buttonicon))+"'></span>"+(f.caption?"<span class='ui-pg-button-text"+(f.iconsOverText?" ui-pg-button-icon-over-text":"")+"'>"+f.caption+"</span>":"")+"</div>");f.id&&a(n).attr("id",f.id);"first"===f.position&&0<e.children("div.ui-pg-button").length?e.children("div.ui-pg-button").first().before(n):e.append(n);a(n,e).attr("title",
  f.title||"").click(function(b){da(this,h)||a.isFunction(f.onClickButton)&&f.onClickButton.call(d,f,b);return!1}).hover(function(){da(this,h)||a(this).addClass(g)},function(){a(this).removeClass(g)});a(d).triggerHandler("jqGridResetFrozenHeights")}}})},navSeparatorAdd:function(b,c){c=a.extend({sepclass:"ui-separator",sepcontent:"",position:"last"},c||{});return this.each(function(){if(this.grid){var d=this.p,e=M.call(this,"navButton","ui-pg-button "+Z.call(this,"disabled"));if(void 0===b)if(d.pager)if(D.navSeparatorAdd.call(a(this),
  d.pager,c),d.toppager)b=d.toppager;else return;else d.toppager&&(b=d.toppager);"string"===typeof b&&0!==b.indexOf("#")&&(b="#"+G(b));d=a(".navtable",b);0<d.length&&(e="<div class='"+e+"'><span class='"+c.sepclass+"'></span>"+c.sepcontent+"</div>","first"===c.position?0===d.children("div.ui-pg-button").length?d.append(e):d.children("div.ui-pg-button").first().before(e):d.append(e))}})},GridToForm:function(b,c){return this.each(function(){var d,e,f,g;if(this.grid){var h=D.getRowData.call(a(this),b);
  if(h)for(d in h)if(h.hasOwnProperty(d))if(e=a("[name="+G(d)+"]",c),e.is("input:radio")||e.is("input:checkbox"))for(f=0;f<e.length;f++)g=a(e[f]),g.prop("checked",g.val()===String(h[d]));else e.val(Ha(h[d])?"":h[d])}})},FormToGrid:function(b,c,d,e){return this.each(function(){if(this.grid){d||(d="set");e||(e="first");var f=a(c).serializeArray(),g={};a.each(f,function(a,b){g[b.name]=b.value});"add"===d?D.addRowData.call(a(this),b,g,e):"set"===d&&D.setRowData.call(a(this),b,g)}})}});u.extend({groupingSetup:function(){return this.each(function(){var b,
  c;c=this.p;var d=c.colModel,e=c.groupingView,f,g,h=function(){return""};if(null===e||"object"!==typeof e&&!a.isFunction(e))c.grouping=!1;else if(e.groupField.length){void 0===e.visibiltyOnNextGrouping&&(e.visibiltyOnNextGrouping=[]);e.lastvalues=[];e._locgr||(e.groups=[]);e.counters=[];for(b=0;b<e.groupField.length;b++)e.groupOrder[b]||(e.groupOrder[b]="asc"),e.groupText[b]||(e.groupText[b]="{0}"),"boolean"!==typeof e.groupColumnShow[b]&&(e.groupColumnShow[b]=!0),"boolean"!==typeof e.groupSummary[b]&&
  (e.groupSummary[b]=!1),e.groupSummaryPos[b]||(e.groupSummaryPos[b]="footer"),f=d[c.iColByName[e.groupField[b]]],!0===e.groupColumnShow[b]?(e.visibiltyOnNextGrouping[b]=!0,null!=f&&!0===f.hidden&&D.showCol.call(a(this),e.groupField[b])):(e.visibiltyOnNextGrouping[b]=a("#"+u.jqID(c.id+"_"+e.groupField[b])).is(":visible"),null!=f&&!0!==f.hidden&&D.hideCol.call(a(this),e.groupField[b]));e.summary=[];e.hideFirstGroupCol&&(e.formatDisplayField[0]=function(a){return a});b=0;for(c=d.length;b<c;b++)f=d[b],
  e.hideFirstGroupCol&&!f.hidden&&e.groupField[0]===f.name&&(f.formatter=h),f.summaryType&&(g={nm:f.name,st:f.summaryType,v:"",sr:f.summaryRound,srt:f.summaryRoundType||"round"},f.summaryDivider&&(g.sd=f.summaryDivider,g.vd=""),e.summary.push(g))}else c.grouping=!1})},groupingPrepare:function(b,c){this.each(function(){var d=this.p.groupingView,e=d.groups,f=d.counters,g=d.lastvalues,h=d.isInTheSameGroup,m=d.groupField.length,l,n,p,q,r=!1,t=D.groupingCalculations.handler;for(l=0;l<m;l++)if(n=d.groupField[l],
  p=d.displayField[l],q=b[n],p=null==p?null:b[p],null==p&&(p=q),void 0!==q){n={idx:l,dataIndex:n,value:q,displayValue:p,startRow:c,cnt:1,summary:[]};0===c?(e.push(n),g[l]=q,p={cnt:1,pos:e.length-1,summary:a.extend(!0,[],d.summary)},f[l]=p):(p={cnt:1,pos:e.length,summary:a.extend(!0,[],d.summary)},"object"===typeof q||(a.isArray(h)&&a.isFunction(h[l])?h[l].call(this,g[l],q,l,d):g[l]===q)?r?(e.push(n),g[l]=q,f[l]=p):(p=f[l],p.cnt+=1,e[p.pos].cnt=p.cnt):(e.push(n),g[l]=q,r=!0,f[l]=p));q=e[p.pos];for(var u=
  void 0,y=void 0,x=void 0,u=0;u<p.summary.length;u++)y=p.summary[u],x=a.isArray(y.st)?y.st[n.idx]:y.st,a.isFunction(x)?y.v=x.call(this,y.v,y.nm,b,n):(y.v=t.call(a(this),x,y.v,y.nm,y.sr,y.srt,b),"avg"===x.toLowerCase()&&y.sd&&(y.vd=t.call(a(this),x,y.vd,y.sd,y.sr,y.srt,b)));q.summary=p.summary}});return this},groupingToggle:function(b,c){this.each(function(){var d=this.p,e=d.groupingView,f=e.minusicon,g=e.plusicon,h=c?a(c).closest("tr.jqgroup"):a("#"+u.jqID(b)),m,l,n=!0,p=!1,q=[],r=function(a){var b,
  c=a.length;for(b=0;b<c;b++)q.push(a[b])},t=parseInt(h.data("jqgrouplevel"),10);d.frozenColumns&&0<h.length&&(l=h[0].rowIndex,h=a(this.rows[l]),h=h.add(this.grid.fbRows[l]));m=h.find(">td>span.tree-wrap");u.hasAllClasses(m,f)?(m.removeClass(f).addClass(g),p=!0):m.removeClass(g).addClass(f);for(h=h.next();h.length;h=h.next())if(h.hasClass("jqfoot"))if(m=parseInt(h.data("jqfootlevel"),10),p){if(m=parseInt(h.data("jqfootlevel"),10),(!e.showSummaryOnHide&&m===t||m>t)&&r(h),m<t)break}else{if((m===t||e.showSummaryOnHide&&
  m===t+1)&&r(h),m<=t)break}else if(h.hasClass("jqgroup"))if(m=parseInt(h.data("jqgrouplevel"),10),p){if(m<=t)break;r(h)}else{if(m<=t)break;m===t+1&&(h.find(">td>span.tree-wrap").removeClass(f).addClass(g),r(h));n=!1}else(p||n)&&r(h);a(q).css("display",p?"none":"");d.frozenColumns&&a(this).triggerHandler("jqGridResetFrozenHeights",[{header:{resizeDiv:!1,resizedRows:{iRowStart:-1,iRowEnd:-1}},resizeFooter:!1,body:{resizeDiv:!0,resizedRows:{iRowStart:l,iRowEnd:h.length?h[0].rowIndex-1:-1}}}]);this.fixScrollOffsetAndhBoxPadding();
  a(this).triggerHandler("jqGridGroupingClickGroup",[b,p]);a.isFunction(d.onClickGroup)&&d.onClickGroup.call(this,b,p)});return!1},groupingRender:function(b,c){function d(b,c,d,e,h){var l=x[b],m,n="",p,q,t,w=0,A,y,E,F=!0;if(0!==c&&0!==x[b].idx)for(m=b;0<=m;m--)if(x[m].idx===x[b].idx-c){l=x[m];break}b=l.cnt;for(A=void 0===h?e:0;A<v;A++){c="&#160;";m=B[A];for(p=0;p<l.summary.length;p++)if(q=l.summary[p],y=a.isArray(q.st)?q.st[d.idx]:q.st,E=a.isArray(m.summaryTpl)?m.summaryTpl[d.idx]:m.summaryTpl||"{0}",
  q.nm===m.name){"string"===typeof y&&"avg"===y.toLowerCase()&&(q.sd&&q.vd?q.v/=q.vd:q.v&&0<b&&(q.v/=b));try{q.groupCount=l.cnt,q.groupIndex=l.dataIndex,q.groupValue=l.value,t=f.formatter("",q.v,A,q)}catch(D){t=q.v}c=u.format(E,t);break}q=p=!1;void 0!==h&&F&&!m.hidden&&(c=h,F=!1,1<e&&(p=!0,w=e-1),q=m.align,m.align="rtl"===g.direction?"right":"left",r.iconColumnName=m.name);0<w&&!m.hidden&&"&#160;"===c?(q&&(m.align=q),w--):(n+="<td role='gridcell' "+f.formatCol(A,1,"")+(p?"colspan='"+e+"'":"")+">"+c+
  "</td>",q&&(m.align=q))}return n}var e="",f=this[0],g=f.p,h=0,m,l=[],n="",p,q,r=g.groupingView,t=a.makeArray(r.groupSummary),w=(r.groupCollapse?r.plusicon:r.minusicon)+" tree-wrap",y=r.groupField.length,x=r.groups,B=g.colModel,v=B.length,E=g.page,A=D.getGuiStyles.call(f,"gridRow","jqgroup ui-row-"+g.direction),F=D.getGuiStyles.call(f,"gridRow","jqfoot ui-row-"+g.direction);a.each(B,function(a,b){var c;for(c=0;c<y;c++)if(r.groupField[c]===b.name){l[c]=a;break}});t.reverse();a.each(x,function(k,C){if(r._locgr&&
  !(C.startRow+C.cnt>(E-1)*c&&C.startRow<E*c))return!0;h++;q=g.id+"ghead_"+C.idx;p=q+"_"+k;n="<span style='cursor:pointer;margin-"+("rtl"===g.direction?"right:":"left:")+12*C.idx+"px;' class='"+r.commonIconClass+" "+w+"' onclick=\"jQuery('#"+u.jqID(g.id).replace("\\","\\\\")+"').jqGrid('groupingToggle','"+p+"', this);return false;\"></span>";try{a.isArray(r.formatDisplayField)&&a.isFunction(r.formatDisplayField[C.idx])?(C.displayValue=r.formatDisplayField[C.idx].call(f,C.displayValue,C.value,B[l[C.idx]],
  C.idx,r),m=C.displayValue):m=f.formatter(p,C.displayValue,l[C.idx],C.value)}catch(D){m=C.displayValue}e+="<tr id='"+p+"' data-jqgrouplevel='"+C.idx+"' "+(r.groupCollapse&&0<C.idx?"style='display:none;' ":"")+"role='row' class='"+A+" "+q+"'>";var K=a.isFunction(r.groupText[C.idx])?r.groupText[C.idx].call(f,m,C.cnt,C.summary):u.template(r.groupText[C.idx],m,C.cnt,C.summary),I=1,H,J,G;G=0;J=y-1===C.idx;"string"!==typeof K&&"number"!==typeof K&&(K=m);"header"===r.groupSummaryPos[C.idx]?(I=1,"cb"!==B[0].name&&
  "cb"!==B[1].name||I++,"subgrid"!==B[0].name&&"subgrid"!==B[1].name||I++,e+=d(k,0,C,I,n+"<span class='cell-wrapper'>"+K+"</span>")):e+="<td role='gridcell' style='padding-left:"+12*C.idx+"px;' colspan='"+v+"'>"+n+K+"</td>";e+="</tr>";if(J){K=x[k+1];J=C.startRow;I=void 0!==K?K.startRow:x[k].startRow+x[k].cnt;r._locgr&&(G=(E-1)*c,G>C.startRow&&(J=G));for(;J<I&&b[J-G];J++)e+=b[J-G].join("");if("header"!==r.groupSummaryPos[C.idx]){if(void 0!==K){for(H=0;H<r.groupField.length&&K.dataIndex!==r.groupField[H];H++);
  h=r.groupField.length-H}for(G=0;G<h;G++)t[G]&&(e+="<tr data-jqfootlevel='"+(C.idx-G)+(r.groupCollapse&&(0<C.idx-G||!r.showSummaryOnHide)?"' style='display:none;'":"'")+" role='row' class='"+F+"'>",e+=d(k,G,x[C.idx-G],0),e+="</tr>");h=H}}});this.unbind("jqGridShowHideCol.groupingRender").bind("jqGridShowHideCol.groupingRender",function(){var b=g.iColByName[r.iconColumnName],c,d,e;if(0<=a.inArray("header",r.groupSummaryPos)){for(c=0;c<B.length;c++)if(!B[c].hidden){e=c;break}if(void 0!==e&&b!==e){for(c=
  0;c<f.rows.length;c++)d=f.rows[c],a(d).hasClass("jqgroup")&&(a(d.cells[e]).html(d.cells[b].innerHTML),a(d.cells[b]).html("&nbsp;"));r.iconColumnName=B[e].name}}});return e},groupingGroupBy:function(b,c){return this.each(function(){var d=this.p,e=d.groupingView,f,g;"string"===typeof b&&(b=[b]);d.grouping=!0;e._locgr=!1;void 0===e.visibiltyOnNextGrouping&&(e.visibiltyOnNextGrouping=[]);for(f=0;f<e.groupField.length;f++)g=d.colModel[d.iColByName[e.groupField[f]]],!e.groupColumnShow[f]&&e.visibiltyOnNextGrouping[f]&&
  null!=g&&!0===g.hidden&&D.showCol.call(a(this),e.groupField[f]);for(f=0;f<b.length;f++)e.visibiltyOnNextGrouping[f]=a(d.idSel+"_"+u.jqID(b[f])).is(":visible");d.groupingView=a.extend(d.groupingView,c||{});e.groupField=b;a(this).trigger("reloadGrid")})},groupingRemove:function(b){return this.each(function(){var c=this.p,d=this.tBodies[0],e=c.groupingView;void 0===b&&(b=!0);c.grouping=!1;if(!0===b){for(c=0;c<e.groupField.length;c++)!e.groupColumnShow[c]&&e.visibiltyOnNextGrouping[c]&&D.showCol.call(a(this),
  e.groupField);a("tr.jqgroup, tr.jqfoot",d).remove();a("tr.jqgrow",d).filter(":hidden").show()}else a(this).trigger("reloadGrid")})},groupingCalculations:{handler:function(a,c,d,e,f,g){var h={sum:function(){return parseFloat(c||0)+parseFloat(g[d]||0)},min:function(){return""===c?parseFloat(g[d]||0):Math.min(parseFloat(c),parseFloat(g[d]||0))},max:function(){return""===c?parseFloat(g[d]||0):Math.max(parseFloat(c),parseFloat(g[d]||0))},count:function(){""===c&&(c=0);return g.hasOwnProperty(d)?c+1:0},
  avg:function(){return h.sum()}};if(!h[a])throw"jqGrid Grouping No such method: "+a;a=h[a]();null!=e&&("fixed"===f?a=a.toFixed(e):(e=Math.pow(10,e),a=Math.round(a*e)/e));return a}}});a.jgrid.extend({jqGridImport:function(b){b=a.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},b||{});return this.each(function(){var c=this,d=function(b,d){var e=a(d.xmlGrid.config,b)[0],f=a(d.xmlGrid.data,
  b)[0],n,p;if(La.xml2json){e=La.xml2json(e," ");e=a.parseJSON(e);for(p in e)e.hasOwnProperty(p)&&(n=e[p]);void 0!==n&&(f?(f=e.grid.datatype,e.grid.datatype="xmlstring",e.grid.datastr=b,a(c).jqGrid(n).jqGrid("setGridParam",{datatype:f})):a(c).jqGrid(n))}else alert("xml2json or parse are not present")},e=function(b,d){if(b&&"string"===typeof b){var e=a.parseJSON(b),f=e[d.jsonGrid.config],e=e[d.jsonGrid.data],n;e?(n=f.datatype,f.datatype="jsonstring",f.datastr=e,a(c).jqGrid(f).jqGrid("setGridParam",{datatype:n})):
  a(c).jqGrid(f)}},f;switch(b.imptype){case "xml":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"xml",context:b,complete:function(b){!(300>b.status||304===b.status)||0===b.status&&4===b.readyState||(d(b.responseXML,this),a(c).triggerHandler("jqGridImportComplete",[b,this]),a.isFunction(this.importComplete)&&this.importComplete(b))}},b.ajaxOptions));break;case "xmlstring":b.impstring&&"string"===typeof b.impstring&&(f=a.parseXML(b.impstring))&&(d(f,b),a(c).triggerHandler("jqGridImportComplete",
  [f,b]),a.isFunction(b.importComplete)&&b.importComplete(f),b.impstring=null);break;case "json":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"json",context:b,complete:function(b){try{!(300>b.status||304===b.status)||0===b.status&&4===b.readyState||(e(b.responseText,this),a(c).triggerHandler("jqGridImportComplete",[b,this]),a.isFunction(this.importComplete)&&this.importComplete(b))}catch(d){}}},b.ajaxOptions));break;case "jsonstring":b.impstring&&"string"===typeof b.impstring&&
  (e(b.impstring,b),a(c).triggerHandler("jqGridImportComplete",[b.impstring,b]),a.isFunction(b.importComplete)&&b.importComplete(b.impstring),b.impstring=null)}})},jqGridExport:function(b){b=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},b||{});var c=null;this.each(function(){if(this.grid){var d,e=a.extend(!0,{},a(this).jqGrid("getGridParam"));e.rownumbers&&(e.colNames.splice(0,1),e.colModel.splice(0,1));e.multiselect&&(e.colNames.splice(0,1),e.colModel.splice(0,1));e.subGrid&&(e.colNames.splice(0,
  1),e.colModel.splice(0,1));e.knv=null;if(e.treeGrid)for(d in e.treeReader)e.treeReader.hasOwnProperty(d)&&(e.colNames.splice(e.colNames.length-1),e.colModel.splice(e.colModel.length-1));switch(b.exptype){case "xmlstring":c="<"+b.root+">"+La.json2xml(e,b.ident)+"</"+b.root+">";break;case "jsonstring":c="{"+La.toJson(e,b.root,b.ident,!1)+"}",void 0!==e.postData.filters&&(c=c.replace(/filters":"/,'filters":'),c=c.replace(/\}\]\}"/,"}]}"))}}});return c},excelExport:function(b){b=a.extend({exptype:"remote",
  url:null,oper:"oper",tag:"excel",exportOptions:{}},b||{});return this.each(function(){var c;this.grid&&"remote"===b.exptype&&(c=a.extend({},this.p.postData,b.exportOptions),c[b.oper]=b.tag,c=jQuery.param(c),c=-1!==b.url.indexOf("?")?b.url+"&"+c:b.url+"?"+c,window.location=c)})}});var Ya=function(b){var c=a.makeArray(arguments).slice(1);c.unshift("");c.unshift("Inline");c.unshift(b);return u.feedback.apply(this,c)};u.inlineEdit=u.inlineEdit||{};u.extend({editRow:function(b,c,d,e,f,g,h,m,l,n){var p=
  {},q=a.makeArray(arguments).slice(1);"object"===a.type(q[0])?p=q[0]:(void 0!==c&&(p.keys=c),a.isFunction(d)&&(p.oneditfunc=d),a.isFunction(e)&&(p.successfunc=e),void 0!==f&&(p.url=f),null!=g&&(p.extraparam=g),a.isFunction(h)&&(p.aftersavefunc=h),a.isFunction(m)&&(p.errorfunc=m),a.isFunction(l)&&(p.afterrestorefunc=l),a.isFunction(n)&&(p.beforeEditRow=n));return this.each(function(){var c=this,d=a(c),e=c.p,f=0,g=null,h={},l=e.colModel,m=e.prmNames;if(c.grid){var n=a.extend(!0,{keys:!1,oneditfunc:null,
  successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:!0,beforeEditRow:null,mtype:"POST",focusField:!0},u.inlineEdit,e.inlineEditing||{},p),q=d.jqGrid("getInd",b,!0),k=n.focusField,C="object"===typeof k&&null!=k?a(k.target||k).closest("tr.jqgrow>td")[0]:null;if(!1!==q&&(n.extraparam[m.oper]===m.addoper||Ya.call(c,n,"beforeEditRow",n,b))&&"0"===(a(q).attr("editable")||"0")&&!a(q).hasClass("not-editable-row")){m=u.detectRowEditing.call(c,b);
  if(null!=m&&"cellEditing"===m.mode){var m=m.savedRow,D=c.rows[m.id],I=Z.call(c,"select");d.jqGrid("restoreCell",m.id,m.ic);a(D.cells[m.ic]).removeClass("edit-cell "+I);a(D).addClass(I).attr({"aria-selected":"true",tabindex:"0"})}u.enumEditableCells.call(c,q,a(q).hasClass("jqgrid-new-row")?"add":"edit",function(d){var k=d.cm,l=a(d.dataElement),m=d.dataWidth,n,p=k.name,q=k.edittype,t=d.iCol,v=k.editoptions||{};if("hidden"!==d.editable){try{n=a.unformat.call(this,d.td,{rowId:b,colModel:k},t)}catch(A){n=
  "textarea"===q?l.text():l.html()}h[p]=n;l.html("");k=a.extend({},v,{id:b+"_"+p,name:p,rowId:b,mode:d.mode});if("&nbsp;"===n||"&#160;"===n||1===n.length&&160===n.charCodeAt(0))n="";n=u.createEl.call(c,q,k,n,!0,a.extend({},u.ajaxOptions,e.ajaxSelectOptions||{}));a(n).addClass("editable");l.append(n);m&&a(n).width(d.dataWidth);u.bindEv.call(c,n,k);"select"===q&&!0===v.multiple&&void 0===v.dataUrl&&u.msie&&a(n).width(a(n).width());null===g&&(g=t);f++}});0<f&&(h.id=b,e.savedRow.push(h),a(q).attr("editable",
  "1"),k&&("number"===typeof k&&parseInt(k,10)<=l.length?g=k:"string"===typeof k?g=e.iColByName[k]:null!=C&&(g=C.cellIndex),setTimeout(function(){var b=d.jqGrid("getNumberOfFrozenColumns"),f=function(a){return e.frozenColumns&&0<b&&g<b?c.grid.fbRows[q.rowIndex].cells[a]:q.cells[a]},h=function(b){return a(b).find("input,textarea,select,button,object,*[tabindex]").filter(":input:visible:not(:disabled)")},k=function(){return h(e.frozenColumns&&0<b?c.grid.fbRows[q.rowIndex]:q).first()},l=h(f(g));0<l.length?
  l.first().focus():"number"===typeof n.defaultFocusField||"string"===typeof n.defaultFocusField?(l=h(f("number"===typeof n.defaultFocusField?n.defaultFocusField:e.iColByName[n.defaultFocusField])),0===l.length&&(l=k()),l.first().focus()):k().focus()},0)),!0===n.keys&&(l=a(q),e.frozenColumns&&(l=l.add(c.grid.fbRows[q.rowIndex])),l.bind("keydown",function(a){if(27===a.keyCode)return d.jqGrid("restoreRow",b,n.afterrestorefunc),!1;if(13===a.keyCode){if("TEXTAREA"===a.target.tagName)return!0;d.jqGrid("saveRow",
  b,n);return!1}})),Da.call(c,n.oneditfunc,"jqGridInlineEditRow",b,n))}}})},saveRow:function(b,c,d,e,f,g,h,m){var l=a.makeArray(arguments).slice(1),n={},p=this[0],q=a(p),r=null!=p?p.p:null,t=u.info_dialog;if(p.grid&&null!=r){"object"===a.type(l[0])?n=l[0]:(a.isFunction(c)&&(n.successfunc=c),void 0!==d&&(n.url=d),void 0!==e&&(n.extraparam=e),a.isFunction(f)&&(n.aftersavefunc=f),a.isFunction(g)&&(n.errorfunc=g),a.isFunction(h)&&(n.afterrestorefunc=h),a.isFunction(m)&&(n.beforeSaveRow=m));var l=function(a){return q.jqGrid("getGridRes",
  a)},n=a.extend(!0,{successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:!0,beforeSaveRow:null,ajaxSaveOptions:{},serializeSaveData:null,mtype:"POST",saveui:"enable",savetext:l("defaults.savetext")||"Saving..."},u.inlineEdit,r.inlineEditing||{},n),w={},y={},x={},B,v,E,A;E=q.jqGrid("getInd",b,!0);var F=a(E);B=r.prmNames;var k=l("errors.errcap"),C=l("edit.bClose"),D;if(!1!==E&&(l=n.extraparam[B.oper]===B.addoper?"add":"edit",Ya.call(p,n,"beforeSaveRow",
  n,b,l)&&(B=F.attr("editable"),n.url=n.url||r.editurl,D="clientArray"!==n.url,"1"===B)))if(u.enumEditableCells.call(p,E,F.hasClass("jqgrid-new-row")?"add":"edit",function(c){var d=c.cm,e=d.formatter,f=d.editoptions||{},g=d.formatoptions||{},h={},k=(a.jgrid.detectRowEditing.call(p,b)||{}).savedRow,l=u.getEditedValue.call(p,a(c.dataElement),d,h,c.editable);"select"===d.edittype&&"select"!==d.formatter&&(y[d.name]=h.text);A=u.checkValues.call(p,l,c.iCol,void 0,void 0,a.extend(c,{oldValue:null!=k?k[d.name]:
  null,newValue:l,oldRowData:k}));if(!1===A[0])return!1;"date"===e&&!0!==g.sendFormatted&&(l=a.unformat.date.call(p,l,d));D&&!0===f.NullIfEmpty&&""===l&&(l="null");w[d.name]=l}),!1===A[0])try{var I=q.jqGrid("getGridRowById",b),G=u.findPos(I);t.call(p,k,A[1],C,{left:G[0],top:G[1]+a(I).outerHeight()})}catch(J){alert(A[1])}else if(I=b,B=r.prmNames,G=!1===r.keyName?B.id:r.keyName,w&&(w[B.oper]=B.editoper,void 0===w[G]||""===w[G]?w[G]=b:E.id!==r.idPrefix+w[G]&&(E=u.stripPref(r.idPrefix,b),void 0!==r._index[E]&&
  (r._index[w[G]]=r._index[E],delete r._index[E]),b=r.idPrefix+w[G],F.attr("id",b),r.selrow===I&&(r.selrow=b),a.isArray(r.selarrrow)&&(E=a.inArray(I,r.selarrrow),0<=E&&(r.selarrrow[E]=b)),r.multiselect&&(E="jqg_"+r.id+"_"+b,F.find("input.cbox").attr("id",E).attr("name",E))),w=a.extend({},w,r.inlineData||{},n.extraparam)),D)q.jqGrid("progressBar",{method:"show",loadtype:n.saveui,htmlcontent:n.savetext}),x=a.extend({},w,x),x[G]=u.stripPref(r.idPrefix,x[G]),r.autoEncodeOnEdit&&a.each(x,function(b,c){a.isFunction(c)||
  (x[b]=u.oldEncodePostedData(c))}),a.ajax(a.extend({url:a.isFunction(n.url)?n.url.call(p,x[G],l,x,n):n.url,data:u.serializeFeedback.call(p,a.isFunction(n.serializeSaveData)?n.serializeSaveData:r.serializeRowData,"jqGridInlineSerializeSaveData",x),type:a.isFunction(n.mtype)?n.mtype.call(p,l,n,x[G],x):n.mtype,complete:function(c,d){q.jqGrid("progressBar",{method:"hide",loadtype:n.saveui,htmlcontent:n.savetext});if((300>c.status||304===c.status)&&(0!==c.status||4!==c.readyState)){var e,f;f=q.triggerHandler("jqGridInlineSuccessSaveRow",
  [c,b,n]);a.isArray(f)||(f=[!0,w]);f[0]&&a.isFunction(n.successfunc)&&(f=n.successfunc.call(p,c));a.isArray(f)?(e=f[0],w=f[1]||w):e=f;if(!0===e){r.autoEncodeOnEdit&&a.each(w,function(a,b){w[a]=u.oldDecodePostedData(b)});w=a.extend({},w,y);q.jqGrid("setRowData",b,w);F.attr("editable","0");for(e=0;e<r.savedRow.length;e++)if(String(r.savedRow[e].id)===String(b)){v=e;break}0<=v&&r.savedRow.splice(v,1);Da.call(p,n.aftersavefunc,"jqGridInlineAfterSaveRow",b,c,w,n);F.removeClass("jqgrid-new-row").unbind("keydown")}else Da.call(p,
  n.errorfunc,"jqGridInlineErrorSaveRow",b,c,d,null,n),!0===n.restoreAfterError&&q.jqGrid("restoreRow",b,n.afterrestorefunc)}},error:function(c,d,e){a("#lui_"+u.jqID(r.id)).hide();q.triggerHandler("jqGridInlineErrorSaveRow",[b,c,d,e,n]);if(a.isFunction(n.errorfunc))n.errorfunc.call(p,b,c,d,e);else{c=c.responseText||c.statusText;try{t.call(p,k,'<div class="'+Z.call(p,"error")+'">'+c+"</div>",C,{buttonalign:"right"})}catch(f){alert(c)}}!0===n.restoreAfterError&&q.jqGrid("restoreRow",b,n.afterrestorefunc)}},
  u.ajaxOptions,r.ajaxRowOptions,n.ajaxSaveOptions||{}));else{w=a.extend({},w,y);E=q.jqGrid("setRowData",b,w);F.attr("editable","0");for(l=0;l<r.savedRow.length;l++)if(String(r.savedRow[l].id)===String(I)){v=l;break}0<=v&&r.savedRow.splice(v,1);Da.call(p,n.aftersavefunc,"jqGridInlineAfterSaveRow",b,E,w,n);F.removeClass("jqgrid-new-row").unbind("keydown")}}},restoreRow:function(b,c){var d=a.makeArray(arguments).slice(1),e={};"object"===a.type(d[0])?e=d[0]:a.isFunction(c)&&(e.afterrestorefunc=c);return this.each(function(){var c=
  this,d=a(c),h=c.p,m=-1,l={},n;if(c.grid){var p=a.extend(!0,{},u.inlineEdit,h.inlineEditing||{},e),q=d.jqGrid("getInd",b,!0);if(!1!==q&&Ya.call(c,p,"beforeCancelRow",p,b)){for(n=0;n<h.savedRow.length;n++)if(String(h.savedRow[n].id)===String(b)){m=n;break}if(0<=m){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+u.jqID(q.id)).datepicker("hide")}catch(r){}a.each(h.colModel,function(){var b=this.name;h.savedRow[m].hasOwnProperty(b)&&(l[b]=h.savedRow[m][b],!this.formatter||"date"!==this.formatter||
  null!=this.formatoptions&&!0===this.formatoptions.sendFormatted||(l[b]=a.unformat.date.call(c,l[b],this)))});d.jqGrid("setRowData",b,l);a(q).attr("editable","0").unbind("keydown");h.savedRow.splice(m,1);a("#"+u.jqID(b),c).hasClass("jqgrid-new-row")&&setTimeout(function(){d.jqGrid("delRowData",b);d.jqGrid("showAddEditButtons",!1)},0)}Da.call(c,p.afterrestorefunc,"jqGridInlineAfterRestoreRow",b)}}})},addRow:function(b){return this.each(function(){if(this.grid){var c=this,d=a(c),e=c.p,f=a.extend(!0,
  {rowID:null,initdata:{},position:"first",useDefValues:!0,useFormatter:!1,beforeAddRow:null,addRowParams:{extraparam:{}}},u.inlineEdit,e.inlineEditing||{},b||{});Ya.call(c,f,"beforeAddRow",f.addRowParams)&&(f.rowID=a.isFunction(f.rowID)?f.rowID.call(c,f):null!=f.rowID?f.rowID:u.randId(),!0===f.useDefValues&&a(e.colModel).each(function(){if(this.editoptions&&this.editoptions.defaultValue){var b=this.editoptions.defaultValue;f.initdata[this.name]=a.isFunction(b)?b.call(c):b}}),f.rowID=e.idPrefix+f.rowID,
  d.jqGrid("addRowData",f.rowID,f.initdata,f.position),a("#"+u.jqID(f.rowID),c).addClass("jqgrid-new-row"),f.useFormatter?a("#"+u.jqID(f.rowID)+" .ui-inline-edit",c).click():(e=e.prmNames,f.addRowParams.extraparam[e.oper]=e.addoper,d.jqGrid("editRow",f.rowID,f.addRowParams),d.jqGrid("setSelection",f.rowID)))}})},inlineNav:function(b,c){"object"===typeof b&&(c=b,b=void 0);return this.each(function(){var d=this,e=a(d),f=d.p;if(this.grid&&null!=f){var g,h=b===f.toppager?f.idSel+"_top":f.idSel,m=b===f.toppager?
  f.id+"_top":f.id,l=Z.call(d,"disabled"),n=a.extend(!0,{edit:!0,editicon:"ui-icon-pencil",add:!0,addicon:"ui-icon-plus",save:!0,saveicon:"ui-icon-disk",cancel:!0,cancelicon:"ui-icon-cancel",commonIconClass:"ui-icon",iconsOverText:!1,addParams:{addRowParams:{extraparam:{}}},editParams:{},restoreAfterSelect:!0},e.jqGrid("getGridRes","nav"),u.nav||{},f.navOptions||{},u.inlineNav||{},f.inlineNavOptions||{},c||{});if(void 0===b)if(f.pager)if(e.jqGrid("inlineNav",f.pager,n),f.toppager)b=f.toppager,h=f.idSel+
  "_top",m=f.id+"_top";else return;else f.toppager&&(b=f.toppager,h=f.idSel+"_top",m=f.id+"_top");if(void 0!==b&&(g=a(b),!(0>=g.length))){0>=g.find(".navtable").length&&e.jqGrid("navGrid",b,{add:!1,edit:!1,del:!1,search:!1,refresh:!1,view:!1});f._inlinenav=!0;if(!0===n.addParams.useFormatter){g=f.colModel;var p,q;for(p=0;p<g.length;p++)if(g[p].formatter&&"actions"===g[p].formatter){g[p].formatoptions&&(q={keys:!1,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{},
  url:null},g=a.extend(q,g[p].formatoptions),n.addParams.addRowParams={keys:g.keys,oneditfunc:g.onEdit,successfunc:g.onSuccess,url:g.url,extraparam:g.extraparam,aftersavefunc:g.afterSave,errorfunc:g.onError,afterrestorefunc:g.afterRestore});break}}n.add&&e.jqGrid("navButtonAdd",b,{caption:n.addtext,title:n.addtitle,commonIconClass:n.commonIconClass,buttonicon:n.addicon,iconsOverText:n.iconsOverText,id:m+"_iladd",onClickButton:function(){da(this,l)||e.jqGrid("addRow",n.addParams)}});n.edit&&e.jqGrid("navButtonAdd",
  b,{caption:n.edittext,title:n.edittitle,commonIconClass:n.commonIconClass,buttonicon:n.editicon,iconsOverText:n.iconsOverText,id:m+"_iledit",onClickButton:function(){if(!da(this,l)){var a=f.selrow;a?e.jqGrid("editRow",a,n.editParams):d.modalAlert()}}});n.save&&(e.jqGrid("navButtonAdd",b,{caption:n.savetext,title:n.savetitle,commonIconClass:n.commonIconClass,buttonicon:n.saveicon,iconsOverText:n.iconsOverText,id:m+"_ilsave",onClickButton:function(){if(!da(this,l)){var b=f.savedRow[0].id;if(b){var c=
  f.prmNames,g=c.oper,h=n.editParams;a("#"+u.jqID(b),d).hasClass("jqgrid-new-row")?(n.addParams.addRowParams.extraparam[g]=c.addoper,h=n.addParams.addRowParams):(n.editParams.extraparam||(n.editParams.extraparam={}),n.editParams.extraparam[g]=c.editoper);e.jqGrid("saveRow",b,h)}else d.modalAlert()}}}),a(h+"_ilsave").addClass(l));n.cancel&&(e.jqGrid("navButtonAdd",b,{caption:n.canceltext,title:n.canceltitle,commonIconClass:n.commonIconClass,buttonicon:n.cancelicon,iconsOverText:n.iconsOverText,id:m+
  "_ilcancel",onClickButton:function(){if(!da(this,l)){var b=f.savedRow[0].id,c=n.editParams;b?(a("#"+u.jqID(b),d).hasClass("jqgrid-new-row")&&(c=n.addParams.addRowParams),e.jqGrid("restoreRow",b,c)):d.modalAlert()}}}),a(h+"_ilcancel").addClass(l));!0===n.restoreAfterSelect&&e.bind("jqGridSelectRow",function(a,b){if(0<f.savedRow.length&&!0===f._inlinenav){var c=f.savedRow[0].id;b!==c&&"number"!==typeof c&&e.jqGrid("restoreRow",c,n.editParams)}});e.bind("jqGridInlineAfterRestoreRow jqGridInlineAfterSaveRow",
  function(){e.jqGrid("showAddEditButtons",!1)});e.bind("jqGridInlineEditRow",function(a,b){e.jqGrid("showAddEditButtons",!0,b)})}}})},showAddEditButtons:function(b){return this.each(function(){if(this.grid){var c=this.p,d=c.idSel,e=Z.call(this,"disabled"),f=d+"_ilsave,"+d+"_ilcancel"+(c.toppager?","+d+"_top_ilsave,"+d+"_top_ilcancel":""),c=d+"_iladd,"+d+"_iledit"+(c.toppager?","+d+"_top_iladd,"+d+"_top_iledit":"");a(b?c:f).addClass(e);a(b?f:c).removeClass(e)}})}});var ha=null!=a.ui?a.ui.multiselect:
  null;u.msie&&8===u.msiever()&&(a.expr[":"].hidden=function(a){return 0===a.offsetWidth||0===a.offsetHeight||"none"===a.style.display});u._multiselect=!1;if(ha){if(ha.prototype._setSelected){var Gb=ha.prototype._setSelected;ha.prototype._setSelected=function(b,c){var d=this,e=Gb.call(d,b,c);if(c&&d.selectedList){var f=d.element;d.selectedList.find("li").each(function(){a(d).data("optionLink")&&a(d).data("optionLink").remove().appendTo(f)})}return e}}ha.prototype.destroy&&(ha.prototype.destroy=function(){this.element.show();
  this.container.remove();void 0===a.Widget?a.widget.prototype.destroy.apply(this,arguments):a.Widget.prototype.destroy.apply(this,arguments)});u._multiselect=!0}u.extend({sortableColumns:function(b){return this.each(function(){function c(){e.disableClick=!0}var d=this,e=d.p,f=G(e.id),f={tolerance:"pointer",axis:"x",scrollSensitivity:"1",items:">th:not(:has(#jqgh_"+f+"_cb,#jqgh_"+f+"_rn,#jqgh_"+f+"_subgrid),:hidden)",placeholder:{element:function(b){return a(document.createElement(b[0].nodeName)).addClass(b[0].className+
  " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(a,b){b.height(a.currentItem.innerHeight()-parseInt(a.currentItem.css("paddingTop")||0,10)-parseInt(a.currentItem.css("paddingBottom")||0,10));b.width(a.currentItem.innerWidth()-parseInt(a.currentItem.css("paddingLeft")||0,10)-parseInt(a.currentItem.css("paddingRight")||0,10))}},update:function(b,c){var f=a(">th",a(c.item).parent()),g=e.id+"_",p=[];f.each(function(){var b=a(">div",this).get(0).id.replace(/^jqgh_/,
  "").replace(g,""),b=e.iColByName[b];void 0!==b&&p.push(b)});a(d).jqGrid("remapColumns",p,!0,!0);a.isFunction(e.sortable.update)&&e.sortable.update(p);setTimeout(function(){e.disableClick=!1},50)}};e.sortable.options?a.extend(f,e.sortable.options):a.isFunction(e.sortable)&&(e.sortable={update:e.sortable});if(f.start){var g=f.start;f.start=function(a,b){c();g.call(this,a,b)}}else f.start=c;e.sortable.exclude&&(f.items+=":not("+e.sortable.exclude+")");f=b.sortable(f);f=f.data("sortable")||f.data("uiSortable")||
  f.data("ui-sortable");null!=f&&(f.floating=!0)})},columnChooser:function(b){function c(b,c){b&&("string"===typeof b?a.fn[b]&&a.fn[b].apply(c,a.makeArray(arguments).slice(2)):a.isFunction(b)&&b.apply(c,a.makeArray(arguments).slice(2)))}var d=this,e=d[0].p,f,g,h={},m=[],l,n,p=e.colModel;l=p.length;n=e.colNames;var q=function(a){return ha&&ha.prototype&&a.data(ha.prototype.widgetFullName||ha.prototype.widgetName)||a.data("ui-multiselect")||a.data("multiselect")};if(!a("#colchooser_"+G(e.id)).length){f=
  a('<div id="colchooser_'+e.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');g=a("select",f);b=a.extend({width:400,height:240,classname:null,done:function(a){a&&null==e.groupHeader&&d.jqGrid("remapColumns",a,!0)},msel:"multiselect",dlog:"dialog",dialog_opts:{minWidth:470,dialogClass:"ui-jqdialog"},dlog_opts:function(b){var c={};c[b.bSubmit]=function(){b.apply_perm();b.cleanup(!1)};c[b.bCancel]=function(){b.cleanup(!0)};return a.extend(!0,{buttons:c,
  close:function(){b.cleanup(!0)},modal:b.modal||!1,resizable:b.resizable||!0,width:b.width+70,resize:function(){var a=q(g),b=a.container.closest(".ui-dialog-content");0<b.length&&"object"===typeof b[0].style?b[0].style.width="":b.css("width","");a.selectedList.height(Math.max(a.selectedContainer.height()-a.selectedActions.outerHeight()-1,1));a.availableList.height(Math.max(a.availableContainer.height()-a.availableActions.outerHeight()-1,1))}},b.dialog_opts||{})},apply_perm:function(){var c=[],f={skipSetGridWidth:!0,
  skipSetGroupHeaders:!0};a("option",g).each(function(){a(this).is(":selected")?d.jqGrid("showCol",p[this.value].name,f):d.jqGrid("hideCol",p[this.value].name,f)});if(e.groupHeader&&("object"===typeof e.groupHeader||a.isFunction(e.groupHeader)))if(d.jqGrid("destroyGroupHeader",!1),null!=e.pivotOptions&&null!=e.pivotOptions.colHeaders&&1<e.pivotOptions.colHeaders.length){var l,k=e.pivotOptions.colHeaders;for(l=0;l<k.length;l++)k[l]&&k[l].groupHeaders.length&&d.jqGrid("setGroupHeaders",k[l])}else d.jqGrid("setGroupHeaders",
  e.groupHeader);a("option",g).filter(":selected").each(function(){c.push(parseInt(this.value,10))});a.each(c,function(){delete h[p[parseInt(this,10)].name]});a.each(h,function(){var a=parseInt(this,10);var b=c,d=a,e,f;0<=d?(e=b.slice(),f=e.splice(d,Math.max(b.length-d,d)),d>b.length&&(d=b.length),e[d]=a,c=e.concat(f)):c=b});b.done&&b.done.call(d,c);d.jqGrid("setGridWidth",e.autowidth||void 0!==e.widthOrg&&"auto"!==e.widthOrg&&"100%"!==e.widthOrg?e.width:e.tblwidth,e.shrinkToFit)},cleanup:function(a){c(b.dlog,
  f,"destroy");c(b.msel,g,"destroy");f.remove();a&&b.done&&b.done.call(d)},msel_opts:{}},d.jqGrid("getGridRes","col"),u.col,b||{});if(a.ui&&ha&&ha.defaults){if(!u._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");return}b.msel_opts=a.extend(ha.defaults,b.msel_opts)}b.caption&&f.attr("title",b.caption);b.classname&&(f.addClass(b.classname),g.addClass(b.classname));b.width&&(a(">div",f).css({width:b.width,margin:"0 auto"}),g.css("width",b.width));
  b.height&&(a(">div",f).css("height",b.height),g.css("height",b.height-10));g.empty();var r=e.groupHeader,t={},w,y,x,B,v;if(null!=r&&null!=r.groupHeaders)for(w=0,x=r.groupHeaders.length;w<x;w++)for(v=r.groupHeaders[w],y=0;y<v.numberOfColumns;y++)B=e.iColByName[v.startColumnName]+y,t[B]=a.isFunction(b.buildItemText)?b.buildItemText.call(d[0],{iCol:B,cm:p[B],cmName:p[B].name,colName:n[B],groupTitleText:v.titleText}):a.jgrid.stripHtml(v.titleText)+": "+a.jgrid.stripHtml(""===n[B]?p[B].name:n[B]);for(B=
  0;B<l;B++)void 0===t[B]&&(t[B]=a.isFunction(b.buildItemText)?b.buildItemText.call(d[0],{iCol:B,cm:p[B],cmName:p[B].name,colName:n[B],groupTitleText:null}):a.jgrid.stripHtml(n[B]));a.each(p,function(a){h[this.name]=a;this.hidedlg?this.hidden||m.push(a):g.append("<option value='"+a+"'"+(e.headertitles||this.headerTitle?" title='"+u.stripHtml("string"===typeof this.headerTitle?this.headerTitle:t[a])+"'":"")+(this.hidden?"":" selected='selected'")+">"+t[a]+"</option>")});l=a.isFunction(b.dlog_opts)?b.dlog_opts.call(d,
  b):b.dlog_opts;c(b.dlog,f,l);l=a.isFunction(b.msel_opts)?b.msel_opts.call(d,b):b.msel_opts;c(b.msel,g,l);l=a("#colchooser_"+G(e.id));l.css({margin:"auto"});l.find(">div").css({width:"100%",height:"100%",margin:"auto"});if(l=q(g))l.container.css({width:"100%",height:"100%",margin:"auto"}),l.selectedContainer.css({width:100*l.options.dividerLocation+"%",height:"100%",margin:"auto",boxSizing:"border-box"}),l.availableContainer.css({width:100-100*l.options.dividerLocation+"%",height:"100%",margin:"auto",
  boxSizing:"border-box"}),l.selectedList.css("height","auto"),l.availableList.css("height","auto"),n=Math.max(l.selectedList.height(),l.availableList.height()),n=Math.min(n,a(window).height()),l.selectedList.css("height",n),l.availableList.css("height",n)}},sortableRows:function(b){return this.each(function(){var c=this,d=c.grid,e=c.p;d&&!e.treeGrid&&a.fn.sortable&&(b=a.extend({cursor:"move",axis:"y",items:">.jqgrow"},b||{}),b.start&&a.isFunction(b.start)?(b._start_=b.start,delete b.start):b._start_=
  !1,b.update&&a.isFunction(b.update)?(b._update_=b.update,delete b.update):b._update_=!1,b.start=function(f,g){a(g.item).css("border-width","0");a("td",g.item).each(function(a){this.style.width=d.cols[a].style.width});if(e.subGrid){var h=a(g.item).attr("id");try{a(c).jqGrid("collapseSubGridRow",h)}catch(m){}}b._start_&&b._start_.apply(this,[f,g])},b.update=function(d,g){a(g.item).css("border-width","");!0===e.rownumbers&&a("td.jqgrid-rownum",c.rows).each(function(b){a(this).html(b+1+(parseInt(e.page,
  10)-1)*parseInt(e.rowNum,10))});b._update_&&b._update_.apply(this,[d,g])},a(c.tBodies[0]).sortable(b),a.isFunction(a.fn.disableSelection)&&a(c.tBodies[0]).children("tr.jqgrow").disableSelection())})},gridDnD:function(b){return this.each(function(){function c(){var b=a.data(d,"dnd");a("tr.jqgrow:not(.ui-draggable)",d).draggable(a.isFunction(b.drag)?b.drag.call(a(d),b):b.drag)}var d=this,e,f;if(d.grid&&!d.p.treeGrid&&a.fn.draggable&&a.fn.droppable)if(void 0===a("#jqgrid_dnd")[0]&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>"),
  "string"===typeof b&&"updateDnD"===b&&!0===d.p.jqgdnd)c();else if(b=a.extend({drag:function(b){return a.extend({start:function(c,e){var f;if(d.p.subGrid){f=a(e.helper).attr("id");try{a(d).jqGrid("collapseSubGridRow",f)}catch(n){}}for(f=0;f<a.data(d,"dnd").connectWith.length;f++)0===a(a.data(d,"dnd").connectWith[f]).jqGrid("getGridParam","reccount")&&a(a.data(d,"dnd").connectWith[f]).jqGrid("addRowData","jqg_empty_row",{});e.helper.addClass("ui-state-highlight");a("td",e.helper).each(function(a){this.style.width=
  d.grid.headers[a].width+"px"});b.onstart&&a.isFunction(b.onstart)&&b.onstart.call(a(d),c,e)},stop:function(c,e){var f;e.helper.dropped&&!b.dragcopy&&(f=a(e.helper).attr("id"),void 0===f&&(f=a(this).attr("id")),a(d).jqGrid("delRowData",f));for(f=0;f<a.data(d,"dnd").connectWith.length;f++)a(a.data(d,"dnd").connectWith[f]).jqGrid("delRowData","jqg_empty_row");b.onstop&&a.isFunction(b.onstop)&&b.onstop.call(a(d),c,e)}},b.drag_opts||{})},drop:function(b){return a.extend({accept:function(b){if(!a(b).hasClass("jqgrow"))return b;
  b=a(b).closest("table.ui-jqgrid-btable");return 0<b.length&&void 0!==a.data(b[0],"dnd")?(b=a.data(b[0],"dnd").connectWith,-1!==a.inArray("#"+G(this.id),b)?!0:!1):!1},drop:function(c,e){if(a(e.draggable).hasClass("jqgrow")){var f=a(e.draggable).attr("id"),f=e.draggable.parent().parent().jqGrid("getRowData",f);if(!b.dropbyname){var n=0,p={},q,r,t=a("#"+G(this.id)).jqGrid("getGridParam","colModel");try{for(r in f)f.hasOwnProperty(r)&&(q=t[n].name,"cb"!==q&&"rn"!==q&&"subgrid"!==q&&f.hasOwnProperty(r)&&
  t[n]&&(p[q]=f[r]),n++);f=p}catch(u){}}e.helper.dropped=!0;b.beforedrop&&a.isFunction(b.beforedrop)&&(q=b.beforedrop.call(this,c,e,f,a("#"+G(d.p.id)),a(this)),void 0!==q&&null!==q&&"object"===typeof q&&(f=q));if(e.helper.dropped){var w;b.autoid&&(a.isFunction(b.autoid)?w=b.autoid.call(this,f):(w=Math.ceil(1E3*Math.random()),w=b.autoidprefix+w));a("#"+G(this.id)).jqGrid("addRowData",w,f,b.droppos);f[d.p.localReader.id]=w}b.ondrop&&a.isFunction(b.ondrop)&&b.ondrop.call(this,c,e,f)}}},b.drop_opts||{})},
  onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dragcopy:!1,dropbyname:!1,droppos:"first",autoid:!0,autoidprefix:"dnd_"},b||{}),b.connectWith)for(b.connectWith=b.connectWith.split(","),b.connectWith=a.map(b.connectWith,function(b){return a.trim(b)}),a.data(d,"dnd",b),0===d.p.reccount||d.p.jqgdnd||c(),d.p.jqgdnd=!0,e=0;e<b.connectWith.length;e++)f=b.connectWith[e],a(f).droppable(a.isFunction(b.drop)?
  b.drop.call(a(d),b):b.drop)})},gridResize:function(b){return this.each(function(){var c=this,d=c.grid,e=c.p,f=e.gView+">.ui-jqgrid-bdiv",g=!1,h,m=e.height;if(d&&a.fn.resizable){b=a.extend({},b||{});b.alsoResize?(b._alsoResize_=b.alsoResize,delete b.alsoResize):b._alsoResize_=!1;b.stop&&a.isFunction(b.stop)?(b._stop_=b.stop,delete b.stop):b._stop_=!1;b.stop=function(l,p){a(c).jqGrid("setGridWidth",p.size.width,b.shrinkToFit);a(e.gView+">.ui-jqgrid-titlebar").css("width","");g?(a(h).each(function(){a(this).css("height",
  "")}),"auto"!==m&&"100%"!==m||a(d.bDiv).css("height",m)):a(c).jqGrid("setGridParam",{height:a(f).height()});c.fixScrollOffsetAndhBoxPadding&&c.fixScrollOffsetAndhBoxPadding();b._stop_&&b._stop_.call(c,l,p)};h=f;"auto"!==m&&"100%"!==m||void 0!==b.handles||(b.handles="e,w");if(b.handles){var l=a.map(String(b.handles).split(","),function(b){return a.trim(b)});2===l.length&&("e"===l[0]&&"w"===l[1]||"e"===l[1]&&"w"===l[1])&&(h=e.gView+">div:not(.frozen-div)",g=!0,e.pager&&(h+=","+e.pager))}b.alsoResize=
  b._alsoResize_?h+","+b._alsoResize_:h;delete b._alsoResize_;a(e.gBox).resizable(b)}})}});oa.prototype.calc=function(b,c,d,e,f){if(void 0!==b)switch(this.result=this.result||0,b=parseFloat(b),this.aggregator){case "sum":this.result+=b;break;case "count":this.result++;break;case "avg":this.finilized?(this.count=this.count||0,this.result=(this.result*this.count+b)/(this.count+1)):(this.result+=b,this.count=this.count||0);this.count++;break;case "min":this.result=Math.min(this.result,b);break;case "max":this.result=
  Math.max(this.result,b);break;default:a.isFunction(this.aggregator)&&(this.result=this.aggregator.call(this.context,{previousResult:this.result,value:b,fieldName:c,item:d,iItem:e,items:f}))}};oa.prototype.getResult=function(a,c,d){if(void 0!==this.result||d)d&&void 0!==this.result&&(this.count=this.result=0),void 0===this.result||this.finilized||"avg"!==this.aggregator||(this.result/=this.count,this.finilized=!0),a[c]=this.result};pa.prototype.compareVectorsEx=function(a,c){var d=this.fieldLength,
  e,f;for(e=0;e<d;e++)if(f=this.fieldCompare[e](a[e],c[e]),0!==f)return{index:e,result:f};return{index:-1,result:0}};pa.prototype.getIndexOfDifferences=function(a,c){return null===c||null===a?0:this.compareVectorsEx(a,c).index};pa.prototype.compareVectors=function(a,c){var d=this.compareVectorsEx(a,c);return 0<(0<=d.index?this.fieldSortDirection[d.index]:1)?d.result:-d.result};pa.prototype.getItem=function(a){return this.items[a]};pa.prototype.getIndexLength=function(){return this.items.length};pa.prototype.getIndexesOfSourceData=
  function(a){return this.indexesOfSourceData[a]};pa.prototype.createDataIndex=function(b){var c,d=b.length,e=this.fieldLength,f,g,h=this.fieldNames,m=this.indexesOfSourceData,l,n,p=this.items,q;for(c=0;c<d;c++){n=b[c];f=Array(e);for(l=0;l<e;l++)g=n[h[l]],void 0!==g&&("string"===typeof g&&this.trimByCollect&&(g=a.trim(g)),f[l]=g);n=0;q=p.length-1;if(0>q)p.push(f),m.push([c]);else if(g=this.compareVectors(f,p[q]),0===g)m[q].push(c);else if(1===g||this.skipSort)p.push(f),m.push([c]);else if(g=this.compareVectors(p[0],
  f),1===g)p.unshift(f),m.unshift([c]);else if(0===g)m[0].push(c);else for(;;){if(2>q-n){p.splice(q,0,f);m.splice(q,0,[c]);break}l=Math.floor((n+q)/2);g=this.compareVectors(p[l],f);if(0===g){m[l].push(c);break}1===g?q=l:n=l}}};u.extend({pivotSetup:function(b,c){var d=this[0],e=a.isArray,f={},g={groupField:[],groupSummary:[],groupSummaryPos:[]},h={grouping:!0,groupingView:g},m=a.extend({totals:!1,useColSpanStyle:!1,trimByCollect:!0,skipSortByX:!1,skipSortByY:!1,caseSensitive:!1,footerTotals:!1,groupSummary:!0,
  groupSummaryPos:"header",frozenStaticCols:!1,defaultFormatting:!0,data:b},c||{}),l,n,p,q=b.length,r,t,w,y,x,B,v=m.xDimension,E=m.yDimension,A=m.aggregates,F,q=m.totalText||m.totals||m.rowTotals||m.totalHeader,k,C=e(v)?v.length:0;y=e(E)?E.length:0;var D=e(A)?A.length:0,G=y-(1===D?1:0),H=[],J=[],M=[],e=[],N=Array(D),O=Array(y),z,R,L,Q,U,T,S,V,W,Z,ca;n=function(c,d,e){c=new pa(m.trimByCollect,m.caseSensitive,d,c);a.isFunction(e)&&(c.compareVectorsEx=e);c.createDataIndex(b);return c};var da=function(b,
  c,e,f,g){var h,k;switch(b){case 1:h=E[f].totalText||"{0} {1} {2}";k="y"+g+"t"+f;break;case 2:h=m.totalText||"{0}";k="t";break;default:h=1<D?c.label||"{0}":ca.getItem(g)[f],k="y"+g}b=a.extend({},c,{name:k+(1<D?"a"+e:""),label:a.isFunction(h)?h.call(d,2===b?{aggregate:c,iAggregate:e,pivotOptions:m}:{yIndex:ca.getItem(g),aggregate:c,iAggregate:e,yLevel:f,pivotOptions:m}):u.template.apply(d,2===b?[h,c.aggregator,c.member,e]:[h,c.aggregator,c.member,ca.getItem(g)[f],f])});delete b.member;delete b.aggregator;
  return b};x=function(a,b,c){var d,e;for(d=0;d<D;d++)e=A[d],void 0===e.template&&void 0===e.formatter&&m.defaultFormatting&&(e.template="count"===e.aggregator?"integer":"number"),M.push(da(a,e,d,b,c))};z=function(b,c,e){var f,g,h,k;for(f=G-1;f>=c;f--)if(J[f]){for(g=0;g<=f;g++)W=H[g].groupHeaders,W[W.length-1].numberOfColumns+=D;r=E[f];h=r.totalHeader;k=r.headerOnTop;for(g=f+1;g<=G-1;g++)H[g].groupHeaders.push({titleText:k&&g===f+1||!k&&g===G-1?a.isFunction(h)?h.call(d,e,f):u.template.call(d,h||"",
  e[f],f):"",startColumnName:"y"+(b-1)+"t"+f+(1===D?"":"a0"),numberOfColumns:D})}};var ba=function(a){a=new oa("count"===A[a].aggregator?"sum":A[a].aggregator,d,c);a.groupInfo={iRows:[],rows:[],ys:[],iYs:[]};return a},ga=function(){var a,b;for(a=G-1;0<=a;a--)if(J[a])for(null==O[a]&&(O[a]=Array(D)),b=0;b<D;b++)O[a][b]=ba(b)},ha=function(a,b,c,d){var e,f=ca.getIndexOfDifferences(b,c),g,h;if(null!==c)for(f=Math.max(f,0),e=G-1;e>=f;e--)g="y"+a+"t"+e+(1<D?"a"+d:""),J[e]&&void 0===S[g]&&(h=O[e][d],h.getResult(S,
  g),S.pivotInfos[g]={colType:1,iA:d,a:A[d],level:e,iRows:h.groupInfo.iRows,rows:h.groupInfo.rows,ys:h.groupInfo.ys,iYs:h.groupInfo.iYs},b!==c&&(O[e][d]=ba(d)))},ia=function(c,d,e,f,g,h,k){var l;if(c!==d)for(d=G-1;0<=d;d--)J[d]&&(l=O[d][f],l.calc(g[e.member],e.member,g,h,b),l=l.groupInfo,0>a.inArray(k,l.iYs)&&(l.iYs.push(k),l.ys.push(c)),0>a.inArray(h,l.iRows)&&(l.iRows.push(h),l.rows.push(g)))};if(0===C||0===D)throw"xDimension or aggregates options are not set!";Z=n(v,m.skipSortByX,m.compareVectorsByX);
  ca=n(E,m.skipSortByY,m.compareVectorsByY);c.xIndex=Z;c.yIndex=ca;for(n=0;n<C;n++)p=v[n],t={name:"x"+n,label:null!=p.label?a.isFunction(p.label)?p.label.call(d,p,n,m):p.label:p.dataName,frozen:m.frozenStaticCols},n<C-1&&(g.groupField.push(t.name),g.groupSummary.push(m.groupSummary),g.groupSummaryPos.push(m.groupSummaryPos)),t=a.extend(t,p),delete t.dataName,delete t.footerText,M.push(t);2>C&&(h.grouping=!1);h.sortname=M[C-1].name;g.hideFirstGroupCol=!0;for(n=0;n<y;n++)r=E[n],J.push(r.totals||r.rowTotals||
  r.totalText||r.totalHeader?!0:!1);V=ca.getItem(0);x(0,y-1,0);g=ca.getIndexLength();for(t=1;t<g;t++){L=ca.getItem(t);n=ca.getIndexOfDifferences(L,V);for(p=G-1;p>=n;p--)J[p]&&x(1,p,t-1);V=L;x(0,y-1,t)}for(n=G-1;0<=n;n--)J[n]&&x(1,n,g-1);q&&x(2);V=ca.getItem(0);for(p=0;p<G;p++)H.push({useColSpanStyle:m.useColSpanStyle,groupHeaders:[{titleText:V[p],startColumnName:1===D?"y0":"y0a0",numberOfColumns:D}]});for(t=1;t<g;t++){L=ca.getItem(t);n=ca.getIndexOfDifferences(L,V);z(t,n,V);for(p=G-1;p>=n;p--)H[p].groupHeaders.push({titleText:L[p],
  startColumnName:"y"+t+(1===D?"":"a0"),numberOfColumns:D});for(p=0;p<n;p++)W=H[p].groupHeaders,W[W.length-1].numberOfColumns+=D;V=L}z(g,0,V);if(q)for(n=0;n<G;n++)H[n].groupHeaders.push({titleText:n<G-1?"":m.totalHeader||"",startColumnName:"t"+(1===D?"":"a0"),numberOfColumns:D});z=Z.getIndexLength();for(y=0;y<z;y++){p=Z.getItem(y);x={iX:y,x:p};S={pivotInfos:x};for(n=0;n<C;n++)S["x"+n]=p[n];R=Z.getIndexesOfSourceData(y);if(q)for(p=0;p<D;p++)N[p]=ba(p);V=null;ga();for(t=0;t<g;t++){L=ca.getItem(t);Q=ca.getIndexesOfSourceData(t);
  for(p=0;p<D;p++){null!==V&&ha(t-1,L,V,p);U=[];for(n=0;n<Q.length;n++)w=Q[n],0<=a.inArray(w,R)&&U.push(w);if(0<U.length){B=Array(U.length);T=A[p];F=new oa(T.aggregator,d,c);for(w=0;w<U.length;w++)n=U[w],l=b[n],B[w]=l,F.calc(l[T.member],T.member,l,n,b),q&&(k=N[p],k.calc(l[T.member],T.member,l,n,b),k=k.groupInfo,0>a.inArray(n,k.iYs)&&(k.iYs.push(t),k.ys.push(L)),0>a.inArray(n,k.iRows)&&(k.iRows.push(n),k.rows.push(l))),ia(L,V,T,p,l,n,t);l="y"+t+(1===D?"":"a"+p);F.getResult(S,l);x[l]={colType:0,iY:t,
  y:L,iA:p,a:T,iRows:U,rows:B}}}V=L}if(null!==V)for(p=0;p<D;p++)ha(g-1,V,V,p);if(q)for(p=0;p<D;p++)l="t"+(1===D?"":"a"+p),k=N[p],k.getResult(S,l),k=k.groupInfo,x[l]={colType:2,iA:p,a:A[p],iRows:k.iRows,rows:k.rows,iYs:k.iYs,ys:k.ys};e.push(S)}if(m.footerTotals||m.colTotals){q=e.length;for(n=0;n<C;n++)f["x"+n]=v[n].footerText||"";for(n=C;n<M.length;n++){l=M[n].name;F=new oa(m.footerAggregator||"sum",d,c);for(w=0;w<q;w++)S=e[w],F.calc(S[l],l,S,w,e);F.getResult(f,l)}}c.colHeaders=H;return{colModel:M,options:c,
  rows:e,groupOptions:h,groupHeaders:H,summary:f}},jqPivot:function(b,c,d,e){return this.each(function(){function f(){var e=m.pivotSetup.call(h,b,c),f=e.groupHeaders,p=e.summary,q=0,r;for(r in p)p.hasOwnProperty(r)&&q++;p=0<q?!0:!1;q=e.groupOptions.groupingView;r=u.from.call(g,e.rows);var t;if(c.skipSortByX)for(t=0;t<q.groupField.length;t++)r.orderBy(q.groupField[t],null!=d&&d.groupingView&&null!=d.groupingView.groupOrder&&"desc"===d.groupingView.groupOrder[t]?"d":"a","text","");c.data=b;m.call(h,a.extend(!0,
  {datastr:a.extend(r.select(),p?{userdata:e.summary}:{}),datatype:"jsonstring",footerrow:p,userDataOnFooter:p,colModel:e.colModel,pivotOptions:e.options,additionalProperties:["pivotInfos"],viewrecords:!0,sortname:c.xDimension[0].dataName},e.groupOptions,d||{}));if(f.length)for(t=0;t<f.length;t++)f[t]&&f[t].groupHeaders.length&&m.setGroupHeaders.call(h,f[t]);c.frozenStaticCols&&m.setFrozenColumns.call(h)}var g=this,h=a(g),m=a.fn.jqGrid;"string"===typeof b?a.ajax(a.extend({url:b,dataType:"json",success:function(a){b=
  u.getAccessor(a,e&&e.reader?e.reader:"rows");f()}},e||{})):f()})}});var vb=function(){var b=a.makeArray(arguments);b[0]="subGrid"+b[0].charAt(0).toUpperCase()+b[0].substring(1);b.unshift("");b.unshift("");b.unshift(this.p);return u.feedback.apply(this,b)},gb=function(b,c){return this.each(function(){if(this.grid&&null!=b&&!0===this.p.subGrid){var d=a(this).jqGrid("getInd",b,!0);a(d).find(">td."+c).trigger("click")}})};u.extend({setSubGrid:function(){return this.each(function(){var b=this.p,c=b.subGridModel[0];
  b.subGridOptions=a.extend({expandOnLoad:!1,delayOnLoad:50,selectOnExpand:!1,selectOnCollapse:!1,reloadOnExpand:!0},b.subGridOptions||{});b.colNames.unshift("");b.colModel.unshift({name:"subgrid",width:u.cell_width?b.subGridWidth+b.cellLayout:b.subGridWidth,labelClasses:"jqgh_subgrid",sortable:!1,resizable:!1,hidedlg:!0,search:!1,fixed:!0,frozen:!0});if(c)for(c.align=a.extend([],c.align||[]),b=0;b<c.name.length;b++)c.align[b]=c.align[b]||"left"})},addSubGridCell:function(b,c,d,e){var f=this[0],g=f.p.subGridOptions;
  d=a.isFunction(g.hasSubgrid)?g.hasSubgrid.call(f,{rowid:d,iRow:c,iCol:b,data:e}):!0;return null==f||null==f.p||null==g?"":"<td role='gridcell' class='"+D.getGuiStyles.call(this,"subgrid.tdStart",d?"ui-sgcollapsed sgcollapsed":"")+"' "+f.formatCol(b,c)+">"+(d?"<div class='"+D.getGuiStyles.call(this,"subgrid.buttonDiv","sgbutton-div")+"'><a role='button' class='"+D.getGuiStyles.call(this,"subgrid.button","sgbutton")+"'><span class='"+u.mergeCssClasses(g.commonIconClass,g.plusicon)+"'></span></a></div>":
  "&nbsp;")+"</td>"},addSubGrid:function(b,c){return this.each(function(){var d=this,e=d.p,f=e.subGridModel[0],g=function(a,b){return D.getGuiStyles.call(d,"subgrid."+a,b||"")},h=g("thSubgrid","ui-th-subgrid ui-th-column ui-th-"+e.direction),m=g("rowSubTable","ui-subtblcell"),l=g("row","ui-subgrid ui-row-"+e.direction),n=g("tdWithIcon","subgrid-cell"),p=g("tdData","subgrid-data"),q=function(b,c,d){c=a("<td align='"+f.align[d]+"'></td>").html(c);b.append(c)},r=function(b,c){var d=e.xmlReader.subgrid;
  a(d.root+" "+d.row,b).each(function(){var b,e,g=a("<tr class='"+m+"'></tr>");if(!0===d.repeatitems)a(d.cell,this).each(function(b){q(g,a(this).text()||"&#160;",b)});else if(b=f.mapping||f.name)for(e=0;e<b.length;e++)q(g,a(b[e],this).text()||"&#160;",e);c.append(g)})},t=function(b,c){var d,g,h,l,n,p=e.jsonReader.subgrid,r=u.getAccessor(b,p.root);if(null!=r)for(g=0;g<r.length;g++){n=r[g];d=a("<tr class='"+m+"'></tr>");if(!0===p.repeatitems)for(p.cell&&(n=n[p.cell]),h=0;h<n.length;h++)q(d,n[h]||"&#160;",
  h);else if(l=f.mapping||f.name,l.length)for(h=0;h<l.length;h++)q(d,n[l[h]]||"&#160;",h);c.append(d)}},w=function(b,c,g){var k,l,m=a("<table"+(u.msie&&8>u.msiever()?" cellspacing='0'":"")+"><tbody></tbody></table>"),n=a(m[0].tBodies[0]),p=a("<tr></tr>");for(l=0;l<f.name.length;l++)k=a("<th class='"+h+"'></th>").html(f.name[l]).width(f.width[l]),p.append(k);n.append(p);g(b,n);a("#"+G(e.id+"_"+c)).append(m);d.grid.hDiv.loading=!1;a("#load_"+G(e.id)).hide();return!1},y=function(b){var c=a(b).attr("id"),
  g={nd_:(new Date).getTime()},h,l;g[e.prmNames.subgridid]=c;if(!f)return!1;if(f.params)for(l=0;l<f.params.length;l++)h=e.iColByName[f.params[l]],void 0!==h&&(g[e.colModel[h].name]=a(b.cells[h]).text().replace(/\&#160\;/ig,""));if(!d.grid.hDiv.loading)switch(d.grid.hDiv.loading=!0,a("#load_"+G(e.id)).show(),e.subgridtype||(e.subgridtype=e.datatype),a.isFunction(e.subgridtype)?e.subgridtype.call(d,g):e.subgridtype=e.subgridtype.toLowerCase(),e.subgridtype){case "xml":case "json":a.ajax(a.extend({type:e.mtype,
  url:a.isFunction(e.subGridUrl)?e.subGridUrl.call(d,g):e.subGridUrl,dataType:e.subgridtype,data:u.serializeFeedback.call(d,e.serializeSubGridData,"jqGridSerializeSubGridData",g),complete:function(b){"xml"===e.subgridtype?w(b.responseXML,c,r):(b=a.parseJSON(b.responseText),w(b,c,t))}},u.ajaxOptions,e.ajaxSubgridOptions||{}))}return!1},g=function(){var c=a(this).parent("tr")[0],f=c.nextSibling,g=c.id,h=e.id+"_"+g,m=function(a){return u.mergeCssClasses(e.subGridOptions.commonIconClass,e.subGridOptions[a])},
  q=1;a.each(e.colModel,function(){!0!==this.hidden&&"rn"!==this.name&&"cb"!==this.name||q++});if(a(this).hasClass("sgcollapsed")){if(!0===e.subGridOptions.reloadOnExpand||!1===e.subGridOptions.reloadOnExpand&&!a(f).hasClass("ui-subgrid")){f=1<=b?"<td colspan='"+b+"'>&#160;</td>":"";if(!vb.call(d,"beforeExpand",h,g))return;a(c).after("<tr role='row' class='"+l+"'>"+f+"<td class='"+n+"'><span class='"+m("openicon")+"'></span></td><td colspan='"+parseInt(e.colNames.length-q,10)+"' class='"+p+"'><div id='"+
  h+"' class='tablediv'></div></td></tr>");a(d).triggerHandler("jqGridSubGridRowExpanded",[h,g]);a.isFunction(e.subGridRowExpanded)?e.subGridRowExpanded.call(d,h,g):y(c)}else a(f).show();a(this).html("<div class='"+D.getGuiStyles.call(d,"subgrid.buttonDiv","sgbutton-div")+"'><a role='button' class='"+D.getGuiStyles.call(d,"subgrid.button","sgbutton")+"'><span class='"+m("minusicon")+"'></span></a></div>").removeClass("sgcollapsed").addClass("sgexpanded");e.subGridOptions.selectOnExpand&&a(d).jqGrid("setSelection",
  g)}else if(a(this).hasClass("sgexpanded")){if(!vb.call(d,"beforeCollapse",h,g))return;!0===e.subGridOptions.reloadOnExpand?a(f).remove(".ui-subgrid"):a(f).hasClass("ui-subgrid")&&a(f).hide();a(this).html("<div class='"+D.getGuiStyles.call(d,"subgrid.buttonDiv","sgbutton-div")+"'><a role='button' class='"+D.getGuiStyles.call(d,"subgrid.button","sgbutton")+"'><span class='"+m("plusicon")+"'></span></a></div>").removeClass("sgexpanded").addClass("sgcollapsed");e.subGridOptions.selectOnCollapse&&a(d).jqGrid("setSelection",
  g)}return!1},x,B,v=1;if(d.grid){x=d.rows.length;void 0!==c&&0<c&&(v=c,x=c+1);for(;v<x;)B=d.rows[v],a(B).hasClass("jqgrow")&&(B=a(B.cells[b]),B.hasClass("ui-sgcollapsed")&&(e.scroll&&B.unbind("click"),B.bind("click",g))),v++;!0===e.subGridOptions.expandOnLoad&&a(d.rows).filter(".jqgrow").each(function(b,c){a(c.cells[0]).click()});d.subGridXml=function(a,b){w(a,b,r)};d.subGridJson=function(a,b){w(a,b,t)}}})},expandSubGridRow:function(a){return gb.call(this,a,"sgcollapsed")},collapseSubGridRow:function(a){return gb.call(this,
  a,"sgexpanded")},toggleSubGridRow:function(a){return gb.call(this,a,"ui-sgcollapsed")}});window.tableToGrid=function(b,c){a(b).each(function(){var b=a(this),e,f,g,h,m=[],l=[],n=[],p=[],q=[];if(!this.grid){b.width("99%");e=b.width();f=a("tr td:first-child input[type=checkbox]:first",b);g=a("tr td:first-child input[type=radio]:first",b);f=0<f.length;g=!f&&0<g.length;h=f||g;a("th",b).each(function(){0===m.length&&h?(m.push({name:"__selection__",index:"__selection__",width:0,hidden:!0}),l.push("__selection__")):
  (m.push({name:a(this).attr("id")||a.trim(a.jgrid.stripHtml(a(this).html())).split(" ").join("_"),index:a(this).attr("id")||a.trim(a.jgrid.stripHtml(a(this).html())).split(" ").join("_"),width:a(this).width()||150}),l.push(a(this).html()))});a("tbody > tr",b).each(function(){var b={},c=0;a("td",a(this)).each(function(){if(0===c&&h){var d=a("input",a(this)),e=d.attr("value");p.push(e||n.length);d.is(":checked")&&q.push(e);b[m[c].name]=d.attr("value")}else b[m[c].name]=a(this).html();c++});0<c&&n.push(b)});
  b.empty();b.jqGrid(a.extend({datatype:"local",width:e,colNames:l,colModel:m,multiselect:f},c||{}));for(e=0;e<n.length;e++)g=null,0<p.length&&(g=p[e])&&g.replace&&(g=encodeURIComponent(g).replace(/[.\-%]/g,"_")),null===g&&(g=a.jgrid.randId()),b.jqGrid("addRowData",g,n[e]);for(e=0;e<q.length;e++)b.jqGrid("setSelection",q[e])}})};var la=function(){var b=a.makeArray(arguments);b[0]="treeGrid"+b[0].charAt(0).toUpperCase()+b[0].substring(1);b.unshift("");b.unshift("");b.unshift(this.p);return u.feedback.apply(this,
  b)};u.extend({setTreeNode:function(){return this.each(function(){var b=a(this),c=this.p;if(this.grid&&c.treeGrid){var d=c.treeReader.expanded_field,e=c.treeReader.leaf_field;b.unbind("jqGridBeforeSelectRow.setTreeNode");b.bind("jqGridBeforeSelectRow.setTreeNode",function(f,g,h){if(null!=h){f=a(h.target);h=f.closest("tr.jqgrow>td");var m=h.parent(),l=function(){var a=c.data[c._index[Oa(c.idPrefix,g)]],f=a[d]?"collapse":"expand";a[e]||(D[f+"Row"].call(b,a,m),D[f+"Node"].call(b,a,m))};f.is("div.treeclick")?
  l():c.ExpandColClick&&0<h.length&&0<f.closest("span.cell-wrapper",h).length&&l();return!0}})}})},setTreeGrid:function(){return this.each(function(){var b=this.p,c,d,e,f=[],g=["leaf_field","expanded_field","loaded"];if(b.treeGrid){b.treedatatype||a.extend(this.p,{treedatatype:b.datatype});b.subGrid=!1;b.altRows=!1;b.pgbuttons=!1;b.pginput=!1;b.gridview=!0;null===b.rowTotal&&(b.rowNum=b.maxRowNum);b.rowList=[];b.treeIcons.plus="rtl"===b.direction?b.treeIcons.plusRtl:b.treeIcons.plusLtr;"nested"===b.treeGridModel?
  b.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},b.treeReader):"adjacency"===b.treeGridModel&&(b.treeReader=a.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},b.treeReader));for(d in b.colModel)if(b.colModel.hasOwnProperty(d))for(e in c=b.colModel[d].name,b.treeReader)b.treeReader.hasOwnProperty(e)&&b.treeReader[e]===
  c&&f.push(c);a.each(b.treeReader,function(c){var d=String(this);d&&-1===a.inArray(d,f)&&(0<=a.inArray(c,g)?b.additionalProperties.push({name:d,search:!1,convert:function(a){return!0===a||"true"===String(a).toLowerCase()||"1"===String(a)?!0:a}}):b.additionalProperties.push(d))})}})},expandRow:function(b){this.each(function(){var c=a(this),d=this.p;if(this.grid&&d.treeGrid){var e=d.treeReader.expanded_field,f=b[d.localReader.id];if(la.call(this,"beforeExpandRow",{rowid:f,item:b})){var g=D.getNodeChildren.call(c,
  b);a(g).each(function(){var b=d.idPrefix+qa(this,d.localReader.id);a(D.getGridRowById.call(c,b)).css("display","");this[e]&&D.expandRow.call(c,this)});la.call(this,"afterExpandRow",{rowid:f,item:b})}}})},collapseRow:function(b){this.each(function(){var c=a(this),d=this.p;if(this.grid&&d.treeGrid){var e=d.treeReader.expanded_field,f=b[d.localReader.id];if(la.call(this,"beforeCollapseRow",{rowid:f,item:b})){var g=D.getNodeChildren.call(c,b);a(g).each(function(){var b=d.idPrefix+qa(this,d.localReader.id);
  a(D.getGridRowById.call(c,b)).css("display","none");this[e]&&D.collapseRow.call(c,this)});la.call(this,"afterCollapseRow",{rowid:f,item:b})}}})},getRootNodes:function(){var b=[];this.each(function(){var c=this.p;if(this.grid&&c.treeGrid)switch(c.treeGridModel){case "nested":var d=c.treeReader.level_field;a(c.data).each(function(){parseInt(this[d],10)===parseInt(c.tree_root_level,10)&&b.push(this)});break;case "adjacency":var e=c.treeReader.parent_id_field;a(c.data).each(function(){null!==this[e]&&
  "null"!==String(this[e]).toLowerCase()||b.push(this)})}});return b},getNodeDepth:function(b){var c=null;this.each(function(){var d=this.p;if(this.grid&&d.treeGrid)switch(d.treeGridModel){case "nested":c=parseInt(b[d.treeReader.level_field],10)-parseInt(d.tree_root_level,10);break;case "adjacency":c=D.getNodeAncestors.call(a(this),b).length}});return c},getNodeParent:function(b){var c=this[0];if(!c||!c.grid||null==c.p||!c.p.treeGrid||null==b)return null;var c=c.p,d=c.treeReader,e=b[d.parent_id_field];
  if("nested"===c.treeGridModel){var f=null,g=d.left_field,h=d.right_field,m=d.level_field,l=parseInt(b[g],10),n=parseInt(b[h],10),p=parseInt(b[m],10);a(c.data).each(function(){if(parseInt(this[m],10)===p-1&&parseInt(this[g],10)<l&&parseInt(this[h],10)>n)return f=this,!1});return f}if(null===e||"null"===e)return null;b=c._index[e];return void 0!==b?c.data[b]:null},getNodeChildren:function(b){var c=[];this.each(function(){var d=this.p;if(this.grid&&d.treeGrid)switch(d.treeGridModel){case "nested":var e=
  d.treeReader.left_field,f=d.treeReader.right_field,g=d.treeReader.level_field,h=parseInt(b[e],10),m=parseInt(b[f],10),l=parseInt(b[g],10);a(d.data).each(function(){parseInt(this[g],10)===l+1&&parseInt(this[e],10)>h&&parseInt(this[f],10)<m&&c.push(this)});break;case "adjacency":var n=d.treeReader.parent_id_field,p=d.localReader.id;a(d.data).each(function(){String(this[n])===String(b[p])&&c.push(this)})}});return c},getFullTreeNode:function(b){var c=[];this.each(function(){var d=this.p,e;if(this.grid&&
  d.treeGrid)switch(d.treeGridModel){case "nested":var f=d.treeReader.left_field,g=d.treeReader.right_field,h=d.treeReader.level_field,m=parseInt(b[f],10),l=parseInt(b[g],10),n=parseInt(b[h],10);a(d.data).each(function(){parseInt(this[h],10)>=n&&parseInt(this[f],10)>=m&&parseInt(this[f],10)<=l&&c.push(this)});break;case "adjacency":if(b){c.push(b);var p=d.treeReader.parent_id_field,q=d.localReader.id;a(d.data).each(function(){var a;e=c.length;for(a=0;a<e;a++)if(c[a][q]===this[p]){c.push(this);break}})}}});
  return c},getNodeAncestors:function(b){var c=[];this.each(function(){var d=a(this),e=D.getNodeParent;if(this.grid&&this.p.treeGrid)for(var f=e.call(d,b);f;)c.push(f),f=e.call(d,f)});return c},isVisibleNode:function(b){var c=!0;this.each(function(){var d=this.p;if(this.grid&&d.treeGrid){var e=D.getNodeAncestors.call(a(this),b),f=d.treeReader.expanded_field;a(e).each(function(){c=c&&this[f];if(!c)return!1})}});return c},isNodeLoaded:function(b){var c;this.each(function(){var d=this.p;if(this.grid&&
  d.treeGrid){var e=d.treeReader.leaf_field,d=d.treeReader.loaded;c=void 0!==b?void 0!==b[d]?b[d]:b[e]||0<D.getNodeChildren.call(a(this),b).length?!0:!1:!1}});return c},expandNode:function(b){return this.each(function(){var c=this.p;if(this.grid&&c.treeGrid){var d=c.treeReader.expanded_field,e=c.treeReader.parent_id_field,f=c.treeReader.loaded,g=c.treeReader.level_field,h=c.treeReader.left_field,m=c.treeReader.right_field;if(!b[d]){var l=qa(b,c.localReader.id);if(la.call(this,"beforeExpandNode",{rowid:l,
  item:b})){var n=a("#"+c.idPrefix+G(l),this.grid.bDiv)[0],p=c._index[l];"local"===c.treedatatype||D.isNodeLoaded.call(a(this),c.data[p])?(b[d]=!0,a("div.treeclick",n).removeClass(c.treeIcons.plus+" tree-plus").addClass(c.treeIcons.commonIconClass).addClass(c.treeIcons.minus+" tree-minus")):this.grid.hDiv.loading||(b[d]=!0,a("div.treeclick",n).removeClass(c.treeIcons.plus+" tree-plus").addClass(c.treeIcons.commonIconClass).addClass(c.treeIcons.minus+" tree-minus"),c.treeANode=n.rowIndex,c.datatype=
  c.treedatatype,D.setGridParam.call(a(this),{postData:"nested"===c.treeGridModel?{nodeid:l,n_level:b[g],n_left:b[h],n_right:b[m]}:{nodeid:l,n_level:b[g],parentid:b[e]}}),a(this).trigger("reloadGrid"),b[f]=!0,D.setGridParam.call(a(this),{postData:"nested"===c.treeGridModel?{nodeid:"",n_level:"",n_left:"",n_right:""}:{nodeid:"",n_level:"",parentid:""}}));la.call(this,"afterExpandNode",{rowid:l,item:b})}}}})},collapseNode:function(b){return this.each(function(){var c=this.p;if(this.grid&&c.treeGrid){var d=
  c.treeReader.expanded_field;if(b[d]){var e=qa(b,c.localReader.id);la.call(this,"beforeCollapseNode",{rowid:e,item:b})&&(b[d]=!1,d=a("#"+c.idPrefix+G(e),this.grid.bDiv)[0],a("div.treeclick",d).removeClass(c.treeIcons.minus+" tree-minus").addClass(c.treeIcons.commonIconClass).addClass(c.treeIcons.plus+" tree-plus"),la.call(this,"afterCollapseNode",{rowid:e,item:b}))}}})},SortTree:function(b,c,d,e){return this.each(function(){var f=this,g=f.p,h=a(f);if(f.grid&&g.treeGrid){var m,l,n,p=[];m=D.getRootNodes.call(h);
  m=u.from.call(f,m);m.orderBy(b,c,d,e);var q=m.select();m=0;for(l=q.length;m<l;m++)n=q[m],p.push(n),D.collectChildrenSortTree.call(h,p,n,b,c,d,e);a.each(p,function(b){var c=qa(this,g.localReader.id);a(f.rows[b]).after(h.find(">tbody>tr#"+G(c)))})}})},collectChildrenSortTree:function(b,c,d,e,f,g){return this.each(function(){var h=a(this);if(this.grid&&this.p.treeGrid){var m,l,n;m=D.getNodeChildren.call(h,c);m=u.from.call(this,m);m.orderBy(d,e,f,g);var p=m.select();m=0;for(l=p.length;m<l;m++)n=p[m],
  b.push(n),D.collectChildrenSortTree.call(h,b,n,d,e,f,g)}})},setTreeRow:function(b,c){var d=!1;this.each(function(){this.grid&&this.p.treeGrid&&(d=D.setRowData.call(a(this),b,c))});return d},delTreeNode:function(b){return this.each(function(){var c=this.p,d,e,f,g;f=c.localReader.id;var h,m=a(this),l=c.treeReader.left_field,n=c.treeReader.right_field;if(this.grid&&c.treeGrid&&(h=c._index[b],void 0!==h)){d=parseInt(c.data[h][n],10);e=d-parseInt(c.data[h][l],10)+1;var p=D.getFullTreeNode.call(m,c.data[h]);
  if(0<p.length)for(h=0;h<p.length;h++)D.delRowData.call(m,p[h][f]);if("nested"===c.treeGridModel){f=u.from.call(this,c.data).greater(l,d,{stype:"integer"}).select();if(f.length)for(g in f)f.hasOwnProperty(g)&&(f[g][l]=parseInt(f[g][l],10)-e);f=u.from.call(this,c.data).greater(n,d,{stype:"integer"}).select();if(f.length)for(g in f)f.hasOwnProperty(g)&&(f[g][n]=parseInt(f[g][n],10)-e)}}})},addChildNode:function(b,c,d,e){var f=a(this),g=f[0],h=g.p,m=D.getInd;if(d){var l,n,p,q,r;l=0;var t=c,w,y,x=h.treeReader.expanded_field;
  y=h.treeReader.leaf_field;var B=h.treeReader.level_field,v=h.treeReader.parent_id_field,E=h.treeReader.left_field,A=h.treeReader.right_field,F=h.treeReader.loaded;void 0===e&&(e=!1);if(null==b){r=h.data.length-1;if(0<=r)for(;0<=r;)l=Math.max(l,parseInt(h.data[r][h.localReader.id],10)),r--;b=l+1}var k=m.call(f,c);w=!1;if(void 0===c||null===c||""===c)t=c=null,l="last",q=h.tree_root_level,r=h.data.length+1;else{l="after";n=h._index[c];p=h.data[n];c=p[h.localReader.id];r=m.call(f,c);q=parseInt(p[B],10)+
  1;var C=D.getFullTreeNode.call(f,p);if(C.length){var G,I,H;for(G=0;G<C.length;G++)H=C[G][h.localReader.id],I=m.call(f,H),I>r&&(r=I,t=H)}r++;p[y]&&(w=!0,p[x]=!0,a(g.rows[k]).find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper").end().find("div.tree-leaf").removeClass(h.treeIcons.leaf+" tree-leaf").addClass(h.treeIcons.commonIconClass).addClass(h.treeIcons.minus+" tree-minus"),h.data[n][y]=!1,p[F]=!0)}m=r+1;void 0===d[x]&&(d[x]=!1);void 0===d[F]&&(d[F]=!1);d[B]=q;void 0===
  d[y]&&(d[y]=!0);"adjacency"===h.treeGridModel&&(d[v]=c);if("nested"===h.treeGridModel){var J;if(null!==c){y=parseInt(p[A],10);h=u.from.call(g,h.data);h=h.greaterOrEquals(A,y,{stype:"integer"});B=h.select();if(B.length)for(J in B)B.hasOwnProperty(J)&&(B[J][E]=B[J][E]>y?parseInt(B[J][E],10)+2:B[J][E],B[J][A]=B[J][A]>=y?parseInt(B[J][A],10)+2:B[J][A]);d[E]=y;d[A]=y+1}else{y=parseInt(D.getCol.call(f,A,!1,"max"),10);B=u.from.call(g,h.data).greater(E,y,{stype:"integer"}).select();if(B.length)for(J in B)B.hasOwnProperty(J)&&
  (B[J][E]=parseInt(B[J][E],10)+2);B=u.from.call(g,h.data).greater(A,y,{stype:"integer"}).select();if(B.length)for(J in B)B.hasOwnProperty(J)&&(B[J][A]=parseInt(B[J][A],10)+2);d[E]=y+1;d[A]=y+2}}if(null===c||D.isNodeLoaded.call(f,p)||w)D.addRowData.call(f,b,d,l,t),D.setTreeNode.call(f,r,m);p&&!p[x]&&e&&a(g.rows[k]).find("div.treeclick").click()}}});var sa="mousedown",ya="mousemove",ta="mouseup",wb=function(a){var c=a.originalEvent.targetTouches;return c?(c=c[0],{x:c.pageX,y:c.pageY}):{x:a.pageX,y:a.pageY}},
  Ma={drag:function(a){var c=a.data,d=c.e,e=c.dnr,f=c.ar,c=c.dnrAr;a=wb(a);"move"===e.k?d.css({left:e.X+a.x-e.pX,top:e.Y+a.y-e.pY}):(d.css({width:Math.max(a.x-e.pX+e.W,0),height:Math.max(a.y-e.pY+e.H,0)}),c&&f.css({width:Math.max(a.x-c.pX+c.W,0),height:Math.max(a.y-c.pY+c.H,0)}));return!1},stop:function(){a(document).unbind(ya,Ma.drag).unbind(ta,Ma.stop)}},xb=function(b,c,d,e){return b.each(function(){c=c?a(c,b):b;c.bind(sa,{e:b,k:d},function(b){var c=b.data,d={},m,l,n=function(a,b){return parseInt(a.css(b),
  10)||!1},p=wb(b);if(!a(b.target).hasClass("ui-jqdialog-titlebar-close")&&!a(b.target).parent().hasClass("ui-jqdialog-titlebar-close")){b=c.e;l=e?a(e):!1;if("relative"!==b.css("position"))try{b.position(d)}catch(q){}m={X:d.left||n(b,"left")||0,Y:d.top||n(b,"top")||0,W:n(b,"width")||b[0].scrollWidth||0,H:n(b,"height")||b[0].scrollHeight||0,pX:p.x,pY:p.y,k:c.k};d=l&&"move"!==c.k?{X:d.left||n(l,"left")||0,Y:d.top||n(l,"top")||0,W:l[0].offsetWidth||n(l,"width")||0,H:l[0].offsetHeight||n(l,"height")||0,
  pX:p.x,pY:p.y,k:c.k}:!1;c=b.find("input.hasDatepicker");if(0<c.length)try{c.datepicker("hide")}catch(q){}b={e:b,dnr:m,ar:l,dnrAr:d};a(document).bind(ya,b,Ma.drag);a(document).bind(ta,b,Ma.stop);return!1}})})};window.PointerEvent?(sa+=".jqGrid pointerdown.jqGrid",ya+=".jqGrid pointermove.jqGrid",ta+=".jqGrid pointerup.jqGrid"):window.MSPointerEvent?(sa+=".jqGrid mspointerdown.jqGrid",ya+=".jqGrid mspointermove.jqGrid",ta+=".jqGrid mspointerup"):(sa+=".jqGrid touchstart.jqGrid",ya+=".jqGrid touchmove.jqGrid",
  ta+=".jqGrid touchend.jqGrid");a.jqDnR=Ma;a.fn.jqDrag=function(a){return xb(this,a,"move")};a.fn.jqResize=function(a,c){return xb(this,a,"resize",c)};var Ua=0,ia,ua=[],mb=function(b){try{a(":input:visible",b.w).first().focus()}catch(c){}},Hb=function(b){var c=ia[ua[ua.length-1]],d=!a(b.target).parents(".jqmID"+c.s)[0],e=a(b.target).offset(),f=void 0!==b.pageX?b.pageX:e.left,g=void 0!==b.pageY?b.pageY:e.top,e=function(){var b=!1;a(".jqmID"+c.s).each(function(){var c=a(this),d=c.offset();if(d.top<=
  g&&g<=d.top+c.height()&&d.left<=f&&f<=d.left+c.width())return b=!0,!1});return b};if("mousedown"!==b.type&&e())return!0;"mousedown"===b.type&&d&&(e()&&(d=!1),d&&!a(b.target).is(":input")&&mb(c));return!d},yb=function(b){a(document)[b]("keypress keydown mousedown",Hb)},zb=function(b,c,d){return b.each(function(){var b=this._jqm;a(c).each(function(){this[d]||(this[d]=[],a(this).click(function(){var a,b,c,d=["jqmShow","jqmHide"];for(a=0;a<d.length;a++)for(c in b=d[a],this[b])if(this[b].hasOwnProperty(c)&&
  ia[this[b][c]])ia[this[b][c]].w[b](this);return!1}));this[d].push(b)})})};a.fn.jqm=function(b){var c={overlay:50,closeoverlay:!1,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:!1,ajaxText:"",target:!1,modal:!1,toTop:!1,onShow:!1,onHide:!1,onLoad:!1};return this.each(function(){if(this._jqm)return ia[this._jqm].c=a.extend({},ia[this._jqm].c,b),ia[this._jqm].c;Ua++;this._jqm=Ua;ia[Ua]={c:a.extend(c,a.jqm.params,b),a:!1,w:a(this).addClass("jqmID"+Ua),s:Ua};c.trigger&&a(this).jqmAddTrigger(c.trigger)})};
  a.fn.jqmAddClose=function(a){return zb(this,a,"jqmHide")};a.fn.jqmAddTrigger=function(a){return zb(this,a,"jqmShow")};a.fn.jqmShow=function(b){return this.each(function(){a.jqm.open(this._jqm,b)})};a.fn.jqmHide=function(b){return this.each(function(){a.jqm.close(this._jqm,b)})};a.jqm={hash:{},open:function(b,c){var d=ia[b],e,f,g=d.c;e=d.w.parent().offset();var h,m="."+g.closeClass;f=parseInt(d.w.css("z-index"),10);f=0<f?f:3E3;e=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,
  top:0,"z-index":f-1,opacity:g.overlay/100});if(d.a)return!1;d.t=c;d.a=!0;d.w.css("z-index",f);a(d.w[0].ownerDocument).data("ui-dialog-overlays")&&d.w.addClass("ui-dialog");g.modal?(ua[0]||setTimeout(function(){yb("bind")},1),ua.push(b)):0<g.overlay?g.closeoverlay&&d.w.jqmAddClose(e):e=!1;d.o=e?e.addClass(g.overlayClass).prependTo("body"):!1;g.ajax?(e=g.target||d.w,f=g.ajax,e="string"===typeof e?a(e,d.w):a(e),f="@"===f.substr(0,1)?a(c).attr(f.substring(1)):f,e.html(g.ajaxText).load(f,function(){g.onLoad&&
  g.onLoad.call(this,d);m&&d.w.jqmAddClose(a(m,d.w));mb(d)})):m&&d.w.jqmAddClose(a(m,d.w));g.toTop&&d.o&&(e=d.w.parent().offset(),f=parseFloat(d.w.css("left")||0),h=parseFloat(d.w.css("top")||0),d.w.before('<span id="jqmP'+d.w[0]._jqm+'"></span>').insertAfter(d.o),d.w.css({top:e.top+h,left:e.left+f}));if(g.onShow)g.onShow(d);else d.w.show();mb(d);return!1},close:function(b){b=ia[b];if(!b.a)return!1;b.a=!1;ua[0]&&(ua.pop(),ua[0]||yb("unbind"));b.c.toTop&&b.o&&a("#jqmP"+b.w[0]._jqm).after(b.w).remove();
  if(b.c.onHide)b.c.onHide(b);else b.w.hide(),b.o&&b.o.remove();return!1},params:{}};ia=a.jqm.hash;a.fmatter=a.fmatter||{};var T=a.fmatter,Na=function(a,c){var d=a.formatoptions||{};return d.hasOwnProperty(c)?d[c]:(a.editoptions||{})[c]},Za=function(a){var c=a.colModel||a.cm,d,e=!1!==c.title?" title='"+(a.colName||c.name)+"'":"";a=Na(c,"checkedClass");d=Na(c,"uncheckedClass");var f=Na(c,"value"),g="string"===typeof f?f.split(":")[0]||"Yes":"Yes",f="string"===typeof f?f.split(":")[1]||"No":"No",h=function(a){return"<i class='"+
  a+"'"+e+"></i>"},c=Na(c,"disabled");void 0===c&&(c=u.formatter.checkbox.disabled);!0===c&&D.isInCommonIconClass.call(this,"fa")?(a=a||"fa fa-check-square-o fa-lg",c=h(a),d=h(d||"fa fa-square-o fa-lg")):!0===c&&D.isInCommonIconClass.call(this,"glyphicon")?(a=a||"glyphicon glyphicon-check",c=h(a),d=h(d||"glyphicon glyphicon-unchecked")):(a="",e+=!0===c?" disabled='disabled'":"",c="<input type='checkbox' checked='checked'"+e+" />",d="<input type='checkbox'"+e+" />");return{checkedClasses:a,checked:c,
  unchecked:d,yes:g,no:f}},Ab=Object.create(null,{1:{value:1},x:{value:1},"true":{value:1},yes:{value:1},on:{value:1}}),Ib=Object.create(null,{0:{value:1},"false":{value:1},no:{value:1},off:{value:1}});a.extend(!0,u,{formatter:{date:{parseRe:/[#%\\\/:_;.,\t\s\-]/,masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO"},reformatAfterEdit:!0,userLocalTime:!1},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:!0},idName:"id"},
  cmTemplate:{integerStr:{formatter:"integer",align:"right",sorttype:"integer",searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},integer:{formatter:"integer",align:"right",sorttype:"integer",convertOnSave:function(a){a=a.newValue;return isNaN(a)?a:parseInt(a,10)},searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},numberStr:{formatter:"number",align:"right",sorttype:"number",searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},number:{formatter:"number",align:"right",sorttype:"number",convertOnSave:function(a){a=
  a.newValue;return isNaN(a)?a:parseFloat(a)},searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},booleanCheckbox:{align:"center",formatter:"checkbox",edittype:"checkbox",editoptions:{value:"true:false",defaultValue:"false"},convertOnSave:function(a){var c=a.newValue;a=Za.call(this,a);var d=String(c).toLowerCase();if(Ab[d]||d===a.yes.toLowerCase())c=!0;else if(Ib[d]||d===a.no.toLowerCase())c=!1;return c},stype:"select",searchoptions:{sopt:["eq","ne"],value:":Any;true:Yes;false:No"}},actions:function(){return{formatter:"actions",
  width:(null!=this.p&&(D.isInCommonIconClass.call(this,"fa")||D.isInCommonIconClass.call(this,"glyphicon"))?a(this).jqGrid("isBootstrapGuiStyle")?45:39:40)+(u.cellWidth()?5:0),align:"center",label:"",autoResizable:!1,frozen:!0,fixed:!0,hidedlg:!0,resizable:!1,sortable:!1,search:!1,editable:!1,viewable:!1}}}});u.cmTemplate.booleanCheckboxFa=u.cmTemplate.booleanCheckbox;a.extend(T,{isObject:function(b){return b&&("object"===typeof b||a.isFunction(b))||!1},isNumber:function(a){return"number"===typeof a&&
  isFinite(a)},isValue:function(a){return this.isObject(a)||"string"===typeof a||this.isNumber(a)||"boolean"===typeof a},isEmpty:function(b){if("string"!==typeof b&&this.isValue(b))return!1;if(!this.isValue(b))return!0;b=a.trim(b).replace(/&nbsp;/ig,"").replace(/&#160;/ig,"");return""===b},NumberFormat:function(a,c){var d=T.isNumber;d(a)||(a*=1);if(d(a)){var e=0>a,f=String(a),g=c.decimalSeparator||".";if(d(c.decimalPlaces)){var h=c.decimalPlaces,f=Math.pow(10,h),f=String(Math.round(a*f)/f),d=f.lastIndexOf(".");
  if(0<h)for(0>d?(f+=g,d=f.length-1):"."!==g&&(f=f.replace(".",g));f.length-1-d<h;)f+="0"}if(c.thousandsSeparator){var h=c.thousandsSeparator,d=f.lastIndexOf(g),d=-1<d?d:f.length,g=void 0===c.decimalSeparator?"":f.substring(d),m=-1,l;for(l=d;0<l;l--)m++,0===m%3&&l!==d&&(!e||1<l)&&(g=h+g),g=f.charAt(l-1)+g;f=g}return f}return a}});var N=function(b,c,d,e,f){var g=c;d=a.extend({},ma.call(a(this),"formatter"),d);try{g=a.fn.fmatter[b].call(this,c,d,e,f)}catch(h){}return g};a.fn.fmatter=N;N.getCellBuilder=
  function(b,c,d){b=null!=a.fn.fmatter[b]?a.fn.fmatter[b].getCellBuilder:null;return a.isFunction(b)?b.call(this,a.extend({},ma.call(a(this),"formatter"),c),d):null};N.defaultFormat=function(a,c){return T.isValue(a)&&""!==a?a:c.defaultValue||"&#160;"};var na=N.defaultFormat,Bb=function(a,c,d){if(void 0===a||T.isEmpty(a))a=Na(d,"defaultValue");a=String(a).toLowerCase();return Ab[a]||a===c.yes.toLowerCase()?c.checked:c.unchecked};N.email=function(a,c){return T.isEmpty(a)?na(a,c):"<a href='mailto:"+a+
  "'>"+a+"</a>"};N.checkbox=function(a,c){var d=Za.call(this,c);return Bb(a,d,c.colModel)};N.checkbox.getCellBuilder=function(a){var c,d=a.colModel;a.colName=a.colName||this.p.colNames[a.pos];c=Za.call(this,a);return function(a){return Bb(a,c,d)}};N.checkbox.unformat=function(b,c,d){b=Za.call(this,c);d=a(d);return(b.checkedClasses?u.hasAllClasses(d.children("i"),b.checkedClasses):d.children("input").is(":checked"))?b.yes:b.no};N.checkboxFontAwesome4=N.checkbox;N.checkboxFontAwesome4.getCellBuilder=
  N.checkbox.getCellBuilder;N.checkboxFontAwesome4.unformat=N.checkbox.unformat;N.link=function(b,c){var d=c.colModel,e="",f={target:c.target};null!=d&&(f=a.extend({},f,d.formatoptions||{}));f.target&&(e="target="+f.target);return T.isEmpty(b)?na(b,f):"<a "+e+" href='"+b+"'>"+b+"</a>"};N.showlink=function(b,c,d){var e=this,f=c.colModel,g={baseLinkUrl:c.baseLinkUrl,showAction:c.showAction,addParam:c.addParam||"",target:c.target,idName:c.idName,hrefDefaultValue:"#"},h="",m,l,n=function(f){return a.isFunction(f)?
  f.call(e,{cellValue:b,rowid:c.rowId,rowData:d,options:g}):f||""};null!=f&&(g=a.extend({},g,f.formatoptions||{}));g.target&&(h="target="+n(g.target));f=n(g.baseLinkUrl)+n(g.showAction);m=g.idName?encodeURIComponent(n(g.idName))+"="+encodeURIComponent(n(g.rowId)||c.rowId):"";l=n(g.addParam);"object"===typeof l&&null!==l&&(l=(""!==m?"&":"")+a.param(l));f+=m||l?"?"+m+l:"";""===f&&(f=n(g.hrefDefaultValue));return"string"===typeof b||T.isNumber(b)||a.isFunction(g.cellValue)?"<a "+h+" href='"+f+"'>"+(a.isFunction(g.cellValue)?
  n(g.cellValue):b)+"</a>":na(b,g)};N.showlink.getCellBuilder=function(b){var c={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,addParam:b.addParam||"",target:b.target,idName:b.idName,hrefDefaultValue:"#"};b=b.colModel;null!=b&&(c=a.extend({},c,b.formatoptions||{}));return function(b,e,f){var g=this,h=e.rowId,m="",l,n,p=function(e){return a.isFunction(e)?e.call(g,{cellValue:b,rowid:h,rowData:f,options:c}):e||""};c.target&&(m="target="+p(c.target));l=p(c.baseLinkUrl)+p(c.showAction);e=c.idName?encodeURIComponent(p(c.idName))+
  "="+encodeURIComponent(p(h)||e.rowId):"";n=p(c.addParam);"object"===typeof n&&null!==n&&(n=(""!==e?"&":"")+a.param(n));l+=e||n?"?"+e+n:"";""===l&&(l=p(c.hrefDefaultValue));return"string"===typeof b||T.isNumber(b)||a.isFunction(c.cellValue)?"<a "+m+" href='"+l+"'>"+(a.isFunction(c.cellValue)?p(c.cellValue):b)+"</a>":na(b,c)}};N.showlink.pageFinalization=function(b){var c=a(this),d=this.p,e=d.colModel[b],f,g=this.rows,h=g.length,m,l=function(d){var f=a(this).closest(".jqgrow");if(0<f.length)return e.formatoptions.onClick.call(c[0],
  {iCol:b,iRow:f[0].rowIndex,rowid:f.attr("id"),cm:e,cmName:e.name,cellValue:a(this).text(),a:this,event:d})};if(null!=e.formatoptions&&a.isFunction(e.formatoptions.onClick))for(f=0;f<h;f++)m=g[f],a(m).hasClass("jqgrow")&&(m=m.cells[b],e.autoResizable&&null!=m&&a(m.firstChild).hasClass(d.autoResizing.wrapperClassName)&&(m=m.firstChild),null!=m&&a(m.firstChild).bind("click",l))};var Va=function(a,c){a=c.prefix?c.prefix+a:a;return c.suffix?a+c.suffix:a},nb=function(b,c,d){var e=c.colModel;c=a.extend({},
  c[d]);null!=e&&(c=a.extend({},c,e.formatoptions||{}));return T.isEmpty(b)?Va(c.defaultValue,c):Va(T.NumberFormat(b,c),c)};N.integer=function(a,c){return nb(a,c,"integer")};N.number=function(a,c){return nb(a,c,"number")};N.currency=function(a,c){return nb(a,c,"currency")};var ob=function(b,c){var d=b.colModel,e=a.extend({},b[c]);null!=d&&(e=a.extend({},e,d.formatoptions||{}));var f=T.NumberFormat,g=e.defaultValue?Va(e.defaultValue,e):"";return function(a){return T.isEmpty(a)?g:Va(f(a,e),e)}};N.integer.getCellBuilder=
  function(a){return ob(a,"integer")};N.number.getCellBuilder=function(a){return ob(a,"number")};N.currency.getCellBuilder=function(a){return ob(a,"currency")};N.date=function(b,c,d,e){d=c.colModel;c=a.extend({},c.date);null!=d&&(c=a.extend({},c,d.formatoptions||{}));return c.reformatAfterEdit||"edit"!==e?T.isEmpty(b)?na(b,c):u.parseDate.call(this,c.srcformat,b,c.newformat,c):na(b,c)};N.date.getCellBuilder=function(b,c){var d=a.extend({},b.date);null!=b.colModel&&(d=a.extend({},d,b.colModel.formatoptions||
  {}));var e=u.parseDate,f=d.srcformat,g=d.newformat;return d.reformatAfterEdit||"edit"!==c?function(a){return T.isEmpty(a)?na(a,d):e.call(this,f,a,g,d)}:function(a){return na(a,d)}};N.select=function(b,c){var d=[],e=c.colModel,f,e=a.extend({},e.editoptions||{},e.formatoptions||{}),g=e.value,h=e.separator||":",m=e.delimiter||";";if(g){var l=!0===e.multiple?!0:!1,n=[],p=function(a,b){if(0<b)return a};l&&(n=a.map(String(b).split(","),function(b){return a.trim(b)}));if("string"===typeof g){var q=g.split(m),
  r,t;for(r=0;r<q.length;r++)if(m=q[r].split(h),2<m.length&&(m[1]=a.map(m,p).join(h)),t=a.trim(m[0]),e.defaultValue===t&&(f=m[1]),l)-1<a.inArray(t,n)&&d.push(m[1]);else if(t===a.trim(b)){d=[m[1]];break}}else T.isObject(g)&&(f=g[e.defaultValue],d=l?a.map(n,function(a){return g[a]}):[void 0===g[b]?"":g[b]])}b=d.join(", ");return""!==b?b:void 0!==e.defaultValue?f:na(b,e)};N.select.getCellBuilder=function(b){b=b.colModel;var c=N.defaultFormat,d=a.extend({},b.editoptions||{},b.formatoptions||{}),e=d.value;
  b=d.separator||":";var f=d.delimiter||";",g,h=void 0!==d.defaultValue,m=!0===d.multiple?!0:!1,l,n={},p=function(a,b){if(0<b)return a};if("string"===typeof e)for(e=e.split(f),f=e.length,l=f-1;0<=l;l--)f=e[l].split(b),2<f.length&&(f[1]=a.map(f,p).join(b)),n[a.trim(f[0])]=f[1];else if(T.isObject(e))n=e;else return function(a){return a?String(a):c(a,d)};h&&(g=n[d.defaultValue]);return m?function(b){var e=[],f,l=a.map(String(b).split(","),function(b){return a.trim(b)});for(f=0;f<l.length;f++)b=l[f],n.hasOwnProperty(b)&&
  e.push(n[b]);b=e.join(", ");return""!==b?b:h?g:c(b,d)}:function(a){var b=n[String(a)];return""!==b&&void 0!==b?b:h?g:c(a,d)}};N.rowactions=function(b,c){var d=a(this).closest("tr.jqgrow"),e=d.attr("id"),f=a(this).closest("table.ui-jqgrid-btable").attr("id").replace(/_frozen([^_]*)$/,"$1"),g=a("#"+u.jqID(f)),f=g[0],h=f.p,m,l;m=function(){var b=d[0],c=g.closest(".ui-jqgrid")[0];return null!=b.getBoundingClientRect&&null!=c.getBoundingClientRect?b.getBoundingClientRect().top+d.outerHeight()-c.getBoundingClientRect().top:
  d.offset().top+d.outerHeight()-a(c).offset().top};var n=h.colModel[u.getCellIndex(this)],n=a.extend(!0,{extraparam:{}},u.actionsNav||{},h.actionsNavOptions||{},n.formatoptions||{});void 0!==h.editOptions&&(n.editOptions=a.extend(!0,n.editOptions||{},h.editOptions));void 0!==h.delOptions&&(n.delOptions=h.delOptions);d.hasClass("jqgrid-new-row")&&(n.extraparam[h.prmNames.oper]=h.prmNames.addoper);l={keys:n.keys,oneditfunc:n.onEdit,successfunc:n.onSuccess,url:n.url,extraparam:n.extraparam,aftersavefunc:n.afterSave,
  errorfunc:n.onError,afterrestorefunc:n.afterRestore,restoreAfterError:n.restoreAfterError,mtype:n.mtype};!h.multiselect&&e!==h.selrow||h.multiselect&&0>a.inArray(e,h.selarrrow)?g.jqGrid("setSelection",e,!0,b):u.fullBoolFeedback.call(f,"onSelectRow","jqGridSelectRow",e,!0,b);switch(c){case "edit":g.jqGrid("editRow",e,l);break;case "save":g.jqGrid("saveRow",e,l);break;case "cancel":g.jqGrid("restoreRow",e,n.afterRestore);break;case "del":n.delOptions=n.delOptions||{};void 0===n.delOptions.top&&(n.delOptions.top=
  m());g.jqGrid("delGridRow",e,n.delOptions);break;case "formedit":n.editOptions=n.editOptions||{};void 0===n.editOptions.top&&(n.editOptions.top=m(),n.editOptions.recreateForm=!0);g.jqGrid("editGridRow",e,n.editOptions);break;default:if(null!=n.custom&&0<n.custom.length)for(m=n.custom.length,h=0;h<m;h++)l=n.custom[h],l.action===c&&a.isFunction(l.onClick)&&l.onClick.call(f,{rowid:e,event:b,action:c,options:l})}b.stopPropagation&&b.stopPropagation();return!1};N.actions=function(b,c,d,e){b=c.rowId;var f=
  "",g=this.p,h=a(this),m={},l=ma.call(h,"edit")||{},g=a.extend({editbutton:!0,delbutton:!0,editformbutton:!1,commonIconClass:"ui-icon",editicon:"ui-icon-pencil",delicon:"ui-icon-trash",saveicon:"ui-icon-disk",cancelicon:"ui-icon-cancel",savetitle:l.bSubmit||"",canceltitle:l.bCancel||""},ma.call(h,"nav")||{},u.nav||{},g.navOptions||{},ma.call(h,"actionsNav")||{},u.actionsNav||{},g.actionsNavOptions||{},c.colModel.formatoptions||{}),l=h.jqGrid("getGuiStyles","states.hover"),l="onmouseover=\"jQuery(this).addClass('"+
  l+"');\" onmouseout=\"jQuery(this).removeClass('"+l+"');\"",n=[{action:"edit",actionName:"formedit",display:g.editformbutton},{action:"edit",display:!g.editformbutton&&g.editbutton},{action:"del",idPrefix:"Delete",display:g.delbutton},{action:"save",display:g.editformbutton||g.editbutton,hidden:!0},{action:"cancel",display:g.editformbutton||g.editbutton,hidden:!0}],p=null!=g.custom?g.custom.length-1:-1;if(void 0===b||T.isEmpty(b))return"";if(a.isFunction(g.isDisplayButtons))try{m=g.isDisplayButtons.call(this,
  c,d,e)||{}}catch(t){}for(;0<=p;)c=g.custom[p--],n["first"===c.position?"unshift":"push"](c);c=0;for(p=n.length;c<p;c++)if(d=a.extend({},n[c],m[n[c].action]||{}),!1!==d.display){e=d.action;var q=d.actionName||e,r=void 0!==d.idPrefix?d.idPrefix:e.charAt(0).toUpperCase()+e.substring(1);d="<div title='"+g[e+"title"]+(d.hidden?"' style='display:none;":"")+"' class='"+h.jqGrid("getGuiStyles","actionsButton","ui-pg-div ui-inline-"+e)+"' "+(null!==r?"id='j"+r+"Button_"+b:"")+"' onclick=\"return jQuery.fn.fmatter.rowactions.call(this,event,'"+
  q+"');\" "+(d.noHovering?"":l)+"><span class='"+u.mergeCssClasses(g.commonIconClass,g[e+"icon"])+"'></span></div>";f+=d}return"<div class='"+h.jqGrid("getGuiStyles","actionsDiv","ui-jqgrid-actions")+"'>"+f+"</div>"};N.actions.pageFinalization=function(b){var c=a(this),d=this.p,e=d.colModel,f=e[b],g=function(g,h){var m=0,q,r;q=e.length;for(r=0;r<q&&!0===e[r].frozen;r++)m=r;q=c.jqGrid("getGridRowById",h);null!=q&&null!=q.cells&&(b=d.iColByName[f.name],r=a(q.cells[b]).children(".ui-jqgrid-actions"),
  f.frozen&&d.frozenColumns&&b<=m&&(r=r.add(a(c[0].grid.fbRows[q.rowIndex].cells[b]).children(".ui-jqgrid-actions"))),g?(r.find(">.ui-inline-edit,>.ui-inline-del").show(),r.find(">.ui-inline-save,>.ui-inline-cancel").hide()):(r.find(">.ui-inline-edit,>.ui-inline-del").hide(),r.find(">.ui-inline-save,>.ui-inline-cancel").show()))},h=function(a,b){g(!0,b);return!1},m=function(a,b){g(!1,b);return!1};null!=f.formatoptions&&f.formatoptions.editformbutton||(c.unbind("jqGridInlineAfterRestoreRow.jqGridFormatter jqGridInlineAfterSaveRow.jqGridFormatter",
  h),c.bind("jqGridInlineAfterRestoreRow.jqGridFormatter jqGridInlineAfterSaveRow.jqGridFormatter",h),c.unbind("jqGridInlineEditRow.jqGridFormatter",m),c.bind("jqGridInlineEditRow.jqGridFormatter",m))};a.unformat=function(b,c,d,e){var f,g=c.colModel,h=g.formatter,m=this.p,l=g.formatoptions||{},n=g.unformat||N[h]&&N[h].unformat;b instanceof jQuery&&0<b.length&&(b=b[0]);m.treeGrid&&null!=b&&a(b.firstChild).hasClass("tree-wrap")&&(a(b.lastChild).hasClass("cell-wrapper")||a(b.lastChild).hasClass("cell-wrapperleaf"))&&
  (b=b.lastChild);g.autoResizable&&null!=b&&a(b.firstChild).hasClass(m.autoResizing.wrapperClassName)&&(b=b.firstChild);if(void 0!==n&&a.isFunction(n))f=n.call(this,a(b).text(),c,b);else if(void 0!==h&&"string"===typeof h){var p=a(this),q=function(a,b){return void 0!==l[b]?l[b]:ma.call(p,"formatter."+a+"."+b)},g=function(a,b){var c=q(a,"thousandsSeparator").replace(/([\.\*\_\'\(\)\{\}\+\?\\])/g,"\\$1");return b.replace(new RegExp(c,"g"),"")};switch(h){case "integer":f=g("integer",a(b).text());break;
  case "number":f=g("number",a(b).text()).replace(q("number","decimalSeparator"),".");break;case "currency":f=a(b).text();c=q("currency","prefix");d=q("currency","suffix");c&&c.length&&(f=f.substr(c.length));d&&d.length&&(f=f.substr(0,f.length-d.length));f=g("number",f).replace(q("number","decimalSeparator"),".");break;case "checkbox":f=N.checkbox.unformat(b,c,b);break;case "select":f=a.unformat.select(b,c,d,e);break;case "actions":return"";default:f=a(b).text()}}return f=void 0!==f?f:!0===e?a(b).text():
  u.htmlDecode(a(b).html())};a.unformat.select=function(b,c,d,e){d=[];b=a(b).text();c=c.colModel;if(!0===e)return b;c=a.extend({},c.editoptions||{},c.formatoptions||{});e=void 0===c.separator?":":c.separator;var f=void 0===c.delimiter?";":c.delimiter;if(c.value){var g=c.value;c=!0===c.multiple?!0:!1;var h=[],m=function(a,b){if(0<b)return a};c&&(h=b.split(","),h=a.map(h,function(b){return a.trim(b)}));if("string"===typeof g){var l=g.split(f),n=0,p;for(p=0;p<l.length;p++)if(f=l[p].split(e),2<f.length&&
  (f[1]=a.map(f,m).join(e)),c)-1<a.inArray(a.trim(f[1]),h)&&(d[n]=f[0],n++);else if(a.trim(f[1])===a.trim(b)){d[0]=f[0];break}}else if(T.isObject(g)||a.isArray(g))c||(h[0]=b),d=a.map(h,function(b){var c;a.each(g,function(a,d){if(d===b)return c=a,!1});if(void 0!==c)return c});return d.join(", ")}return b||""};a.unformat.date=function(b,c){var d=a.extend(!0,{},ma.call(a(this),"formatter.date"),u.formatter.date||{},c.formatoptions||{});return T.isEmpty(b)?"":u.parseDate.call(this,d.newformat,b,d.srcformat,
  d)}});
  //# sourceMappingURL=jquery.jqgrid.min.map
  