From 5744f200bfc3bce95eb1254ae9c85dc9eef32752 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 23 Sep 2011 18:36:05 +0200 Subject: Upgrade to jqGrid v4.1.2 --- docs/src/INSTALL.t2t | 181 ++++++++++++++- static/js/i18n/grid.locale-fi.js | 92 ++++---- static/js/jquery.jqGrid.min.js | 459 +++++++++++++++++++++------------------ 3 files changed, 465 insertions(+), 267 deletions(-) diff --git a/docs/src/INSTALL.t2t b/docs/src/INSTALL.t2t index f411d5e99..f8366c968 100644 --- a/docs/src/INSTALL.t2t +++ b/docs/src/INSTALL.t2t @@ -14,27 +14,186 @@ Last update: %%date(%m-%d-%Y) - [postgres http://www.postgresql.org/] version 8.x - [gettext http://www.gnu.org/software/gettext/] - [psycopg2 http://freshmeat.net/projects/psycopg/] +- [python-pisa http://pypi.python.org/pypi/pisa/] +- [django-registration https://bitbucket.org/ubernostrum/django-registration/] +- [django-formwizard http://django-formwizard.readthedocs.org/en/latest/] - [django-simple-history https://bitbucket.org/q/django-simple-history/src] version 1.0 -- registration -- libjs-jquery -- libjs-jquery-ui -- django-formwizard +- [jquery http://jquery.com/] +- [jquery-ui http://jqueryui.com/] +- [xhtml2odt http://xhtml2odt.org/] +- python-utidylib +- python-lxml +- python-imaging + + +Optionaly: + - curl (to fetch towns from OSM) -- python-pisa -To install django-simple-history: + +The easier way to obtain most these packages is to get them from your favorite Linux distribution repositories. +For instance the packages for Debian squeeze are get with: +``` +$ apt-get install apache2 python python-django python-psycopg2 gettext postgresql-8.4 libjs-jquery libjs-jquery-ui python-pisa python-django-registration python-utidylib , python-lxml, python-imaging +``` +If these packages do not exist in your distribution's repository, please refer to the applications websites. + +django-simple-history, django-formwizard and xhtml2odt are usually not packaged. + +To install django-simple-history (mercurial package is needed): +``` +$ hg clone -r 1.0 http://bitbucket.org/q/django-simple-history +$ cd django-simple-history +$ python setup.py install +``` + +To install django-formwizard (git package is needed): +``` +$ git clone https://github.com/stephrdev/django-formwizard.git +$ cd django-formwizard +$ git checkout 0.5 +$ python setup.py install +``` + +To install django-formwizard (git package is needed): +``` +$ git clone git://gitorious.org/xhtml2odt/xhtml2odt.git +``` +(don't forget the path you have installed this library: you'll have to set it in your settings) + +If you want to take the bleeding edge version git is necessary. Install the appropriate package. + ++++ Database configuration +++ + +Now that postgres is installed, you need to create a new user for your ishtar instance: + +``` +createuser --echo --adduser --createdb --encrypted --pwprompt ishtar-user +``` + +Then, you have to create the database: + +``` +createdb --echo --owner ishtar-user --encoding UNICODE ishtar "My Ishtar database" +``` + ++++ Getting the sources +++ + +Currently only the git version is available (in the directory you have decided to place sources - for instance /var/local is a good idea): + +``` +cd /var/local/ +git clone git://lysithea.proxience.com/git/ishtar.git +``` + ++++ Install the sources +++ + +In your Ishtar application directory create settings.py to fit to your configuration. +A base template is provided (settings.py.example): + +``` +cd ishtar/ishtar/ +cp settings.py.example settings.py +nano settings.py +#### +ROOT_PATH = '/var/local/ishtar/ishtar/' + +URL_PATH = "" +JQUERY_URL = "/javascript/jquery/jquery.js" +JQUERY_UI_URL = "/javascript/jquery-ui/" +XHTML2ODT_PATH = ROOT_PATH + "../xhtml2odt" +ODT_TEMPLATE = ROOT_PATH + "../static/template.odt" + +LOGIN_REDIRECT_URL = "/" + URL_PATH + +(...) +DATABASES = { + 'default': { + 'ENGINE': 'django.contrib.gis.db.backends.postgis', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': 'ishtar', # Or path to database file if using sqlite3. + 'USER': 'user', # Not used with sqlite3. + 'PASSWORD': 'pass', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + } +} +(...) +#### +``` + ++++ Compiling languages +++ + +If your language is available in the locale directory of Ishtar, you will just need to get it compiled. Still being in the Ishtar directory, this can be done with (here, "de" stands for german. Replace it with the appropriate language code): + +``` +django-admin compilemessages -l de +``` + +If your language is not available, feel free to create the default po files and to submit it, contributions are well appreciated. Procedure is as follows : + +You first need to create the default po file (of course, replace "de" according to the language you chose to create) : + +``` +django-admin makemessages -l de +``` + +There should now be a django.po file in locale/de/LC_MESSAGES. Complete it with your translation. + +Now that the translation file is completed, just compile it the same way you would have if the language file was already available. + ++++ Database initialisation +++ + +Create the appropriate tables (still being in chimère application directory): + ``` -hg clone -r 1.0 http://bitbucket.org/q/django-simple-history -cd django-simple-history -python setup.py install +./manage.py syncdb ``` -git clone git://gitorious.org/xhtml2odt/xhtml2odt.git +You will be prompted for the creation of an administrator account (administration can be found at: http://where_is_ishtar/admin). +The database is set, congratulations! + ++++ Webserver configuration +++ + +++++ Apache configuration with mod_wsgi ++++ + +Install mod_wsgi for apache + +``` +sudo apt-get install libapache2-mod-wsgi +``` + +Create and edit a configuration for Chimère. + +``` +sudo mkdir /var/local/ishtar/apache +sudo cp /var/local/ishtar/docs/conf/django.wsgi /var/local/ishtar/apache/django.wsgi +sudo cp /var/local/ishtar/docs/conf/apache-wsgi.conf /etc/apache2/sites-available/ishtar +``` + +Adapt the files django.wsgi (with the correct sys path) and ishtar. + +To activate the website reload apache. + +``` +sudo a2ensite ishtar +sudo /etc/init.d/apache2 reload +``` + + +Now that you have gone through ALL this configuration procedure (which was not that hard after all) you can configure the site. + + + + +NOTES À NE PAS PRENDRE EN COMPTE + +""" INSTALL_PATH = "/home/etienne/work/ishtar/xhtml2odt" __init__.py => nécessite python-utidylib , python-lxml, python-imaging + Import towns: curl --location --globoff "http://openstreetmap.us/xapi/api/0.6/node[place=village|town|city][bbox=-5.53711,41.90228,8.96484,51.50874]" -o data.osm - +""" diff --git a/static/js/i18n/grid.locale-fi.js b/static/js/i18n/grid.locale-fi.js index 3744f9efa..9a07511d9 100644 --- a/static/js/i18n/grid.locale-fi.js +++ b/static/js/i18n/grid.locale-fi.js @@ -8,62 +8,60 @@ * http://www.gnu.org/licenses/gpl.html **/ $.jgrid = { - defaults : { - //recordtext: "Näytä {0} - {1} / {2}", - recordtext: " {0}-{1}/{2}", - emptyrecords: "Ei näytettäviä", + defaults: { + recordtext: "Rivit {0} - {1} / {2}", + emptyrecords: "Ei näytettäviä", loadtext: "Haetaan...", - //pgtext : "Sivu {0} / {1}" - pgtext : "{0}/{1}" + pgtext: "Sivu {0} / {1}" }, - search : { + search: { caption: "Etsi...", Find: "Etsi", Reset: "Tyhjää", - odata : ['=', '<>', '<', '<=','>','>=', 'alkaa','ei ala','joukossa','ei joukossa ','loppuu','ei lopu','sisältää','ei sisällä'], - groupOps: [ { op: "JA", text: "kaikki" }, { op: "TAI", text: "mikä tahansa" } ], - matchText: " match", - rulesText: " rules" + odata: ['=', '<>', '<', '<=','>','>=', 'alkaa','ei ala','joukossa','ei joukossa','loppuu','ei lopu','sisältää','ei sisällä'], + groupOps: [ { op: "AND", text: "kaikki" }, { op: "OR", text: "mikä tahansa" } ], + matchText: "  täytä ehdot:", + rulesText: "" }, - edit : { + edit: { addCaption: "Uusi rivi", - editCaption: "Muokkaa rivi", + editCaption: "Muokkaa riviä", bSubmit: "OK", bCancel: "Peru", bClose: "Sulje", - saveData: "Tietoja muutettu! Tallenetaanko?", - bYes : "K", - bNo : "E", - bExit : "Peru", + saveData: "Tietoja muutettu! Tallennetaanko?", + bYes: "K", + bNo: "E", + bExit: "Peru", msg: { - required:"pakollinen", - number:"Anna kelvollinen nro", - minValue:"arvo oltava >= ", - maxValue:"arvo oltava <= ", + required: "pakollinen", + number: "Anna kelvollinen nro", + minValue: "arvo oltava >= ", + maxValue: "arvo oltava <= ", email: "virheellinen sposti ", integer: "Anna kelvollinen kokonaisluku", date: "Anna kelvollinen pvm", url: "Ei ole sopiva linkki(URL). Alku oltava ('http://' tai 'https://')", - nodefined : " ei ole määritelty!", - novalue : " paluuarvo vaaditaan!", - customarray : "Custom function should return array!", - customfcheck : "Custom function should be present in case of custom checking!" + nodefined: " ei ole määritelty!", + novalue: " paluuarvo vaaditaan!", + customarray: "Custom function should return array!", + customfcheck: "Custom function should be present in case of custom checking!" } }, - view : { - caption: "Nä rivi", + view: { + caption: "Näytä rivi", bClose: "Sulje" }, - del : { + del: { caption: "Poista", - msg: "Poista valitut rivi(t)?", + msg: "Poista valitut rivit?", bSubmit: "Poista", bCancel: "Peru" }, - nav : { + nav: { edittext: " ", edittitle: "Muokkaa valittu rivi", - addtext:" ", + addtext: " ", addtitle: "Uusi rivi", deltext: " ", deltitle: "Poista valittu rivi", @@ -74,37 +72,37 @@ $.jgrid = { alertcap: "Varoitus", alerttext: "Valitse rivi", viewtext: "", - viewtitle: "Nayta valitut rivit" + viewtitle: "Näyta valitut rivit" }, - col : { - caption: "Nayta/Piilota sarakkeet", + col: { + caption: "Näyta/Piilota sarakkeet", bSubmit: "OK", bCancel: "Peru" }, errors : { - errcap : "Virhe", - nourl : "url asettamatta", + errcap: "Virhe", + nourl: "url asettamatta", norecords: "Ei muokattavia tietoja", - model : "Pituus colNames <> colModel!" + model: "Pituus colNames <> colModel!" }, - formatter : { - integer : {thousandsSeparator: "", defaultValue: '0'}, - number : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, defaultValue: '0,00'}, - currency : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'}, - date : { + formatter: { + integer: {thousandsSeparator: "", defaultValue: '0'}, + number: {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, defaultValue: '0,00'}, + currency: {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'}, + date: { dayNames: [ "Su", "Ma", "Ti", "Ke", "To", "Pe", "La", - "Sunnuntai", "Maanantai", "Tiista", "Keskiviikko", "Torstai", "Perjantai", "Lauantai" + "Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai" ], monthNames: [ "Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou", "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" ], - AmPm : ["am","pm","AM","PM"], + AmPm: ["am","pm","AM","PM"], S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'}, srcformat: 'Y-m-d', newformat: 'd/m/Y', - masks : { + masks: { ISO8601Long:"Y-m-d H:i:s", ISO8601Short:"Y-m-d", ShortDate: "d.m.Y", @@ -122,8 +120,8 @@ $.jgrid = { baseLinkUrl: '', showAction: '', target: '', - checkbox : {disabled:true}, - idName : 'id' + checkbox: {disabled:true}, + idName: 'id' } }; // FI diff --git a/static/js/jquery.jqGrid.min.js b/static/js/jquery.jqGrid.min.js index e265989b5..684aba850 100644 --- a/static/js/jquery.jqGrid.min.js +++ b/static/js/jquery.jqGrid.min.js @@ -1,217 +1,258 @@ /* -* jqGrid 3.8.2 - jQuery Grid +* jqGrid 4.1.2 - 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:2010-12-14 -* Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.postext.js; grid.jqueryui.js; +* Date:2011-07-20 +* Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.import.js; JsonXml.js; grid.jqueryui.js; */ -(function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{htmlDecode:function(f){if(f==" "||f==" "||f.length==1&&f.charCodeAt(0)==160)return"";return!f?f:String(f).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"')},htmlEncode:function(f){return!f?f:String(f).replace(/&/g,"&").replace(/>/g,">").replace(/])*>/gi;if(f)return(f=f.replace(j,""))&&f!==" "&&f!==" "?f.replace(/\"/g,"'"):"";else return f},stringToDoc:function(f){var j;if(typeof f!=="string")return f;try{j=(new DOMParser).parseFromString(f,"text/xml")}catch(i){j=new ActiveXObject("Microsoft.XMLDOM"); -j.async=false;j.loadXML(f)}return j&&j.documentElement&&j.documentElement.tagName!="parsererror"?j:null},parse:function(f){f=f;if(f.substr(0,9)=="while(1);")f=f.substr(9);if(f.substr(0,2)=="/*")f=f.substr(2,f.length-4);f||(f="{}");return b.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(f):eval("("+f+")")},parseDate:function(f,j){var i={m:1,d:1,y:1970,h:0,i:0,s:0},c,e,k;if(j&&j!==null&&j!==undefined){j=b.trim(j);j=j.split(/[\\\/:_;.\t\T\s-]/);f=f.split(/[\\\/:_;.\t\T\s-]/); -var n=b.jgrid.formatter.date.monthNames,a=b.jgrid.formatter.date.AmPm,r=function(t,B){if(t===0){if(B==12)B=0}else if(B!=12)B+=12;return B};c=0;for(e=f.length;c11)j[c]=k+1-12}if(f[c]=="a"){k=b.inArray(j[c],a);if(k!==-1&&k<2&&j[c]==a[k]){j[c]=k;i.h=r(j[c],i.h)}}if(f[c]=="A"){k=b.inArray(j[c],a);if(k!==-1&&k>1&&j[c]==a[k]){j[c]=k-2;i.h=r(j[c],i.h)}}if(j[c]!==undefined)i[f[c].toLowerCase()]= -parseInt(j[c],10)}i.m=parseInt(i.m,10)-1;f=i.y;if(f>=70&&f<=99)i.y=1900+i.y;else if(f>=0&&f<=69)i.y=2E3+i.y}return new Date(i.y,i.m,i.d,i.h,i.i,i.s,0)},jqID:function(f){f+="";return f.replace(/([\.\:\[\]])/g,"\\$1")},getAccessor:function(f,j){var i,c,e,k;if(typeof j==="function")return j(f);i=f[j];if(i===undefined)try{if(typeof j==="string")e=j.split(".");if(k=e.length)for(i=f;i&&k--;){c=e.shift();i=i[c]}}catch(n){}return i},ajaxOptions:{},from:function(f){return new (function(j,i){if(typeof j=="string")j= -b.data(j);var c=this,e=j,k=true,n=false,a=i,r=/[\$,%]/g,t=null,B=null,F=false,S="",J=[],N=true;if(typeof j=="object"&&j.push){if(j.length>0)N=typeof j[0]!="object"?false:true}else throw"data provides is not an array";this._hasData=function(){return e===null?false:e.length===0?false:true};this._getStr=function(l){var m=[];n&&m.push("jQuery.trim(");m.push("String("+l+")");n&&m.push(")");k||m.push(".toLowerCase()");return m.join("")};this._strComp=function(l){return typeof l=="string"?".toString()": -""};this._group=function(l,m){return{field:l.toString(),unique:m,items:[]}};this._toStr=function(l){if(n)l=b.trim(l);k||(l=l.toLowerCase());return l=l.toString().replace(new RegExp('\\"',"g"),'\\"')};this._funcLoop=function(l){var m=[];b.each(e,function(q,A){m.push(l(A))});return m};this._append=function(l){if(a===null)a="";else a+=S===""?" && ":S;if(F)a+="!";a+="("+l+")";F=false;S=""};this._setCommand=function(l,m){t=l;B=m};this._resetNegate=function(){F=false};this._repeatCommand=function(l,m){if(t=== -null)return c;if(l!=null&&m!=null)return t(l,m);if(B===null)return t(l);if(!N)return t(l);return t(B,l)};this._equals=function(l,m){return c._compare(l,m,1)===0};this._compare=function(l,m,q){if(q===undefined)q=1;if(l===undefined)l=null;if(m===undefined)m=null;if(l===null&&m===null)return 0;if(l===null&&m!==null)return 1;if(l!==null&&m===null)return-1;if(!k&&typeof l!=="number"&&typeof m!=="number"){l=String(l).toLowerCase();m=String(m).toLowerCase()}if(lm)return q;return 0};this._performSort= -function(){if(J.length!==0)e=c._doSort(e,0)};this._doSort=function(l,m){var q=J[m].by,A=J[m].dir,u=J[m].type,I=J[m].datefmt;if(m==J.length-1)return c._getOrder(l,q,A,u,I);m++;l=c._getGroup(l,q,A,u,I);q=[];for(A=0;A0};this.showQuery=function(l){var m=a;if(m===null)m= -"no query found";if(b.isFunction(l)){l(m);return c}return m};this.andNot=function(l,m,q){F=!F;return c.and(l,m,q)};this.orNot=function(l,m,q){F=!F;return c.or(l,m,q)};this.not=function(l,m,q){return c.andNot(l,m,q)};this.and=function(l,m,q){S=" && ";if(l===undefined)return c;return c._repeatCommand(l,m,q)};this.or=function(l,m,q){S=" || ";if(l===undefined)return c;return c._repeatCommand(l,m,q)};this.isNot=function(l){F=!F;return c.is(l)};this.is=function(l){c._append("this."+l);c._resetNegate(); -return c};this._compareValues=function(l,m,q,A,u){var I;I=N?"this."+m:"this";if(q===undefined)q=null;q=q===null?m:q;switch(u.stype===undefined?"text":u.stype){case "int":case "integer":q=isNaN(Number(q))?"0":q;I="parseInt("+I+",10)";q="parseInt("+q+",10)";break;case "float":case "number":case "numeric":q=String(q).replace(r,"");q=isNaN(Number(q))?"0":q;I="parseFloat("+I+")";q="parseFloat("+q+")";break;case "date":case "datetime":q=String(b.jgrid.parseDate(u.newfmt||"Y-m-d",q).getTime());I='jQuery.jgrid.parseDate("'+ -u.srcfmt+'",'+I+").getTime()";break;default:I=c._getStr(I);q=c._getStr('"'+c._toStr(q)+'"')}c._append(I+" "+A+" "+q);c._setCommand(l,m);c._resetNegate();return c};this.equals=function(l,m,q){return c._compareValues(c.equals,l,m,"==",q)};this.greater=function(l,m,q){return c._compareValues(c.greater,l,m,">",q)};this.less=function(l,m,q){return c._compareValues(c.less,l,m,"<",q)};this.greaterOrEquals=function(l,m,q){return c._compareValues(c.greaterOrEquals,l,m,">=",q)};this.lessOrEquals=function(l, -m,q){return c._compareValues(c.lessOrEquals,l,m,"<=",q)};this.startsWith=function(l,m){var q=m===undefined||m===null?l:m;q=n?b.trim(q.toString()).length:q.toString().length;if(N)c._append(c._getStr("this."+l)+".substr(0,"+q+") == "+c._getStr('"'+c._toStr(m)+'"'));else{q=n?b.trim(m.toString()).length:m.toString().length;c._append(c._getStr("this")+".substr(0,"+q+") == "+c._getStr('"'+c._toStr(l)+'"'))}c._setCommand(c.startsWith,l);c._resetNegate();return c};this.endsWith=function(l,m){var q=m===undefined|| -m===null?l:m;q=n?b.trim(q.toString()).length:q.toString().length;N?c._append(c._getStr("this."+l)+".substr("+c._getStr("this."+l)+".length-"+q+","+q+') == "'+c._toStr(m)+'"'):c._append(c._getStr("this")+".substr("+c._getStr("this")+'.length-"'+c._toStr(l)+'".length,"'+c._toStr(l)+'".length) == "'+c._toStr(l)+'"');c._setCommand(c.endsWith,l);c._resetNegate();return c};this.contains=function(l,m){N?c._append(c._getStr("this."+l)+'.indexOf("'+c._toStr(m)+'",0) > -1'):c._append(c._getStr("this")+'.indexOf("'+ -c._toStr(l)+'",0) > -1');c._setCommand(c.contains,l);c._resetNegate();return c};this.groupBy=function(l,m,q,A){if(!c._hasData())return null;return c._getGroup(e,l,m,q,A)};this.orderBy=function(l,m,q,A){m=m===undefined||m===null?"a":b.trim(m.toString().toLowerCase());if(q===null||q===undefined)q="text";if(A===null||A===undefined)A="Y-m-d";if(m=="desc"||m=="descending")m="d";if(m=="asc"||m=="ascending")m="a";J.push({by:l,dir:m,type:q,datefmt:A});return c};return c})(f,null)},extend:function(f){b.extend(b.fn.jqGrid, -f);this.no_legacy_api||b.fn.extend(f)}});b.fn.jqGrid=function(f){if(typeof f=="string"){var j=b.jgrid.getAccessor(b.fn.jqGrid,f);if(!j)throw"jqGrid - No such method: "+f;var i=b.makeArray(arguments).slice(1);return j.apply(this,i)}return this.each(function(){if(!this.grid){var c=b.extend(true,{url:"",height:150,page:1,rowNum:20,rowTotal:null,records:0,pager:"",pgbuttons:true,pginput:true,colModel:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",altRows:false,selarrrow:[], -savedRow:[],shrinkToFit:true,xmlReader:{},jsonReader:{},subGrid:false,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,onHeaderClick:null,viewrecords:false,loadonce:false,multiselect:false,multikey:false,editurl:null,search:false,caption:"",hidegrid:true, -hiddengrid:false,postData:{},userData:{},treeGrid:false,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:false,gridstate:"visible",cellEdit:false,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[false,""],scroll:false,multiboxonly:false,deselectAfterSort:true, -scrollrows:false,autowidth:false,scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:false,rownumWidth:25,rownumbers:false,pagerpos:"center",recordpos:"right",footerrow:false,userDataOnFooter:false,hoverrows:true,altclass:"ui-priority-secondary",viewsortcols:[false,"vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false,headertitles:false,scrollTimeout:40,data:[],_index:{},grouping:false,groupingView:{groupField:[],groupOrder:[], -groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:false,sortitems:[],sortnames:[],groupDataSorted:false,summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus",minusicon:"ui-icon-circlesmall-minus"},ignoreCase:false,cmTemplate:{}},b.jgrid.defaults,f||{}),e={headers:[],cols:[],footers:[],dragStart:function(d,g,h){this.resizing={idx:d,startX:g.clientX,sOL:h[0]};this.hDiv.style.cursor="col-resize";this.curGbox=b("#rs_m"+c.id,"#gbox_"+c.id);this.curGbox.css({display:"block",left:h[0], -top:h[1],height:h[2]});b.isFunction(c.resizeStart)&&c.resizeStart.call(this,g,d);document.onselectstart=function(){return false}},dragMove:function(d){if(this.resizing){var g=d.clientX-this.resizing.startX;d=this.headers[this.resizing.idx];var h=c.direction==="ltr"?d.width+g:d.width-g,o;if(h>33){this.curGbox.css({left:this.resizing.sOL+g});if(c.forceFit===true){o=this.headers[this.resizing.idx+c.nv];g=c.direction==="ltr"?o.width-g:o.width+g;if(g>33){d.newWidth=h;o.newWidth=g}}else{this.newWidth=c.direction=== -"ltr"?c.tblwidth+g:c.tblwidth-g;d.newWidth=h}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var d=this.resizing.idx,g=this.headers[d].newWidth||this.headers[d].width;g=parseInt(g,10);this.resizing=false;b("#rs_m"+c.id).css("display","none");c.colModel[d].width=g;this.headers[d].width=g;this.headers[d].el.style.width=g+"px";this.cols[d].style.width=g+"px";if(this.footers.length>0)this.footers[d].style.width=g+"px";if(c.forceFit===true){g=this.headers[d+c.nv].newWidth||this.headers[d+ -c.nv].width;this.headers[d+c.nv].width=g;this.headers[d+c.nv].el.style.width=g+"px";this.cols[d+c.nv].style.width=g+"px";if(this.footers.length>0)this.footers[d+c.nv].style.width=g+"px";c.colModel[d+c.nv].width=g}else{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;if(c.footerrow){b("table:first",this.sDiv).css("width",c.tblwidth+"px");this.sDiv.scrollLeft= -this.bDiv.scrollLeft}}b.isFunction(c.resizeStop)&&c.resizeStop.call(this,g,d)}this.curGbox=null;document.onselectstart=function(){return true}},populateVisible:function(){e.timer&&clearTimeout(e.timer);e.timer=null;var d=b(e.bDiv).height();if(d){var g=b("table:first",e.bDiv),h=b("> tbody > tr:gt(0):visible:first",g).outerHeight()||e.prevRowHeight;if(h){e.prevRowHeight=h;var o=c.rowNum,p=e.scrollTop=e.bDiv.scrollTop,x=Math.round(g.position().top)-p,w=x+g.height();h=h*o;var C,G,s;if(w=0||G<2||c.scroll===true){C=Math.round((w+p)/h)+1;x=-1}else x=1}if(x>0){C=parseInt(p/h,10)+1;G=parseInt((p+d)/h,10)+2-C;s=true}if(G)if(!(c.lastpage&&C>c.lastpage||c.lastpage==1))if(e.hDiv.loading)e.timer=setTimeout(e.populateVisible,c.scrollTimeout);else{c.page=C;if(s){e.selectionPreserver(g[0]);e.emptyRows(e.bDiv,false)}e.populate(G)}}}},scrollGrid:function(){if(c.scroll){var d=e.bDiv.scrollTop;if(e.scrollTop===undefined)e.scrollTop= -0;if(d!=e.scrollTop){e.scrollTop=d;e.timer&&clearTimeout(e.timer);e.timer=setTimeout(e.populateVisible,c.scrollTimeout)}}e.hDiv.scrollLeft=e.bDiv.scrollLeft;if(c.footerrow)e.sDiv.scrollLeft=e.bDiv.scrollLeft},selectionPreserver:function(d){var g=d.p,h=g.selrow,o=g.selarrrow?b.makeArray(g.selarrrow):null,p=d.grid.bDiv.scrollLeft,x=g.gridComplete;g.gridComplete=function(){g.selrow=null;g.selarrrow=[];if(g.multiselect&&o&&o.length>0)for(var w=0;w"),B,F=b.browser.msie?true:false, -S=b.browser.safari?true:false;a=this;a.p.direction=b.trim(a.p.direction.toLowerCase());if(b.inArray(a.p.direction,["ltr","rtl"])==-1)a.p.direction="ltr";n=a.p.direction;b(t).insertBefore(this);b(this).appendTo(t).removeClass("scroll");var J=b("
");b(J).insertBefore(t).attr({id:"gbox_"+this.id,dir:n});b(t).appendTo(J).attr("id","gview_"+this.id);B=F&&b.browser.version<=6?'': -"";b("
").append(B).insertBefore(t);b("
"+this.p.loadtext+"
").insertBefore(t);b(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var N=function(d,g){d=parseInt(d,10);return isNaN(d)?g?g:0:d},l=function(d,g,h){var o=a.p.colModel[d],p=o.align,x='style="', -w=o.classes,C=o.name;if(p)x+="text-align:"+p+";";if(o.hidden===true)x+="display:none;";if(g===0)x+="width: "+e.headers[d].width+"px;";x+='"'+(w!==undefined?' class="'+w+'"':"")+(o.title&&h?' title="'+b.jgrid.stripHtml(h)+'"':"");x+=' aria-describedby="'+a.p.id+"_"+C+'"';return x},m=function(d){return d===undefined||d===null||d===""?" ":a.p.autoencode?b.jgrid.htmlEncode(d):d+""},q=function(d,g,h,o,p){var x=a.p.colModel[h];if(typeof x.formatter!=="undefined"){d={rowId:d,colModel:x,gid:a.p.id,pos:h}; -g=b.isFunction(x.formatter)?x.formatter.call(a,g,d,o,p):b.fmatter?b.fn.fmatter(x.formatter,g,d,o,p):m(g)}else g=m(g);return g},A=function(d,g,h,o,p){d=q(d,g,h,p,"add");return'"+d+""},u=function(d,g,h){d='';return'"+d+""},I=function(d,g,h,o){h=(parseInt(h,10)-1)*parseInt(o,10)+1+g;return'"+h+""},U=function(d){var g,h=[],o=0,p;for(p=0;pdiv:first",d).css({height:"auto"}).children("div:first").css({height:0,display:"none"});d.scrollTop=0}},aa=function(){var d=a.p.data.length,g,h,o;g=a.p.rownumbers===true?1:0;h=a.p.multiselect===true?1:0;o=a.p.subGrid===true?1:0;g=a.p.keyIndex===false||a.p.loadonce===true?a.p.localReader.id:a.p.colModel[a.p.keyIndex+h+o+g].name;for(h=0;h1?h:1;var s,v=0,y,D,K=0,H=0,E=0,Q,z=[],W,T={},O,M,X=[],na=a.p.altRows===true?" "+a.p.altclass:"";a.p.xmlReader.repeatitems||(z=U(G));Q=a.p.keyIndex===false?a.p.xmlReader.id:a.p.keyIndex;if(z.length>0&&!isNaN(Q)){if(a.p.remapColumns&& -a.p.remapColumns.length)Q=b.inArray(Q,a.p.remapColumns);Q=z[Q]}G=(Q+"").indexOf("[")===-1?z.length?function(ca,Y){return b(Q,ca).text()||Y}:function(ca,Y){return b(a.p.xmlReader.cell,ca).eq(Q).text()||Y}:function(ca,Y){return ca.getAttribute(Q.replace(/[\[\]]/g,""))||Y};a.p.userData={};b(a.p.xmlReader.page,d).each(function(){a.p.page=this.textContent||this.text||0});b(a.p.xmlReader.total,d).each(function(){a.p.lastpage=this.textContent||this.text;if(a.p.lastpage===undefined)a.p.lastpage=1});b(a.p.xmlReader.records, -d).each(function(){a.p.records=this.textContent||this.text||0});b(a.p.xmlReader.userdata,d).each(function(){a.p.userData[this.getAttribute("name")]=this.textContent||this.text});(d=b(a.p.xmlReader.root+" "+a.p.xmlReader.row,d))||(d=[]);var fa=d.length,Z=0;if(d&&fa){var ga=parseInt(a.p.rowNum,10),qa=a.p.scroll?(parseInt(a.p.page,10)-1)*ga+1:1;if(p)ga*=p+1;p=b.isFunction(a.p.afterInsertRow);var ha={},xa="";if(a.p.grouping&&a.p.groupingView.groupCollapse===true)xa=' style="display:none;"';for(;Z');if(a.p.rownumbers===true){X.push(I(0,Z,a.p.page,a.p.rowNum));E=1}if(a.p.multiselect===true){X.push(u(M,E,Z));K=1}if(a.p.subGrid===true){X.push(b(a).jqGrid("addSubGridCell",K+E,Z+h));H=1}if(a.p.xmlReader.repeatitems){W||(W=$(K+H+E));var Ba=b(a.p.xmlReader.cell,O);b.each(W,function(ca){var Y=Ba[this];if(!Y)return false;y=Y.textContent||Y.text;T[a.p.colModel[ca+ -K+H+E].name]=y;X.push(A(M,y,ca+K+H+E,Z+h,O))})}else for(s=0;s");if(a.p.grouping){s=a.p.groupingView.groupField.length;D=[];for(var ya=0;ya-1?a.p.treeANode:0;D=b(X.join(""))[0];b(a.rows[Z+s]).after(D); -try{b(a).jqGrid("setTreeNode",T,D)}catch(Ia){}}else b("tbody:first",g).append(X.join(""));if(a.p.subGrid===true)try{b(a).jqGrid("addSubGrid",a.rows[a.rows.length-1],K+E)}catch(Ja){}p&&a.p.afterInsertRow.call(a,M,T,O);X=[]}T={};v++;Z++;if(v==ga)break}}if(a.p.gridview===true)if(a.p.grouping){b(a).jqGrid("groupingRender",ha,a.p.colModel.length);ha=null}else b("tbody:first",g).append(X.join(""));a.p.totaltime=new Date-x;if(v>0)if(a.p.records===0)a.p.records=fa;X=null;if(!a.p.treeGrid&&!a.p.scroll)a.grid.bDiv.scrollTop= -0;a.p.reccount=v;a.p.treeANode=-1;a.p.userDataOnFooter&&b(a).jqGrid("footerData","set",a.p.userData,true);if(w){a.p.records=fa;a.p.lastpage=Math.ceil(fa/ga)}o||a.updatepager(false,true);if(w){for(;v1?h:1;var w,C,G=a.p.datatype!="local"&&a.p.loadonce||a.p.datatype=="jsonstring";if(G){a.p.data=[];a.p._index={};w=a.p.localReader.id="_id_"}a.p.reccount=0;if(a.p.datatype=="local"){g=a.p.localReader;C="local"}else{g=a.p.jsonReader;C="json"}var s=0,v,y,D,K=[],H,E=0,Q=0,z=0,W,T,O={},M;D=[];var X=a.p.altRows===true?" "+a.p.altclass:"";a.p.page=b.jgrid.getAccessor(d,g.page)||0;W=b.jgrid.getAccessor(d, -g.total);a.p.lastpage=W===undefined?1:W;a.p.records=b.jgrid.getAccessor(d,g.records)||0;a.p.userData=b.jgrid.getAccessor(d,g.userdata)||{};g.repeatitems||(H=K=U(C));C=a.p.keyIndex===false?g.id:a.p.keyIndex;if(K.length>0&&!isNaN(C)){if(a.p.remapColumns&&a.p.remapColumns.length)C=b.inArray(C,a.p.remapColumns);C=K[C]}(T=b.jgrid.getAccessor(d,g.root))||(T=[]);W=T.length;d=0;var na=parseInt(a.p.rowNum,10),fa=a.p.scroll?(parseInt(a.p.page,10)-1)*na+1:1;if(p)na*=p+1;var Z=b.isFunction(a.p.afterInsertRow), -ga={},qa="";if(a.p.grouping&&a.p.groupingView.groupCollapse===true)qa=' style="display:none;"';for(;d');if(a.p.rownumbers===true){D.push(I(0,d,a.p.page,a.p.rowNum));z=1}if(a.p.multiselect){D.push(u(M,z,d));E=1}if(a.p.subGrid){D.push(b(a).jqGrid("addSubGridCell", -E+z,d+h));Q=1}if(g.repeatitems){if(g.cell)p=b.jgrid.getAccessor(p,g.cell);H||(H=$(E+Q+z))}for(y=0;y");if(a.p.grouping){v=a.p.groupingView.groupField.length;y=[];for(var ha=0;ha-1?a.p.treeANode: -0;D=b(D.join(""))[0];b(a.rows[d+v]).after(D);try{b(a).jqGrid("setTreeNode",O,D)}catch(xa){}}else b("#"+a.p.id+" tbody:first").append(D.join(""));if(a.p.subGrid===true)try{b(a).jqGrid("addSubGrid",a.rows[a.rows.length-1],E+z)}catch(Ba){}Z&&a.p.afterInsertRow.call(a,M,O,p);D=[]}O={};s++;d++;if(s==na)break}if(a.p.gridview===true)a.p.grouping?b(a).jqGrid("groupingRender",ga,a.p.colModel.length):b("#"+a.p.id+" tbody:first").append(D.join(""));a.p.totaltime=new Date-x;if(s>0)if(a.p.records===0)a.p.records= -W;if(!a.p.treeGrid&&!a.p.scroll)a.grid.bDiv.scrollTop=0;a.p.reccount=s;a.p.treeANode=-1;a.p.userDataOnFooter&&b(a).jqGrid("footerData","set",a.p.userData,true);if(G){a.p.records=W;a.p.lastpage=Math.ceil(W/na)}o||a.updatepager(false,true);if(G){for(;s1)if(p.npage!==null){h[p.npage]=d;C=d-1;d=1}else x=function(s){a.p.page++;a.grid.hDiv.loading=false;w&&a.p.loadComplete.call(a,s);ia(d-1)};else p.npage!==null&&delete a.p.postData[p.npage];if(a.p.grouping){b(a).jqGrid("groupingSetup"); -if(a.p.groupingView.groupDataSorted===true)h[p.sort]=a.p.groupingView.groupField[0]+" "+a.p.groupingView.groupOrder[0]+", "+h[p.sort]}b.extend(a.p.postData,h);var G=!a.p.scroll?1:a.rows.length-1;if(b.isFunction(a.p.datatype))a.p.datatype.call(a,a.p.postData,"load_"+a.p.id);else{b.isFunction(a.p.beforeRequest)&&a.p.beforeRequest.call(a);o=a.p.datatype.toLowerCase();switch(o){case "json":case "jsonp":case "xml":case "script":b.ajax(b.extend({url:a.p.url,type:a.p.mtype,dataType:o,data:b.isFunction(a.p.serializeGridData)? -a.p.serializeGridData.call(a,a.p.postData):a.p.postData,success:function(s){o==="xml"?ea(s,a.grid.bDiv,G,d>1,C):L(s,a.grid.bDiv,G,d>1,C);x&&x.call(a,s);g&&a.grid.populateVisible();if(a.p.loadonce||a.p.treeGrid)a.p.datatype="local";oa()},error:function(s,v,y){b.isFunction(a.p.loadError)&&a.p.loadError.call(a,s,v,y);oa()},beforeSend:function(s){ra();b.isFunction(a.p.loadBeforeSend)&&a.p.loadBeforeSend.call(a,s)}},b.jgrid.ajaxOptions,a.p.ajaxGridOptions));break;case "xmlstring":ra();h=b.jgrid.stringToDoc(a.p.datastr); -ea(h,a.grid.bDiv);w&&a.p.loadComplete.call(a,h);a.p.datatype="local";a.p.datastr=null;oa();break;case "jsonstring":ra();h=typeof a.p.datastr=="string"?b.jgrid.parse(a.p.datastr):a.p.datastr;L(h,a.grid.bDiv);w&&a.p.loadComplete.call(a,h);a.p.datatype="local";a.p.datastr=null;oa();break;case "local":case "clientside":ra();a.p.datatype="local";h=da();L(h,a.grid.bDiv,G,d>1,C);x&&x.call(a,h);g&&a.grid.populateVisible();oa();break}}}};B=function(d,g){var h="",o="", -p="",x,w,C,G,s=function(v){var y;if(b.isFunction(a.p.onPaging))y=a.p.onPaging.call(a,v);a.p.selrow=null;if(a.p.multiselect){a.p.selarrrow=[];b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false)}a.p.savedRow=[];if(y=="stop")return false;return true};d=d.substr(1);x="pg_"+d;w=d+"_left";C=d+"_center";G=d+"_right";b("#"+d).append("
").attr("dir","ltr");if(a.p.rowList.length>0){p="";p+=""}if(n=="rtl")o+=p;if(a.p.pginput===true)h=""+b.jgrid.format(a.p.pgtext||"","","")+"";if(a.p.pgbuttons===true){w=["first"+g,"prev"+g,"next"+g,"last"+g];n=="rtl"&&w.reverse();o+="";o+="";o+=h!==""?""+ -h+"":"";o+="";o+=""}else if(h!=="")o+=h;if(n=="ltr")o+=p;o+="";a.p.viewrecords===true&&b("td#"+d+"_"+a.p.recordpos,"#"+x).append("
");b("td#"+d+"_"+a.p.pagerpos,"#"+x).append(o);p=b(".ui-jqgrid").css("font-size")||"11px";b(document.body).append("");o=b(o).clone().appendTo("#testpg").width();b("#testpg").remove();if(o>0){if(h!="")o+=50;b("td#"+d+"_"+a.p.pagerpos,"#"+x).width(o)}a.p._nvtd=[];a.p._nvtd[0]=o?Math.floor((a.p.width-o)/2):Math.floor(a.p.width/3);a.p._nvtd[1]=0;o=null;b(".ui-pg-selbox", -"#"+x).bind("change",function(){a.p.page=Math.round(a.p.rowNum*(a.p.page-1)/this.value-0.5)+1;a.p.rowNum=this.value;if(g)b(".ui-pg-selbox",a.p.pager).val(this.value);else a.p.toppager&&b(".ui-pg-selbox",a.p.toppager).val(this.value);if(!s("records"))return false;ia();return false});if(a.p.pgbuttons===true){b(".ui-pg-button","#"+x).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"+g+", #prev"+g+", #next"+g+", #last"+g,"#"+d).click(function(){var v=N(a.p.page,1),y=N(a.p.lastpage,1),D=false,K=true,H=true,E=true,Q=true;if(y===0||y===1)Q=E=H=K=false;else if(y>1&&v>=1)if(v===1)H=K=false;else{if(!(v>1&&v1&&v===0){Q=E=false;v=y-1}if(this.id==="first"+g&&K){a.p.page=1;D=true}if(this.id==="prev"+g&&H){a.p.page=v-1;D=true}if(this.id==="next"+g&&E){a.p.page=v+1;D=true}if(this.id==="last"+g&&Q){a.p.page=y;D=true}if(D){if(!s(this.id))return false; -ia()}return false})}a.p.pginput===true&&b("input.ui-pg-input","#"+x).keypress(function(v){if((v.charCode?v.charCode:v.keyCode?v.keyCode:0)==13){a.p.page=b(this).val()>0?b(this).val():a.p.page;if(!s("user"))return false;ia();return false}return this})};var Ca=function(d,g,h,o){if(a.p.colModel[g].sortable)if(!(a.p.savedRow.length>0)){if(!h){if(a.p.lastsort==g)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[g].firstsortorder|| -"asc";a.p.page=1}if(o)if(a.p.lastsort==g&&a.p.sortorder==o&&!h)return;else a.p.sortorder=o;h=b("thead:first",a.grid.hDiv).get(0);b("tr th:eq("+a.p.lastsort+") span.ui-grid-ico-sort",h).addClass("ui-state-disabled");b("tr th:eq("+a.p.lastsort+")",h).attr("aria-selected","false");b("tr th:eq("+g+") span.ui-icon-"+a.p.sortorder,h).removeClass("ui-state-disabled");b("tr th:eq("+g+")",h).attr("aria-selected","true");if(!a.p.viewsortcols[0])if(a.p.lastsort!=g){b("tr th:eq("+a.p.lastsort+") span.s-ico", -h).hide();b("tr th:eq("+g+") span.s-ico",h).show()}d=d.substring(5);a.p.sortname=a.p.colModel[g].index||d;h=a.p.sortorder;if(b.isFunction(a.p.onSortCol))if(a.p.onSortCol.call(a,d,g,h)=="stop"){a.p.lastsort=g;return}if(a.p.datatype=="local")a.p.deselectAfterSort&&b(a).jqGrid("resetSelection");else{a.p.selrow=null;a.p.multiselect&&b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false);a.p.selarrrow=[];a.p.savedRow=[]}if(a.p.scroll){h=a.grid.bDiv.scrollLeft;P(a.grid.bDiv,true);a.grid.hDiv.scrollLeft= -h}a.p.subGrid&&a.p.datatype=="local"&&b("td.sgexpanded","#"+a.p.id).each(function(){b(this).trigger("click")});ia();a.p.lastsort=g;if(a.p.sortname!=d&&g)a.p.lastsort=g}},Fa=function(d){var g=d,h;for(h=d+1;h");this.p.colModel.unshift({name:"cb",width:S?a.p.multiselectWidth+a.p.cellLayout:a.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}if(this.p.rownumbers){this.p.colNames.unshift("");this.p.colModel.unshift({name:"rn",width:a.p.rownumWidth, +(function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{htmlDecode:function(f){if(f&&(f==" "||f==" "||f.length==1&&f.charCodeAt(0)==160))return"";return!f?f:String(f).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"')},htmlEncode:function(f){return!f?f:String(f).replace(/&/g,"&").replace(/>/g,">").replace(/])*>/gi;if(f)return(f=f.replace(j,""))&&f!==" "&&f!==" "?f.replace(/\"/g,"'"):"";else return f},stringToDoc:function(f){var j;if(typeof f!=="string")return f;try{j=(new DOMParser).parseFromString(f,"text/xml")}catch(h){j= +new ActiveXObject("Microsoft.XMLDOM");j.async=false;j.loadXML(f)}return j&&j.documentElement&&j.documentElement.tagName!="parsererror"?j:null},parse:function(f){if(f.substr(0,9)=="while(1);")f=f.substr(9);if(f.substr(0,2)=="/*")f=f.substr(2,f.length-4);f||(f="{}");return b.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(f):eval("("+f+")")},parseDate:function(f,j){var h={m:1,d:1,y:1970,h:0,i:0,s:0},c,g,k;c=/[\\\/:_;.,\t\T\s-]/;if(j&&j!==null&&j!==undefined){j= +b.trim(j);j=j.split(c);f=f.split(c);var l=b.jgrid.formatter.date.monthNames,a=b.jgrid.formatter.date.AmPm,q=function(x,y){if(x===0){if(y==12)y=0}else if(y!=12)y+=12;return y};c=0;for(g=f.length;c11)j[c]=k+1-12}if(f[c]=="a"){k=b.inArray(j[c],a);if(k!==-1&&k<2&&j[c]==a[k]){j[c]=k;h.h=q(j[c],h.h)}}if(f[c]=="A"){k=b.inArray(j[c],a);if(k!==-1&&k>1&&j[c]==a[k]){j[c]=k-2;h.h=q(j[c],h.h)}}if(j[c]!== +undefined)h[f[c].toLowerCase()]=parseInt(j[c],10)}h.m=parseInt(h.m,10)-1;c=h.y;if(c>=70&&c<=99)h.y=1900+h.y;else if(c>=0&&c<=69)h.y=2E3+h.y}return new Date(h.y,h.m,h.d,h.h,h.i,h.s,0)},jqID:function(f){return String(f).replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},guid:1,uidPref:"jqg",randId:function(f){return(f?f:b.jgrid.uidPref)+b.jgrid.guid++},getAccessor:function(f,j){var h,c,g=[],k;if(typeof j==="function")return j(f);h=f[j];if(h===undefined)try{if(typeof j==="string")g=j.split("."); +if(k=g.length)for(h=f;h&&k--;){c=g.shift();h=h[c]}}catch(l){}return h},ajaxOptions:{},from:function(f){return new function(j,h){if(typeof j=="string")j=b.data(j);var c=this,g=j,k=true,l=false,a=h,q=/[\$,%]/g,x=null,y=null,H=0,L=false,M="",P=[],U=true;if(typeof j=="object"&&j.push){if(j.length>0)U=typeof j[0]!="object"?false:true}else throw"data provides is not an array";this._hasData=function(){return g===null?false:g.length===0?false:true};this._getStr=function(o){var m=[];l&&m.push("jQuery.trim("); +m.push("String("+o+")");l&&m.push(")");k||m.push(".toLowerCase()");return m.join("")};this._strComp=function(o){return typeof o=="string"?".toString()":""};this._group=function(o,m){return{field:o.toString(),unique:m,items:[]}};this._toStr=function(o){if(l)o=b.trim(o);k||(o=o.toLowerCase());return o=o.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"')};this._funcLoop=function(o){var m=[];b.each(g,function(r,D){m.push(o(D))});return m};this._append=function(o){var m;if(a===null)a="";else a+=M=== +""?" && ":M;for(m=0;mm)return r;return 0};this._performSort=function(){if(P.length!==0)g=c._doSort(g,0)};this._doSort=function(o,m){var r=P[m].by,D=P[m].dir,T=P[m].type,I=P[m].datefmt;if(m==P.length-1)return c._getOrder(o,r,D,T,I);m++;r=c._getGroup(o,r,D,T,I);D=[];for(T=0;T0};this.andNot=function(o,m,r){L=!L;return c.and(o,m,r)};this.orNot=function(o,m,r){L=!L;return c.or(o,m,r)};this.not=function(o,m,r){return c.andNot(o,m,r)};this.and=function(o,m,r){M=" && ";if(o===undefined)return c;return c._repeatCommand(o,m,r)};this.or=function(o,m,r){M=" || ";if(o===undefined)return c;return c._repeatCommand(o,m,r)};this.orBegin=function(){H++;return c};this.orEnd=function(){if(a!==null)a+=")";return c};this.isNot=function(o){L=!L;return c.is(o)}; +this.is=function(o){c._append("this."+o);c._resetNegate();return c};this._compareValues=function(o,m,r,D,T){var I;I=U?"jQuery.jgrid.getAccessor(this,'"+m+"')":"this";if(r===undefined)r=null;var C=r,ca=T.stype===undefined?"text":T.stype;if(r!==null)switch(ca){case "int":case "integer":C=isNaN(Number(C))||C===""?"0":C;I="parseInt("+I+",10)";C="parseInt("+C+",10)";break;case "float":case "number":case "numeric":C=String(C).replace(q,"");C=isNaN(Number(C))||C===""?"0":C;I="parseFloat("+I+")";C="parseFloat("+ +C+")";break;case "date":case "datetime":C=String(b.jgrid.parseDate(T.newfmt||"Y-m-d",C).getTime());I='jQuery.jgrid.parseDate("'+T.srcfmt+'",'+I+").getTime()";break;default:I=c._getStr(I);C=c._getStr('"'+c._toStr(C)+'"')}c._append(I+" "+D+" "+C);c._setCommand(o,m);c._resetNegate();return c};this.equals=function(o,m,r){return c._compareValues(c.equals,o,m,"==",r)};this.notEquals=function(o,m,r){return c._compareValues(c.equals,o,m,"!==",r)};this.isNull=function(o,m,r){return c._compareValues(c.equals, +o,null,"===",r)};this.greater=function(o,m,r){return c._compareValues(c.greater,o,m,">",r)};this.less=function(o,m,r){return c._compareValues(c.less,o,m,"<",r)};this.greaterOrEquals=function(o,m,r){return c._compareValues(c.greaterOrEquals,o,m,">=",r)};this.lessOrEquals=function(o,m,r){return c._compareValues(c.lessOrEquals,o,m,"<=",r)};this.startsWith=function(o,m){var r=m===undefined||m===null?o:m;r=l?b.trim(r.toString()).length:r.toString().length;if(U)c._append(c._getStr("jQuery.jgrid.getAccessor(this,'"+ +o+"')")+".substr(0,"+r+") == "+c._getStr('"'+c._toStr(m)+'"'));else{r=l?b.trim(m.toString()).length:m.toString().length;c._append(c._getStr("this")+".substr(0,"+r+") == "+c._getStr('"'+c._toStr(o)+'"'))}c._setCommand(c.startsWith,o);c._resetNegate();return c};this.endsWith=function(o,m){var r=m===undefined||m===null?o:m;r=l?b.trim(r.toString()).length:r.toString().length;U?c._append(c._getStr("jQuery.jgrid.getAccessor(this,'"+o+"')")+".substr("+c._getStr("jQuery.jgrid.getAccessor(this,'"+o+"')")+ +".length-"+r+","+r+') == "'+c._toStr(m)+'"'):c._append(c._getStr("this")+".substr("+c._getStr("this")+'.length-"'+c._toStr(o)+'".length,"'+c._toStr(o)+'".length) == "'+c._toStr(o)+'"');c._setCommand(c.endsWith,o);c._resetNegate();return c};this.contains=function(o,m){U?c._append(c._getStr("jQuery.jgrid.getAccessor(this,'"+o+"')")+'.indexOf("'+c._toStr(m)+'",0) > -1'):c._append(c._getStr("this")+'.indexOf("'+c._toStr(o)+'",0) > -1');c._setCommand(c.contains,o);c._resetNegate();return c};this.groupBy= +function(o,m,r,D){if(!c._hasData())return null;return c._getGroup(g,o,m,r,D)};this.orderBy=function(o,m,r,D){m=m===undefined||m===null?"a":b.trim(m.toString().toLowerCase());if(r===null||r===undefined)r="text";if(D===null||D===undefined)D="Y-m-d";if(m=="desc"||m=="descending")m="d";if(m=="asc"||m=="ascending")m="a";P.push({by:o,dir:m,type:r,datefmt:D});return c};return c}(f,null)},extend:function(f){b.extend(b.fn.jqGrid,f);this.no_legacy_api||b.fn.extend(f)}});b.fn.jqGrid=function(f){if(typeof f== +"string"){var j=b.jgrid.getAccessor(b.fn.jqGrid,f);if(!j)throw"jqGrid - No such method: "+f;var h=b.makeArray(arguments).slice(1);return j.apply(this,h)}return this.each(function(){if(!this.grid){var c=b.extend(true,{url:"",height:150,page:1,rowNum:20,rowTotal:null,records:0,pager:"",pgbuttons:true,pginput:true,colModel:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",altRows:false,selarrrow:[],savedRow:[],shrinkToFit:true,xmlReader:{},jsonReader:{},subGrid:false,subGridModel:[], +reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,onHeaderClick:null,viewrecords:false,loadonce:false,multiselect:false,multikey:false,editurl:null,search:false,caption:"",hidegrid:true,hiddengrid:false,postData:{},userData:{},treeGrid:false,treeGridModel:"nested",treeReader:{}, +treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:false,gridstate:"visible",cellEdit:false,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[false,""],scroll:false,multiboxonly:false,deselectAfterSort:true,scrollrows:false,autowidth:false,scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20, +gridview:false,rownumWidth:25,rownumbers:false,pagerpos:"center",recordpos:"right",footerrow:false,userDataOnFooter:false,hoverrows:true,altclass:"ui-priority-secondary",viewsortcols:[false,"vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false,headertitles:false,scrollTimeout:40,data:[],_index:{},grouping:false,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:false,sortitems:[], +sortnames:[],groupDataSorted:false,summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus",minusicon:"ui-icon-circlesmall-minus"},ignoreCase:false,cmTemplate:{}},b.jgrid.defaults,f||{}),g={headers:[],cols:[],footers:[],dragStart:function(e,d,i){this.resizing={idx:e,startX:d.clientX,sOL:i[0]};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:i[0],top:i[1],height:i[2]});b.isFunction(c.resizeStart)&& +c.resizeStart.call(this,d,e);document.onselectstart=function(){return false}},dragMove:function(e){if(this.resizing){var d=e.clientX-this.resizing.startX;e=this.headers[this.resizing.idx];var i=c.direction==="ltr"?e.width+d:e.width-d,n;if(i>33){this.curGbox.css({left:this.resizing.sOL+d});if(c.forceFit===true){n=this.headers[this.resizing.idx+c.nv];d=c.direction==="ltr"?n.width-d:n.width+d;if(d>33){e.newWidth=i;n.newWidth=d}}else{this.newWidth=c.direction==="ltr"?c.tblwidth+d:c.tblwidth-d;e.newWidth= +i}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var e=this.resizing.idx,d=this.headers[e].newWidth||this.headers[e].width;d=parseInt(d,10);this.resizing=false;b("#rs_m"+b.jgrid.jqID(c.id)).css("display","none");c.colModel[e].width=d;this.headers[e].width=d;this.headers[e].el.style.width=d+"px";this.cols[e].style.width=d+"px";if(this.footers.length>0)this.footers[e].style.width=d+"px";if(c.forceFit===true){d=this.headers[e+c.nv].newWidth||this.headers[e+c.nv].width;this.headers[e+ +c.nv].width=d;this.headers[e+c.nv].el.style.width=d+"px";this.cols[e+c.nv].style.width=d+"px";if(this.footers.length>0)this.footers[e+c.nv].style.width=d+"px";c.colModel[e+c.nv].width=d}else{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;if(c.footerrow){b("table:first",this.sDiv).css("width",c.tblwidth+"px");this.sDiv.scrollLeft=this.bDiv.scrollLeft}}b.isFunction(c.resizeStop)&& +c.resizeStop.call(this,d,e)}this.curGbox=null;document.onselectstart=function(){return true}},populateVisible:function(){g.timer&&clearTimeout(g.timer);g.timer=null;var e=b(g.bDiv).height();if(e){var d=b("table:first",g.bDiv),i,n;if(d[0].rows.length)try{n=(i=d[0].rows[1])?b(i).outerHeight()||g.prevRowHeight:g.prevRowHeight}catch(p){n=g.prevRowHeight}if(n){g.prevRowHeight=n;var A=c.rowNum;i=g.scrollTop=g.bDiv.scrollTop;var s=Math.round(d.position().top)-i,E=s+d.height();n*=A;var u,z,w;if(E=0||z<2||c.scroll===true){u=Math.round((E+i)/n)+1;s=-1}else s=1}if(s>0){u=parseInt(i/n,10)+1;z=parseInt((i+e)/n,10)+2-u;w=true}if(z)if(!(c.lastpage&&u>c.lastpage||c.lastpage==1||u===c.page&&u===c.lastpage))if(g.hDiv.loading)g.timer=setTimeout(g.populateVisible,c.scrollTimeout);else{c.page=u;if(w){g.selectionPreserver(d[0]);g.emptyRows(g.bDiv,false,false)}g.populate(z)}}}},scrollGrid:function(e){if(c.scroll){var d= +g.bDiv.scrollTop;if(g.scrollTop===undefined)g.scrollTop=0;if(d!=g.scrollTop){g.scrollTop=d;g.timer&&clearTimeout(g.timer);g.timer=setTimeout(g.populateVisible,c.scrollTimeout)}}g.hDiv.scrollLeft=g.bDiv.scrollLeft;if(c.footerrow)g.sDiv.scrollLeft=g.bDiv.scrollLeft;e&&e.stopPropagation()},selectionPreserver:function(e){var d=e.p,i=d.selrow,n=d.selarrrow?b.makeArray(d.selarrrow):null,p=e.grid.bDiv.scrollLeft,A=d.gridComplete;d.gridComplete=function(){d.selrow=null;d.selarrrow=[];if(d.multiselect&&n&& +n.length>0)for(var s=0;s"),x,y=b.browser.msie?true:false,H=b.browser.webkit||b.browser.safari?true:false;a=this;a.p.direction=b.trim(a.p.direction.toLowerCase());if(b.inArray(a.p.direction,["ltr","rtl"])==-1)a.p.direction="ltr";l=a.p.direction;b(q).insertBefore(this);b(this).appendTo(q).removeClass("scroll");var L=b("
");b(L).insertBefore(q).attr({id:"gbox_"+this.id,dir:l});b(q).appendTo(L).attr("id","gview_"+ +this.id);x=y&&b.browser.version<=6?'':"";b("
").append(x).insertBefore(q);b("
"+this.p.loadtext+"
").insertBefore(q);b(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect, +"aria-labelledby":"gbox_"+this.id});var M=function(e,d){e=parseInt(e,10);return isNaN(e)?d?d:0:e},P=function(e,d,i,n,p,A){var s=a.p.colModel[e],E=s.align,u='style="',z=s.classes,w=s.name,t=[];if(E)u+="text-align:"+E+";";if(s.hidden===true)u+="display:none;";if(d===0)u+="width: "+g.headers[e].width+"px;";else if(s.cellattr&&b.isFunction(s.cellattr))if((e=s.cellattr.call(a,p,i,n,s,A))&&typeof e==="string"){e=e.replace(/style/i,"style").replace(/title/i,"title");if(e.indexOf("title")>-1)s.title=false; +if(e.indexOf("class")>-1)z=undefined;t=e.split("style");if(t.length===2){t[1]=b.trim(t[1].replace("=",""));if(t[1].indexOf("'")===0||t[1].indexOf('"')===0)t[1]=t[1].substring(1);u+=t[1].replace(/'/gi,'"')}else u+='"'}if(!t.length){t[0]="";u+='"'}u+=(z!==undefined?' class="'+z+'"':"")+(s.title&&i?' title="'+b.jgrid.stripHtml(i)+'"':"");u+=' aria-describedby="'+a.p.id+"_"+w+'"';return u+t[0]},U=function(e){return e===undefined||e===null||e===""?" ":a.p.autoencode?b.jgrid.htmlEncode(e):e+""},o= +function(e,d,i,n,p){var A=a.p.colModel[i];if(typeof A.formatter!=="undefined"){e={rowId:e,colModel:A,gid:a.p.id,pos:i};d=b.isFunction(A.formatter)?A.formatter.call(a,d,e,n,p):b.fmatter?b.fn.fmatter(A.formatter,d,e,n,p):U(d)}else d=U(d);return d},m=function(e,d,i,n,p){d=o(e,d,i,p,"add");return'"+d+""},r=function(e,d,i){var n='';return'"+n+""},D=function(e,d,i,n){i=(parseInt(i,10)-1)*parseInt(n,10)+1+d;return'"+i+""},T=function(e){var d,i=[],n=0,p;for(p=0;pdiv:first",e).css({height:"auto"}).children("div:first").css({height:0,display:"none"});e.scrollTop=0}if(i===true)if(a.p.treeGrid===true){a.p.data=[];a.p._index={}}},ca=function(){var e= +a.p.data.length,d,i,n;d=a.p.rownumbers===true?1:0;i=a.p.multiselect===true?1:0;n=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+i+n+d].name;for(i=0;i1?i:1;var u,z,w=0,t,F=0,S=0,N=0,K,O=[],Y,J={},v,B,G=[],ia=a.p.altRows===true?" "+a.p.altclass:"";a.p.xmlReader.repeatitems||(O=T(E));K=a.p.keyIndex===false?a.p.xmlReader.id:a.p.keyIndex;if(O.length>0&&!isNaN(K)){if(a.p.remapColumns&&a.p.remapColumns.length)K=b.inArray(K,a.p.remapColumns);K=O[K]}E=(K+"").indexOf("[")===-1?O.length?function(ga,aa){return b(K,ga).text()||aa}:function(ga,aa){return b(a.p.xmlReader.cell,ga).eq(K).text()||aa}:function(ga,aa){return ga.getAttribute(K.replace(/[\[\]]/g, +""))||aa};a.p.userData={};b(a.p.xmlReader.page,e).each(function(){a.p.page=this.textContent||this.text||0});b(a.p.xmlReader.total,e).each(function(){a.p.lastpage=this.textContent||this.text;if(a.p.lastpage===undefined)a.p.lastpage=1});b(a.p.xmlReader.records,e).each(function(){a.p.records=this.textContent||this.text||0});b(a.p.xmlReader.userdata,e).each(function(){a.p.userData[this.getAttribute("name")]=this.textContent||this.text});(e=b(a.p.xmlReader.root+" "+a.p.xmlReader.row,e))||(e=[]);var ba= +e.length,W=0,Z={},ha;if(e&&ba){ha=parseInt(a.p.rowNum,10);var pa=a.p.scroll?b.jgrid.randId():1;if(p)ha*=p+1;p=b.isFunction(a.p.afterInsertRow);var qa="";if(a.p.grouping&&a.p.groupingView.groupCollapse===true)qa=' style="display:none;"';for(;W');if(a.p.rownumbers===true){G.push(D(0,W,a.p.page,a.p.rowNum));N=1}if(a.p.multiselect=== +true){G.push(r(B,N,W));F=1}if(a.p.subGrid===true){G.push(b(a).jqGrid("addSubGridCell",F+N,W+i));S=1}if(a.p.xmlReader.repeatitems){Y||(Y=I(F+S+N));var Ba=b(a.p.xmlReader.cell,v);b.each(Y,function(ga){var aa=Ba[this];if(!aa)return false;t=aa.textContent||aa.text;J[a.p.colModel[ga+F+S+N].name]=t;G.push(m(B,t,ga+F+S+N,W+i,v))})}else for(u=0;u");if(a.p.grouping){u=a.p.groupingView.groupField.length; +for(var xa=[],ya=0;ya-1?a.p.treeANode:0;if(a.p.grouping){b(a).jqGrid("groupingRender",Z,a.p.colModel.length);Z=null}else a.p.treeGrid===true&&z> +0?b(a.rows[z]).after(G.join("")):b("tbody:first",d).append(G.join(""))}if(a.p.subGrid===true)try{b(a).jqGrid("addSubGrid",F+N)}catch(Ha){}a.p.totaltime=new Date-A;if(w>0)if(a.p.records===0)a.p.records=ba;G=null;if(a.p.treeGrid===true)try{b(a).jqGrid("setTreeNode",z+1,w+z+1)}catch(Ia){}if(!a.p.treeGrid&&!a.p.scroll)a.grid.bDiv.scrollTop=0;a.p.reccount=w;a.p.treeANode=-1;a.p.userDataOnFooter&&b(a).jqGrid("footerData","set",a.p.userData,true);if(s){a.p.records=ba;a.p.lastpage=Math.ceil(ba/ha)}n||a.updatepager(false, +true);if(s)for(;w1?i:1;var s, +E=a.p.datatype!="local"&&a.p.loadonce||a.p.datatype=="jsonstring";if(E){a.p.data=[];a.p._index={};a.p.localReader.id="_id_"}a.p.reccount=0;if(a.p.datatype=="local"){d=a.p.localReader;s="local"}else{d=a.p.jsonReader;s="json"}var u=0,z,w,t=[],F,S=0,N=0,K=0,O,Y,J={},v,B,G=[],ia=a.p.altRows===true?" "+a.p.altclass:"";a.p.page=b.jgrid.getAccessor(e,d.page)||0;O=b.jgrid.getAccessor(e,d.total);a.p.lastpage=O===undefined?1:O;a.p.records=b.jgrid.getAccessor(e,d.records)||0;a.p.userData=b.jgrid.getAccessor(e, +d.userdata)||{};d.repeatitems||(F=t=T(s));s=a.p.keyIndex===false?d.id:a.p.keyIndex;if(t.length>0&&!isNaN(s)){if(a.p.remapColumns&&a.p.remapColumns.length)s=b.inArray(s,a.p.remapColumns);s=t[s]}(Y=b.jgrid.getAccessor(e,d.root))||(Y=[]);O=Y.length;e=0;var ba=parseInt(a.p.rowNum,10),W=a.p.scroll?b.jgrid.randId():1;if(p)ba*=p+1;var Z=b.isFunction(a.p.afterInsertRow),ha={},pa="";if(a.p.grouping&&a.p.groupingView.groupCollapse===true)pa=' style="display:none;"';for(;e');if(a.p.rownumbers===true){G.push(D(0,e,a.p.page,a.p.rowNum));K=1}if(a.p.multiselect){G.push(r(B,K,e));S=1}if(a.p.subGrid){G.push(b(a).jqGrid("addSubGridCell",S+K,e+i));N=1}if(d.repeatitems){if(d.cell)p=b.jgrid.getAccessor(p,d.cell);F||(F=I(S+N+K))}for(w=0;w< +F.length;w++){z=b.jgrid.getAccessor(p,F[w]);G.push(m(B,z,w+S+N+K,e+i,p));J[a.p.colModel[w+S+N+K].name]=z}G.push("");if(a.p.grouping){z=a.p.groupingView.groupField.length;w=[];for(var qa=0;qa-1?a.p.treeANode:0;if(a.p.grouping)b(a).jqGrid("groupingRender",ha,a.p.colModel.length);else a.p.treeGrid===true&&v>0?b(a.rows[v]).after(G.join("")):b("#"+b.jgrid.jqID(a.p.id)+" tbody:first").append(G.join(""))}if(a.p.subGrid===true)try{b(a).jqGrid("addSubGrid",S+K)}catch(Ba){}a.p.totaltime=new Date-A;if(u>0)if(a.p.records===0)a.p.records=O;if(a.p.treeGrid===true)try{b(a).jqGrid("setTreeNode",v+1,u+v+1)}catch(xa){}if(!a.p.treeGrid&& +!a.p.scroll)a.grid.bDiv.scrollTop=0;a.p.reccount=u;a.p.treeANode=-1;a.p.userDataOnFooter&&b(a).jqGrid("footerData","set",a.p.userData,true);if(E){a.p.records=O;a.p.lastpage=Math.ceil(O/ba)}n||a.updatepager(false,true);if(E)for(;u0&&ia&&t.or();try{e(v.groups[G])}catch(ha){alert(ha)}B++}ia&&t.orEnd()}if(v.rules!==undefined){if(B>0){ia=t.select();t=b.jgrid.from(ia)}try{(ba=v.rules.length&&v.groupOp.toString().toUpperCase()==="OR")&&t.orBegin();for(G=0;G0&&W&&W==="OR")t=t.or();t=w[Z.op](t,W)(Z.field,Z.data,n[Z.field])}B++}ba&&t.orEnd()}catch(pa){alert(pa)}}}var d,i=false,n={},p=[],A=[],s,E,u;if(b.isArray(a.p.data)){var z=a.p.grouping?a.p.groupingView:false;b.each(a.p.colModel,function(){E=this.sorttype||"text";if(E=="date"||E=="datetime"){if(this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"){s=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat: +b.jgrid.formatter.date.srcformat;u=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:b.jgrid.formatter.date.newformat}else s=u=this.datefmt||"Y-m-d";n[this.name]={stype:E,srcfmt:s,newfmt:u}}else n[this.name]={stype:E,srcfmt:"",newfmt:""};if(a.p.grouping&&this.name==z.groupField[0]){var v=this.name;if(typeof this.index!="undefined")v=this.index;p[0]=n[v];A.push(v)}if(!i&&(this.index==a.p.sortname||this.name==a.p.sortname)){d=this.name;i=true}});if(a.p.treeGrid)b(a).jqGrid("SortTree", +d,a.p.sortorder,n[d].stype,n[d].srcfmt);else{var w={eq:function(v){return v.equals},ne:function(v){return v.notEquals},lt:function(v){return v.less},le:function(v){return v.lessOrEquals},gt:function(v){return v.greater},ge:function(v){return v.greaterOrEquals},cn:function(v){return v.contains},nc:function(v,B){return B==="OR"?v.orNot().contains:v.andNot().contains},bw:function(v){return v.startsWith},bn:function(v,B){return B==="OR"?v.orNot().startsWith:v.andNot().startsWith},en:function(v,B){return B=== +"OR"?v.orNot().endsWith:v.andNot().endsWith},ew:function(v){return v.endsWith},ni:function(v,B){return B==="OR"?v.orNot().equals:v.andNot().equals},"in":function(v){return v.equals},nu:function(v){return v.isNull},nn:function(v,B){return B==="OR"?v.orNot().isNull:v.andNot().isNull}},t=b.jgrid.from(a.p.data);if(a.p.ignoreCase)t=t.ignoreCase();if(a.p.search===true){var F=a.p.postData.filters;if(F){if(typeof F=="string")F=b.jgrid.parse(F);e(F)}else try{t=w[a.p.postData.searchOper](t)(a.p.postData.searchField, +a.p.postData.searchString,n[a.p.postData.searchField])}catch(S){}}if(a.p.grouping){t.orderBy(A,z.groupOrder[0],p[0].stype,p[0].srcfmt);z.groupDataSorted=true}if(d&&a.p.sortorder&&i)a.p.sortorder.toUpperCase()=="DESC"?t.orderBy(a.p.sortname,"d",n[d].stype,n[d].srcfmt):t.orderBy(a.p.sortname,"a",n[d].stype,n[d].srcfmt);F=t.select();var N=parseInt(a.p.rowNum,10),K=F.length,O=parseInt(a.p.page,10),Y=Math.ceil(K/N),J={};F=F.slice((O-1)*N,O*N);n=t=null;J[a.p.localReader.total]=Y;J[a.p.localReader.page]= +O;J[a.p.localReader.records]=K;J[a.p.localReader.root]=F;F=null;return J}}},R=function(){a.grid.hDiv.loading=true;if(!a.p.hiddengrid)switch(a.p.loadui){case "enable":b("#load_"+b.jgrid.jqID(a.p.id)).show();break;case "block":b("#lui_"+b.jgrid.jqID(a.p.id)).show();b("#load_"+b.jgrid.jqID(a.p.id)).show()}},$=function(){a.grid.hDiv.loading=false;switch(a.p.loadui){case "enable":b("#load_"+b.jgrid.jqID(a.p.id)).hide();break;case "block":b("#lui_"+b.jgrid.jqID(a.p.id)).hide();b("#load_"+b.jgrid.jqID(a.p.id)).hide()}}, +ja=function(e){if(!a.grid.hDiv.loading){var d=a.p.scroll&&e===false,i={},n,p=a.p.prmNames;if(a.p.page<=0)a.p.page=1;if(p.search!==null)i[p.search]=a.p.search;if(p.nd!==null)i[p.nd]=(new Date).getTime();if(p.rows!==null)i[p.rows]=a.p.rowNum;if(p.page!==null)i[p.page]=a.p.page;if(p.sort!==null)i[p.sort]=a.p.sortname;if(p.order!==null)i[p.order]=a.p.sortorder;if(a.p.rowTotal!==null&&p.totalrows!==null)i[p.totalrows]=a.p.rowTotal;var A=a.p.loadComplete,s=b.isFunction(A);s||(A=null);var E=0;e=e||1;if(e> +1)if(p.npage!==null){i[p.npage]=e;E=e-1;e=1}else A=function(z){a.p.page++;a.grid.hDiv.loading=false;s&&a.p.loadComplete.call(a,z);ja(e-1)};else p.npage!==null&&delete a.p.postData[p.npage];if(a.p.grouping){b(a).jqGrid("groupingSetup");if(a.p.groupingView.groupDataSorted===true)i[p.sort]=a.p.groupingView.groupField[0]+" "+a.p.groupingView.groupOrder[0]+", "+i[p.sort]}b.extend(a.p.postData,i);var u=!a.p.scroll?1:a.rows.length-1;if(b.isFunction(a.p.datatype))a.p.datatype.call(a,a.p.postData,"load_"+ +a.p.id);else{b.isFunction(a.p.beforeRequest)&&a.p.beforeRequest.call(a);n=a.p.datatype.toLowerCase();switch(n){case "json":case "jsonp":case "xml":case "script":b.ajax(b.extend({url:a.p.url,type:a.p.mtype,dataType:n,data:b.isFunction(a.p.serializeGridData)?a.p.serializeGridData.call(a,a.p.postData):a.p.postData,success:function(z){n==="xml"?V(z,a.grid.bDiv,u,e>1,E):fa(z,a.grid.bDiv,u,e>1,E);A&&A.call(a,z);d&&a.grid.populateVisible();if(a.p.loadonce||a.p.treeGrid)a.p.datatype="local";$()},error:function(z, +w,t){b.isFunction(a.p.loadError)&&a.p.loadError.call(a,z,w,t);$()},beforeSend:function(z){R();b.isFunction(a.p.loadBeforeSend)&&a.p.loadBeforeSend.call(a,z)}},b.jgrid.ajaxOptions,a.p.ajaxGridOptions));break;case "xmlstring":R();i=b.jgrid.stringToDoc(a.p.datastr);V(i,a.grid.bDiv);s&&a.p.loadComplete.call(a,i);a.p.datatype="local";a.p.datastr=null;$();break;case "jsonstring":R();i=typeof a.p.datastr=="string"?b.jgrid.parse(a.p.datastr):a.p.datastr;fa(i,a.grid.bDiv);s&&a.p.loadComplete.call(a,i);a.p.datatype= +"local";a.p.datastr=null;$();break;case "local":case "clientside":R();a.p.datatype="local";i=oa();fa(i,a.grid.bDiv,u,e>1,E);A&&A.call(a,i);d&&a.grid.populateVisible();$()}}}};x=function(e,d){var i="",n="",p="",A,s,E,u,z=function(w){var t;if(b.isFunction(a.p.onPaging))t=a.p.onPaging.call(a,w);a.p.selrow=null;if(a.p.multiselect){a.p.selarrrow=[];b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked", +false)}a.p.savedRow=[];if(t=="stop")return false;return true};e=e.substr(1);d+="_"+e;A="pg_"+e;s=e+"_left";E=e+"_center";u=e+"_right";b("#"+b.jgrid.jqID(e)).append("
").attr("dir", +"ltr");if(a.p.rowList.length>0){p="";p+=""}if(l=="rtl")n+=p;if(a.p.pginput===true)i=""+b.jgrid.format(a.p.pgtext||"","","")+"";if(a.p.pgbuttons===true){s=["first"+d,"prev"+d,"next"+d,"last"+d];l=="rtl"&&s.reverse();n+="";n+="";n+=i!==""?""+i+"": +"";n+="";n+=""}else if(i!=="")n+=i;if(l=="ltr")n+=p;n+="";a.p.viewrecords===true&&b("td#"+e+"_"+a.p.recordpos,"#"+A).append("
");b("td#"+e+"_"+a.p.pagerpos,"#"+A).append(n);p=b(".ui-jqgrid").css("font-size")|| +"11px";b(document.body).append("");n=b(n).clone().appendTo("#testpg").width();b("#testpg").remove();if(n>0){if(i!=="")n+=50;b("td#"+e+"_"+a.p.pagerpos,"#"+A).width(n)}a.p._nvtd=[];a.p._nvtd[0]=n?Math.floor((a.p.width-n)/2):Math.floor(a.p.width/3);a.p._nvtd[1]=0;n=null;b(".ui-pg-selbox","#"+A).bind("change",function(){a.p.page=Math.round(a.p.rowNum*(a.p.page-1)/this.value-0.5)+1;a.p.rowNum= +this.value;if(d)b(".ui-pg-selbox",a.p.pager).val(this.value);else a.p.toppager&&b(".ui-pg-selbox",a.p.toppager).val(this.value);if(!z("records"))return false;ja();return false});if(a.p.pgbuttons===true){b(".ui-pg-button","#"+A).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 w=M(a.p.page,1),t=M(a.p.lastpage,1),F=false,S=true,N=true,K=true,O=true;if(t===0||t===1)O=K=N=S=false;else if(t>1&&w>=1)if(w===1)N=S=false;else{if(!(w>1&&w1&&w===0){O=K=false;w=t-1}if(this.id==="first"+d&&S){a.p.page=1;F=true}if(this.id==="prev"+d&&N){a.p.page=w-1;F=true}if(this.id==="next"+d&&K){a.p.page=w+1;F=true}if(this.id==="last"+d&& +O){a.p.page=t;F=true}if(F){if(!z(this.id))return false;ja()}return false})}a.p.pginput===true&&b("input.ui-pg-input","#"+A).keypress(function(w){if((w.charCode?w.charCode:w.keyCode?w.keyCode:0)==13){a.p.page=b(this).val()>0?b(this).val():a.p.page;if(!z("user"))return false;ja();return false}return this})};var Ca=function(e,d,i,n){if(a.p.colModel[d].sortable)if(!(a.p.savedRow.length>0)){if(!i){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(n)if(a.p.lastsort==d&&a.p.sortorder==n&&!i)return;else a.p.sortorder=n;i=b("thead:first",a.grid.hDiv).get(0);b("tr th:eq("+a.p.lastsort+") span.ui-grid-ico-sort",i).addClass("ui-state-disabled");b("tr th:eq("+a.p.lastsort+")",i).attr("aria-selected","false");b("tr th:eq("+d+") span.ui-icon-"+a.p.sortorder,i).removeClass("ui-state-disabled");b("tr th:eq("+d+")",i).attr("aria-selected","true");if(!a.p.viewsortcols[0])if(a.p.lastsort!= +d){b("tr th:eq("+a.p.lastsort+") span.s-ico",i).hide();b("tr th:eq("+d+") span.s-ico",i).show()}e=e.substring(5+a.p.id.length+1);a.p.sortname=a.p.colModel[d].index||e;i=a.p.sortorder;if(b.isFunction(a.p.onSortCol))if(a.p.onSortCol.call(a,e,d,i)=="stop"){a.p.lastsort=d;return}if(a.p.datatype=="local")a.p.deselectAfterSort&&b(a).jqGrid("resetSelection");else{a.p.selrow=null;a.p.multiselect&&b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false);a.p.selarrrow=[];a.p.savedRow=[]}if(a.p.scroll){i= +a.grid.bDiv.scrollLeft;C(a.grid.bDiv,true,false);a.grid.hDiv.scrollLeft=i}a.p.subGrid&&a.p.datatype=="local"&&b("td.sgexpanded","#"+b.jgrid.jqID(a.p.id)).each(function(){b(this).trigger("click")});ja();a.p.lastsort=d;if(a.p.sortname!=e&&d)a.p.lastsort=d}},Fa=function(e){var d,i={},n=H?0:a.p.cellLayout;for(d=i[0]=i[1]=i[2]=0;d<=e;d++)if(a.p.colModel[d].hidden===false)i[0]+=a.p.colModel[d].width+n;if(a.p.direction=="rtl")i[0]=a.p.width-i[0];i[0]-=a.grid.bDiv.scrollLeft;if(b(a.grid.cDiv).is(":visible"))i[1]+= +b(a.grid.cDiv).height()+parseInt(b(a.grid.cDiv).css("padding-top"),10)+parseInt(b(a.grid.cDiv).css("padding-bottom"),10);if(a.p.toolbar[0]===true&&(a.p.toolbar[1]=="top"||a.p.toolbar[1]=="both"))i[1]+=b(a.grid.uDiv).height()+parseInt(b(a.grid.uDiv).css("border-top-width"),10)+parseInt(b(a.grid.uDiv).css("border-bottom-width"),10);if(a.p.toppager)i[1]+=b(a.grid.topDiv).height()+parseInt(b(a.grid.topDiv).css("border-bottom-width"),10);i[2]+=b(a.grid.bDiv).height()+b(a.grid.hDiv).height();return i}; +this.p.id=this.id;if(b.inArray(a.p.multikey,["shiftKey","altKey","ctrlKey"])==-1)a.p.multikey=false;a.p.keyIndex=false;for(k=0;k");this.p.colModel.unshift({name:"cb",width:H?a.p.multiselectWidth+a.p.cellLayout:a.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}if(this.p.rownumbers){this.p.colNames.unshift("");this.p.colModel.unshift({name:"rn",width:a.p.rownumWidth, sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}a.p.xmlReader=b.extend(true,{root:"rows",row:"row",page:"rows>page",total:"rows>total",records:"rows>records",repeatitems:true,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:true,cell:"cell"}},a.p.xmlReader);a.p.jsonReader=b.extend(true,{root:"rows",page:"page",total:"total",records:"records",repeatitems:true,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:true, -cell:"cell"}},a.p.jsonReader);a.p.localReader=b.extend(true,{root:"rows",page:"page",total:"total",records:"records",repeatitems:false,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:true,cell:"cell"}},a.p.localReader);if(a.p.scroll){a.p.pgbuttons=false;a.p.pginput=false;a.p.rowList=[]}a.p.data.length&&aa();r="";var Da,la,sa,pa,ta,V,R,ma;la=ma="";if(a.p.shrinkToFit===true&&a.p.forceFit===true)for(k=a.p.colModel.length-1;k>= -0;k--)if(!a.p.colModel[k].hidden){a.p.colModel[k].resizable=false;break}if(a.p.viewsortcols[1]=="horizontal"){ma=" ui-i-asc";la=" ui-i-desc"}Da=F?"class='ui-th-div-ie'":"";ma="";for(k=0;k< -this.p.colNames.length;k++){la=a.p.headertitles?' title="'+b.jgrid.stripHtml(a.p.colNames[k])+'"':"";r+="";la=a.p.colModel[k].index||a.p.colModel[k].name;r+="
"+a.p.colNames[k];a.p.colModel[k].width=a.p.colModel[k].width?parseInt(a.p.colModel[k].width,10):150;if(typeof a.p.colModel[k].title!=="boolean")a.p.colModel[k].title=true;if(la== -a.p.sortname)a.p.lastsort=k;r+=ma+"
"}r+="";ma=null;b(this).append(r);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 za=[],ua;b("#cb_"+b.jgrid.jqID(a.p.id),this).bind("click",function(){if(this.checked){b("[id^=jqg_"+a.p.id+"_]").attr("checked","checked");b(a.rows).each(function(d){if(d>0)if(!b(this).hasClass("subgrid")&&!b(this).hasClass("jqgroup")){b(this).addClass("ui-state-highlight").attr("aria-selected", -"true");a.p.selarrrow.push(this.id);a.p.selrow=this.id}});ua=true;za=[]}else{b("[id^=jqg_"+a.p.id+"_]").removeAttr("checked");b(a.rows).each(function(d){if(d>0)if(!b(this).hasClass("subgrid")){b(this).removeClass("ui-state-highlight").attr("aria-selected","false");za.push(this.id)}});a.p.selarrrow=[];a.p.selrow=null;ua=false}if(b.isFunction(a.p.onSelectAll))a.p.onSelectAll.call(a,ua?a.p.selarrrow:za,ua)})}if(a.p.autowidth===true){r=b(J).innerWidth();a.p.width=r>0?r:"nw"}(function(){var d=0,g=a.p.cellLayout, -h=0,o,p=a.p.scrollOffset,x,w=false,C,G=0,s=0,v=0,y;if(S)g=0;b.each(a.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){d+=N(this.width,0);if(this.fixed){G+=this.width;s+=this.width+g}else h++;v++}});if(isNaN(a.p.width))a.p.width=e.width=d;else e.width=a.p.width;a.p.tblwidth=d;if(a.p.shrinkToFit===false&&a.p.forceFit===true)a.p.forceFit=false;if(a.p.shrinkToFit===true&&h>0){C=e.width-g*h-s;if(!isNaN(a.p.height)){C-=p;w=true}d=0;b.each(a.p.colModel, -function(D){if(this.hidden===false&&!this.fixed){this.width=x=Math.round(C*this.width/(a.p.tblwidth-G));d+=x;o=D}});y=0;if(w){if(e.width-s-(d+g*h)!==p)y=e.width-s-(d+g*h)-p}else if(!w&&Math.abs(e.width-s-(d+g*h))!==1)y=e.width-s-(d+g*h);a.p.colModel[o].width+=y;a.p.tblwidth=d+y+G+v*g;if(a.p.tblwidth>a.p.width){a.p.colModel[o].width-=a.p.tblwidth-parseInt(a.p.width,10);a.p.tblwidth=a.p.width}}})();b(J).css("width",e.width+"px").append("
 
"); -b(t).css("width",e.width+"px");r=b("thead:first",a).get(0);var va="";if(a.p.footerrow)va+="";t=b("tr:first",r);var wa="";a.p.disableClick=false;b("th",t).each(function(d){sa=a.p.colModel[d].width;if(typeof a.p.colModel[d].resizable==="undefined")a.p.colModel[d].resizable= -true;if(a.p.colModel[d].resizable){pa=document.createElement("span");b(pa).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+n);b.browser.opera||b(pa).css("cursor","col-resize");b(this).addClass(a.p.resizeclass)}else pa="";b(this).css("width",sa+"px").prepend(pa);var g="";if(a.p.colModel[d].hidden){b(this).css("display","none");g="display:none;"}wa+="";e.headers[d]={width:sa,el:this};ta=a.p.colModel[d].sortable;if(typeof ta!== -"boolean")ta=a.p.colModel[d].sortable=true;g=a.p.colModel[d].name;g=="cb"||g=="subgrid"||g=="rn"||a.p.viewsortcols[2]&&b("div",this).addClass("ui-jqgrid-sortable");if(ta)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")}if(a.p.footerrow)va+=""}).mousedown(function(d){if(b(d.target).closest("th>span.ui-jqgrid-resize").length==1){var g=b.jgrid.getCellIndex(this);if(a.p.forceFit===true)a.p.nv=Fa(g);e.dragStart(g,d,Ga(g));return false}}).click(function(d){if(a.p.disableClick)return a.p.disableClick=false;var g="th>div.ui-jqgrid-sortable",h,o;a.p.viewsortcols[2]||(g="th>div>span>span.ui-grid-ico-sort");d=b(d.target).closest(g);if(d.length==1){g=b.jgrid.getCellIndex(this);if(!a.p.viewsortcols[2]){h=true;o=d.attr("sort")}Ca(b("div", -this)[0].id,g,h,o);return false}});if(a.p.sortable&&b.fn.sortable)try{b(a).jqGrid("sortableColumns",t)}catch(Ma){}if(a.p.footerrow)va+="
 
";wa+="";this.appendChild(document.createElement("tbody"));b(this).addClass("ui-jqgrid-btable").append(wa);wa=null;t=b("
").append(r);var ba=a.p.caption&&a.p.hiddengrid===true?true: -false;k=b("
");r=null;e.hDiv=document.createElement("div");b(e.hDiv).css({width:e.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(k);b(k).append(t);t=null;ba&&b(e.hDiv).hide();if(a.p.pager){if(typeof a.p.pager=="string"){if(a.p.pager.substr(0,1)!="#")a.p.pager="#"+a.p.pager}else a.p.pager="#"+b(a.p.pager).attr("id");b(a.p.pager).css({width:e.width+"px"}).appendTo(J).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom"); -ba&&b(a.p.pager).hide();B(a.p.pager,"")}a.p.cellEdit===false&&a.p.hoverrows===true&&b(a).bind("mouseover",function(d){R=b(d.target).closest("tr.jqgrow");b(R).attr("class")!=="subgrid"&&b(R).addClass("ui-state-hover");return false}).bind("mouseout",function(d){R=b(d.target).closest("tr.jqgrow");b(R).removeClass("ui-state-hover");return false});var ja,ka;b(a).before(e.hDiv).click(function(d){V=d.target;var g=b(V).hasClass("cbox");R=b(V,a.rows).closest("tr.jqgrow");if(b(R).length===0)return this;var h= -true;if(b.isFunction(a.p.beforeSelectRow))h=a.p.beforeSelectRow.call(a,R[0].id,d);if(V.tagName=="A"||(V.tagName=="INPUT"||V.tagName=="TEXTAREA"||V.tagName=="OPTION"||V.tagName=="SELECT")&&!g)return this;if(h===true){if(a.p.cellEdit===true)if(a.p.multiselect&&g)b(a).jqGrid("setSelection",R[0].id,true);else{ja=R[0].rowIndex;ka=b.jgrid.getCellIndex(V);try{b(a).jqGrid("editCell",ja,ka,true)}catch(o){}}else if(a.p.multikey)if(d[a.p.multikey])b(a).jqGrid("setSelection",R[0].id,true);else{if(a.p.multiselect&& -g){g=b("[id^=jqg_"+a.p.id+"_]").attr("checked");b("[id^=jqg_"+a.p.id+"_]").attr("checked",!g)}}else{if(a.p.multiselect&&a.p.multiboxonly)if(!g){b(a.p.selarrrow).each(function(p,x){p=a.rows.namedItem(x);b(p).removeClass("ui-state-highlight");b("#jqg_"+a.p.id+"_"+b.jgrid.jqID(x)).attr("checked",false)});a.p.selarrrow=[];b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false)}b(a).jqGrid("setSelection",R[0].id,true)}if(b.isFunction(a.p.onCellSelect)){ja=R[0].id;ka=b.jgrid.getCellIndex(V);a.p.onCellSelect.call(a, -ja,ka,b(V).html(),d)}d.stopPropagation()}else return this}).bind("reloadGrid",function(d,g){if(a.p.treeGrid===true)a.p.datatype=a.p.treedatatype;g&&g.current&&a.grid.selectionPreserver(a);if(a.p.datatype=="local"){b(a).jqGrid("resetSelection");a.p.data.length&&aa()}else if(!a.p.treeGrid){a.p.selrow=null;if(a.p.multiselect){a.p.selarrrow=[];b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false)}a.p.savedRow=[]}a.p.scroll&&P(a.grid.bDiv,true);if(g&&g.page){d=g.page;if(d>a.p.lastpage)d=a.p.lastpage; -if(d<1)d=1;a.p.page=d;a.grid.bDiv.scrollTop=a.grid.prevRowHeight?(d-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();return false});b.isFunction(this.p.ondblClickRow)&&b(this).dblclick(function(d){V=d.target;R=b(V,a.rows).closest("tr.jqgrow");if(b(R).length===0)return false;ja=R[0].rowIndex;ka=b.jgrid.getCellIndex(V);a.p.ondblClickRow.call(a,b(R).attr("id"),ja,ka,d);return false});b.isFunction(this.p.onRightClickRow)&& -b(this).bind("contextmenu",function(d){V=d.target;R=b(V,a.rows).closest("tr.jqgrow");if(b(R).length===0)return false;a.p.multiselect||b(a).jqGrid("setSelection",R[0].id,true);ja=R[0].rowIndex;ka=b.jgrid.getCellIndex(V);a.p.onRightClickRow.call(a,b(R).attr("id"),ja,ka,d);return false});e.bDiv=document.createElement("div");b(e.bDiv).append(b('
').append("
").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height+ -(isNaN(a.p.height)?"":"px"),width:e.width+"px"}).scroll(e.scrollGrid);b("table:first",e.bDiv).css({width:a.p.tblwidth+"px"});if(F){b("tbody",this).size()==2&&b("tbody:gt(0)",this).remove();a.p.multikey&&b(e.bDiv).bind("selectstart",function(){return false})}else a.p.multikey&&b(e.bDiv).bind("mousedown",function(){return false});ba&&b(e.bDiv).hide();e.cDiv=document.createElement("div");var Aa=a.p.hidegrid===true?b("").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){Aa.addClass("ui-state-hover")}, -function(){Aa.removeClass("ui-state-hover")}).append("").css(n=="rtl"?"left":"right","0px"):"";b(e.cDiv).append(Aa).append(""+a.p.caption+"").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");b(e.cDiv).insertBefore(e.hDiv);if(a.p.toolbar[0]){e.uDiv=document.createElement("div");if(a.p.toolbar[1]=="top")b(e.uDiv).insertBefore(e.hDiv);else a.p.toolbar[1]== -"bottom"&&b(e.uDiv).insertAfter(e.hDiv);if(a.p.toolbar[1]=="both"){e.ubDiv=document.createElement("div");b(e.uDiv).insertBefore(e.hDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);b(e.ubDiv).insertAfter(e.hDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id);ba&&b(e.ubDiv).hide()}else b(e.uDiv).width(e.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);ba&&b(e.uDiv).hide()}if(a.p.toppager){a.p.toppager=a.p.id+"_toppager";e.topDiv=b("
")[0];a.p.toppager="#"+a.p.toppager;b(e.topDiv).insertBefore(e.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(e.width);B(a.p.toppager,"_t")}if(a.p.footerrow){e.sDiv=b("
")[0];k=b("
");b(e.sDiv).append(k).insertAfter(e.hDiv).width(e.width);b(k).append(va);e.footers=b(".ui-jqgrid-ftable",e.sDiv)[0].rows[0].cells;if(a.p.rownumbers)e.footers[0].className="ui-state-default jqgrid-rownum"; -ba&&b(e.sDiv).hide()}k=null;if(a.p.caption){var Ha=a.p.datatype;if(a.p.hidegrid===true){b(".ui-jqgrid-titlebar-close",e.cDiv).click(function(d){var g=b.isFunction(a.p.onHeaderClick),h=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",o,p=this;if(a.p.toolbar[0]===true){if(a.p.toolbar[1]=="both")h+=", #"+b(e.ubDiv).attr("id");h+=", #"+b(e.uDiv).attr("id")}o=b(h,"#gview_"+a.p.id).length;if(a.p.gridstate=="visible")b(h,"#gbox_"+a.p.id).slideUp("fast",function(){o--;if(o==0){b("span", -p).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");a.p.gridstate="hidden";b("#gbox_"+a.p.id).hasClass("ui-resizable")&&b(".ui-resizable-handle","#gbox_"+a.p.id).hide();if(g)ba||a.p.onHeaderClick.call(a,a.p.gridstate,d)}});else a.p.gridstate=="hidden"&&b(h,"#gbox_"+a.p.id).slideDown("fast",function(){o--;if(o==0){b("span",p).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(ba){a.p.datatype=Ha;ia();ba=false}a.p.gridstate="visible";b("#gbox_"+ -a.p.id).hasClass("ui-resizable")&&b(".ui-resizable-handle","#gbox_"+a.p.id).show();if(g)ba||a.p.onHeaderClick.call(a,a.p.gridstate,d)}});return false});if(ba){a.p.datatype="local";b(".ui-jqgrid-titlebar-close",e.cDiv).trigger("click")}}}else b(e.cDiv).hide();b(e.hDiv).after(e.bDiv).mousemove(function(d){if(e.resizing){e.dragMove(d);return false}});b(".ui-jqgrid-labels",e.hDiv).bind("selectstart",function(){return false});b(document).mouseup(function(){if(e.resizing){e.dragEnd();return false}return true}); -a.formatCol=l;a.sortData=Ca;a.updatepager=function(d,g){var h,o,p,x,w,C,G,s="";p=parseInt(a.p.page,10)-1;if(p<0)p=0;p*=parseInt(a.p.rowNum,10);w=p+a.p.reccount;if(a.p.scroll){h=b("tbody:first > tr:gt(0)",a.grid.bDiv);p=w-h.length;a.p.reccount=h.length;if(o=h.outerHeight()||a.grid.prevRowHeight){h=p*o;o=parseInt(a.p.records,10)*o;b(">div:first",a.grid.bDiv).css({height:o}).children("div:first").css({height:h,display:h?"":"none"})}a.grid.bDiv.scrollLeft=a.grid.hDiv.scrollLeft}s=a.p.pager?a.p.pager: -"";s+=a.p.toppager?s?","+a.p.toppager:a.p.toppager:"";if(s){G=b.jgrid.formatter.integer||{};h=N(a.p.page);o=N(a.p.lastpage);b(".selbox",s).attr("disabled",false);if(a.p.pginput===true){b(".ui-pg-input",s).val(a.p.page);b("#sp_1",s).html(b.fmatter?b.fmatter.util.NumberFormat(a.p.lastpage,G):a.p.lastpage)}if(a.p.viewrecords)if(a.p.reccount===0)b(".ui-paging-info",s).html(a.p.emptyrecords);else{x=p+1;C=a.p.records;if(b.fmatter){x=b.fmatter.util.NumberFormat(x,G);w=b.fmatter.util.NumberFormat(w,G);C= -b.fmatter.util.NumberFormat(C,G)}b(".ui-paging-info",s).html(b.jgrid.format(a.p.recordtext,x,w,C))}if(a.p.pgbuttons===true){if(h<=0)h=o=0;if(h==1||h===0){b("#first, #prev",a.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");a.p.toppager&&b("#first_t, #prev_t",a.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{b("#first, #prev",a.p.pager).removeClass("ui-state-disabled");a.p.toppager&&b("#first_t, #prev_t",a.p.toppager).removeClass("ui-state-disabled")}if(h== -o||h===0){b("#next, #last",a.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");a.p.toppager&&b("#next_t, #last_t",a.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{b("#next, #last",a.p.pager).removeClass("ui-state-disabled");a.p.toppager&&b("#next_t, #last_t",a.p.toppager).removeClass("ui-state-disabled")}}}d===true&&a.p.rownumbers===true&&b("td.jqgrid-rownum",a.rows).each(function(v){b(this).html(p+1+v)});g&&a.p.jqgdnd&&b(a).jqGrid("gridDnD","updateDnD"); -b.isFunction(a.p.gridComplete)&&a.p.gridComplete.call(a)};a.refreshIndex=aa;a.formatter=function(d,g,h,o,p){return q(d,g,h,o,p)};b.extend(e,{populate:ia,emptyRows:P});this.grid=e;a.addXmlData=function(d){ea(d,a.grid.bDiv)};a.addJSONData=function(d){L(d,a.grid.bDiv)};this.grid.cols=this.rows[0].cells;ia();a.p.hiddengrid=false;b(window).unload(function(){a=null})}}}})};b.jgrid.extend({getGridParam:function(f){var j=this[0];if(j&&j.grid)return f?typeof j.p[f]!="undefined"?j.p[f]:null:j.p},setGridParam:function(f){return this.each(function(){this.grid&& -typeof f==="object"&&b.extend(true,this.p,f)})},getDataIDs:function(){var f=[],j=0,i,c=0;this.each(function(){if((i=this.rows.length)&&i>0)for(;j=a+r)b(c.grid.bDiv)[0].scrollTop=t-(a+r)+n+r;else if(t=0&&i(k)}if(c.p.multiselect){c.p.selrow=e.id;k=b.inArray(c.p.selrow,c.p.selarrrow);if(k===-1){e.className!=="ui-subgrid"&&b(e).addClass("ui-state-highlight").attr("aria-selected","true");e=true;b("#jqg_"+c.p.id+"_"+b.jgrid.jqID(c.p.selrow)).attr("checked",e);c.p.selarrrow.push(c.p.selrow);c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,c.p.selrow,e)}else{e.className!== -"ui-subgrid"&&b(e).removeClass("ui-state-highlight").attr("aria-selected","false");e=false;b("#jqg_"+c.p.id+"_"+b.jgrid.jqID(c.p.selrow)).attr("checked",e);c.p.selarrrow.splice(k,1);c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,c.p.selrow,e);e=c.p.selarrrow[0];c.p.selrow=e===undefined?null:e}}else if(e.className!=="ui-subgrid"){c.p.selrow&&b(c.rows.namedItem(c.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false");if(c.p.selrow!=e.id){c.p.selrow=e.id;b(e).addClass("ui-state-highlight").attr("aria-selected", -"true");c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,c.p.selrow,true)}else c.p.selrow=null}}}})},resetSelection:function(){return this.each(function(){var f=this,j;if(f.p.multiselect){b(f.p.selarrrow).each(function(i,c){j=f.rows.namedItem(c);b(j).removeClass("ui-state-highlight").attr("aria-selected","false");b("#jqg_"+f.p.id+"_"+b.jgrid.jqID(c)).attr("checked",false)});b("#cb_"+b.jgrid.jqID(f.p.id)).attr("checked",false);f.p.selarrrow=[]}else if(f.p.selrow){b("#"+f.p.id+" tbody:first tr#"+b.jgrid.jqID(f.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected", -"false");f.p.selrow=null}f.p.savedRow=[]})},getRowData:function(f){var j={},i,c=false,e,k=0;this.each(function(){var n=this,a,r;if(typeof f=="undefined"){c=true;i=[];e=n.rows.length}else{r=n.rows.namedItem(f);if(!r)return j;e=2}for(;k span:first",r).html(a).attr(k):b("td:eq("+J+")",r).html(a).attr(k)}});if(n.p.datatype=="local"){var F=n.p._index[f];if(typeof F!="undefined")n.p.data[F]=b.extend(true,n.p.data[F],B);B=null}}catch(S){e=false}if(e)if(t==="string")b(r).addClass(i);else t==="object"&&b(r).css(i)});return e},addRowData:function(f,j,i,c){i||(i="last");var e=false,k,n,a,r,t,B,F,S, -J="",N,l,m,q,A;if(j){if(b.isArray(j)){N=true;i="last";l=f}else{j=[j];N=false}this.each(function(){var u=this,I=j.length;t=u.p.rownumbers===true?1:0;a=u.p.multiselect===true?1:0;r=u.p.subGrid===true?1:0;if(!N)if(typeof f!="undefined")f+="";else{f=u.p.records+1+"";if(u.p.keyIndex!==false){l=u.p.colModel[u.p.keyIndex+a+r+t].name;if(typeof j[0][l]!="undefined")f=j[0][l]}}m=u.p.altclass;for(var U=0,$="",P={},aa=b.isFunction(u.p.afterInsertRow)?true:false;U0"}if(a){S='';J=u.formatCol(t,1,"");n+='"+S+""}if(r)n+=b(u).jqGrid("addSubGridCell",a+t,1);for(F=a+r+t;F"+S+""}n=''+n+"";if(u.p.subGrid===true){n=b(n)[0];b(u).jqGrid("addSubGrid",n,a+t)}if(u.rows.length===0)b("table:first",u.grid.bDiv).append(n);else switch(i){case "last":b(u.rows[u.rows.length- -1]).after(n);break;case "first":b(u.rows[0]).after(n);break;case "after":if(B=u.rows.namedItem(c))b(u.rows[B.rowIndex+1]).hasClass("ui-subgrid")?b(u.rows[B.rowIndex+1]).after(n):b(B).after(n);break;case "before":if(B=u.rows.namedItem(c)){b(B).before(n);B=B.rowIndex}break}u.p.records++;u.p.reccount++;aa&&u.p.afterInsertRow.call(u,f,q,q);U++;if(u.p.datatype=="local"){u.p._index[f]=u.p.data.length;u.p.data.push(P);P={}}}if(u.p.altRows===true&&!N)if(i=="last")(u.rows.length-1)%2==1&&b(u.rows[u.rows.length- -1]).addClass(m);else b(u.rows).each(function(L){L%2==1?b(this).addClass(m):b(this).removeClass(m)});u.updatepager(true,true);e=true})}return e},footerData:function(f,j,i){function c(r){for(var t in r)if(r.hasOwnProperty(t))return false;return true}var e,k=false,n={},a;if(typeof f=="undefined")f="get";if(typeof i!="boolean")i=true;f=f.toLowerCase();this.each(function(){var r=this,t;if(!r.grid||!r.p.footerrow)return false;if(f=="set")if(c(j))return false;k=true;b(this.p.colModel).each(function(B){e= -this.name;if(f=="set"){if(j[e]!==undefined){t=i?r.formatter("",j[e],B,j,"edit"):j[e];a=this.title?{title:b.jgrid.stripHtml(t)}:{};b("tr.footrow td:eq("+B+")",r.grid.sDiv).html(t).attr(a);k=true}}else if(f=="get")n[e]=b("tr.footrow td:eq("+B+")",r.grid.sDiv).html()})});return f=="get"?n:k},ShowHideCol:function(f,j){return this.each(function(){var i=this,c=false;if(i.grid){if(typeof f==="string")f=[f];j=j!="none"?"":"none";var e=j===""?true:false;b(this.p.colModel).each(function(k){if(b.inArray(this.name, -f)!==-1&&this.hidden===e){b("tr",i.grid.hDiv).each(function(){b("th:eq("+k+")",this).css("display",j)});b(i.rows).each(function(n){b("td:eq("+k+")",i.rows[n]).css("display",j)});i.p.footerrow&&b("td:eq("+k+")",i.grid.sDiv).css("display",j);if(j=="none")i.p.tblwidth-=this.width+i.p.cellLayout;else i.p.tblwidth+=this.width;this.hidden=!e;c=true}});if(c===true){b("table:first",i.grid.hDiv).width(i.p.tblwidth);b("table:first",i.grid.bDiv).width(i.p.tblwidth);i.grid.hDiv.scrollLeft=i.grid.bDiv.scrollLeft; -if(i.p.footerrow){b("table:first",i.grid.sDiv).width(i.p.tblwidth);i.grid.sDiv.scrollLeft=i.grid.bDiv.scrollLeft}i.p.shrinkToFit===true&&b(i).jqGrid("setGridWidth",i.grid.width-0.001,true)}}})},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,j,i){function c(n){var a;a=n.length?b.makeArray(n):b.extend({},n);b.each(f,function(r){n[r]=a[this]})}function e(n, -a){b(">tr"+(a||""),n).each(function(){var r=this,t=b.makeArray(r.cells);b.each(f,function(){var B=t[this];B&&r.appendChild(B)})})}var k=this.get(0);c(k.p.colModel);c(k.p.colNames);c(k.grid.headers);e(b("thead:first",k.grid.hDiv),i&&":not(.ui-jqgrid-labels)");j&&e(b("#"+k.p.id+" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot");k.p.footerrow&&e(b("tbody:first",k.grid.sDiv));if(k.p.remapColumns)if(k.p.remapColumns.length)c(k.p.remapColumns);else k.p.remapColumns=b.makeArray(f);k.p.lastsort=b.inArray(k.p.lastsort, -f);if(k.p.treeGrid)k.p.expColInd=b.inArray(k.p.expColInd,f)},setGridWidth:function(f,j){return this.each(function(){if(this.grid){var i=this,c,e=0,k=i.p.cellLayout,n,a=0,r=false,t=i.p.scrollOffset,B,F=0,S=0,J=0,N;if(typeof j!="boolean")j=i.p.shrinkToFit;if(!isNaN(f)){f=parseInt(f,10);i.grid.width=i.p.width=f;b("#gbox_"+i.p.id).css("width",f+"px");b("#gview_"+i.p.id).css("width",f+"px");b(i.grid.bDiv).css("width",f+"px");b(i.grid.hDiv).css("width",f+"px");i.p.pager&&b(i.p.pager).css("width",f+"px"); -i.p.toppager&&b(i.p.toppager).css("width",f+"px");if(i.p.toolbar[0]===true){b(i.grid.uDiv).css("width",f+"px");i.p.toolbar[1]=="both"&&b(i.grid.ubDiv).css("width",f+"px")}i.p.footerrow&&b(i.grid.sDiv).css("width",f+"px");if(j===false&&i.p.forceFit===true)i.p.forceFit=false;if(j===true){if(b.browser.safari)k=0;b.each(i.p.colModel,function(){if(this.hidden===false){e+=parseInt(this.width,10);if(this.fixed){S+=this.width;F+=this.width+k}else a++;J++}});if(a!==0){i.p.tblwidth=e;B=f-k*a-F;if(!isNaN(i.p.height))if(b(i.grid.bDiv)[0].clientHeight< -b(i.grid.bDiv)[0].scrollHeight||i.rows.length===1){r=true;B-=t}e=0;var l=i.grid.cols.length>0;b.each(i.p.colModel,function(m){if(this.hidden===false&&!this.fixed){c=Math.round(B*this.width/(i.p.tblwidth-S));if(!(c<0)){this.width=c;e+=c;i.grid.headers[m].width=c;i.grid.headers[m].el.style.width=c+"px";if(i.p.footerrow)i.grid.footers[m].style.width=c+"px";if(l)i.grid.cols[m].style.width=c+"px";n=m}}});N=0;if(r){if(f-F-(e+k*a)!==t)N=f-F-(e+k*a)-t}else if(Math.abs(f-F-(e+k*a))!==1)N=f-F-(e+k*a);i.p.colModel[n].width+= -N;i.p.tblwidth=e+N+S+k*J;if(i.p.tblwidth>f){r=i.p.tblwidth-parseInt(f,10);i.p.tblwidth=f;c=i.p.colModel[n].width-=r}else c=i.p.colModel[n].width;i.grid.headers[n].width=c;i.grid.headers[n].el.style.width=c+"px";if(l)i.grid.cols[n].style.width=c+"px";b("table:first",i.grid.bDiv).css("width",i.p.tblwidth+"px");b("table:first",i.grid.hDiv).css("width",i.p.tblwidth+"px");i.grid.hDiv.scrollLeft=i.grid.bDiv.scrollLeft;if(i.p.footerrow){i.grid.footers[n].style.width=c+"px";b("table:first",i.grid.sDiv).css("width", -i.p.tblwidth+"px")}}}}}})},setGridHeight:function(f){return this.each(function(){var j=this;if(j.grid){b(j.grid.bDiv).css({height:f+(isNaN(f)?"":"px")});j.p.height=f;j.p.scroll&&j.grid.populateVisible()}})},setCaption:function(f){return this.each(function(){this.p.caption=f;b("span.ui-jqgrid-title",this.grid.cDiv).html(f);b(this.grid.cDiv).show()})},setLabel:function(f,j,i,c){return this.each(function(){var e=this,k=-1;if(e.grid){if(isNaN(f))b(e.p.colModel).each(function(r){if(this.name==f){k=r;return false}}); -else k=parseInt(f,10);if(k>=0){var n=b("tr.ui-jqgrid-labels th:eq("+k+")",e.grid.hDiv);if(j){var a=b(".s-ico",n);b("[id^=jqgh_]",n).empty().html(j).append(a);e.p.colNames[k]=j}if(i)typeof i==="string"?b(n).addClass(i):b(n).css(i);typeof c==="object"&&b(n).attr(c)}}})},setCell:function(f,j,i,c,e,k){return this.each(function(){var n=this,a=-1,r,t;if(n.grid){if(isNaN(j))b(n.p.colModel).each(function(F){if(this.name==j){a=F;return false}});else a=parseInt(j,10);if(a>=0)if(r=n.rows.namedItem(f)){var B= -b("td:eq("+a+")",r);if(i!==""||k===true){r=n.formatter(f,i,a,r,"edit");t=n.p.colModel[a].title?{title:b.jgrid.stripHtml(r)}:{};n.p.treeGrid&&b(".tree-wrap",b(B)).length>0?b("span",b(B)).html(r).attr(t):b(B).html(r).attr(t);if(n.p.datatype=="local"){r=n.p.colModel[a];i=r.formatter&&typeof r.formatter==="string"&&r.formatter=="date"?b.unformat.date(i,r):i;t=n.p._index[f];if(typeof t!="undefined")n.p.data[t][r.name]=i}}if(typeof c==="string")b(B).addClass(c);else c&&b(B).css(c);typeof e==="object"&& -b(B).attr(e)}}})},getCell:function(f,j){var i=false;this.each(function(){var c=this,e=-1;if(c.grid){if(isNaN(j))b(c.p.colModel).each(function(a){if(this.name===j){e=a;return false}});else e=parseInt(j,10);if(e>=0){var k=c.rows.namedItem(f);if(k)try{i=b.unformat(b("td:eq("+e+")",k),{rowId:k.id,colModel:c.p.colModel[e]},e)}catch(n){i=b.jgrid.htmlDecode(b("td:eq("+e+")",k).html())}}}});return i},getCol:function(f,j,i){var c=[],e,k=0;j=typeof j!="boolean"?false:j;if(typeof i=="undefined")i=false;this.each(function(){var n= -this,a=-1;if(n.grid){if(isNaN(f))b(n.p.colModel).each(function(F){if(this.name===f){a=F;return false}});else a=parseInt(f,10);if(a>=0){var r=n.rows.length,t=0;if(r&&r>0){for(;t0){if(a<0){f+=e;a=f.length-1}else if(e!==".")f=f.replace(".",e);for(;f.length-1-a-1?a:f.length;e=f.substring(a);for(var g=-1,h=a;h>0;h--){g++;if(g%3===0&&h!==a&&(!d||h>1))e=i+e;e=f.charAt(h-1)+e}f=e}f=b.prefix?b.prefix+f:f;return f=b.suffix?f+b.suffix:f}else return a},DateFormat:function(a,b,d,f){var e=b.match(/^\/Date((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?)\/$/), -i=function(m,r){m=String(m);for(r=parseInt(r,10)||2;m.length11)b[e]=h+1-12}if(b[e])g[a[e].toLowerCase()]=parseInt(b[e],10)}if(g.f)g.m=g.f;if(g.m===0&&g.y===0&&g.d===0)return" ";g.m=parseInt(g.m,10)-1;h=g.y;if(h>=70&&h<=99)g.y=1900+g.y;else if(h>=0&&h<=69)g.y=2E3+g.y;h=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u)}if(d in f.masks)d=f.masks[d];else d||(d="Y-m-d");g=h.getHours();a=h.getMinutes();b= -h.getDate();e=h.getMonth()+1;j=h.getTimezoneOffset();var l=h.getSeconds(),o=h.getMilliseconds(),n=h.getDay(),p=h.getFullYear(),q=(n+6)%7+1,s=(new Date(p,e-1,b)-new Date(p,0,1))/864E5,t={d:i(b),D:k.i18n.dayNames[n],j:b,l:k.i18n.dayNames[n+7],N:q,S:f.S(b),w:n,z:s,W:q<5?Math.floor((s+q-1)/7)+1:Math.floor((s+q-1)/7)||(((new Date(p-1,0,1)).getDay()+6)%7<4?53:52),F:k.i18n.monthNames[e-1+12],m:i(e),M:k.i18n.monthNames[e-1],n:e,t:"?",L:"?",o:"?",Y:p,y:String(p).substring(2),a:g<12?f.AmPm[0]:f.AmPm[1],A:g< -12?f.AmPm[2]:f.AmPm[3],B:"?",g:g%12||12,G:g,h:i(g%12||12),H:i(g),i:i(a),s:i(l),u:o,e:"?",I:"?",O:(j>0?"-":"+")+i(Math.floor(Math.abs(j)/60)*100+Math.abs(j)%60,4),P:"?",T:(String(h).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(h/1E3)};return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(m){return m in t?t[m]:m.substring(1)})}}; -c.fn.fmatter.defaultFormat=function(a,b){return c.fmatter.isValue(a)&&a!==""?a:b.defaultValue?b.defaultValue:" "};c.fn.fmatter.email=function(a,b){return c.fmatter.isEmpty(a)?c.fn.fmatter.defaultFormat(a,b):'
'+a+""};c.fn.fmatter.checkbox=function(a,b){var d=c.extend({},b.checkbox);c.fmatter.isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));b=d.disabled===true?'disabled="disabled"':"";if(c.fmatter.isEmpty(a)||c.fmatter.isUndefined(a))a= -c.fn.fmatter.defaultFormat(a,d);a+="";a=a.toLowerCase();return'"};c.fn.fmatter.link=function(a,b){var d={target:b.target},f="";c.fmatter.isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(d.target)f="target="+d.target;return c.fmatter.isEmpty(a)?c.fn.fmatter.defaultFormat(a,b):"'+a+""};c.fn.fmatter.showlink=function(a,b){var d= -{baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,addParam:b.addParam||"",target:b.target,idName:b.idName},f="";c.fmatter.isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(d.target)f="target="+d.target;d=d.baseLinkUrl+d.showAction+"?"+d.idName+"="+b.rowId+d.addParam;return c.fmatter.isString(a)||c.fmatter.isNumber(a)?"'+a+"":c.fn.fmatter.defaultFormat(a,b)};c.fn.fmatter.integer=function(a,b){var d=c.extend({},b.integer);c.fmatter.isUndefined(b.colModel.formatoptions)|| -(d=c.extend({},d,b.colModel.formatoptions));if(c.fmatter.isEmpty(a))return d.defaultValue;return c.fmatter.util.NumberFormat(a,d)};c.fn.fmatter.number=function(a,b){var d=c.extend({},b.number);c.fmatter.isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(c.fmatter.isEmpty(a))return d.defaultValue;return c.fmatter.util.NumberFormat(a,d)};c.fn.fmatter.currency=function(a,b){var d=c.extend({},b.currency);c.fmatter.isUndefined(b.colModel.formatoptions)||(d=c.extend({}, -d,b.colModel.formatoptions));if(c.fmatter.isEmpty(a))return d.defaultValue;return c.fmatter.util.NumberFormat(a,d)};c.fn.fmatter.date=function(a,b,d,f){d=c.extend({},b.date);c.fmatter.isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));return!d.reformatAfterEdit&&f=="edit"?c.fn.fmatter.defaultFormat(a,b):c.fmatter.isEmpty(a)?c.fn.fmatter.defaultFormat(a,b):c.fmatter.util.DateFormat(d.srcformat,a,d.newformat,d)};c.fn.fmatter.select=function(a,b){a+="";var d=false,f=[]; -if(c.fmatter.isUndefined(b.colModel.formatoptions)){if(!c.fmatter.isUndefined(b.colModel.editoptions))d=b.colModel.editoptions.value}else d=b.colModel.formatoptions.value;if(d){var e=b.colModel.editoptions.multiple===true?true:false,i=[],g;if(e){i=a.split(",");i=c.map(i,function(l){return c.trim(l)})}if(c.fmatter.isString(d))for(var h=d.split(";"),j=0,k=0;k2)g[1]=jQuery.map(g,function(l,o){if(o>0)return l}).join(":");if(e){if(jQuery.inArray(g[0],i)>-1){f[j]= -g[1];j++}}else if(c.trim(g[0])==c.trim(a)){f[0]=g[1];break}}else if(c.fmatter.isObject(d))if(e)f=jQuery.map(i,function(l){return d[l]});else f[0]=d[a]||""}a=f.join(", ");return a===""?c.fn.fmatter.defaultFormat(a,b):a};c.fn.fmatter.rowactions=function(a,b,d,f){var e={keys:false,editbutton:true,delbutton:true,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{oper:"edit"},url:null,delOptions:{}};f=c("#"+b)[0].p.colModel[f];c.fmatter.isUndefined(f.formatoptions)||(e= -c.extend(e,f.formatoptions));f=function(g){e.afterSave&&e.afterSave(g);c("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+b).show();c("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+b).hide()};var i=function(g){e.afterRestore&&e.afterRestore(g);c("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+b).show();c("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+b).hide()};switch(d){case "edit":c("#"+b).jqGrid("editRow",a,e.keys,e.onEdit,e.onSuccess, -e.url,e.extraparam,f,e.onError,i);c("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+b).hide();c("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+b).show();break;case "save":c("#"+b).jqGrid("saveRow",a,e.onSuccess,e.url,e.extraparam,f,e.onError,i);c("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+b).show();c("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+b).hide();break;case "cancel":c("#"+b).jqGrid("restoreRow",a,i);c("tr#"+a+" div.ui-inline-edit, tr#"+ -a+" div.ui-inline-del","#"+b).show();c("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+b).hide();break;case "del":c("#"+b).jqGrid("delGridRow",a,e.delOptions);break}};c.fn.fmatter.actions=function(a,b){a={keys:false,editbutton:true,delbutton:true};c.fmatter.isUndefined(b.colModel.formatoptions)||(a=c.extend(a,b.colModel.formatoptions));var d=b.rowId,f="",e;if(typeof d=="undefined"||c.fmatter.isEmpty(d))return"";if(a.editbutton){e="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+ -"','edit',"+b.pos+");";f=f+"
"}if(a.delbutton){e="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+"','del',"+b.pos+");";f=f+"
"}e="onclick=$.fn.fmatter.rowactions('"+ -d+"','"+b.gid+"','save',"+b.pos+");";f=f+"";e="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+"','cancel',"+b.pos+");";return f=f+"
"};c.unformat=function(a,b, -d,f){var e,i=b.colModel.formatter,g=b.colModel.formatoptions||{},h=/([\.\*\_\'\(\)\{\}\+\?\\])/g,j=b.colModel.unformat||c.fn.fmatter[i]&&c.fn.fmatter[i].unformat;if(typeof j!=="undefined"&&c.isFunction(j))e=j(c(a).text(),b,a);else if(!c.fmatter.isUndefined(i)&&c.fmatter.isString(i)){e=c.jgrid.formatter||{};switch(i){case "integer":g=c.extend({},e.integer,g);b=g.thousandsSeparator.replace(h,"\\$1");b=new RegExp(b,"g");e=c(a).text().replace(b,"");break;case "number":g=c.extend({},e.number,g);b=g.thousandsSeparator.replace(h, -"\\$1");b=new RegExp(b,"g");e=c(a).text().replace(b,"").replace(g.decimalSeparator,".");break;case "currency":g=c.extend({},e.currency,g);b=g.thousandsSeparator.replace(h,"\\$1");b=new RegExp(b,"g");e=c(a).text().replace(b,"").replace(g.decimalSeparator,".").replace(g.prefix,"").replace(g.suffix,"");break;case "checkbox":g=b.colModel.editoptions?b.colModel.editoptions.value.split(":"):["Yes","No"];e=c("input",a).attr("checked")?g[0]:g[1];break;case "select":e=c.unformat.select(a,b,d,f);break;case "actions":return""; -default:e=c(a).text()}}return e?e:f===true?c(a).text():c.jgrid.htmlDecode(c(a).html())};c.unformat.select=function(a,b,d,f){d=[];a=c(a).text();if(f===true)return a;b=c.extend({},b.colModel.editoptions);if(b.value){var e=b.value;b=b.multiple===true?true:false;f=[];var i;if(b){f=a.split(",");f=c.map(f,function(k){return c.trim(k)})}if(c.fmatter.isString(e))for(var g=e.split(";"),h=0,j=0;j2)i[1]=jQuery.map(i,function(k,l){if(l>0)return k}).join(":");if(b){if(jQuery.inArray(i[1], -f)>-1){d[h]=i[0];h++}}else if(c.trim(i[1])==c.trim(a)){d[0]=i[0];break}}else if(c.fmatter.isObject(e)||c.isArray(e)){b||(f[0]=a);d=jQuery.map(f,function(k){var l;c.each(e,function(o,n){if(n==k){l=o;return false}});if(typeof l!="undefined")return l})}return d.join(", ")}else return a||""};c.unformat.date=function(a,b){var d=c.jgrid.formatter.date||{};c.fmatter.isUndefined(b.formatoptions)||(d=c.extend({},d,b.formatoptions));return c.fmatter.isEmpty(a)?c.fn.fmatter.defaultFormat(a,b):c.fmatter.util.DateFormat(d.newformat, +cell:"cell"}},a.p.jsonReader);a.p.localReader=b.extend(true,{root:"rows",page:"page",total:"total",records:"records",repeatitems:false,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:true,cell:"cell"}},a.p.localReader);if(a.p.scroll){a.p.pgbuttons=false;a.p.pginput=false;a.p.rowList=[]}a.p.data.length&&ca();var da="",Da,ma,sa,ra,ta,X,Q,na;ma=na="";if(a.p.shrinkToFit===true&&a.p.forceFit===true)for(k=a.p.colModel.length- +1;k>=0;k--)if(!a.p.colModel[k].hidden){a.p.colModel[k].resizable=false;break}if(a.p.viewsortcols[1]=="horizontal"){na=" ui-i-asc";ma=" ui-i-desc"}Da=y?"class='ui-th-div-ie'":"";na="";for(k= +0;k";ma=a.p.colModel[k].index||a.p.colModel[k].name;da+="
"+a.p.colNames[k];a.p.colModel[k].width=a.p.colModel[k].width?parseInt(a.p.colModel[k].width,10):150;if(typeof a.p.colModel[k].title!=="boolean")a.p.colModel[k].title= +true;if(ma==a.p.sortname)a.p.lastsort=k;da+=na+"
"}da+="";na=null;b(this).append(da);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 za=[],ua;b("#cb_"+b.jgrid.jqID(a.p.id),this).bind("click",function(){a.p.selarrrow=[];if(this.checked){b(a.rows).each(function(e){if(e>0)if(!b(this).hasClass("subgrid")&&!b(this).hasClass("jqgroup")&&!b(this).hasClass("ui-state-disabled")){b("#jqg_"+ +b.jgrid.jqID(a.p.id)+"_"+b.jgrid.jqID(this.id)).attr("checked","checked");b(this).addClass("ui-state-highlight").attr("aria-selected","true");a.p.selarrrow.push(this.id);a.p.selrow=this.id}});ua=true;za=[]}else{b(a.rows).each(function(e){if(e>0)if(!b(this).hasClass("subgrid")&&!b(this).hasClass("ui-state-disabled")){b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+b.jgrid.jqID(this.id)).removeAttr("checked");b(this).removeClass("ui-state-highlight").attr("aria-selected","false");za.push(this.id)}});a.p.selrow= +null;ua=false}if(b.isFunction(a.p.onSelectAll))a.p.onSelectAll.call(a,ua?a.p.selarrrow:za,ua)})}if(a.p.autowidth===true){da=b(L).innerWidth();a.p.width=da>0?da:"nw"}(function(){var e=0,d=H?0:a.p.cellLayout,i=0,n,p=a.p.scrollOffset,A,s=false,E,u=0,z=0,w;b.each(a.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;this.widthOrg=A=M(this.width,0);if(this.hidden===false){e+=A+d;if(this.fixed)u+=A+d;else i++;z++}});if(isNaN(a.p.width))a.p.width=g.width=e;else g.width=a.p.width; +a.p.tblwidth=e;if(a.p.shrinkToFit===false&&a.p.forceFit===true)a.p.forceFit=false;if(a.p.shrinkToFit===true&&i>0){E=g.width-d*i-u;if(!isNaN(a.p.height)){E-=p;s=true}e=0;b.each(a.p.colModel,function(t){if(this.hidden===false&&!this.fixed){this.width=A=Math.round(E*this.width/(a.p.tblwidth-d*i-u));e+=A;n=t}});w=0;if(s){if(g.width-u-(e+d*i)!==p)w=g.width-u-(e+d*i)-p}else if(!s&&Math.abs(g.width-u-(e+d*i))!==1)w=g.width-u-(e+d*i);a.p.colModel[n].width+=w;a.p.tblwidth=e+w+d*i+u;if(a.p.tblwidth>a.p.width){a.p.colModel[n].width-= +a.p.tblwidth-parseInt(a.p.width,10);a.p.tblwidth=a.p.width}}})();b(L).css("width",g.width+"px").append("
 
");b(q).css("width",g.width+"px");da=b("thead:first",a).get(0);var va="";if(a.p.footerrow)va+="";q=b("tr:first",da);var wa=""; +a.p.disableClick=false;b("th",q).each(function(e){sa=a.p.colModel[e].width;if(typeof a.p.colModel[e].resizable==="undefined")a.p.colModel[e].resizable=true;if(a.p.colModel[e].resizable){ra=document.createElement("span");b(ra).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+l);b.browser.opera||b(ra).css("cursor","col-resize");b(this).addClass(a.p.resizeclass)}else ra="";b(this).css("width",sa+"px").prepend(ra);var d="";if(a.p.colModel[e].hidden){b(this).css("display","none");d="display:none;"}wa+= +"";g.headers[e]={width:sa,el:this};ta=a.p.colModel[e].sortable;if(typeof ta!=="boolean")ta=a.p.colModel[e].sortable=true;d=a.p.colModel[e].name;d=="cb"||d=="subgrid"||d=="rn"||a.p.viewsortcols[2]&&b("div",this).addClass("ui-jqgrid-sortable");if(ta)if(a.p.viewsortcols[0]){b("div span.s-ico",this).show();e==a.p.lastsort&&b("div span.ui-icon-"+a.p.sortorder,this).removeClass("ui-state-disabled")}else if(e==a.p.lastsort){b("div span.s-ico", +this).show();b("div span.ui-icon-"+a.p.sortorder,this).removeClass("ui-state-disabled")}if(a.p.footerrow)va+=""}).mousedown(function(e){if(b(e.target).closest("th>span.ui-jqgrid-resize").length==1){var d=b.jgrid.getCellIndex(this);if(a.p.forceFit===true){var i=a.p,n=d,p;for(p=d+1;p
 
").append(da);var ea=a.p.caption&&a.p.hiddengrid===true?true:false;k=b("
");da=null;g.hDiv=document.createElement("div");b(g.hDiv).css({width:g.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(k);b(k).append(q);q=null;ea&&b(g.hDiv).hide();if(a.p.pager){if(typeof a.p.pager== +"string"){if(a.p.pager.substr(0,1)!="#")a.p.pager="#"+a.p.pager}else a.p.pager="#"+b(a.p.pager).attr("id");b(a.p.pager).css({width:g.width+"px"}).appendTo(L).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom");ea&&b(a.p.pager).hide();x(a.p.pager,"")}a.p.cellEdit===false&&a.p.hoverrows===true&&b(a).bind("mouseover",function(e){Q=b(e.target).closest("tr.jqgrow");b(Q).attr("class")!=="subgrid"&&b(Q).addClass("ui-state-hover")}).bind("mouseout",function(e){Q=b(e.target).closest("tr.jqgrow"); +b(Q).removeClass("ui-state-hover")});var ka,la;b(a).before(g.hDiv).click(function(e){X=e.target;Q=b(X,a.rows).closest("tr.jqgrow");if(b(Q).length===0||Q[0].className.indexOf("ui-state-disabled")>-1)return this;var d=b(X).hasClass("cbox"),i=true;if(b.isFunction(a.p.beforeSelectRow))i=a.p.beforeSelectRow.call(a,Q[0].id,e);if(X.tagName=="A"||(X.tagName=="INPUT"||X.tagName=="TEXTAREA"||X.tagName=="OPTION"||X.tagName=="SELECT")&&!d)return this;if(i===true){if(a.p.cellEdit===true)if(a.p.multiselect&&d)b(a).jqGrid("setSelection", +Q[0].id,true);else{ka=Q[0].rowIndex;la=b.jgrid.getCellIndex(X);try{b(a).jqGrid("editCell",ka,la,true)}catch(n){}}else if(a.p.multikey)if(e[a.p.multikey])b(a).jqGrid("setSelection",Q[0].id,true);else{if(a.p.multiselect&&d){d=b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+Q[0].id).attr("checked");b("#jqg_"+b.jgrid.jqID(a.p.id)+"_"+Q[0].id).attr("checked",!d)}}else{if(a.p.multiselect&&a.p.multiboxonly)if(!d){b(a.p.selarrrow).each(function(p,A){var s=a.rows.namedItem(A);b(s).removeClass("ui-state-highlight");b("#jqg_"+ +b.jgrid.jqID(a.p.id)+"_"+b.jgrid.jqID(A)).attr("checked",false)});a.p.selarrrow=[];b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false)}b(a).jqGrid("setSelection",Q[0].id,true)}if(b.isFunction(a.p.onCellSelect)){ka=Q[0].id;la=b.jgrid.getCellIndex(X);a.p.onCellSelect.call(a,ka,la,b(X).html(),e)}}return this}).bind("reloadGrid",function(e,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&&ca()}else if(!a.p.treeGrid){a.p.selrow=null;if(a.p.multiselect){a.p.selarrrow=[];b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false)}a.p.savedRow=[]}a.p.scroll&&C(a.grid.bDiv,true,false);if(d&&d.page){var i=d.page;if(i>a.p.lastpage)i=a.p.lastpage;if(i<1)i=1;a.p.page=i;a.grid.bDiv.scrollTop=a.grid.prevRowHeight?(i-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();return false}); +b.isFunction(this.p.ondblClickRow)&&b(this).dblclick(function(e){X=e.target;Q=b(X,a.rows).closest("tr.jqgrow");if(b(Q).length===0)return false;ka=Q[0].rowIndex;la=b.jgrid.getCellIndex(X);a.p.ondblClickRow.call(a,b(Q).attr("id"),ka,la,e);return false});b.isFunction(this.p.onRightClickRow)&&b(this).bind("contextmenu",function(e){X=e.target;Q=b(X,a.rows).closest("tr.jqgrow");if(b(Q).length===0)return false;a.p.multiselect||b(a).jqGrid("setSelection",Q[0].id,true);ka=Q[0].rowIndex;la=b.jgrid.getCellIndex(X); +a.p.onRightClickRow.call(a,b(Q).attr("id"),ka,la,e);return false});g.bDiv=document.createElement("div");if(y)if(String(a.p.height).toLowerCase()==="auto")a.p.height="100%";b(g.bDiv).append(b('
').append("
").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height+(isNaN(a.p.height)?"":"px"),width:g.width+"px"}).scroll(g.scrollGrid);b("table:first",g.bDiv).css({width:a.p.tblwidth+"px"});if(y){b("tbody", +this).size()==2&&b("tbody:gt(0)",this).remove();a.p.multikey&&b(g.bDiv).bind("selectstart",function(){return false})}else a.p.multikey&&b(g.bDiv).bind("mousedown",function(){return false});ea&&b(g.bDiv).hide();g.cDiv=document.createElement("div");var Aa=a.p.hidegrid===true?b("").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){Aa.addClass("ui-state-hover")},function(){Aa.removeClass("ui-state-hover")}).append("").css(l== +"rtl"?"left":"right","0px"):"";b(g.cDiv).append(Aa).append(""+a.p.caption+"").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");b(g.cDiv).insertBefore(g.hDiv);if(a.p.toolbar[0]){g.uDiv=document.createElement("div");if(a.p.toolbar[1]=="top")b(g.uDiv).insertBefore(g.hDiv);else a.p.toolbar[1]=="bottom"&&b(g.uDiv).insertAfter(g.hDiv);if(a.p.toolbar[1]=="both"){g.ubDiv=document.createElement("div");b(g.uDiv).insertBefore(g.hDiv).addClass("ui-userdata ui-state-default").attr("id", +"t_"+this.id);b(g.ubDiv).insertAfter(g.hDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id);ea&&b(g.ubDiv).hide()}else b(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);ea&&b(g.uDiv).hide()}if(a.p.toppager){a.p.toppager=b.jgrid.jqID(a.p.id)+"_toppager";g.topDiv=b("
")[0];a.p.toppager="#"+a.p.toppager;b(g.topDiv).insertBefore(g.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width);x(a.p.toppager, +"_t")}if(a.p.footerrow){g.sDiv=b("
")[0];k=b("
");b(g.sDiv).append(k).insertAfter(g.hDiv).width(g.width);b(k).append(va);g.footers=b(".ui-jqgrid-ftable",g.sDiv)[0].rows[0].cells;if(a.p.rownumbers)g.footers[0].className="ui-state-default jqgrid-rownum";ea&&b(g.sDiv).hide()}k=null;if(a.p.caption){var Ga=a.p.datatype;if(a.p.hidegrid===true){b(".ui-jqgrid-titlebar-close",g.cDiv).click(function(e){var d=b.isFunction(a.p.onHeaderClick), +i=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",n,p=this;if(a.p.toolbar[0]===true){if(a.p.toolbar[1]=="both")i+=", #"+b(g.ubDiv).attr("id");i+=", #"+b(g.uDiv).attr("id")}n=b(i,"#gview_"+b.jgrid.jqID(a.p.id)).length;if(a.p.gridstate=="visible")b(i,"#gbox_"+b.jgrid.jqID(a.p.id)).slideUp("fast",function(){n--;if(n===0){b("span",p).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();if(d)ea||a.p.onHeaderClick.call(a,a.p.gridstate,e)}});else a.p.gridstate=="hidden"&&b(i,"#gbox_"+b.jgrid.jqID(a.p.id)).slideDown("fast",function(){n--;if(n===0){b("span",p).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(ea){a.p.datatype=Ga;ja();ea=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();if(d)ea|| +a.p.onHeaderClick.call(a,a.p.gridstate,e)}});return false});if(ea){a.p.datatype="local";b(".ui-jqgrid-titlebar-close",g.cDiv).trigger("click")}}}else b(g.cDiv).hide();b(g.hDiv).after(g.bDiv).mousemove(function(e){if(g.resizing){g.dragMove(e);return false}});b(".ui-jqgrid-labels",g.hDiv).bind("selectstart",function(){return false});b(document).mouseup(function(){if(g.resizing){g.dragEnd();return false}return true});a.formatCol=P;a.sortData=Ca;a.updatepager=function(e,d){var i,n,p,A,s,E,u,z="",w=a.p.pager? +"_"+b.jgrid.jqID(a.p.pager.substr(1)):"",t=a.p.toppager?"_"+a.p.toppager.substr(1):"";p=parseInt(a.p.page,10)-1;if(p<0)p=0;p*=parseInt(a.p.rowNum,10);s=p+a.p.reccount;if(a.p.scroll){i=b("tbody:first > tr:gt(0)",a.grid.bDiv);p=s-i.length;a.p.reccount=i.length;if(n=i.outerHeight()||a.grid.prevRowHeight){i=p*n;n*=parseInt(a.p.records,10);b(">div:first",a.grid.bDiv).css({height:n}).children("div:first").css({height:i,display:i?"":"none"})}a.grid.bDiv.scrollLeft=a.grid.hDiv.scrollLeft}z=a.p.pager?a.p.pager: +"";z+=a.p.toppager?z?","+a.p.toppager:a.p.toppager:"";if(z){u=b.jgrid.formatter.integer||{};i=M(a.p.page);n=M(a.p.lastpage);b(".selbox",z).attr("disabled",false);if(a.p.pginput===true){b(".ui-pg-input",z).val(a.p.page);A=a.p.toppager?"#sp_1"+w+",#sp_1"+t:"#sp_1"+w;b(A).html(b.fmatter?b.fmatter.util.NumberFormat(a.p.lastpage,u):a.p.lastpage)}if(a.p.viewrecords)if(a.p.reccount===0)b(".ui-paging-info",z).html(a.p.emptyrecords);else{A=p+1;E=a.p.records;if(b.fmatter){A=b.fmatter.util.NumberFormat(A,u); +s=b.fmatter.util.NumberFormat(s,u);E=b.fmatter.util.NumberFormat(E,u)}b(".ui-paging-info",z).html(b.jgrid.format(a.p.recordtext,A,s,E))}if(a.p.pgbuttons===true){if(i<=0)i=n=0;if(i==1||i===0){b("#first"+w+", #prev"+w).addClass("ui-state-disabled").removeClass("ui-state-hover");a.p.toppager&&b("#first_t"+t+", #prev_t"+t).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{b("#first"+w+", #prev"+w).removeClass("ui-state-disabled");a.p.toppager&&b("#first_t"+t+", #prev_t"+t).removeClass("ui-state-disabled")}if(i== +n||i===0){b("#next"+w+", #last"+w).addClass("ui-state-disabled").removeClass("ui-state-hover");a.p.toppager&&b("#next_t"+t+", #last_t"+t).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{b("#next"+w+", #last"+w).removeClass("ui-state-disabled");a.p.toppager&&b("#next_t"+t+", #last_t"+t).removeClass("ui-state-disabled")}}}e===true&&a.p.rownumbers===true&&b("td.jqgrid-rownum",a.rows).each(function(F){b(this).html(p+1+F)});d&&a.p.jqgdnd&&b(a).jqGrid("gridDnD","updateDnD");b.isFunction(a.p.gridComplete)&& +a.p.gridComplete.call(a)};a.refreshIndex=ca;a.formatter=function(e,d,i,n,p){return o(e,d,i,n,p)};b.extend(g,{populate:ja,emptyRows:C});this.grid=g;a.addXmlData=function(e){V(e,a.grid.bDiv)};a.addJSONData=function(e){fa(e,a.grid.bDiv)};this.grid.cols=this.rows[0].cells;ja();a.p.hiddengrid=false;b(window).unload(function(){a=null})}}}})};b.jgrid.extend({getGridParam:function(f){var j=this[0];if(j&&j.grid)return f?typeof j.p[f]!="undefined"?j.p[f]:null:j.p},setGridParam:function(f){return this.each(function(){this.grid&& +typeof f==="object"&&b.extend(true,this.p,f)})},getDataIDs:function(){var f=[],j=0,h,c=0;this.each(function(){if((h=this.rows.length)&&h>0)for(;j=q+x)b(c.grid.bDiv)[0].scrollTop=y-(q+x)+a+x;else if(y-1)){if(c.p.scrollrows===true){g=c.rows.namedItem(f).rowIndex;g>=0&&h(g)}if(c.p.multiselect){c.p.selrow=k.id;l=b.inArray(c.p.selrow,c.p.selarrrow);if(l===-1){k.className!=="ui-subgrid"&&b(k).addClass("ui-state-highlight").attr("aria-selected","true");g=true;b("#jqg_"+b.jgrid.jqID(c.p.id)+"_"+b.jgrid.jqID(c.p.selrow)).attr("checked",g);c.p.selarrrow.push(c.p.selrow)}else{k.className!== +"ui-subgrid"&&b(k).removeClass("ui-state-highlight").attr("aria-selected","false");g=false;b("#jqg_"+b.jgrid.jqID(c.p.id)+"_"+b.jgrid.jqID(c.p.selrow)).attr("checked",g);c.p.selarrrow.splice(l,1);l=c.p.selarrrow[0];c.p.selrow=l===undefined?null:l}c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,k.id,g)}else if(k.className!=="ui-subgrid"){if(c.p.selrow!=k.id){b(c.rows.namedItem(c.p.selrow)).removeClass("ui-state-highlight").attr({"aria-selected":"false",tabindex:"-1"});b(k).addClass("ui-state-highlight").attr({"aria-selected":true, +tabindex:"0"});g=true}else g=false;c.p.selrow=k.id;c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,k.id,g)}}}})},resetSelection:function(f){return this.each(function(){var j=this,h,c;if(typeof f!=="undefined"){c=f===j.p.selrow?j.p.selrow:f;b("#"+b.jgrid.jqID(j.p.id)+" tbody:first tr#"+b.jgrid.jqID(c)).removeClass("ui-state-highlight").attr("aria-selected","false");if(j.p.multiselect){b("#jqg_"+b.jgrid.jqID(j.p.id)+"_"+b.jgrid.jqID(c)).attr("checked",false);b("#cb_"+b.jgrid.jqID(j.p.id)).attr("checked", +false)}c=null}else if(j.p.multiselect){b(j.p.selarrrow).each(function(g,k){h=j.rows.namedItem(k);b(h).removeClass("ui-state-highlight").attr("aria-selected","false");b("#jqg_"+b.jgrid.jqID(j.p.id)+"_"+b.jgrid.jqID(k)).attr("checked",false)});b("#cb_"+b.jgrid.jqID(j.p.id)).attr("checked",false);j.p.selarrrow=[]}else if(j.p.selrow){b("#"+b.jgrid.jqID(j.p.id)+" tbody:first tr#"+b.jgrid.jqID(j.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false");j.p.selrow=null}j.p.savedRow=[]})}, +getRowData:function(f){var j={},h,c=false,g,k=0;this.each(function(){var l=this,a,q;if(typeof f=="undefined"){c=true;h=[];g=l.rows.length}else{q=l.rows.namedItem(f);if(!q)return j;g=2}for(;k span:first",q).html(a).attr(k):b("td:eq("+P+")",q).html(a).attr(k)}});if(l.p.datatype=="local"){var H=l.p._index[f];if(l.p.treeGrid)for(var L in l.p.treeReader)y.hasOwnProperty(l.p.treeReader[L])&&delete y[l.p.treeReader[L]];if(typeof H!="undefined")l.p.data[H]=b.extend(true,l.p.data[H],y);y=null}}catch(M){g=false}if(g)if(x==="string")b(q).addClass(h); +else x==="object"&&b(q).css(h)});return g},addRowData:function(f,j,h,c){h||(h="last");var g=false,k,l,a,q,x,y,H,L,M="",P,U,o,m,r;if(j){if(b.isArray(j)){P=true;h="last";U=f}else{j=[j];P=false}this.each(function(){var D=j.length;x=this.p.rownumbers===true?1:0;a=this.p.multiselect===true?1:0;q=this.p.subGrid===true?1:0;if(!P)if(typeof f!="undefined")f+="";else{f=b.jgrid.randId();if(this.p.keyIndex!==false){U=this.p.colModel[this.p.keyIndex+a+q+x].name;if(typeof j[0][U]!="undefined")f=j[0][U]}}o=this.p.altclass; +for(var T=0,I="",C={},ca=b.isFunction(this.p.afterInsertRow)?true:false;T0"}if(a){L='';M=this.formatCol(x,1,"",null,f,true);l+='"+L+""}if(q)l+=b(this).jqGrid("addSubGridCell",a+x,1);for(H=a+q+x;H"+L+""}l=''+l+"";if(this.rows.length===0)b("table:first",this.grid.bDiv).append(l);else switch(h){case "last":b(this.rows[this.rows.length-1]).after(l);y=this.rows.length-1;break;case "first":b(this.rows[0]).after(l);y=1;break;case "after":if(y=this.rows.namedItem(c))b(this.rows[y.rowIndex+1]).hasClass("ui-subgrid")?b(this.rows[y.rowIndex+1]).after(l):b(y).after(l);y++;break;case "before":if(y=this.rows.namedItem(c)){b(y).before(l);y=y.rowIndex}y--}this.p.subGrid===true&&b(this).jqGrid("addSubGrid", +a+x,y);this.p.records++;this.p.reccount++;ca&&this.p.afterInsertRow.call(this,f,m,m);T++;if(this.p.datatype=="local"){C[this.p.localReader.id]=f;this.p._index[f]=this.p.data.length;this.p.data.push(C);C={}}}if(this.p.altRows===true&&!P)if(h=="last")(this.rows.length-1)%2==1&&b(this.rows[this.rows.length-1]).addClass(o);else b(this.rows).each(function(fa){fa%2==1?b(this).addClass(o):b(this).removeClass(o)});this.updatepager(true,true);g=true})}return g},footerData:function(f,j,h){function c(q){for(var x in q)if(q.hasOwnProperty(x))return false; +return true}var g,k=false,l={},a;if(typeof f=="undefined")f="get";if(typeof h!="boolean")h=true;f=f.toLowerCase();this.each(function(){var q=this,x;if(!q.grid||!q.p.footerrow)return false;if(f=="set")if(c(j))return false;k=true;b(this.p.colModel).each(function(y){g=this.name;if(f=="set"){if(j[g]!==undefined){x=h?q.formatter("",j[g],y,j,"edit"):j[g];a=this.title?{title:b.jgrid.stripHtml(x)}:{};b("tr.footrow td:eq("+y+")",q.grid.sDiv).html(x).attr(a);k=true}}else if(f=="get")l[g]=b("tr.footrow td:eq("+ +y+")",q.grid.sDiv).html()})});return f=="get"?l:k},showHideCol:function(f,j){return this.each(function(){var h=this,c=false,g=b.browser.webkit||b.browser.safari?0:h.p.cellLayout,k;if(h.grid){if(typeof f==="string")f=[f];j=j!="none"?"":"none";var l=j===""?true:false;b(this.p.colModel).each(function(a){if(b.inArray(this.name,f)!==-1&&this.hidden===l){b("tr",h.grid.hDiv).each(function(){b(this).children("th:eq("+a+")").css("display",j)});b(h.rows).each(function(){b(this).children("td:eq("+a+")").css("display", +j)});h.p.footerrow&&b("tr.footrow td:eq("+a+")",h.grid.sDiv).css("display",j);k=this.widthOrg?this.widthOrg:parseInt(this.width,10);if(j==="none")h.p.tblwidth-=k+g;else h.p.tblwidth+=k+g;this.hidden=!l;c=true}});if(c===true)if(h.p.shrinkToFit===false)b(h).jqGrid("setGridWidth",h.grid.width);else h.grid.width!==h.p.tblwidth&&b(h).jqGrid("setGridWidth",h.p.tblwidth)}})},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,j,h){function c(l){var a;a=l.length?b.makeArray(l):b.extend({},l);b.each(f,function(q){l[q]=a[this]})}function g(l,a){b(">tr"+(a||""),l).each(function(){var q=this,x=b.makeArray(q.cells);b.each(f,function(){var y=x[this];y&&q.appendChild(y)})})}var k=this.get(0);c(k.p.colModel);c(k.p.colNames);c(k.grid.headers);g(b("thead:first",k.grid.hDiv),h&&":not(.ui-jqgrid-labels)");j&&g(b("#"+b.jgrid.jqID(k.p.id)+" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot");k.p.footerrow&& +g(b("tbody:first",k.grid.sDiv));if(k.p.remapColumns)if(k.p.remapColumns.length)c(k.p.remapColumns);else k.p.remapColumns=b.makeArray(f);k.p.lastsort=b.inArray(k.p.lastsort,f);if(k.p.treeGrid)k.p.expColInd=b.inArray(k.p.expColInd,f)},setGridWidth:function(f,j){return this.each(function(){if(this.grid){var h=this,c,g=0,k=b.browser.webkit||b.browser.safari?0:h.p.cellLayout,l,a=0,q=false,x=h.p.scrollOffset,y,H=0,L=0,M;if(typeof j!="boolean")j=h.p.shrinkToFit;if(!isNaN(f)){f=parseInt(f,10);h.grid.width= +h.p.width=f;b("#gbox_"+b.jgrid.jqID(h.p.id)).css("width",f+"px");b("#gview_"+b.jgrid.jqID(h.p.id)).css("width",f+"px");b(h.grid.bDiv).css("width",f+"px");b(h.grid.hDiv).css("width",f+"px");h.p.pager&&b(h.p.pager).css("width",f+"px");h.p.toppager&&b(h.p.toppager).css("width",f+"px");if(h.p.toolbar[0]===true){b(h.grid.uDiv).css("width",f+"px");h.p.toolbar[1]=="both"&&b(h.grid.ubDiv).css("width",f+"px")}h.p.footerrow&&b(h.grid.sDiv).css("width",f+"px");if(j===false&&h.p.forceFit===true)h.p.forceFit= +false;if(j===true){b.each(h.p.colModel,function(){if(this.hidden===false){c=this.widthOrg?this.widthOrg:parseInt(this.width,10);g+=c+k;if(this.fixed)H+=c+k;else a++;L++}});if(a===0)return;h.p.tblwidth=g;y=f-k*a-H;if(!isNaN(h.p.height))if(b(h.grid.bDiv)[0].clientHeight0;b.each(h.p.colModel,function(U){if(this.hidden===false&&!this.fixed){c=this.widthOrg?this.widthOrg:parseInt(this.width,10);c=Math.round(y* +c/(h.p.tblwidth-k*a-H));if(!(c<0)){this.width=c;g+=c;h.grid.headers[U].width=c;h.grid.headers[U].el.style.width=c+"px";if(h.p.footerrow)h.grid.footers[U].style.width=c+"px";if(P)h.grid.cols[U].style.width=c+"px";l=U}}});M=0;if(q){if(f-H-(g+k*a)!==x)M=f-H-(g+k*a)-x}else if(Math.abs(f-H-(g+k*a))!==1)M=f-H-(g+k*a);h.p.colModel[l].width+=M;h.p.tblwidth=g+M+k*a+H;if(h.p.tblwidth>f){q=h.p.tblwidth-parseInt(f,10);h.p.tblwidth=f;c=h.p.colModel[l].width-=q}else c=h.p.colModel[l].width;h.grid.headers[l].width= +c;h.grid.headers[l].el.style.width=c+"px";if(P)h.grid.cols[l].style.width=c+"px";if(h.p.footerrow)h.grid.footers[l].style.width=c+"px"}if(h.p.tblwidth){b("table:first",h.grid.bDiv).css("width",h.p.tblwidth+"px");b("table:first",h.grid.hDiv).css("width",h.p.tblwidth+"px");h.grid.hDiv.scrollLeft=h.grid.bDiv.scrollLeft;h.p.footerrow&&b("table:first",h.grid.sDiv).css("width",h.p.tblwidth+"px")}}}})},setGridHeight:function(f){return this.each(function(){if(this.grid){b(this.grid.bDiv).css({height:f+(isNaN(f)? +"":"px")});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",this.grid.cDiv).html(f);b(this.grid.cDiv).show()})},setLabel:function(f,j,h,c){return this.each(function(){var g=-1;if(this.grid)if(typeof f!="undefined"){b(this.p.colModel).each(function(a){if(this.name==f){g=a;return false}});if(g>=0){var k=b("tr.ui-jqgrid-labels th:eq("+g+")",this.grid.hDiv);if(j){var l=b(".s-ico",k);b("[id^=jqgh_]", +k).empty().html(j).append(l);this.p.colNames[g]=j}if(h)typeof h==="string"?b(k).addClass(h):b(k).css(h);typeof c==="object"&&b(k).attr(c)}}})},setCell:function(f,j,h,c,g,k){return this.each(function(){var l=-1,a,q;if(this.grid){if(isNaN(j))b(this.p.colModel).each(function(y){if(this.name==j){l=y;return false}});else l=parseInt(j,10);if(l>=0)if(a=this.rows.namedItem(f)){var x=b("td:eq("+l+")",a);if(h!==""||k===true){a=this.formatter(f,h,l,a,"edit");q=this.p.colModel[l].title?{title:b.jgrid.stripHtml(a)}: +{};this.p.treeGrid&&b(".tree-wrap",b(x)).length>0?b("span",b(x)).html(a).attr(q):b(x).html(a).attr(q);if(this.p.datatype=="local"){a=this.p.colModel[l];h=a.formatter&&typeof a.formatter==="string"&&a.formatter=="date"?b.unformat.date(h,a):h;q=this.p._index[f];if(typeof q!="undefined")this.p.data[q][a.name]=h}}if(typeof c==="string")b(x).addClass(c);else c&&b(x).css(c);typeof g==="object"&&b(x).attr(g)}}})},getCell:function(f,j){var h=false;this.each(function(){var c=-1;if(this.grid){if(isNaN(j))b(this.p.colModel).each(function(l){if(this.name=== +j){c=l;return false}});else c=parseInt(j,10);if(c>=0){var g=this.rows.namedItem(f);if(g)try{h=b.unformat(b("td:eq("+c+")",g),{rowId:g.id,colModel:this.p.colModel[c]},c)}catch(k){h=b.jgrid.htmlDecode(b("td:eq("+c+")",g).html())}}}});return h},getCol:function(f,j,h){var c=[],g,k=0,l=0,a=0,q;j=typeof j!="boolean"?false:j;if(typeof h=="undefined")h=false;this.each(function(){var x=-1;if(this.grid){if(isNaN(f))b(this.p.colModel).each(function(M){if(this.name===f){x=M;return false}});else x=parseInt(f, +10);if(x>=0){var y=this.rows.length,H=0;if(y&&y>0){for(;H=0)j=this.p.data[h]}});return j}})})(jQuery); +(function(b){b.fmatter={};b.extend(b.fmatter,{isBoolean:function(a){return typeof a==="boolean"},isObject:function(a){return a&&(typeof a==="object"||b.isFunction(a))||false},isString:function(a){return typeof a==="string"},isNumber:function(a){return typeof a==="number"&&isFinite(a)},isNull:function(a){return a===null},isUndefined:function(a){return typeof a==="undefined"},isValue:function(a){return this.isObject(a)||this.isString(a)||this.isNumber(a)||this.isBoolean(a)},isEmpty:function(a){if(!this.isString(a)&& +this.isValue(a))return false;else if(!this.isValue(a))return true;a=b.trim(a).replace(/\ \;/ig,"").replace(/\ \;/ig,"");return a===""}});b.fn.fmatter=function(a,c,d,e,f){var g=c;d=b.extend({},b.jgrid.formatter,d);if(b.fn.fmatter[a])g=b.fn.fmatter[a](c,d,e,f);return g};b.fmatter.util={NumberFormat:function(a,c){b.fmatter.isNumber(a)||(a*=1);if(b.fmatter.isNumber(a)){var d=a<0,e=a+"",f=c.decimalSeparator?c.decimalSeparator:".",g;if(b.fmatter.isNumber(c.decimalPlaces)){var h=c.decimalPlaces; +e=Math.pow(10,h);e=Math.round(a*e)/e+"";g=e.lastIndexOf(".");if(h>0){if(g<0){e+=f;g=e.length-1}else if(f!==".")e=e.replace(".",f);for(;e.length-1-g-1?g:e.length;f=e.substring(g);for(var i=-1,j=g;j>0;j--){i++;if(i%3===0&&j!==g&&(!d||j>1))f=h+f;f=e.charAt(j-1)+f}e=f}e=c.prefix?c.prefix+e:e;return e=c.suffix?e+c.suffix:e}else return a},DateFormat:function(a,c,d,e){var f=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/, +g=typeof c==="string"?c.match(f):null;f=function(m,r){m=String(m);for(r=parseInt(r,10)||2;m.length11)c[g]=i+1-12}if(c[g])h[a[g].toLowerCase()]=parseInt(c[g],10)}if(h.f)h.m=h.f;if(h.m===0&&h.y===0&&h.d===0)return" ";h.m=parseInt(h.m,10)-1;i=h.y;if(i>=70&&i<=99)h.y=1900+h.y;else if(i>=0&&i<=69)h.y=2E3+h.y;i=new Date(h.y, +h.m,h.d,h.h,h.i,h.s,h.u)}if(d in e.masks)d=e.masks[d];else d||(d="Y-m-d");a=i.getHours();c=i.getMinutes();h=i.getDate();g=i.getMonth()+1;j=i.getTimezoneOffset();var l=i.getSeconds(),o=i.getMilliseconds(),n=i.getDay(),p=i.getFullYear(),q=(n+6)%7+1,s=(new Date(p,g-1,h)-new Date(p,0,1))/864E5,t={d:f(h),D:k.i18n.dayNames[n],j:h,l:k.i18n.dayNames[n+7],N:q,S:e.S(h),w:n,z:s,W:q<5?Math.floor((s+q-1)/7)+1:Math.floor((s+q-1)/7)||(((new Date(p-1,0,1)).getDay()+6)%7<4?53:52),F:k.i18n.monthNames[g-1+12],m:f(g), +M:k.i18n.monthNames[g-1],n:g,t:"?",L:"?",o:"?",Y:p,y:String(p).substring(2),a:a<12?e.AmPm[0]:e.AmPm[1],A:a<12?e.AmPm[2]:e.AmPm[3],B:"?",g:a%12||12,G:a,h:f(a%12||12),H:f(a),i:f(c),s:f(l),u:o,e:"?",I:"?",O:(j>0?"-":"+")+f(Math.floor(Math.abs(j)/60)*100+Math.abs(j)%60,4),P:"?",T:(String(i).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(i/ +1E3)};return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(m){return m in t?t[m]:m.substring(1)})}};b.fn.fmatter.defaultFormat=function(a,c){return b.fmatter.isValue(a)&&a!==""?a:c.defaultValue?c.defaultValue:" "};b.fn.fmatter.email=function(a,c){return b.fmatter.isEmpty(a)?b.fn.fmatter.defaultFormat(a,c):'
'+a+""};b.fn.fmatter.checkbox=function(a,c){var d=b.extend({},c.checkbox),e;b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend({},d, +c.colModel.formatoptions));e=d.disabled===true?'disabled="disabled"':"";if(b.fmatter.isEmpty(a)||b.fmatter.isUndefined(a))a=b.fn.fmatter.defaultFormat(a,d);a+="";a=a.toLowerCase();return'"};b.fn.fmatter.link=function(a,c){var d={target:c.target},e="";b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend({},d,c.colModel.formatoptions));if(d.target)e="target="+d.target;return b.fmatter.isEmpty(a)? +b.fn.fmatter.defaultFormat(a,c):"'+a+""};b.fn.fmatter.showlink=function(a,c){var d={baseLinkUrl:c.baseLinkUrl,showAction:c.showAction,addParam:c.addParam||"",target:c.target,idName:c.idName},e="";b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend({},d,c.colModel.formatoptions));if(d.target)e="target="+d.target;d=d.baseLinkUrl+d.showAction+"?"+d.idName+"="+c.rowId+d.addParam;return b.fmatter.isString(a)||b.fmatter.isNumber(a)?"'+a+"":b.fn.fmatter.defaultFormat(a, +c)};b.fn.fmatter.integer=function(a,c){var d=b.extend({},c.integer);b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend({},d,c.colModel.formatoptions));if(b.fmatter.isEmpty(a))return d.defaultValue;return b.fmatter.util.NumberFormat(a,d)};b.fn.fmatter.number=function(a,c){var d=b.extend({},c.number);b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend({},d,c.colModel.formatoptions));if(b.fmatter.isEmpty(a))return d.defaultValue;return b.fmatter.util.NumberFormat(a,d)};b.fn.fmatter.currency= +function(a,c){var d=b.extend({},c.currency);b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend({},d,c.colModel.formatoptions));if(b.fmatter.isEmpty(a))return d.defaultValue;return b.fmatter.util.NumberFormat(a,d)};b.fn.fmatter.date=function(a,c,d,e){d=b.extend({},c.date);b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend({},d,c.colModel.formatoptions));return!d.reformatAfterEdit&&e=="edit"?b.fn.fmatter.defaultFormat(a,c):b.fmatter.isEmpty(a)?b.fn.fmatter.defaultFormat(a,c):b.fmatter.util.DateFormat(d.srcformat, +a,d.newformat,d)};b.fn.fmatter.select=function(a,c){a+="";var d=false,e=[];if(b.fmatter.isUndefined(c.colModel.formatoptions)){if(!b.fmatter.isUndefined(c.colModel.editoptions))d=c.colModel.editoptions.value}else d=c.colModel.formatoptions.value;if(d){var f=c.colModel.editoptions.multiple===true?true:false,g=[],h;if(f){g=a.split(",");g=b.map(g,function(l){return b.trim(l)})}if(b.fmatter.isString(d))for(var i=d.split(";"),j=0,k=0;k2)h[1]=jQuery.map(h,function(l, +o){if(o>0)return l}).join(":");if(f){if(jQuery.inArray(h[0],g)>-1){e[j]=h[1];j++}}else if(b.trim(h[0])==b.trim(a)){e[0]=h[1];break}}else if(b.fmatter.isObject(d))if(f)e=jQuery.map(g,function(l){return d[l]});else e[0]=d[a]||""}a=e.join(", ");return a===""?b.fn.fmatter.defaultFormat(a,c):a};b.fn.fmatter.rowactions=function(a,c,d,e){var f={keys:false,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{oper:"edit"},url:null,delOptions:{},editOptions:{}};a=b.jgrid.jqID(a); +c=b.jgrid.jqID(c);e=b("#"+c)[0].p.colModel[e];b.fmatter.isUndefined(e.formatoptions)||(f=b.extend(f,e.formatoptions));if(!b.fmatter.isUndefined(b("#"+c)[0].p.editOptions))f.editOptions=b("#"+c)[0].p.editOptions;if(!b.fmatter.isUndefined(b("#"+c)[0].p.delOptions))f.delOptions=b("#"+c)[0].p.delOptions;e=function(h){f.afterSave&&f.afterSave(h);b("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+c+".ui-jqgrid-btable:first").show();b("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel", +"#"+c+".ui-jqgrid-btable:first").hide()};var g=function(h){f.afterRestore&&f.afterRestore(h);b("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+c+".ui-jqgrid-btable:first").show();b("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+c+".ui-jqgrid-btable:first").hide()};switch(d){case "edit":b("#"+c).jqGrid("editRow",a,f.keys,f.onEdit,f.onSuccess,f.url,f.extraparam,e,f.onError,g);b("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+c+".ui-jqgrid-btable:first").hide(); +b("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+c+".ui-jqgrid-btable:first").show();break;case "save":if(b("#"+c).jqGrid("saveRow",a,f.onSuccess,f.url,f.extraparam,e,f.onError,g)){b("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+c+".ui-jqgrid-btable:first").show();b("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+c+".ui-jqgrid-btable:first").hide()}break;case "cancel":b("#"+c).jqGrid("restoreRow",a,g);b("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del", +"#"+c+".ui-jqgrid-btable:first").show();b("tr#"+a+" div.ui-inline-save, tr#"+a+" div.ui-inline-cancel","#"+c+".ui-jqgrid-btable:first").hide();break;case "del":b("#"+c).jqGrid("delGridRow",a,f.delOptions);break;case "formedit":b("#"+c).jqGrid("setSelection",a);b("#"+c).jqGrid("editGridRow",a,f.editOptions)}};b.fn.fmatter.actions=function(a,c){var d={keys:false,editbutton:true,delbutton:true,editformbutton:false};b.fmatter.isUndefined(c.colModel.formatoptions)||(d=b.extend(d,c.colModel.formatoptions)); +var e=c.rowId,f="",g;if(typeof e=="undefined"||b.fmatter.isEmpty(e))return"";if(d.editformbutton){g="onclick=$.fn.fmatter.rowactions('"+e+"','"+c.gid+"','formedit',"+c.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";f=f+"
"}else if(d.editbutton){g="onclick=$.fn.fmatter.rowactions('"+ +e+"','"+c.gid+"','edit',"+c.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover') ";f=f+"
"}if(d.delbutton){g="onclick=$.fn.fmatter.rowactions('"+e+"','"+c.gid+"','del',"+c.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); "; +f=f+"
"}g="onclick=$.fn.fmatter.rowactions('"+e+"','"+c.gid+"','save',"+c.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";f=f+""; +g="onclick=$.fn.fmatter.rowactions('"+e+"','"+c.gid+"','cancel',"+c.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";f=f+"";return"
"+f+"
"};b.unformat=function(a,c,d,e){var f,g=c.colModel.formatter,h=c.colModel.formatoptions|| +{},i=/([\.\*\_\'\(\)\{\}\+\?\\])/g,j=c.colModel.unformat||b.fn.fmatter[g]&&b.fn.fmatter[g].unformat;if(typeof j!=="undefined"&&b.isFunction(j))f=j(b(a).text(),c,a);else if(!b.fmatter.isUndefined(g)&&b.fmatter.isString(g)){f=b.jgrid.formatter||{};switch(g){case "integer":h=b.extend({},f.integer,h);c=h.thousandsSeparator.replace(i,"\\$1");f=b(a).text().replace(RegExp(c,"g"),"");break;case "number":h=b.extend({},f.number,h);c=h.thousandsSeparator.replace(i,"\\$1");f=b(a).text().replace(RegExp(c,"g"), +"").replace(h.decimalSeparator,".");break;case "currency":h=b.extend({},f.currency,h);c=h.thousandsSeparator.replace(i,"\\$1");f=b(a).text().replace(RegExp(c,"g"),"").replace(h.decimalSeparator,".").replace(h.prefix,"").replace(h.suffix,"");break;case "checkbox":h=c.colModel.editoptions?c.colModel.editoptions.value.split(":"):["Yes","No"];f=b("input",a).attr("checked")?h[0]:h[1];break;case "select":f=b.unformat.select(a,c,d,e);break;case "actions":return"";default:f=b(a).text()}}return f!==undefined? +f:e===true?b(a).text():b.jgrid.htmlDecode(b(a).html())};b.unformat.select=function(a,c,d,e){d=[];a=b(a).text();if(e===true)return a;c=b.extend({},c.colModel.editoptions);if(c.value){var f=c.value;c=c.multiple===true?true:false;e=[];var g;if(c){e=a.split(",");e=b.map(e,function(k){return b.trim(k)})}if(b.fmatter.isString(f))for(var h=f.split(";"),i=0,j=0;j2)g[1]=jQuery.map(g,function(k,l){if(l>0)return k}).join(":");if(c){if(jQuery.inArray(g[1],e)>-1){d[i]= +g[0];i++}}else if(b.trim(g[1])==b.trim(a)){d[0]=g[0];break}}else if(b.fmatter.isObject(f)||b.isArray(f)){c||(e[0]=a);d=jQuery.map(e,function(k){var l;b.each(f,function(o,n){if(n==k){l=o;return false}});if(typeof l!="undefined")return l})}return d.join(", ")}else return a||""};b.unformat.date=function(a,c){var d=b.jgrid.formatter.date||{};b.fmatter.isUndefined(c.formatoptions)||(d=b.extend({},d,c.formatoptions));return b.fmatter.isEmpty(a)?b.fn.fmatter.defaultFormat(a,c):b.fmatter.util.DateFormat(d.newformat, a,d.srcformat,d)}})(jQuery); -(function(a){a.jgrid.extend({getColProp:function(f){var d={},b=this[0];if(!b.grid)return false;b=b.p.colModel;for(var m=0;m0&&a(f).each(function(){c=this;if(o=h.rows.namedItem(c[d])){g=c[d];if(b===true)if(h.p.jsonReader.repeatitems===true){if(h.p.jsonReader.cell)c=c[h.p.jsonReader.cell];for(var e=0;e span:first",o).html(k).attr(q):a("td:eq("+e+")",o).html(k).attr(q)}return t=true}a(h.p.colModel).each(function(n){m=b===true?this.jsonmap|| -this.name:this.name;if(c[m]!==undefined){k=h.formatter(g,c[m],n,c,"edit");q=this.title?{title:a.jgrid.stripHtml(k)}:{};h.p.treeGrid===true&&m==h.p.ExpandColumn?a("td:eq("+n+") > span:first",o).html(k).attr(q):a("td:eq("+n+")",o).html(k).attr(q);t=true}})}})});return t},filterGrid:function(f,d){d=a.extend({gridModel:false,gridNames:false,gridToolbar:false,filterModel:[],formtype:"horizontal",autosearch:true,formclass:"filterform",tableclass:"filtertable",buttonclass:"filterbutton",searchButton:"Search", -clearButton:"Clear",enableSearch:false,enableClear:false,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,url:"",marksearched:true},d||{});return this.each(function(){var b=this;this.p=d;if(this.p.filterModel.length===0&&this.p.gridModel===false)alert("No filter is set");else if(f){this.p.gridid=f.indexOf("#")!=-1?f:"#"+f;var m=a(this.p.gridid).jqGrid("getGridParam","colModel");if(m){if(this.p.gridModel===true){var t=a(this.p.gridid)[0],q;a.each(m,function(g){var e=[];this.search= -this.search===false?false:true;q=this.editrules&&this.editrules.searchhidden===true?true:this.hidden===true?false:true;if(this.search===true&&q===true){e.label=b.p.gridNames===true?t.p.colNames[g]:"";e.name=this.name;e.index=this.index||this.name;e.stype=this.edittype||"text";if(e.stype!="select")e.stype="text";e.defval=this.defval||"";e.surl=this.surl||"";e.sopt=this.editoptions||{};e.width=this.width;b.p.filterModel.push(e)}})}else a.each(b.p.filterModel,function(){for(var g=0;g0?true:false;a.extend(i.p.postData,g);var l;if(b.p.url){l=a(i).jqGrid("getGridParam","url");a(i).jqGrid("setGridParam",{url:b.p.url})}a(i).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",[{page:1}]);l&&a(i).jqGrid("setGridParam", -{url:l});a.isFunction(b.p.afterSearch)&&b.p.afterSearch()},k=function(){var g={},e,n=0,i=a(b.p.gridid)[0],j;a.isFunction(b.p.beforeClear)&&b.p.beforeClear();a.each(b.p.filterModel,function(){j=this.index;e=this.defval?this.defval:"";if(!this.stype)this.stype="text";switch(this.stype){case "select":var r;a("select[name="+j+"] option",b).each(function(v){if(v===0)this.selected=true;if(a(this).text()==e){this.selected=true;r=a(this).val();return false}});if(r){g[j]=r;b.p.marksearched&&a("#jqgh_"+this.name, -i.grid.hDiv).addClass("dirty-cell");n++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(s){}}break;case "text":a("input[name="+j+"]",b).val(e);if(e){g[j]=e;b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).addClass("dirty-cell");n++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(u){}}break}});var p=n>0?true:false;a.extend(i.p.postData,g);var l; -if(b.p.url){l=a(i).jqGrid("getGridParam","url");a(i).jqGrid("setGridParam",{url:b.p.url})}a(i).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",[{page:1}]);l&&a(i).jqGrid("setGridParam",{url:l});a.isFunction(b.p.afterClear)&&b.p.afterClear()},o,c=a("
");o=a("
");a(c).append(o);(function(){var g=document.createElement("tr"), -e,n,i,j;b.p.formtype=="horizontal"&&a(o).append(g);a.each(b.p.filterModel,function(p){i=document.createElement("td");a(i).append("");j=document.createElement("td");var l=this;if(!this.stype)this.stype="text";switch(this.stype){case "select":if(this.surl)a(j).load(this.surl,function(){l.defval&&a("select",this).val(l.defval);a("select",this).attr({name:l.index||l.name,id:"sg_"+l.name});l.sopt&&a("select",this).attr(l.sopt);b.p.gridToolbar===true&&l.width&& -a("select",this).width(l.width);b.p.autosearch===true&&a("select",this).change(function(){h();return false})});else if(l.sopt.value){var r=l.sopt.value,s=document.createElement("select");a(s).attr({name:l.index||l.name,id:"sg_"+l.name}).attr(l.sopt);var u;if(typeof r==="string"){p=r.split(";");for(var v=0;v");l.sopt&&a("input",j).attr(l.sopt);if(b.p.gridToolbar===true&&l.width)a.browser.msie?a("input",j).width(l.width- -4):a("input",j).width(l.width-2);b.p.autosearch===true&&a("input",j).keypress(function(w){if((w.charCode?w.charCode:w.keyCode?w.keyCode:0)==13){h();return false}return this});break}if(b.p.formtype=="horizontal"){b.p.gridToolbar===true&&b.p.gridNames===false?a(g).append(j):a(g).append(i).append(j);a(g).append(j)}else{e=document.createElement("tr");a(e).append(i).append(j);a(o).append(e)}});j=document.createElement("td");if(b.p.enableSearch===true){n="";a(j).append(n);a("input#sButton",j).click(function(){h();return false})}if(b.p.enableClear===true){n="";a(j).append(n);a("input#cButton",j).click(function(){k();return false})}if(b.p.enableClear===true||b.p.enableSearch===true)if(b.p.formtype=="horizontal")a(g).append(j);else{e=document.createElement("tr");a(e).append(" ").append(j);a(o).append(e)}})();a(this).append(c); -this.triggerSearch=h;this.clearSearch=k}else alert("Could not get grid colModel")}else alert("No target grid is set!")})},filterToolbar:function(f){f=a.extend({autosearch:true,searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND",defaultSearch:"bw"},f||{});return this.each(function(){function d(h,k){var o=a(h);o[0]&&jQuery.each(k,function(){this.data!==undefined?o.bind(this.type,this.data,this.fn):o.bind(this.type,this.fn)})} -var b=this,m=function(){var h={},k=0,o,c,g={},e;a.each(b.p.colModel,function(){c=this.index||this.name;switch(this.stype){case "select":e=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:"eq";if(o=a("select[name="+c+"]",b.grid.hDiv).val()){h[c]=o;g[c]=e;k++}else try{delete b.p.postData[c]}catch(r){}break;case "text":e=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:f.defaultSearch;if(o=a("input[name="+c+"]",b.grid.hDiv).val()){h[c]=o;g[c]=e;k++}else try{delete b.p.postData[c]}catch(s){}break}}); -var n=k>0?true:false;if(f.stringResult===true||b.p.datatype=="local"){var i='{"groupOp":"'+f.groupOp+'","rules":[',j=0;a.each(h,function(r,s){if(j>0)i+=",";i+='{"field":"'+r+'",';i+='"op":"'+g[r]+'",';i+='"data":"'+s+'"}';j++});i+="]}";a.extend(b.p.postData,{filters:i})}else a.extend(b.p.postData,h);var p;if(b.p.searchurl){p=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var l=false;if(a.isFunction(f.beforeSearch))l=f.beforeSearch.call(b);l||a(b).jqGrid("setGridParam",{search:n}).trigger("reloadGrid", -[{page:1}]);p&&a(b).jqGrid("setGridParam",{url:p});a.isFunction(f.afterSearch)&&f.afterSearch()},t=a(""),q;a.each(b.p.colModel,function(){var h=this,k,o,c,g;o=a("");k=a("
");this.hidden===true&&a(o).css("display","none");this.search=this.search===false?false:true;if(typeof this.stype== -"undefined")this.stype="text";c=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(g=this.surl||c.dataUrl)a.ajax(a.extend({url:g,dataType:"html",complete:function(p){if(c.buildSelect!==undefined)(p=c.buildSelect(p))&&a(k).append(p);else a(k).append(p.responseText);c.defaultValue&&a("select",k).val(c.defaultValue);a("select",k).attr({name:h.index||h.name,id:"gs_"+h.name});c.attr&&a("select",k).attr(c.attr);a("select",k).css({width:"100%"});c.dataInit!==undefined&& -c.dataInit(a("select",k)[0]);c.dataEvents!==undefined&&d(a("select",k)[0],c.dataEvents);f.autosearch===true&&a("select",k).change(function(){m();return false});p=null}},a.jgrid.ajaxOptions,b.p.ajaxSelectOptions||{}));else{var e;if(h.searchoptions&&h.searchoptions.value)e=h.searchoptions.value;else if(h.editoptions&&h.editoptions.value)e=h.editoptions.value;if(e){g=document.createElement("select");g.style.width="100%";a(g).attr({name:h.index||h.name,id:"gs_"+h.name});var n,i;if(typeof e==="string"){e= -e.split(";");for(var j=0;j");c.attr&&a("input",k).attr(c.attr);c.dataInit!==undefined&&c.dataInit(a("input",k)[0]);c.dataEvents!==undefined&&d(a("input",k)[0],c.dataEvents);if(f.autosearch===true)f.searchOnEnter?a("input",k).keypress(function(p){if((p.charCode?p.charCode:p.keyCode?p.keyCode:0)==13){m();return false}return this}):a("input",k).keydown(function(p){switch(p.which){case 13:return false; -case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:q&&clearTimeout(q);q=setTimeout(function(){m()},500)}});break}a(o).append(k);a(t).append(o)});a("table thead",b.grid.hDiv).append(t);this.triggerToolbar=m;this.clearToolbar=function(h){var k={},o,c=0,g;h=typeof h!="boolean"?true:h;a.each(b.p.colModel,function(){o=this.searchoptions&&this.searchoptions.defaultValue?this.searchoptions.defaultValue:"";g=this.index||this.name;switch(this.stype){case "select":var l;a("select[name="+g+ -"] option",b.grid.hDiv).each(function(u){if(u===0)this.selected=true;if(a(this).text()==o){this.selected=true;l=a(this).val();return false}});if(l){k[g]=l;c++}else try{delete b.p.postData[g]}catch(r){}break;case "text":a("input[name="+g+"]",b.grid.hDiv).val(o);if(o){k[g]=o;c++}else try{delete b.p.postData[g]}catch(s){}break}});var e=c>0?true:false;if(f.stringResult===true||b.p.datatype=="local"){var n='{"groupOp":"'+f.groupOp+'","rules":[',i=0;a.each(k,function(l,r){if(i>0)n+=",";n+='{"field":"'+ -l+'",';n+='"op":"eq",';n+='"data":"'+r+'"}';i++});n+="]}";a.extend(b.p.postData,{filters:n})}else a.extend(b.p.postData,k);var j;if(b.p.searchurl){j=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var p=false;if(a.isFunction(f.beforeClear))p=f.beforeClear.call(b);p||h&&a(b).jqGrid("setGridParam",{search:e}).trigger("reloadGrid",[{page:1}]);j&&a(b).jqGrid("setGridParam",{url:j});a.isFunction(f.afterClear)&&f.afterClear()};this.toggleToolbar=function(){var h=a("tr.ui-search-toolbar",b.grid.hDiv); -h.css("display")=="none"?h.show():h.hide()}})}})})(jQuery); -(function(c){c.jgrid.extend({getPostData:function(){var a=this[0];if(a.grid)return a.p.postData},setPostData:function(a){var b=this[0];if(b.grid)if(typeof a==="object")b.p.postData=a;else alert("Error: cannot add a non-object postData value. postData unchanged.")},appendPostData:function(a){var b=this[0];if(b.grid)typeof a==="object"?c.extend(b.p.postData,a):alert("Error: cannot append a non-object postData value. postData unchanged.")},setPostDataItem:function(a,b){var d=this[0];if(d.grid)d.p.postData[a]= -b},getPostDataItem:function(a){var b=this[0];if(b.grid)return b.p.postData[a]},removePostDataItem:function(a){var b=this[0];b.grid&&delete b.p.postData[a]},getUserData:function(){var a=this[0];if(a.grid)return a.p.userData},getUserDataItem:function(a){var b=this[0];if(b.grid)return b.p.userData[a]}})})(jQuery); -(function(a){if(a.browser.msie&&a.browser.version==8)a.expr[":"].hidden=function(b){return b.offsetWidth===0||b.offsetHeight===0||b.style.display=="none"};a.jgrid._multiselect=false;if(a.ui)if(a.ui.multiselect){if(a.ui.multiselect.prototype._setSelected){var q=a.ui.multiselect.prototype._setSelected;a.ui.multiselect.prototype._setSelected=function(b,j){b=q.call(this,b,j);if(j&&this.selectedList){var c=this.element;this.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(c)})}return b}}if(a.ui.multiselect.prototype.destroy)a.ui.multiselect.prototype.destroy= -function(){this.element.show();this.container.remove();a.Widget===undefined?a.widget.prototype.destroy.apply(this,arguments):a.Widget.prototype.destroy.apply(this,arguments)};a.jgrid._multiselect=true}a.jgrid.extend({sortableColumns:function(b){return this.each(function(){function j(){c.p.disableClick=true}var c=this,h={tolerance:"pointer",axis:"x",scrollSensitivity:"1",items:">th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)",placeholder:{element:function(e){return a(document.createElement(e[0].nodeName)).addClass(e[0].className+ -" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(e,g){g.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10));g.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}},update:function(e,g){e=a(g.item).parent();e=a(">th",e);var i={};a.each(c.p.colModel,function(m){i[this.name]=m});var l=[]; -e.each(function(){var m=a(">div",this).get(0).id.replace(/^jqgh_/,"");m in i&&l.push(i[m])});a(c).jqGrid("remapColumns",l,true,true);a.isFunction(c.p.sortable.update)&&c.p.sortable.update(l);setTimeout(function(){c.p.disableClick=false},50)}};if(c.p.sortable.options)a.extend(h,c.p.sortable.options);else if(a.isFunction(c.p.sortable))c.p.sortable={update:c.p.sortable};if(h.start){var d=h.start;h.start=function(e,g){j();d.call(this,e,g)}}else h.start=j;if(c.p.sortable.exclude)h.items+=":not("+c.p.sortable.exclude+ -")";b.sortable(h).data("sortable").floating=true})},columnChooser:function(b){function j(f,k,p){if(k>=0){var o=f.slice(),r=o.splice(k,Math.max(f.length-k,k));if(k>f.length)k=f.length;o[k]=p;return o.concat(r)}}function c(f,k){if(f)if(typeof f=="string")a.fn[f]&&a.fn[f].apply(k,a.makeArray(arguments).slice(2));else a.isFunction(f)&&f.apply(k,a.makeArray(arguments).slice(2))}var h=this;if(!a("#colchooser_"+h[0].p.id).length){var d=a('
'), -e=a("select",d);b=a.extend({width:420,height:240,classname:null,done:function(f){f&&h.jqGrid("remapColumns",f,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(f){var k={};k[f.bSubmit]=function(){f.apply_perm();f.cleanup(false)};k[f.bCancel]=function(){f.cleanup(true)};return{buttons:k,close:function(){f.cleanup(true)},modal:false,resizable:false,width:f.width+20}},apply_perm:function(){a("option",e).each(function(){this.selected?h.jqGrid("showCol",g[this.value].name):h.jqGrid("hideCol", -g[this.value].name)});var f=[];a("option[selected]",e).each(function(){f.push(parseInt(this.value,10))});a.each(f,function(){delete l[g[parseInt(this,10)].name]});a.each(l,function(){var k=parseInt(this,10);f=j(f,k,k)});b.done&&b.done.call(h,f)},cleanup:function(f){c(b.dlog,d,"destroy");c(b.msel,e,"destroy");d.remove();f&&b.done&&b.done.call(h)},msel_opts:{}},a.jgrid.col,b||{});if(a.ui)if(a.ui.multiselect)if(b.msel=="multiselect"){if(!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!"); -return}b.msel_opts=a.extend(a.ui.multiselect.defaults,b.msel_opts)}b.caption&&d.attr("title",b.caption);if(b.classname){d.addClass(b.classname);e.addClass(b.classname)}if(b.width){a(">div",d).css({width:b.width,margin:"0 auto"});e.css("width",b.width)}if(b.height){a(">div",d).css("height",b.height);e.css("height",b.height-10)}var g=h.jqGrid("getGridParam","colModel"),i=h.jqGrid("getGridParam","colNames"),l={},m=[];e.empty();a.each(g,function(f){l[this.name]=f;if(this.hidedlg)this.hidden||m.push(f); -else e.append("")});var n=a.isFunction(b.dlog_opts)?b.dlog_opts.call(h,b):b.dlog_opts;c(b.dlog,d,n);n=a.isFunction(b.msel_opts)?b.msel_opts.call(h,b):b.msel_opts;c(b.msel,e,n)}},sortableRows:function(b){return this.each(function(){var j=this;if(j.grid)if(!j.p.treeGrid)if(a.fn.sortable){b=a.extend({cursor:"move",axis:"y",items:".jqgrow"},b||{});if(b.start&&a.isFunction(b.start)){b._start_=b.start;delete b.start}else b._start_= -false;if(b.update&&a.isFunction(b.update)){b._update_=b.update;delete b.update}else b._update_=false;b.start=function(c,h){a(h.item).css("border-width","0px");a("td",h.item).each(function(g){this.style.width=j.grid.cols[g].style.width});if(j.p.subGrid){var d=a(h.item).attr("id");try{a(j).jqGrid("collapseSubGridRow",d)}catch(e){}}b._start_&&b._start_.apply(this,[c,h])};b.update=function(c,h){a(h.item).css("border-width","");j.p.rownumbers===true&&a("td.jqgrid-rownum",j.rows).each(function(d){a(this).html(d+ -1)});b._update_&&b._update_.apply(this,[c,h])};a("tbody:first",j).sortable(b);a("tbody:first",j).disableSelection()}})},gridDnD:function(b){return this.each(function(){function j(){var d=a.data(c,"dnd");a("tr.jqgrow:not(.ui-draggable)",c).draggable(a.isFunction(d.drag)?d.drag.call(a(c),d):d.drag)}var c=this;if(c.grid)if(!c.p.treeGrid)if(a.fn.draggable&&a.fn.droppable){a("#jqgrid_dnd").html()===null&&a("body").append("
");if(typeof b=="string"&&b== -"updateDnD"&&c.p.jqgdnd===true)j();else{b=a.extend({drag:function(d){return a.extend({start:function(e,g){if(c.p.subGrid){var i=a(g.helper).attr("id");try{a(c).jqGrid("collapseSubGridRow",i)}catch(l){}}for(i=0;i -0&&a.data(g[0],"dnd")!==undefined){e=a.data(g[0],"dnd").connectWith;return a.inArray("#"+this.id,e)!=-1?true:false}return e},drop:function(e,g){if(a(g.draggable).hasClass("jqgrow")){var i=a(g.draggable).attr("id");i=g.draggable.parent().parent().jqGrid("getRowData",i);if(!d.dropbyname){var l=0,m={},n,f=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var k in i){if(i.hasOwnProperty(k)&&f[l]){n=f[l].name;m[n]=i[k]}l++}i=m}catch(p){}}g.helper.dropped=true;if(d.beforedrop&&a.isFunction(d.beforedrop)){n= -d.beforedrop.call(this,e,g,i,a("#"+c.id),a(this));if(typeof n!="undefined"&&n!==null&&typeof n=="object")i=n}if(g.helper.dropped){var o;if(d.autoid)if(a.isFunction(d.autoid))o=d.autoid.call(this,i);else{o=Math.ceil(Math.random()*1E3);o=d.autoidprefix+o}a("#"+this.id).jqGrid("addRowData",o,i,d.droppos)}d.ondrop&&a.isFunction(d.ondrop)&&d.ondrop.call(this,e,g,i)}}},d.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",hoverClass:"ui-state-hover"}, -drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},b||{});if(b.connectWith){b.connectWith=b.connectWith.split(",");b.connectWith=a.map(b.connectWith,function(d){return a.trim(d)});a.data(c,"dnd",b);c.p.reccount!="0"&&!c.p.jqgdnd&&j();c.p.jqgdnd=true;for(var h=0;h0?true:false;if(c.stringResult===true||b.p.datatype=="local"){var m='{"groupOp":"'+c.groupOp+ +'","rules":[',q=0;a.each(e,function(p,s){if(q>0)m+=",";m+='{"field":"'+p+'",';m+='"op":"'+g[p]+'",';s+="";m+='"data":"'+s.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';q++});m+="]}";a.extend(b.p.postData,{filters:m});a.each(["searchField","searchString","searchOper"],function(p,s){b.p.postData.hasOwnProperty(s)&&delete b.p.postData[s]})}else a.extend(b.p.postData,e);var l;if(b.p.searchurl){l=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var r=false;if(a.isFunction(c.beforeSearch))r=c.beforeSearch.call(b); +r||a(b).jqGrid("setGridParam",{search:n}).trigger("reloadGrid",[{page:1}]);l&&a(b).jqGrid("setGridParam",{url:l});a.isFunction(c.afterSearch)&&c.afterSearch()},o=a(""),t;a.each(b.p.colModel,function(){var e=this,f,j,d,g;j=a("");f=a("
");this.hidden===true&&a(j).css("display","none"); +this.search=this.search===false?false:true;if(typeof this.stype=="undefined")this.stype="text";d=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(g=this.surl||d.dataUrl)a.ajax(a.extend({url:g,dataType:"html",complete:function(l){if(d.buildSelect!==undefined)(l=d.buildSelect(l))&&a(f).append(l);else a(f).append(l.responseText);d.defaultValue&&a("select",f).val(d.defaultValue);a("select",f).attr({name:e.index||e.name,id:"gs_"+e.name});d.attr&&a("select",f).attr(d.attr); +a("select",f).css({width:"100%"});d.dataInit!==undefined&&d.dataInit(a("select",f)[0]);d.dataEvents!==undefined&&h(a("select",f)[0],d.dataEvents);c.autosearch===true&&a("select",f).change(function(){i();return false});l=null}},a.jgrid.ajaxOptions,b.p.ajaxSelectOptions||{}));else{var k;if(e.searchoptions&&e.searchoptions.value)k=e.searchoptions.value;else if(e.editoptions&&e.editoptions.value)k=e.editoptions.value;if(k){g=document.createElement("select");g.style.width="100%";a(g).attr({name:e.index|| +e.name,id:"gs_"+e.name});var n,m;if(typeof k==="string"){k=k.split(";");for(var q=0;q");d.attr&&a("input",f).attr(d.attr);d.dataInit!==undefined&&d.dataInit(a("input",f)[0]);d.dataEvents!==undefined&&h(a("input",f)[0],d.dataEvents);if(c.autosearch===true)c.searchOnEnter?a("input",f).keypress(function(l){if((l.charCode?l.charCode:l.keyCode?l.keyCode: +0)==13){i();return false}return this}):a("input",f).keydown(function(l){switch(l.which){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:t&&clearTimeout(t);t=setTimeout(function(){i()},500)}})}a(j).append(f);a(o).append(j)});a("table thead",b.grid.hDiv).append(o);this.ftoolbar=true;this.triggerToolbar=i;this.clearToolbar=function(e){var f={},j,d=0,g;e=typeof e!="boolean"?true:e;a.each(b.p.colModel,function(){j=this.searchoptions&&this.searchoptions.defaultValue? +this.searchoptions.defaultValue:"";g=this.index||this.name;switch(this.stype){case "select":var r;a("#gs_"+a.jgrid.jqID(g)+" option",b.grid.hDiv).each(function(u){if(u===0)this.selected=true;if(a(this).text()==j){this.selected=true;r=a(this).val();return false}});if(r){f[g]=r;d++}else try{delete b.p.postData[g]}catch(p){}break;case "text":a("#gs_"+a.jgrid.jqID(g),b.grid.hDiv).val(j);if(j){f[g]=j;d++}else try{delete b.p.postData[g]}catch(s){}}});var k=d>0?true:false;if(c.stringResult===true||b.p.datatype== +"local"){var n='{"groupOp":"'+c.groupOp+'","rules":[',m=0;a.each(f,function(r,p){if(m>0)n+=",";n+='{"field":"'+r+'",';n+='"op":"eq",';p+="";n+='"data":"'+p.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';m++});n+="]}";a.extend(b.p.postData,{filters:n});a.each(["searchField","searchString","searchOper"],function(r,p){b.p.postData.hasOwnProperty(p)&&delete b.p.postData[p]})}else a.extend(b.p.postData,f);var q;if(b.p.searchurl){q=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var l=false;if(a.isFunction(c.beforeClear))l= +c.beforeClear.call(b);l||e&&a(b).jqGrid("setGridParam",{search:k}).trigger("reloadGrid",[{page:1}]);q&&a(b).jqGrid("setGridParam",{url:q});a.isFunction(c.afterClear)&&c.afterClear()};this.toggleToolbar=function(){var e=a("tr.ui-search-toolbar",b.grid.hDiv);e.css("display")=="none"?e.show():e.hide()}}})}})})(jQuery); +(function(a){a.extend(a.jgrid,{showModal:function(b){b.w.show()},closeModal:function(b){b.w.hide().attr("aria-hidden","true");b.o&&b.o.remove()},hideModal:function(b,c){c=a.extend({jqm:true,gb:""},c||{});if(c.onClose){var d=c.onClose(b);if(typeof d=="boolean"&&!d)return}if(a.fn.jqm&&c.jqm===true)a(b).attr("aria-hidden","true").jqmHide();else{if(c.gb!=="")try{a(".jqgrid-overlay:first",c.gb).hide()}catch(f){}a(b).hide().attr("aria-hidden","true")}},findPos:function(b){var c=0,d=0;if(b.offsetParent){do{c+= +b.offsetLeft;d+=b.offsetTop}while(b=b.offsetParent)}return[c,d]},createModal:function(b,c,d,f,g,h,j){var e=document.createElement("div"),k,m=this;j=a.extend({},j||{});k=a(d.gbox).attr("dir")=="rtl"?true:false;e.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";e.id=b.themodal;var i=document.createElement("div");i.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";i.id=b.modalhead;a(i).append(""+d.caption+"");var q= +a("").hover(function(){q.addClass("ui-state-hover")},function(){q.removeClass("ui-state-hover")}).append("");a(i).append(q);if(k){e.dir="rtl";a(".ui-jqdialog-title",i).css("float","right");a(".ui-jqdialog-titlebar-close",i).css("left","0.3em")}else{e.dir="ltr";a(".ui-jqdialog-title",i).css("float","left");a(".ui-jqdialog-titlebar-close",i).css("right","0.3em")}var l=document.createElement("div"); +a(l).addClass("ui-jqdialog-content ui-widget-content").attr("id",b.modalcontent);a(l).append(c);e.appendChild(l);a(e).prepend(i);if(h===true)a("body").append(e);else typeof h=="string"?a(h).append(e):a(e).insertBefore(f);a(e).css(j);if(typeof d.jqModal==="undefined")d.jqModal=true;c={};if(a.fn.jqm&&d.jqModal===true){if(d.left===0&&d.top===0&&d.overlay){j=[];j=this.findPos(g);d.left=j[0]+4;d.top=j[1]+4}c.top=d.top+"px";c.left=d.left}else if(d.left!==0||d.top!==0){c.left=d.left;c.top=d.top+"px"}a("a.ui-jqdialog-titlebar-close", +i).click(function(){var p=a("#"+b.themodal).data("onClose")||d.onClose,o=a("#"+b.themodal).data("gbox")||d.gbox;m.hideModal("#"+b.themodal,{gb:o,jqm:d.jqModal,onClose:p});return false});if(d.width===0||!d.width)d.width=300;if(d.height===0||!d.height)d.height=200;if(!d.zIndex){f=a(f).parents("*[role=dialog]").filter(":first").css("z-index");d.zIndex=f?parseInt(f,10)+1:950}f=0;if(k&&c.left&&!h){f=a(d.gbox).width()-(!isNaN(d.width)?parseInt(d.width,10):0)-8;c.left=parseInt(c.left,10)+parseInt(f,10)}if(c.left)c.left+= +"px";a(e).css(a.extend({width:isNaN(d.width)?"auto":d.width+"px",height:isNaN(d.height)?"auto":d.height+"px",zIndex:d.zIndex,overflow:"hidden"},c)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":b.modalhead,"aria-hidden":"true"});if(typeof d.drag=="undefined")d.drag=true;if(typeof d.resize=="undefined")d.resize=true;if(d.drag){a(i).css("cursor","move");if(a.fn.jqDrag)a(e).jqDrag(i);else try{a(e).draggable({handle:a("#"+i.id)})}catch(n){}}if(d.resize)if(a.fn.jqResize){a(e).append("
"); +a("#"+b.themodal).jqResize(".jqResize",b.scrollelm?"#"+b.scrollelm:false)}else try{a(e).resizable({handles:"se, sw",alsoResize:b.scrollelm?"#"+b.scrollelm:false})}catch(r){}d.closeOnEscape===true&&a(e).keydown(function(p){if(p.which==27){p=a("#"+b.themodal).data("onClose")||d.onClose;m.hideModal(this,{gb:d.gbox,jqm:d.jqModal,onClose:p})}})},viewModal:function(b,c){c=a.extend({toTop:true,overlay:10,modal:false,overlayClass:"ui-widget-overlay",onShow:this.showModal,onHide:this.closeModal,gbox:"",jqm:true, +jqM:true},c||{});if(a.fn.jqm&&c.jqm===true)c.jqM?a(b).attr("aria-hidden","false").jqm(c).jqmShow():a(b).attr("aria-hidden","false").jqmShow();else{if(c.gbox!==""){a(".jqgrid-overlay:first",c.gbox).show();a(b).data("gbox",c.gbox)}a(b).show().attr("aria-hidden","false");try{a(":input:visible",b)[0].focus()}catch(d){}}},info_dialog:function(b,c,d,f){var g={width:290,height:"auto",dataheight:"auto",drag:true,resize:false,caption:""+b+"",left:250,top:170,zIndex:1E3,jqModal:true,modal:false,closeOnEscape:true, +align:"center",buttonalign:"center",buttons:[]};a.extend(g,f||{});var h=g.jqModal,j=this;if(a.fn.jqm&&!h)h=false;b="";if(g.buttons.length>0)for(f=0;f"+g.buttons[f].text+""}f=isNaN(g.dataheight)?g.dataheight:g.dataheight+"px";var e="
";e+="
"+c+"
";e+=d?"
"+d+""+b+"
":b!==""?"
"+ +b+"
":"";e+="
";try{a("#info_dialog").attr("aria-hidden")=="false"&&this.hideModal("#info_dialog",{jqm:h});a("#info_dialog").remove()}catch(k){}this.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},e,g,"","",true);b&&a.each(g.buttons,function(i){a("#"+this.id,"#info_id").bind("click",function(){g.buttons[i].onClick.call(a("#info_dialog"));return false})});a("#closedialog","#info_id").click(function(){j.hideModal("#info_dialog",{jqm:h}); +return false});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();this.viewModal("#info_dialog",{onHide:function(i){i.w.hide().remove();i.o&&i.o.remove()},modal:g.modal,jqm:h});a.isFunction(g.afterOpen)&&g.afterOpen();try{a("#info_dialog").focus()}catch(m){}},createEl:function(b,c,d,f,g){function h(l,n){a.isFunction(n.dataInit)&&n.dataInit(l);n.dataEvents&&a.each(n.dataEvents, +function(){this.data!==undefined?a(l).bind(this.type,this.data,this.fn):a(l).bind(this.type,this.fn)});return n}function j(l,n,r){var p=["dataInit","dataEvents","dataUrl","buildSelect","sopt","searchhidden","defaultValue","attr"];if(typeof r!="undefined"&&a.isArray(r))p=a.extend(p,r);a.each(n,function(o,s){a.inArray(o,p)===-1&&a(l).attr(o,s)});n.hasOwnProperty("id")||a(l).attr("id",a.jgrid.randId())}var e="";switch(b){case "textarea":e=document.createElement("textarea");if(f)c.cols||a(e).css({width:"98%"}); +else if(!c.cols)c.cols=20;if(!c.rows)c.rows=2;if(d==" "||d==" "||d.length==1&&d.charCodeAt(0)==160)d="";e.value=d;j(e,c);c=h(e,c);a(e).attr({role:"textbox",multiline:"true"});break;case "checkbox":e=document.createElement("input");e.type="checkbox";if(c.value){b=c.value.split(":");if(d===b[0]){e.checked=true;e.defaultChecked=true}e.value=b[0];a(e).attr("offval",b[1])}else{b=d.toLowerCase();if(b.search(/(false|0|no|off|undefined)/i)<0&&b!==""){e.checked=true;e.defaultChecked=true;e.value= +d}else e.value="on";a(e).attr("offval","off")}j(e,c,["value"]);c=h(e,c);a(e).attr("role","checkbox");break;case "select":e=document.createElement("select");e.setAttribute("role","select");f=[];if(c.multiple===true){b=true;e.multiple="multiple";a(e).attr("aria-multiselectable","true")}else b=false;if(typeof c.dataUrl!="undefined")a.ajax(a.extend({url:c.dataUrl,type:"GET",dataType:"html",context:{elem:e,options:c,vl:d},success:function(l){var n=[],r=this.elem,p=this.vl,o=a.extend({},this.options),s= +o.multiple===true;if(typeof o.buildSelect!="undefined")l=o.buildSelect(l);if(l=a(l).html()){a(r).append(l);j(r,o);o=h(r,o);if(typeof o.size==="undefined")o.size=s?3:1;if(s){n=p.split(",");n=a.map(n,function(t){return a.trim(t)})}else n[0]=a.trim(p);setTimeout(function(){a("option",r).each(function(){a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),n)>-1||a.inArray(a.trim(a(this).val()),n)>-1)this.selected="selected"})},0)}}},g||{}));else if(c.value){var k;if(b){f=d.split(",");f=a.map(f, +function(l){return a.trim(l)});if(typeof c.size==="undefined")c.size=3}else c.size=1;if(typeof c.value==="function")c.value=c.value();var m,i;if(typeof c.value==="string"){m=c.value.split(";");for(k=0;k2)i[1]=a.map(i,function(l,n){if(n>0)return l}).join(":");g=document.createElement("option");g.setAttribute("role","option");g.value=i[0];g.innerHTML=i[1];if(!b&&(a.trim(i[0])==a.trim(d)||a.trim(i[1])==a.trim(d)))g.selected="selected";if(b&&(a.inArray(a.trim(i[1]), +f)>-1||a.inArray(a.trim(i[0]),f)>-1))g.selected="selected";e.appendChild(g)}}else if(typeof c.value==="object"){m=c.value;for(k in m)if(m.hasOwnProperty(k)){g=document.createElement("option");g.setAttribute("role","option");g.value=k;g.innerHTML=m[k];if(!b&&(a.trim(k)==a.trim(d)||a.trim(m[k])==a.trim(d)))g.selected="selected";if(b&&(a.inArray(a.trim(m[k]),f)>-1||a.inArray(a.trim(k),f)>-1))g.selected="selected";e.appendChild(g)}}j(e,c,["value"]);c=h(e,c)}break;case "text":case "password":case "button":k= +b=="button"?"button":"textbox";e=document.createElement("input");e.type=b;e.value=d;j(e,c);c=h(e,c);if(b!="button")if(f)c.size||a(e).css({width:"98%"});else if(!c.size)c.size=20;a(e).attr("role",k);break;case "image":case "file":e=document.createElement("input");e.type=b;j(e,c);c=h(e,c);break;case "custom":e=document.createElement("span");try{if(a.isFunction(c.custom_element))if(m=c.custom_element.call(this,d,c)){m=a(m).addClass("customelement").attr({id:c.id,name:c.name});a(e).empty().append(m)}else throw"e2"; +else throw"e1";}catch(q){q=="e1"&&this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose);q=="e2"?this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose):this.info_dialog(a.jgrid.errors.errcap,typeof q==="string"?q:q.message,a.jgrid.edit.bClose)}}return e},checkDate:function(b,c){var d={},f;b=b.toLowerCase();f=b.indexOf("/")!=-1?"/":b.indexOf("-")!=-1?"-":b.indexOf(".")!=-1?".":"/"; +b=b.split(f);c=c.split(f);if(c.length!=3)return false;f=-1;for(var g,h=-1,j=-1,e=0;e12)return false}if(h===-1)return false;else{k=d[b[h]].toString();if(k.length<1||d[b[h]]<1||d[b[h]]>31||d[b[j]]==2&&d[b[h]]>(d[b[f]]%4===0&&(d[b[f]]%100!==0||d[b[f]]%400===0)?29:28)||d[b[h]]>e[d[b[j]]])return false}return true},isEmpty:function(b){return b.match(/^\s+$/)||b===""?true:false},checkTime:function(b){var c=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!this.isEmpty(b))if(b=b.match(c)){if(b[3]){if(b[1]< +1||b[1]>12)return false}else if(b[1]>23)return false;if(b[2]>59)return false}else return false;return true},checkValues:function(b,c,d,f,g){var h,j;if(typeof f==="undefined")if(typeof c=="string"){f=0;for(g=d.p.colModel.length;f=0)h=d.p.colModel[c].editrules}else{h=f;j=g===undefined?"_":g}if(h){j||(j=d.p.colNames[c]);if(h.required===true)if(this.isEmpty(b))return[false, +j+": "+a.jgrid.edit.msg.required,""];f=h.required===false?false:true;if(h.number===true)if(!(f===false&&this.isEmpty(b)))if(isNaN(b))return[false,j+": "+a.jgrid.edit.msg.number,""];if(typeof h.minValue!="undefined"&&!isNaN(h.minValue))if(parseFloat(b)parseFloat(h.maxValue))return[false,j+": "+a.jgrid.edit.msg.maxValue+" "+h.maxValue,""];if(h.email=== +true)if(!(f===false&&this.isEmpty(b))){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; +if(!g.test(b))return[false,j+": "+a.jgrid.edit.msg.email,""]}if(h.integer===true)if(!(f===false&&this.isEmpty(b))){if(isNaN(b))return[false,j+": "+a.jgrid.edit.msg.integer,""];if(b%1!==0||b.indexOf(".")!=-1)return[false,j+": "+a.jgrid.edit.msg.integer,""]}if(h.date===true)if(!(f===false&&this.isEmpty(b))){c=d.p.colModel[c].formatoptions&&d.p.colModel[c].formatoptions.newformat?d.p.colModel[c].formatoptions.newformat:d.p.colModel[c].datefmt||"Y-m-d";if(!this.checkDate(c,b))return[false,j+": "+a.jgrid.edit.msg.date+ +" - "+c,""]}if(h.time===true)if(!(f===false&&this.isEmpty(b)))if(!this.checkTime(b))return[false,j+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(h.url===true)if(!(f===false&&this.isEmpty(b))){g=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!g.test(b))return[false,j+": "+a.jgrid.edit.msg.url,""]}if(h.custom===true)if(!(f===false&&this.isEmpty(b)))if(a.isFunction(h.custom_func)){b=h.custom_func.call(d,b,j);return a.isArray(b)? +b:[false,a.jgrid.edit.msg.customarray,""]}else return[false,a.jgrid.edit.msg.customfcheck,""]}return[true,"",""]}})})(jQuery); +(function(b){b.jgrid.extend({jqGridImport:function(a){a=b.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},a||{});return this.each(function(){var d=this,c=function(f,g){var e=b(g.xmlGrid.config,f)[0],h=b(g.xmlGrid.data,f)[0],i;if(xmlJsonClass.xml2json&&b.jgrid.parse){e=xmlJsonClass.xml2json(e," ");e=b.jgrid.parse(e);for(var l in e)if(e.hasOwnProperty(l))i=e[l];if(h){h=e.grid.datatype; +e.grid.datatype="xmlstring";e.grid.datastr=f;b(d).jqGrid(i).jqGrid("setGridParam",{datatype:h})}else b(d).jqGrid(i)}else alert("xml2json or parse are not present")},j=function(f,g){if(f&&typeof f=="string"){var e=b.jgrid.parse(f),h=e[g.jsonGrid.config];if(e=e[g.jsonGrid.data]){var i=h.datatype;h.datatype="jsonstring";h.datastr=e;b(d).jqGrid(h).jqGrid("setGridParam",{datatype:i})}else b(d).jqGrid(h)}};switch(a.imptype){case "xml":b.ajax(b.extend({url:a.impurl,type:a.mtype,data:a.impData,dataType:"xml", +complete:function(f,g){if(g=="success"){c(f.responseXML,a);b.isFunction(a.importComplete)&&a.importComplete(f)}}},a.ajaxOptions));break;case "xmlstring":if(a.impstring&&typeof a.impstring=="string"){var k=b.jgrid.stringToDoc(a.impstring);if(k){c(k,a);b.isFunction(a.importComplete)&&a.importComplete(k);a.impstring=null}k=null}break;case "json":b.ajax(b.extend({url:a.impurl,type:a.mtype,data:a.impData,dataType:"json",complete:function(f,g){if(g=="success"){j(f.responseText,a);b.isFunction(a.importComplete)&& +a.importComplete(f)}}},a.ajaxOptions));break;case "jsonstring":if(a.impstring&&typeof a.impstring=="string"){j(a.impstring,a);b.isFunction(a.importComplete)&&a.importComplete(a.impstring);a.impstring=null}}})},jqGridExport:function(a){a=b.extend({exptype:"xmlstring",root:"grid",ident:"\t"},a||{});var d=null;this.each(function(){if(this.grid){var c=b.extend({},b(this).jqGrid("getGridParam"));if(c.rownumbers){c.colNames.splice(0,1);c.colModel.splice(0,1)}if(c.multiselect){c.colNames.splice(0,1);c.colModel.splice(0, +1)}if(c.subGrid){c.colNames.splice(0,1);c.colModel.splice(0,1)}c.knv=null;if(c.treeGrid)for(var j in c.treeReader)if(c.treeReader.hasOwnProperty(j)){c.colNames.splice(c.colNames.length-1);c.colModel.splice(c.colModel.length-1)}switch(a.exptype){case "xmlstring":d="<"+a.root+">"+xmlJsonClass.json2xml(c,a.ident)+"";break;case "jsonstring":d="{"+xmlJsonClass.toJson(c,a.root,a.ident,false)+"}";if(c.postData.filters!==undefined){d=d.replace(/filters":"/,'filters":');d=d.replace(/}]}"/,"}]}")}}}}); +return d},excelExport:function(a){a=b.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},a||{});return this.each(function(){if(this.grid){var d;if(a.exptype=="remote"){d=b.extend({},this.p.postData);d[a.oper]=a.tag;d=jQuery.param(d);d=a.url.indexOf("?")!=-1?a.url+"&"+d:a.url+"?"+d;window.location=d}}})}})})(jQuery); +var xmlJsonClass={xml2json:function(a,b){if(a.nodeType===9)a=a.documentElement;var g=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+b+(b?g.replace(/\t/g,b):g.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,b){var g=function(d,c,i){var h="",k,j;if(d instanceof Array)if(d.length===0)h+=i+"<"+c+">__EMPTY_ARRAY_\n";else{k=0;for(j=d.length;k":"/>";if(k){for(j in d)if(d.hasOwnProperty(j))if(j==="#text")h+=d[j];else if(j==="#cdata")h+="";else if(j.charAt(0)!=="@")h+=g(d[j],j,i+"\t");h+=(h.charAt(h.length-1)==="\n"?i:"")+""}}else h+=typeof d==="function"?i+"<"+c+">":d.toString()==='""'||d.toString().length===0?i+"<"+c+">__EMPTY_STRING_":i+"<"+c+">"+d.toString()+"";return h},e="",f;for(f in a)if(a.hasOwnProperty(f))e+= +g(a[f],f,"");return b?e.replace(/\t/g,b):e.replace(/\t|\n/g,"")},toObj:function(a){var b={},g=/function/i;if(a.nodeType===1){if(a.attributes.length){var e;for(e=0;e1)b=this.escape(this.innerXml(a));else for(c=a.firstChild;c;c=c.nextSibling)if(g.test(a.firstChild.nodeValue)){b=a.firstChild.nodeValue;break}else b["#cdata"]=this.escape(c.nodeValue)}if(!a.attributes.length&&!a.firstChild)b=null}else if(a.nodeType===9)b=this.toObj(a.documentElement);else alert("unhandled node type: "+ +a.nodeType);return b},toJson:function(a,b,g,e){if(e===undefined)e=true;var f=b?'"'+b+'"':"",d="\t",c="\n";if(!e)c=d="";if(a==="[]")f+=b?":[]":"[]";else if(a instanceof Array){var i,h,k=[];h=0;for(i=a.length;h1?c+g+d+k.join(","+c+g+d)+c+g:k.join(""))+"]"}else if(a===null)f+=(b&&":")+"null";else if(typeof a==="object"){i=[];for(h in a)if(a.hasOwnProperty(h))i[i.length]=this.toJson(a[h],h,g+d,e);f+=(b?":{":"{")+(i.length>1?c+g+d+i.join(","+ +c+g+d)+c+g:i.join(""))+"}"}else f+=typeof a==="string"?(b&&":")+'"'+a.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"':(b&&":")+'"'+a.toString()+'"';return f},innerXml:function(a){var b="";if("innerHTML"in a)b=a.innerHTML;else{var g=function(e){var f="",d;if(e.nodeType===1){f+="<"+e.nodeName;for(d=0;d"}else f+= +"/>"}else if(e.nodeType===3)f+=e.nodeValue;else if(e.nodeType===4)f+="";return f};for(a=a.firstChild;a;a=a.nextSibling)b+=g(a)}return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();var b;for(b=a.firstChild;b;)if(b.nodeType===3)if(b.nodeValue.match(/[^ \f\n\r\t\v]/))b=b.nextSibling;else{var g=b.nextSibling;a.removeChild(b);b=g}else{b.nodeType===1&&this.removeWhite(b); +b=b.nextSibling}return a}}; +(function(a){if(a.browser.msie&&a.browser.version==8)a.expr[":"].hidden=function(b){return b.offsetWidth===0||b.offsetHeight===0||b.style.display=="none"};a.jgrid._multiselect=false;if(a.ui)if(a.ui.multiselect){if(a.ui.multiselect.prototype._setSelected){var q=a.ui.multiselect.prototype._setSelected;a.ui.multiselect.prototype._setSelected=function(b,g){var c=q.call(this,b,g);if(g&&this.selectedList){var f=this.element;this.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(f)})}return c}}if(a.ui.multiselect.prototype.destroy)a.ui.multiselect.prototype.destroy= +function(){this.element.show();this.container.remove();a.Widget===undefined?a.widget.prototype.destroy.apply(this,arguments):a.Widget.prototype.destroy.apply(this,arguments)};a.jgrid._multiselect=true}a.jgrid.extend({sortableColumns:function(b){return this.each(function(){function g(){c.p.disableClick=true}var c=this,f=c.p.id;f={tolerance:"pointer",axis:"x",scrollSensitivity:"1",items:">th:not(:has(#jqgh_"+f+"_cb,#jqgh_"+f+"_rn,#jqgh_"+f+"_subgrid),:hidden)",placeholder:{element:function(h){return a(document.createElement(h[0].nodeName)).addClass(h[0].className+ +" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(h,j){j.height(h.currentItem.innerHeight()-parseInt(h.currentItem.css("paddingTop")||0,10)-parseInt(h.currentItem.css("paddingBottom")||0,10));j.width(h.currentItem.innerWidth()-parseInt(h.currentItem.css("paddingLeft")||0,10)-parseInt(h.currentItem.css("paddingRight")||0,10))}},update:function(h,j){var i=a(j.item).parent();i=a(">th",i);var l={},m=c.p.id+"_";a.each(c.p.colModel,function(k){l[this.name]= +k});var d=[];i.each(function(){var k=a(">div",this).get(0).id.replace(/^jqgh_/,"").replace(m,"");k in l&&d.push(l[k])});a(c).jqGrid("remapColumns",d,true,true);a.isFunction(c.p.sortable.update)&&c.p.sortable.update(d);setTimeout(function(){c.p.disableClick=false},50)}};if(c.p.sortable.options)a.extend(f,c.p.sortable.options);else if(a.isFunction(c.p.sortable))c.p.sortable={update:c.p.sortable};if(f.start){var e=f.start;f.start=function(h,j){g();e.call(this,h,j)}}else f.start=g;if(c.p.sortable.exclude)f.items+= +":not("+c.p.sortable.exclude+")";b.sortable(f).data("sortable").floating=true})},columnChooser:function(b){function g(d,k){if(d)if(typeof d=="string")a.fn[d]&&a.fn[d].apply(k,a.makeArray(arguments).slice(2));else a.isFunction(d)&&d.apply(k,a.makeArray(arguments).slice(2))}var c=this;if(!a("#colchooser_"+c[0].p.id).length){var f=a('
'),e=a("select",f);b=a.extend({width:420, +height:240,classname:null,done:function(d){d&&c.jqGrid("remapColumns",d,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(d){var k={};k[d.bSubmit]=function(){d.apply_perm();d.cleanup(false)};k[d.bCancel]=function(){d.cleanup(true)};return{buttons:k,close:function(){d.cleanup(true)},modal:d.modal?d.modal:false,resizable:d.resizable?d.resizable:true,width:d.width+20}},apply_perm:function(){a("option",e).each(function(){this.selected?c.jqGrid("showCol",h[this.value].name):c.jqGrid("hideCol", +h[this.value].name)});var d=[];a("option[selected]",e).each(function(){d.push(parseInt(this.value,10))});a.each(d,function(){delete i[h[parseInt(this,10)].name]});a.each(i,function(){var k=parseInt(this,10);var p=d,o=k;if(o>=0){var n=p.slice(),r=n.splice(o,Math.max(p.length-o,o));if(o>p.length)o=p.length;n[o]=k;d=n.concat(r)}else d=void 0});b.done&&b.done.call(c,d)},cleanup:function(d){g(b.dlog,f,"destroy");g(b.msel,e,"destroy");f.remove();d&&b.done&&b.done.call(c)},msel_opts:{}},a.jgrid.col,b||{}); +if(a.ui)if(a.ui.multiselect)if(b.msel=="multiselect"){if(!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");return}b.msel_opts=a.extend(a.ui.multiselect.defaults,b.msel_opts)}b.caption&&f.attr("title",b.caption);if(b.classname){f.addClass(b.classname);e.addClass(b.classname)}if(b.width){a(">div",f).css({width:b.width,margin:"0 auto"});e.css("width",b.width)}if(b.height){a(">div",f).css("height",b.height);e.css("height",b.height-10)}var h= +c.jqGrid("getGridParam","colModel"),j=c.jqGrid("getGridParam","colNames"),i={},l=[];e.empty();a.each(h,function(d){i[this.name]=d;if(this.hidedlg)this.hidden||l.push(d);else e.append("")});var m=a.isFunction(b.dlog_opts)?b.dlog_opts.call(c,b):b.dlog_opts;g(b.dlog,f,m);m=a.isFunction(b.msel_opts)?b.msel_opts.call(c,b):b.msel_opts;g(b.msel,e,m)}},sortableRows:function(b){return this.each(function(){var g=this;if(g.grid)if(!g.p.treeGrid)if(a.fn.sortable){b= +a.extend({cursor:"move",axis:"y",items:".jqgrow"},b||{});if(b.start&&a.isFunction(b.start)){b._start_=b.start;delete b.start}else b._start_=false;if(b.update&&a.isFunction(b.update)){b._update_=b.update;delete b.update}else b._update_=false;b.start=function(c,f){a(f.item).css("border-width","0px");a("td",f.item).each(function(j){this.style.width=g.grid.cols[j].style.width});if(g.p.subGrid){var e=a(f.item).attr("id");try{a(g).jqGrid("collapseSubGridRow",e)}catch(h){}}b._start_&&b._start_.apply(this, +[c,f])};b.update=function(c,f){a(f.item).css("border-width","");g.p.rownumbers===true&&a("td.jqgrid-rownum",g.rows).each(function(e){a(this).html(e+1)});b._update_&&b._update_.apply(this,[c,f])};a("tbody:first",g).sortable(b);a("tbody:first",g).disableSelection()}})},gridDnD:function(b){return this.each(function(){function g(){var e=a.data(c,"dnd");a("tr.jqgrow:not(.ui-draggable)",c).draggable(a.isFunction(e.drag)?e.drag.call(a(c),e):e.drag)}var c=this;if(c.grid)if(!c.p.treeGrid)if(a.fn.draggable&& +a.fn.droppable){a("#jqgrid_dnd").html()===null&&a("body").append("
");if(typeof b=="string"&&b=="updateDnD"&&c.p.jqgdnd===true)g();else{b=a.extend({drag:function(e){return a.extend({start:function(h,j){if(c.p.subGrid){var i=a(j.helper).attr("id");try{a(c).jqGrid("collapseSubGridRow",i)}catch(l){}}for(i=0;i0&&a.data(j[0],"dnd")!==undefined){h=a.data(j[0],"dnd").connectWith;return a.inArray("#"+this.id,h)!=-1?true:false}return h},drop:function(h,j){if(a(j.draggable).hasClass("jqgrow")){var i=a(j.draggable).attr("id");i=j.draggable.parent().parent().jqGrid("getRowData",i);if(!e.dropbyname){var l=0,m={},d,k=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var p in i){if(i.hasOwnProperty(p)&&k[l]){d=k[l].name;m[d]=i[p]}l++}i=m}catch(o){}}j.helper.dropped= +true;if(e.beforedrop&&a.isFunction(e.beforedrop)){d=e.beforedrop.call(this,h,j,i,a("#"+c.id),a(this));if(typeof d!="undefined"&&d!==null&&typeof d=="object")i=d}if(j.helper.dropped){var n;if(e.autoid)if(a.isFunction(e.autoid))n=e.autoid.call(this,i);else{n=Math.ceil(Math.random()*1E3);n=e.autoidprefix+n}a("#"+this.id).jqGrid("addRowData",n,i,e.droppos)}e.ondrop&&a.isFunction(e.ondrop)&&e.ondrop.call(this,h,j,i)}}},e.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active", +hoverClass:"ui-state-hover"},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},b||{});if(b.connectWith){b.connectWith=b.connectWith.split(",");b.connectWith=a.map(b.connectWith,function(e){return a.trim(e)});a.data(c,"dnd",b);c.p.reccount!="0"&&!c.p.jqgdnd&&g();c.p.jqgdnd=true;for(var f=0;f