/* * jqGrid 4.4.4 - jQuery Grid * Copyright (c) 2008, Tony Tomov, tony@trirand.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:2013-01-30 * Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; grid.filter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.import.js; JsonXml.js; grid.tbltogrid.js; grid.jqueryui.js; */ (function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{version:"4.4.4",htmlDecode:function(b){return b&&(" "==b||" "==b||1===b.length&&160===b.charCodeAt(0))?"":!b?b:(""+b).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")},htmlEncode:function(b){return!b?b:(""+b).replace(/&/g,"&").replace(/\"/g,""").replace(//g,">")},format:function(f){var d=b.makeArray(arguments).slice(1);null==f&&(f="");return f.replace(/\{(\d+)\}/g,function(b, e){return d[e]})},msie:"Microsoft Internet Explorer"==navigator.appName,msiever:function(){var b=-1;null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(b=parseFloat(RegExp.$1));return b},getCellIndex:function(f){f=b(f);if(f.is("tr"))return-1;f=(!f.is("td")&&!f.is("th")?f.closest("td,th"):f)[0];return b.jgrid.msie?b.inArray(f,f.parentNode.cells):f.cellIndex},stripHtml:function(b){var b=""+b,d=/<("[^"]*"|'[^']*'|[^'">])*>/gi;return b?(b=b.replace(d,""))&&" "!==b&&" "!==b?b.replace(/\"/g, "'"):"":b},stripPref:function(f,d){var c=b.type(f);if("string"==c||"number"==c)f=""+f,d=""!==f?(""+d).replace(""+f,""):d;return d},stringToDoc:function(b){var d;if("string"!==typeof b)return b;try{d=(new DOMParser).parseFromString(b,"text/xml")}catch(c){d=new ActiveXObject("Microsoft.XMLDOM"),d.async=!1,d.loadXML(b)}return d&&d.documentElement&&"parsererror"!=d.documentElement.tagName?d:null},parse:function(f){"while(1);"==f.substr(0,9)&&(f=f.substr(9));"/*"==f.substr(0,2)&&(f=f.substr(2,f.length- 4));f||(f="{}");return!0===b.jgrid.useJSON&&"object"===typeof JSON&&"function"===typeof JSON.parse?JSON.parse(f):eval("("+f+")")},parseDate:function(f,d){var c={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},e,a,i;e=/[\\\/:_;.,\t\T\s-]/;if(d&&null!=d){d=b.trim(d);d=d.split(e);void 0!==b.jgrid.formatter.date.masks[f]&&(f=b.jgrid.formatter.date.masks[f]);var f=f.split(e),h=b.jgrid.formatter.date.monthNames,g=b.jgrid.formatter.date.AmPm,j=function(a,b){0===a?12===b&&(b=0):12!==b&&(b+=12);return b};e=0;for(a=f.length;e< a;e++)"M"==f[e]&&(i=b.inArray(d[e],h),-1!==i&&12>i&&(d[e]=i+1,c.m=d[e])),"F"==f[e]&&(i=b.inArray(d[e],h),-1!==i&&11i&&d[e]==g[i]&&(d[e]=i,c.h=j(d[e],c.h))),"A"==f[e]&&(i=b.inArray(d[e],g),-1!==i&&1=e?c.y=1900+c.y:0<=e&&69>=e&&(c.y=2E3+c.y);void 0!==c.j&&(c.d= c.j);void 0!==c.n&&(c.m=parseInt(c.n,10)-1)}return new Date(c.y,c.m,c.d,c.h,c.i,c.s,c.u)},jqID:function(b){return(""+b).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g,"\\$&")},guid:1,uidPref:"jqg",randId:function(f){return(f||b.jgrid.uidPref)+b.jgrid.guid++},getAccessor:function(b,d){var c,e,a=[],i;if("function"===typeof d)return d(b);c=b[d];if(void 0===c)try{if("string"===typeof d&&(a=d.split(".")),i=a.length)for(c=b;c&&i--;)e=a.shift(),c=c[e]}catch(h){}return c},getXmlData:function(f,d,c){var e= "string"===typeof d?d.match(/^(.*)\[(\w+)\]$/):null;if("function"===typeof d)return d(f);if(e&&e[2])return e[1]?b(e[1],f).attr(e[2]):b(f).attr(e[2]);f=b(d,f);return c?f:0
"),d=f.appendTo("body").find("td").width();f.remove();return 5!==d},cell_width:!0,ajaxOptions:{},from:function(f){return new function(d, c){"string"===typeof d&&(d=b.data(d));var e=this,a=d,i=!0,f=!1,g=c,j=/[\$,%]/g,k=null,l=null,n=0,s=!1,m="",v=[],E=!0;if("object"===typeof d&&d.push)0b?e:0;!i&&"number"!==typeof a&&"number"!==typeof b&&(a=""+a,b=""+b);return a< b?-e:a>b?e:0};this._performSort=function(){0!==v.length&&(a=e._doSort(a,0))};this._doSort=function(a,b){var c=v[b].by,f=v[b].dir,i=v[b].type,d=v[b].datefmt;if(b==v.length-1)return e._getOrder(a,c,f,i,d);b++;for(var c=e._getGroup(a,c,f,i,d),f=[],h,i=0;i",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;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();return e};this.endsWith=function(a,c){var d=null==c?a:c,d=f?b.trim(d.toString()).length: d.toString().length;E?e._append(e._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+".substr("+e._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+".length-"+d+","+d+') == "'+e._toStr(c)+'"'):e._append(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();return e};this.contains=function(a,b){E?e._append(e._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+'.indexOf("'+e._toStr(b)+ '",0) > -1'):e._append(e._getStr("this")+'.indexOf("'+e._toStr(a)+'",0) > -1');e._setCommand(e.contains,a);e._resetNegate();return e};this.groupBy=function(b,c,d,f){return!e._hasData()?null:e._getGroup(a,b,c,d,f)};this.orderBy=function(a,c,d,f){c=null==c?"a":b.trim(c.toString().toLowerCase());null==d&&(d="text");null==f&&(f="Y-m-d");if("desc"==c||"descending"==c)c="d";if("asc"==c||"ascending"==c)c="a";v.push({by:a,dir:c,type:d,datefmt:f});return e};return e}(f,null)},getMethod:function(f){return this.getAccessor(b.fn.jqGrid, f)},extend:function(f){b.extend(b.fn.jqGrid,f);this.no_legacy_api||b.fn.extend(f)}});b.fn.jqGrid=function(f){if("string"===typeof f){var d=b.jgrid.getMethod(f);if(!d)throw"jqGrid - No such method: "+f;var c=b.makeArray(arguments).slice(1);return d.apply(this,c)}return this.each(function(){if(!this.grid){var e=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:""},b.jgrid.defaults,f||{}),a=this,c={headers:[],cols:[],footers:[],dragStart:function(c,d,f){this.resizing={idx:c,startX:d.clientX,sOL:f[0]};this.hDiv.style.cursor="col-resize";this.curGbox=b("#rs_m"+b.jgrid.jqID(e.id),"#gbox_"+b.jgrid.jqID(e.id));this.curGbox.css({display:"block",left:f[0], top:f[1],height:f[2]});b(a).triggerHandler("jqGridResizeStart",[d,c]);b.isFunction(e.resizeStart)&&e.resizeStart.call(this,d,c);document.onselectstart=function(){return!1}},dragMove:function(a){if(this.resizing){var b=a.clientX-this.resizing.startX,a=this.headers[this.resizing.idx],c="ltr"===e.direction?a.width+b:a.width-b,d;33=j&&(void 0===e.lastpage||parseInt((k+f+L-1)/L,10)<=e.lastpage))F=parseInt((a-k+L-1)/L,10),0<=k||2>F||!0===e.scroll?(y=Math.round((k+f)/L)+1,j=-1):j=1;0e.lastpage||1==e.lastpage||y===e.page&&y===e.lastpage)))c.hDiv.loading?c.timer=setTimeout(c.populateVisible,e.scrollTimeout):(e.page=y,q&&(c.selectionPreserver(d[0]), c.emptyRows.call(d[0],!1,!1)),c.populate(F))}}},scrollGrid:function(a){if(e.scroll){var b=c.bDiv.scrollTop;void 0===c.scrollTop&&(c.scrollTop=0);b!=c.scrollTop&&(c.scrollTop=b,c.timer&&clearTimeout(c.timer),c.timer=setTimeout(c.populateVisible,e.scrollTimeout))}c.hDiv.scrollLeft=c.bDiv.scrollLeft;e.footerrow&&(c.sDiv.scrollLeft=c.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,h=function(){var g; c.selrow=null;c.selarrrow=[];if(c.multiselect&&e&&0=document.documentMode)alert("Grid can not be used in this ('quirks') mode!");else{b(this).empty().attr("tabindex", "0");this.p=e;this.p.useProp=!!b.fn.prop;var d,g;if(0===this.p.colNames.length)for(d=0;d"),k=b.jgrid.msie;a.p.direction=b.trim(a.p.direction.toLowerCase());-1==b.inArray(a.p.direction,["ltr","rtl"])&&(a.p.direction="ltr");g=a.p.direction;b(j).insertBefore(this);b(this).removeClass("scroll").appendTo(j); var l=b("
");b(l).attr({id:"gbox_"+this.id,dir:g}).insertBefore(j);b(j).attr("id","gview_"+this.id).appendTo(l);b("
").insertBefore(j);b("
"+this.p.loadtext+"
").insertBefore(j);b(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect, "aria-labelledby":"gbox_"+this.id});var n=function(a,b){a=parseInt(a,10);return isNaN(a)?b||0:a},s=function(d,e,f,h,g,j){var P=a.p.colModel[d],k=P.align,y='style="',F=P.classes,q=P.name,o=[];k&&(y=y+("text-align:"+k+";"));P.hidden===true&&(y=y+"display:none;");if(e===0)y=y+("width: "+c.headers[d].width+"px;");else if(P.cellattr&&b.isFunction(P.cellattr))if((d=P.cellattr.call(a,g,f,h,P,j))&&typeof d==="string"){d=d.replace(/style/i,"style").replace(/title/i,"title");if(d.indexOf("title")>-1)P.title= false;d.indexOf("class")>-1&&(F=void 0);o=d.split("style");if(o.length===2){o[1]=b.trim(o[1].replace("=",""));if(o[1].indexOf("'")===0||o[1].indexOf('"')===0)o[1]=o[1].substring(1);y=y+o[1].replace(/'/gi,'"')}else y=y+'"'}if(!o.length){o[0]="";y=y+'"'}y=y+((F!==void 0?' class="'+F+'"':"")+(P.title&&f?' title="'+b.jgrid.stripHtml(f)+'"':""));y=y+(' aria-describedby="'+a.p.id+"_"+q+'"');return y+o[0]},m=function(c){return c==null||c===""?" ":a.p.autoencode?b.jgrid.htmlEncode(c):""+c},v=function(c, d,e,f,h){var g=a.p.colModel[e];if(g.formatter!==void 0){c=""+a.p.idPrefix!==""?b.jgrid.stripPref(a.p.idPrefix,c):c;c={rowId:c,colModel:g,gid:a.p.id,pos:e};d=b.isFunction(g.formatter)?g.formatter.call(a,d,c,f,h):b.fmatter?b.fn.fmatter.call(a,g.formatter,d,c,f,h):m(d)}else d=m(d);return d},E=function(a,b,c,d,e,f){b=v(a,b,c,e,"add");return'"+b+""},T=function(b,c,d,e){e='";return'"+e+""},K=function(a,b,c,d){c=(parseInt(c,10)-1)*parseInt(d,10)+1+b;return'"+c+""},aa=function(b){var c,d=[],e=0,f;for(f=0;f0?this.rows[0]:null;b(this.firstChild).empty().append(d)}if(a&&this.p.scroll){b(this.grid.bDiv.firstChild).css({height:"auto"});b(this.grid.bDiv.firstChild.firstChild).css({height:0,display:"none"});if(this.grid.bDiv.scrollTop!==0)this.grid.bDiv.scrollTop= 0}if(c===true&&this.p.treeGrid){this.p.data=[];this.p._index={}}},M=function(){var c=a.p.data.length,d,e,f;d=a.p.rownumbers===true?1:0;e=a.p.multiselect===true?1:0;f=a.p.subGrid===true?1:0;d=a.p.keyIndex===false||a.p.loadonce===true?a.p.localReader.id:a.p.colModel[a.p.keyIndex+e+f+d].name;for(e=0;e"},H=function(c,d,e,f,g){var h=new Date,i=a.p.datatype!="local"&&a.p.loadonce||a.p.datatype=="xmlstring",j=a.p.xmlReader,k=a.p.datatype=="local"?"local":"xml";if(i){a.p.data=[];a.p._index={};a.p.localReader.id="_id_"}a.p.reccount=0;if(b.isXMLDoc(c)){if(a.p.treeANode===-1&&!a.p.scroll){W.call(a,false,true);e=1}else e=e>1?e:1;var F=b(a),q,o,l=0,u,C=a.p.multiselect===true?1:0,n=0,s,m=a.p.rownumbers===true?1:0,Q,p=[],x,B={},t,w,G=[],v=a.p.altRows===true?" "+a.p.altclass:"",A; if(a.p.subGrid===true){n=1;s=b.jgrid.getMethod("addSubGridCell")}j.repeatitems||(p=aa(k));Q=a.p.keyIndex===false?b.isFunction(j.id)?j.id.call(a,c):j.id:a.p.keyIndex;if(p.length>0&&!isNaN(Q)){a.p.remapColumns&&a.p.remapColumns.length&&(Q=b.inArray(Q,a.p.remapColumns));Q=p[Q]}k=(""+Q).indexOf("[")===-1?p.length?function(a,c){return b(Q,a).text()||c}:function(a,c){return b(j.cell,a).eq(Q).text()||c}:function(a,b){return a.getAttribute(Q.replace(/[\[\]]/g,""))||b};a.p.userData={};a.p.page=b.jgrid.getXmlData(c, j.page)||a.p.page||0;a.p.lastpage=b.jgrid.getXmlData(c,j.total);if(a.p.lastpage===void 0)a.p.lastpage=1;a.p.records=b.jgrid.getXmlData(c,j.records)||0;b.isFunction(j.userdata)?a.p.userData=j.userdata.call(a,c)||{}:b.jgrid.getXmlData(c,j.userdata,true).each(function(){a.p.userData[this.getAttribute("name")]=b(this).text()});c=b.jgrid.getXmlData(c,j.root,true);(c=b.jgrid.getXmlData(c,j.row,true))||(c=[]);var R=c.length,r=0,z=[],D=parseInt(a.p.rowNum,10),H=a.p.scroll?b.jgrid.randId():1;if(R>0&&a.p.page<= 0)a.p.page=1;if(c&&R){g&&(D=D*(g+1));var g=b.isFunction(a.p.afterInsertRow),J=false,I;if(a.p.grouping){J=a.p.groupingView.groupCollapse===true;I=b.jgrid.getMethod("groupingPrepare")}for(;r");if(a.p.grouping){z=I.call(F,G,z,B,r);G=[]}if(i||a.p.treeGrid===true){B._id_=w;a.p.data.push(B);a.p._index[w]=a.p.data.length-1}if(a.p.gridview===false){b("tbody:first",d).append(G.join(""));F.triggerHandler("jqGridAfterInsertRow",[w,B,t]);g&&a.p.afterInsertRow.call(a, w,B,t);G=[]}B={};l++;r++;if(l==D)break}}if(a.p.gridview===true){o=a.p.treeANode>-1?a.p.treeANode:0;if(a.p.grouping){F.jqGrid("groupingRender",z,a.p.colModel.length);z=null}else a.p.treeGrid===true&&o>0?b(a.rows[o]).after(G.join("")):b("tbody:first",d).append(G.join(""))}if(a.p.subGrid===true)try{F.jqGrid("addSubGrid",C+m)}catch(S){}a.p.totaltime=new Date-h;if(l>0&&a.p.records===0)a.p.records=R;G=null;if(a.p.treeGrid===true)try{F.jqGrid("setTreeNode",o+1,l+o+1)}catch(V){}if(!a.p.treeGrid&&!a.p.scroll)a.grid.bDiv.scrollTop= 0;a.p.reccount=l;a.p.treeANode=-1;a.p.userDataOnFooter&&F.jqGrid("footerData","set",a.p.userData,true);if(i){a.p.records=R;a.p.lastpage=Math.ceil(R/D)}f||a.updatepager(false,true);if(i)for(;l1?e:1;var h,i,j=a.p.datatype!="local"&&a.p.loadonce||a.p.datatype=="jsonstring";if(j){a.p.data=[];a.p._index={};a.p.localReader.id="_id_"}a.p.reccount=0;if(a.p.datatype=="local"){h=a.p.localReader;i="local"}else{h=a.p.jsonReader;i="json"}var k=b(a),l=0,q,o,n=[],u,C=a.p.multiselect?1:0,m=0,s,p=a.p.rownumbers===true?1:0, r,v,x={},B,t,w=[],G=a.p.altRows===true?" "+a.p.altclass:"",A;a.p.page=b.jgrid.getAccessor(c,h.page)||a.p.page||0;r=b.jgrid.getAccessor(c,h.total);if(a.p.subGrid===true){m=1;s=b.jgrid.getMethod("addSubGridCell")}a.p.lastpage=r===void 0?1:r;a.p.records=b.jgrid.getAccessor(c,h.records)||0;a.p.userData=b.jgrid.getAccessor(c,h.userdata)||{};h.repeatitems||(u=n=aa(i));i=a.p.keyIndex===false?b.isFunction(h.id)?h.id.call(a,c):h.id:a.p.keyIndex;if(n.length>0&&!isNaN(i)){a.p.remapColumns&&a.p.remapColumns.length&& (i=b.inArray(i,a.p.remapColumns));i=n[i]}(v=b.jgrid.getAccessor(c,h.root))||(v=[]);r=v.length;c=0;if(r>0&&a.p.page<=0)a.p.page=1;var z=parseInt(a.p.rowNum,10),R=a.p.scroll?b.jgrid.randId():1,D=false,H;g&&(z=z*(g+1));a.p.datatype==="local"&&!a.p.deselectAfterSort&&(D=true);var J=b.isFunction(a.p.afterInsertRow),I=[],M=false,N;if(a.p.grouping){M=a.p.groupingView.groupCollapse===true;N=b.jgrid.getMethod("groupingPrepare")}for(;c");if(a.p.grouping){I=N.call(k,w,I,x,c);w=[]}if(j||a.p.treeGrid===true){x._id_=t;a.p.data.push(x);a.p._index[t]=a.p.data.length-1}if(a.p.gridview===false){b("#"+b.jgrid.jqID(a.p.id)+" tbody:first").append(w.join(""));k.triggerHandler("jqGridAfterInsertRow",[t,x,g]);J&&a.p.afterInsertRow.call(a,t,x,g);w=[]}x={};l++;c++;if(l==z)break}if(a.p.gridview===true){B=a.p.treeANode>-1?a.p.treeANode:0;a.p.grouping?k.jqGrid("groupingRender",I,a.p.colModel.length):a.p.treeGrid===true&&B> 0?b(a.rows[B]).after(w.join("")):b("#"+b.jgrid.jqID(a.p.id)+" tbody:first").append(w.join(""))}if(a.p.subGrid===true)try{k.jqGrid("addSubGrid",C+p)}catch(S){}a.p.totaltime=new Date-d;if(l>0&&a.p.records===0)a.p.records=r;if(a.p.treeGrid===true)try{k.jqGrid("setTreeNode",B+1,l+B+1)}catch(V){}if(!a.p.treeGrid&&!a.p.scroll)a.grid.bDiv.scrollTop=0;a.p.reccount=l;a.p.treeANode=-1;a.p.userDataOnFooter&&k.jqGrid("footerData","set",a.p.userData,true);if(j){a.p.records=r;a.p.lastpage=Math.ceil(r/z)}f||a.updatepager(false, true);if(j)for(;l0&&e&&u.or();try{c(a.groups[d])}catch(j){alert(j)}b++}e&&u.orEnd()}if(a.rules!=null)try{(g=a.rules.length&&a.groupOp.toString().toUpperCase()==="OR")&&u.orBegin();for(d=0;d0&&h&&h==="OR"&&(u=u.or());u=n[i.op](u,h)(i.field,i.data,f[i.field])}b++}g&&u.orEnd()}catch(oa){alert(oa)}}var d,e=false,f={},g=[],h=[],i,j,k;if(b.isArray(a.p.data)){var l=a.p.grouping? a.p.groupingView:false,q,o;b.each(a.p.colModel,function(){j=this.sorttype||"text";if(j=="date"||j=="datetime"){if(this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"){i=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat:b.jgrid.formatter.date.srcformat;k=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:b.jgrid.formatter.date.newformat}else i=k=this.datefmt||"Y-m-d";f[this.name]={stype:j,srcfmt:i,newfmt:k}}else f[this.name]= {stype:j,srcfmt:"",newfmt:""};if(a.p.grouping){o=0;for(q=l.groupField.length;o1)if(g.npage!==null){e[g.npage]=c;j=c-1;c=1}else i=function(b){a.p.page++;a.grid.hDiv.loading=false;h&&a.p.loadComplete.call(a,b);I(c-1)};else g.npage!==null&& delete a.p.postData[g.npage];if(a.p.grouping){b(a).jqGrid("groupingSetup");var k=a.p.groupingView,l,q="";for(l=0;l1,j):V(e,a.grid.bDiv,n,c>1,j);b(a).triggerHandler("jqGridLoadComplete", [e]);i&&i.call(a,e);b(a).triggerHandler("jqGridAfterLoadComplete",[e]);d&&a.grid.populateVisible();if(a.p.loadonce||a.p.treeGrid)a.p.datatype="local";c===1&&O()}},error:function(e,d,f){b.isFunction(a.p.loadError)&&a.p.loadError.call(a,e,d,f);c===1&&O()},beforeSend:function(c,e){var d=true;b.isFunction(a.p.loadBeforeSend)&&(d=a.p.loadBeforeSend.call(a,c,e));d===void 0&&(d=true);if(d===false)return false;ba()}},b.jgrid.ajaxOptions,a.p.ajaxGridOptions));break;case "xmlstring":ba();e=b.jgrid.stringToDoc(a.p.datastr); H(e,a.grid.bDiv);b(a).triggerHandler("jqGridLoadComplete",[e]);h&&a.p.loadComplete.call(a,e);b(a).triggerHandler("jqGridAfterLoadComplete",[e]);a.p.datatype="local";a.p.datastr=null;O();break;case "jsonstring":ba();e=typeof a.p.datastr==="string"?b.jgrid.parse(a.p.datastr):a.p.datastr;V(e,a.grid.bDiv);b(a).triggerHandler("jqGridLoadComplete",[e]);h&&a.p.loadComplete.call(a,e);b(a).triggerHandler("jqGridAfterLoadComplete",[e]);a.p.datatype="local";a.p.datastr=null;O();break;case "local":case "clientside":ba(); a.p.datatype="local";e=ja();V(e,a.grid.bDiv,n,c>1,j);b(a).triggerHandler("jqGridLoadComplete",[e]);i&&i.call(a,e);b(a).triggerHandler("jqGridAfterLoadComplete",[e]);d&&a.grid.populateVisible();O()}}}},ca=function(c){b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv)[a.p.useProp?"prop":"attr"]("checked",c);if(a.p.frozenColumns&&a.p.id+"_frozen")b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.fhDiv)[a.p.useProp?"prop":"attr"]("checked",c)},ka=function(c,d){var e="",f="", h="",i,j,k,l,m=function(c){var d;b.isFunction(a.p.onPaging)&&(d=a.p.onPaging.call(a,c));a.p.selrow=null;if(a.p.multiselect){a.p.selarrrow=[];ca(false)}a.p.savedRow=[];return d=="stop"?false:true},c=c.substr(1),d=d+("_"+c);i="pg_"+c;j=c+"_left";k=c+"_center";l=c+"_right";b("#"+b.jgrid.jqID(c)).append("
").attr("dir","ltr");if(a.p.rowList.length>0){h="";h=h+""}g=="rtl"&&(f=f+h);a.p.pginput===true&&(e=""+b.jgrid.format(a.p.pgtext||"","","")+"");if(a.p.pgbuttons===true){j=["first"+d,"prev"+d,"next"+d,"last"+d];g=="rtl"&&j.reverse();f=f+("");f=f+(""); f=f+(e!==""?""+e+"":"")+("");f=f+("")}else e!==""&&(f=f+e);g=="ltr"&&(f=f+h);f=f+""; a.p.viewrecords===true&&b("td#"+c+"_"+a.p.recordpos,"#"+i).append("
");b("td#"+c+"_"+a.p.pagerpos,"#"+i).append(f);h=b(".ui-jqgrid").css("font-size")||"11px";b(document.body).append("");f=b(f).clone().appendTo("#testpg").width();b("#testpg").remove();if(f>0){e!==""&&(f=f+50);b("td#"+c+"_"+a.p.pagerpos,"#"+ i).width(f)}a.p._nvtd=[];a.p._nvtd[0]=f?Math.floor((a.p.width-f)/2):Math.floor(a.p.width/3);a.p._nvtd[1]=0;f=null;b(".ui-pg-selbox","#"+i).bind("change",function(){if(!m("records"))return false;a.p.page=Math.round(a.p.rowNum*(a.p.page-1)/this.value-0.5)+1;a.p.rowNum=this.value;a.p.pager&&b(".ui-pg-selbox",a.p.pager).val(this.value);a.p.toppager&&b(".ui-pg-selbox",a.p.toppager).val(this.value);I();return false});if(a.p.pgbuttons===true){b(".ui-pg-button","#"+i).hover(function(){if(b(this).hasClass("ui-state-disabled"))this.style.cursor= "default";else{b(this).addClass("ui-state-hover");this.style.cursor="pointer"}},function(){if(!b(this).hasClass("ui-state-disabled")){b(this).removeClass("ui-state-hover");this.style.cursor="default"}});b("#first"+b.jgrid.jqID(d)+", #prev"+b.jgrid.jqID(d)+", #next"+b.jgrid.jqID(d)+", #last"+b.jgrid.jqID(d)).click(function(){var b=n(a.p.page,1),c=n(a.p.lastpage,1),e=false,f=true,g=true,h=true,i=true;if(c===0||c===1)i=h=g=f=false;else if(c>1&&b>=1)if(b===1)g=f=false;else{if(b===c)i=h=false}else if(c> 1&&b===0){i=h=false;b=c-1}if(!m(this.id))return false;if(this.id==="first"+d&&f){a.p.page=1;e=true}if(this.id==="prev"+d&&g){a.p.page=b-1;e=true}if(this.id==="next"+d&&h){a.p.page=b+1;e=true}if(this.id==="last"+d&&i){a.p.page=c;e=true}e&&I();return false})}a.p.pginput===true&&b("input.ui-pg-input","#"+i).keypress(function(c){if((c.charCode||c.keyCode||0)==13){if(!m("user"))return false;a.p.page=b(this).val()>0?b(this).val():a.p.page;I();return false}return this})},la=function(c,d,e,f){if(a.p.colModel[d].sortable&& !(a.p.savedRow.length>0)){if(!e){if(a.p.lastsort==d)if(a.p.sortorder=="asc")a.p.sortorder="desc";else{if(a.p.sortorder=="desc")a.p.sortorder="asc"}else a.p.sortorder=a.p.colModel[d].firstsortorder||"asc";a.p.page=1}if(f){if(a.p.lastsort==d&&a.p.sortorder==f&&!e)return;a.p.sortorder=f}e=a.grid.headers[a.p.lastsort].el;f=a.grid.headers[d].el;b("span.ui-grid-ico-sort",e).addClass("ui-state-disabled");b(e).attr("aria-selected","false");b("span.ui-icon-"+a.p.sortorder,f).removeClass("ui-state-disabled"); b(f).attr("aria-selected","true");if(!a.p.viewsortcols[0]&&a.p.lastsort!=d){b("span.s-ico",e).hide();b("span.s-ico",f).show()}c=c.substring(5+a.p.id.length+1);a.p.sortname=a.p.colModel[d].index||c;e=a.p.sortorder;if(b(a).triggerHandler("jqGridSortCol",[c,d,e])==="stop")a.p.lastsort=d;else if(b.isFunction(a.p.onSortCol)&&a.p.onSortCol.call(a,c,d,e)=="stop")a.p.lastsort=d;else{if(a.p.datatype=="local")a.p.deselectAfterSort&&b(a).jqGrid("resetSelection");else{a.p.selrow=null;a.p.multiselect&&ca(false); a.p.selarrrow=[];a.p.savedRow=[]}if(a.p.scroll){e=a.grid.bDiv.scrollLeft;W.call(a,true,false);a.grid.hDiv.scrollLeft=e}a.p.subGrid&&a.p.datatype=="local"&&b("td.sgexpanded","#"+b.jgrid.jqID(a.p.id)).each(function(){b(this).trigger("click")});I();a.p.lastsort=d;if(a.p.sortname!=c&&d)a.p.lastsort=d}}},pa=function(c){var d,e=[0],f=b.jgrid.cell_width?0:a.p.cellLayout;for(d=0;d<=c;d++)a.p.colModel[d].hidden===false&&(e[0]=e[0]+(a.p.colModel[d].width+f));a.p.direction=="rtl"&&(e[0]=a.p.width-e[0]);e[0]= e[0]-a.grid.bDiv.scrollLeft;e.push(b(a.grid.hDiv).position().top);e.push(b(a.grid.bDiv).offset().top-b(a.grid.hDiv).offset().top+b(a.grid.bDiv).height());return e},ma=function(c){var d,e=a.grid.headers,f=b.jgrid.getCellIndex(c);for(d=0;d"),this.p.colModel.unshift({name:"cb",width:b.jgrid.cell_width?a.p.multiselectWidth+a.p.cellLayout:a.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:a.p.rownumWidth,sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0}));a.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"}},a.p.xmlReader);a.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"}},a.p.jsonReader);a.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"}},a.p.localReader);a.p.scroll&&(a.p.pgbuttons=!1,a.p.pginput=!1,a.p.rowList=[]);a.p.data.length&&M();var z="",na,N,da,ea,fa,A,p,Y;N=Y="";if(!0===a.p.shrinkToFit&&!0===a.p.forceFit)for(d=a.p.colModel.length-1;0<=d;d--)if(!a.p.colModel[d].hidden){a.p.colModel[d].resizable=!1;break}"horizontal"==a.p.viewsortcols[1]&&(Y=" ui-i-asc",N=" ui-i-desc");na=k?"class='ui-th-div-ie'":"";Y="");for(d=0;d",N=a.p.colModel[d].index||a.p.colModel[d].name,z+="
"+a.p.colNames[d],a.p.colModel[d].width=a.p.colModel[d].width?parseInt(a.p.colModel[d].width,10):150,"boolean"!==typeof a.p.colModel[d].title&&(a.p.colModel[d].title=!0),N==a.p.sortname&&(a.p.lastsort=d),z+=Y+"
";Y=null;b(this).append(z+"");b("thead tr:first th",this).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});if(this.p.multiselect){var ga=[],Z;b("#cb_"+b.jgrid.jqID(a.p.id), this).bind("click",function(){a.p.selarrrow=[];var c=a.p.frozenColumns===true?a.p.id+"_frozen":"";if(this.checked){b(a.rows).each(function(d){if(d>0&&!b(this).hasClass("ui-subgrid")&&!b(this).hasClass("jqgroup")&&!b(this).hasClass("ui-state-disabled")){b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+b.jgrid.jqID(this.id))[a.p.useProp?"prop":"attr"]("checked",true);b(this).addClass("ui-state-highlight").attr("aria-selected","true");a.p.selarrrow.push(this.id);a.p.selrow=this.id;if(c){b("#jqg_"+b.jgrid.jqID(a.p.id)+ "_"+b.jgrid.jqID(this.id),a.grid.fbDiv)[a.p.useProp?"prop":"attr"]("checked",true);b("#"+b.jgrid.jqID(this.id),a.grid.fbDiv).addClass("ui-state-highlight")}}});Z=true;ga=[]}else{b(a.rows).each(function(d){if(d>0&&!b(this).hasClass("ui-subgrid")&&!b(this).hasClass("ui-state-disabled")){b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+b.jgrid.jqID(this.id))[a.p.useProp?"prop":"attr"]("checked",false);b(this).removeClass("ui-state-highlight").attr("aria-selected","false");ga.push(this.id);if(c){b("#jqg_"+b.jgrid.jqID(a.p.id)+ "_"+b.jgrid.jqID(this.id),a.grid.fbDiv)[a.p.useProp?"prop":"attr"]("checked",false);b("#"+b.jgrid.jqID(this.id),a.grid.fbDiv).removeClass("ui-state-highlight")}}});a.p.selrow=null;Z=false}b(a).triggerHandler("jqGridSelectAll",[Z?a.p.selarrrow:ga,Z]);b.isFunction(a.p.onSelectAll)&&a.p.onSelectAll.call(a,Z?a.p.selarrrow:ga,Z)})}!0===a.p.autowidth&&(z=b(l).innerWidth(),a.p.width=00){l=c.width-e*f-m;if(!isNaN(a.p.height)){l=l-h;k=true}d=0;b.each(a.p.colModel,function(b){if(this.hidden===false&&!this.fixed){this.width=j=Math.round(l*this.width/(a.p.tblwidth-e*f-m));d=d+j;g=b}});q=0;k?c.width-m-(d+e*f)!==h&&(q=c.width-m-(d+e*f)-h):!k&&Math.abs(c.width-m-(d+e*f))!==1&&(q=c.width-m-(d+e*f));a.p.colModel[g].width=a.p.colModel[g].width+q;a.p.tblwidth=d+q+e*f+m;if(a.p.tblwidth>a.p.width){a.p.colModel[g].width=a.p.colModel[g].width-(a.p.tblwidth-parseInt(a.p.width, 10));a.p.tblwidth=a.p.width}}})();b(l).css("width",c.width+"px").append("
 
");b(j).css("width",c.width+"px");var z=b("thead:first",a).get(0),S="";a.p.footerrow&&(S+="");var j=b("tr:first",z),$=""; a.p.disableClick=!1;b("th",j).each(function(d){da=a.p.colModel[d].width;if(a.p.colModel[d].resizable===void 0)a.p.colModel[d].resizable=true;if(a.p.colModel[d].resizable){ea=document.createElement("span");b(ea).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+g).css("cursor","col-resize");b(this).addClass(a.p.resizeclass)}else ea="";b(this).css("width",da+"px").prepend(ea);var e="";if(a.p.colModel[d].hidden){b(this).css("display","none");e="display:none;"}$=$+("");c.headers[d]={width:da,el:this};fa=a.p.colModel[d].sortable;if(typeof fa!=="boolean")fa=a.p.colModel[d].sortable=true;e=a.p.colModel[d].name;e=="cb"||e=="subgrid"||e=="rn"||a.p.viewsortcols[2]&&b(">div",this).addClass("ui-jqgrid-sortable");if(fa)if(a.p.viewsortcols[0]){b("div span.s-ico",this).show();d==a.p.lastsort&&b("div span.ui-icon-"+a.p.sortorder,this).removeClass("ui-state-disabled")}else if(d==a.p.lastsort){b("div span.s-ico",this).show();b("div span.ui-icon-"+a.p.sortorder, this).removeClass("ui-state-disabled")}a.p.footerrow&&(S=S+(""))}).mousedown(function(d){if(b(d.target).closest("th>span.ui-jqgrid-resize").length==1){var e=ma(this);if(a.p.forceFit===true){var f=a.p,g=e,h;for(h=e+1;h
 
").append(z),D=a.p.caption&&!0===a.p.hiddengrid?!0:!1;d=b("
");z=null;c.hDiv=document.createElement("div");b(c.hDiv).css({width:c.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(d);b(d).append(j);j=null;D&&b(c.hDiv).hide();a.p.pager&&("string"===typeof a.p.pager?"#"!=a.p.pager.substr(0,1)&&(a.p.pager="#"+a.p.pager):a.p.pager="#"+b(a.p.pager).attr("id"),b(a.p.pager).css({width:c.width+ "px"}).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom").appendTo(l),D&&b(a.p.pager).hide(),ka(a.p.pager,""));!1===a.p.cellEdit&&!0===a.p.hoverrows&&b(a).bind("mouseover",function(a){p=b(a.target).closest("tr.jqgrow");b(p).attr("class")!=="ui-subgrid"&&b(p).addClass("ui-state-hover")}).bind("mouseout",function(a){p=b(a.target).closest("tr.jqgrow");b(p).removeClass("ui-state-hover")});var r,J,ha;b(a).before(c.hDiv).click(function(c){A=c.target;p=b(A,a.rows).closest("tr.jqgrow");if(b(p).length=== 0||p[0].className.indexOf("ui-state-disabled")>-1||(b(A,a).closest("table.ui-jqgrid-btable").attr("id")||"").replace("_frozen","")!==a.id)return this;var d=b(A).hasClass("cbox"),e=b(a).triggerHandler("jqGridBeforeSelectRow",[p[0].id,c]);(e=e===false||e==="stop"?false:true)&&b.isFunction(a.p.beforeSelectRow)&&(e=a.p.beforeSelectRow.call(a,p[0].id,c));if(!(A.tagName=="A"||(A.tagName=="INPUT"||A.tagName=="TEXTAREA"||A.tagName=="OPTION"||A.tagName=="SELECT")&&!d)&&e===true){r=p[0].id;J=b.jgrid.getCellIndex(A); ha=b(A).closest("td,th").html();b(a).triggerHandler("jqGridCellSelect",[r,J,ha,c]);b.isFunction(a.p.onCellSelect)&&a.p.onCellSelect.call(a,r,J,ha,c);if(a.p.cellEdit===true)if(a.p.multiselect&&d)b(a).jqGrid("setSelection",r,true,c);else{r=p[0].rowIndex;try{b(a).jqGrid("editCell",r,J,true)}catch(f){}}else if(a.p.multikey)if(c[a.p.multikey])b(a).jqGrid("setSelection",r,true,c);else{if(a.p.multiselect&&d){d=b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+r).is(":checked");b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+r)[a.p.useProp? "prop":"attr"]("checked",d)}}else{if(a.p.multiselect&&a.p.multiboxonly&&!d){var g=a.p.frozenColumns?a.p.id+"_frozen":"";b(a.p.selarrrow).each(function(c,d){var e=a.rows.namedItem(d);b(e).removeClass("ui-state-highlight");b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+b.jgrid.jqID(d))[a.p.useProp?"prop":"attr"]("checked",false);if(g){b("#"+b.jgrid.jqID(d),"#"+b.jgrid.jqID(g)).removeClass("ui-state-highlight");b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+b.jgrid.jqID(d),"#"+b.jgrid.jqID(g))[a.p.useProp?"prop":"attr"]("checked", false)}});a.p.selarrrow=[]}b(a).jqGrid("setSelection",r,true,c)}}}).bind("reloadGrid",function(c,d){if(a.p.treeGrid===true)a.p.datatype=a.p.treedatatype;d&&d.current&&a.grid.selectionPreserver(a);if(a.p.datatype=="local"){b(a).jqGrid("resetSelection");a.p.data.length&&M()}else if(!a.p.treeGrid){a.p.selrow=null;if(a.p.multiselect){a.p.selarrrow=[];ca(false)}a.p.savedRow=[]}a.p.scroll&&W.call(a,true,false);if(d&&d.page){var e=d.page;if(e>a.p.lastpage)e=a.p.lastpage;e<1&&(e=1);a.p.page=e;a.grid.bDiv.scrollTop= a.grid.prevRowHeight?(e-1)*a.grid.prevRowHeight*a.p.rowNum:0}if(a.grid.prevRowHeight&&a.p.scroll){delete a.p.lastpage;a.grid.populateVisible()}else a.grid.populate();a.p._inlinenav===true&&b(a).jqGrid("showAddEditButtons");return false}).dblclick(function(c){A=c.target;p=b(A,a.rows).closest("tr.jqgrow");if(b(p).length!==0){r=p[0].rowIndex;J=b.jgrid.getCellIndex(A);b(a).triggerHandler("jqGridDblClickRow",[b(p).attr("id"),r,J,c]);b.isFunction(this.p.ondblClickRow)&&a.p.ondblClickRow.call(a,b(p).attr("id"), r,J,c)}}).bind("contextmenu",function(c){A=c.target;p=b(A,a.rows).closest("tr.jqgrow");if(b(p).length!==0){a.p.multiselect||b(a).jqGrid("setSelection",p[0].id,true,c);r=p[0].rowIndex;J=b.jgrid.getCellIndex(A);b(a).triggerHandler("jqGridRightClickRow",[b(p).attr("id"),r,J,c]);b.isFunction(this.p.onRightClickRow)&&a.p.onRightClickRow.call(a,b(p).attr("id"),r,J,c)}});c.bDiv=document.createElement("div");k&&"auto"===(""+a.p.height).toLowerCase()&&(a.p.height="100%");b(c.bDiv).append(b('
').append("
").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height+(isNaN(a.p.height)?"":"px"),width:c.width+"px"}).scroll(c.scrollGrid);b("table:first",c.bDiv).css({width:a.p.tblwidth+"px"});b.support.tbody||2==b("tbody",this).length&&b("tbody:gt(0)",this).remove();a.p.multikey&&(b.jgrid.msie?b(c.bDiv).bind("selectstart",function(){return false}):b(c.bDiv).bind("mousedown",function(){return false}));D&&b(c.bDiv).hide();c.cDiv= document.createElement("div");var ia=!0===a.p.hidegrid?b("").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){ia.addClass("ui-state-hover")},function(){ia.removeClass("ui-state-hover")}).append("").css("rtl"==g?"left":"right","0px"):"";b(c.cDiv).append(ia).append(""+a.p.caption+"").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"); b(c.cDiv).insertBefore(c.hDiv);a.p.toolbar[0]&&(c.uDiv=document.createElement("div"),"top"==a.p.toolbar[1]?b(c.uDiv).insertBefore(c.hDiv):"bottom"==a.p.toolbar[1]&&b(c.uDiv).insertAfter(c.hDiv),"both"==a.p.toolbar[1]?(c.ubDiv=document.createElement("div"),b(c.uDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id).insertBefore(c.hDiv),b(c.ubDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id).insertAfter(c.hDiv),D&&b(c.ubDiv).hide()):b(c.uDiv).width(c.width).addClass("ui-userdata ui-state-default").attr("id", "t_"+this.id),D&&b(c.uDiv).hide());a.p.toppager&&(a.p.toppager=b.jgrid.jqID(a.p.id)+"_toppager",c.topDiv=b("
")[0],a.p.toppager="#"+a.p.toppager,b(c.topDiv).addClass("ui-state-default ui-jqgrid-toppager").width(c.width).insertBefore(c.hDiv),ka(a.p.toppager,"_t"));a.p.footerrow&&(c.sDiv=b("
")[0],d=b("
"),b(c.sDiv).append(d).width(c.width).insertAfter(c.hDiv),b(d).append(S),c.footers= b(".ui-jqgrid-ftable",c.sDiv)[0].rows[0].cells,a.p.rownumbers&&(c.footers[0].className="ui-state-default jqgrid-rownum"),D&&b(c.sDiv).hide());d=null;if(a.p.caption){var qa=a.p.datatype;!0===a.p.hidegrid&&(b(".ui-jqgrid-titlebar-close",c.cDiv).click(function(d){var e=b.isFunction(a.p.onHeaderClick),f=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",g,h=this;if(a.p.toolbar[0]===true){a.p.toolbar[1]=="both"&&(f=f+(", #"+b(c.ubDiv).attr("id")));f=f+(", #"+b(c.uDiv).attr("id"))}g= b(f,"#gview_"+b.jgrid.jqID(a.p.id)).length;a.p.gridstate=="visible"?b(f,"#gbox_"+b.jgrid.jqID(a.p.id)).slideUp("fast",function(){g--;if(g===0){b("span",h).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");a.p.gridstate="hidden";b("#gbox_"+b.jgrid.jqID(a.p.id)).hasClass("ui-resizable")&&b(".ui-resizable-handle","#gbox_"+b.jgrid.jqID(a.p.id)).hide();b(a).triggerHandler("jqGridHeaderClick",[a.p.gridstate,d]);e&&(D||a.p.onHeaderClick.call(a,a.p.gridstate,d))}}):a.p.gridstate== "hidden"&&b(f,"#gbox_"+b.jgrid.jqID(a.p.id)).slideDown("fast",function(){g--;if(g===0){b("span",h).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(D){a.p.datatype=qa;I();D=false}a.p.gridstate="visible";b("#gbox_"+b.jgrid.jqID(a.p.id)).hasClass("ui-resizable")&&b(".ui-resizable-handle","#gbox_"+b.jgrid.jqID(a.p.id)).show();b(a).triggerHandler("jqGridHeaderClick",[a.p.gridstate,d]);e&&(D||a.p.onHeaderClick.call(a,a.p.gridstate,d))}});return false}),D&&(a.p.datatype= "local",b(".ui-jqgrid-titlebar-close",c.cDiv).trigger("click")))}else b(c.cDiv).hide();b(c.hDiv).after(c.bDiv).mousemove(function(a){if(c.resizing){c.dragMove(a);return false}});b(".ui-jqgrid-labels",c.hDiv).bind("selectstart",function(){return false});b(document).mouseup(function(){if(c.resizing){c.dragEnd();return false}return true});a.formatCol=s;a.sortData=la;a.updatepager=function(c,d){var e,f,g,h,i,j,k,l="",m=a.p.pager?"_"+b.jgrid.jqID(a.p.pager.substr(1)):"",o=a.p.toppager?"_"+a.p.toppager.substr(1): "";g=parseInt(a.p.page,10)-1;g<0&&(g=0);g=g*parseInt(a.p.rowNum,10);i=g+a.p.reccount;if(a.p.scroll){e=b("tbody:first > tr:gt(0)",a.grid.bDiv);g=i-e.length;a.p.reccount=e.length;if(f=e.outerHeight()||a.grid.prevRowHeight){e=g*f;f=parseInt(a.p.records,10)*f;b(">div:first",a.grid.bDiv).css({height:f}).children("div:first").css({height:e,display:e?"":"none"})}a.grid.bDiv.scrollLeft=a.grid.hDiv.scrollLeft}l=a.p.pager||"";if(l=l+(a.p.toppager?l?","+a.p.toppager:a.p.toppager:"")){k=b.jgrid.formatter.integer|| {};e=n(a.p.page);f=n(a.p.lastpage);b(".selbox",l)[this.p.useProp?"prop":"attr"]("disabled",false);if(a.p.pginput===true){b(".ui-pg-input",l).val(a.p.page);h=a.p.toppager?"#sp_1"+m+",#sp_1"+o:"#sp_1"+m;b(h).html(b.fmatter?b.fmatter.util.NumberFormat(a.p.lastpage,k):a.p.lastpage)}if(a.p.viewrecords)if(a.p.reccount===0)b(".ui-paging-info",l).html(a.p.emptyrecords);else{h=g+1;j=a.p.records;if(b.fmatter){h=b.fmatter.util.NumberFormat(h,k);i=b.fmatter.util.NumberFormat(i,k);j=b.fmatter.util.NumberFormat(j, k)}b(".ui-paging-info",l).html(b.jgrid.format(a.p.recordtext,h,i,j))}if(a.p.pgbuttons===true){e<=0&&(e=f=0);if(e==1||e===0){b("#first"+m+", #prev"+m).addClass("ui-state-disabled").removeClass("ui-state-hover");a.p.toppager&&b("#first_t"+o+", #prev_t"+o).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{b("#first"+m+", #prev"+m).removeClass("ui-state-disabled");a.p.toppager&&b("#first_t"+o+", #prev_t"+o).removeClass("ui-state-disabled")}if(e==f||e===0){b("#next"+m+", #last"+m).addClass("ui-state-disabled").removeClass("ui-state-hover"); a.p.toppager&&b("#next_t"+o+", #last_t"+o).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{b("#next"+m+", #last"+m).removeClass("ui-state-disabled");a.p.toppager&&b("#next_t"+o+", #last_t"+o).removeClass("ui-state-disabled")}}}c===true&&a.p.rownumbers===true&&b("td.jqgrid-rownum",a.rows).each(function(a){b(this).html(g+1+a)});d&&a.p.jqgdnd&&b(a).jqGrid("gridDnD","updateDnD");b(a).triggerHandler("jqGridGridComplete");b.isFunction(a.p.gridComplete)&&a.p.gridComplete.call(a);b(a).triggerHandler("jqGridAfterGridComplete")}; a.refreshIndex=M;a.setHeadCheckBox=ca;a.constructTr=X;a.formatter=function(a,b,c,d,e){return v(a,b,c,d,e)};b.extend(c,{populate:I,emptyRows:W});this.grid=c;a.addXmlData=function(b){H(b,a.grid.bDiv)};a.addJSONData=function(b){V(b,a.grid.bDiv)};this.grid.cols=this.rows[0].cells;b(a).triggerHandler("jqGridInitGrid");b.isFunction(a.p.onInitGrid)&&a.p.onInitGrid.call(a);I();a.p.hiddengrid=!1}}}})};b.jgrid.extend({getGridParam:function(b){var d=this[0];return!d||!d.grid?void 0:!b?d.p:void 0!==d.p[b]?d.p[b]: null},setGridParam:function(f){return this.each(function(){this.grid&&"object"===typeof f&&b.extend(!0,this.p,f)})},getDataIDs:function(){var f=[],d=0,c,e=0;this.each(function(){if((c=this.rows.length)&&0=e+h?b(this.grid.bDiv)[0].scrollTop=g-(e+h)+i+h:g span:first",j).html(g).attr(i):b("td[role='gridcell']:eq("+a+")",j).html(g).attr(i))}),"local"==h.p.datatype){var n=b.jgrid.stripPref(h.p.idPrefix,f),s=h.p._index[n],m;if(h.p.treeGrid)for(m in h.p.treeReader)h.p.treeReader.hasOwnProperty(m)&&delete l[h.p.treeReader[m]];void 0!==s&&(h.p.data[s]=b.extend(!0,h.p.data[s],l));l=null}}catch(v){a=!1}a&&("string"===k?b(j).addClass(c):"object"===k&&b(j).css(c),b(h).triggerHandler("jqGridAfterGridComplete"))});return a},addRowData:function(f,d,c,e){c|| (c="last");var a=!1,i,h,g,j,k,l,n,s,m="",v,E,T,K,aa,U;d&&(b.isArray(d)?(v=!0,c="last",E=f):(d=[d],v=!1),this.each(function(){var W=d.length;k=this.p.rownumbers===true?1:0;g=this.p.multiselect===true?1:0;j=this.p.subGrid===true?1:0;if(!v)if(f!==void 0)f=""+f;else{f=b.jgrid.randId();if(this.p.keyIndex!==false){E=this.p.colModel[this.p.keyIndex+g+j+k].name;d[0][E]!==void 0&&(f=d[0][E])}}T=this.p.altclass;for(var M=0,X="",H={},V=b.isFunction(this.p.afterInsertRow)?true:false;M0"}if(g){s='';m=this.formatCol(k,1,"",null,f,true);h[h.length]='"+s+""}j&&(h[h.length]=b(this).jqGrid("addSubGridCell", g+k,1));for(n=g+j+k;n"+s+""}h.unshift(this.constructTr(f,false,X,H,K,false));h[h.length]="";if(this.rows.length===0)b("table:first",this.grid.bDiv).append(h.join(""));else switch(c){case "last":b(this.rows[this.rows.length-1]).after(h.join(""));l=this.rows.length-1;break;case "first":b(this.rows[0]).after(h.join("")); l=1;break;case "after":(l=this.rows.namedItem(e))&&(b(this.rows[l.rowIndex+1]).hasClass("ui-subgrid")?b(this.rows[l.rowIndex+1]).after(h):b(l).after(h.join("")));l++;break;case "before":if(l=this.rows.namedItem(e)){b(l).before(h.join(""));l=l.rowIndex}l--}this.p.subGrid===true&&b(this).jqGrid("addSubGrid",g+k,l);this.p.records++;this.p.reccount++;b(this).triggerHandler("jqGridAfterInsertRow",[f,K,K]);V&&this.p.afterInsertRow.call(this,f,K,K);M++;if(this.p.datatype=="local"){H[this.p.localReader.id]= U;this.p._index[U]=this.p.data.length;this.p.data.push(H);H={}}}this.p.altRows===true&&!v&&(c=="last"?(this.rows.length-1)%2==1&&b(this.rows[this.rows.length-1]).addClass(T):b(this.rows).each(function(a){a%2==1?b(this).addClass(T):b(this).removeClass(T)}));this.updatepager(true,true);a=true}));return a},footerData:function(f,d,c){function e(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var a,i=!1,h={},g;void 0===f&&(f="get");"boolean"!==typeof c&&(c=!0);f=f.toLowerCase();this.each(function(){var j= this,k;if(!j.grid||!j.p.footerrow||"set"==f&&e(d))return!1;i=!0;b(this.p.colModel).each(function(e){a=this.name;"set"==f?void 0!==d[a]&&(k=c?j.formatter("",d[a],e,d,"edit"):d[a],g=this.title?{title:b.jgrid.stripHtml(k)}:{},b("tr.footrow td:eq("+e+")",j.grid.sDiv).html(k).attr(g),i=!0):"get"==f&&(h[a]=b("tr.footrow td:eq("+e+")",j.grid.sDiv).html())})});return"get"==f?h:i},showHideCol:function(f,d){return this.each(function(){var c=this,e=!1,a=b.jgrid.cell_width?0:c.p.cellLayout,i;if(c.grid){"string"=== typeof f&&(f=[f]);d="none"!=d?"":"none";var h=""===d?!0:!1,g=c.p.groupHeader&&("object"===typeof c.p.groupHeader||b.isFunction(c.p.groupHeader));g&&b(c).jqGrid("destroyGroupHeader",!1);b(this.p.colModel).each(function(g){if(-1!==b.inArray(this.name,f)&&this.hidden===h){if(!0===c.p.frozenColumns&&!0===this.frozen)return!0;b("tr",c.grid.hDiv).each(function(){b(this.cells[g]).css("display",d)});b(c.rows).each(function(){b(this).hasClass("jqgroup")||b(this.cells[g]).css("display",d)});c.p.footerrow&& b("tr.footrow td:eq("+g+")",c.grid.sDiv).css("display",d);i=parseInt(this.width,10);c.p.tblwidth="none"===d?c.p.tblwidth-(i+a):c.p.tblwidth+(i+a);this.hidden=!h;e=!0;b(c).triggerHandler("jqGridShowHideCol",[h,this.name,g])}});!0===e&&(!0===c.p.shrinkToFit&&!isNaN(c.p.height)&&(c.p.tblwidth+=parseInt(c.p.scrollOffset,10)),b(c).jqGrid("setGridWidth",!0===c.p.shrinkToFit?c.p.tblwidth:c.p.width));g&&b(c).jqGrid("setGroupHeaders",c.p.groupHeader)}})},hideCol:function(f){return this.each(function(){b(this).jqGrid("showHideCol", f,"none")})},showCol:function(f){return this.each(function(){b(this).jqGrid("showHideCol",f,"")})},remapColumns:function(f,d,c){function e(a){var c;c=a.length?b.makeArray(a):b.extend({},a);b.each(f,function(b){a[b]=c[this]})}function a(a,c){b(">tr"+(c||""),a).each(function(){var a=this,c=b.makeArray(a.cells);b.each(f,function(){var b=c[this];b&&a.appendChild(b)})})}var i=this.get(0);e(i.p.colModel);e(i.p.colNames);e(i.grid.headers);a(b("thead:first",i.grid.hDiv),c&&":not(.ui-jqgrid-labels)");d&&a(b("#"+ b.jgrid.jqID(i.p.id)+" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot");i.p.footerrow&&a(b("tbody:first",i.grid.sDiv));i.p.remapColumns&&(i.p.remapColumns.length?e(i.p.remapColumns):i.p.remapColumns=b.makeArray(f));i.p.lastsort=b.inArray(i.p.lastsort,f);i.p.treeGrid&&(i.p.expColInd=b.inArray(i.p.expColInd,f));b(i).triggerHandler("jqGridRemapColumns",[f,d,c])},setGridWidth:function(f,d){return this.each(function(){if(this.grid){var c=this,e,a=0,i=b.jgrid.cell_width?0:c.p.cellLayout,h,g=0,j=!1,k= c.p.scrollOffset,l,n=0,s=0,m;"boolean"!==typeof d&&(d=c.p.shrinkToFit);if(!isNaN(f)){f=parseInt(f,10);c.grid.width=c.p.width=f;b("#gbox_"+b.jgrid.jqID(c.p.id)).css("width",f+"px");b("#gview_"+b.jgrid.jqID(c.p.id)).css("width",f+"px");b(c.grid.bDiv).css("width",f+"px");b(c.grid.hDiv).css("width",f+"px");c.p.pager&&b(c.p.pager).css("width",f+"px");c.p.toppager&&b(c.p.toppager).css("width",f+"px");!0===c.p.toolbar[0]&&(b(c.grid.uDiv).css("width",f+"px"),"both"==c.p.toolbar[1]&&b(c.grid.ubDiv).css("width", f+"px"));c.p.footerrow&&b(c.grid.sDiv).css("width",f+"px");!1===d&&!0===c.p.forceFit&&(c.p.forceFit=!1);if(!0===d){b.each(c.p.colModel,function(){if(this.hidden===false){e=this.widthOrg;a=a+(e+i);this.fixed?n=n+(e+i):g++;s++}});if(0===g)return;c.p.tblwidth=a;l=f-i*g-n;if(!isNaN(c.p.height)&&(b(c.grid.bDiv)[0].clientHeightf?(j=c.p.tblwidth-parseInt(f,10),c.p.tblwidth=f,e=c.p.colModel[h].width-=j):e=c.p.colModel[h].width;c.grid.headers[h].width= e;c.grid.headers[h].el.style.width=e+"px";v&&(c.grid.cols[h].style.width=e+"px");c.p.footerrow&&(c.grid.footers[h].style.width=e+"px")}c.p.tblwidth&&(b("table:first",c.grid.bDiv).css("width",c.p.tblwidth+"px"),b("table:first",c.grid.hDiv).css("width",c.p.tblwidth+"px"),c.grid.hDiv.scrollLeft=c.grid.bDiv.scrollLeft,c.p.footerrow&&b("table:first",c.grid.sDiv).css("width",c.p.tblwidth+"px"))}}})},setGridHeight:function(f){return this.each(function(){if(this.grid){var d=b(this.grid.bDiv);d.css({height:f+ (isNaN(f)?"":"px")});!0===this.p.frozenColumns&&b("#"+b.jgrid.jqID(this.p.id)+"_frozen").parent().height(d.height()-16);this.p.height=f;this.p.scroll&&this.grid.populateVisible()}})},setCaption:function(f){return this.each(function(){this.p.caption=f;b("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",this.grid.cDiv).html(f);b(this.grid.cDiv).show()})},setLabel:function(f,d,c,e){return this.each(function(){var a=-1;if(this.grid&&void 0!==f&&(b(this.p.colModel).each(function(b){if(this.name==f)return a= b,!1}),0<=a)){var i=b("tr.ui-jqgrid-labels th:eq("+a+")",this.grid.hDiv);if(d){var h=b(".s-ico",i);b("[id^=jqgh_]",i).empty().html(d).append(h);this.p.colNames[a]=d}c&&("string"===typeof c?b(i).addClass(c):b(i).css(c));"object"===typeof e&&b(i).attr(e)}})},setCell:function(f,d,c,e,a,i){return this.each(function(){var h=-1,g,j;if(this.grid&&(isNaN(d)?b(this.p.colModel).each(function(a){if(this.name==d)return h=a,!1}):h=parseInt(d,10),0<=h&&(g=this.rows.namedItem(f)))){var k=b("td:eq("+h+")",g);if(""!== c||!0===i)g=this.formatter(f,c,h,g,"edit"),j=this.p.colModel[h].title?{title:b.jgrid.stripHtml(g)}:{},this.p.treeGrid&&0c,e=""+c,f=b.decimalSeparator||".",h;if(a.fmatter.isNumber(b.decimalPlaces)){var g=b.decimalPlaces,e=Math.pow(10,g),e=""+Math.round(c* e)/e;h=e.lastIndexOf(".");if(0h?(e+=f,h=e.length-1):"."!==f&&(e=e.replace(".",f));for(;e.length-1-hi&&(b[h]=i+1)),"F"==c[h]&&(i=a.inArray(b[h],k.i18n.monthNames),-1!==i&&11=i?g.y=1900+g.y:0<=i&&69>=i&&(g.y=2E3+g.y);i=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u)}e.masks.hasOwnProperty(d)?d= e.masks[d]:d||(d="Y-m-d");c=i.getHours();b=i.getMinutes();g=i.getDate();h=i.getMonth()+1;j=i.getTimezoneOffset();var l=i.getSeconds(),r=i.getMilliseconds(),n=i.getDay(),m=i.getFullYear(),o=(n+6)%7+1,p=(new Date(m,h-1,g)-new Date(m,0,1))/864E5,q={d:f(g),D:k.i18n.dayNames[n],j:g,l:k.i18n.dayNames[n+7],N:o,S:e.S(g),w:n,z:p,W:5>o?Math.floor((p+o-1)/7)+1:Math.floor((p+o-1)/7)||(4>((new Date(m-1,0,1)).getDay()+6)%7?53:52),F:k.i18n.monthNames[h-1+12],m:f(h),M:k.i18n.monthNames[h-1],n:h,t:"?",L:"?",o:"?", Y:m,y:(""+m).substring(2),a:12>c?e.AmPm[0]:e.AmPm[1],A:12>c?e.AmPm[2]:e.AmPm[3],B:"?",g:c%12||12,G:c,h:f(c%12||12),H:f(c),i:f(b),s:f(l),u:r,e:"?",I:"?",O:(0'+c+"
":a.fn.fmatter.defaultFormat(c,b)};a.fn.fmatter.checkbox=function(c,b){var d=a.extend({},b.checkbox),e;void 0!==b.colModel&&!a.fmatter.isUndefined(b.colModel.formatoptions)&&(d=a.extend({},d,b.colModel.formatoptions));e=!0===d.disabled?'disabled="disabled"': "";if(a.fmatter.isEmpty(c)||a.fmatter.isUndefined(c))c=a.fn.fmatter.defaultFormat(c,d);c=(""+c).toLowerCase();return'c.search(/(false|0|no|n|off)/i)?" checked='checked' ":"")+' value="'+c+'" offval="no" '+e+"/>"};a.fn.fmatter.link=function(c,b){var d={target:b.target},e="";void 0!==b.colModel&&!a.fmatter.isUndefined(b.colModel.formatoptions)&&(d=a.extend({},d,b.colModel.formatoptions));d.target&&(e="target="+d.target);return!a.fmatter.isEmpty(c)?"'+ c+"":a.fn.fmatter.defaultFormat(c,b)};a.fn.fmatter.showlink=function(c,b){var d={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,addParam:b.addParam||"",target:b.target,idName:b.idName},e="";void 0!==b.colModel&&!a.fmatter.isUndefined(b.colModel.formatoptions)&&(d=a.extend({},d,b.colModel.formatoptions));d.target&&(e="target="+d.target);d=d.baseLinkUrl+d.showAction+"?"+d.idName+"="+b.rowId+d.addParam;return a.fmatter.isString(c)||a.fmatter.isNumber(c)?"'+c+"":a.fn.fmatter.defaultFormat(c, b)};a.fn.fmatter.integer=function(c,b){var d=a.extend({},b.integer);void 0!==b.colModel&&!a.fmatter.isUndefined(b.colModel.formatoptions)&&(d=a.extend({},d,b.colModel.formatoptions));return a.fmatter.isEmpty(c)?d.defaultValue:a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.number=function(c,b){var d=a.extend({},b.number);void 0!==b.colModel&&!a.fmatter.isUndefined(b.colModel.formatoptions)&&(d=a.extend({},d,b.colModel.formatoptions));return a.fmatter.isEmpty(c)?d.defaultValue:a.fmatter.util.NumberFormat(c, d)};a.fn.fmatter.currency=function(c,b){var d=a.extend({},b.currency);void 0!==b.colModel&&!a.fmatter.isUndefined(b.colModel.formatoptions)&&(d=a.extend({},d,b.colModel.formatoptions));return a.fmatter.isEmpty(c)?d.defaultValue:a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.date=function(c,b,d,e){d=a.extend({},b.date);void 0!==b.colModel&&!a.fmatter.isUndefined(b.colModel.formatoptions)&&(d=a.extend({},d,b.colModel.formatoptions));return!d.reformatAfterEdit&&"edit"==e?a.fn.fmatter.defaultFormat(c, b):!a.fmatter.isEmpty(c)?a.fmatter.util.DateFormat(d.srcformat,c,d.newformat,d):a.fn.fmatter.defaultFormat(c,b)};a.fn.fmatter.select=function(c,b){var c=""+c,d=!1,e=[],f,h;a.fmatter.isUndefined(b.colModel.formatoptions)?a.fmatter.isUndefined(b.colModel.editoptions)||(d=b.colModel.editoptions.value,f=void 0===b.colModel.editoptions.separator?":":b.colModel.editoptions.separator,h=void 0===b.colModel.editoptions.delimiter?";":b.colModel.editoptions.delimiter):(d=b.colModel.formatoptions.value,f=void 0=== b.colModel.formatoptions.separator?":":b.colModel.formatoptions.separator,h=void 0===b.colModel.formatoptions.delimiter?";":b.colModel.formatoptions.delimiter);if(d){var g=!0===b.colModel.editoptions.multiple?!0:!1,i=[];g&&(i=c.split(","),i=a.map(i,function(b){return a.trim(b)}));if(a.fmatter.isString(d)){var j=d.split(h),k=0,l;for(l=0;l0)return a}).join(f)),g)-1": d.editbutton&&(f+="
");d.delbutton&&(f+="
"); f+="";f+=""; return"
"+f+"
"};a.unformat=function(c,b,d,e){var f,h=b.colModel.formatter,g=b.colModel.formatoptions||{},i=/([\.\*\_\'\(\)\{\}\+\?\\])/g,j=b.colModel.unformat||a.fn.fmatter[h]&&a.fn.fmatter[h].unformat;if(void 0!==j&&a.isFunction(j))f=j.call(this,a(c).text(),b,c);else if(!a.fmatter.isUndefined(h)&&a.fmatter.isString(h))switch(f=a.jgrid.formatter||{},h){case "integer":g=a.extend({},f.integer,g);b=g.thousandsSeparator.replace(i,"\\$1");f=a(c).text().replace(RegExp(b, "g"),"");break;case "number":g=a.extend({},f.number,g);b=g.thousandsSeparator.replace(i,"\\$1");f=a(c).text().replace(RegExp(b,"g"),"").replace(g.decimalSeparator,".");break;case "currency":g=a.extend({},f.currency,g);b=g.thousandsSeparator.replace(i,"\\$1");b=RegExp(b,"g");f=a(c).text();g.prefix&&g.prefix.length&&(f=f.substr(g.prefix.length));g.suffix&&g.suffix.length&&(f=f.substr(0,f.length-g.suffix.length));f=f.replace(b,"").replace(g.decimalSeparator,".");break;case "checkbox":g=b.colModel.editoptions? b.colModel.editoptions.value.split(":"):["Yes","No"];f=a("input",c).is(":checked")?g[0]:g[1];break;case "select":f=a.unformat.select(c,b,d,e);break;case "actions":return"";default:f=a(c).text()}return void 0!==f?f:!0===e?a(c).text():a.jgrid.htmlDecode(a(c).html())};a.unformat.select=function(c,b,d,e){d=[];c=a(c).text();if(!0===e)return c;var e=a.extend({},!a.fmatter.isUndefined(b.colModel.formatoptions)?b.colModel.formatoptions:b.colModel.editoptions),b=void 0===e.separator?":":e.separator,f=void 0=== e.delimiter?";":e.delimiter;if(e.value){var h=e.value,e=!0===e.multiple?!0:!1,g=[];e&&(g=c.split(","),g=a.map(g,function(b){return a.trim(b)}));if(a.fmatter.isString(h)){var i=h.split(f),j=0,k;for(k=0;k0)return a}).join(b)),e)-1"),f;a.each(c.p.colModel,function(){var e=this,j,m,h,l;m=a("");j=a("
"); !0===this.hidden&&a(m).css("display","none");this.search=!1===this.search?!1:!0;void 0===this.stype&&(this.stype="text");h=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(l=this.surl||h.dataUrl)a.ajax(a.extend({url:l,dataType:"html",success:function(f){if(h.buildSelect!==void 0)(f=h.buildSelect(f))&&a(j).append(f);else a(j).append(f);h.defaultValue!==void 0&&a("select",j).val(h.defaultValue);a("select",j).attr({name:e.index||e.name,id:"gs_"+e.name});h.attr&& a("select",j).attr(h.attr);a("select",j).css({width:"100%"});a.jgrid.bindEv(a("select",j)[0],h,c);b.autosearch===true&&a("select",j).change(function(){d();return false});f=null}},a.jgrid.ajaxOptions,c.p.ajaxSelectOptions||{}));else{var k,p,i;e.searchoptions?(k=void 0===e.searchoptions.value?"":e.searchoptions.value,p=void 0===e.searchoptions.separator?":":e.searchoptions.separator,i=void 0===e.searchoptions.delimiter?";":e.searchoptions.delimiter):e.editoptions&&(k=void 0===e.editoptions.value?"": e.editoptions.value,p=void 0===e.editoptions.separator?":":e.editoptions.separator,i=void 0===e.editoptions.delimiter?";":e.editoptions.delimiter);if(k){l=document.createElement("select");l.style.width="100%";a(l).attr({name:e.index||e.name,id:"gs_"+e.name});var n,o;if("string"===typeof k){k=k.split(i);for(o=0;o"),h.attr&&a("input",j).attr(h.attr),a.jgrid.bindEv(a("input",j)[0],h,c),!0===b.autosearch&&(b.searchOnEnter? a("input",j).keypress(function(a){if((a.charCode||a.keyCode||0)==13){d();return false}return this}):a("input",j).keydown(function(a){switch(a.which){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:f&&clearTimeout(f);f=setTimeout(function(){d()},500)}}))}a(m).append(j);a(g).append(m)});a("table thead",c.grid.hDiv).append(g);this.ftoolbar=!0;this.triggerToolbar=d;this.clearToolbar=function(e){var d={},f=0,h,e="boolean"!==typeof e?!0:e;a.each(c.p.colModel,function(){var b; this.searchoptions&&void 0!==this.searchoptions.defaultValue&&(b=this.searchoptions.defaultValue);h=this.index||this.name;switch(this.stype){case "select":a("#gs_"+a.jgrid.jqID(this.name)+" option",!0===this.frozen&&!0===c.p.frozenColumns?c.grid.fhDiv:c.grid.hDiv).each(function(c){if(c===0)this.selected=true;if(a(this).val()==b){this.selected=true;return false}});if(void 0!==b)d[h]=b,f++;else try{delete c.p.postData[h]}catch(e){}break;case "text":if(a("#gs_"+a.jgrid.jqID(this.name),!0===this.frozen&& !0===c.p.frozenColumns?c.grid.fhDiv:c.grid.hDiv).val(b),void 0!==b)d[h]=b,f++;else try{delete c.p.postData[h]}catch(k){}}});var g=0",{role:"rowheader"}).addClass("ui-jqgrid-labels");f=d.headers;d=0;for(g=f.length;d", {role:"row","aria-hidden":"true"}).addClass("jqg-first-row-header").css("height","auto"):o.empty();var q,r=function(a,b){var c=b.length,d;for(d=0;d",{role:"rowheader"}).addClass("ui-jqgrid-labels jqg-third-row-header");for(c=0;c",{role:"gridcell"}).css(e).addClass("ui-first-th-"+this.p.direction).appendTo(o),j.style.width= "",e=r(d.name,b.groupHeaders),0<=e){e=b.groupHeaders[e];g=e.numberOfColumns;h=e.titleText;for(e=d=0;e").attr({role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+this.p.direction).css({height:"22px","border-top":"0px none"}).html(h);0",{role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+ this.p.direction).css({display:d.hidden?"none":"","border-top":"0px none"}).insertBefore(m),f.append(j)):(f.append(j),g--);l=a(this).children("thead");l.prepend(o);f.insertAfter(n);i.append(l);b.useColSpanStyle&&(i.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;")}),i.find("div.ui-jqgrid-sortable").each(function(){var b=a(this),c=b.parent();c.is(":visible")&&c.is(":has(span.ui-jqgrid-resize)")&& b.css("top",(c.height()-b.outerHeight())/2+"px")}));q=l.find("tr.jqg-first-row-header");a(this).bind("jqGridResizeStop.setGroupHeaders",function(a,b,c){q.find("th").eq(c).width(b)})})},setFrozenColumns:function(){return this.each(function(){if(this.grid){var b=this,c=b.p.colModel,d=0,g=c.length,f=-1,e=!1;if(!(!0===b.p.subGrid||!0===b.p.treeGrid||!0===b.p.cellEdit||b.p.sortable||b.p.scroll||b.p.grouping)){b.p.rownumbers&&d++;for(b.p.multiselect&&d++;d');b.grid.fbDiv=a('
'); a("#gview_"+a.jgrid.jqID(b.p.id)).append(b.grid.fhDiv);c=a(".ui-jqgrid-htable","#gview_"+a.jgrid.jqID(b.p.id)).clone(!0);if(b.p.groupHeader){a("tr.jqg-first-row-header, tr.jqg-third-row-header",c).each(function(){a("th:gt("+f+")",this).remove()});var j=-1,m=-1;a("tr.jqg-second-row-header th",c).each(function(){var b=parseInt(a(this).attr("colspan"),10);b&&(j+=b,m++);if(j===f)return!1});j!==f&&(m=f);a("tr.jqg-second-row-header",c).each(function(){a("th:gt("+m+")",this).remove()})}else a("tr",c).each(function(){a("th:gt("+ f+")",this).remove()});a(c).width(1);a(b.grid.fhDiv).append(c).mousemove(function(a){if(b.grid.resizing)return b.grid.dragMove(a),!1});a(b).bind("jqGridResizeStop.setFrozenColumns",function(c,d,e){c=a(".ui-jqgrid-htable",b.grid.fhDiv);a("th:eq("+e+")",c).width(d);c=a(".ui-jqgrid-btable",b.grid.fbDiv);a("tr:first td:eq("+e+")",c).width(d)});a(b).bind("jqGridOnSortCol.setFrozenColumns",function(c,d){var e=a("tr.ui-jqgrid-labels:last th:eq("+b.p.lastsort+")",b.grid.fhDiv),f=a("tr.ui-jqgrid-labels:last th:eq("+ d+")",b.grid.fhDiv);a("span.ui-grid-ico-sort",e).addClass("ui-state-disabled");a(e).attr("aria-selected","false");a("span.ui-icon-"+b.p.sortorder,f).removeClass("ui-state-disabled");a(f).attr("aria-selected","true");!b.p.viewsortcols[0]&&b.p.lastsort!=d&&(a("span.s-ico",e).hide(),a("span.s-ico",f).show())});a("#gview_"+a.jgrid.jqID(b.p.id)).append(b.grid.fbDiv);a(b.grid.bDiv).scroll(function(){a(b.grid.fbDiv).scrollTop(a(this).scrollTop())});!0===b.p.hoverrows&&a("#"+a.jgrid.jqID(b.p.id)).unbind("mouseover").unbind("mouseout"); a(b).bind("jqGridAfterGridComplete.setFrozenColumns",function(){a("#"+a.jgrid.jqID(b.p.id)+"_frozen").remove();a(b.grid.fbDiv).height(a(b.grid.bDiv).height()-16);var c=a("#"+a.jgrid.jqID(b.p.id)).clone(!0);a("tr",c).each(function(){a("td:gt("+f+")",this).remove()});a(c).width(1).attr("id",b.p.id+"_frozen");a(b.grid.fbDiv).append(c);!0===b.p.hoverrows&&(a("tr.jqgrow",c).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(b.p.id)).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(b.p.id)).removeClass("ui-state-hover")}),a("tr.jqgrow","#"+a.jgrid.jqID(b.p.id)).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(b.p.id)+"_frozen").addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(b.p.id)+"_frozen").removeClass("ui-state-hover")}));c=null});b.p.frozenColumns=!0}}}})}, destroyFrozenColumns:function(){return this.each(function(){if(this.grid&&!0===this.p.frozenColumns){a(this.grid.fhDiv).remove();a(this.grid.fbDiv).remove();this.grid.fhDiv=null;this.grid.fbDiv=null;a(this).unbind(".setFrozenColumns");if(!0===this.p.hoverrows){var b;a("#"+a.jgrid.jqID(this.p.id)).bind("mouseover",function(c){b=a(c.target).closest("tr.jqgrow");"ui-subgrid"!==a(b).attr("class")&&a(b).addClass("ui-state-hover")}).bind("mouseout",function(c){b=a(c.target).closest("tr.jqgrow");a(b).removeClass("ui-state-hover")})}this.p.frozenColumns= !1}})}})})(jQuery); (function(a){a.extend(a.jgrid,{showModal:function(a){a.w.show()},closeModal:function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},hideModal:function(d,b){b=a.extend({jqm:!0,gb:""},b||{});if(b.onClose){var c=b.gb&&"string"===typeof b.gb&&"#gbox_"===b.gb.substr(0,6)?b.onClose.call(a("#"+b.gb.substr(6))[0],d):b.onClose(d);if("boolean"===typeof c&&!c)return}if(a.fn.jqm&&!0===b.jqm)a(d).attr("aria-hidden","true").jqmHide();else{if(""!==b.gb)try{a(".jqgrid-overlay:first",b.gb).hide()}catch(e){}a(d).hide().attr("aria-hidden", "true")}},findPos:function(a){var b=0,c=0;if(a.offsetParent){do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent)}return[b,c]},createModal:function(d,b,c,e,g,h,f){var c=a.extend(!0,{},a.jgrid.jqModal||{},c),i=document.createElement("div"),j,n=this,f=a.extend({},f||{});j="rtl"==a(c.gbox).attr("dir")?!0:!1;i.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";i.id=d.themodal;var k=document.createElement("div");k.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"; k.id=d.modalhead;a(k).append(""+c.caption+"");var l=a("").hover(function(){l.addClass("ui-state-hover")},function(){l.removeClass("ui-state-hover")}).append("");a(k).append(l);j?(i.dir="rtl",a(".ui-jqdialog-title",k).css("float","right"),a(".ui-jqdialog-titlebar-close",k).css("left","0.3em")):(i.dir="ltr",a(".ui-jqdialog-title",k).css("float", "left"),a(".ui-jqdialog-titlebar-close",k).css("right","0.3em"));var m=document.createElement("div");a(m).addClass("ui-jqdialog-content ui-widget-content").attr("id",d.modalcontent);a(m).append(b);i.appendChild(m);a(i).prepend(k);!0===h?a("body").append(i):"string"===typeof h?a(h).append(i):a(i).insertBefore(e);a(i).css(f);void 0===c.jqModal&&(c.jqModal=!0);b={};if(a.fn.jqm&&!0===c.jqModal)0===c.left&&0===c.top&&c.overlay&&(f=[],f=a.jgrid.findPos(g),c.left=f[0]+4,c.top=f[1]+4),b.top=c.top+"px",b.left= c.left;else if(0!==c.left||0!==c.top)b.left=c.left,b.top=c.top+"px";a("a.ui-jqdialog-titlebar-close",k).click(function(){var b=a("#"+a.jgrid.jqID(d.themodal)).data("onClose")||c.onClose,e=a("#"+a.jgrid.jqID(d.themodal)).data("gbox")||c.gbox;n.hideModal("#"+a.jgrid.jqID(d.themodal),{gb:e,jqm:c.jqModal,onClose:b});return false});if(0===c.width||!c.width)c.width=300;if(0===c.height||!c.height)c.height=200;c.zIndex||(e=a(e).parents("*[role=dialog]").filter(":first").css("z-index"),c.zIndex=e?parseInt(e, 10)+2:950);e=0;j&&b.left&&!h&&(e=a(c.gbox).width()-(!isNaN(c.width)?parseInt(c.width,10):0)-8,b.left=parseInt(b.left,10)+parseInt(e,10));b.left&&(b.left+="px");a(i).css(a.extend({width:isNaN(c.width)?"auto":c.width+"px",height:isNaN(c.height)?"auto":c.height+"px",zIndex:c.zIndex,overflow:"hidden"},b)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":d.modalhead,"aria-hidden":"true"});void 0===c.drag&&(c.drag=!0);void 0===c.resize&&(c.resize=!0);if(c.drag)if(a(k).css("cursor","move"),a.fn.jqDrag)a(i).jqDrag(k); else try{a(i).draggable({handle:a("#"+a.jgrid.jqID(k.id))})}catch(o){}if(c.resize)if(a.fn.jqResize)a(i).append("
"),a("#"+a.jgrid.jqID(d.themodal)).jqResize(".jqResize",d.scrollelm?"#"+a.jgrid.jqID(d.scrollelm):!1);else try{a(i).resizable({handles:"se, sw",alsoResize:d.scrollelm?"#"+a.jgrid.jqID(d.scrollelm):!1})}catch(p){}!0===c.closeOnEscape&&a(i).keydown(function(b){if(b.which==27){b=a("#"+a.jgrid.jqID(d.themodal)).data("onClose")|| c.onClose;n.hideModal("#"+a.jgrid.jqID(d.themodal),{gb:c.gbox,jqm:c.jqModal,onClose:b})}})},viewModal:function(d,b){b=a.extend({toTop:!0,overlay:10,modal:!1,overlayClass:"ui-widget-overlay",onShow:a.jgrid.showModal,onHide:a.jgrid.closeModal,gbox:"",jqm:!0,jqM:!0},b||{});if(a.fn.jqm&&!0===b.jqm)b.jqM?a(d).attr("aria-hidden","false").jqm(b).jqmShow():a(d).attr("aria-hidden","false").jqmShow();else{""!==b.gbox&&(a(".jqgrid-overlay:first",b.gbox).show(),a(d).data("gbox",b.gbox));a(d).show().attr("aria-hidden", "false");try{a(":input:visible",d)[0].focus()}catch(c){}}},info_dialog:function(d,b,c,e){var g={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:[]};a.extend(!0,g,a.jgrid.jqModal||{},{caption:""+d+""},e||{});var h=g.jqModal,f=this;a.fn.jqm&&!h&&(h=!1);d="";if(0"+g.buttons[e].text+"";e=isNaN(g.dataheight)?g.dataheight:g.dataheight+"px";b="
"+("
"+b+"
");b+=c?"
"+ c+""+d+"
":""!==d?"
"+d+"
":"";b+="
";try{"false"==a("#info_dialog").attr("aria-hidden")&&a.jgrid.hideModal("#info_dialog",{jqm:h}),a("#info_dialog").remove()}catch(i){}a.jgrid.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},b,g,"","",!0);d&&a.each(g.buttons, function(d){a("#"+a.jgrid.jqID(this.id),"#info_id").bind("click",function(){g.buttons[d].onClick.call(a("#info_dialog"));return!1})});a("#closedialog","#info_id").click(function(){f.hideModal("#info_dialog",{jqm:h});return!1});a(".fm-button","#info_dialog").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a.isFunction(g.beforeOpen)&&g.beforeOpen();a.jgrid.viewModal("#info_dialog",{onHide:function(a){a.w.hide().remove();a.o&&a.o.remove()},modal:g.modal, jqm:h});a.isFunction(g.afterOpen)&&g.afterOpen();try{a("#info_dialog").focus()}catch(j){}},bindEv:function(d,b,c){a.isFunction(b.dataInit)&&b.dataInit.call(c,d);b.dataEvents&&a.each(b.dataEvents,function(){void 0!==this.data?a(d).bind(this.type,this.data,this.fn):a(d).bind(this.type,this.fn)})},createEl:function(d,b,c,e,g){function h(d,b,c){var e="dataInit,dataEvents,dataUrl,buildSelect,sopt,searchhidden,defaultValue,attr,custom_element,custom_value".split(",");void 0!==c&&a.isArray(c)&&a.merge(e, c);a.each(b,function(b,c){-1===a.inArray(b,e)&&a(d).attr(b,c)});b.hasOwnProperty("id")||a(d).attr("id",a.jgrid.randId())}var f="",i=this;switch(d){case "textarea":f=document.createElement("textarea");e?b.cols||a(f).css({width:"98%"}):b.cols||(b.cols=20);b.rows||(b.rows=2);if(" "==c||" "==c||1==c.length&&160==c.charCodeAt(0))c="";f.value=c;h(f,b);a(f).attr({role:"textbox",multiline:"true"});break;case "checkbox":f=document.createElement("input");f.type="checkbox";b.value?(d=b.value.split(":"), c===d[0]&&(f.checked=!0,f.defaultChecked=!0),f.value=d[0],a(f).attr("offval",d[1])):(d=c.toLowerCase(),0>d.search(/(false|0|no|off|undefined)/i)&&""!==d?(f.checked=!0,f.defaultChecked=!0,f.value=c):f.value="on",a(f).attr("offval","off"));h(f,b,["value"]);a(f).attr("role","checkbox");break;case "select":f=document.createElement("select");f.setAttribute("role","select");e=[];!0===b.multiple?(d=!0,f.multiple="multiple",a(f).attr("aria-multiselectable","true")):d=!1;if(void 0!==b.dataUrl)d=b.name?(""+ b.id).substring(0,(""+b.id).length-(""+b.name).length-1):""+b.id,e=b.postData||g.postData,i.p&&i.p.idPrefix?d=a.jgrid.stripPref(i.p.idPrefix,d):e=void 0,a.ajax(a.extend({url:b.dataUrl,type:"GET",dataType:"html",data:a.isFunction(e)?e.call(i,d,c,""+b.name):e,context:{elem:f,options:b,vl:c},success:function(b){var d=[],c=this.elem,e=this.vl,f=a.extend({},this.options),g=f.multiple===true;a.isFunction(f.buildSelect)&&(b=f.buildSelect.call(i,b));if(b=a(b).html()){a(c).append(b);h(c,f);if(f.size===void 0)f.size= g?3:1;if(g){d=e.split(",");d=a.map(d,function(d){return a.trim(d)})}else d[0]=a.trim(e);setTimeout(function(){a("option",c).each(function(b){if(b===0&&c.multiple)this.selected=false;a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),d)>-1||a.inArray(a.trim(a(this).val()),d)>-1)this.selected="selected"})},0)}}},g||{}));else if(b.value){var j;void 0===b.size&&(b.size=d?3:1);d&&(e=c.split(","),e=a.map(e,function(d){return a.trim(d)}));"function"===typeof b.value&&(b.value=b.value());var n, k,l=void 0===b.separator?":":b.separator,g=void 0===b.delimiter?";":b.delimiter;if("string"===typeof b.value){n=b.value.split(g);for(j=0;j0)return a}).join(l));g=document.createElement("option");g.setAttribute("role","option");g.value=k[0];g.innerHTML=k[1];f.appendChild(g);if(!d&&(a.trim(k[0])==a.trim(c)||a.trim(k[1])==a.trim(c)))g.selected="selected";if(d&&(-1j.length||1>c[a[f]]||12j.length||1>c[a[h]]||31(0===c[a[e]]%4&&(0!==c[a[e]]%100||0===c[a[e]]%400)?29:28)||c[a[h]]>i[c[a[f]]]?!1:!0},isEmpty:function(a){return a.match(/^\s+$/)||""===a?!0:!1},checkTime:function(d){var b=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!a.jgrid.isEmpty(d))if(d=d.match(b)){if(d[3]){if(1>d[1]||12parseFloat(h.maxValue))return[!1,f+": "+a.jgrid.edit.msg.maxValue+" "+h.maxValue,""];if(!0===h.email&&!(!1===e&&a.jgrid.isEmpty(d))&&(g=/^((([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, !g.test(d)))return[!1,f+": "+a.jgrid.edit.msg.email,""];if(!0===h.integer&&!(!1===e&&a.jgrid.isEmpty(d))&&(isNaN(d)||0!==d%1||-1!=d.indexOf(".")))return[!1,f+": "+a.jgrid.edit.msg.integer,""];if(!0===h.date&&!(!1===e&&a.jgrid.isEmpty(d))&&(b=c.p.colModel[b].formatoptions&&c.p.colModel[b].formatoptions.newformat?c.p.colModel[b].formatoptions.newformat:c.p.colModel[b].datefmt||"Y-m-d",!a.jgrid.checkDate(b,d)))return[!1,f+": "+a.jgrid.edit.msg.date+" - "+b,""];if(!0===h.time&&!(!1===e&&a.jgrid.isEmpty(d))&& !a.jgrid.checkTime(d))return[!1,f+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(!0===h.url&&!(!1===e&&a.jgrid.isEmpty(d))&&(g=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i,!g.test(d)))return[!1,f+": "+a.jgrid.edit.msg.url,""];if(!0===h.custom&&!(!1===e&&a.jgrid.isEmpty(d)))return a.isFunction(h.custom_func)?(d=h.custom_func.call(c,d,f),a.isArray(d)?d:[!1,a.jgrid.edit.msg.customarray,""]):[!1,a.jgrid.edit.msg.customfcheck, ""]}return[!0,"",""]}})})(jQuery); (function(a){var b={};a.jgrid.extend({searchGrid:function(b){b=a.extend(!0,{recreateFilter:!1,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,jqModal:!0,modal:!1,resize:!0,width:450,height:"auto",dataheight:"auto",showQuery:!1, errorcheck:!0,sopt:null,stringResult:void 0,onClose:null,onSearch:null,onReset:null,toTop:!0,overlay:30,columns:[],tmplNames:null,tmplFilters:null,tmplLabel:" Template: ",showOnLoad:!1,layer:null},a.jgrid.search,b||{});return this.each(function(){function c(d){s=a(e).triggerHandler("jqGridFilterBeforeShow",[d]);void 0===s&&(s=!0);s&&a.isFunction(b.beforeShowSearch)&&(s=b.beforeShowSearch.call(e,d));s&&(a.jgrid.viewModal("#"+a.jgrid.jqID(t.themodal),{gbox:"#gbox_"+a.jgrid.jqID(h),jqm:b.jqModal,modal:b.modal, overlay:b.overlay,toTop:b.toTop}),a(e).triggerHandler("jqGridFilterAfterShow",[d]),a.isFunction(b.afterShowSearch)&&b.afterShowSearch.call(e,d))}var e=this;if(e.grid){var h="fbox_"+e.p.id,s=!0,t={themodal:"searchmod"+h,modalhead:"searchhd"+h,modalcontent:"searchcnt"+h,scrollelm:h},r=e.p.postData[b.sFilter];"string"===typeof r&&(r=a.jgrid.parse(r));!0===b.recreateFilter&&a("#"+a.jgrid.jqID(t.themodal)).remove();if(void 0!==a("#"+a.jgrid.jqID(t.themodal))[0])c(a("#fbox_"+a.jgrid.jqID(+e.p.id)));else{var p= a("
").insertBefore("#gview_"+a.jgrid.jqID(e.p.id)),f="left",i="";"rtl"==e.p.direction&&(f="right",i=" style='text-align:left'",p.attr("dir","rtl"));var m=a.extend([],e.p.colModel),w=""+b.Find+"",d=""+ b.Reset+"",n="",g="",o,l=!1,q=-1;b.showQuery&&(n="Query");b.columns.length?m=b.columns:a.each(m,function(a,b){if(!b.label)b.label=e.p.colNames[a];if(!l){var d=b.search===void 0?true:b.search,c=b.hidden===true;if(b.searchoptions&&b.searchoptions.searchhidden===true&&d||d&&!c){l=true;o=b.index||b.name;q=a}}});if(!r&&o||!1===b.multipleSearch){var x= "eq";0<=q&&m[q].searchoptions&&m[q].searchoptions.sopt?x=m[q].searchoptions.sopt[0]:b.sopt&&b.sopt.length&&(x=b.sopt[0]);r={groupOp:"AND",rules:[{field:o,op:x,data:""}]}}l=!1;b.tmplNames&&b.tmplNames.length&&(l=!0,g=b.tmplLabel,g+="");f="

"+d+g+""+n+w+"
";h=a.jgrid.jqID(h);a("#"+h).jqFilter({columns:m,filter:b.loadDefaults?r:null,showQuery:b.showQuery,errorcheck:b.errorcheck,sopt:b.sopt,groupButton:b.multipleGroup,ruleButtons:b.multipleSearch,afterRedraw:b.afterRedraw,_gridsopt:a.jgrid.search.odata,ajaxSelectOptions:e.p.ajaxSelectOptions,groupOps:b.groupOps,onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString());a.isFunction(b.afterChange)&& b.afterChange.call(e,a("#"+h),b)},direction:e.p.direction});p.append(f);l&&b.tmplFilters&&b.tmplFilters.length&&a(".ui-template",p).bind("change",function(){var d=a(this).val();d=="default"?a("#"+h).jqFilter("addFilter",r):a("#"+h).jqFilter("addFilter",b.tmplFilters[parseInt(d,10)]);return false});!0===b.multipleGroup&&(b.multipleSearch=!0);a(e).triggerHandler("jqGridFilterInitialize",[a("#"+h)]);a.isFunction(b.onInitializeSearch)&&b.onInitializeSearch.call(e,a("#"+h));b.gbox="#gbox_"+h;b.layer?a.jgrid.createModal(t, p,b,"#gview_"+a.jgrid.jqID(e.p.id),a("#gbox_"+a.jgrid.jqID(e.p.id))[0],"#"+a.jgrid.jqID(b.layer),{position:"relative"}):a.jgrid.createModal(t,p,b,"#gview_"+a.jgrid.jqID(e.p.id),a("#gbox_"+a.jgrid.jqID(e.p.id))[0]);(b.searchOnEnter||b.closeOnEscape)&&a("#"+a.jgrid.jqID(t.themodal)).keydown(function(d){var c=a(d.target);if(b.searchOnEnter&&d.which===13&&!c.hasClass("add-group")&&!c.hasClass("add-rule")&&!c.hasClass("delete-group")&&!c.hasClass("delete-rule")&&(!c.hasClass("fm-button")||!c.is("[id$=_query]"))){a("#"+ h+"_search").focus().click();return false}if(b.closeOnEscape&&d.which===27){a("#"+a.jgrid.jqID(t.modalhead)).find(".ui-jqdialog-titlebar-close").focus().click();return false}});n&&a("#"+h+"_query").bind("click",function(){a(".queryresult",p).toggle();return false});void 0===b.stringResult&&(b.stringResult=b.multipleSearch);a("#"+h+"_search").bind("click",function(){var d=a("#"+h),c={},g,k=d.jqFilter("filterData");if(b.errorcheck){d[0].hideError();b.showQuery||d.jqFilter("toSQLString");if(d[0].p.error){d[0].showError(); return false}}if(b.stringResult){try{g=xmlJsonClass.toJson(k,"","",false)}catch(i){try{g=JSON.stringify(k)}catch(f){}}if(typeof g==="string"){c[b.sFilter]=g;a.each([b.sField,b.sValue,b.sOper],function(){c[this]=""})}}else if(b.multipleSearch){c[b.sFilter]=k;a.each([b.sField,b.sValue,b.sOper],function(){c[this]=""})}else{c[b.sField]=k.rules[0].field;c[b.sValue]=k.rules[0].data;c[b.sOper]=k.rules[0].op;c[b.sFilter]=""}e.p.search=true;a.extend(e.p.postData,c);a(e).triggerHandler("jqGridFilterSearch"); a.isFunction(b.onSearch)&&b.onSearch.call(e);a(e).trigger("reloadGrid",[{page:1}]);b.closeAfterSearch&&a.jgrid.hideModal("#"+a.jgrid.jqID(t.themodal),{gb:"#gbox_"+a.jgrid.jqID(e.p.id),jqm:b.jqModal,onClose:b.onClose});return false});a("#"+h+"_reset").bind("click",function(){var d={},c=a("#"+h);e.p.search=false;b.multipleSearch===false?d[b.sField]=d[b.sValue]=d[b.sOper]="":d[b.sFilter]="";c[0].resetFilter();l&&a(".ui-template",p).val("default");a.extend(e.p.postData,d);a(e).triggerHandler("jqGridFilterReset"); a.isFunction(b.onReset)&&b.onReset.call(e);a(e).trigger("reloadGrid",[{page:1}]);return false});c(a("#"+h));a(".fm-button:not(.ui-state-disabled)",p).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},editGridRow:function(u,c){c=a.extend(!0,{top:0,left:0,width:300,datawidth:"auto",height:"auto",dataheight:"auto",modal:!1,overlay:30,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:{},recreateForm:!1,jqModal:!0,closeOnEscape:!1,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[!1,13],navkeys:[!1,38,40],checkOnSubmit:!1,checkOnUpdate:!1,_savedData:{},processing:!1,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:!0},a.jgrid.edit,c||{});b[a(this)[0].p.id]= c;return this.each(function(){function e(){a(l+" > tbody > tr > td > .FormElement").each(function(){var b=a(".customelement",this);if(b.length){var c=a(b[0]).attr("name");a.each(d.p.colModel,function(){if(this.name===c&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{if(j[c]=this.editoptions.custom_value.call(d,a("#"+a.jgrid.jqID(c),l),"get"),void 0===j[c])throw"e1";}catch(b){"e1"===b?a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue, a.jgrid.edit.bClose):a.jgrid.info_dialog(a.jgrid.errors.errcap,b.message,a.jgrid.edit.bClose)}return!0}})}else{switch(a(this).get(0).type){case "checkbox":a(this).is(":checked")?j[this.name]=a(this).val():(b=a(this).attr("offval"),j[this.name]=b);break;case "select-one":j[this.name]=a("option:selected",this).val();B[this.name]=a("option:selected",this).text();break;case "select-multiple":j[this.name]=a(this).val();j[this.name]=j[this.name]?j[this.name].join(","):"";var e=[];a("option:selected",this).each(function(d, b){e[d]=a(b).text()});B[this.name]=e.join(",");break;case "password":case "text":case "textarea":case "button":j[this.name]=a(this).val()}d.p.autoencode&&(j[this.name]=a.jgrid.htmlEncode(j[this.name]))}});return!0}function h(c,e,k,j){var i,f,l,q=0,h,p,o,m=[],y=!1,u="",n;for(n=1;n<=j;n++)u+="  ";"_empty"!=c&&(y=a(e).jqGrid("getInd",c));a(e.p.colModel).each(function(n){i=this.name;p=(f=this.editrules&&!0===this.editrules.edithidden?!1:!0=== this.hidden?!0:!1)?"style='display:none'":"";if("cb"!==i&&"subgrid"!==i&&!0===this.editable&&"rn"!==i){if(!1===y)h="";else if(i==e.p.ExpandColumn&&!0===e.p.treeGrid)h=a("td[role='gridcell']:eq("+n+")",e.rows[y]).text();else{try{h=a.unformat.call(e,a("td[role='gridcell']:eq("+n+")",e.rows[y]),{rowId:c,colModel:this},n)}catch(s){h=this.edittype&&"textarea"==this.edittype?a("td[role='gridcell']:eq("+n+")",e.rows[y]).text():a("td[role='gridcell']:eq("+n+")",e.rows[y]).html()}if(!h||" "==h||" "== h||1==h.length&&160==h.charCodeAt(0))h=""}var r=a.extend({},this.editoptions||{},{id:i,name:i}),v=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:!1,rowcontent:""},this.formoptions||{}),t=parseInt(v.rowpos,10)||q+1,x=parseInt(2*(parseInt(v.colpos,10)||1),10);"_empty"==c&&r.defaultValue&&(h=a.isFunction(r.defaultValue)?r.defaultValue.call(d):r.defaultValue);this.edittype||(this.edittype="text");d.p.autoencode&&(h=a.jgrid.htmlDecode(h));o=a.jgrid.createEl.call(d,this.edittype,r,h,!1,a.extend({},a.jgrid.ajaxOptions, e.p.ajaxSelectOptions||{}));""===h&&"checkbox"==this.edittype&&(h=a(o).attr("offval"));""===h&&"select"==this.edittype&&(h=a("option:eq(0)",o).text());if(b[d.p.id].checkOnSubmit||b[d.p.id].checkOnUpdate)b[d.p.id]._savedData[i]=h;a(o).addClass("FormElement");-1"+v.rowcontent+""); a(k).append(z);z[0].rp=t}0===l.length&&(l=a("").addClass("FormData").attr("id","tr_"+i),a(l).append(u),a(k).append(l),l[0].rp=t);a("td:eq("+(x-2)+")",l[0]).html(void 0===v.label?e.p.colNames[n]:v.label);a("td:eq("+(x-1)+")",l[0]).append(v.elmprefix).append(o).append(v.elmsuffix);a.isFunction(r.custom_value)&&"_empty"!==c&&r.custom_value.call(d,a("#"+i,"#"+g),"set",h);a.jgrid.bindEv(o,r,d);m[q]=n;q++}});if(0