unified-node-open-mining-portal
Version:
An extremely efficient, highly scalable, all-in-one, easy to setup cryptocurrency mining pool
2 lines • 268 kB
JavaScript
/*! SmartAdmin - v1.5 - 2014-09-27 */function tableToGrid(a,b){jQuery(a).each(function(){if(!this.grid){jQuery(this).width("99%");var a=jQuery(this).width(),c=jQuery("tr td:first-child input[type=checkbox]:first",jQuery(this)),d=jQuery("tr td:first-child input[type=radio]:first",jQuery(this)),c=0<c.length,d=!c&&0<d.length,e=c||d,f=[],g=[];jQuery("th",jQuery(this)).each(function(){0===f.length&&e?(f.push({"name":"__selection__","index":"__selection__","width":0,"hidden":!0}),g.push("__selection__")):(f.push({"name":jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),"index":jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),"width":jQuery(this).width()||150}),g.push(jQuery(this).html()))});var h=[],i=[],j=[];for(jQuery("tbody > tr",jQuery(this)).each(function(){var a={},b=0;jQuery("td",jQuery(this)).each(function(){if(0===b&&e){var c=jQuery("input",jQuery(this)),d=c.attr("value");i.push(d||h.length),c.is(":checked")&&j.push(d),a[f[b].name]=c.attr("value")}else a[f[b].name]=jQuery(this).html();b++}),b>0&&h.push(a)}),jQuery(this).empty(),jQuery(this).addClass("scroll"),jQuery(this).jqGrid(jQuery.extend({"datatype":"local","width":a,"colNames":g,"colModel":f,"multiselect":c},b||{})),a=0;a<h.length;a++)d=null,0<i.length&&(d=i[a])&&d.replace&&(d=encodeURIComponent(d).replace(/[.\-%]/g,"_")),null===d&&(d=a+1),jQuery(this).jqGrid("addRowData",d,h[a]);for(a=0;a<j.length;a++)jQuery(this).jqGrid("setSelection",j[a])}})}!function(b){b.jgrid=b.jgrid||{},b.extend(b.jgrid,{"version":"4.5.3","htmlDecode":function(a){return a&&(" "===a||" "===a||1===a.length&&160===a.charCodeAt(0))?"":a?(""+a).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&"):a},"htmlEncode":function(a){return a?(""+a).replace(/&/g,"&").replace(/\"/g,""").replace(/</g,"<").replace(/>/g,">"):a},"format":function(a){var c=b.makeArray(arguments).slice(1);return null==a&&(a=""),a.replace(/\{(\d+)\}/g,function(a,b){return c[b]})},"msie":"Microsoft Internet Explorer"===navigator.appName,"msiever":function(){var a=-1;return null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1)),a},"getCellIndex":function(a){return a=b(a),a.is("tr")?-1:(a=(a.is("td")||a.is("th")?a:a.closest("td,th"))[0],b.jgrid.msie?b.inArray(a,a.parentNode.cells):a.cellIndex)},"stripHtml":function(a){var a=""+a,b=/<("[^"]*"|'[^']*'|[^'">])*>/gi;return a?(a=a.replace(b,""))&&" "!==a&&" "!==a?a.replace(/\"/g,"'"):"":a},"stripPref":function(a,c){var d=b.type(a);return("string"===d||"number"===d)&&(a=""+a,c=""!==a?(""+c).replace(""+a,""):c),c},"parse":function(d){return"while(1);"===d.substr(0,9)&&(d=d.substr(9)),"/*"===d.substr(0,2)&&(d=d.substr(2,d.length-4)),d||(d="{}"),!0===b.jgrid.useJSON&&"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(d):eval("("+d+")")},"parseDate":function(a,c,d,e){var f,g,h=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,i="string"==typeof c?c.match(h):null,h=function(a,b){for(a=""+a,b=parseInt(b,10)||2;a.length<b;)a="0"+a;return a},j={"m":1,"d":1,"y":1970,"h":0,"i":0,"s":0,"u":0},k=0,k=function(a,b){return 0===a?12===b&&(b=0):12!==b&&(b+=12),b};if(void 0===e&&(e=b.jgrid.formatter.date),void 0===e.parseRe&&(e.parseRe=/[Tt\\\/:_;.,\t\s-]/),e.masks.hasOwnProperty(a)&&(a=e.masks[a]),c&&null!=c)if(isNaN(c-0)||"u"!==(""+a).toLowerCase())if(c.constructor===Date)k=c;else if(null!==i)k=new Date(parseInt(i[1],10)),i[3]&&(a=60*Number(i[5])+Number(i[6]),a*="-"===i[4]?1:-1,a-=k.getTimezoneOffset(),k.setTime(Number(Number(k)+6e4*a)));else{for(c=(""+c).replace(/\\T/g,"T").replace(/\\t/,"t").split(e.parseRe),a=a.replace(/\\T/g,"T").replace(/\\t/,"t").split(e.parseRe),f=0,g=a.length;g>f;f++)"M"===a[f]&&(i=b.inArray(c[f],e.monthNames),-1!==i&&12>i&&(c[f]=i+1,j.m=c[f])),"F"===a[f]&&(i=b.inArray(c[f],e.monthNames,12),-1!==i&&i>11&&(c[f]=i+1-12,j.m=c[f])),"a"===a[f]&&(i=b.inArray(c[f],e.AmPm),-1!==i&&2>i&&c[f]===e.AmPm[i]&&(c[f]=i,j.h=k(c[f],j.h))),"A"===a[f]&&(i=b.inArray(c[f],e.AmPm),-1!==i&&i>1&&c[f]===e.AmPm[i]&&(c[f]=i-2,j.h=k(c[f],j.h))),"g"===a[f]&&(j.h=parseInt(c[f],10)),void 0!==c[f]&&(j[a[f].toLowerCase()]=parseInt(c[f],10));if(j.f&&(j.m=j.f),0===j.m&&0===j.y&&0===j.d)return" ";j.m=parseInt(j.m,10)-1,k=j.y,k>=70&&99>=k?j.y=1900+j.y:k>=0&&69>=k&&(j.y=2e3+j.y),k=new Date(j.y,j.m,j.d,j.h,j.i,j.s,j.u)}else k=new Date(1e3*parseFloat(c));else k=new Date(j.y,j.m,j.d,j.h,j.i,j.s,j.u);if(void 0===d)return k;e.masks.hasOwnProperty(d)?d=e.masks[d]:d||(d="Y-m-d"),a=k.getHours(),c=k.getMinutes(),j=k.getDate(),i=k.getMonth()+1,f=k.getTimezoneOffset(),g=k.getSeconds();var l=k.getMilliseconds(),m=k.getDay(),n=k.getFullYear(),o=(m+6)%7+1,p=(new Date(n,i-1,j)-new Date(n,0,1))/864e5,q={"d":h(j),"D":e.dayNames[m],"j":j,"l":e.dayNames[m+7],"N":o,"S":e.S(j),"w":m,"z":p,"W":5>o?Math.floor((p+o-1)/7)+1:Math.floor((p+o-1)/7)||(4>(new Date(n-1,0,1).getDay()+6)%7?53:52),"F":e.monthNames[i-1+12],"m":h(i),"M":e.monthNames[i-1],"n":i,"t":"?","L":"?","o":"?","Y":n,"y":(""+n).substring(2),"a":12>a?e.AmPm[0]:e.AmPm[1],"A":12>a?e.AmPm[2]:e.AmPm[3],"B":"?","g":a%12||12,"G":a,"h":h(a%12||12),"H":h(a),"i":h(c),"s":h(g),"u":l,"e":"?","I":"?","O":(f>0?"-":"+")+h(100*Math.floor(Math.abs(f)/60)+Math.abs(f)%60,4),"P":"?","T":((""+k).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(k/1e3)};return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(a){return q.hasOwnProperty(a)?q[a]:a.substring(1)})},"jqID":function(a){return(""+a).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g,"\\$&")},"guid":1,"uidPref":"jqg","randId":function(a){return(a||b.jgrid.uidPref)+b.jgrid.guid++},"getAccessor":function(a,b){var c,d,e,f=[];if("function"==typeof b)return b(a);if(c=a[b],void 0===c)try{if("string"==typeof b&&(f=b.split(".")),e=f.length)for(c=a;c&&e--;)d=f.shift(),c=c[d]}catch(g){}return c},"getXmlData":function(a,c,d){var e="string"==typeof c?c.match(/^(.*)\[(\w+)\]$/):null;return"function"==typeof c?c(a):e&&e[2]?e[1]?b(e[1],a).attr(e[2]):b(a).attr(e[2]):(a=b(c,a),d?a:0<a.length?b(a).text():void 0)},"cellWidth":function(){var a=b("<div class='ui-jqgrid' style='left:10000px'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;display:block;'></td></tr></table></div>"),c=a.appendTo("body").find("td").width();return a.remove(),.1<Math.abs(c-5)},"cell_width":!0,"ajaxOptions":{},"from":function(d){return new function(d,c){"string"==typeof d&&(d=b.data(d));var e=this,a=d,i=!0,f=!1,h=c,j=/[\$,%]/g,k=null,m=null,n=0,l=!1,r="",u=[],E=!0;if("object"!=typeof d||!d.push)throw"data provides is not an array";return 0<d.length&&(E="object"!=typeof d[0]?!1:!0),this._hasData=function(){return null===a?!1:0===a.length?!1:!0},this._getStr=function(a){var b=[];return f&&b.push("jQuery.trim("),b.push("String("+a+")"),f&&b.push(")"),i||b.push(".toLowerCase()"),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(a){return f&&(a=b.trim(a)),a=a.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"'),i?a:a.toLowerCase()},this._funcLoop=function(c){var d=[];return b.each(a,function(a,b){d.push(c(b))}),d},this._append=function(a){var b;for(h=null===h?"":h+(""===r?" && ":r),b=0;n>b;b++)h+="(";l&&(h+="!"),h+="("+a+")",l=!1,r="",n=0},this._setCommand=function(a,b){k=a,m=b},this._resetNegate=function(){l=!1},this._repeatCommand=function(a,b){return null===k?e:null!==a&&null!==b?k(a,b):null!==m&&E?k(m,a):k(a)},this._equals=function(a,b){return 0===e._compare(a,b,1)},this._compare=function(a,b,c){var d=Object.prototype.toString;return void 0===c&&(c=1),void 0===a&&(a=null),void 0===b&&(b=null),null===a&&null===b?0:null===a&&null!==b?1:null!==a&&null===b?-1:"[object Date]"===d.call(a)&&"[object Date]"===d.call(b)?b>a?-c:a>b?c:0:(!i&&"number"!=typeof a&&"number"!=typeof b&&(a=""+a,b=""+b),b>a?-c:a>b?c:0)},this._performSort=function(){0!==u.length&&(a=e._doSort(a,0))},this._doSort=function(a,b){var c=u[b].by,d=u[b].dir,f=u[b].type,g=u[b].datefmt;if(b===u.length-1)return e._getOrder(a,c,d,f,g);b++;for(var h,c=e._getGroup(a,c,d,f,g),d=[],f=0;f<c.length;f++)for(h=e._doSort(c[f].items,b),g=0;g<h.length;g++)d.push(h[g]);return d},this._getOrder=function(a,c,d,f,g){var h,k,l=[],m=[],n="a"===d?1:-1;void 0===f&&(f="text"),k="float"===f||"number"===f||"currency"===f||"numeric"===f?function(a){return a=parseFloat((""+a).replace(j,"")),isNaN(a)?0:a}:"int"===f||"integer"===f?function(a){return a?parseFloat((""+a).replace(j,"")):0}:"date"===f||"datetime"===f?function(a){return b.jgrid.parseDate(g,a).getTime()}:b.isFunction(f)?f:function(a){return a=a?b.trim(""+a):"",i?a:a.toLowerCase()},b.each(a,function(a,d){h=""!==c?b.jgrid.getAccessor(d,c):d,void 0===h&&(h=""),h=k(h,d),m.push({"vSort":h,"index":a})}),m.sort(function(a,b){return a=a.vSort,b=b.vSort,e._compare(a,b,n)});for(var f=0,o=a.length;o>f;)d=m[f].index,l.push(a[d]),f++;return l},this._getGroup=function(a,c,d,f,g){var h,i=[],j=null,k=null;return b.each(e._getOrder(a,c,d,f,g),function(a,d){h=b.jgrid.getAccessor(d,c),null==h&&(h=""),e._equals(k,h)||(k=h,null!==j&&i.push(j),j=e._group(c,h)),j.items.push(d)}),null!==j&&i.push(j),i},this.ignoreCase=function(){return i=!1,e},this.useCase=function(){return i=!0,e},this.trim=function(){return f=!0,e},this.noTrim=function(){return f=!1,e},this.execute=function(){var d=h,c=[];return null===d?e:(b.each(a,function(){eval(d)&&c.push(this)}),a=c,e)},this.data=function(){return a},this.select=function(c){if(e._performSort(),!e._hasData())return[];if(e.execute(),b.isFunction(c)){var d=[];return b.each(a,function(a,b){d.push(c(b))}),d}return a},this.hasMatch=function(){return e._hasData()?(e.execute(),0<a.length):!1},this.andNot=function(a,b,c){return l=!l,e.and(a,b,c)},this.orNot=function(a,b,c){return l=!l,e.or(a,b,c)},this.not=function(a,b,c){return e.andNot(a,b,c)},this.and=function(a,b,c){return r=" && ",void 0===a?e:e._repeatCommand(a,b,c)},this.or=function(a,b,c){return r=" || ",void 0===a?e:e._repeatCommand(a,b,c)},this.orBegin=function(){return n++,e},this.orEnd=function(){return null!==h&&(h+=")"),e},this.isNot=function(a){return l=!l,e.is(a)},this.is=function(a){return e._append("this."+a),e._resetNegate(),e},this._compareValues=function(a,c,d,f,g){var h;h=E?"jQuery.jgrid.getAccessor(this,'"+c+"')":"this",void 0===d&&(d=null);var i=d,k=void 0===g.stype?"text":g.stype;if(null!==d)switch(k){case"int":case"integer":i=isNaN(Number(i))||""===i?"0":i,h="parseInt("+h+",10)",i="parseInt("+i+",10)";break;case"float":case"number":case"numeric":i=(""+i).replace(j,""),i=isNaN(Number(i))||""===i?"0":i,h="parseFloat("+h+")",i="parseFloat("+i+")";break;case"date":case"datetime":i=""+b.jgrid.parseDate(g.newfmt||"Y-m-d",i).getTime(),h='jQuery.jgrid.parseDate("'+g.srcfmt+'",'+h+").getTime()";break;default:h=e._getStr(h),i=e._getStr('"'+e._toStr(i)+'"')}return e._append(h+" "+f+" "+i),e._setCommand(a,c),e._resetNegate(),e},this.equals=function(a,b,c){return e._compareValues(e.equals,a,b,"==",c)},this.notEquals=function(a,b,c){return e._compareValues(e.equals,a,b,"!==",c)},this.isNull=function(a,b,c){return e._compareValues(e.equals,a,null,"===",c)},this.greater=function(a,b,c){return e._compareValues(e.greater,a,b,">",c)},this.less=function(a,b,c){return e._compareValues(e.less,a,b,"<",c)},this.greaterOrEquals=function(a,b,c){return e._compareValues(e.greaterOrEquals,a,b,">=",c)},this.lessOrEquals=function(a,b,c){return e._compareValues(e.lessOrEquals,a,b,"<=",c)},this.startsWith=function(a,c){var d=null==c?a:c,d=f?b.trim(d.toString()).length:d.toString().length;return E?e._append(e._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+".substr(0,"+d+") == "+e._getStr('"'+e._toStr(c)+'"')):(d=f?b.trim(c.toString()).length:c.toString().length,e._append(e._getStr("this")+".substr(0,"+d+") == "+e._getStr('"'+e._toStr(a)+'"'))),e._setCommand(e.startsWith,a),e._resetNegate(),e},this.endsWith=function(a,c){var d=null==c?a:c,d=f?b.trim(d.toString()).length:d.toString().length;return e._append(E?e._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+".substr("+e._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+".length-"+d+","+d+') == "'+e._toStr(c)+'"':e._getStr("this")+".substr("+e._getStr("this")+'.length-"'+e._toStr(a)+'".length,"'+e._toStr(a)+'".length) == "'+e._toStr(a)+'"'),e._setCommand(e.endsWith,a),e._resetNegate(),e},this.contains=function(a,b){return e._append(E?e._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+'.indexOf("'+e._toStr(b)+'",0) > -1':e._getStr("this")+'.indexOf("'+e._toStr(a)+'",0) > -1'),e._setCommand(e.contains,a),e._resetNegate(),e},this.groupBy=function(b,c,d,f){return e._hasData()?e._getGroup(a,b,c,d,f):null},this.orderBy=function(a,c,d,f){return c=null==c?"a":b.trim(c.toString().toLowerCase()),null==d&&(d="text"),null==f&&(f="Y-m-d"),("desc"===c||"descending"===c)&&(c="d"),("asc"===c||"ascending"===c)&&(c="a"),u.push({"by":a,"dir":c,"type":d,"datefmt":f}),e},e}(d,null)},"getMethod":function(a){return this.getAccessor(b.fn.jqGrid,a)},"extend":function(a){b.extend(b.fn.jqGrid,a),this.no_legacy_api||b.fn.extend(a)}}),b.fn.jqGrid=function(a){if("string"==typeof a){var c=b.jgrid.getMethod(a);if(!c)throw"jqGrid - No such method: "+a;var d=b.makeArray(arguments).slice(1);return c.apply(this,d)}return this.each(function(){if(!this.grid){var c=b.extend(!0,{"url":"","height":150,"page":1,"rowNum":20,"rowTotal":null,"records":0,"pager":"","pgbuttons":!0,"pginput":!0,"colModel":[],"rowList":[],"colNames":[],"sortorder":"asc","sortname":"","datatype":"xml","mtype":"GET","altRows":!1,"selarrrow":[],"savedRow":[],"shrinkToFit":!0,"xmlReader":{},"jsonReader":{},"subGrid":!1,"subGridModel":[],"reccount":0,"lastpage":0,"lastsort":0,"selrow":null,"beforeSelectRow":null,"onSelectRow":null,"onSortCol":null,"ondblClickRow":null,"onRightClickRow":null,"onPaging":null,"onSelectAll":null,"onInitGrid":null,"loadComplete":null,"gridComplete":null,"loadError":null,"loadBeforeSend":null,"afterInsertRow":null,"beforeRequest":null,"beforeProcessing":null,"onHeaderClick":null,"viewrecords":!1,"loadonce":!1,"multiselect":!1,"multikey":!1,"editurl":null,"search":!1,"caption":"","hidegrid":!0,"hiddengrid":!1,"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,"cellsubmit":"remote","nv":0,"loadui":"enable","toolbar":[!1,""],"scroll":!1,"multiboxonly":!1,"deselectAfterSort":!0,"scrollrows":!1,"autowidth":!1,"scrollOffset":18,"cellLayout":5,"subGridWidth":20,"multiselectWidth":20,"gridview":!1,"rownumWidth":25,"rownumbers":!1,"pagerpos":"center","recordpos":"right","footerrow":!1,"userDataOnFooter":!1,"hoverrows":!0,"altclass":"ui-priority-secondary","viewsortcols":[!1,"vertical",!0],"resizeclass":"","autoencode":!1,"remapColumns":[],"ajaxGridOptions":{},"direction":"ltr","toppager":!1,"headertitles":!1,"scrollTimeout":40,"data":[],"_index":{},"grouping":!1,"groupingView":{"groupField":[],"groupOrder":[],"groupText":[],"groupColumnShow":[],"groupSummary":[],"showSummaryOnHide":!1,"sortitems":[],"sortnames":[],"summary":[],"summaryval":[],"plusicon":"ui-icon-circlesmall-plus","minusicon":"ui-icon-circlesmall-minus","displayField":[]},"ignoreCase":!1,"cmTemplate":{},"idPrefix":"","multiSort":!1},b.jgrid.defaults,a||{}),d=this,e={"headers":[],"cols":[],"footers":[],"dragStart":function(a,e,f){this.resizing={"idx":a,"startX":e.clientX,"sOL":e.clientX-6},this.hDiv.style.cursor="col-resize",this.curGbox=b("#rs_m"+b.jgrid.jqID(c.id),"#gbox_"+b.jgrid.jqID(c.id)),this.curGbox.css({"display":"block","left":e.clientX-6,"top":f[1],"height":f[2]}),b(d).triggerHandler("jqGridResizeStart",[e,a]),b.isFunction(c.resizeStart)&&c.resizeStart.call(d,e,a),document.onselectstart=function(){return!1}},"dragMove":function(a){if(this.resizing){var b,d=a.clientX-this.resizing.startX,a=this.headers[this.resizing.idx],e="ltr"===c.direction?a.width+d:a.width-d;e>33&&(this.curGbox.css({"left":this.resizing.sOL+d}),!0===c.forceFit?(b=this.headers[this.resizing.idx+c.nv],d="ltr"===c.direction?b.width-d:b.width+d,d>33&&(a.newWidth=e,b.newWidth=d)):(this.newWidth="ltr"===c.direction?c.tblwidth+d:c.tblwidth-d,a.newWidth=e))}},"dragEnd":function(){if(this.hDiv.style.cursor="default",this.resizing){var a=this.resizing.idx,e=this.headers[a].newWidth||this.headers[a].width,e=parseInt(e,10);this.resizing=!1,b("#rs_m"+b.jgrid.jqID(c.id)).css("display","none"),c.colModel[a].width=e,this.headers[a].width=e,this.headers[a].el.style.width=e+"px",this.cols[a].style.width=e+"px",0<this.footers.length&&(this.footers[a].style.width=e+"px"),!0===c.forceFit?(e=this.headers[a+c.nv].newWidth||this.headers[a+c.nv].width,this.headers[a+c.nv].width=e,this.headers[a+c.nv].el.style.width=e+"px",this.cols[a+c.nv].style.width=e+"px",0<this.footers.length&&(this.footers[a+c.nv].style.width=e+"px"),c.colModel[a+c.nv].width=e):(c.tblwidth=this.newWidth||c.tblwidth,b("table:first",this.bDiv).css("width",c.tblwidth+"px"),b("table:first",this.hDiv).css("width",c.tblwidth+"px"),this.hDiv.scrollLeft=this.bDiv.scrollLeft,c.footerrow&&(b("table:first",this.sDiv).css("width",c.tblwidth+"px"),this.sDiv.scrollLeft=this.bDiv.scrollLeft)),b(d).triggerHandler("jqGridResizeStop",[e,a]),b.isFunction(c.resizeStop)&&c.resizeStop.call(d,e,a)}this.curGbox=null,document.onselectstart=function(){return!0}},"populateVisible":function(){e.timer&&clearTimeout(e.timer),e.timer=null;var a=b(e.bDiv).height();if(a){var d,f,g=b("table:first",e.bDiv);if(g[0].rows.length)try{f=(d=g[0].rows[1])?b(d).outerHeight()||e.prevRowHeight:e.prevRowHeight}catch(h){f=e.prevRowHeight}if(f){e.prevRowHeight=f;var i=c.rowNum;d=e.scrollTop=e.bDiv.scrollTop;var j=Math.round(g.position().top)-d,k=j+g.height();f*=i;var l,m,n;a>k&&0>=j&&(void 0===c.lastpage||parseInt((k+d+f-1)/f,10)<=c.lastpage)&&(m=parseInt((a-k+f-1)/f,10),k>=0||2>m||!0===c.scroll?(l=Math.round((k+d)/f)+1,j=-1):j=1),j>0&&(l=parseInt(d/f,10)+1,m=parseInt((d+a)/f,10)+2-l,n=!0),!m||c.lastpage&&(l>c.lastpage||1===c.lastpage||l===c.page&&l===c.lastpage)||(e.hDiv.loading?e.timer=setTimeout(e.populateVisible,c.scrollTimeout):(c.page=l,n&&(e.selectionPreserver(g[0]),e.emptyRows.call(g[0],!1,!1)),e.populate(m)))}}},"scrollGrid":function(a){if(c.scroll){var b=e.bDiv.scrollTop;void 0===e.scrollTop&&(e.scrollTop=0),b!==e.scrollTop&&(e.scrollTop=b,e.timer&&clearTimeout(e.timer),e.timer=setTimeout(e.populateVisible,c.scrollTimeout))}e.hDiv.scrollLeft=e.bDiv.scrollLeft,c.footerrow&&(e.sDiv.scrollLeft=e.bDiv.scrollLeft),a&&a.stopPropagation()},"selectionPreserver":function(a){var c=a.p,d=c.selrow,e=c.selarrrow?b.makeArray(c.selarrrow):null,f=a.grid.bDiv.scrollLeft,g=function(){var h;if(c.selrow=null,c.selarrrow=[],c.multiselect&&e&&0<e.length)for(h=0;h<e.length;h++)e[h]!==d&&b(a).jqGrid("setSelection",e[h],!1,null);d&&b(a).jqGrid("setSelection",d,!1,null),a.grid.bDiv.scrollLeft=f,b(a).unbind(".selectionPreserver",g)};b(a).bind("jqGridGridComplete.selectionPreserver",g)}};if("TABLE"!==this.tagName.toUpperCase())alert("Element is not a table");else if(void 0!==document.documentMode&&5>=document.documentMode)alert("Grid can not be used in this ('quirks') mode!");else{b(this).empty().attr("tabindex","0"),this.p=c,this.p.useProp=!!b.fn.prop;var f,g;if(0===this.p.colNames.length)for(f=0;f<this.p.colModel.length;f++)this.p.colNames[f]=this.p.colModel[f].label||this.p.colModel[f].name;if(this.p.colNames.length!==this.p.colModel.length)alert(b.jgrid.errors.model);else{var h=b("<div class='ui-jqgrid-view'></div>"),i=b.jgrid.msie;d.p.direction=b.trim(d.p.direction.toLowerCase()),-1===b.inArray(d.p.direction,["ltr","rtl"])&&(d.p.direction="ltr"),g=d.p.direction,b(h).insertBefore(this),b(this).removeClass("scroll").appendTo(h);var j=b("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");b(j).attr({"id":"gbox_"+this.id,"dir":g}).insertBefore(h),b(h).attr("id","gview_"+this.id).appendTo(j),b("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").insertBefore(h),b("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(h),b(this).attr({"cellspacing":"0","cellpadding":"0","border":"0","role":"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var k=function(a,b){return a=parseInt(a,10),isNaN(a)?b||0:a},l=function(a,c,f,g,h,i){var j=d.p.colModel[a],k=j.align,l='style="',m=j.classes,n=j.name,o=[];return k&&(l+="text-align:"+k+";"),j.hidden===!0&&(l+="display:none;"),0===c?l+="width: "+e.headers[a].width+"px;":j.cellattr&&b.isFunction(j.cellattr)&&(a=j.cellattr.call(d,h,f,g,j,i))&&"string"==typeof a&&(a=a.replace(/style/i,"style").replace(/title/i,"title"),a.indexOf("title")>-1&&(j.title=!1),a.indexOf("class")>-1&&(m=void 0),o=a.replace("-style","-sti").split(/style/),2===o.length?(o[1]=b.trim(o[1].replace("-sti","-style").replace("=","")),(0===o[1].indexOf("'")||0===o[1].indexOf('"'))&&(o[1]=o[1].substring(1)),l+=o[1].replace(/'/gi,'"')):l+='"'),o.length||(o[0]="",l+='"'),l+=(void 0!==m?' class="'+m+'"':"")+(j.title&&f?' title="'+b.jgrid.stripHtml(f)+'"':""),l+=' aria-describedby="'+d.p.id+"_"+n+'"',l+o[0]},m=function(a){return null==a||""===a?" ":d.p.autoencode?b.jgrid.htmlEncode(a):""+a},n=function(a,c,e,f,g){var h=d.p.colModel[e];return void 0!==h.formatter?(a=""+d.p.idPrefix!=""?b.jgrid.stripPref(d.p.idPrefix,a):a,a={"rowId":a,"colModel":h,"gid":d.p.id,"pos":e},c=b.isFunction(h.formatter)?h.formatter.call(d,c,a,f,g):b.fmatter?b.fn.fmatter.call(d,h.formatter,c,a,f,g):m(c)):c=m(c),c},o=function(a,b,c,d,e,f){return b=n(a,b,c,e,"add"),'<td role="gridcell" '+l(c,d,b,e,a,f)+">"+b+"</td>"},p=function(a,b,c,e){return e='<input role="checkbox" type="checkbox" id="jqg_'+d.p.id+"_"+a+'" class="cbox" name="jqg_'+d.p.id+"_"+a+'"'+(e?'checked="checked"':"")+"/>",'<td role="gridcell" '+l(b,c,"",null,a,!0)+">"+e+"</td>"},q=function(a,b,c,d){return c=(parseInt(c,10)-1)*parseInt(d,10)+1+b,'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+l(a,b,c,null,b,!0)+">"+c+"</td>"},r=function(a){var b,c,e=[],f=0;for(c=0;c<d.p.colModel.length;c++)b=d.p.colModel[c],"cb"!==b.name&&"subgrid"!==b.name&&"rn"!==b.name&&(e[f]="local"===a?b.name:"xml"===a||"xmlstring"===a?b.xmlmap||b.name:b.jsonmap||b.name,d.p.keyIndex!==!1&&b.key===!0&&(d.p.keyName=e[f]),f++);return e},s=function(a){var c=d.p.remapColumns;return c&&c.length||(c=b.map(d.p.colModel,function(a,b){return b})),a&&(c=b.map(c,function(b){return a>b?null:b-a})),c},t=function(a,c){var d;this.p.deepempty?b(this.rows).slice(1).remove():(d=this.rows.length>0?this.rows[0]:null,b(this.firstChild).empty().append(d)),a&&this.p.scroll&&(b(this.grid.bDiv.firstChild).css({"height":"auto"}),b(this.grid.bDiv.firstChild.firstChild).css({"height":0,"display":"none"}),0!==this.grid.bDiv.scrollTop&&(this.grid.bDiv.scrollTop=0)),c===!0&&this.p.treeGrid&&(this.p.data=[],this.p._index={})},u=function(){var a,c,e,f=d.p.data.length;for(a=d.p.rownumbers===!0?1:0,c=d.p.multiselect===!0?1:0,e=d.p.subGrid===!0?1:0,a=d.p.keyIndex===!1||d.p.loadonce===!0?d.p.localReader.id:d.p.colModel[d.p.keyIndex+c+e+a].name,c=0;f>c;c++)e=b.jgrid.getAccessor(d.p.data[c],a),void 0===e&&(e=""+(c+1)),d.p._index[e]=c},v=function(a,c,e,f,g,h){var i,j="-1",k="",c=c?"display:none;":"",e="ui-widget-content jqgrow ui-row-"+d.p.direction+(e?" "+e:"")+(h?" ui-state-highlight":""),h=b(d).triggerHandler("jqGridRowAttr",[f,g,a]);if("object"!=typeof h&&(h=b.isFunction(d.p.rowattr)?d.p.rowattr.call(d,f,g,a):{}),!b.isEmptyObject(h)){h.hasOwnProperty("id")&&(a=h.id,delete h.id),h.hasOwnProperty("tabindex")&&(j=h.tabindex,delete h.tabindex),h.hasOwnProperty("style")&&(c+=h.style,delete h.style),h.hasOwnProperty("class")&&(e+=" "+h["class"],delete h["class"]);try{delete h.role}catch(l){}for(i in h)h.hasOwnProperty(i)&&(k+=" "+i+"="+h[i])}return'<tr role="row" id="'+a+'" tabindex="'+j+'" class="'+e+'"'+(""===c?"":' style="'+c+'"')+k+">"},w=function(a,c,e,f,g){var h=new Date,i="local"!==d.p.datatype&&d.p.loadonce||"xmlstring"===d.p.datatype,j=d.p.xmlReader,l="local"===d.p.datatype?"local":"xml";if(i&&(d.p.data=[],d.p._index={},d.p.localReader.id="_id_"),d.p.reccount=0,b.isXMLDoc(a)){-1!==d.p.treeANode||d.p.scroll?e=e>1?e:1:(t.call(d,!1,!0),e=1);var m,n,u,w,x,y,z,A,B,C=b(d),D=0,E=d.p.multiselect===!0?1:0,F=0,G=d.p.rownumbers===!0?1:0,H=[],I={},J=[],K=d.p.altRows===!0?d.p.altclass:"";d.p.subGrid===!0&&(F=1,w=b.jgrid.getMethod("addSubGridCell")),j.repeatitems||(H=r(l)),x=d.p.keyIndex===!1?b.isFunction(j.id)?j.id.call(d,a):j.id:d.p.keyIndex,H.length>0&&!isNaN(x)&&(x=d.p.keyName),l=-1===(""+x).indexOf("[")?H.length?function(a,c){return b(x,a).text()||c}:function(a,c){return b(j.cell,a).eq(x).text()||c}:function(a,b){return a.getAttribute(x.replace(/[\[\]]/g,""))||b},d.p.userData={},d.p.page=k(b.jgrid.getXmlData(a,j.page),d.p.page),d.p.lastpage=k(b.jgrid.getXmlData(a,j.total),1),d.p.records=k(b.jgrid.getXmlData(a,j.records)),b.isFunction(j.userdata)?d.p.userData=j.userdata.call(d,a)||{}:b.jgrid.getXmlData(a,j.userdata,!0).each(function(){d.p.userData[this.getAttribute("name")]=b(this).text()}),a=b.jgrid.getXmlData(a,j.root,!0),(a=b.jgrid.getXmlData(a,j.row,!0))||(a=[]);var L=a.length,M=0,N=[],O=parseInt(d.p.rowNum,10),P=d.p.scroll?b.jgrid.randId():1;if(L>0&&d.p.page<=0&&(d.p.page=1),a&&L){g&&(O*=g+1);var Q,g=b.isFunction(d.p.afterInsertRow),R=!1;for(d.p.grouping&&(R=d.p.groupingView.groupCollapse===!0,Q=b.jgrid.getMethod("groupingPrepare"));L>M;){z=a[M],A=l(z,P+M),A=d.p.idPrefix+A,m=0===e?0:e+1,B=(m+M)%2===1?K:"";var S=J.length;if(J.push(""),G&&J.push(q(0,M,d.p.page,d.p.rowNum)),E&&J.push(p(A,G,M,!1)),F&&J.push(w.call(C,E+G,M+e)),j.repeatitems){y||(y=s(E+F+G));var T=b.jgrid.getXmlData(z,j.cell,!0);b.each(y,function(a){var b=T[this];return b?(u=b.textContent||b.text,I[d.p.colModel[a+E+F+G].name]=u,void J.push(o(A,u,a+E+F+G,M+e,z,I))):!1})}else for(m=0;m<H.length;m++)u=b.jgrid.getXmlData(z,H[m]),I[d.p.colModel[m+E+F+G].name]=u,J.push(o(A,u,m+E+F+G,M+e,z,I));if(J[S]=v(A,R,B,I,z,!1),J.push("</tr>"),d.p.grouping&&(N=Q.call(C,J,N,I,M),J=[]),(i||d.p.treeGrid===!0)&&(I._id_=b.jgrid.stripPref(d.p.idPrefix,A),d.p.data.push(I),d.p._index[I._id_]=d.p.data.length-1),d.p.gridview===!1&&(b("tbody:first",c).append(J.join("")),C.triggerHandler("jqGridAfterInsertRow",[A,I,z]),g&&d.p.afterInsertRow.call(d,A,I,z),J=[]),I={},D++,M++,D===O)break}}if(d.p.gridview===!0&&(n=d.p.treeANode>-1?d.p.treeANode:0,d.p.grouping?(C.jqGrid("groupingRender",N,d.p.colModel.length),N=null):d.p.treeGrid===!0&&n>0?b(d.rows[n]).after(J.join("")):b("tbody:first",c).append(J.join(""))),d.p.subGrid===!0)try{C.jqGrid("addSubGrid",E+G)}catch(U){}if(d.p.totaltime=new Date-h,D>0&&0===d.p.records&&(d.p.records=L),J=null,d.p.treeGrid===!0)try{C.jqGrid("setTreeNode",n+1,D+n+1)}catch(V){}if(d.p.treeGrid||d.p.scroll||(d.grid.bDiv.scrollTop=0),d.p.reccount=D,d.p.treeANode=-1,d.p.userDataOnFooter&&C.jqGrid("footerData","set",d.p.userData,!0),i&&(d.p.records=L,d.p.lastpage=Math.ceil(L/O)),f||d.updatepager(!1,!0),i)for(;L>D;){if(z=a[D],A=l(z,D+P),A=d.p.idPrefix+A,j.repeatitems){y||(y=s(E+F+G));var W=b.jgrid.getXmlData(z,j.cell,!0);b.each(y,function(a){var b=W[this];return b?(u=b.textContent||b.text,void(I[d.p.colModel[a+E+F+G].name]=u)):!1})}else for(m=0;m<H.length;m++)u=b.jgrid.getXmlData(z,H[m]),I[d.p.colModel[m+E+F+G].name]=u;I._id_=b.jgrid.stripPref(d.p.idPrefix,A),d.p.data.push(I),d.p._index[I._id_]=d.p.data.length-1,I={},D++}}},x=function(a,c,e,f,g){var h=new Date;if(a){-1!==d.p.treeANode||d.p.scroll?e=e>1?e:1:(t.call(d,!1,!0),e=1);var i,j="local"!==d.p.datatype&&d.p.loadonce||"jsonstring"===d.p.datatype;j&&(d.p.data=[],d.p._index={},d.p.localReader.id="_id_"),d.p.reccount=0,"local"===d.p.datatype?(c=d.p.localReader,i="local"):(c=d.p.jsonReader,i="json");var l,m,n,u,w=b(d),x=0,y=[],z=d.p.multiselect?1:0,A=d.p.subGrid===!0?1:0,B=d.p.rownumbers===!0?1:0,C=s(z+A+B);i=r(i);var D,E,F,G,H,I,J={},K=[],L=d.p.altRows===!0?d.p.altclass:"";d.p.page=k(b.jgrid.getAccessor(a,c.page),d.p.page),d.p.lastpage=k(b.jgrid.getAccessor(a,c.total),1),d.p.records=k(b.jgrid.getAccessor(a,c.records)),d.p.userData=b.jgrid.getAccessor(a,c.userdata)||{},A&&(u=b.jgrid.getMethod("addSubGridCell")),F=d.p.keyIndex===!1?b.isFunction(c.id)?c.id.call(d,a):c.id:d.p.keyIndex,c.repeatitems||(y=i,y.length>0&&!isNaN(F)&&(F=d.p.keyName)),E=b.jgrid.getAccessor(a,c.root),null==E&&b.isArray(a)&&(E=a),E||(E=[]),a=E.length,m=0,a>0&&d.p.page<=0&&(d.p.page=1);var M,N=parseInt(d.p.rowNum,10),O=d.p.scroll?b.jgrid.randId():1,P=!1;g&&(N*=g+1),"local"===d.p.datatype&&!d.p.deselectAfterSort&&(P=!0);var Q,R=b.isFunction(d.p.afterInsertRow),S=[],T=!1;for(d.p.grouping&&(T=d.p.groupingView.groupCollapse===!0,Q=b.jgrid.getMethod("groupingPrepare"));a>m;){g=E[m],H=b.jgrid.getAccessor(g,F),void 0===H&&("number"==typeof F&&null!=d.p.colModel[F+z+A+B]&&(H=b.jgrid.getAccessor(g,d.p.colModel[F+z+A+B].name)),void 0===H&&(H=O+m,0===y.length&&c.cell&&(l=b.jgrid.getAccessor(g,c.cell)||g,H=null!=l&&void 0!==l[F]?l[F]:H))),H=d.p.idPrefix+H,l=1===e?0:e,I=(l+m)%2===1?L:"",P&&(M=d.p.multiselect?-1!==b.inArray(H,d.p.selarrrow):H===d.p.selrow);var U=K.length;for(K.push(""),B&&K.push(q(0,m,d.p.page,d.p.rowNum)),z&&K.push(p(H,B,m,M)),A&&K.push(u.call(w,z+B,m+e)),D=i,c.repeatitems&&(c.cell&&(g=b.jgrid.getAccessor(g,c.cell)||g),b.isArray(g)&&(D=C)),n=0;n<D.length;n++)l=b.jgrid.getAccessor(g,D[n]),J[d.p.colModel[n+z+A+B].name]=l,K.push(o(H,l,n+z+A+B,m+e,g,J));if(K[U]=v(H,T,I,J,g,M),K.push("</tr>"),d.p.grouping&&(S=Q.call(w,K,S,J,m),K=[]),(j||d.p.treeGrid===!0)&&(J._id_=b.jgrid.stripPref(d.p.idPrefix,H),d.p.data.push(J),d.p._index[J._id_]=d.p.data.length-1),d.p.gridview===!1&&(b("#"+b.jgrid.jqID(d.p.id)+" tbody:first").append(K.join("")),w.triggerHandler("jqGridAfterInsertRow",[H,J,g]),R&&d.p.afterInsertRow.call(d,H,J,g),K=[]),J={},x++,m++,x===N)break}if(d.p.gridview===!0&&(G=d.p.treeANode>-1?d.p.treeANode:0,d.p.grouping?w.jqGrid("groupingRender",S,d.p.colModel.length):d.p.treeGrid===!0&&G>0?b(d.rows[G]).after(K.join("")):b("#"+b.jgrid.jqID(d.p.id)+" tbody:first").append(K.join(""))),d.p.subGrid===!0)try{w.jqGrid("addSubGrid",z+B)}catch(V){}if(d.p.totaltime=new Date-h,x>0&&0===d.p.records&&(d.p.records=a),d.p.treeGrid===!0)try{w.jqGrid("setTreeNode",G+1,x+G+1)}catch(W){}if(d.p.treeGrid||d.p.scroll||(d.grid.bDiv.scrollTop=0),d.p.reccount=x,d.p.treeANode=-1,d.p.userDataOnFooter&&w.jqGrid("footerData","set",d.p.userData,!0),j&&(d.p.records=a,d.p.lastpage=Math.ceil(a/N)),f||d.updatepager(!1,!0),j)for(;a>x&&E[x];){if(g=E[x],H=b.jgrid.getAccessor(g,F),void 0===H&&("number"==typeof F&&null!=d.p.colModel[F+z+A+B]&&(H=b.jgrid.getAccessor(g,d.p.colModel[F+z+A+B].name)),void 0===H&&(H=O+x,0===y.length&&c.cell&&(e=b.jgrid.getAccessor(g,c.cell)||g,H=null!=e&&void 0!==e[F]?e[F]:H))),g){for(H=d.p.idPrefix+H,D=i,c.repeatitems&&(c.cell&&(g=b.jgrid.getAccessor(g,c.cell)||g),b.isArray(g)&&(D=C)),n=0;n<D.length;n++)J[d.p.colModel[n+z+A+B].name]=b.jgrid.getAccessor(g,D[n]);J._id_=b.jgrid.stripPref(d.p.idPrefix,H),d.p.data.push(J),d.p._index[J._id_]=d.p.data.length-1,J={}}x++}}},y=function(){function a(b){var c,d,e,f,g,h=0;if(null!=b.groups){for((d=b.groups.length&&"OR"===b.groupOp.toString().toUpperCase())&&q.orBegin(),c=0;c<b.groups.length;c++){h>0&&d&&q.or();try{a(b.groups[c])}catch(i){alert(i)}h++}d&&q.orEnd()}if(null!=b.rules)try{for((e=b.rules.length&&"OR"===b.groupOp.toString().toUpperCase())&&q.orBegin(),c=0;c<b.rules.length;c++)g=b.rules[c],f=b.groupOp.toString().toUpperCase(),p[g.op]&&g.field&&(h>0&&f&&"OR"===f&&(q=q.or()),q=p[g.op](q,f)(g.field,g.data,j[g.field])),h++;
e&&q.orEnd()}catch(k){alert(k)}}var c,e,f,g=d.p.multiSort?[]:"",h=[],i=!1,j={},k=[],l=[];if(b.isArray(d.p.data)){var m,n,o=d.p.grouping?d.p.groupingView:!1;if(b.each(d.p.colModel,function(){if(e=this.sorttype||"text","date"===e||"datetime"===e?(this.formatter&&"string"==typeof this.formatter&&"date"===this.formatter?(c=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat:b.jgrid.formatter.date.srcformat,f=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:b.jgrid.formatter.date.newformat):c=f=this.datefmt||"Y-m-d",j[this.name]={"stype":e,"srcfmt":c,"newfmt":f}):j[this.name]={"stype":e,"srcfmt":"","newfmt":""},d.p.grouping)for(n=0,m=o.groupField.length;m>n;n++)if(this.name===o.groupField[n]){var a=this.name;this.index&&(a=this.index),k[n]=j[a],l[n]=a}d.p.multiSort?this.lso&&(g.push(this.name),a=this.lso.split("-"),h.push(a[a.length-1])):i||this.index!==d.p.sortname&&this.name!==d.p.sortname||(g=this.name,i=!0)}),!d.p.treeGrid){var p={"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}},q=b.jgrid.from(d.p.data);if(d.p.ignoreCase&&(q=q.ignoreCase()),d.p.search===!0){var r=d.p.postData.filters;if(r)"string"==typeof r&&(r=b.jgrid.parse(r)),a(r);else try{q=p[d.p.postData.searchOper](q)(d.p.postData.searchField,d.p.postData.searchString,j[d.p.postData.searchField])}catch(s){}}if(d.p.grouping)for(n=0;m>n;n++)q.orderBy(l[n],o.groupOrder[n],k[n].stype,k[n].srcfmt);d.p.multiSort?b.each(g,function(a){q.orderBy(this,h[a],j[this].stype,j[this].srcfmt)}):g&&d.p.sortorder&&i&&("DESC"===d.p.sortorder.toUpperCase()?q.orderBy(d.p.sortname,"d",j[g].stype,j[g].srcfmt):q.orderBy(d.p.sortname,"a",j[g].stype,j[g].srcfmt));var r=q.select(),t=parseInt(d.p.rowNum,10),u=r.length,v=parseInt(d.p.page,10),w=Math.ceil(u/t),x={},r=r.slice((v-1)*t,v*t),j=q=null;return x[d.p.localReader.total]=w,x[d.p.localReader.page]=v,x[d.p.localReader.records]=u,x[d.p.localReader.root]=r,x[d.p.localReader.userdata]=d.p.userData,r=null,x}b(d).jqGrid("SortTree",g,d.p.sortorder,j[g].stype||"text",j[g].srcfmt||"")}},z=function(){if(d.grid.hDiv.loading=!0,!d.p.hiddengrid)switch(d.p.loadui){case"enable":b("#load_"+b.jgrid.jqID(d.p.id)).show();break;case"block":b("#lui_"+b.jgrid.jqID(d.p.id)).show(),b("#load_"+b.jgrid.jqID(d.p.id)).show()}},A=function(){switch(d.grid.hDiv.loading=!1,d.p.loadui){case"enable":b("#load_"+b.jgrid.jqID(d.p.id)).hide();break;case"block":b("#lui_"+b.jgrid.jqID(d.p.id)).hide(),b("#load_"+b.jgrid.jqID(d.p.id)).hide()}},B=function(a){if(!d.grid.hDiv.loading){var c,e=d.p.scroll&&a===!1,f={},g=d.p.prmNames;d.p.page<=0&&(d.p.page=Math.min(1,d.p.lastpage)),null!==g.search&&(f[g.search]=d.p.search),null!==g.nd&&(f[g.nd]=(new Date).getTime()),null!==g.rows&&(f[g.rows]=d.p.rowNum),null!==g.page&&(f[g.page]=d.p.page),null!==g.sort&&(f[g.sort]=d.p.sortname),null!==g.order&&(f[g.order]=d.p.sortorder),null!==d.p.rowTotal&&null!==g.totalrows&&(f[g.totalrows]=d.p.rowTotal);var h=b.isFunction(d.p.loadComplete),i=h?d.p.loadComplete:null,j=0,a=a||1;if(a>1?null!==g.npage?(f[g.npage]=a,j=a-1,a=1):i=function(b){d.p.page++,d.grid.hDiv.loading=!1,h&&d.p.loadComplete.call(d,b),B(a-1)}:null!==g.npage&&delete d.p.postData[g.npage],d.p.grouping){b(d).jqGrid("groupingSetup");var k,l=d.p.groupingView,m="";for(k=0;k<l.groupField.length;k++){var n=l.groupField[k];b.each(d.p.colModel,function(a,b){b.name===n&&b.index&&(n=b.index)}),m+=n+" "+l.groupOrder[k]+", "}f[g.sort]=m+f[g.sort]}b.extend(d.p.postData,f);var o=d.p.scroll?d.rows.length-1:1,f=b(d).triggerHandler("jqGridBeforeRequest");if(f!==!1&&"stop"!==f)if(b.isFunction(d.p.datatype))d.p.datatype.call(d,d.p.postData,"load_"+d.p.id,o,a,j);else{if(b.isFunction(d.p.beforeRequest)&&(f=d.p.beforeRequest.call(d),void 0===f&&(f=!0),f===!1))return;switch(c=d.p.datatype.toLowerCase()){case"json":case"jsonp":case"xml":case"script":b.ajax(b.extend({"url":d.p.url,"type":d.p.mtype,"dataType":c,"data":b.isFunction(d.p.serializeGridData)?d.p.serializeGridData.call(d,d.p.postData):d.p.postData,"success":function(f,g,h){b.isFunction(d.p.beforeProcessing)&&d.p.beforeProcessing.call(d,f,g,h)===!1?A():("xml"===c?w(f,d.grid.bDiv,o,a>1,j):x(f,d.grid.bDiv,o,a>1,j),b(d).triggerHandler("jqGridLoadComplete",[f]),i&&i.call(d,f),b(d).triggerHandler("jqGridAfterLoadComplete",[f]),e&&d.grid.populateVisible(),(d.p.loadonce||d.p.treeGrid)&&(d.p.datatype="local"),1===a&&A())},"error":function(c,e,f){b.isFunction(d.p.loadError)&&d.p.loadError.call(d,c,e,f),1===a&&A()},"beforeSend":function(a,c){var e=!0;return b.isFunction(d.p.loadBeforeSend)&&(e=d.p.loadBeforeSend.call(d,a,c)),void 0===e&&(e=!0),e===!1?!1:void z()}},b.jgrid.ajaxOptions,d.p.ajaxGridOptions));break;case"xmlstring":z(),f="string"!=typeof d.p.datastr?d.p.datastr:b.parseXML(d.p.datastr),w(f,d.grid.bDiv),b(d).triggerHandler("jqGridLoadComplete",[f]),h&&d.p.loadComplete.call(d,f),b(d).triggerHandler("jqGridAfterLoadComplete",[f]),d.p.datatype="local",d.p.datastr=null,A();break;case"jsonstring":z(),f="string"==typeof d.p.datastr?b.jgrid.parse(d.p.datastr):d.p.datastr,x(f,d.grid.bDiv),b(d).triggerHandler("jqGridLoadComplete",[f]),h&&d.p.loadComplete.call(d,f),b(d).triggerHandler("jqGridAfterLoadComplete",[f]),d.p.datatype="local",d.p.datastr=null,A();break;case"local":case"clientside":z(),d.p.datatype="local",f=y(),x(f,d.grid.bDiv,o,a>1,j),b(d).triggerHandler("jqGridLoadComplete",[f]),i&&i.call(d,f),b(d).triggerHandler("jqGridAfterLoadComplete",[f]),e&&d.grid.populateVisible(),A()}}}},C=function(a){b("#cb_"+b.jgrid.jqID(d.p.id),d.grid.hDiv)[d.p.useProp?"prop":"attr"]("checked",a),d.p.frozenColumns&&b("#cb_"+b.jgrid.jqID(d.p.id),d.grid.fhDiv)[d.p.useProp?"prop":"attr"]("checked",a)},D=function(a,c){var e,f,h,i,j="",l="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",m="",n=function(a){var c;return b.isFunction(d.p.onPaging)&&(c=d.p.onPaging.call(d,a)),"stop"===c?!1:(d.p.selrow=null,d.p.multiselect&&(d.p.selarrrow=[],C(!1)),d.p.savedRow=[],!0)},a=a.substr(1),c=c+("_"+a);if(e="pg_"+a,f=a+"_left",h=a+"_center",i=a+"_right",b("#"+b.jgrid.jqID(a)).append("<div id='"+e+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+f+"' align='left'></td><td id='"+h+"' align='center' style='white-space:pre;'></td><td id='"+i+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr"),d.p.rowList.length>0){for(m="<td dir='"+g+"'>",m+="<select class='ui-pg-selbox' role='listbox'>",f=0;f<d.p.rowList.length;f++)m+='<option role="option" value="'+d.p.rowList[f]+'"'+(d.p.rowNum===d.p.rowList[f]?' selected="selected"':"")+">"+d.p.rowList[f]+"</option>";m+="</select></td>"}"rtl"===g&&(l+=m),d.p.pginput===!0&&(j="<td dir='"+g+"'>"+b.jgrid.format(d.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1_"+b.jgrid.jqID(a)+"'></span>")+"</td>"),d.p.pgbuttons===!0?(f=["first"+c,"prev"+c,"next"+c,"last"+c],"rtl"===g&&f.reverse(),l+="<td id='"+f[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>",l+="<td id='"+f[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>",l=l+(""!==j?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+j+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":"")+("<td id='"+f[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>"),l+="<td id='"+f[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"):""!==j&&(l+=j),"ltr"===g&&(l+=m),l+="</tr></tbody></table>",d.p.viewrecords===!0&&b("td#"+a+"_"+d.p.recordpos,"#"+e).append("<div dir='"+g+"' style='text-align:"+d.p.recordpos+"' class='ui-paging-info'></div>"),b("td#"+a+"_"+d.p.pagerpos,"#"+e).append(l),m=b(".ui-jqgrid").css("font-size")||"11px",b(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+m+";visibility:hidden;' ></div>"),l=b(l).clone().appendTo("#testpg").width(),b("#testpg").remove(),l>0&&(""!==j&&(l+=50),b("td#"+a+"_"+d.p.pagerpos,"#"+e).width(l)),d.p._nvtd=[],d.p._nvtd[0]=Math.floor(l?(d.p.width-l)/2:d.p.width/3),d.p._nvtd[1]=0,l=null,b(".ui-pg-selbox","#"+e).bind("change",function(){return n("records")?(d.p.page=Math.round(d.p.rowNum*(d.p.page-1)/this.value-.5)+1,d.p.rowNum=this.value,d.p.pager&&b(".ui-pg-selbox",d.p.pager).val(this.value),d.p.toppager&&b(".ui-pg-selbox",d.p.toppager).val(this.value),B(),!1):!1}),d.p.pgbuttons===!0&&(b(".ui-pg-button","#"+e).hover(function(){b(this).hasClass("ui-state-disabled")?this.style.cursor="default":(b(this).addClass("ui-state-hover"),this.style.cursor="pointer")},function(){b(this).hasClass("ui-state-disabled")||(b(this).removeClass("ui-state-hover"),this.style.cursor="default")}),b("#first"+b.jgrid.jqID(c)+", #prev"+b.jgrid.jqID(c)+", #next"+b.jgrid.jqID(c)+", #last"+b.jgrid.jqID(c)).click(function(){var a=k(d.p.page,1),b=k(d.p.lastpage,1),e=!1,f=!0,g=!0,h=!0,i=!0;return 0===b||1===b?i=h=g=f=!1:b>1&&a>=1?1===a?g=f=!1:a===b&&(i=h=!1):b>1&&0===a&&(i=h=!1,a=b-1),n(this.id)?(this.id==="first"+c&&f&&(d.p.page=1,e=!0),this.id==="prev"+c&&g&&(d.p.page=a-1,e=!0),this.id==="next"+c&&h&&(d.p.page=a+1,e=!0),this.id==="last"+c&&i&&(d.p.page=b,e=!0),e&&B(),!1):!1})),d.p.pginput===!0&&b("input.ui-pg-input","#"+e).keypress(function(a){return 13===(a.charCode||a.keyCode||0)?n("user")?(b(this).val(k(b(this).val(),1)),d.p.page=b(this).val()>0?b(this).val():d.p.page,B(),!1):!1:this})},E=function(a,c){var e,f,g="",h=d.p.colModel,i=!1;f=d.p.frozenColumns?c:d.grid.headers[a].el;var j="";b("span.ui-grid-ico-sort",f).addClass("ui-state-disabled"),b(f).attr("aria-selected","false"),h[a].lso?"asc"===h[a].lso?(h[a].lso=h[a].lso+"-desc",j="desc"):"desc"===h[a].lso?(h[a].lso=h[a].lso+"-asc",j="asc"):("asc-desc"===h[a].lso||"desc-asc"===h[a].lso)&&(h[a].lso=""):h[a].lso=j=h[a].firstsortorder||"asc",j?(b("span.s-ico",f).show(),b("span.ui-icon-"+j,f).removeClass("ui-state-disabled"),b(f).attr("aria-selected","true")):d.p.viewsortcols[0]||b("span.s-ico",f).hide(),d.p.sortorder="",b.each(h,function(a){this.lso&&(a>0&&i&&(g+=", "),e=this.lso.split("-"),g+=h[a].index||h[a].name,g+=" "+e[e.length-1],i=!0,d.p.sortorder=e[e.length-1])}),f=g.lastIndexOf(d.p.sortorder),g=g.substring(0,f),d.p.sortname=g},F=function(a,c,e,f,g){if(d.p.colModel[c].sortable&&!(d.p.savedRow.length>0)){if(e||(d.p.lastsort===c?"asc"===d.p.sortorder?d.p.sortorder="desc":"desc"===d.p.sortorder&&(d.p.sortorder="asc"):d.p.sortorder=d.p.colModel[c].firstsortorder||"asc",d.p.page=1),d.p.multiSort)E(c,g);else{if(f){if(d.p.lastsort===c&&d.p.sortorder===f&&!e)return;d.p.sortorder=f}e=d.grid.headers[d.p.lastsort].el,g=d.p.frozenColumns?g:d.grid.headers[c].el,b("span.ui-grid-ico-sort",e).addClass("ui-state-disabled"),b(e).attr("aria-selected","false"),d.p.frozenColumns&&(d.grid.fhDiv.find("span.ui-grid-ico-sort").addClass("ui-state-disabled"),d.grid.fhDiv.find("th").attr("aria-selected","false")),b("span.ui-icon-"+d.p.sortorder,g).removeClass("ui-state-disabled"),b(g).attr("aria-selected","true"),d.p.viewsortcols[0]||d.p.lastsort===c||(d.p.frozenColumns&&d.grid.fhDiv.find("span.s-ico").hide(),b("span.s-ico",e).hide(),b("span.s-ico",g).show()),a=a.substring(5+d.p.id.length+1),d.p.sortname=d.p.colModel[c].index||a}"stop"===b(d).triggerHandler("jqGridSortCol",[d.p.sortname,c,d.p.sortorder])?d.p.lastsort=c:b.isFunction(d.p.onSortCol)&&"stop"===d.p.onSortCol.call(d,d.p.sortname,c,d.p.sortorder)?d.p.lastsort=c:("local"===d.p.datatype?d.p.deselectAfterSort&&b(d).jqGrid("resetSelection"):(d.p.selrow=null,d.p.multiselect&&C(!1),d.p.selarrrow=[],d.p.savedRow=[]),d.p.scroll&&(g=d.grid.bDiv.scrollLeft,t.call(d,!0,!1),d.grid.hDiv.scrollLeft=g),d.p.subGrid&&"local"===d.p.datatype&&b("td.sgexpanded","#"+b.jgrid.jqID(d.p.id)).each(function(){b(this).trigger("click")}),B(),d.p.lastsort=c,d.p.sortname!==a&&c&&(d.p.lastsort=c))}},G=function(a){return a=b(d.grid.headers[a].el),a=[a.position().left+a.outerWidth()],"rtl"===d.p.direction&&(a[0]=d.p.width-a[0]),a[0]=a[0]-d.grid.bDiv.scrollLeft,a.push(b(d.grid.hDiv).position().top),a.push(b(d.grid.bDiv).offset().top-b(d.grid.hDiv).offset().top+b(d.grid.bDiv).height()),a},H=function(a){var c,e=d.grid.headers,f=b.jgrid.getCellIndex(a);for(c=0;c<e.length;c++)if(a===e[c].el){f=c;break}return f};for(this.p.id=this.id,-1===b.inArray(d.p.multikey,["shiftKey","altKey","ctrlKey"])&&(d.p.multikey=!1),d.p.keyIndex=!1,d.p.keyName=!1,f=0;f<d.p.colModel.length;f++)d.p.colModel[f]=b.extend(!0,{},d.p.cmTemplate,d.p.colModel[f].template||{},d.p.colModel[f]),!1===d.p.keyIndex&&!0===d.p.colModel[f].key&&(d.p.keyIndex=f);if(d.p.sortorder=d.p.sortorder.toLowerCase(),b.jgrid.cell_width=b.jgrid.cellWidth(),!0===d.p.grouping&&(d.p.scroll=!1,d.p.rownumbers=!1,d.p.treeGrid=!1,d.p.gridview=!0),!0===this.p.treeGrid){try{b(this).jqGrid("setTreeGrid")}catch(I){}"local"!==d.p.datatype&&(d.p.localReader={"id":"_id_"})}if(this.p.subGrid)try{b(d).jqGrid("setSubGrid")}catch(J){}this.p.multiselect&&(this.p.colNames.unshift("<input role='checkbox' id='cb_"+this.p.id+"' class='cbox' type='checkbox'/>"),this.p.colModel.unshift({"name":"cb","width":b.jgrid.cell_width?d.p.multiselectWidth+d.p.cellLayout:d.p.multiselectWidth,"sortable":!1,"resizable":!1,"hidedlg":!0,"search":!1,"align":"center","fixed":!0})),this.p.rownumbers&&(this.p.colNames.unshift(""),this.p.colModel.unshift({"name":"rn","width":d.p.rownumWidth,"sortable":!1,"resizable":!1,"hidedlg":!0,"search":!1,"align":"center","fixed":!0})),d.p.xmlReader=b.extend(!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"}},d.p.xmlReader),d.p.jsonReader=b.extend(!0,{"root":"rows","page":"page","total":"total","records":"records","repeatitems":!0,"cell":"cell","id":"id","userdata":"userdata","subgrid":{"root":"rows","repeatitems":!0,"cell":"cell"}},d.p.jsonReader),d.p.localReader=b.extend(!0,{"root":"rows","page":"page","total":"total","records":"records","repeatitems":!1,"cell":"cell","id":"id","userdata":"userdata","subgrid":{"root":"rows","repeatitems":!0,"cell":"cell"}},d.p.localReader),d.p.scroll&&(d.p.pgbuttons=!1,d.p.pginput=!1,d.p.rowList=[]),d.p.data.length&&u();var K,L,M,N,O,P,Q,R,S="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",T=R="",U=[],V=[];if(L=[],!0===d.p.shrinkToFit&&!0===d.p.forceFit)for(f=d.p.colModel.length-1;f>=0;f--)if(!d.p.colModel[f].hidden){d.p.colModel[f].resizable=!1;break}if("horizontal"===d.p.viewsortcols[1]&&(R=" ui-i-asc",T=" ui-i-desc"),K=i?"class='ui-th-div-ie'":"",R="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+R+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+g+"'></span>"+("<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+T+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+g+"'></span></span>"),d.p.multiSort)for(U=d.p.sortname.split(","),f=0;f<U.length;f++)L=b.trim(U[f]).split(" "),U[f]=b.trim(L[0]),V[f]=L[1]?b.trim(L[1]):d.p.sortorder||"asc";for(f=0;f<this.p.colNames.length;f++)L=d.p.headertitles?' title="'+b.jgrid.stripHtml(d.p.colNames[f])+'"':"",S+="<th id='"+d.p.id+"_"+d.p.colModel[f].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+g+"'"+L+">",L=d.p.colModel[f].index||d.p.colModel[f].name,S+="<div id='jqgh_"+d.p.id+"_"+d.p.colModel[f].name+"' "+K+">"+d.p.colNames[f],d.p.colModel[f].width=d.p.colModel[f].width?parseInt(d.p.colModel[f].width,10):150,"boolean"!=typeof d.p.colModel[f].title&&(d.p.colModel[f].title=!0),d.p.colModel[f].lso="",L===d.p.sortname&&(d.p.lastsort=f),d.p.multiSort&&(L=b.inArray(L,U),-1!==L&&(d.p.colModel[f].lso=V[L])),S+=R+"</div></th>";if(R=null,b(this).append(S+"</tr></thead>"),b("thead tr:first th",this).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}),this.p.multiselect){var W,X=[];b("#cb_"+b.jgrid.jqID(d.p.id),this).bind("click",function(){d.p.selarrrow=[];var a=d.p.frozenColumns===!0?d.p.id+"_frozen":"";this.checked?(b(d.rows).each(function(c){c>0&&!b(this).hasClass("ui-subgrid")&&!b(this).hasClass("jqgroup")&&!b(this).hasClass("ui-state-disabled")&&(b("#jqg_"+b.jgrid.jqID(d.p.id)+"_"+b.jgrid.jqID(this.id))[d.p.useProp?"prop":"attr"]("checked",!0),b(this).addClass("ui-state-highlight").attr("aria-selected","true"),d.p.selarrrow.push(this.id),d.p.selrow=this.id,a&&(b("#jqg_"+b.jgrid.jqID(d.p.id)+"_"+b.jgrid.jqID(this.id),d.grid.fbDiv)[d.p.useProp?"prop":"attr"]("checked",!0),b("#"+b.jgrid.jqID(this.id),d.grid.fbDiv).addClass("ui-state-highlight")))}),W=!0,X=[]):(b(d.rows).each(function(c){c>0&&!b(this).hasClass("ui-subgrid")&&!b(this).hasClass("ui-state-disabled")&&(b("#jqg_"+b.jgrid.jqID(d.p.id)+"_"+b.jgrid.jqID(this.id))[d.p.useProp?"prop":"attr"]("checked",!1),b(this).removeClass("ui-state-highlight").attr("aria-selected","false"),X.pu