rails_jq_grid 0.0.3.pre2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/VERSION +1 -1
  2. data/public/javascripts/rails-jqgrid/Changes.txt +0 -0
  3. data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg.js +132 -1
  4. data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg1251.js +132 -1
  5. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cat.js +128 -1
  6. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cn.js +132 -1
  7. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cs.js +128 -1
  8. data/public/javascripts/rails-jqgrid/i18n/grid.locale-da.js +128 -0
  9. data/public/javascripts/rails-jqgrid/i18n/grid.locale-de.js +133 -1
  10. data/public/javascripts/rails-jqgrid/i18n/grid.locale-el.js +126 -1
  11. data/public/javascripts/rails-jqgrid/i18n/grid.locale-en.js +128 -1
  12. data/public/javascripts/rails-jqgrid/i18n/grid.locale-es.js +128 -1
  13. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fa.js +145 -1
  14. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fi.js +130 -1
  15. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fr.js +126 -1
  16. data/public/javascripts/rails-jqgrid/i18n/grid.locale-gl.js +126 -0
  17. data/public/javascripts/rails-jqgrid/i18n/grid.locale-he.js +127 -1
  18. data/public/javascripts/rails-jqgrid/i18n/grid.locale-hu.js +129 -1
  19. data/public/javascripts/rails-jqgrid/i18n/grid.locale-is.js +126 -1
  20. data/public/javascripts/rails-jqgrid/i18n/grid.locale-it.js +1 -1
  21. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ja.js +155 -1
  22. data/public/javascripts/rails-jqgrid/i18n/grid.locale-nl.js +149 -1
  23. data/public/javascripts/rails-jqgrid/i18n/grid.locale-no.js +1 -1
  24. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pl.js +127 -1
  25. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt-br.js +127 -1
  26. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt.js +125 -1
  27. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ro.js +139 -1
  28. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ru.js +127 -1
  29. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sk.js +127 -1
  30. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sr.js +128 -0
  31. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sv.js +127 -1
  32. data/public/javascripts/rails-jqgrid/i18n/grid.locale-tr.js +126 -1
  33. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ua.js +127 -1
  34. data/public/javascripts/rails-jqgrid/install.txt +0 -0
  35. data/public/javascripts/rails-jqgrid/jquery.jqGrid.min.js +445 -432
  36. data/public/javascripts/rails-jqgrid/src/JsonXml.js +329 -329
  37. data/public/javascripts/rails-jqgrid/src/css/ellipsis-xbl.xml +0 -0
  38. data/public/javascripts/rails-jqgrid/src/css/ui.jqgrid.css +139 -129
  39. data/public/javascripts/rails-jqgrid/src/css/ui.multiselect.css +0 -0
  40. data/public/javascripts/rails-jqgrid/src/grid.base.js +3078 -3003
  41. data/public/javascripts/rails-jqgrid/src/grid.celledit.js +486 -486
  42. data/public/javascripts/rails-jqgrid/src/grid.common.js +646 -636
  43. data/public/javascripts/rails-jqgrid/src/grid.custom.js +820 -817
  44. data/public/javascripts/rails-jqgrid/src/grid.formedit.js +1954 -1872
  45. data/public/javascripts/rails-jqgrid/src/grid.grouping.js +250 -0
  46. data/public/javascripts/rails-jqgrid/src/grid.import.js +200 -200
  47. data/public/javascripts/rails-jqgrid/src/grid.inlinedit.js +255 -250
  48. data/public/javascripts/rails-jqgrid/src/grid.jqueryui.js +504 -503
  49. data/public/javascripts/rails-jqgrid/src/grid.loader.js +1 -0
  50. data/public/javascripts/rails-jqgrid/src/grid.postext.js +63 -63
  51. data/public/javascripts/rails-jqgrid/src/grid.setcolumns.js +125 -125
  52. data/public/javascripts/rails-jqgrid/src/grid.subgrid.js +260 -260
  53. data/public/javascripts/rails-jqgrid/src/grid.tbltogrid.js +106 -106
  54. data/public/javascripts/rails-jqgrid/src/grid.treegrid.js +489 -482
  55. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg.js +132 -132
  56. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg1251.js +132 -132
  57. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cat.js +128 -128
  58. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cn.js +132 -132
  59. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cs.js +128 -128
  60. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-da.js +128 -0
  61. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-de.js +132 -127
  62. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-dk.js +0 -0
  63. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-el.js +126 -126
  64. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-en.js +128 -128
  65. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-es.js +128 -128
  66. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fa.js +145 -125
  67. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fi.js +130 -130
  68. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fr.js +2 -2
  69. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-gl.js +126 -0
  70. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-he.js +127 -127
  71. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-hu.js +129 -129
  72. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-is.js +126 -126
  73. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-it.js +0 -0
  74. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ja.js +155 -155
  75. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-nl.js +148 -148
  76. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-no.js +0 -0
  77. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pl.js +126 -126
  78. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt-br.js +127 -127
  79. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt.js +125 -125
  80. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ro.js +139 -139
  81. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ru.js +127 -127
  82. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sk.js +127 -127
  83. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sr.js +128 -0
  84. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sv.js +127 -127
  85. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-tr.js +126 -126
  86. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ua.js +127 -127
  87. data/public/javascripts/rails-jqgrid/src/jqDnR.js +68 -67
  88. data/public/javascripts/rails-jqgrid/src/jqModal.js +68 -68
  89. data/public/javascripts/rails-jqgrid/src/jquery.fmatter.js +563 -541
  90. data/public/javascripts/rails-jqgrid/src/jquery.searchFilter.js +1 -1
  91. data/public/javascripts/rails-jqgrid/src/ui.multiselect.js +0 -0
  92. data/public/stylesheets/rails-jqgrid/ellipsis-xbl.xml +0 -0
  93. data/public/stylesheets/rails-jqgrid/ui.jqgrid.css +139 -2
  94. data/rails_jq_grid.gemspec +10 -3
  95. metadata +15 -11
@@ -1 +1,127 @@
1
- (function(a){a.jgrid={defaults:{recordtext:"Перегляд {0} - {1} з {2}",emptyrecords:"Немає записів для перегляду",loadtext:"Завантаження...",pgtext:"Стор. {0} з {1}"},search:{caption:"Пошук...",Find:"Знайти",Reset:"Скидання",odata:["рівно","не рівно","менше","менше або рівне","більше","більше або рівне","починається з","не починається з","знаходиться в","не знаходиться в","закінчується на","не закінчується на","містить","не містить"],groupOps:[{op:"AND",text:"все"},{op:"OR",text:"будь-який"}],matchText:" збігається",rulesText:" правила"},edit:{addCaption:"Додати запис",editCaption:"Змінити запис",bSubmit:"Зберегти",bCancel:"Відміна",bClose:"Закрити",saveData:"До данних були внесені зміни! Зберегти зміни?",bYes:"Так",bNo:"Ні",bExit:"Відміна",msg:{required:"Поле є обов'язковим",number:"Будь ласка, введіть правильне число",minValue:"значення повинне бути більше або дорівнює",maxValue:"значення повинно бути менше або дорівнює",email:"некоректна адреса електронної пошти",integer:"Будь ласка, введення дійсне ціле значення",date:"Будь ласка, введення дійсне значення дати",url:"не дійсний URL. Необхідна приставка ('http://' or 'https://')",nodefined:" is not defined!",novalue:" return value is required!",customarray:"Custom function should return array!",customfcheck:"Custom function should be present in case of custom checking!"}},view:{caption:"Переглянути запис",bClose:"Закрити"},del:{caption:"Видалити",msg:"Видалити обраний запис(и)?",bSubmit:"Видалити",bCancel:"Відміна"},nav:{edittext:" ",edittitle:"Змінити вибраний запис",addtext:" ",addtitle:"Додати новий запис",deltext:" ",deltitle:"Видалити вибраний запис",searchtext:" ",searchtitle:"Знайти записи",refreshtext:"",refreshtitle:"Оновити таблицю",alertcap:"Попередження",alerttext:"Будь ласка, виберіть запис",viewtext:"",viewtitle:"Переглянути обраний запис"},col:{caption:"Показати/Приховати стовпці",bSubmit:"Зберегти",bCancel:"Відміна"},errors:{errcap:"Помилка",nourl:"URL не задан",norecords:"Немає записів для обробки",model:"Число полів не відповідає числу стовпців таблиці!"},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:["Нд","Пн","Вт","Ср","Чт","Пт","Сб","Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"],monthNames:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру","Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],AmPm:["am","pm","AM","PM"],S:function(b){return b<11||b>13?["st","nd","rd","th"][Math.min((b-1)%10,3)]:"th"},srcformat:"Y-m-d",newformat:"d.m.Y",masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"n.j.Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y G:i:s",MonthDay:"F d",ShortTime:"G:i",LongTime:"G:i:s",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:true},idName:"id"}}})(jQuery);
1
+ ;(function($){
2
+ /**
3
+ * jqGrid Ukrainian Translation v1.0 02.07.2009
4
+ * Sergey Dyagovchenko
5
+ * http://d.sumy.ua
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ **/
10
+ $.jgrid = {
11
+ defaults : {
12
+ recordtext: "Перегляд {0} - {1} з {2}",
13
+ emptyrecords: "Немає записів для перегляду",
14
+ loadtext: "Завантаження...",
15
+ pgtext : "Стор. {0} з {1}"
16
+ },
17
+ search : {
18
+ caption: "Пошук...",
19
+ Find: "Знайти",
20
+ Reset: "Скидання",
21
+ odata : ['рівно', 'не рівно', 'менше', 'менше або рівне','більше','більше або рівне', 'починається з','не починається з','знаходиться в','не знаходиться в','закінчується на','не закінчується на','містить','не містить'],
22
+ groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "будь-який" } ],
23
+ matchText: " збігається",
24
+ rulesText: " правила"
25
+ },
26
+ edit : {
27
+ addCaption: "Додати запис",
28
+ editCaption: "Змінити запис",
29
+ bSubmit: "Зберегти",
30
+ bCancel: "Відміна",
31
+ bClose: "Закрити",
32
+ saveData: "До данних були внесені зміни! Зберегти зміни?",
33
+ bYes : "Так",
34
+ bNo : "Ні",
35
+ bExit : "Відміна",
36
+ msg: {
37
+ required:"Поле є обов'язковим",
38
+ number:"Будь ласка, введіть правильне число",
39
+ minValue:"значення повинне бути більше або дорівнює",
40
+ maxValue:"значення повинно бути менше або дорівнює",
41
+ email: "некоректна адреса електронної пошти",
42
+ integer: "Будь ласка, введення дійсне ціле значення",
43
+ date: "Будь ласка, введення дійсне значення дати",
44
+ url: "не дійсний URL. Необхідна приставка ('http://' or 'https://')",
45
+ nodefined : " is not defined!",
46
+ novalue : " return value is required!",
47
+ customarray : "Custom function should return array!",
48
+ customfcheck : "Custom function should be present in case of custom checking!"
49
+ }
50
+ },
51
+ view : {
52
+ caption: "Переглянути запис",
53
+ bClose: "Закрити"
54
+ },
55
+ del : {
56
+ caption: "Видалити",
57
+ msg: "Видалити обраний запис(и)?",
58
+ bSubmit: "Видалити",
59
+ bCancel: "Відміна"
60
+ },
61
+ nav : {
62
+ edittext: " ",
63
+ edittitle: "Змінити вибраний запис",
64
+ addtext:" ",
65
+ addtitle: "Додати новий запис",
66
+ deltext: " ",
67
+ deltitle: "Видалити вибраний запис",
68
+ searchtext: " ",
69
+ searchtitle: "Знайти записи",
70
+ refreshtext: "",
71
+ refreshtitle: "Оновити таблицю",
72
+ alertcap: "Попередження",
73
+ alerttext: "Будь ласка, виберіть запис",
74
+ viewtext: "",
75
+ viewtitle: "Переглянути обраний запис"
76
+ },
77
+ col : {
78
+ caption: "Показати/Приховати стовпці",
79
+ bSubmit: "Зберегти",
80
+ bCancel: "Відміна"
81
+ },
82
+ errors : {
83
+ errcap : "Помилка",
84
+ nourl : "URL не задан",
85
+ norecords: "Немає записів для обробки",
86
+ model : "Число полів не відповідає числу стовпців таблиці!"
87
+ },
88
+ formatter : {
89
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
90
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
91
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
92
+ date : {
93
+ dayNames: [
94
+ "Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб",
95
+ "Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"
96
+ ],
97
+ monthNames: [
98
+ "Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру",
99
+ "Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"
100
+ ],
101
+ AmPm : ["am","pm","AM","PM"],
102
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
103
+ srcformat: 'Y-m-d',
104
+ newformat: 'd.m.Y',
105
+ masks : {
106
+ ISO8601Long:"Y-m-d H:i:s",
107
+ ISO8601Short:"Y-m-d",
108
+ ShortDate: "n.j.Y",
109
+ LongDate: "l, F d, Y",
110
+ FullDateTime: "l, F d, Y G:i:s",
111
+ MonthDay: "F d",
112
+ ShortTime: "G:i",
113
+ LongTime: "G:i:s",
114
+ SortableDateTime: "Y-m-d\\TH:i:s",
115
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
116
+ YearMonth: "F, Y"
117
+ },
118
+ reformatAfterEdit : false
119
+ },
120
+ baseLinkUrl: '',
121
+ showAction: '',
122
+ target: '',
123
+ checkbox : {disabled:true},
124
+ idName : 'id'
125
+ }
126
+ };
127
+ })(jQuery);
File without changes
@@ -1,445 +1,458 @@
1
1
  /*
2
- * jqGrid 3.7.2 - jQuery Grid
2
+ * jqGrid 3.8.2 - jQuery Grid
3
3
  * Copyright (c) 2008, Tony Tomov, tony@trirand.com
4
4
  * Dual licensed under the MIT and GPL licenses
5
5
  * http://www.opensource.org/licenses/mit-license.php
6
6
  * http://www.gnu.org/licenses/gpl-2.0.html
7
- * Date:2010-07-12
8
- * Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; jquery.searchFilter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.treegrid.js; grid.import.js; JsonXml.js; grid.setcolumns.js; grid.postext.js; grid.tbltogrid.js; grid.jqueryui.js;
7
+ * Date:2010-12-14
8
+ * Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; jquery.searchFilter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.import.js; JsonXml.js; grid.setcolumns.js; grid.postext.js; grid.tbltogrid.js; grid.jqueryui.js;
9
9
  */
10
- (function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{htmlDecode:function(e){if(e=="&nbsp;"||e=="&#160;"||e.length==1&&e.charCodeAt(0)==160)return"";return!e?e:String(e).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(e){return!e?e:String(e).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(e){var j=b.makeArray(arguments).slice(1);if(e===undefined)e="";return e.replace(/\{(\d+)\}/g,function(i,
11
- c){return j[c]})},getCellIndex:function(e){e=b(e);if(e.is("tr"))return-1;e=(!e.is("td")&&!e.is("th")?e.closest("td,th"):e)[0];if(b.browser.msie)return b.inArray(e,e.parentNode.cells);return e.cellIndex},stripHtml:function(e){e+="";var j=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(e)return(e=e.replace(j,""))&&e!=="&nbsp;"&&e!=="&#160;"?e.replace(/\"/g,"'"):"";else return e},stringToDoc:function(e){var j;if(typeof e!=="string")return e;try{j=(new DOMParser).parseFromString(e,"text/xml")}catch(i){j=new ActiveXObject("Microsoft.XMLDOM");
12
- j.async=false;j.loadXML(e)}return j&&j.documentElement&&j.documentElement.tagName!="parsererror"?j:null},parse:function(e){e=e;if(e.substr(0,9)=="while(1);")e=e.substr(9);if(e.substr(0,2)=="/*")e=e.substr(2,e.length-4);e||(e="{}");return b.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(e):eval("("+e+")")},parseDate:function(e,j){var i={m:1,d:1,y:1970,h:0,i:0,s:0},c,f,k;if(j&&j!==null&&j!==undefined){j=b.trim(j);j=j.split(/[\\\/:_;.\t\T\s-]/);e=e.split(/[\\\/:_;.\t\T\s-]/);
13
- var n=b.jgrid.formatter.date.monthNames,a=b.jgrid.formatter.date.AmPm,r=function(v,y){if(v===0){if(y==12)y=0}else if(y!=12)y+=12;return y};c=0;for(f=e.length;c<f;c++){if(e[c]=="M"){k=b.inArray(j[c],n);if(k!==-1&&k<12)j[c]=k+1}if(e[c]=="F"){k=b.inArray(j[c],n);if(k!==-1&&k>11)j[c]=k+1-12}if(e[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(e[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[e[c].toLowerCase()]=
14
- parseInt(j[c],10)}i.m=parseInt(i.m,10)-1;e=i.y;if(e>=70&&e<=99)i.y=1900+i.y;else if(e>=0&&e<=69)i.y=2E3+i.y}return new Date(i.y,i.m,i.d,i.h,i.i,i.s,0)},jqID:function(e){e+="";return e.replace(/([\.\:\[\]])/g,"\\$1")},getAccessor:function(e,j){var i,c,f,k;if(typeof j==="function")return j(e);i=e[j];if(i===undefined)try{if(typeof j==="string")f=j.split(".");if(k=f.length)for(i=e;i&&k--;){c=f.shift();i=i[c]}}catch(n){}return i},ajaxOptions:{},from:function(e){return new (function(j,i){if(typeof j=="string")j=
15
- b.data(j);var c=this,f=j,k=true,n=false,a=i,r=/[\$,%]/g,v=null,y=null,E=false,O="",H=[],L=true;if(typeof j=="object"&&j.push){if(j.length>0)L=typeof j[0]!="object"?false:true}else throw"data provides is not an array";this._hasData=function(){return f===null?false:f.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()":
16
- ""};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(f,function(o,A){m.push(l(A))});return m};this._append=function(l){if(a===null)a="";else a+=O==""?" && ":O;if(E)a+="!";a+="("+l+")";E=false;O=""};this._setCommand=function(l,m){v=l;y=m};this._resetNegate=function(){E=false};this._repeatCommand=function(l,m){if(v===
17
- null)return c;if(l!=null&&m!=null)return v(l,m);if(y===null)return v(l);if(!L)return v(l);return v(y,l)};this._equals=function(l,m){return c._compare(l,m,1)===0};this._compare=function(l,m,o){if(o===undefined)o=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){l=l.toLowerCase();m=m.toLowerCase()}if(l<m)return-o;if(l>m)return o;return 0};this._performSort=function(){if(H.length!==0)f=c._doSort(f,0)};
18
- this._doSort=function(l,m){var o=H[m].by,A=H[m].dir,t=H[m].type,G=H[m].datefmt;if(m==H.length-1)return c._getOrder(l,o,A,t,G);m++;l=c._getGroup(l,o,A,t,G);o=[];for(A=0;A<l.length;A++){t=c._doSort(l[A].items,m);for(G=0;G<t.length;G++)o.push(t[G])}return o};this._getOrder=function(l,m,o,A,t){var G=[],S=[],ba=o=="a"?1:-1,Q,fa;if(A===undefined)A="text";fa=A=="float"||A=="number"||A=="currency"||A=="numeric"?function(J){J=parseFloat(String(J).replace(r,""));return isNaN(J)?0:J}:A=="int"||A=="integer"?
19
- function(J){return J?parseFloat(String(J).replace(r,"")):0}:A=="date"||A=="datetime"?function(J){return b.jgrid.parseDate(t,J).getTime()}:function(J){J||(J="");return b.trim(J.toUpperCase())};b.each(l,function(J,Z){Q=b.jgrid.getAccessor(Z,m);if(Q===undefined)Q="";Q=fa(Q);S.push({vSort:Q,index:J})});S.sort(function(J,Z){J=J.vSort;Z=Z.vSort;return c._compare(J,Z,ba)});A=0;for(var ka=l.length;A<ka;){o=S[A].index;G.push(l[o]);A++}return G};this._getGroup=function(l,m,o,A,t){var G=[],S=null,ba=null,Q;
20
- b.each(c._getOrder(l,m,o,A,t),function(fa,ka){Q=b.jgrid.getAccessor(ka,m);if(Q===undefined)Q="";if(!c._equals(ba,Q)){ba=Q;S!=null&&G.push(S);S=c._group(m,Q)}S.items.push(ka)});S!=null&&G.push(S);return G};this.ignoreCase=function(){k=false;return c};this.useCase=function(){k=true;return c};this.trim=function(){n=true;return c};this.noTrim=function(){n=false;return c};this.combine=function(l){var m=b.from(f);k||m.ignoreCase();n&&m.trim();result=l(m).showQuery();c._append(result);return c};this.execute=
21
- function(){var l=a,m=[];if(l===null)return c;b.each(f,function(){eval(l)&&m.push(this)});f=m;return c};this.data=function(){return f};this.select=function(l){c._performSort();if(!c._hasData())return[];c.execute();if(b.isFunction(l)){var m=[];b.each(f,function(o,A){m.push(l(A))});return m}return f};this.hasMatch=function(){if(!c._hasData())return false;c.execute();return f.length>0};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=
22
- function(l,m,o){E=!E;return c.and(l,m,o)};this.orNot=function(l,m,o){E=!E;return c.or(l,m,o)};this.not=function(l,m,o){return c.andNot(l,m,o)};this.and=function(l,m,o){O=" && ";if(l===undefined)return c;return c._repeatCommand(l,m,o)};this.or=function(l,m,o){O=" || ";if(l===undefined)return c;return c._repeatCommand(l,m,o)};this.isNot=function(l){E=!E;return c.is(l)};this.is=function(l){c._append("this."+l);c._resetNegate();return c};this._compareValues=function(l,m,o,A,t){var G;G=L?"this."+m:"this";
23
- if(o===undefined)o=null;o=o===null?m:o;switch(t.stype===undefined?"text":t.stype){case "int":case "integer":o=isNaN(Number(o))?"0":o;G="parseInt("+G+",10)";o="parseInt("+o+",10)";break;case "float":case "number":case "numeric":o=String(o).replace(r,"");o=isNaN(Number(o))?"0":o;G="parseFloat("+G+")";o="parseFloat("+o+")";break;case "date":case "datetime":o=String(b.jgrid.parseDate(t.newfmt||"Y-m-d",o).getTime());G='jQuery.jgrid.parseDate("'+t.srcfmt+'",'+G+").getTime()";break;default:G=c._getStr(G);
24
- o=c._getStr('"'+c._toStr(o)+'"')}c._append(G+" "+A+" "+o);c._setCommand(l,m);c._resetNegate();return c};this.equals=function(l,m,o){return c._compareValues(c.equals,l,m,"==",o)};this.greater=function(l,m,o){return c._compareValues(c.greater,l,m,">",o)};this.less=function(l,m,o){return c._compareValues(c.less,l,m,"<",o)};this.greaterOrEquals=function(l,m,o){return c._compareValues(c.greaterOrEquals,l,m,">=",o)};this.lessOrEquals=function(l,m,o){return c._compareValues(c.lessOrEquals,l,m,"<=",o)};this.startsWith=
25
- function(l,m){var o=m===undefined||m===null?l:m;o=n?b.trim(o.toString()).length:o.toString().length;if(L)c._append(c._getStr("this."+l)+".substr(0,"+o+") == "+c._getStr('"'+c._toStr(m)+'"'));else{o=n?b.trim(m.toString()).length:m.toString().length;c._append(c._getStr("this")+".substr(0,"+o+") == "+c._getStr('"'+c._toStr(l)+'"'))}c._setCommand(c.startsWith,l);c._resetNegate();return c};this.endsWith=function(l,m){var o=m===undefined||m===null?l:m;o=n?b.trim(o.toString()).length:o.toString().length;
26
- L?c._append(c._getStr("this."+l)+".substr("+c._getStr("this."+l)+".length-"+o+","+o+') == "'+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){L?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();
27
- return c};this.where=function(l){if(b.isFunction(l)){c.execute();var m=[];b.each(f,function(o,A){l(A)&&m.push(A)});return b.from(m,c.showQuery())}c._append(l);c._setCommand(this.where,null);c._resetNegate();return c};this.groupBy=function(l,m,o,A){if(!c._hasData())return null;return c._getGroup(f,l,m,o,A)};this.distinct=function(l,m){l=c.groupBy(l,m);var o=[];b.each(l,function(A,t){o.push(t.unique)});return o};this.orderBy=function(l,m,o,A){m=m===undefined||m===null?"a":b.trim(m.toString().toLowerCase());
28
- if(o===null||o===undefined)o="text";if(A===null||A===undefined)A="Y-m-d";if(m=="desc"||m=="descending")m="d";if(m=="asc"||m=="ascending")m="a";H.push({by:l,dir:m,type:o,datefmt:A});return c};return c})(e,null)},extend:function(e){b.extend(b.fn.jqGrid,e);this.no_legacy_api||b.fn.extend(e)}});b.fn.jqGrid=function(e){if(typeof e=="string"){var j=b.fn.jqGrid[e];if(!j)throw"jqGrid - No such method: "+e;var i=b.makeArray(arguments).slice(1);return j.apply(this,i)}return this.each(function(){if(!this.grid){var c=
29
- 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,
30
- 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",
31
- 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,
32
- "vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false,headertitles:false,scrollTimeout:200,data:[],_index:{}},b.jgrid.defaults,e||{}),f={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,
33
- 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,q;if(h>33){this.curGbox.css({left:this.resizing.sOL+g});if(c.forceFit===true){q=this.headers[this.resizing.idx+c.nv];g=c.direction==="ltr"?q.width-g:q.width+g;if(g>33){d.newWidth=h;q.newWidth=g}}else{this.newWidth=c.direction==="ltr"?c.tblwidth+g:c.tblwidth-g;d.newWidth=h}}}},dragEnd:function(){this.hDiv.style.cursor=
34
- "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";if(this.cols.length>0)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+
35
- c.nv].el.style.width=g+"px";if(this.cols.length>0)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)&&
36
- c.resizeStop.call(this,g,d)}this.curGbox=null;document.onselectstart=function(){return true}},populateVisible:function(){f.timer&&clearTimeout(f.timer);f.timer=null;var d=b(f.bDiv).height();if(d){var g=b("table:first",f.bDiv),h=b("> tbody > tr:visible:first",g).outerHeight()||f.prevRowHeight;if(h){f.prevRowHeight=h;var q=c.rowNum,p=f.scrollTop=f.bDiv.scrollTop,w=Math.round(g.position().top)-p,s=w+g.height();h=h*q;var C,z,x;if(s<d&&w<=0&&(c.lastpage===undefined||parseInt((s+p+h-1)/h,10)<=c.lastpage)){z=
37
- parseInt((d-s+h-1)/h,10);if(s>=0||z<2||c.scroll===true){C=Math.round((s+p)/h)+1;w=-1}else w=1}if(w>0){C=parseInt(p/h,10)+1;z=parseInt((p+d)/h,10)+2-C;x=true}if(z)if(!(c.lastpage&&C>c.lastpage||c.lastpage==1))if(f.hDiv.loading)f.timer=setTimeout(f.populateVisible,c.scrollTimeout);else{c.page=C;if(x){f.selectionPreserver(g[0]);f.emptyRows(f.bDiv,false)}f.populate(z)}}}},scrollGrid:function(){if(c.scroll){var d=f.bDiv.scrollTop;if(f.scrollTop===undefined)f.scrollTop=0;if(d!=f.scrollTop){f.scrollTop=
38
- d;f.timer&&clearTimeout(f.timer);f.timer=setTimeout(f.populateVisible,c.scrollTimeout)}}f.hDiv.scrollLeft=f.bDiv.scrollLeft;if(c.footerrow)f.sDiv.scrollLeft=f.bDiv.scrollLeft},selectionPreserver:function(d){var g=d.p,h=g.selrow,q=g.selarrrow?b.makeArray(g.selarrrow):null,p=d.grid.bDiv.scrollLeft,w=g.gridComplete;g.gridComplete=function(){g.selrow=null;g.selarrrow=[];if(g.multiselect&&q&&q.length>0)for(var s=0;s<q.length;s++)q[s]!=h&&b(d).jqGrid("setSelection",q[s],false);h&&b(d).jqGrid("setSelection",
39
- h,false);d.grid.bDiv.scrollLeft=p;g.gridComplete=w;g.gridComplete&&w()}}};this.p=c;var k,n,a;if(this.p.colNames.length===0)for(k=0;k<this.p.colModel.length;k++)this.p.colNames[k]=this.p.colModel[k].label||this.p.colModel[k].name;if(this.p.colNames.length!==this.p.colModel.length)alert(b.jgrid.errors.model);else{var r=b("<div class='ui-jqgrid-view'></div>"),v,y=b.browser.msie?true:false,E=b.browser.safari?true:false;a=this;a.p.direction=b.trim(a.p.direction.toLowerCase());if(b.inArray(a.p.direction,
40
- ["ltr","rtl"])==-1)a.p.direction="ltr";n=a.p.direction;b(r).insertBefore(this);b(this).appendTo(r).removeClass("scroll");var O=b("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");b(O).insertBefore(r).attr({id:"gbox_"+this.id,dir:n});b(r).appendTo(O).attr("id","gview_"+this.id);v=y&&b.browser.version<=6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"";b("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+
41
- this.id+"'></div>").append(v).insertBefore(r);b("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(r);b(this).attr({cellSpacing:"0",cellPadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var H=function(d,g){d=parseInt(d,10);return isNaN(d)?g?g:0:d},L=function(d,g,h){var q=a.p.colModel[d],p=q.align,w='style="',s=q.classes,C=q.name;if(p)w+="text-align:"+p+";";if(q.hidden===
42
- true)w+="display:none;";if(g===0)w+="width: "+f.headers[d].width+"px;";w+='"'+(s!==undefined?' class="'+s+'"':"")+(q.title&&h?' title="'+b.jgrid.stripHtml(h)+'"':"");w+=' aria-describedby="'+a.p.id+"_"+C+'"';return w},l=function(d){return d===undefined||d===null||d===""?"&#160;":a.p.autoencode?b.jgrid.htmlEncode(d):d+""},m=function(d,g,h,q,p){h=a.p.colModel[h];if(typeof h.formatter!=="undefined"){d={rowId:d,colModel:h,gid:a.p.id};g=b.isFunction(h.formatter)?h.formatter.call(a,g,d,q,p):b.fmatter?b.fn.fmatter(h.formatter,
43
- g,d,q,p):l(g)}else g=l(g);return g},o=function(d,g,h,q,p){d=m(d,g,h,p,"add");return'<td role="gridcell" '+L(h,q,d)+">"+d+"</td>"},A=function(d,g,h){d='<input role="checkbox" type="checkbox" id="jqg_'+d+'" class="cbox" name="jqg_'+d+'"/>';g=L(g,h,"");return'<td role="gridcell" aria-describedby="'+a.p.id+'_cb" '+g+">"+d+"</td>"},t=function(d,g,h,q){h=(parseInt(h,10)-1)*parseInt(q,10)+1+g;d=L(d,g,"");return'<td role="gridcell" aria-describedby="'+a.p.id+'_rn" class="ui-state-default jqgrid-rownum" '+
44
- d+">"+h+"</td>"},G=function(d){var g,h=[],q=0,p;for(p=0;p<a.p.colModel.length;p++){g=a.p.colModel[p];if(g.name!=="cb"&&g.name!=="subgrid"&&g.name!=="rn"){h[q]=d=="xml"?g.xmlmap||g.name:g.jsonmap||g.name;q++}}return h},S=function(d){var g=a.p.remapColumns;if(!g||!g.length)g=b.map(a.p.colModel,function(h,q){return q});if(d)g=b.map(g,function(h){return h<d?null:h-d});return g},ba=function(d,g){a.p.deepempty?b("tbody:first tr",d).remove():b("tbody:first",d).empty();if(g&&a.p.scroll){b(">div:first",d).css({height:"auto"}).children("div:first").css({height:0,
45
- display:"none"});d.scrollTop=0}},Q=function(d,g,h,q,p){var w=new Date,s=a.p.datatype!="local"&&a.p.loadonce||a.p.datatype=="xmlstring",C;if(s){a.p.data=[];a.p._index={};a.p.localReader.id=C="_id_"}a.p.reccount=0;if(b.isXMLDoc(d)){if(a.p.treeANode===-1&&!a.p.scroll){ba(g,false);h=0}else h=h>0?h:0;var z,x=0,u,D,F=0,B=0,I=0,M,X,T=[],ca,U={},Y=a.rows.length,P,R,$=[],K=0,wa=a.p.altRows===true?" "+a.p.altclass:"";a.p.xmlReader.repeatitems||(T=G("xml"));M=a.p.keyIndex===false?a.p.xmlReader.id:a.p.keyIndex;
46
- if(T.length>0&&!isNaN(M)){if(a.p.remapColumns&&a.p.remapColumns.length)M=b.inArray(M,a.p.remapColumns);M=T[M]}X=(M+"").indexOf("[")===-1?T.length?function(ga,da){return b(M,ga).text()||da}:function(ga,da){return b(a.p.xmlReader.cell,ga).eq(M).text()||da}:function(ga,da){return ga.getAttribute(M.replace(/[\[\]]/g,""))||da};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;
47
- 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);var ea=d.length,aa=0;if(d&&ea){var ma=parseInt(a.p.rowNum,10),Aa=a.p.scroll?(parseInt(a.p.page,10)-1)*ma+1:1;if(p)ma*=p+1;for(p=b.isFunction(a.p.afterInsertRow);aa<ea;){P=d[aa];R=X(P,Aa+aa);z=h===0?0:h+1;z=
48
- (z+aa)%2==1?wa:"";$[K++]='<tr id="'+R+'" role="row" class ="ui-widget-content jqgrow ui-row-'+a.p.direction+""+z+'">';if(a.p.rownumbers===true){$[K++]=t(0,aa,a.p.page,a.p.rowNum);I=1}if(a.p.multiselect===true){$[K++]=A(R,I,aa);F=1}if(a.p.subGrid===true){$[K++]=b(a).jqGrid("addSubGridCell",F+I,aa+h);B=1}if(a.p.xmlReader.repeatitems){ca||(ca=S(F+B+I));var qa=b(a.p.xmlReader.cell,P);b.each(ca,function(ga){var da=qa[this];if(!da)return false;u=da.textContent||da.text;U[a.p.colModel[ga+F+B+I].name]=u;
49
- $[K++]=o(R,u,ga+F+B+I,aa+h,P)})}else for(z=0;z<T.length;z++){u=b(T[z],P).text();U[a.p.colModel[z+F+B+I].name]=u;$[K++]=o(R,u,z+F+B+I,aa+h,P)}$[K++]="</tr>";if(s){U[C]=R;a.p.data.push(U)}if(a.p.gridview===false){if(a.p.treeGrid===true){z=a.p.treeANode>=-1?a.p.treeANode:0;D=b($.join(""))[0];Y===0?b("tbody:first",g).append(D):b(a.rows[aa+z+h]).after(D);try{b(a).jqGrid("setTreeNode",U,D)}catch(Ga){}}else b("tbody:first",g).append($.join(""));if(a.p.subGrid===true)try{b(a).jqGrid("addSubGrid",a.rows[a.rows.length-
50
- 1],F+I)}catch(Ha){}p&&a.p.afterInsertRow.call(a,R,U,P);$=[];K=0}U={};x++;aa++;if(x==ma)break}}a.p.gridview===true&&b("tbody:first",g).append($.join(""));a.p.totaltime=new Date-w;if(x>0){a.grid.cols=a.rows[0].cells;if(a.p.records===0)a.p.records=ea}$=null;if(!a.p.treeGrid&&!a.p.scroll)a.grid.bDiv.scrollTop=0;a.p.reccount=x;a.p.treeANode=-1;a.p.userDataOnFooter&&b(a).jqGrid("footerData","set",a.p.userData,true);if(s){a.p.records=ea;a.p.lastpage=Math.ceil(ea/ma)}q||J(false,true);if(s){for(;x<ea;){P=
51
- d[x];R=X(P,x);if(a.p.xmlReader.repeatitems){ca||(ca=S(F+B+I));qa=b(a.p.xmlReader.cell,P);b.each(ca,function(ga){var da=qa[this];if(!da)return false;u=da.textContent||da.text;U[a.p.colModel[ga+F+B+I].name]=u})}else for(z=0;z<T.length;z++){u=b(T[z],P).text();U[a.p.colModel[z+F+B+I].name]=u}U[C]=R;a.p.data.push(U);U={};x++}ra()}}},fa=function(d,g,h,q,p){var w=new Date;if(d){if(a.p.treeANode===-1&&!a.p.scroll){ba(g,false);h=0}else h=h>0?h:0;var s=a.p.datatype=="local"?a.p.localReader:a.p.jsonReader,C,
52
- z=a.p.datatype!="local"&&a.p.loadonce||a.p.datatype=="jsonstring";if(z){a.p.data=[];a.p._index={};C=a.p.localReader.id="_id_"}var x=a.p.reccount=0,u,D,F,B=[],I,M=0,X=0,T=0,ca,U,Y,P={},R,$=a.rows.length,K;F=[];R=0;var wa=a.p.altRows===true?" "+a.p.altclass:"";a.p.page=b.jgrid.getAccessor(d,s.page)||0;Y=b.jgrid.getAccessor(d,s.total);a.p.lastpage=Y===undefined?1:Y;a.p.records=b.jgrid.getAccessor(d,s.records)||0;a.p.userData=b.jgrid.getAccessor(d,s.userdata)||{};s.repeatitems||(I=B=G("json"));Y=a.p.keyIndex===
53
- false?s.id:a.p.keyIndex;if(B.length>0&&!isNaN(Y)){if(a.p.remapColumns&&a.p.remapColumns.length)Y=b.inArray(Y,a.p.remapColumns);Y=B[Y]}if(U=b.jgrid.getAccessor(d,s.root)){ca=U.length;d=0;var ea=parseInt(a.p.rowNum,10),aa=a.p.scroll?(parseInt(a.p.page,10)-1)*ea+1:1;if(p)ea*=p+1;for(var ma=b.isFunction(a.p.afterInsertRow);d<ca;){p=U[d];K=b.jgrid.getAccessor(p,Y);if(K===undefined){K=aa+d;if(B.length===0)if(s.cell){u=p[s.cell];K=u[Y]||K}}u=h===0?0:h+1;u=(u+d)%2==1?wa:"";F[R++]='<tr id="'+K+'" role="row" class= "ui-widget-content jqgrow ui-row-'+
54
- a.p.direction+""+u+'">';if(a.p.rownumbers===true){F[R++]=t(0,d,a.p.page,a.p.rowNum);T=1}if(a.p.multiselect){F[R++]=A(K,T,d);M=1}if(a.p.subGrid){F[R++]=b(a).jqGrid("addSubGridCell",M+T,d+h);X=1}if(s.repeatitems){if(s.cell)p=b.jgrid.getAccessor(p,s.cell);I||(I=S(M+X+T))}for(D=0;D<I.length;D++){u=b.jgrid.getAccessor(p,I[D]);F[R++]=o(K,u,D+M+X+T,d+h,p);P[a.p.colModel[D+M+X+T].name]=u}F[R++]="</tr>";if(z){P[C]=K;a.p.data.push(P)}if(a.p.gridview===false){if(a.p.treeGrid===true){R=a.p.treeANode>=-1?a.p.treeANode:
55
- 0;F=b(F.join(""))[0];$===0?b("tbody:first",g).append(F):b(a.rows[d+R+h]).after(F);try{b(a).jqGrid("setTreeNode",P,F)}catch(Aa){}}else b("tbody:first",g).append(F.join(""));if(a.p.subGrid===true)try{b(a).jqGrid("addSubGrid",a.rows[a.rows.length-1],M+T)}catch(qa){}ma&&a.p.afterInsertRow.call(a,K,P,p);F=[];R=0}P={};x++;d++;if(x==ea)break}a.p.gridview===true&&b("tbody:first",g).append(F.join(""));a.p.totaltime=new Date-w;if(x>0){a.grid.cols=a.rows[0].cells;if(a.p.records===0)a.p.records=ca}}if(!a.p.treeGrid&&
56
- !a.p.scroll)a.grid.bDiv.scrollTop=0;a.p.reccount=x;a.p.treeANode=-1;a.p.userDataOnFooter&&b(a).jqGrid("footerData","set",a.p.userData,true);if(z){a.p.records=ca;a.p.lastpage=Math.ceil(ca/ea)}q||J(false,true);if(z){for(;x<ca;){p=U[x];K=b.jgrid.getAccessor(p,Y);if(K===undefined){K=aa+x;if(B.length===0)if(s.cell){u=p[s.cell];K=u[Y]||K}}if(p){if(s.repeatitems){if(s.cell)p=b.jgrid.getAccessor(p,s.cell);I||(I=S(M+X+T))}for(D=0;D<I.length;D++){u=b.jgrid.getAccessor(p,I[D]);P[a.p.colModel[D+M+X+T].name]=
57
- u}P[C]=K;a.p.data.push(P);P={}}x++}ra()}}},ka=function(){var d,g=false,h=[],q,p;if(a.p.data.length){b.each(a.p.colModel,function(){sorttype=this.sorttype||"text";if(sorttype=="date"||sorttype=="datetime"){if(this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"){q=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat:b.jgrid.formatter.date.srcformat;p=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:b.jgrid.formatter.date.newformat}else q=
58
- p=this.datefmt||"Y-m-d";h[this.name]={stype:sorttype,srcfmt:q,newfmt:p}}else h[this.name]={stype:sorttype,srcfmt:"",newfmt:""};if(!g&&(this.index==a.p.sortname||this.name==a.p.sortname)){d=this.name;g=true}});if(a.p.treeGrid)b(a).jqGrid("SortTree",a.p.sortname,a.p.sortorder,h[d].stype,h[d].srcfmt);else{var w={eq:function(B){return B.equals},ne:function(B){return B.not().equals},lt:function(B){return B.less},le:function(B){return B.lessOrEquals},gt:function(B){return B.greater},ge:function(B){return B.greaterOrEquals},
59
- cn:function(B){return B.contains},nc:function(B){return B.not().contains},bw:function(B){return B.startsWith},bn:function(B){return B.not().startsWith},en:function(B){return B.not().endsWith},ew:function(B){return B.endsWith},ni:function(B){return B.not().equals},"in":function(B){return B.equals}},s=b.jgrid.from(a.p.data);if(a.p.search===true){var C=a.p.postData.filters;if(C){if(typeof C=="string")C=b.jgrid.parse(C);for(var z=0,x=C.rules.length,u;z<x;z++){u=C.rules[z];var D=C.groupOp;if(w[u.op]&&
60
- u.field&&u.data&&D)s=D.toUpperCase()=="OR"?w[u.op](s)(u.field,u.data,h[u.field]).or():w[u.op](s)(u.field,u.data,h[u.field])}}else try{s=w[a.p.postData.searchOper](s)(a.p.postData.searchField,a.p.postData.searchString,h[a.p.postData.searchField])}catch(F){}}if(d&&a.p.sortorder)a.p.sortorder.toUpperCase()=="DESC"?s.orderBy(d,"d",h[d].stype,h[d].srcfmt):s.orderBy(d,"a",h[d].stype,h[d].srcfmt);w=s.select();s=parseInt(a.p.rowNum,10);C=w.length;z=parseInt(a.p.page,10);x=Math.ceil(C/s);u={};w=w.slice((z-
61
- 1)*s,z*s);h=s=null;u[a.p.localReader.total]=x;u[a.p.localReader.page]=z;u[a.p.localReader.records]=C;u[a.p.localReader.root]=w;w=null;return u}}},J=function(d,g){var h,q,p,w,s,C,z,x="";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){h=b("tbody:first > tr",a.grid.bDiv);p=s-h.length;a.p.reccount=h.length;if(q=h.outerHeight()){h=p*q;q=parseInt(a.p.records,10)*q;b(">div:first",a.grid.bDiv).css({height:q}).children("div:first").css({height:h,display:h?"":
62
- "none"})}a.grid.bDiv.scrollLeft=a.grid.hDiv.scrollLeft}x=a.p.pager?a.p.pager:"";x+=a.p.toppager?x?","+a.p.toppager:a.p.toppager:"";if(x){z=b.jgrid.formatter.integer||{};h=H(a.p.page);q=H(a.p.lastpage);b(".selbox",x).attr("disabled",false);if(a.p.pginput===true){b(".ui-pg-input",x).val(a.p.page);b("#sp_1",x).html(b.fmatter?b.fmatter.util.NumberFormat(a.p.lastpage,z):a.p.lastpage)}if(a.p.viewrecords)if(a.p.reccount===0)b(".ui-paging-info",x).html(a.p.emptyrecords);else{w=p+1;C=a.p.records;if(b.fmatter){w=
63
- b.fmatter.util.NumberFormat(w,z);s=b.fmatter.util.NumberFormat(s,z);C=b.fmatter.util.NumberFormat(C,z)}b(".ui-paging-info",x).html(b.jgrid.format(a.p.recordtext,w,s,C))}if(a.p.pgbuttons===true){if(h<=0)h=q=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&&
64
- b("#first_t, #prev_t",a.p.toppager).removeClass("ui-state-disabled")}if(h==q||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(u){b(this).html(p+
65
- 1+u)});g&&a.p.jqgdnd&&b(a).jqGrid("gridDnD","updateDnD");b.isFunction(a.p.gridComplete)&&a.p.gridComplete.call(a)},Z=function(d){if(!a.grid.hDiv.loading){var g=a.p.scroll&&d===false,h={},q,p=a.p.prmNames;if(a.p.page<=0)a.p.page=1;if(p.search!==null)h[p.search]=a.p.search;if(p.nd!==null)h[p.nd]=(new Date).getTime();if(p.rows!==null)h[p.rows]=a.p.rowNum;if(p.page!==null)h[p.page]=a.p.page;if(p.sort!==null)h[p.sort]=a.p.sortname;if(p.order!==null)h[p.order]=a.p.sortorder;if(a.p.rowTotal!==null&&p.totalrows!==
66
- null)h[p.totalrows]=a.p.rowTotal;var w=a.p.loadComplete,s=b.isFunction(w);s||(w=null);var C=0;d=d||1;if(d>1)if(p.npage!==null){h[p.npage]=d;C=d-1;d=1}else w=function(x){a.p.page++;a.grid.hDiv.loading=false;s&&a.p.loadComplete.call(a,x);Z(d-1)};else p.npage!==null&&delete a.p.postData[p.npage];b.extend(a.p.postData,h);var z=!a.p.scroll?0: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);q=a.p.datatype.toLowerCase();
67
- switch(q){case "json":case "jsonp":case "xml":case "script":b.ajax(b.extend({url:a.p.url,type:a.p.mtype,dataType:q,data:b.isFunction(a.p.serializeGridData)?a.p.serializeGridData.call(a,a.p.postData):a.p.postData,success:function(x){q==="xml"?Q(x,a.grid.bDiv,z,d>1,C):fa(x,a.grid.bDiv,z,d>1,C);w&&w.call(a,x);g&&a.grid.populateVisible();if(a.p.loadonce||a.p.treeGrid)a.p.datatype="local";oa()},error:function(x,u,D){b.isFunction(a.p.loadError)&&a.p.loadError.call(a,x,u,D);oa()},beforeSend:function(x){sa();
68
- b.isFunction(a.p.loadBeforeSend)&&a.p.loadBeforeSend.call(a,x)}},b.jgrid.ajaxOptions,a.p.ajaxGridOptions));break;case "xmlstring":sa();h=b.jgrid.stringToDoc(a.p.datastr);s&&a.p.loadComplete.call(a,h);Q(h,a.grid.bDiv);a.p.datatype="local";a.p.datastr=null;oa();break;case "jsonstring":sa();h=typeof a.p.datastr=="string"?b.jgrid.parse(a.p.datastr):a.p.datastr;s&&a.p.loadComplete.call(a,h);fa(h,a.grid.bDiv);a.p.datatype="local";a.p.datastr=null;oa();break;case "local":case "clientside":sa();a.p.datatype=
69
- "local";h=ka();fa(h,a.grid.bDiv,z,d>1,C);w&&w.call(a,h);g&&a.grid.populateVisible();oa();break}}}},ra=function(){var d=a.p.data.length,g,h,q;g=a.p.rownumbers===true?1:0;h=a.p.multiselect===true?1:0;q=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+q+g].name;for(h=0;h<d;h++){q=b.jgrid.getAccessor(a.p.data[h],g);a.p._index[q]=h}},sa=function(){a.grid.hDiv.loading=true;if(!a.p.hiddengrid)switch(a.p.loadui){case "disable":break;case "enable":b("#load_"+
70
- a.p.id).show();break;case "block":b("#lui_"+a.p.id).show();b("#load_"+a.p.id).show();break}},oa=function(){a.grid.hDiv.loading=false;switch(a.p.loadui){case "disable":break;case "enable":b("#load_"+a.p.id).hide();break;case "block":b("#lui_"+a.p.id).hide();b("#load_"+a.p.id).hide();break}};v=function(d,g){var h="",q="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",p="",w,s,C,z,x=function(u){var D;if(b.isFunction(a.p.onPaging))D=a.p.onPaging.call(a,
71
- u);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(D=="stop")return false;return true};d=d.substr(1);w="pg_"+d;s=d+"_left";C=d+"_center";z=d+"_right";b("#"+d).append("<div id='"+w+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;' role='row'><tbody><tr><td id='"+s+"' align='left'></td><td id='"+C+"' align='center' style='white-space:pre;'></td><td id='"+
72
- z+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(a.p.rowList.length>0){p="<td dir='"+n+"'>";p+="<select class='ui-pg-selbox' role='listbox'>";for(s=0;s<a.p.rowList.length;s++)p+="<option role='option' value='"+a.p.rowList[s]+"'"+(a.p.rowNum==a.p.rowList[s]?" selected":"")+">"+a.p.rowList[s]+"</option>";p+="</select></td>"}if(n=="rtl")q+=p;if(a.p.pginput===true)h="<td dir='"+n+"'>"+b.jgrid.format(a.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>",
73
- "<span id='sp_1'></span>")+"</td>";if(a.p.pgbuttons===true){s=["first"+g,"prev"+g,"next"+g,"last"+g];n=="rtl"&&s.reverse();q+="<td id='"+s[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";q+="<td id='"+s[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";q+=h!=""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+h+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":
74
- "";q+="<td id='"+s[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";q+="<td id='"+s[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else if(h!="")q+=h;if(n=="ltr")q+=p;q+="</tr></tbody></table>";a.p.viewrecords===true&&b("td#"+d+"_"+a.p.recordpos,"#"+w).append("<div dir='"+n+"' style='text-align:"+a.p.recordpos+"' class='ui-paging-info'></div>");b("td#"+d+"_"+a.p.pagerpos,"#"+w).append(q);p=b(".ui-jqgrid").css("font-size")||
75
- "11px";b(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+p+";visibility:hidden;' ></div>");q=b(q).clone().appendTo("#testpg").width();b("#testpg").remove();if(q>0){if(h!="")q+=50;b("td#"+d+"_"+a.p.pagerpos,"#"+w).width(q)}a.p._nvtd=[];a.p._nvtd[0]=q?Math.floor((a.p.width-q)/2):Math.floor(a.p.width/3);a.p._nvtd[1]=0;q=null;b(".ui-pg-selbox","#"+w).bind("change",function(){a.p.page=Math.round(a.p.rowNum*(a.p.page-1)/this.value-0.5)+1;a.p.rowNum=
76
- 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(!x("records"))return false;Z();return false});if(a.p.pgbuttons===true){b(".ui-pg-button","#"+w).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"}});
77
- b("#first"+g+", #prev"+g+", #next"+g+", #last"+g,"#"+d).click(function(){var u=H(a.p.page,1),D=H(a.p.lastpage,1),F=false,B=true,I=true,M=true,X=true;if(D===0||D===1)X=M=I=B=false;else if(D>1&&u>=1)if(u===1)I=B=false;else{if(!(u>1&&u<D))if(u===D)X=M=false}else if(D>1&&u===0){X=M=false;u=D-1}if(this.id==="first"+g&&B){a.p.page=1;F=true}if(this.id==="prev"+g&&I){a.p.page=u-1;F=true}if(this.id==="next"+g&&M){a.p.page=u+1;F=true}if(this.id==="last"+g&&X){a.p.page=D;F=true}if(F){if(!x(this.id))return false;
78
- Z()}return false})}a.p.pginput===true&&b("input.ui-pg-input","#"+w).keypress(function(u){if((u.charCode?u.charCode:u.keyCode?u.keyCode:0)==13){a.p.page=b(this).val()>0?b(this).val():a.p.page;if(!x("user"))return false;Z();return false}return this})};var Ba=function(d,g,h,q){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||
79
- "asc";a.p.page=1}if(q)if(a.p.lastsort==g&&a.p.sortorder==q&&!h)return;else a.p.sortorder=q;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",
80
- 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;ba(a.grid.bDiv,true);a.grid.hDiv.scrollLeft=
81
- h}a.p.subGrid&&a.p.datatype=="local"&&b("td.sgexpanded","#"+a.p.id).each(function(){b(this).trigger("click")});Z();a.p.lastsort=g;if(a.p.sortname!=d&&g)a.p.lastsort=g}},Da=function(d){var g=d,h;for(h=d+1;h<a.p.colModel.length;h++)if(a.p.colModel[h].hidden!==true){g=h;break}return g-d},Ea=function(d){var g,h={},q=E?0:a.p.cellLayout;for(g=h[0]=h[1]=h[2]=0;g<=d;g++)if(a.p.colModel[g].hidden===false)h[0]+=a.p.colModel[g].width+q;if(a.p.direction=="rtl")h[0]=a.p.width-h[0];h[0]-=a.grid.bDiv.scrollLeft;
82
- if(b(a.grid.cDiv).is(":visible"))h[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"))h[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)h[1]+=b(a.grid.topDiv).height()+parseInt(b(a.grid.topDiv).css("border-bottom-width"),10);h[2]+=b(a.grid.bDiv).height()+
83
- b(a.grid.hDiv).height();return h};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<a.p.colModel.length;k++)if(a.p.colModel[k].key===true){a.p.keyIndex=k;break}a.p.sortorder=a.p.sortorder.toLowerCase();if(this.p.treeGrid===true){try{b(this).jqGrid("setTreeGrid")}catch(Ia){}if(a.p.datatype!="local")a.p.localReader={id:"_id_"}}if(this.p.subGrid)try{b(a).jqGrid("setSubGrid")}catch(Ja){}if(this.p.multiselect){this.p.colNames.unshift("<input role='checkbox' id='cb_"+
84
- this.p.id+"' class='cbox' type='checkbox'/>");this.p.colModel.unshift({name:"cb",width:E?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",
85
- 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",
86
- 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&&ra();var V="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",Ca,la,xa,pa,ta,W,N,na;la=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";la=" ui-i-desc"}Ca=y?"class='ui-th-div-ie'":"";
87
- na="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+na+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+n+"'></span>";na+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+la+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+n+"'></span></span>";for(k=0;k<this.p.colNames.length;k++){la=a.p.headertitles?' title="'+b.jgrid.stripHtml(a.p.colNames[k])+'"':"";V+="<th id='"+a.p.id+"_"+a.p.colModel[k].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+
88
- n+"'"+la+">";la=a.p.colModel[k].index||a.p.colModel[k].name;V+="<div id='jqgh_"+a.p.colModel[k].name+"' "+Ca+">"+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;V+=na+"</div></th>"}V+="</tr></thead>";b(this).append(V);b("thead tr:first th",this).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});
89
- if(this.p.multiselect){var ya=[],ua;b("#cb_"+b.jgrid.jqID(a.p.id),this).bind("click",function(){if(this.checked){b("[id^=jqg_]",a.rows).attr("checked",true);b(a.rows).each(function(d){if(!b(this).hasClass("subgrid")){b(this).addClass("ui-state-highlight").attr("aria-selected","true");a.p.selarrrow[d]=a.p.selrow=this.id}});ua=true;ya=[]}else{b("[id^=jqg_]",a.rows).attr("checked",false);b(a.rows).each(function(d){if(!b(this).hasClass("subgrid")){b(this).removeClass("ui-state-highlight").attr("aria-selected",
90
- "false");ya[d]=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:ya,ua)})}if(a.p.autowidth===true){V=b(O).innerWidth();a.p.width=V>0?V:"nw"}(function(){var d=0,g=a.p.cellLayout,h=0,q,p=a.p.scrollOffset,w,s=false,C,z=0,x=0,u=0,D;if(E)g=0;b.each(a.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){d+=H(this.width,0);if(this.fixed){z+=this.width;x+=this.width+g}else h++;u++}});
91
- if(isNaN(a.p.width))a.p.width=f.width=d;else f.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=f.width-g*h-x;if(!isNaN(a.p.height)){C-=p;s=true}d=0;b.each(a.p.colModel,function(F){if(this.hidden===false&&!this.fixed){this.width=w=Math.round(C*this.width/(a.p.tblwidth-z));d+=w;q=F}});D=0;if(s){if(f.width-x-(d+g*h)!==p)D=f.width-x-(d+g*h)-p}else if(!s&&Math.abs(f.width-x-(d+g*h))!==1)D=f.width-x-(d+g*h);a.p.colModel[q].width+=
92
- D;a.p.tblwidth=d+D+z+u*g;if(a.p.tblwidth>a.p.width){a.p.colModel[q].width-=a.p.tblwidth-parseInt(a.p.width,10);a.p.tblwidth=a.p.width}}})();b(O).css("width",f.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+a.p.id+"'>&#160;</div>");b(r).css("width",f.width+"px");V=b("thead:first",a).get(0);var va="";if(a.p.footerrow)va+="<table role='grid' style='width:"+a.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+
93
- n+"'>";r=b("tr:first",V);a.p.disableClick=false;b("th",r).each(function(d){xa=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("&#160;").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",xa+"px").prepend(pa);a.p.colModel[d].hidden&&b(this).css("display","none");
94
- f.headers[d]={width:xa,el:this};ta=a.p.colModel[d].sortable;if(typeof ta!=="boolean")ta=a.p.colModel[d].sortable=true;var 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+=
95
- "<td role='gridcell' "+L(d,0,"")+">&#160;</td>"}).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=Da(g);f.dragStart(g,d,Ea(g));return false}}).click(function(d){if(a.p.disableClick)return a.p.disableClick=false;var g="th>div.ui-jqgrid-sortable",h,q;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=
96
- true;q=d.attr("sort")}Ba(b("div",this)[0].id,g,h,q);return false}});if(a.p.sortable&&b.fn.sortable)try{b(a).jqGrid("sortableColumns",r)}catch(Ka){}if(a.p.footerrow)va+="</tr></tbody></table>";this.appendChild(document.createElement("tbody"));b(this).addClass("ui-jqgrid-btable");r=b("<table class='ui-jqgrid-htable' style='width:"+a.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(V);var ha=a.p.caption&&a.p.hiddengrid===true?
97
- true:false;V=b("<div class='ui-jqgrid-hbox"+(n=="rtl"?"-rtl":"")+"'></div>");f.hDiv=document.createElement("div");b(f.hDiv).css({width:f.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(V);b(V).append(r);ha&&b(f.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:f.width+"px"}).appendTo(O).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom");ha&&b(a.p.pager).hide();
98
- v(a.p.pager,"")}a.p.cellEdit===false&&a.p.hoverrows===true&&b(a).bind("mouseover",function(d){N=b(d.target).closest("tr.jqgrow");b(N).attr("class")!=="subgrid"&&b(N).addClass("ui-state-hover");return false}).bind("mouseout",function(d){N=b(d.target).closest("tr.jqgrow");b(N).removeClass("ui-state-hover");return false});var ia,ja;b(a).before(f.hDiv).click(function(d){W=d.target;var g=b(W).hasClass("cbox");N=b(W,a.rows).closest("tr.jqgrow");if(b(N).length===0)return this;var h=true;if(b.isFunction(a.p.beforeSelectRow))h=
99
- a.p.beforeSelectRow.call(a,N[0].id,d);if(W.tagName=="A"||(W.tagName=="INPUT"||W.tagName=="TEXTAREA"||W.tagName=="OPTION"||W.tagName=="SELECT")&&!g)return this;if(h===true){if(a.p.cellEdit===true)if(a.p.multiselect&&g)b(a).jqGrid("setSelection",N[0].id,true);else{ia=N[0].rowIndex;ja=b.jgrid.getCellIndex(W);try{b(a).jqGrid("editCell",ia,ja,true)}catch(q){}}else if(a.p.multikey)if(d[a.p.multikey])b(a).jqGrid("setSelection",N[0].id,true);else{if(a.p.multiselect&&g){g=b("[id^=jqg_]",N).attr("checked");
100
- b("[id^=jqg_]",N).attr("checked",!g)}}else{if(a.p.multiselect&&a.p.multiboxonly)if(!g){b(a.p.selarrrow).each(function(p,w){p=a.rows.namedItem(w);b(p).removeClass("ui-state-highlight");b("#jqg_"+b.jgrid.jqID(w),p).attr("checked",false)});a.p.selarrrow=[];b("#cb_"+b.jgrid.jqID(a.p.id),a.grid.hDiv).attr("checked",false)}b(a).jqGrid("setSelection",N[0].id,true)}if(b.isFunction(a.p.onCellSelect)){ia=N[0].id;ja=b.jgrid.getCellIndex(W);a.p.onCellSelect.call(a,ia,ja,b(W).html(),d)}d.stopPropagation()}else return this}).bind("reloadGrid",
101
- function(d,g){if(a.p.treeGrid===true){a.p.datatype=a.p.treedatatype;if(a.p.postData.hasOwnProperty("nodeid")&&a.p.postData.nodeid==""){a.p.data=[];_index={}}}g&&g.current&&a.grid.selectionPreserver(a);if(a.p.datatype=="local")b(a).jqGrid("resetSelection");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&&ba(a.grid.bDiv,true);if(g&&g.page){d=g.page;if(d>a.p.lastpage)d=a.p.lastpage;
102
- 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){W=d.target;N=b(W,a.rows).closest("tr.jqgrow");if(b(N).length===0)return false;ia=N[0].rowIndex;ja=b.jgrid.getCellIndex(W);a.p.ondblClickRow.call(a,b(N).attr("id"),ia,ja,d);return false});b.isFunction(this.p.onRightClickRow)&&
103
- b(this).bind("contextmenu",function(d){W=d.target;N=b(W,a.rows).closest("tr.jqgrow");if(b(N).length===0)return false;a.p.multiselect||b(a).jqGrid("setSelection",N[0].id,true);ia=N[0].rowIndex;ja=b.jgrid.getCellIndex(W);a.p.onRightClickRow.call(a,b(N).attr("id"),ia,ja,d);return false});f.bDiv=document.createElement("div");b(f.bDiv).append(b('<div style="position:relative;'+(y&&b.browser.version<8?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height+
104
- (isNaN(a.p.height)?"":"px"),width:f.width+"px"}).scroll(f.scrollGrid);b("table:first",f.bDiv).css({width:a.p.tblwidth+"px"});if(y){b("tbody",this).size()==2&&b("tbody:first",this).remove();a.p.multikey&&b(f.bDiv).bind("selectstart",function(){return false})}else a.p.multikey&&b(f.bDiv).bind("mousedown",function(){return false});ha&&b(f.bDiv).hide();f.cDiv=document.createElement("div");var za=a.p.hidegrid===true?b("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){za.addClass("ui-state-hover")},
105
- function(){za.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css(n=="rtl"?"left":"right","0px"):"";b(f.cDiv).append(za).append("<span class='ui-jqgrid-title"+(n=="rtl"?"-rtl":"")+"'>"+a.p.caption+"</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");b(f.cDiv).insertBefore(f.hDiv);if(a.p.toolbar[0]){f.uDiv=document.createElement("div");if(a.p.toolbar[1]=="top")b(f.uDiv).insertBefore(f.hDiv);else a.p.toolbar[1]==
106
- "bottom"&&b(f.uDiv).insertAfter(f.hDiv);if(a.p.toolbar[1]=="both"){f.ubDiv=document.createElement("div");b(f.uDiv).insertBefore(f.hDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);b(f.ubDiv).insertAfter(f.hDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id);ha&&b(f.ubDiv).hide()}else b(f.uDiv).width(f.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);ha&&b(f.uDiv).hide()}if(a.p.toppager){a.p.toppager=a.p.id+"_toppager";f.topDiv=b("<div id='"+
107
- a.p.toppager+"'></div>")[0];a.p.toppager="#"+a.p.toppager;b(f.topDiv).insertBefore(f.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(f.width);v(a.p.toppager,"_t")}if(a.p.footerrow){f.sDiv=b("<div class='ui-jqgrid-sdiv'></div>")[0];V=b("<div class='ui-jqgrid-hbox"+(n=="rtl"?"-rtl":"")+"'></div>");b(f.sDiv).append(V).insertAfter(f.hDiv).width(f.width);b(V).append(va);f.footers=b(".ui-jqgrid-ftable",f.sDiv)[0].rows[0].cells;if(a.p.rownumbers)f.footers[0].className="ui-state-default jqgrid-rownum";
108
- ha&&b(f.sDiv).hide()}if(a.p.caption){var Fa=a.p.datatype;if(a.p.hidegrid===true){b(".ui-jqgrid-titlebar-close",f.cDiv).click(function(d){var g=b.isFunction(a.p.onHeaderClick);if(a.p.gridstate=="visible"){b(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+a.p.id).slideUp("fast");a.p.pager&&b(a.p.pager).slideUp("fast");a.p.toppager&&b(a.p.toppager).slideUp("fast");if(a.p.toolbar[0]===true){a.p.toolbar[1]=="both"&&b(f.ubDiv).slideUp("fast");b(f.uDiv).slideUp("fast")}a.p.footerrow&&b(".ui-jqgrid-sdiv","#gbox_"+
109
- a.p.id).slideUp("fast");b("span",this).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)ha||a.p.onHeaderClick.call(a,a.p.gridstate,d)}else if(a.p.gridstate=="hidden"){b(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+a.p.id).slideDown("fast");a.p.pager&&b(a.p.pager).slideDown("fast");a.p.toppager&&b(a.p.toppager).slideDown("fast");if(a.p.toolbar[0]===
110
- true){a.p.toolbar[1]=="both"&&b(f.ubDiv).slideDown("fast");b(f.uDiv).slideDown("fast")}a.p.footerrow&&b(".ui-jqgrid-sdiv","#gbox_"+a.p.id).slideDown("fast");b("span",this).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(ha){a.p.datatype=Fa;Z();ha=false}a.p.gridstate="visible";b("#gbox_"+a.p.id).hasClass("ui-resizable")&&b(".ui-resizable-handle","#gbox_"+a.p.id).show();g&&a.p.onHeaderClick.call(a,a.p.gridstate,d)}return false});if(ha){a.p.datatype="local";b(".ui-jqgrid-titlebar-close",
111
- f.cDiv).trigger("click")}}}else b(f.cDiv).hide();b(f.hDiv).after(f.bDiv).mousemove(function(d){if(f.resizing){f.dragMove(d);return false}});b(".ui-jqgrid-labels",f.hDiv).bind("selectstart",function(){return false});b(document).mouseup(function(){if(f.resizing){f.dragEnd();return false}return true});this.updateColumns=function(){var d=this.rows[0],g=this;if(d){b("td",d).each(function(h){b(this).css("width",g.grid.headers[h].width+"px")});this.grid.cols=d.cells}return this};a.formatCol=L;a.sortData=
112
- Ba;a.updatepager=J;a.refreshIndex=ra;a.formatter=function(d,g,h,q,p){return m(d,g,h,q,p)};b.extend(f,{populate:Z,emptyRows:ba});this.grid=f;a.addXmlData=function(d){Q(d,a.grid.bDiv)};a.addJSONData=function(d){fa(d,a.grid.bDiv)};Z();a.p.hiddengrid=false;b(window).unload(function(){a=null})}}})};b.jgrid.extend({getGridParam:function(e){var j=this[0];if(j&&j.grid)return e?typeof j.p[e]!="undefined"?j.p[e]:null:j.p},setGridParam:function(e){return this.each(function(){this.grid&&typeof e==="object"&&
113
- b.extend(true,this.p,e)})},getDataIDs:function(){var e=[],j=0,i;this.each(function(){if((i=this.rows.length)&&i>0)for(;j<i;){e[j]=this.rows[j].id;j++}});return e},setSelection:function(e,j){return this.each(function(){function i(a){var r=b(c.grid.bDiv)[0].clientHeight,v=b(c.grid.bDiv)[0].scrollTop,y=c.rows[a].offsetTop;a=c.rows[a].clientHeight;if(y+a>=r+v)b(c.grid.bDiv)[0].scrollTop=y-(r+v)+a+v;else if(y<r+v)if(y<v)b(c.grid.bDiv)[0].scrollTop=y}var c=this,f,k,n;if(e!==undefined){j=j===false?false:
114
- true;if(k=c.rows.namedItem(e+"")){if(c.p.scrollrows===true){f=c.rows.namedItem(e).rowIndex;f>=0&&i(f)}if(c.p.multiselect){c.p.selrow=k.id;n=b.inArray(c.p.selrow,c.p.selarrrow);if(n===-1){k.className!=="ui-subgrid"&&b(k).addClass("ui-state-highlight").attr("aria-selected","true");f=true;b("#jqg_"+b.jgrid.jqID(c.p.selrow),c.rows[k.rowIndex]).attr("checked",f);c.p.selarrrow.push(c.p.selrow);c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,c.p.selrow,f)}else{k.className!=="ui-subgrid"&&b(k).removeClass("ui-state-highlight").attr("aria-selected",
115
- "false");f=false;b("#jqg_"+b.jgrid.jqID(c.p.selrow),c.rows[k.rowIndex]).attr("checked",f);c.p.selarrrow.splice(n,1);c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,c.p.selrow,f);k=c.p.selarrrow[0];c.p.selrow=k===undefined?null:k}}else if(k.className!=="ui-subgrid"){c.p.selrow&&b(c.rows.namedItem(c.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false");c.p.selrow=k.id;b(k).addClass("ui-state-highlight").attr("aria-selected","true");c.p.onSelectRow&&j&&c.p.onSelectRow.call(c,c.p.selrow,
116
- true)}}}})},resetSelection:function(){return this.each(function(){var e=this,j;if(e.p.multiselect){b(e.p.selarrrow).each(function(i,c){j=e.rows.namedItem(c);b(j).removeClass("ui-state-highlight").attr("aria-selected","false");b("#jqg_"+b.jgrid.jqID(c),j).attr("checked",false)});b("#cb_"+b.jgrid.jqID(e.p.id),e.grid.hDiv).attr("checked",false);e.p.selarrrow=[]}else if(e.p.selrow){b("tr#"+b.jgrid.jqID(e.p.selrow),e.grid.bDiv).removeClass("ui-state-highlight").attr("aria-selected","false");e.p.selrow=
117
- null}e.p.savedRow=[]})},getRowData:function(e){var j={},i,c=false,f,k=0;this.each(function(){var n=this,a,r;if(typeof e=="undefined"){c=true;i=[];f=n.rows.length}else{r=n.rows.namedItem(e);if(!r)return j;f=1}for(;k<f;){if(c)r=n.rows[k];b("td",r).each(function(v){a=n.p.colModel[v].name;if(a!=="cb"&&a!=="subgrid"&&a!=="rn")if(n.p.treeGrid===true&&a==n.p.ExpandColumn)j[a]=b.jgrid.htmlDecode(b("span:first",this).html());else try{j[a]=b.unformat(this,{rowId:r.id,colModel:n.p.colModel[v]},v)}catch(y){j[a]=
118
- b.jgrid.htmlDecode(b(this).html())}});k++;if(c){i.push(j);j={}}}});return i?i:j},delRowData:function(e){var j=false,i,c,f;this.each(function(){var k=this;if(i=k.rows.namedItem(e)){f=i.rowIndex;b(i).remove();k.p.records--;k.p.reccount--;k.updatepager(true,false);j=true;if(k.p.multiselect){c=b.inArray(e,k.p.selarrrow);c!=-1&&k.p.selarrrow.splice(c,1)}if(e==k.p.selrow)k.p.selrow=null}else return false;if(k.p.datatype=="local"){var n=null;n=k.p._index[e];if(n!==null){k.p.data.splice(n,1);k.refreshIndex()}}f===
119
- 0&&j&&k.updateColumns();if(k.p.altRows===true&&j){var a=k.p.altclass;b(k.rows).each(function(r){r%2==1?b(this).addClass(a):b(this).removeClass(a)})}});return j},setRowData:function(e,j,i){var c,f=true,k;this.each(function(){if(!this.grid)return false;var n=this,a,r,v=typeof i,y={};r=n.rows.namedItem(e);if(!r)return false;if(j)try{b(this.p.colModel).each(function(H){c=this.name;if(j[c]!==undefined){y[c]=this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"?b.unformat.date(j[c],this):
120
- j[c];a=n.formatter(e,j[c],H,j,"edit");k=this.title?{title:b.jgrid.stripHtml(a)}:{};n.p.treeGrid===true&&c==n.p.ExpandColumn?b("td:eq("+H+") > span:first",r).html(a).attr(k):b("td:eq("+H+")",r).html(a).attr(k)}});if(n.p.datatype=="local"){var E;E=n.p._index[e];if(typeof E!="undefined")n.p.data[E]=b.extend(true,n.p.data[E],y);y=null}}catch(O){f=false}if(f)if(v==="string")b(r).addClass(i);else v==="object"&&b(r).css(i)});return f},addRowData:function(e,j,i,c){i||(i="last");var f=false,k,n,a,r,v,y,E,
121
- O,H="",L,l,m,o,A;if(j){if(b.isArray(j)){L=true;i="last";l=e}else{j=[j];L=false}this.each(function(){var t=this,G=j.length;v=t.p.rownumbers===true?1:0;a=t.p.multiselect===true?1:0;r=t.p.subGrid===true?1:0;if(!L)if(typeof e!="undefined")e+="";else{e=t.p.records+1+"";if(t.p.keyIndex!==false){l=t.p.colModel[t.p.keyIndex+a+r+v].name;if(typeof j[0][l]!="undefined")e=j[0][l]}}m=t.p.altclass;for(var S=0,ba="",Q={},fa=b.isFunction(t.p.afterInsertRow)?true:false;S<G;){o=j[S];n="";if(L){try{e=o[l]}catch(ka){e=
122
- t.p.records+1+""}ba=t.p.altRows===true?(t.rows.length-1)%2===0?m:"":""}if(v){H=t.formatCol(0,1,"");n+='<td role="gridcell" aria-describedby="'+t.p.id+'_rn" class="ui-state-default jqgrid-rownum" '+H+">0</td>"}if(a){O='<input role="checkbox" type="checkbox" id="jqg_'+e+'" class="cbox"/>';H=t.formatCol(v,1,"");n+='<td role="gridcell" aria-describedby="'+t.p.id+'_cb" '+H+">"+O+"</td>"}if(r)n+=b(t).jqGrid("addSubGridCell",a+v,1);for(E=a+r+v;E<t.p.colModel.length;E++){A=t.p.colModel[E];k=A.name;Q[k]=A.formatter&&
123
- typeof A.formatter==="string"&&A.formatter=="date"?b.unformat.date(o[k],A):o[k];O=t.formatter(e,o[k],E,o,"edit");H=t.formatCol(E,1,O);n+='<td role="gridcell" aria-describedby="'+t.p.id+"_"+k+'" '+H+">"+O+"</td>"}n='<tr id="'+e+'" role="row" class="ui-widget-content jqgrow ui-row-'+t.p.direction+" "+ba+'">'+n+"</tr>";if(t.p.subGrid===true){n=b(n)[0];b(t).jqGrid("addSubGrid",n,a+v)}if(t.rows.length===0)b("table:first",t.grid.bDiv).append(n);else switch(i){case "last":b(t.rows[t.rows.length-1]).after(n);
124
- break;case "first":b(t.rows[0]).before(n);break;case "after":if(y=t.rows.namedItem(c))b(t.rows[y.rowIndex+1]).hasClass("ui-subgrid")?b(t.rows[y.rowIndex+1]).after(n):b(y).after(n);break;case "before":if(y=t.rows.namedItem(c)){b(y).before(n);y=y.rowIndex}break}t.p.records++;t.p.reccount++;if(!t.grid.cols||!t.grid.cols.length)t.grid.cols=t.rows[0].cells;if(i==="first"||i==="before"&&y<=1||t.rows.length===1)t.updateColumns();fa&&t.p.afterInsertRow.call(t,e,o,o);S++;if(t.p.datatype=="local"){t.p._index[e]=
125
- t.p.data.length;t.p.data.push(Q);Q={}}}if(t.p.altRows===true&&!L)if(i=="last")(t.rows.length-1)%2==1&&b(t.rows[t.rows.length-1]).addClass(m);else b(t.rows).each(function(J){J%2==1?b(this).addClass(m):b(this).removeClass(m)});t.updatepager(true,true);f=true})}return f},footerData:function(e,j,i){function c(r){for(var v in r)if(r.hasOwnProperty(v))return false;return true}var f,k=false,n={},a;if(typeof e=="undefined")e="get";if(typeof i!="boolean")i=true;e=e.toLowerCase();this.each(function(){var r=
126
- this,v;if(!r.grid||!r.p.footerrow)return false;if(e=="set")if(c(j))return false;k=true;b(this.p.colModel).each(function(y){f=this.name;if(e=="set"){if(j[f]!==undefined){v=i?r.formatter("",j[f],y,j,"edit"):j[f];a=this.title?{title:b.jgrid.stripHtml(v)}:{};b("tr.footrow td:eq("+y+")",r.grid.sDiv).html(v).attr(a);k=true}}else if(e=="get")n[f]=b("tr.footrow td:eq("+y+")",r.grid.sDiv).html()})});return e=="get"?n:k},ShowHideCol:function(e,j){return this.each(function(){var i=this,c=false;if(i.grid){if(typeof e===
127
- "string")e=[e];j=j!="none"?"":"none";var f=j==""?true:false;b(this.p.colModel).each(function(k){if(b.inArray(this.name,e)!==-1&&this.hidden===f){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;else i.p.tblwidth+=this.width;this.hidden=!f;c=true}});if(c===true){b("table:first",i.grid.hDiv).width(i.p.tblwidth);
128
- 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}}}})},hideCol:function(e){return this.each(function(){b(this).jqGrid("ShowHideCol",e,"none")})},showCol:function(e){return this.each(function(){b(this).jqGrid("ShowHideCol",e,"")})},remapColumns:function(e,j,i){function c(n){var a;a=n.length?b.makeArray(n):b.extend({},n);b.each(e,function(r){n[r]=
129
- a[this]})}function f(n,a){b(">tr"+(a||""),n).each(function(){var r=this,v=b.makeArray(r.cells);b.each(e,function(){var y=v[this];y&&r.appendChild(y)})})}var k=this.get(0);c(k.p.colModel);c(k.p.colNames);c(k.grid.headers);f(b("thead:first",k.grid.hDiv),i&&":not(.ui-jqgrid-labels)");j&&f(b("tbody:first",k.grid.bDiv),".jqgrow");k.p.footerrow&&f(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(e);k.p.lastsort=b.inArray(k.p.lastsort,
130
- e);if(k.p.treeGrid)k.p.expColInd=b.inArray(k.p.expColInd,e)},setGridWidth:function(e,j){return this.each(function(){if(this.grid){var i=this,c,f=0,k=i.p.cellLayout,n,a=0,r=false,v=i.p.scrollOffset,y,E=0,O=0,H=0,L;if(typeof j!="boolean")j=i.p.shrinkToFit;if(!isNaN(e)){e=parseInt(e,10);i.grid.width=i.p.width=e;b("#gbox_"+i.p.id).css("width",e+"px");b("#gview_"+i.p.id).css("width",e+"px");b(i.grid.bDiv).css("width",e+"px");b(i.grid.hDiv).css("width",e+"px");i.p.pager&&b(i.p.pager).css("width",e+"px");
131
- i.p.toppager&&b(i.p.toppager).css("width",e+"px");if(i.p.toolbar[0]===true){b(i.grid.uDiv).css("width",e+"px");i.p.toolbar[1]=="both"&&b(i.grid.ubDiv).css("width",e+"px")}i.p.footerrow&&b(i.grid.sDiv).css("width",e+"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){f+=parseInt(this.width,10);if(this.fixed){O+=this.width;E+=this.width+k}else a++;H++}});if(a!==0){i.p.tblwidth=f;y=e-k*a-E;if(!isNaN(i.p.height))if(b(i.grid.bDiv)[0].clientHeight<
132
- b(i.grid.bDiv)[0].scrollHeight){r=true;y-=v}f=0;var l=i.grid.cols.length>0;b.each(i.p.colModel,function(m){if(this.hidden===false&&!this.fixed){c=Math.round(y*this.width/(i.p.tblwidth-O));if(!(c<0)){this.width=c;f+=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}}});L=0;if(r){if(e-E-(f+k*a)!==v)L=e-E-(f+k*a)-v}else if(Math.abs(e-E-(f+k*a))!==1)L=e-E-(f+k*a);i.p.colModel[n].width+=L;
133
- i.p.tblwidth=f+L+O+k*H;if(i.p.tblwidth>e){r=i.p.tblwidth-parseInt(e,10);i.p.tblwidth=e;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",
134
- i.p.tblwidth+"px")}}}}}})},setGridHeight:function(e){return this.each(function(){var j=this;if(j.grid){b(j.grid.bDiv).css({height:e+(isNaN(e)?"":"px")});j.p.height=e;j.p.scroll&&j.grid.populateVisible()}})},setCaption:function(e){return this.each(function(){this.p.caption=e;b("span.ui-jqgrid-title",this.grid.cDiv).html(e);b(this.grid.cDiv).show()})},setLabel:function(e,j,i,c){return this.each(function(){var f=this,k=-1;if(f.grid){if(isNaN(e))b(f.p.colModel).each(function(r){if(this.name==e){k=r;return false}});
135
- else k=parseInt(e,10);if(k>=0){var n=b("tr.ui-jqgrid-labels th:eq("+k+")",f.grid.hDiv);if(j){var a=b(".s-ico",n);b("[id^=jqgh_]",n).empty().html(j).append(a);f.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(e,j,i,c,f,k){return this.each(function(){var n=this,a=-1,r,v;if(n.grid){if(isNaN(j))b(n.p.colModel).each(function(E){if(this.name==j){a=E;return false}});else a=parseInt(j,10);if(a>=0)if(r=n.rows.namedItem(e)){var y=
136
- b("td:eq("+a+")",r);if(i!==""||k===true){r=n.formatter(e,i,a,r,"edit");v=n.p.colModel[a].title?{title:b.jgrid.stripHtml(r)}:{};n.p.treeGrid&&b(".tree-wrap",b(y)).length>0?b("span",b(y)).html(r).attr(v):b(y).html(r).attr(v);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;v=n.p._index[e];if(parseInt(v,10)>=0)n.p.data[v][r.name]=i}}if(typeof c==="string")b(y).addClass(c);else c&&b(y).css(c);typeof f==="object"&&b(y).attr(f)}}})},
137
- getCell:function(e,j){var i=false;this.each(function(){var c=this,f=-1;if(c.grid){if(isNaN(j))b(c.p.colModel).each(function(a){if(this.name===j){f=a;return false}});else f=parseInt(j,10);if(f>=0){var k=c.rows.namedItem(e);if(k)try{i=b.unformat(b("td:eq("+f+")",k),{rowId:k.id,colModel:c.p.colModel[f]},f)}catch(n){i=b.jgrid.htmlDecode(b("td:eq("+f+")",k).html())}}}});return i},getCol:function(e,j,i){var c=[],f,k=0;j=typeof j!="boolean"?false:j;if(typeof i=="undefined")i=false;this.each(function(){var n=
138
- this,a=-1;if(n.grid){if(isNaN(e))b(n.p.colModel).each(function(E){if(this.name===e){a=E;return false}});else a=parseInt(e,10);if(a>=0){var r=n.rows.length,v=0;if(r&&r>0){for(;v<r;){try{f=b.unformat(b(n.rows[v].cells[a]),{rowId:n.rows[v].id,colModel:n.p.colModel[a]},a)}catch(y){f=b.jgrid.htmlDecode(n.rows[v].cells[a].innerHTML)}if(i)k+=parseFloat(f);else if(j)c.push({id:n.rows[v].id,value:f});else c[v]=f;v++}if(i)switch(i.toLowerCase()){case "sum":c=k;break;case "avg":c=k/r;break;case "count":c=r;
139
- break}}}}});return c},clearGridData:function(e){return this.each(function(){var j=this;if(j.grid){if(typeof e!="boolean")e=false;b("tbody:first tr",j.grid.bDiv).remove();j.p.footerrow&&e&&b(".ui-jqgrid-ftable td",j.grid.sDiv).html("&#160;");j.p.selrow=null;j.p.selarrrow=[];j.p.savedRow=[];j.p.records=0;j.p.page="0";j.p.lastpage="0";j.p.reccount=0;j.p.data=[];j.p_index={};j.updatepager(true,false)}})},getInd:function(e,j){var i=false,c;this.each(function(){if(c=this.rows.namedItem(e))i=j===true?c:
140
- c.rowIndex});return i}})})(jQuery);
141
- (function(c){function u(a,b,d,e,g){var h=b;if(c.fn.fmatter[a])h=c.fn.fmatter[a](b,d,e,g);return h}c.fmatter={};c.fn.fmatter=function(a,b,d,e,g){d=c.extend({},c.jgrid.formatter,d);return u(a,b,d,e,g)};c.fmatter.util={NumberFormat:function(a,b){isNumber(a)||(a*=1);if(isNumber(a)){var d=a<0,e=a+"",g=b.decimalSeparator?b.decimalSeparator:".";if(isNumber(b.decimalPlaces)){var h=b.decimalPlaces;e=Math.pow(10,h);e=Math.round(a*e)/e+"";a=e.lastIndexOf(".");if(h>0){if(a<0){e+=g;a=e.length-1}else if(g!==".")e=
142
- e.replace(".",g);for(;e.length-1-a<h;)e+="0"}}if(b.thousandsSeparator){h=b.thousandsSeparator;a=e.lastIndexOf(g);a=a>-1?a:e.length;g=e.substring(a);for(var f=-1,i=a;i>0;i--){f++;if(f%3===0&&i!==a&&(!d||i>1))g=h+g;g=e.charAt(i-1)+g}e=g}e=b.prefix?b.prefix+e:e;return e=b.suffix?e+b.suffix:e}else return a},DateFormat:function(a,b,d,e){var g=function(m,r){m=String(m);for(r=parseInt(r,10)||2;m.length<r;)m="0"+m;return m},h={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},f=0,i,k,j=["i18n"];j.i18n={dayNames:e.dayNames,
143
- monthNames:e.monthNames};if(a in e.masks)a=e.masks[a];if(b.constructor===Date)f=b;else{b=b.split(/[\\\/:_;.\t\T\s-]/);a=a.split(/[\\\/:_;.\t\T\s-]/);i=0;for(k=a.length;i<k;i++){if(a[i]=="M"){f=c.inArray(b[i],j.i18n.monthNames);if(f!==-1&&f<12)b[i]=f+1}if(a[i]=="F"){f=c.inArray(b[i],j.i18n.monthNames);if(f!==-1&&f>11)b[i]=f+1-12}if(b[i])h[a[i].toLowerCase()]=parseInt(b[i],10)}h.m=parseInt(h.m,10)-1;f=h.y;if(f>=70&&f<=99)h.y=1900+h.y;else if(f>=0&&f<=69)h.y=2E3+h.y;f=new Date(h.y,h.m,h.d,h.h,h.i,h.s,
144
- h.u)}if(d in e.masks)d=e.masks[d];else d||(d="Y-m-d");h=f.getHours();a=f.getMinutes();b=f.getDate();i=f.getMonth()+1;k=f.getTimezoneOffset();var l=f.getSeconds(),o=f.getMilliseconds(),n=f.getDay(),p=f.getFullYear(),q=(n+6)%7+1,s=(new Date(p,i-1,b)-new Date(p,0,1))/864E5,t={d:g(b),D:j.i18n.dayNames[n],j:b,l:j.i18n.dayNames[n+7],N:q,S:e.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:j.i18n.monthNames[i-1+12],m:g(i),M:j.i18n.monthNames[i-
145
- 1],n:i,t:"?",L:"?",o:"?",Y:p,y:String(p).substring(2),a:h<12?e.AmPm[0]:e.AmPm[1],A:h<12?e.AmPm[2]:e.AmPm[3],B:"?",g:h%12||12,G:h,h:g(h%12||12),H:g(h),i:g(a),s:g(l),u:o,e:"?",I:"?",O:(k>0?"-":"+")+g(Math.floor(Math.abs(k)/60)*100+Math.abs(k)%60,4),P:"?",T:(String(f).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(f/1E3)};return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,
146
- function(m){return m in t?t[m]:m.substring(1)})}};c.fn.fmatter.defaultFormat=function(a,b){return isValue(a)&&a!==""?a:b.defaultValue?b.defaultValue:"&#160;"};c.fn.fmatter.email=function(a,b){return isEmpty(a)?c.fn.fmatter.defaultFormat(a,b):'<a href="mailto:'+a+'">'+a+"</a>"};c.fn.fmatter.checkbox=function(a,b){var d=c.extend({},b.checkbox);isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));b=d.disabled===true?"disabled":"";if(isEmpty(a)||isUndefined(a))a=c.fn.fmatter.defaultFormat(a,
147
- d);a+="";a=a.toLowerCase();return'<input type="checkbox" '+(a.search(/(false|0|no|off)/i)<0?" checked='checked' ":"")+' value="'+a+'" offval="no" '+b+"/>"};c.fn.fmatter.link=function(a,b){var d={target:b.target},e="";isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(d.target)e="target="+d.target;return isEmpty(a)?c.fn.fmatter.defaultFormat(a,b):"<a "+e+' href="'+a+'">'+a+"</a>"};c.fn.fmatter.showlink=function(a,b){var d={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,
148
- addParam:b.addParam||"",target:b.target,idName:b.idName},e="";isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(d.target)e="target="+d.target;d=d.baseLinkUrl+d.showAction+"?"+d.idName+"="+b.rowId+d.addParam;return isString(a)?"<a "+e+' href="'+d+'">'+a+"</a>":c.fn.fmatter.defaultFormat(a,b)};c.fn.fmatter.integer=function(a,b){var d=c.extend({},b.integer);isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(isEmpty(a))return d.defaultValue;
149
- return c.fmatter.util.NumberFormat(a,d)};c.fn.fmatter.number=function(a,b){var d=c.extend({},b.number);isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(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);isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));if(isEmpty(a))return d.defaultValue;return c.fmatter.util.NumberFormat(a,d)};c.fn.fmatter.date=
150
- function(a,b,d,e){d=c.extend({},b.date);isUndefined(b.colModel.formatoptions)||(d=c.extend({},d,b.colModel.formatoptions));return!d.reformatAfterEdit&&e=="edit"?c.fn.fmatter.defaultFormat(a,b):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,e=[];if(!isUndefined(b.colModel.editoptions))d=b.colModel.editoptions.value;if(d){var g=b.colModel.editoptions.multiple===true?true:false,h=[],f;if(g){h=a.split(",");
151
- h=c.map(h,function(l){return c.trim(l)})}if(isString(d))for(var i=d.split(";"),k=0,j=0;j<i.length;j++){f=i[j].split(":");if(f.length>2)f[1]=jQuery.map(f,function(l,o){if(o>0)return l}).join(":");if(g){if(jQuery.inArray(f[0],h)>-1){e[k]=f[1];k++}}else if(c.trim(f[0])==c.trim(a)){e[0]=f[1];break}}else if(isObject(d))if(g)e=jQuery.map(h,function(l){return d[l]});else e[0]=d[a]||""}a=e.join(", ");return a==""?c.fn.fmatter.defaultFormat(a,b):a};c.fn.fmatter.rowactions=function(a,b,d,e){switch(d){case "edit":d=
152
- function(){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()};c("#"+b).jqGrid("editRow",a,e,null,null,null,{oper:"edit"},d,null,d);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,null,null);c("tr#"+a+" div.ui-inline-edit, tr#"+a+" div.ui-inline-del","#"+
153
- 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);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}};c.fn.fmatter.actions=function(a,b){a={keys:false,editbutton:true,delbutton:true};isUndefined(b.colModel.formatoptions)||(a=c.extend(a,b.colModel.formatoptions));var d=b.rowId,e="",g;if(typeof d=="undefined"||
154
- isEmpty(d))return"";if(a.editbutton){g="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+"','edit',"+a.keys+");";e=e+"<div style='margin-left:8px;'><div title='"+c.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+g+"><span class='ui-icon ui-icon-pencil'></span></div>"}if(a.delbutton){g="onclick=jQuery('#"+b.gid+"').jqGrid('delGridRow','"+d+"');";e=e+"<div title='"+c.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+
155
- g+"><span class='ui-icon ui-icon-trash'></span></div>"}g="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+"','save',false);";e=e+"<div title='"+c.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save'><span class='ui-icon ui-icon-disk' "+g+"></span></div>";g="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+"','cancel',false);";return e=e+"<div title='"+c.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel'><span class='ui-icon ui-icon-cancel' "+
156
- g+"></span></div></div>"};c.unformat=function(a,b,d,e){var g,h=b.colModel.formatter,f=b.colModel.formatoptions||{},i=/([\.\*\_\'\(\)\{\}\+\?\\])/g;unformatFunc=b.colModel.unformat||c.fn.fmatter[h]&&c.fn.fmatter[h].unformat;if(typeof unformatFunc!=="undefined"&&isFunction(unformatFunc))g=unformatFunc(c(a).text(),b,a);else if(typeof h!=="undefined"&&isString(h)){g=c.jgrid.formatter||{};switch(h){case "integer":f=c.extend({},g.integer,f);b=f.thousandsSeparator.replace(i,"\\$1");b=new RegExp(b,"g");g=
157
- c(a).text().replace(b,"");break;case "number":f=c.extend({},g.number,f);b=f.thousandsSeparator.replace(i,"\\$1");b=new RegExp(b,"g");g=c(a).text().replace(b,"").replace(f.decimalSeparator,".");break;case "currency":f=c.extend({},g.currency,f);b=f.thousandsSeparator.replace(i,"\\$1");b=new RegExp(b,"g");g=c(a).text().replace(b,"").replace(f.decimalSeparator,".").replace(f.prefix,"").replace(f.suffix,"");break;case "checkbox":f=b.colModel.editoptions?b.colModel.editoptions.value.split(":"):["Yes","No"];
158
- g=c("input",a).attr("checked")?f[0]:f[1];break;case "select":g=c.unformat.select(a,b,d,e);break;case "actions":return"";default:g=c(a).text()}}return g?g:e===true?c(a).text():c.jgrid.htmlDecode(c(a).html())};c.unformat.select=function(a,b,d,e){d=[];a=c(a).text();if(e===true)return a;b=c.extend({},b.colModel.editoptions);if(b.value){var g=b.value;b=b.multiple===true?true:false;e=[];var h;if(b){e=a.split(",");e=c.map(e,function(j){return c.trim(j)})}if(isString(g))for(var f=g.split(";"),i=0,k=0;k<f.length;k++){h=
159
- f[k].split(":");if(h.length>2)h[1]=jQuery.map(h,function(j,l){if(l>0)return j}).join(":");if(b){if(jQuery.inArray(h[1],e)>-1){d[i]=h[0];i++}}else if(c.trim(h[1])==c.trim(a)){d[0]=h[0];break}}else if(isObject(g)){b||(e[0]=a);d=jQuery.map(e,function(j){var l;c.each(g,function(o,n){if(n==j){l=o;return false}});if(l)return l})}return d.join(", ")}else return a||""};c.unformat.date=function(a,b){var d=c.jgrid.formatter.date||{};isUndefined(b.formatoptions)||(d=c.extend({},d,b.formatoptions));return isEmpty(a)?
160
- c.fn.fmatter.defaultFormat(a,b):c.fmatter.util.DateFormat(d.newformat,a,d.srcformat,d)};isValue=function(a){return isObject(a)||isString(a)||isNumber(a)||isBoolean(a)};isBoolean=function(a){return typeof a==="boolean"};isNull=function(a){return a===null};isNumber=function(a){return typeof a==="number"&&isFinite(a)};isString=function(a){return typeof a==="string"};isEmpty=function(a){if(!isString(a)&&isValue(a))return false;else if(!isValue(a))return true;a=c.trim(a).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,
161
- "");return a===""};isUndefined=function(a){return typeof a==="undefined"};isObject=function(a){return a&&(typeof a==="object"||isFunction(a))||false};isFunction=function(a){return typeof a==="function"}})(jQuery);
162
- (function(a){a.jgrid.extend({getColProp:function(g){var d={},b=this[0];if(b.grid){b=b.p.colModel;for(var n=0;n<b.length;n++)if(b[n].name==g){d=b[n];break}return d}},setColProp:function(g,d){return this.each(function(){if(this.grid)if(d)for(var b=this.p.colModel,n=0;n<b.length;n++)if(b[n].name==g){a.extend(this.p.colModel[n],d);break}})},sortGrid:function(g,d,b){return this.each(function(){var n=this,s=-1;if(n.grid){if(!g)g=n.p.sortname;for(var q=0;q<n.p.colModel.length;q++)if(n.p.colModel[q].index==
163
- g||n.p.colModel[q].name==g){s=q;break}if(s!=-1){q=n.p.colModel[s].sortable;if(typeof q!=="boolean")q=true;if(typeof d!=="boolean")d=false;q&&n.sortData("jqgh_"+g,s,d,b)}}})},GridDestroy:function(){return this.each(function(){if(this.grid){this.p.pager&&a(this.p.pager).remove();var g=this.id;try{a("#gbox_"+g).remove()}catch(d){}}})},GridUnload:function(){return this.each(function(){if(this.grid){var g={id:a(this).attr("id"),cl:a(this).attr("class")};this.p.pager&&a(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom");
164
- var d=document.createElement("table");a(d).attr({id:g.id});d.className=g.cl;g=this.id;a(d).removeClass("ui-jqgrid-btable");if(a(this.p.pager).parents("#gbox_"+g).length===1){a(d).insertBefore("#gbox_"+g).show();a(this.p.pager).insertBefore("#gbox_"+g)}else a(d).insertBefore("#gbox_"+g).show();a("#gbox_"+g).remove()}})},setGridState:function(g){return this.each(function(){if(this.grid){var d=this;if(g=="hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+d.p.id).slideUp("fast");d.p.pager&&a(d.p.pager).slideUp("fast");
165
- d.p.toppager&&a(d.p.toppager).slideUp("fast");if(d.p.toolbar[0]===true){d.p.toolbar[1]=="both"&&a(d.grid.ubDiv).slideUp("fast");a(d.grid.uDiv).slideUp("fast")}d.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+d.p.id).slideUp("fast");a(".ui-jqgrid-titlebar-close span",d.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");d.p.gridstate="hidden"}else if(g=="visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+d.p.id).slideDown("fast");d.p.pager&&a(d.p.pager).slideDown("fast");
166
- d.p.toppager&&a(d.p.toppager).slideDown("fast");if(d.p.toolbar[0]===true){d.p.toolbar[1]=="both"&&a(d.grid.ubDiv).slideDown("fast");a(d.grid.uDiv).slideDown("fast")}d.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+d.p.id).slideDown("fast");a(".ui-jqgrid-titlebar-close span",d.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");d.p.gridstate="visible"}}})},updateGridRows:function(g,d,b){var n,s=false,q;this.each(function(){var h=this,l,o,c,f;if(!h.grid)return false;
167
- d||(d="id");g&&g.length>0&&a(g).each(function(){c=this;if(o=h.rows.namedItem(c[d])){f=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<c.length;e++){l=h.formatter(f,c[e],e,c,"edit");q=h.p.colModel[e].title?{title:a.jgrid.stripHtml(l)}:{};h.p.treeGrid===true&&n==h.p.ExpandColumn?a("td:eq("+e+") > span:first",o).html(l).attr(q):a("td:eq("+e+")",o).html(l).attr(q)}return s=true}a(h.p.colModel).each(function(m){n=b===true?this.jsonmap||
168
- this.name:this.name;if(c[n]!==undefined){l=h.formatter(f,c[n],m,c,"edit");q=this.title?{title:a.jgrid.stripHtml(l)}:{};h.p.treeGrid===true&&n==h.p.ExpandColumn?a("td:eq("+m+") > span:first",o).html(l).attr(q):a("td:eq("+m+")",o).html(l).attr(q);s=true}})}})});return s},filterGrid:function(g,d){d=a.extend({gridModel:false,gridNames:false,gridToolbar:false,filterModel:[],formtype:"horizontal",autosearch:true,formclass:"filterform",tableclass:"filtertable",buttonclass:"filterbutton",searchButton:"Search",
169
- 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(g){this.p.gridid=g.indexOf("#")!=-1?g:"#"+g;var n=a(this.p.gridid).jqGrid("getGridParam","colModel");if(n){if(this.p.gridModel===true){var s=a(this.p.gridid)[0],q;a.each(n,function(f){var e=[];this.search=
170
- 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?s.p.colNames[f]:"";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 f=0;f<n.length;f++)if(this.name==
171
- n[f].name){this.index=n[f].index||this.name;break}if(!this.index)this.index=this.name});var h=function(){var f={},e=0,m,i=a(b.p.gridid)[0],k;i.p.searchdata={};a.isFunction(b.p.beforeSearch)&&b.p.beforeSearch();a.each(b.p.filterModel,function(){k=this.index;switch(this.stype){case "select":if(m=a("select[name="+k+"]",b).val()){f[k]=m;b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).addClass("dirty-cell");e++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(r){}}break;
172
- default:if(m=a("input[name="+k+"]",b).val()){f[k]=m;b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).addClass("dirty-cell");e++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(u){}}}});var p=e>0?true:false;a.extend(i.p.postData,f);var j;if(b.p.url){j=a(i).jqGrid("getGridParam","url");a(i).jqGrid("setGridParam",{url:b.p.url})}a(i).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",[{page:1}]);j&&a(i).jqGrid("setGridParam",
173
- {url:j});a.isFunction(b.p.afterSearch)&&b.p.afterSearch()},l=function(){var f={},e,m=0,i=a(b.p.gridid)[0],k;a.isFunction(b.p.beforeClear)&&b.p.beforeClear();a.each(b.p.filterModel,function(){k=this.index;e=this.defval?this.defval:"";if(!this.stype)this.stype="text";switch(this.stype){case "select":var r;a("select[name="+k+"] 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){f[k]=r;b.p.marksearched&&a("#jqgh_"+this.name,
174
- i.grid.hDiv).addClass("dirty-cell");m++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(u){}}break;case "text":a("input[name="+k+"]",b).val(e);if(e){f[k]=e;b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).addClass("dirty-cell");m++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(t){}}break}});var p=m>0?true:false;a.extend(i.p.postData,f);var j;
175
- if(b.p.url){j=a(i).jqGrid("getGridParam","url");a(i).jqGrid("setGridParam",{url:b.p.url})}a(i).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",[{page:1}]);j&&a(i).jqGrid("setGridParam",{url:j});a.isFunction(b.p.afterClear)&&b.p.afterClear()},o=a("<form name='SearchForm' style=display:inline;' class='"+this.p.formclass+"'></form>"),c=a("<table class='"+this.p.tableclass+"' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");a(o).append(c);(function(){var f=document.createElement("tr"),
176
- e,m,i,k;b.p.formtype=="horizontal"&&a(c).append(f);a.each(b.p.filterModel,function(p){i=document.createElement("td");a(i).append("<label for='"+this.name+"'>"+this.label+"</label>");k=document.createElement("td");var j=this;if(!this.stype)this.stype="text";switch(this.stype){case "select":if(this.surl)a(k).load(this.surl,function(){j.defval&&a("select",this).val(j.defval);a("select",this).attr({name:j.index||j.name,id:"sg_"+j.name});j.sopt&&a("select",this).attr(j.sopt);b.p.gridToolbar===true&&j.width&&
177
- a("select",this).width(j.width);b.p.autosearch===true&&a("select",this).change(function(){h();return false})});else if(j.sopt.value){var r=j.sopt.value,u=document.createElement("select");a(u).attr({name:j.index||j.name,id:"sg_"+j.name}).attr(j.sopt);var t;if(typeof r==="string"){p=r.split(";");for(var v=0;v<p.length;v++){r=p[v].split(":");t=document.createElement("option");t.value=r[0];t.innerHTML=r[1];if(r[1]==j.defval)t.selected="selected";u.appendChild(t)}}else if(typeof r==="object")for(v in r)if(r.hasOwnProperty(v)){p++;
178
- t=document.createElement("option");t.value=v;t.innerHTML=r[v];if(r[v]==j.defval)t.selected="selected";u.appendChild(t)}b.p.gridToolbar===true&&j.width&&a(u).width(j.width);a(k).append(u);b.p.autosearch===true&&a(u).change(function(){h();return false})}break;case "text":u=this.defval?this.defval:"";a(k).append("<input type='text' name='"+(this.index||this.name)+"' id='sg_"+this.name+"' value='"+u+"'/>");j.sopt&&a("input",k).attr(j.sopt);if(b.p.gridToolbar===true&&j.width)a.browser.msie?a("input",k).width(j.width-
179
- 4):a("input",k).width(j.width-2);b.p.autosearch===true&&a("input",k).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(f).append(k):a(f).append(i).append(k);a(f).append(k)}else{e=document.createElement("tr");a(e).append(i).append(k);a(c).append(e)}});k=document.createElement("td");if(b.p.enableSearch===true){m="<input type='button' id='sButton' class='"+b.p.buttonclass+
180
- "' value='"+b.p.searchButton+"'/>";a(k).append(m);a("input#sButton",k).click(function(){h();return false})}if(b.p.enableClear===true){m="<input type='button' id='cButton' class='"+b.p.buttonclass+"' value='"+b.p.clearButton+"'/>";a(k).append(m);a("input#cButton",k).click(function(){l();return false})}if(b.p.enableClear===true||b.p.enableSearch===true)if(b.p.formtype=="horizontal")a(f).append(k);else{e=document.createElement("tr");a(e).append("<td>&#160;</td>").append(k);a(c).append(e)}})();a(this).append(o);
181
- this.triggerSearch=h;this.clearSearch=l}else alert("Could not get grid colModel")}else alert("No target grid is set!")})},filterToolbar:function(g){g=a.extend({autosearch:true,searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND"},g||{});return this.each(function(){function d(h,l){var o=a(h);o[0]&&jQuery.each(l,function(){this.data!==undefined?o.bind(this.type,this.data,this.fn):o.bind(this.type,this.fn)})}var b=this,n=
182
- function(){var h={},l=0,o,c,f={};a.each(b.p.colModel,function(){c=this.index||this.name;var j=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:"bw";switch(this.stype){case "select":if(o=a("select[name="+c+"]",b.grid.hDiv).val()){h[c]=o;f[c]=j;l++}else try{delete b.p.postData[c]}catch(r){}break;case "text":if(o=a("input[name="+c+"]",b.grid.hDiv).val()){h[c]=o;f[c]=j;l++}else try{delete b.p.postData[c]}catch(u){}break}});var e=l>0?true:false;if(g.stringResult===true||b.p.datatype==
183
- "local"){var m='{"groupOp":"'+g.groupOp+'","rules":[',i=0;a.each(h,function(j,r){if(i>0)m+=",";m+='{"field":"'+j+'",';m+='"op":"'+f[j]+'",';m+='"data":"'+r+'"}';i++});m+="]}";a.extend(b.p.postData,{filters:m})}else a.extend(b.p.postData,h);var k;if(b.p.searchurl){k=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var p=false;if(a.isFunction(g.beforeSearch))p=g.beforeSearch.call(b);p||a(b).jqGrid("setGridParam",{search:e}).trigger("reloadGrid",[{page:1}]);k&&a(b).jqGrid("setGridParam",{url:k});
184
- a.isFunction(g.afterSearch)&&g.afterSearch()},s=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),q;a.each(b.p.colModel,function(){var h=this,l,o,c,f;o=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+b.p.direction+"'></th>");l=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");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({},
185
- this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(f=this.surl||c.dataUrl)a.ajax(a.extend({url:f,dataType:"html",complete:function(p){if(c.buildSelect!==undefined)(p=c.buildSelect(p))&&a(l).append(p);else a(l).append(p.responseText);c.defaultValue&&a("select",l).val(c.defaultValue);a("select",l).attr({name:h.index||h.name,id:"gs_"+h.name});c.attr&&a("select",l).attr(c.attr);a("select",l).css({width:"100%"});c.dataInit!==undefined&&c.dataInit(a("select",l)[0]);c.dataEvents!==
186
- undefined&&d(a("select",l)[0],c.dataEvents);g.autosearch===true&&a("select",l).change(function(){n();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){f=document.createElement("select");f.style.width="100%";a(f).attr({name:h.index||h.name,id:"gs_"+h.name});var m,i;if(typeof e==="string"){e=e.split(";");for(var k=0;k<e.length;k++){m=
187
- e[k].split(":");i=document.createElement("option");i.value=m[0];i.innerHTML=m[1];f.appendChild(i)}}else if(typeof e==="object")for(m in e)if(e.hasOwnProperty(m)){i=document.createElement("option");i.value=m;i.innerHTML=e[m];f.appendChild(i)}c.defaultValue&&a(f).val(c.defaultValue);c.attr&&a(f).attr(c.attr);c.dataInit!==undefined&&c.dataInit(f);c.dataEvents!==undefined&&d(f,c.dataEvents);a(l).append(f);g.autosearch===true&&a(f).change(function(){n();return false})}}break;case "text":f=c.defaultValue?
188
- c.defaultValue:"";a(l).append("<input type='text' style='width:95%;padding:0px;' name='"+(h.index||h.name)+"' id='gs_"+h.name+"' value='"+f+"'/>");c.attr&&a("input",l).attr(c.attr);c.dataInit!==undefined&&c.dataInit(a("input",l)[0]);c.dataEvents!==undefined&&d(a("input",l)[0],c.dataEvents);if(g.autosearch===true)g.searchOnEnter?a("input",l).keypress(function(p){if((p.charCode?p.charCode:p.keyCode?p.keyCode:0)==13){n();return false}return this}):a("input",l).keydown(function(p){switch(p.which){case 13:return false;
189
- case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:q&&clearTimeout(q);q=setTimeout(function(){n()},500)}});break}a(o).append(l);a(s).append(o)});a("table thead",b.grid.hDiv).append(s);this.triggerToolbar=n;this.clearToolbar=function(h){var l={},o,c=0,f;h=typeof h!="boolean"?true:h;a.each(b.p.colModel,function(){o=this.searchoptions&&this.searchoptions.defaultValue?this.searchoptions.defaultValue:"";f=this.index||this.name;switch(this.stype){case "select":var j;a("select[name="+f+
190
- "] option",b.grid.hDiv).each(function(t){if(t===0)this.selected=true;if(a(this).text()==o){this.selected=true;j=a(this).val();return false}});if(j){l[f]=j;c++}else try{delete b.p.postData[f]}catch(r){}break;case "text":a("input[name="+f+"]",b.grid.hDiv).val(o);if(o){l[f]=o;c++}else try{delete b.p.postData[f]}catch(u){}break}});var e=c>0?true:false;if(g.stringResult===true||b.p.datatype=="local"){var m='{"groupOp":"'+g.groupOp+'","rules":[',i=0;a.each(l,function(j,r){if(i>0)m+=",";m+='{"field":"'+
191
- j+'",';m+='"op":"eq",';m+='"data":"'+r+'"}';i++});m+="]}";a.extend(b.p.postData,{filters:m})}else a.extend(b.p.postData,l);var k;if(b.p.searchurl){k=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var p=false;if(a.isFunction(g.beforeClear))p=g.beforeClear.call(b);p||h&&a(b).jqGrid("setGridParam",{search:e}).trigger("reloadGrid",[{page:1}]);k&&a(b).jqGrid("setGridParam",{url:k});a.isFunction(g.afterClear)&&g.afterClear()};this.toggleToolbar=function(){var h=a("tr.ui-search-toolbar",b.grid.hDiv);
10
+ (function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{htmlDecode:function(f){if(f=="&nbsp;"||f=="&#160;"||f.length==1&&f.charCodeAt(0)==160)return"";return!f?f:String(f).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(f){return!f?f:String(f).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(f){var j=b.makeArray(arguments).slice(1);if(f===undefined)f="";return f.replace(/\{(\d+)\}/g,function(i,
11
+ c){return j[c]})},getCellIndex:function(f){f=b(f);if(f.is("tr"))return-1;f=(!f.is("td")&&!f.is("th")?f.closest("td,th"):f)[0];if(b.browser.msie)return b.inArray(f,f.parentNode.cells);return f.cellIndex},stripHtml:function(f){f+="";var j=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(f)return(f=f.replace(j,""))&&f!=="&nbsp;"&&f!=="&#160;"?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");
12
+ 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-]/);
13
+ 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;c<e;c++){if(f[c]=="M"){k=b.inArray(j[c],n);if(k!==-1&&k<12)j[c]=k+1}if(f[c]=="F"){k=b.inArray(j[c],n);if(k!==-1&&k>11)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()]=
14
+ 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=
15
+ 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()":
16
+ ""};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===
17
+ 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(l<m)return-q;if(l>m)return q;return 0};this._performSort=
18
+ 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;A<l.length;A++){u=c._doSort(l[A].items,m);for(I=0;I<u.length;I++)q.push(u[I])}return q};this._getOrder=function(l,m,q,A,u){var I=[],U=[],$=q=="a"?1:-1,P,aa;if(A===undefined)A="text";aa=A=="float"||A=="number"||A=="currency"||A=="numeric"?function(L){L=parseFloat(String(L).replace(r,""));
19
+ return isNaN(L)?0:L}:A=="int"||A=="integer"?function(L){return L?parseFloat(String(L).replace(r,"")):0}:A=="date"||A=="datetime"?function(L){return b.jgrid.parseDate(u,L).getTime()}:b.isFunction(A)?A:function(L){L||(L="");return b.trim(String(L).toUpperCase())};b.each(l,function(L,da){P=m!==""?b.jgrid.getAccessor(da,m):da;if(P===undefined)P="";P=aa(P,da);U.push({vSort:P,index:L})});U.sort(function(L,da){L=L.vSort;da=da.vSort;return c._compare(L,da,$)});A=0;for(var ea=l.length;A<ea;){q=U[A].index;
20
+ I.push(l[q]);A++}return I};this._getGroup=function(l,m,q,A,u){var I=[],U=null,$=null,P;b.each(c._getOrder(l,m,q,A,u),function(aa,ea){P=b.jgrid.getAccessor(ea,m);if(P===undefined)P="";if(!c._equals($,P)){$=P;U!=null&&I.push(U);U=c._group(m,P)}U.items.push(ea)});U!=null&&I.push(U);return I};this.ignoreCase=function(){k=false;return c};this.useCase=function(){k=true;return c};this.trim=function(){n=true;return c};this.noTrim=function(){n=false;return c};this.combine=function(l){var m=b.from(e);k||m.ignoreCase();
21
+ n&&m.trim();l=l(m).showQuery();c._append(l);return c};this.execute=function(){var l=a,m=[];if(l===null)return c;b.each(e,function(){eval(l)&&m.push(this)});e=m;return c};this.data=function(){return e};this.select=function(l){c._performSort();if(!c._hasData())return[];c.execute();if(b.isFunction(l)){var m=[];b.each(e,function(q,A){m.push(l(A))});return m}return e};this.hasMatch=function(){if(!c._hasData())return false;c.execute();return e.length>0};this.showQuery=function(l){var m=a;if(m===null)m=
22
+ "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();
23
+ 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("'+
24
+ 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,
25
+ 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||
26
+ 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("'+
27
+ 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,
28
+ 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:[],
29
+ 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,
30
+ 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,
31
+ 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:[],
32
+ 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],
33
+ 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===
34
+ "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+
35
+ 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=
36
+ 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<d&&x<=0&&(c.lastpage===
37
+ undefined||parseInt((w+p+h-1)/h,10)<=c.lastpage)){G=parseInt((d-w+h-1)/h,10);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=
38
+ 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<o.length;w++)o[w]!=h&&b(d).jqGrid("setSelection",o[w],
39
+ false);h&&b(d).jqGrid("setSelection",h,false);d.grid.bDiv.scrollLeft=p;g.gridComplete=x;g.gridComplete&&x()}}};if(this.tagName!="TABLE")alert("Element is not a table");else{b(this).empty();this.p=c;var k,n,a,r;if(this.p.colNames.length===0)for(k=0;k<this.p.colModel.length;k++)this.p.colNames[k]=this.p.colModel[k].label||this.p.colModel[k].name;if(this.p.colNames.length!==this.p.colModel.length)alert(b.jgrid.errors.model);else{var t=b("<div class='ui-jqgrid-view'></div>"),B,F=b.browser.msie?true:false,
40
+ 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("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");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?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':
41
+ "";b("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").append(B).insertBefore(t);b("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").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="',
42
+ 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===""?"&#160;":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};
43
+ 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'<td role="gridcell" '+l(h,o,d)+">"+d+"</td>"},u=function(d,g,h){d='<input role="checkbox" type="checkbox" id="jqg_'+a.p.id+"_"+d+'" class="cbox" name="jqg_'+a.p.id+"_"+d+'"/>';return'<td role="gridcell" '+l(g,h,"")+">"+d+"</td>"},I=function(d,g,h,o){h=(parseInt(h,10)-1)*parseInt(o,10)+1+g;return'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+
44
+ l(d,g,"")+">"+h+"</td>"},U=function(d){var g,h=[],o=0,p;for(p=0;p<a.p.colModel.length;p++){g=a.p.colModel[p];if(g.name!=="cb"&&g.name!=="subgrid"&&g.name!=="rn"){h[o]=d=="local"?g.name:d=="xml"?g.xmlmap||g.name:g.jsonmap||g.name;o++}}return h},$=function(d){var g=a.p.remapColumns;if(!g||!g.length)g=b.map(a.p.colModel,function(h,o){return o});if(d)g=b.map(g,function(h){return h<d?null:h-d});return g},P=function(d,g){if(a.p.deepempty)b("#"+a.p.id+" tbody:first tr:gt(0)").remove();else{var h=b("#"+a.p.id+
45
+ " tbody:first tr:first")[0];b("#"+a.p.id+" tbody:first").empty().append(h)}if(g&&a.p.scroll){b(">div: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;h<d;h++){o=b.jgrid.getAccessor(a.p.data[h],g);a.p._index[o]=h}},ea=
46
+ function(d,g,h,o,p){var x=new Date,w=a.p.datatype!="local"&&a.p.loadonce||a.p.datatype=="xmlstring",C,G=a.p.datatype=="local"?"local":"xml";if(w){a.p.data=[];a.p._index={};a.p.localReader.id=C="_id_"}a.p.reccount=0;if(b.isXMLDoc(d)){if(a.p.treeANode===-1&&!a.p.scroll){P(g,false);h=1}else h=h>1?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&&
47
+ 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,
48
+ 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<fa;){O=
49
+ d[Z];M=G(O,qa+Z);s=h===0?0:h+1;s=(s+Z)%2==1?na:"";X.push("<tr"+xa+' id="'+M+'" role="row" class ="ui-widget-content jqgrow ui-row-'+a.p.direction+""+s+'">');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+
50
+ K+H+E].name]=y;X.push(A(M,y,ca+K+H+E,Z+h,O))})}else for(s=0;s<z.length;s++){y=b(z[s],O).text();T[a.p.colModel[s+K+H+E].name]=y;X.push(A(M,y,s+K+H+E,Z+h,O))}X.push("</tr>");if(a.p.grouping){s=a.p.groupingView.groupField.length;D=[];for(var ya=0;ya<s;ya++)D.push(T[a.p.groupingView.groupField[ya]]);ha=b(a).jqGrid("groupingPrepare",X,D,ha,T);X=[]}if(w){T[C]=M;a.p.data.push(T)}if(a.p.gridview===false){if(a.p.treeGrid===true){s=a.p.treeANode>-1?a.p.treeANode:0;D=b(X.join(""))[0];b(a.rows[Z+s]).after(D);
51
+ 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=
52
+ 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(;v<fa;){O=d[v];M=G(O,v);if(a.p.xmlReader.repeatitems){W||(W=$(K+H+E));var Ea=b(a.p.xmlReader.cell,O);b.each(W,function(ca){var Y=Ea[this];if(!Y)return false;y=Y.textContent||Y.text;T[a.p.colModel[ca+K+H+E].name]=y})}else for(s=0;s<z.length;s++){y=b(z[s],O).text();T[a.p.colModel[s+K+H+E].name]=y}T[C]=M;a.p.data.push(T);
53
+ T={};v++}aa()}}},L=function(d,g,h,o,p){var x=new Date;if(d){if(a.p.treeANode===-1&&!a.p.scroll){P(g,false);h=1}else h=h>1?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,
54
+ 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),
55
+ ga={},qa="";if(a.p.grouping&&a.p.groupingView.groupCollapse===true)qa=' style="display:none;"';for(;d<W;){p=T[d];M=b.jgrid.getAccessor(p,C);if(M===undefined){M=fa+d;if(K.length===0)if(g.cell)M=p[g.cell][C]||M}v=h===1?0:h;v=(v+d)%2==1?X:"";D.push("<tr"+qa+' id="'+M+'" role="row" class= "ui-widget-content jqgrow ui-row-'+a.p.direction+""+v+'">');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",
56
+ 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<H.length;y++){v=b.jgrid.getAccessor(p,H[y]);D.push(A(M,v,y+E+Q+z,d+h,p));O[a.p.colModel[y+E+Q+z].name]=v}D.push("</tr>");if(a.p.grouping){v=a.p.groupingView.groupField.length;y=[];for(var ha=0;ha<v;ha++)y.push(O[a.p.groupingView.groupField[ha]]);ga=b(a).jqGrid("groupingPrepare",D,y,ga,O);D=[]}if(G){O[w]=M;a.p.data.push(O)}if(a.p.gridview===false){if(a.p.treeGrid===true){v=a.p.treeANode>-1?a.p.treeANode:
57
+ 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=
58
+ 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(;s<W;){p=T[s];M=b.jgrid.getAccessor(p,C);if(M===undefined){M=fa+s;if(K.length===0)if(g.cell)M=p[g.cell][C]||M}if(p){if(g.repeatitems){if(g.cell)p=b.jgrid.getAccessor(p,g.cell);H||(H=$(E+Q+z))}for(y=0;y<H.length;y++){v=b.jgrid.getAccessor(p,H[y]);O[a.p.colModel[y+
59
+ E+Q+z].name]=v}O[w]=M;a.p.data.push(O);O={}}s++}aa()}}},da=function(){var d,g=false,h=[],o=[],p=[],x,w,C;if(b.isArray(a.p.data)){var G=a.p.grouping?a.p.groupingView:false;b.each(a.p.colModel,function(){w=this.sorttype||"text";if(w=="date"||w=="datetime"){if(this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"){x=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat:b.jgrid.formatter.date.srcformat;C=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:
60
+ b.jgrid.formatter.date.newformat}else x=C=this.datefmt||"Y-m-d";h[this.name]={stype:w,srcfmt:x,newfmt:C}}else h[this.name]={stype:w,srcfmt:"",newfmt:""};if(a.p.grouping&&this.name==G.groupField[0]){var z=this.name;if(typeof this.index!="undefined")z=this.index;o[0]=h[z];p.push(z)}if(!g&&(this.index==a.p.sortname||this.name==a.p.sortname)){d=this.name;g=true}});if(a.p.treeGrid)b(a).jqGrid("SortTree",d,a.p.sortorder,h[d].stype,h[d].srcfmt);else{var s={eq:function(z){return z.equals},ne:function(z){return z.not().equals},
61
+ lt:function(z){return z.less},le:function(z){return z.lessOrEquals},gt:function(z){return z.greater},ge:function(z){return z.greaterOrEquals},cn:function(z){return z.contains},nc:function(z){return z.not().contains},bw:function(z){return z.startsWith},bn:function(z){return z.not().startsWith},en:function(z){return z.not().endsWith},ew:function(z){return z.endsWith},ni:function(z){return z.not().equals},"in":function(z){return z.equals}},v=b.jgrid.from(a.p.data);if(a.p.ignoreCase)v=v.ignoreCase();
62
+ if(a.p.search===true){var y=a.p.postData.filters,D;if(y){if(typeof y=="string")y=b.jgrid.parse(y);for(var K=0,H=y.rules.length,E;K<H;K++){E=y.rules[K];D=y.groupOp;if(s[E.op]&&E.field&&E.data&&D)v=D.toUpperCase()=="OR"?s[E.op](v)(E.field,E.data,h[E.field]).or():s[E.op](v)(E.field,E.data,h[E.field])}}else try{v=s[a.p.postData.searchOper](v)(a.p.postData.searchField,a.p.postData.searchString,h[a.p.postData.searchField])}catch(Q){}}if(a.p.grouping){v.orderBy(p,G.groupOrder[0],o[0].stype,o[0].srcfmt);
63
+ G.groupDataSorted=true}if(d&&a.p.sortorder&&g)a.p.sortorder.toUpperCase()=="DESC"?v.orderBy(a.p.sortname,"d",h[d].stype,h[d].srcfmt):v.orderBy(a.p.sortname,"a",h[d].stype,h[d].srcfmt);s=v.select();v=parseInt(a.p.rowNum,10);y=s.length;D=parseInt(a.p.page,10);K=Math.ceil(y/v);H={};s=s.slice((D-1)*v,D*v);h=v=null;H[a.p.localReader.total]=K;H[a.p.localReader.page]=D;H[a.p.localReader.records]=y;H[a.p.localReader.root]=s;s=null;return H}}},ra=function(){a.grid.hDiv.loading=true;if(!a.p.hiddengrid)switch(a.p.loadui){case "disable":break;
64
+ case "enable":b("#load_"+a.p.id).show();break;case "block":b("#lui_"+a.p.id).show();b("#load_"+a.p.id).show();break}},oa=function(){a.grid.hDiv.loading=false;switch(a.p.loadui){case "disable":break;case "enable":b("#load_"+a.p.id).hide();break;case "block":b("#lui_"+a.p.id).hide();b("#load_"+a.p.id).hide();break}},ia=function(d){if(!a.grid.hDiv.loading){var g=a.p.scroll&&d===false,h={},o,p=a.p.prmNames;if(a.p.page<=0)a.p.page=1;if(p.search!==null)h[p.search]=a.p.search;if(p.nd!==null)h[p.nd]=(new Date).getTime();
65
+ if(p.rows!==null)h[p.rows]=a.p.rowNum;if(p.page!==null)h[p.page]=a.p.page;if(p.sort!==null)h[p.sort]=a.p.sortname;if(p.order!==null)h[p.order]=a.p.sortorder;if(a.p.rowTotal!==null&&p.totalrows!==null)h[p.totalrows]=a.p.rowTotal;var x=a.p.loadComplete,w=b.isFunction(x);w||(x=null);var C=0;d=d||1;if(d>1)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");
66
+ 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)?
67
+ 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);
68
+ 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="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",
69
+ 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("<div id='"+x+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+
70
+ w+"' align='left'></td><td id='"+C+"' align='center' style='white-space:pre;'></td><td id='"+G+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(a.p.rowList.length>0){p="<td dir='"+n+"'>";p+="<select class='ui-pg-selbox' role='listbox'>";for(w=0;w<a.p.rowList.length;w++)p+='<option role="option" value="'+a.p.rowList[w]+'"'+(a.p.rowNum==a.p.rowList[w]?' selected="selected"':"")+">"+a.p.rowList[w]+"</option>";p+="</select></td>"}if(n=="rtl")o+=p;if(a.p.pginput===true)h="<td dir='"+
71
+ n+"'>"+b.jgrid.format(a.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1'></span>")+"</td>";if(a.p.pgbuttons===true){w=["first"+g,"prev"+g,"next"+g,"last"+g];n=="rtl"&&w.reverse();o+="<td id='"+w[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";o+="<td id='"+w[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";o+=h!==""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+
72
+ h+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":"";o+="<td id='"+w[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";o+="<td id='"+w[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else if(h!=="")o+=h;if(n=="ltr")o+=p;o+="</tr></tbody></table>";a.p.viewrecords===true&&b("td#"+d+"_"+a.p.recordpos,"#"+x).append("<div dir='"+n+"' style='text-align:"+a.p.recordpos+
73
+ "' class='ui-paging-info'></div>");b("td#"+d+"_"+a.p.pagerpos,"#"+x).append(o);p=b(".ui-jqgrid").css("font-size")||"11px";b(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+p+";visibility:hidden;' ></div>");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",
74
+ "#"+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");
75
+ 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&&v<y))if(v===y)Q=E=false}else if(y>1&&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;
76
+ 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||
77
+ "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",
78
+ 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=
79
+ 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<a.p.colModel.length;h++)if(a.p.colModel[h].hidden!==true){g=h;break}return g-d},Ga=function(d){var g,h={},o=S?0:a.p.cellLayout;for(g=h[0]=h[1]=h[2]=0;g<=d;g++)if(a.p.colModel[g].hidden===false)h[0]+=a.p.colModel[g].width+o;if(a.p.direction=="rtl")h[0]=a.p.width-h[0];h[0]-=a.grid.bDiv.scrollLeft;
80
+ if(b(a.grid.cDiv).is(":visible"))h[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"))h[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)h[1]+=b(a.grid.topDiv).height()+parseInt(b(a.grid.topDiv).css("border-bottom-width"),10);h[2]+=b(a.grid.bDiv).height()+
81
+ b(a.grid.hDiv).height();return h};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<a.p.colModel.length;k++){r=a.p.colModel[k];r=b.extend(r,a.p.cmTemplate,r.template||{});if(a.p.keyIndex===false&&a.p.colModel[k].key===true)a.p.keyIndex=k}a.p.sortorder=a.p.sortorder.toLowerCase();if(a.p.grouping===true){a.p.scroll=false;a.p.rownumbers=false;a.p.subGrid=false;a.p.treeGrid=false;a.p.gridview=true}if(this.p.treeGrid===true){try{b(this).jqGrid("setTreeGrid")}catch(Ka){}if(a.p.datatype!=
82
+ "local")a.p.localReader={id:"_id_"}}if(this.p.subGrid)try{b(a).jqGrid("setSubGrid")}catch(La){}if(this.p.multiselect){this.p.colNames.unshift("<input role='checkbox' id='cb_"+this.p.id+"' class='cbox' type='checkbox'/>");this.p.colModel.unshift({name:"cb",width: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,
83
+ 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,
84
+ 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="<thead><tr class='ui-jqgrid-labels' role='rowheader'>";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>=
85
+ 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="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+ma+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+n+"'></span>";ma+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+la+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+n+"'></span></span>";for(k=0;k<
86
+ this.p.colNames.length;k++){la=a.p.headertitles?' title="'+b.jgrid.stripHtml(a.p.colNames[k])+'"':"";r+="<th id='"+a.p.id+"_"+a.p.colModel[k].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+n+"'"+la+">";la=a.p.colModel[k].index||a.p.colModel[k].name;r+="<div id='jqgh_"+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(la==
87
+ a.p.sortname)a.p.lastsort=k;r+=ma+"</div></th>"}r+="</tr></thead>";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",
88
+ "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,
89
+ 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,
90
+ 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("<div class='ui-jqgrid-resize-mark' id='rs_m"+a.p.id+"'>&#160;</div>");
91
+ b(t).css("width",e.width+"px");r=b("thead:first",a).get(0);var va="";if(a.p.footerrow)va+="<table role='grid' style='width:"+a.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+n+"'>";t=b("tr:first",r);var wa="<tr class='jqgfirstrow' role='row' style='height:auto'>";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=
92
+ true;if(a.p.colModel[d].resizable){pa=document.createElement("span");b(pa).html("&#160;").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+="<td role='gridcell' style='height:0px;width:"+sa+"px;"+g+"'></td>";e.headers[d]={width:sa,el:this};ta=a.p.colModel[d].sortable;if(typeof ta!==
93
+ "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+="<td role='gridcell' "+l(d,0,"")+
94
+ ">&#160;</td>"}).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",
95
+ 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+="</tr></tbody></table>";wa+="</tr>";this.appendChild(document.createElement("tbody"));b(this).addClass("ui-jqgrid-btable").append(wa);wa=null;t=b("<table class='ui-jqgrid-htable' style='width:"+a.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(r);var ba=a.p.caption&&a.p.hiddengrid===true?true:
96
+ false;k=b("<div class='ui-jqgrid-hbox"+(n=="rtl"?"-rtl":"")+"'></div>");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");
97
+ 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=
98
+ 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&&
99
+ 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,
100
+ 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;
101
+ 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)&&
102
+ 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('<div style="position:relative;'+(F&&b.browser.version<8?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height+
103
+ (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("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){Aa.addClass("ui-state-hover")},
104
+ function(){Aa.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css(n=="rtl"?"left":"right","0px"):"";b(e.cDiv).append(Aa).append("<span class='ui-jqgrid-title"+(n=="rtl"?"-rtl":"")+"'>"+a.p.caption+"</span>").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]==
105
+ "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("<div id='"+
106
+ a.p.toppager+"'></div>")[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("<div class='ui-jqgrid-sdiv'></div>")[0];k=b("<div class='ui-jqgrid-hbox"+(n=="rtl"?"-rtl":"")+"'></div>");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";
107
+ 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",
108
+ 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_"+
109
+ 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});
110
+ 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:
111
+ "";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=
112
+ 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==
113
+ 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");
114
+ 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&&
115
+ 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<i;){if(b(this.rows[j]).hasClass("jqgrow")){f[c]=this.rows[j].id;c++}j++}});return f},setSelection:function(f,j){return this.each(function(){function i(n){var a=b(c.grid.bDiv)[0].clientHeight,r=b(c.grid.bDiv)[0].scrollTop,t=c.rows[n].offsetTop;n=c.rows[n].clientHeight;if(t+n>=a+r)b(c.grid.bDiv)[0].scrollTop=t-(a+r)+n+r;else if(t<a+r)if(t<r)b(c.grid.bDiv)[0].scrollTop=
116
+ t}var c=this,e,k;if(f!==undefined){j=j===false?false:true;if(e=c.rows.namedItem(f+"")){if(c.p.scrollrows===true){k=c.rows.namedItem(f).rowIndex;k>=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!==
117
+ "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",
118
+ "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",
119
+ "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<e;){if(c)r=n.rows[k];if(b(r).hasClass("jqgrow")){b("td",r).each(function(t){a=n.p.colModel[t].name;if(a!=="cb"&&a!=="subgrid"&&a!=="rn")if(n.p.treeGrid===true&&a==n.p.ExpandColumn)j[a]=b.jgrid.htmlDecode(b("span:first",this).html());else try{j[a]=b.unformat(this,{rowId:r.id,
120
+ colModel:n.p.colModel[t]},t)}catch(B){j[a]=b.jgrid.htmlDecode(b(this).html())}});if(c){i.push(j);j={}}}k++}});return i?i:j},delRowData:function(f){var j=false,i,c;this.each(function(){var e=this;if(i=e.rows.namedItem(f)){b(i).remove();e.p.records--;e.p.reccount--;e.updatepager(true,false);j=true;if(e.p.multiselect){c=b.inArray(f,e.p.selarrrow);c!=-1&&e.p.selarrrow.splice(c,1)}if(f==e.p.selrow)e.p.selrow=null}else return false;if(e.p.datatype=="local"){var k=e.p._index[f];if(typeof k!="undefined"){e.p.data.splice(k,
121
+ 1);e.refreshIndex()}}if(e.p.altRows===true&&j){var n=e.p.altclass;b(e.rows).each(function(a){a%2==1?b(this).addClass(n):b(this).removeClass(n)})}});return j},setRowData:function(f,j,i){var c,e=true,k;this.each(function(){if(!this.grid)return false;var n=this,a,r,t=typeof i,B={};r=n.rows.namedItem(f);if(!r)return false;if(j)try{b(this.p.colModel).each(function(J){c=this.name;if(j[c]!==undefined){B[c]=this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"?b.unformat.date(j[c],this):
122
+ j[c];a=n.formatter(f,j[c],J,j,"edit");k=this.title?{title:b.jgrid.stripHtml(a)}:{};n.p.treeGrid===true&&c==n.p.ExpandColumn?b("td:eq("+J+") > 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,
123
+ 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;U<I;){q=j[U];n="";if(N){try{f=q[l]}catch(ea){f=
124
+ u.p.records+1+""}$=u.p.altRows===true?(u.rows.length-1)%2===0?m:"":""}if(t){J=u.formatCol(0,1,"");n+='<td role="gridcell" aria-describedby="'+u.p.id+'_rn" class="ui-state-default jqgrid-rownum" '+J+">0</td>"}if(a){S='<input role="checkbox" type="checkbox" id="jqg_'+u.p.id+"_"+f+'" class="cbox"/>';J=u.formatCol(t,1,"");n+='<td role="gridcell" aria-describedby="'+u.p.id+'_cb" '+J+">"+S+"</td>"}if(r)n+=b(u).jqGrid("addSubGridCell",a+t,1);for(F=a+r+t;F<u.p.colModel.length;F++){A=u.p.colModel[F];k=A.name;
125
+ P[k]=A.formatter&&typeof A.formatter==="string"&&A.formatter=="date"?b.unformat.date(q[k],A):q[k];S=u.formatter(f,b.jgrid.getAccessor(q,k),F,q,"edit");J=u.formatCol(F,1,S);n+='<td role="gridcell" aria-describedby="'+u.p.id+"_"+k+'" '+J+">"+S+"</td>"}n='<tr id="'+f+'" role="row" class="ui-widget-content jqgrow ui-row-'+u.p.direction+" "+$+'">'+n+"</tr>";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-
126
+ 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-
127
+ 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=
128
+ 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,
129
+ 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;
130
+ 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,
131
+ 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,
132
+ 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");
133
+ 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<
134
+ 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+=
135
+ 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",
136
+ 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}});
137
+ 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=
138
+ 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"&&
139
+ 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=
140
+ 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(;t<r;){if(b(n.rows[t]).hasClass("jqgrow")){try{e=b.unformat(b(n.rows[t].cells[a]),{rowId:n.rows[t].id,colModel:n.p.colModel[a]},a)}catch(B){e=b.jgrid.htmlDecode(n.rows[t].cells[a].innerHTML)}if(i)k+=parseFloat(e);else if(j)c.push({id:n.rows[t].id,value:e});else c[t]=e}t++}if(i)switch(i.toLowerCase()){case "sum":c=k;break;case "avg":c=
141
+ k/r;break;case "count":c=r;break}}}}});return c},clearGridData:function(f){return this.each(function(){var j=this;if(j.grid){if(typeof f!="boolean")f=false;if(j.p.deepempty)b("#"+j.p.id+" tbody:first tr:gt(0)").remove();else{var i=b("#"+j.p.id+" tbody:first tr:first")[0];b("#"+j.p.id+" tbody:first").empty().append(i)}j.p.footerrow&&f&&b(".ui-jqgrid-ftable td",j.grid.sDiv).html("&#160;");j.p.selrow=null;j.p.selarrrow=[];j.p.savedRow=[];j.p.records=0;j.p.page=1;j.p.lastpage=0;j.p.reccount=0;j.p.data=
142
+ [];j.p_index={};j.updatepager(true,false)}})},getInd:function(f,j){var i=false,c;this.each(function(){if(c=this.rows.namedItem(f))i=j===true?c:c.rowIndex});return i}})})(jQuery);
143
+ (function(c){c.fmatter={};c.extend(c.fmatter,{isBoolean:function(a){return typeof a==="boolean"},isObject:function(a){return a&&(typeof a==="object"||c.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)&&
144
+ this.isValue(a))return false;else if(!this.isValue(a))return true;a=c.trim(a).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,"");return a===""}});c.fn.fmatter=function(a,b,d,f,e){var i=b;d=c.extend({},c.jgrid.formatter,d);if(c.fn.fmatter[a])i=c.fn.fmatter[a](b,d,f,e);return i};c.fmatter.util={NumberFormat:function(a,b){c.fmatter.isNumber(a)||(a*=1);if(c.fmatter.isNumber(a)){var d=a<0,f=a+"",e=b.decimalSeparator?b.decimalSeparator:".";if(c.fmatter.isNumber(b.decimalPlaces)){var i=b.decimalPlaces;f=
145
+ Math.pow(10,i);f=Math.round(a*f)/f+"";a=f.lastIndexOf(".");if(i>0){if(a<0){f+=e;a=f.length-1}else if(e!==".")f=f.replace(".",e);for(;f.length-1-a<i;)f+="0"}}if(b.thousandsSeparator){i=b.thousandsSeparator;a=f.lastIndexOf(e);a=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}))?)\/$/),
146
+ i=function(m,r){m=String(m);for(r=parseInt(r,10)||2;m.length<r;)m="0"+m;return m},g={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},h=0,j,k=["i18n"];k.i18n={dayNames:f.dayNames,monthNames:f.monthNames};if(a in f.masks)a=f.masks[a];if(b.constructor===Number)h=new Date(b);else if(b.constructor===Date)h=b;else if(e!==null){h=new Date(parseInt(e[1],10));if(e[3]){g=Number(e[5])*60+Number(e[6]);g*=e[4]=="-"?1:-1;g-=h.getTimezoneOffset();h.setTime(Number(Number(h)+g*60*1E3))}}else{b=b.split(/[\\\/:_;.,\t\T\s-]/);a=a.split(/[\\\/:_;.,\t\T\s-]/);
147
+ e=0;for(j=a.length;e<j;e++){if(a[e]=="M"){h=c.inArray(b[e],k.i18n.monthNames);if(h!==-1&&h<12)b[e]=h+1}if(a[e]=="F"){h=c.inArray(b[e],k.i18n.monthNames);if(h!==-1&&h>11)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"&#160;";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=
148
+ 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<
149
+ 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)})}};
150
+ c.fn.fmatter.defaultFormat=function(a,b){return c.fmatter.isValue(a)&&a!==""?a:b.defaultValue?b.defaultValue:"&#160;"};c.fn.fmatter.email=function(a,b){return c.fmatter.isEmpty(a)?c.fn.fmatter.defaultFormat(a,b):'<a href="mailto:'+a+'">'+a+"</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=
151
+ c.fn.fmatter.defaultFormat(a,d);a+="";a=a.toLowerCase();return'<input type="checkbox" '+(a.search(/(false|0|no|off)/i)<0?" checked='checked' ":"")+' value="'+a+'" offval="no" '+b+"/>"};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 "+f+' href="'+a+'">'+a+"</a>"};c.fn.fmatter.showlink=function(a,b){var d=
152
+ {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 "+f+' href="'+d+'">'+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)||
153
+ (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({},
154
+ 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=[];
155
+ 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;k<h.length;k++){g=h[k].split(":");if(g.length>2)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]=
156
+ 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=
157
+ 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,
158
+ 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#"+
159
+ 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+
160
+ "','edit',"+b.pos+");";f=f+"<div style='margin-left:8px;'><div title='"+c.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+e+"><span class='ui-icon ui-icon-pencil'></span></div>"}if(a.delbutton){e="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+"','del',"+b.pos+");";f=f+"<div title='"+c.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+e+"><span class='ui-icon ui-icon-trash'></span></div>"}e="onclick=$.fn.fmatter.rowactions('"+
161
+ d+"','"+b.gid+"','save',"+b.pos+");";f=f+"<div title='"+c.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save'><span class='ui-icon ui-icon-disk' "+e+"></span></div>";e="onclick=$.fn.fmatter.rowactions('"+d+"','"+b.gid+"','cancel',"+b.pos+");";return f=f+"<div title='"+c.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel'><span class='ui-icon ui-icon-cancel' "+e+"></span></div></div>"};c.unformat=function(a,b,
162
+ 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,
163
+ "\\$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"";
164
+ 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;j<g.length;j++){i=g[j].split(":");if(i.length>2)i[1]=jQuery.map(i,function(k,l){if(l>0)return k}).join(":");if(b){if(jQuery.inArray(i[1],
165
+ 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,
166
+ a,d.srcformat,d)}})(jQuery);
167
+ (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;m<b.length;m++)if(b[m].name==f){d=b[m];break}return d},setColProp:function(f,d){return this.each(function(){if(this.grid)if(d)for(var b=this.p.colModel,m=0;m<b.length;m++)if(b[m].name==f){a.extend(this.p.colModel[m],d);break}})},sortGrid:function(f,d,b){return this.each(function(){var m=this,t=-1;if(m.grid){if(!f)f=m.p.sortname;for(var q=0;q<m.p.colModel.length;q++)if(m.p.colModel[q].index==
168
+ f||m.p.colModel[q].name==f){t=q;break}if(t!=-1){q=m.p.colModel[t].sortable;if(typeof q!=="boolean")q=true;if(typeof d!=="boolean")d=false;q&&m.sortData("jqgh_"+f,t,d,b)}}})},GridDestroy:function(){return this.each(function(){if(this.grid){this.p.pager&&a(this.p.pager).remove();var f=this.id;try{a("#gbox_"+f).remove()}catch(d){}}})},GridUnload:function(){return this.each(function(){if(this.grid){var f={id:a(this).attr("id"),cl:a(this).attr("class")};this.p.pager&&a(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom");
169
+ var d=document.createElement("table");a(d).attr({id:f.id});d.className=f.cl;f=this.id;a(d).removeClass("ui-jqgrid-btable");if(a(this.p.pager).parents("#gbox_"+f).length===1){a(d).insertBefore("#gbox_"+f).show();a(this.p.pager).insertBefore("#gbox_"+f)}else a(d).insertBefore("#gbox_"+f).show();a("#gbox_"+f).remove()}})},setGridState:function(f){return this.each(function(){if(this.grid){var d=this;if(f=="hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+d.p.id).slideUp("fast");d.p.pager&&a(d.p.pager).slideUp("fast");
170
+ d.p.toppager&&a(d.p.toppager).slideUp("fast");if(d.p.toolbar[0]===true){d.p.toolbar[1]=="both"&&a(d.grid.ubDiv).slideUp("fast");a(d.grid.uDiv).slideUp("fast")}d.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+d.p.id).slideUp("fast");a(".ui-jqgrid-titlebar-close span",d.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");d.p.gridstate="hidden"}else if(f=="visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+d.p.id).slideDown("fast");d.p.pager&&a(d.p.pager).slideDown("fast");
171
+ d.p.toppager&&a(d.p.toppager).slideDown("fast");if(d.p.toolbar[0]===true){d.p.toolbar[1]=="both"&&a(d.grid.ubDiv).slideDown("fast");a(d.grid.uDiv).slideDown("fast")}d.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+d.p.id).slideDown("fast");a(".ui-jqgrid-titlebar-close span",d.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");d.p.gridstate="visible"}}})},updateGridRows:function(f,d,b){var m,t=false,q;this.each(function(){var h=this,k,o,c,g;if(!h.grid)return false;
172
+ d||(d="id");f&&f.length>0&&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<c.length;e++){k=h.formatter(g,c[e],e,c,"edit");q=h.p.colModel[e].title?{title:a.jgrid.stripHtml(k)}:{};h.p.treeGrid===true&&m==h.p.ExpandColumn?a("td:eq("+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||
173
+ 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",
174
+ 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=
175
+ 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;g<m.length;g++)if(this.name==
176
+ m[g].name){this.index=m[g].index||this.name;break}if(!this.index)this.index=this.name});var h=function(){var g={},e=0,n,i=a(b.p.gridid)[0],j;i.p.searchdata={};a.isFunction(b.p.beforeSearch)&&b.p.beforeSearch();a.each(b.p.filterModel,function(){j=this.index;switch(this.stype){case "select":if(n=a("select[name="+j+"]",b).val()){g[j]=n;b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).addClass("dirty-cell");e++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(r){}}break;
177
+ default:if(n=a("input[name="+j+"]",b).val()){g[j]=n;b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).addClass("dirty-cell");e++}else{b.p.marksearched&&a("#jqgh_"+this.name,i.grid.hDiv).removeClass("dirty-cell");try{delete i.p.postData[this.index]}catch(s){}}}});var p=e>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",
178
+ {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,
179
+ 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;
180
+ 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("<form name='SearchForm' style=display:inline;' class='"+this.p.formclass+"'></form>");o=a("<table class='"+this.p.tableclass+"' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");a(c).append(o);(function(){var g=document.createElement("tr"),
181
+ 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("<label for='"+this.name+"'>"+this.label+"</label>");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&&
182
+ 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<p.length;v++){r=p[v].split(":");u=document.createElement("option");u.value=r[0];u.innerHTML=r[1];if(r[1]==l.defval)u.selected="selected";s.appendChild(u)}}else if(typeof r==="object")for(v in r)if(r.hasOwnProperty(v)){p++;
183
+ u=document.createElement("option");u.value=v;u.innerHTML=r[v];if(r[v]==l.defval)u.selected="selected";s.appendChild(u)}b.p.gridToolbar===true&&l.width&&a(s).width(l.width);a(j).append(s);b.p.autosearch===true&&a(s).change(function(){h();return false})}break;case "text":s=this.defval?this.defval:"";a(j).append("<input type='text' name='"+(this.index||this.name)+"' id='sg_"+this.name+"' value='"+s+"'/>");l.sopt&&a("input",j).attr(l.sopt);if(b.p.gridToolbar===true&&l.width)a.browser.msie?a("input",j).width(l.width-
184
+ 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="<input type='button' id='sButton' class='"+b.p.buttonclass+
185
+ "' value='"+b.p.searchButton+"'/>";a(j).append(n);a("input#sButton",j).click(function(){h();return false})}if(b.p.enableClear===true){n="<input type='button' id='cButton' class='"+b.p.buttonclass+"' value='"+b.p.clearButton+"'/>";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("<td>&#160;</td>").append(j);a(o).append(e)}})();a(this).append(c);
186
+ 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)})}
187
+ 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}});
188
+ 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",
189
+ [{page:1}]);p&&a(b).jqGrid("setGridParam",{url:p});a.isFunction(f.afterSearch)&&f.afterSearch()},t=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),q;a.each(b.p.colModel,function(){var h=this,k,o,c,g;o=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+b.p.direction+"'></th>");k=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");this.hidden===true&&a(o).css("display","none");this.search=this.search===false?false:true;if(typeof this.stype==
190
+ "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&&
191
+ 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=
192
+ e.split(";");for(var j=0;j<e.length;j++){n=e[j].split(":");i=document.createElement("option");i.value=n[0];i.innerHTML=n[1];g.appendChild(i)}}else if(typeof e==="object")for(n in e)if(e.hasOwnProperty(n)){i=document.createElement("option");i.value=n;i.innerHTML=e[n];g.appendChild(i)}c.defaultValue&&a(g).val(c.defaultValue);c.attr&&a(g).attr(c.attr);c.dataInit!==undefined&&c.dataInit(g);c.dataEvents!==undefined&&d(g,c.dataEvents);a(k).append(g);f.autosearch===true&&a(g).change(function(){m();return false})}}break;
193
+ case "text":g=c.defaultValue?c.defaultValue:"";a(k).append("<input type='text' style='width:95%;padding:0px;' name='"+(h.index||h.name)+"' id='gs_"+h.name+"' value='"+g+"'/>");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;
194
+ 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+
195
+ "] 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":"'+
196
+ 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);
192
197
  h.css("display")=="none"?h.show():h.hide()}})}})})(jQuery);
193
- var showModal=function(a){a.w.show()},closeModal=function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},hideModal=function(a,b){b=jQuery.extend({jqm:true,gb:""},b||{});if(b.onClose){var c=b.onClose(a);if(typeof c=="boolean"&&!c)return}if(jQuery.fn.jqm&&b.jqm===true)jQuery(a).attr("aria-hidden","true").jqmHide();else{if(b.gb!="")try{jQuery(".jqgrid-overlay:first",b.gb).hide()}catch(e){}jQuery(a).hide().attr("aria-hidden","true")}};
194
- function findPos(a){var b=0,c=0;if(a.offsetParent){do{b+=a.offsetLeft;c+=a.offsetTop}while(a=a.offsetParent)}return[b,c]}
195
- var createModal=function(a,b,c,e,f,h){var d=document.createElement("div"),g;g=jQuery(c.gbox).attr("dir")=="rtl"?true:false;d.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";d.id=a.themodal;var i=document.createElement("div");i.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";i.id=a.modalhead;jQuery(i).append("<span class='ui-jqdialog-title'>"+c.caption+"</span>");var j=jQuery("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){j.addClass("ui-state-hover")},
196
- function(){j.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");jQuery(i).append(j);if(g){d.dir="rtl";jQuery(".ui-jqdialog-title",i).css("float","right");jQuery(".ui-jqdialog-titlebar-close",i).css("left","0.3em")}else{d.dir="ltr";jQuery(".ui-jqdialog-title",i).css("float","left");jQuery(".ui-jqdialog-titlebar-close",i).css("right","0.3em")}var l=document.createElement("div");jQuery(l).addClass("ui-jqdialog-content ui-widget-content").attr("id",a.modalcontent);
197
- jQuery(l).append(b);d.appendChild(l);jQuery(d).prepend(i);h===true?jQuery("body").append(d):jQuery(d).insertBefore(e);if(typeof c.jqModal==="undefined")c.jqModal=true;b={};if(jQuery.fn.jqm&&c.jqModal===true){if(c.left===0&&c.top===0){e=[];e=findPos(f);c.left=e[0]+4;c.top=e[1]+4}b.top=c.top+"px";b.left=c.left}else if(c.left!==0||c.top!==0){b.left=c.left;b.top=c.top+"px"}jQuery("a.ui-jqdialog-titlebar-close",i).click(function(){var n=jQuery("#"+a.themodal).data("onClose")||c.onClose,k=jQuery("#"+a.themodal).data("gbox")||
198
- c.gbox;hideModal("#"+a.themodal,{gb:k,jqm:c.jqModal,onClose:n});return false});if(c.width===0||!c.width)c.width=300;if(c.height===0||!c.height)c.height=200;if(!c.zIndex)c.zIndex=950;f=0;if(g&&b.left&&!h){f=jQuery(c.gbox).width()-(!isNaN(c.width)?parseInt(c.width,10):0)-8;b.left=parseInt(b.left,10)+parseInt(f,10)}if(b.left)b.left+="px";jQuery(d).css(jQuery.extend({width:isNaN(c.width)?"auto":c.width+"px",height:isNaN(c.height)?"auto":c.height+"px",zIndex:c.zIndex,overflow:"hidden"},b)).attr({tabIndex:"-1",
199
- role:"dialog","aria-labelledby":a.modalhead,"aria-hidden":"true"});if(typeof c.drag=="undefined")c.drag=true;if(typeof c.resize=="undefined")c.resize=true;if(c.drag){jQuery(i).css("cursor","move");if(jQuery.fn.jqDrag)jQuery(d).jqDrag(i);else try{jQuery(d).draggable({handle:jQuery("#"+i.id)})}catch(q){}}if(c.resize)if(jQuery.fn.jqResize){jQuery(d).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>");jQuery("#"+a.themodal).jqResize(".jqResize",
200
- a.scrollelm?"#"+a.scrollelm:false)}else try{jQuery(d).resizable({handles:"se, sw",alsoResize:a.scrollelm?"#"+a.scrollelm:false})}catch(o){}c.closeOnEscape===true&&jQuery(d).keydown(function(n){if(n.which==27){n=jQuery("#"+a.themodal).data("onClose")||c.onClose;hideModal(this,{gb:c.gbox,jqm:c.jqModal,onClose:n})}})},viewModal=function(a,b){b=jQuery.extend({toTop:true,overlay:10,modal:false,onShow:showModal,onHide:closeModal,gbox:"",jqm:true,jqM:true},b||{});if(jQuery.fn.jqm&&b.jqm===true)b.jqM?jQuery(a).attr("aria-hidden",
201
- "false").jqm(b).jqmShow():jQuery(a).attr("aria-hidden","false").jqmShow();else{if(b.gbox!=""){jQuery(".jqgrid-overlay:first",b.gbox).show();jQuery(a).data("gbox",b.gbox)}jQuery(a).show().attr("aria-hidden","false");try{jQuery(":input:visible",a)[0].focus()}catch(c){}}};
202
- function info_dialog(a,b,c,e){var f={width:290,height:"auto",dataheight:"auto",drag:true,resize:false,caption:"<b>"+a+"</b>",left:250,top:170,zIndex:1E3,jqModal:true,modal:false,closeOnEscape:true,align:"center",buttonalign:"center",buttons:[]};jQuery.extend(f,e||{});var h=f.jqModal;if(jQuery.fn.jqm&&!h)h=false;a="";if(f.buttons.length>0)for(e=0;e<f.buttons.length;e++){if(typeof f.buttons[e].id=="undefined")f.buttons[e].id="info_button_"+e;a+="<a href='javascript:void(0)' id='"+f.buttons[e].id+"' class='fm-button ui-state-default ui-corner-all'>"+
203
- f.buttons[e].text+"</a>"}e=isNaN(f.dataheight)?f.dataheight:f.dataheight+"px";var d="<div id='info_id'>";d+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+e+";"+("text-align:"+f.align+";")+"'>"+b+"</div>";d+=c?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+f.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+
204
- c+"</a>"+a+"</div>":a!=""?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+f.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+a+"</div>":"";d+="</div>";try{jQuery("#info_dialog").attr("aria-hidden")=="false"&&hideModal("#info_dialog",{jqm:h});jQuery("#info_dialog").remove()}catch(g){}createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},d,f,"","",true);a&&jQuery.each(f.buttons,
205
- function(j){jQuery("#"+this.id,"#info_id").bind("click",function(){f.buttons[j].onClick.call(jQuery("#info_dialog"));return false})});jQuery("#closedialog","#info_id").click(function(j){hideModal("#info_dialog",{jqm:h});return false});jQuery(".fm-button","#info_dialog").hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")});jQuery.isFunction(f.beforeOpen)&&f.beforeOpen();viewModal("#info_dialog",{onHide:function(j){j.w.hide().remove();j.o&&
206
- j.o.remove()},modal:f.modal,jqm:h});jQuery.isFunction(f.afterOpen)&&f.afterOpen();try{$("#info_dialog").focus()}catch(i){}}
207
- function createEl(a,b,c,e,f){function h(k,m){if(jQuery.isFunction(m.dataInit)){k.id=m.id;m.dataInit(k);delete m.id;delete m.dataInit}if(m.dataEvents){jQuery.each(m.dataEvents,function(){this.data!==undefined?jQuery(k).bind(this.type,this.data,this.fn):jQuery(k).bind(this.type,this.fn)});delete m.dataEvents}return m}var d="";b.defaultValue&&delete b.defaultValue;switch(a){case "textarea":d=document.createElement("textarea");if(e)b.cols||jQuery(d).css({width:"98%"});else if(!b.cols)b.cols=20;if(!b.rows)b.rows=
208
- 2;if(c=="&nbsp;"||c=="&#160;"||c.length==1&&c.charCodeAt(0)==160)c="";d.value=c;b=h(d,b);jQuery(d).attr(b).attr({role:"textbox",multiline:"true"});break;case "checkbox":d=document.createElement("input");d.type="checkbox";if(b.value){var g=b.value.split(":");if(c===g[0]){d.checked=true;d.defaultChecked=true}d.value=g[0];jQuery(d).attr("offval",g[1]);try{delete b.value}catch(i){}}else{g=c.toLowerCase();if(g.search(/(false|0|no|off|undefined)/i)<0&&g!==""){d.checked=true;d.defaultChecked=true;d.value=
209
- c}else d.value="on";jQuery(d).attr("offval","off")}b=h(d,b);jQuery(d).attr(b).attr("role","checkbox");break;case "select":d=document.createElement("select");d.setAttribute("role","select");var j,l=[];if(b.multiple===true){j=true;d.multiple="multiple";$(d).attr("aria-multiselectable","true")}else j=false;if(typeof b.dataUrl!="undefined")jQuery.ajax(jQuery.extend({url:b.dataUrl,type:"GET",dataType:"html",success:function(k,m){try{delete b.dataUrl;delete b.value}catch(r){}if(typeof b.buildSelect!="undefined"){k=
210
- b.buildSelect(k);k=jQuery(k).html();delete b.buildSelect}else k=jQuery(k).html();if(k){jQuery(d).append(k);b=h(d,b);if(typeof b.size==="undefined")b.size=j?3:1;if(j){l=c.split(",");l=jQuery.map(l,function(p){return jQuery.trim(p)})}else l[0]=jQuery.trim(c);jQuery(d).attr(b);setTimeout(function(){jQuery("option",d).each(function(p){if(p===0)this.selected="";$(this).attr("role","option");if(jQuery.inArray(jQuery.trim(jQuery(this).text()),l)>-1||jQuery.inArray(jQuery.trim(jQuery(this).val()),l)>-1){this.selected=
211
- "selected";if(!j)return false}})},0)}}},f||{}));else if(b.value){if(j){l=c.split(",");l=jQuery.map(l,function(k){return jQuery.trim(k)});if(typeof b.size==="undefined")b.size=3}else b.size=1;if(typeof b.value==="function")b.value=b.value();if(typeof b.value==="string"){e=b.value.split(";");for(g=0;g<e.length;g++){f=e[g].split(":");if(f.length>2)f[1]=jQuery.map(f,function(k,m){if(m>0)return k}).join(":");a=document.createElement("option");a.setAttribute("role","option");a.value=f[0];a.innerHTML=f[1];
212
- if(!j&&(jQuery.trim(f[0])==jQuery.trim(c)||jQuery.trim(f[1])==jQuery.trim(c)))a.selected="selected";if(j&&(jQuery.inArray(jQuery.trim(f[1]),l)>-1||jQuery.inArray(jQuery.trim(f[0]),l)>-1))a.selected="selected";d.appendChild(a)}}else if(typeof b.value==="object"){e=b.value;for(g in e)if(e.hasOwnProperty(g)){a=document.createElement("option");a.setAttribute("role","option");a.value=g;a.innerHTML=e[g];if(!j&&(jQuery.trim(g)==jQuery.trim(c)||jQuery.trim(e[g])==jQuery.trim(c)))a.selected="selected";if(j&&
213
- (jQuery.inArray(jQuery.trim(e[g]),l)>-1||jQuery.inArray(jQuery.trim(g),l)>-1))a.selected="selected";d.appendChild(a)}}b=h(d,b);try{delete b.value}catch(q){}jQuery(d).attr(b)}break;case "text":case "password":case "button":g=a=="button"?"button":"textbox";d=document.createElement("input");d.type=a;d.value=c;b=h(d,b);if(a!="button")if(e)b.size||jQuery(d).css({width:"98%"});else if(!b.size)b.size=20;jQuery(d).attr(b).attr("role",g);break;case "image":case "file":d=document.createElement("input");d.type=
214
- a;b=h(d,b);jQuery(d).attr(b);break;case "custom":d=document.createElement("span");try{if(jQuery.isFunction(b.custom_element)){var o=b.custom_element.call(this,c,b);if(o){o=jQuery(o).addClass("customelement").attr({id:b.id,name:b.name});jQuery(d).empty().append(o)}else throw"e2";}else throw"e1";}catch(n){n=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_element' "+jQuery.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);n=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_element' "+
215
- jQuery.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,typeof n==="string"?n:n.message,jQuery.jgrid.edit.bClose)}break}return d}function daysInFebruary(a){return a%4===0&&(a%100!==0||a%400===0)?29:28}function DaysArray(a){for(var b=1;b<=a;b++){this[b]=31;if(b==4||b==6||b==9||b==11)this[b]=30;if(b==2)this[b]=29}return this}
216
- function checkDate(a,b){var c={},e;a=a.toLowerCase();e=a.indexOf("/")!=-1?"/":a.indexOf("-")!=-1?"-":a.indexOf(".")!=-1?".":"/";a=a.split(e);b=b.split(e);if(b.length!=3)return false;e=-1;for(var f,h=-1,d=-1,g=0;g<a.length;g++){f=isNaN(b[g])?0:parseInt(b[g],10);c[a[g]]=f;f=a[g];if(f.indexOf("y")!=-1)e=g;if(f.indexOf("m")!=-1)d=g;if(f.indexOf("d")!=-1)h=g}f=a[e]=="y"||a[e]=="yyyy"?4:a[e]=="yy"?2:-1;g=DaysArray(12);var i;if(e===-1)return false;else{i=c[a[e]].toString();if(f==2&&i.length==1)f=1;if(i.length!=
217
- f||c[a[e]]===0&&b[e]!="00")return false}if(d===-1)return false;else{i=c[a[d]].toString();if(i.length<1||c[a[d]]<1||c[a[d]]>12)return false}if(h===-1)return false;else{i=c[a[h]].toString();if(i.length<1||c[a[h]]<1||c[a[h]]>31||c[a[d]]==2&&c[a[h]]>daysInFebruary(c[a[e]])||c[a[h]]>g[c[a[d]]])return false}return true}function isEmpty(a){return a.match(/^\s+$/)||a==""?true:false}
218
- function checkTime(a){var b=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!isEmpty(a))if(a=a.match(b)){if(a[3]){if(a[1]<1||a[1]>12)return false}else if(a[1]>23)return false;if(a[2]>59)return false}else return false;return true}
219
- function checkValues(a,b,c){var e,f,h;if(typeof b=="string"){f=0;for(len=c.p.colModel.length;f<len;f++)if(c.p.colModel[f].name==b){e=c.p.colModel[f].editrules;b=f;try{h=c.p.colModel[f].formoptions.label}catch(d){}break}}else if(b>=0)e=c.p.colModel[b].editrules;if(e){h||(h=c.p.colNames[b]);if(e.required===true)if(isEmpty(a))return[false,h+": "+jQuery.jgrid.edit.msg.required,""];f=e.required===false?false:true;if(e.number===true)if(!(f===false&&isEmpty(a)))if(isNaN(a))return[false,h+": "+jQuery.jgrid.edit.msg.number,
220
- ""];if(typeof e.minValue!="undefined"&&!isNaN(e.minValue))if(parseFloat(a)<parseFloat(e.minValue))return[false,h+": "+jQuery.jgrid.edit.msg.minValue+" "+e.minValue,""];if(typeof e.maxValue!="undefined"&&!isNaN(e.maxValue))if(parseFloat(a)>parseFloat(e.maxValue))return[false,h+": "+jQuery.jgrid.edit.msg.maxValue+" "+e.maxValue,""];var g;if(e.email===true)if(!(f===false&&isEmpty(a))){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;
221
- if(!g.test(a))return[false,h+": "+jQuery.jgrid.edit.msg.email,""]}if(e.integer===true)if(!(f===false&&isEmpty(a))){if(isNaN(a))return[false,h+": "+jQuery.jgrid.edit.msg.integer,""];if(a%1!==0||a.indexOf(".")!=-1)return[false,h+": "+jQuery.jgrid.edit.msg.integer,""]}if(e.date===true)if(!(f===false&&isEmpty(a))){b=c.p.colModel[b].formatoptions&&c.p.colModel[b].formatoptions.newformat?c.p.colModel[b].formatoptions.newformat:c.p.colModel[b].datefmt||"Y-m-d";if(!checkDate(b,a))return[false,h+": "+jQuery.jgrid.edit.msg.date+
222
- " - "+b,""]}if(e.time===true)if(!(f===false&&isEmpty(a)))if(!checkTime(a))return[false,h+": "+jQuery.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(e.url===true)if(!(f===false&&isEmpty(a))){g=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!g.test(a))return[false,h+": "+jQuery.jgrid.edit.msg.url,""]}if(e.custom===true)if(!(f===false&&isEmpty(a)))if(jQuery.isFunction(e.custom_func)){a=e.custom_func.call(c,a,h);return jQuery.isArray(a)?
223
- a:[false,jQuery.jgrid.edit.msg.customarray,""]}else return[false,jQuery.jgrid.edit.msg.customfcheck,""]}return[true,"",""]};
224
- (function(a){var c=null;a.jgrid.extend({searchGrid:function(d){d=a.extend({recreateFilter:false,drag:true,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",loadDefaults:true,beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,closeAfterSearch:false,closeAfterReset:false,closeOnEscape:false,multipleSearch:false,cloneSearchRowOnAdd:true,sopt:null,stringResult:undefined,onClose:null,useDataProxy:false,overlay:true},a.jgrid.search,d||{});return this.each(function(){function b(o,
225
- s){s=o.p.postData[s.sFilter];if(typeof s=="string")s=a.jgrid.parse(s);if(s){s.groupOp&&o.SearchFilter.setGroupOp(s.groupOp);if(s.rules){var E,J=0,k=s.rules.length;for(E=false;J<k;J++){E=s.rules[J];if(E.field!==undefined&&E.op!==undefined&&E.data!==undefined)(E=o.SearchFilter.setFilter({sfref:o.SearchFilter.$.find(".sf:last"),filter:a.extend({},E)}))&&o.SearchFilter.add()}}}}function q(o){var s=o!==undefined,E=a("#"+z.p.id),J={};if(d.multipleSearch===false){J[d.sField]=o.rules[0].field;J[d.sValue]=
226
- o.rules[0].data;J[d.sOper]=o.rules[0].op}else J[d.sFilter]=o;E[0].p.search=s;a.extend(E[0].p.postData,J);E.trigger("reloadGrid",[{page:1}]);d.closeAfterSearch&&t(a("#"+h))}function C(o){o=o&&o.hasOwnProperty("reload")?o.reload:true;grid=a("#"+z.p.id);sdata=[];grid[0].p.search=false;if(d.multipleSearch===false)sdata[d.sField]=sdata[d.sValue]=sdata[d.sOper]="";else sdata[d.sFilter]="";a.extend(grid[0].p.postData,sdata);o&&grid.trigger("reloadGrid",[{page:1}]);d.closeAfterReset&&t(a("#"+h))}function t(o){if(d.onClose){var s=
227
- d.onClose(o);if(typeof s=="boolean"&&!s)return}o.hide();d.overlay===true&&a(".jqgrid-overlay:first","#gbox_"+z.p.id).hide()}function F(){var o=a(".ui-searchFilter").length;if(o>1){var s=a("#"+h).css("zIndex");a("#"+h).css({zIndex:parseInt(s,10)+o})}a("#"+h).show();d.overlay===true&&a(".jqgrid-overlay:first","#gbox_"+z.p.id).show();try{a(":input:visible","#"+h)[0].focus()}catch(E){}}var z=this;if(z.grid)if(a.fn.searchFilter){var h="fbox_"+z.p.id;d.recreateFilter===true&&a("#"+h).remove();if(a("#"+
228
- h).html()!=null){a.isFunction(d.beforeShowSearch)&&d.beforeShowSearch(a("#"+h));F();a.isFunction(d.afterShowSearch)&&d.afterShowSearch(a("#"+h))}else{var p=[],H=a("#"+z.p.id).jqGrid("getGridParam","colNames"),e=a("#"+z.p.id).jqGrid("getGridParam","colModel"),l=["eq","ne","lt","le","gt","ge","bw","bn","in","ni","ew","en","cn","nc"],f,j,m,u=[];if(d.sopt!==null)for(f=m=0;f<d.sopt.length;f++){if((j=a.inArray(d.sopt[f],l))!=-1){u[m]={op:d.sopt[f],text:d.odata[j]};m++}}else for(f=0;f<l.length;f++)u[f]=
229
- {op:l[f],text:d.odata[f]};a.each(e,function(o,s){var E=typeof s.search==="undefined"?true:s.search,J=s.hidden===true;o=a.extend({},{text:H[o],itemval:s.index||s.name},this.searchoptions);s=o.searchhidden===true;if(typeof o.sopt!=="undefined"){m=0;o.ops=[];if(o.sopt.length>0)for(f=0;f<o.sopt.length;f++)if((j=a.inArray(o.sopt[f],l))!=-1){o.ops[m]={op:o.sopt[f],text:d.odata[j]};m++}}if(typeof this.stype==="undefined")this.stype="text";if(this.stype=="select")if(o.dataUrl===undefined){var k;if(o.value)k=
230
- o.value;else if(this.editoptions)k=this.editoptions.value;if(k){o.dataValues=[];if(typeof k==="string"){k=k.split(";");var i;for(f=0;f<k.length;f++){i=k[f].split(":");o.dataValues[f]={value:i[0],text:i[1]}}}else if(typeof k==="object"){f=0;for(i in k)if(k.hasOwnProperty(i)){o.dataValues[f]={value:i,text:k[i]};f++}}}}if(s&&E||E&&!J)p.push(o)});if(p.length>0){a("<div id='"+h+"' role='dialog' tabindex='-1'></div>").insertBefore("#gview_"+z.p.id);if(d.stringResult===undefined)d.stringResult=d.multipleSearch;
231
- z.SearchFilter=a("#"+h).searchFilter(p,{groupOps:d.groupOps,operators:u,onClose:t,resetText:d.Reset,searchText:d.Find,windowTitle:d.caption,rulesText:d.rulesText,matchText:d.matchText,onSearch:q,onReset:C,stringResult:d.stringResult,ajaxSelectOptions:a.extend({},a.jgrid.ajaxOptions,z.p.ajaxSelectOptions||{}),clone:d.cloneSearchRowOnAdd});a(".ui-widget-overlay","#"+h).remove();z.p.direction=="rtl"&&a(".ui-closer","#"+h).css("float","left");if(d.drag===true){a("#"+h+" table thead tr:first td:first").css("cursor",
232
- "move");if(jQuery.fn.jqDrag)a("#"+h).jqDrag(a("#"+h+" table thead tr:first td:first"));else try{a("#"+h).draggable({handle:a("#"+h+" table thead tr:first td:first")})}catch(Q){}}if(d.multipleSearch===false){a(".ui-del, .ui-add, .ui-del, .ui-add-last, .matchText, .rulesText","#"+h).hide();a("select[name='groupOp']","#"+h).hide()}d.multipleSearch===true&&d.loadDefaults===true&&b(z,d);a.isFunction(d.onInitializeSearch)&&d.onInitializeSearch(a("#"+h));a.isFunction(d.beforeShowSearch)&&d.beforeShowSearch(a("#"+
233
- h));F();a.isFunction(d.afterShowSearch)&&d.afterShowSearch(a("#"+h));d.closeOnEscape===true&&a("#"+h).keydown(function(o){o.which==27&&t(a("#"+h))})}}}})},editGridRow:function(d,b){c=b=a.extend({top:0,left:0,width:300,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,url:null,mtype:"POST",clearAfterAdd:true,closeAfterEdit:false,reloadAfterSubmit:true,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,
234
- afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:false,jqModal:true,closeOnEscape:false,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[false,13],navkeys:[false,38,40],checkOnSubmit:false,checkOnUpdate:false,_savedData:{},processing:false,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:true},a.jgrid.edit,b||{});return this.each(function(){function q(g,n){g===0?a("#pData","#"+j+"_2").addClass("ui-state-disabled"):
235
- a("#pData","#"+j+"_2").removeClass("ui-state-disabled");g==n?a("#nData","#"+j+"_2").addClass("ui-state-disabled"):a("#nData","#"+j+"_2").removeClass("ui-state-disabled")}function C(){var g=a(e).jqGrid("getDataIDs"),n=a("#id_g","#"+j).val();return[a.inArray(n,g),g]}function t(){var g=true;a("#FormError","#"+j).hide();if(c.checkOnUpdate){k={};i={};F();w=a.extend({},k,i);if(O=H(w,c._savedData)){a("#"+f).data("disabled",true);a(".confirm","#"+m.themodal).show();g=false}}return g}function F(){a(".FormElement",
236
- "#"+j).each(function(){var g=a(".customelement",this);if(g.length){var n=a(g[0]).attr("name");a.each(e.p.colModel,function(){if(this.name==n&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{k[n]=this.editoptions.custom_value(a("#"+n,"#"+j),"get");if(k[n]===undefined)throw"e1";}catch(r){r=="e1"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,r.message,jQuery.jgrid.edit.bClose)}return true}})}else{switch(a(this).get(0).type){case "checkbox":if(a(this).attr("checked"))k[this.name]=
237
- a(this).val();else{g=a(this).attr("offval");k[this.name]=g}break;case "select-one":k[this.name]=a("option:selected",this).val();i[this.name]=a("option:selected",this).text();break;case "select-multiple":k[this.name]=a(this).val();k[this.name]=k[this.name]?k[this.name].join(","):"";var v=[];a("option:selected",this).each(function(r,D){v[r]=a(D).text()});i[this.name]=v.join(",");break;case "password":case "text":case "textarea":case "button":k[this.name]=a(this).val();break}if(e.p.autoencode)k[this.name]=
238
- a.jgrid.htmlEncode(k[this.name])}});return true}function z(g,n,v,r){for(var D,A,x,M=0,y,P,B,T=[],G=false,V="",R=1;R<=r;R++)V+="<td class='CaptionTD ui-widget-content'>&#160;</td><td class='DataTD ui-widget-content' style='white-space:pre'>&#160;</td>";if(g!="_empty")G=a(n).jqGrid("getInd",g);a(n.p.colModel).each(function(U){D=this.name;P=(A=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";if(D!=="cb"&&D!=="subgrid"&&this.editable===true&&
239
- D!=="rn"){if(G===false)y="";else if(D==n.p.ExpandColumn&&n.p.treeGrid===true)y=a("td:eq("+U+")",n.rows[G]).text();else try{y=a.unformat(a("td:eq("+U+")",n.rows[G]),{rowId:g,colModel:this},U)}catch(ca){y=a("td:eq("+U+")",n.rows[G]).html()}var W=a.extend({},this.editoptions||{},{id:D,name:D}),X=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),ba=parseInt(X.rowpos,10)||M+1,da=parseInt((parseInt(X.colpos,10)||1)*2,10);if(g=="_empty"&&W.defaultValue)y=a.isFunction(W.defaultValue)?
240
- W.defaultValue():W.defaultValue;if(!this.edittype)this.edittype="text";if(e.p.autoencode)y=a.jgrid.htmlDecode(y);B=createEl(this.edittype,W,y,false,a.extend({},a.jgrid.ajaxOptions,n.p.ajaxSelectOptions||{}));if(y==""&&this.edittype=="checkbox")y=a(B).attr("offval");if(y==""&&this.edittype=="select")y=a("option:eq(0)",B).text();if(c.checkOnSubmit||c.checkOnUpdate)c._savedData[D]=y;a(B).addClass("FormElement");x=a(v).find("tr[rowpos="+ba+"]");if(X.rowabove){W=a("<tr><td class='contentinfo' colspan='"+
241
- r*2+"'>"+X.rowcontent+"</td></tr>");a(v).append(W);W[0].rp=ba}if(x.length===0){x=a("<tr "+P+" rowpos='"+ba+"'></tr>").addClass("FormData").attr("id","tr_"+D);a(x).append(V);a(v).append(x);x[0].rp=ba}a("td:eq("+(da-2)+")",x[0]).html(typeof X.label==="undefined"?n.p.colNames[U]:X.label);a("td:eq("+(da-1)+")",x[0]).append(X.elmprefix).append(B).append(X.elmsuffix);T[M]=U;M++}});if(M>0){R=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(r*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+
242
- n.p.id+"_id' value='"+g+"'/></td></tr>");R[0].rp=M+999;a(v).append(R);if(c.checkOnSubmit||c.checkOnUpdate)c._savedData[n.p.id+"_id"]=g}return T}function h(g,n,v){var r,D=0,A,x,M,y,P;if(c.checkOnSubmit||c.checkOnUpdate){c._savedData={};c._savedData[n.p.id+"_id"]=g}var B=n.p.colModel;if(g=="_empty"){a(B).each(function(){r=this.name;M=a.extend({},this.editoptions||{});x=a("#"+a.jgrid.jqID(r),"#"+v);if(x[0]!=null){y="";if(M.defaultValue){y=a.isFunction(M.defaultValue)?M.defaultValue():M.defaultValue;
243
- if(x[0].type=="checkbox"){P=y.toLowerCase();if(P.search(/(false|0|no|off|undefined)/i)<0&&P!==""){x[0].checked=true;x[0].defaultChecked=true;x[0].value=y}else x.attr({checked:"",defaultChecked:""})}else x.val(y)}else if(x[0].type=="checkbox"){x[0].checked=false;x[0].defaultChecked=false;y=a(x).attr("offval")}else if(x[0].type&&x[0].type.substr(0,6)=="select")x[0].selectedIndex=0;else x.val(y);if(c.checkOnSubmit===true||c.checkOnUpdate)c._savedData[r]=y}});a("#id_g","#"+v).val(g)}else{var T=a(n).jqGrid("getInd",
244
- g,true);if(T){a("td",T).each(function(G){r=B[G].name;if(r!=="cb"&&r!=="subgrid"&&r!=="rn"&&B[G].editable===true){if(r==n.p.ExpandColumn&&n.p.treeGrid===true)A=a(this).text();else try{A=a.unformat(this,{rowId:g,colModel:B[G]},G)}catch(V){A=a(this).html()}if(e.p.autoencode)A=a.jgrid.htmlDecode(A);if(c.checkOnSubmit===true||c.checkOnUpdate)c._savedData[r]=A;r=a.jgrid.jqID(r);switch(B[G].edittype){case "password":case "text":case "button":case "image":a("#"+r,"#"+v).val(A);break;case "textarea":if(A==
245
- "&nbsp;"||A=="&#160;"||A.length==1&&A.charCodeAt(0)==160)A="";a("#"+r,"#"+v).val(A);break;case "select":var R=A.split(",");R=a.map(R,function(ca){return a.trim(ca)});a("#"+r+" option","#"+v).each(function(){this.selected=!B[G].editoptions.multiple&&(R[0]==a.trim(a(this).text())||R[0]==a.trim(a(this).val()))?true:B[G].editoptions.multiple?a.inArray(a.trim(a(this).text()),R)>-1||a.inArray(a.trim(a(this).val()),R)>-1?true:false:false});break;case "checkbox":A+="";if(B[G].editoptions&&B[G].editoptions.value)if(B[G].editoptions.value.split(":")[0]==
246
- A){a("#"+r,"#"+v).attr("checked",true);a("#"+r,"#"+v).attr("defaultChecked",true)}else{a("#"+r,"#"+v).attr("checked",false);a("#"+r,"#"+v).attr("defaultChecked","")}else{A=A.toLowerCase();if(A.search(/(false|0|no|off|undefined)/i)<0&&A!==""){a("#"+r,"#"+v).attr("checked",true);a("#"+r,"#"+v).attr("defaultChecked",true)}else{a("#"+r,"#"+v).attr("checked",false);a("#"+r,"#"+v).attr("defaultChecked","")}}break;case "custom":try{if(B[G].editoptions&&a.isFunction(B[G].editoptions.custom_value))B[G].editoptions.custom_value(a("#"+
247
- r,"#"+v),"set",A);else throw"e1";}catch(U){U=="e1"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,U.message,jQuery.jgrid.edit.bClose)}break}D++}});D>0&&a("#id_g","#"+j).val(g)}}}function p(){var g,n=[true,"",""],v={},r=e.p.prmNames,D,A;if(a.isFunction(c.beforeCheckValues)){var x=c.beforeCheckValues(k,a("#"+f),k[e.p.id+"_id"]=="_empty"?r.addoper:r.editoper);if(x&&typeof x==="object")k=x}for(var M in k)if(k.hasOwnProperty(M)){n=
248
- checkValues(k[M],M,e);if(n[0]===false)break}if(n[0]){if(a.isFunction(c.onclickSubmit))v=c.onclickSubmit(c,k)||{};if(a.isFunction(c.beforeSubmit))n=c.beforeSubmit(k,a("#"+f))}if(n[0]&&!c.processing){c.processing=true;a("#sData","#"+j+"_2").addClass("ui-state-active");A=r.oper;D=r.id;k[A]=a.trim(k[e.p.id+"_id"])=="_empty"?r.addoper:r.editoper;if(k[A]!=r.addoper)k[D]=k[e.p.id+"_id"];else if(k[D]===undefined)k[D]=k[e.p.id+"_id"];delete k[e.p.id+"_id"];k=a.extend(k,c.editData,v);v=a.extend({url:c.url?
249
- c.url:a(e).jqGrid("getGridParam","editurl"),type:c.mtype,data:a.isFunction(c.serializeEditData)?c.serializeEditData(k):k,complete:function(y,P){if(P!="success"){n[0]=false;n[1]=a.isFunction(c.errorTextFormat)?c.errorTextFormat(y):P+" Status: '"+y.statusText+"'. Error code: "+y.status}else if(a.isFunction(c.afterSubmit))n=c.afterSubmit(y,k);if(n[0]===false){a("#FormError>td","#"+j).html(n[1]);a("#FormError","#"+j).show()}else{a.each(e.p.colModel,function(){if(i[this.name]&&this.formatter&&this.formatter==
250
- "select")try{delete i[this.name]}catch(G){}});k=a.extend(k,i);e.p.autoencode&&a.each(k,function(G,V){k[G]=a.jgrid.htmlDecode(V)});c.reloadAfterSubmit=c.reloadAfterSubmit&&e.p.datatype!="local";if(k[A]==r.addoper){n[2]||(n[2]=parseInt(e.p.records,10)+1+"");k[D]=n[2];if(c.closeAfterAdd){if(c.reloadAfterSubmit)a(e).trigger("reloadGrid");else{a(e).jqGrid("addRowData",n[2],k,b.addedrow);a(e).jqGrid("setSelection",n[2])}hideModal("#"+m.themodal,{gb:"#gbox_"+l,jqm:b.jqModal,onClose:c.onClose})}else if(c.clearAfterAdd){c.reloadAfterSubmit?
251
- a(e).trigger("reloadGrid"):a(e).jqGrid("addRowData",n[2],k,b.addedrow);h("_empty",e,f)}else c.reloadAfterSubmit?a(e).trigger("reloadGrid"):a(e).jqGrid("addRowData",n[2],k,b.addedrow)}else{if(c.reloadAfterSubmit){a(e).trigger("reloadGrid");c.closeAfterEdit||setTimeout(function(){a(e).jqGrid("setSelection",k[D])},1E3)}else e.p.treeGrid===true?a(e).jqGrid("setTreeRow",k[D],k):a(e).jqGrid("setRowData",k[D],k);c.closeAfterEdit&&hideModal("#"+m.themodal,{gb:"#gbox_"+l,jqm:b.jqModal,onClose:c.onClose})}if(a.isFunction(c.afterComplete)){g=
252
- y;setTimeout(function(){c.afterComplete(g,k,a("#"+f));g=null},500)}}c.processing=false;if(c.checkOnSubmit||c.checkOnUpdate){a("#"+f).data("disabled",false);if(c._savedData[e.p.id+"_id"]!="_empty")for(var B in c._savedData)if(k[B])c._savedData[B]=k[B]}a("#sData","#"+j+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+f)[0].focus()}catch(T){}},error:function(y,P,B){a("#FormError>td","#"+j).html(P+" : "+B);a("#FormError","#"+j).show();c.processing=false;a("#"+f).data("disabled",false);
253
- a("#sData","#"+j+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,c.ajaxEditOptions);if(!v.url&&!c.useDataProxy)if(a.isFunction(e.p.dataProxy))c.useDataProxy=true;else{n[0]=false;n[1]+=" "+a.jgrid.errors.nourl}if(n[0])c.useDataProxy?e.p.dataProxy.call(e,v,"set_"+e.p.id):a.ajax(v)}if(n[0]===false){a("#FormError>td","#"+j).html(n[1]);a("#FormError","#"+j).show()}}function H(g,n){var v=false,r;for(r in g)if(g[r]!=n[r]){v=true;break}return v}var e=this;if(e.grid&&d){var l=e.p.id,f="FrmGrid_"+
254
- l,j="TblGrid_"+l,m={themodal:"editmod"+l,modalhead:"edithd"+l,modalcontent:"editcnt"+l,scrollelm:f},u=a.isFunction(c.beforeShowForm)?c.beforeShowForm:false,Q=a.isFunction(c.afterShowForm)?c.afterShowForm:false,o=a.isFunction(c.beforeInitData)?c.beforeInitData:false,s=a.isFunction(c.onInitializeForm)?c.onInitializeForm:false,E=1,J=0,k,i,w,O;if(d=="new"){d="_empty";b.caption=b.addCaption}else b.caption=b.editCaption;b.recreateForm===true&&a("#"+m.themodal).html()!=null&&a("#"+m.themodal).remove();var S=
255
- true;if(b.checkOnUpdate&&b.jqModal&&!b.modal)S=false;if(a("#"+m.themodal).html()!=null){a(".ui-jqdialog-title","#"+m.modalhead).html(b.caption);a("#FormError","#"+j).hide();if(c.topinfo){a(".topinfo","#"+j+"_2").html(c.topinfo);a(".tinfo","#"+j+"_2").show()}else a(".tinfo","#"+j+"_2").hide();if(c.bottominfo){a(".bottominfo","#"+j+"_2").html(c.bottominfo);a(".binfo","#"+j+"_2").show()}else a(".binfo","#"+j+"_2").hide();o&&o(a("#"+f));h(d,e,f);d=="_empty"||!c.viewPagerButtons?a("#pData, #nData","#"+
256
- j+"_2").hide():a("#pData, #nData","#"+j+"_2").show();if(c.processing===true){c.processing=false;a("#sData","#"+j+"_2").removeClass("ui-state-active")}if(a("#"+f).data("disabled")===true){a(".confirm","#"+m.themodal).hide();a("#"+f).data("disabled",false)}u&&u(a("#"+f));a("#"+m.themodal).data("onClose",c.onClose);viewModal("#"+m.themodal,{gbox:"#gbox_"+l,jqm:b.jqModal,jqM:false,closeoverlay:S,modal:b.modal});S||a(".jqmOverlay").click(function(){if(!t())return false;hideModal("#"+m.themodal,{gb:"#gbox_"+
257
- l,jqm:b.jqModal,onClose:c.onClose});return false});Q&&Q(a("#"+f))}else{a(e.p.colModel).each(function(){var g=this.formoptions;E=Math.max(E,g?g.colpos||0:0);J=Math.max(J,g?g.rowpos||0:0)});var I=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",K;I=a("<form name='FormPost' id='"+f+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+I+";'></form>").data("disabled",false);var L=a("<table id='"+j+"' class='EditTable' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");
258
- a(I).append(L);K=a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+E*2+"'></td></tr>");K[0].rp=0;a(L).append(K);K=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+E*2+"'>"+c.topinfo+"</td></tr>");K[0].rp=0;a(L).append(K);o&&o(a("#"+f));K=(o=e.p.direction=="rtl"?true:false)?"nData":"pData";var N=o?"pData":"nData";z(d,e,L,E);K="<a href='javascript:void(0)' id='"+K+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>";
259
- N="<a href='javascript:void(0)' id='"+N+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>";var Z="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>",$="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>";K="<table border='0' class='EditTable' id='"+j+"_2'><tbody><tr id='Act_Buttons'><td class='navButton ui-widget-content'>"+(o?
260
- N+K:K+N)+"</td><td class='EditButton ui-widget-content'>"+Z+$+"</td></tr>";K+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+c.bottominfo+"</td></tr>";K+="</tbody></table>";if(J>0){var aa=[];a.each(a(L)[0].rows,function(g,n){aa[g]=n});aa.sort(function(g,n){if(g.rp>n.rp)return 1;if(g.rp<n.rp)return-1;return 0});a.each(aa,function(g,n){a("tbody",L).append(n)})}b.gbox="#gbox_"+l;var Y=false;if(b.closeOnEscape===true){b.closeOnEscape=false;Y=true}I=a("<span></span>").append(I).append(K);
261
- createModal(m,I,b,"#gview_"+e.p.id,a("#gbox_"+e.p.id)[0]);if(o){a("#pData, #nData","#"+j+"_2").css("float","right");a(".EditButton","#"+j+"_2").css("text-align","left")}c.topinfo&&a(".tinfo","#"+j+"_2").show();c.bottominfo&&a(".binfo","#"+j+"_2").show();K=I=null;a("#"+m.themodal).keydown(function(g){var n=g.target;if(a("#"+f).data("disabled")===true)return false;if(c.savekey[0]===true&&g.which==c.savekey[1])if(n.tagName!="TEXTAREA"){a("#sData","#"+j+"_2").trigger("click");return false}if(g.which===
262
- 27){if(!t())return false;Y&&hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:c.onClose});return false}if(c.navkeys[0]===true){if(a("#id_g","#"+j).val()=="_empty")return true;if(g.which==c.navkeys[1]){a("#pData","#"+j+"_2").trigger("click");return false}if(g.which==c.navkeys[2]){a("#nData","#"+j+"_2").trigger("click");return false}}});if(b.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+m.themodal).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+m.themodal).unbind("click").click(function(){if(!t())return false;
263
- hideModal("#"+m.themodal,{gb:"#gbox_"+l,jqm:b.jqModal,onClose:c.onClose});return false})}b.saveicon=a.extend([true,"left","ui-icon-disk"],b.saveicon);b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.saveicon[0]===true)a("#sData","#"+j+"_2").addClass(b.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.saveicon[2]+"'></span>");if(b.closeicon[0]===true)a("#cData","#"+j+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":
264
- "fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");if(c.checkOnSubmit||c.checkOnUpdate){Z="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bYes+"</a>";N="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bNo+"</a>";$="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bExit+"</a>";
265
- I=b.zIndex||999;I++;a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+I+";display:none;'>&#160;"+(a.browser.msie&&a.browser.version==6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"")+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(I+1)+"'>"+b.saveData+"<br/><br/>"+Z+N+$+"</div>").insertAfter("#"+f);a("#sNew","#"+m.themodal).click(function(){p();a("#"+f).data("disabled",
266
- false);a(".confirm","#"+m.themodal).hide();return false});a("#nNew","#"+m.themodal).click(function(){a(".confirm","#"+m.themodal).hide();a("#"+f).data("disabled",false);setTimeout(function(){a(":input","#"+f)[0].focus()},0);return false});a("#cNew","#"+m.themodal).click(function(){a(".confirm","#"+m.themodal).hide();a("#"+f).data("disabled",false);hideModal("#"+m.themodal,{gb:"#gbox_"+l,jqm:b.jqModal,onClose:c.onClose});return false})}s&&s(a("#"+f));d=="_empty"||!c.viewPagerButtons?a("#pData,#nData",
267
- "#"+j+"_2").hide():a("#pData,#nData","#"+j+"_2").show();u&&u(a("#"+f));a("#"+m.themodal).data("onClose",c.onClose);viewModal("#"+m.themodal,{gbox:"#gbox_"+l,jqm:b.jqModal,closeoverlay:S,modal:b.modal});S||a(".jqmOverlay").click(function(){if(!t())return false;hideModal("#"+m.themodal,{gb:"#gbox_"+l,jqm:b.jqModal,onClose:c.onClose});return false});Q&&Q(a("#"+f));a(".fm-button","#"+m.themodal).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a("#sData",
268
- "#"+j+"_2").click(function(){k={};i={};a("#FormError","#"+j).hide();F();if(k[e.p.id+"_id"]=="_empty")p();else if(b.checkOnSubmit===true){w=a.extend({},k,i);if(O=H(w,c._savedData)){a("#"+f).data("disabled",true);a(".confirm","#"+m.themodal).show()}else p()}else p();return false});a("#cData","#"+j+"_2").click(function(){if(!t())return false;hideModal("#"+m.themodal,{gb:"#gbox_"+l,jqm:b.jqModal,onClose:c.onClose});return false});a("#nData","#"+j+"_2").click(function(){if(!t())return false;a("#FormError",
269
- "#"+j).hide();var g=C();g[0]=parseInt(g[0],10);if(g[0]!=-1&&g[1][g[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",a("#"+f),g[1][g[0]]);h(g[1][g[0]+1],e,f);a(e).jqGrid("setSelection",g[1][g[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",a("#"+f),g[1][g[0]+1]);q(g[0]+1,g[1].length-1)}return false});a("#pData","#"+j+"_2").click(function(){if(!t())return false;a("#FormError","#"+j).hide();var g=C();if(g[0]!=-1&&g[1][g[0]-1]){a.isFunction(b.onclickPgButtons)&&
270
- b.onclickPgButtons("prev",a("#"+f),g[1][g[0]]);h(g[1][g[0]-1],e,f);a(e).jqGrid("setSelection",g[1][g[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+f),g[1][g[0]-1]);q(g[0]-1,g[1].length-1)}return false})}u=C();q(u[0],u[1].length-1)}})},viewGridRow:function(d,b){b=a.extend({top:0,left:0,width:0,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,jqModal:true,closeOnEscape:false,labelswidth:"30%",closeicon:[],navkeys:[false,38,40],onClose:null,beforeShowForm:null,
271
- viewPagerButtons:true},a.jgrid.view,b||{});return this.each(function(){function q(){if(b.closeOnEscape===true||b.navkeys[0]===true)setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+l.modalhead).focus()},0)}function C(i,w){i===0?a("#pData","#"+e+"_2").addClass("ui-state-disabled"):a("#pData","#"+e+"_2").removeClass("ui-state-disabled");i==w?a("#nData","#"+e+"_2").addClass("ui-state-disabled"):a("#nData","#"+e+"_2").removeClass("ui-state-disabled")}function t(){var i=a(h).jqGrid("getDataIDs"),
272
- w=a("#id_g","#"+e).val();return[a.inArray(w,i),i]}function F(i,w,O,S){for(var I,K,L,N=0,Z,$,aa=[],Y=false,g="<td class='CaptionTD form-view-label ui-widget-content' width='"+b.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",n="",v=["integer","number","currency"],r=0,D=0,A,x,M,y=1;y<=S;y++)n+=y==1?g:"<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";a(w.p.colModel).each(function(){K=
273
- this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false;if(!K&&this.align==="right")if(this.formatter&&a.inArray(this.formatter,v)!==-1)r=Math.max(r,parseInt(this.width,10));else D=Math.max(D,parseInt(this.width,10))});A=r!==0?r:D!==0?D:0;Y=a(w).jqGrid("getInd",i);a(w.p.colModel).each(function(P){I=this.name;x=false;$=(K=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";M=typeof this.viewable!="boolean"?true:
274
- this.viewable;if(I!=="cb"&&I!=="subgrid"&&I!=="rn"&&M){Z=Y===false?"":I==w.p.ExpandColumn&&w.p.treeGrid===true?a("td:eq("+P+")",w.rows[Y]).text():a("td:eq("+P+")",w.rows[Y]).html();x=this.align==="right"&&A!==0?true:false;a.extend({},this.editoptions||{},{id:I,name:I});var B=a.extend({},{rowabove:false,rowcontent:""},this.formoptions||{}),T=parseInt(B.rowpos,10)||N+1,G=parseInt((parseInt(B.colpos,10)||1)*2,10);if(B.rowabove){var V=a("<tr><td class='contentinfo' colspan='"+S*2+"'>"+B.rowcontent+"</td></tr>");
275
- a(O).append(V);V[0].rp=T}L=a(O).find("tr[rowpos="+T+"]");if(L.length===0){L=a("<tr "+$+" rowpos='"+T+"'></tr>").addClass("FormData").attr("id","trv_"+I);a(L).append(n);a(O).append(L);L[0].rp=T}a("td:eq("+(G-2)+")",L[0]).html("<b>"+(typeof B.label==="undefined"?w.p.colNames[P]:B.label)+"</b>");a("td:eq("+(G-1)+")",L[0]).append("<span>"+Z+"</span>").attr("id","v_"+I);x&&a("td:eq("+(G-1)+") span",L[0]).css({"text-align":"right",width:A+"px"});aa[N]=P;N++}});if(N>0){i=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+
276
- (S*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+i+"'/></td></tr>");i[0].rp=N+99;a(O).append(i)}return aa}function z(i,w){var O,S,I=0,K,L;if(L=a(w).jqGrid("getInd",i,true)){a("td",L).each(function(N){O=w.p.colModel[N].name;S=w.p.colModel[N].editrules&&w.p.colModel[N].editrules.edithidden===true?false:w.p.colModel[N].hidden===true?true:false;if(O!=="cb"&&O!=="subgrid"&&O!=="rn"){K=O==w.p.ExpandColumn&&w.p.treeGrid===true?a(this).text():a(this).html();a.extend({},
277
- w.p.colModel[N].editoptions||{});O=a.jgrid.jqID("v_"+O);a("#"+O+" span","#"+e).html(K);S&&a("#"+O,"#"+e).parents("tr:first").hide();I++}});I>0&&a("#id_g","#"+e).val(i)}}var h=this;if(h.grid&&d){if(!b.imgpath)b.imgpath=h.p.imgpath;var p=h.p.id,H="ViewGrid_"+p,e="ViewTbl_"+p,l={themodal:"viewmod"+p,modalhead:"viewhd"+p,modalcontent:"viewcnt"+p,scrollelm:H},f=1,j=0;if(a("#"+l.themodal).html()!=null){a(".ui-jqdialog-title","#"+l.modalhead).html(b.caption);a("#FormError","#"+e).hide();z(d,h);a.isFunction(b.beforeShowForm)&&
278
- b.beforeShowForm(a("#"+H));viewModal("#"+l.themodal,{gbox:"#gbox_"+p,jqm:b.jqModal,jqM:false,modal:b.modal});q()}else{a(h.p.colModel).each(function(){var i=this.formoptions;f=Math.max(f,i?i.colpos||0:0);j=Math.max(j,i?i.rowpos||0:0)});var m=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",u=a("<form name='FormPost' id='"+H+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+m+";'></form>"),Q=a("<table id='"+e+"' class='EditTable' cellspacing='1' cellpading='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
279
- a(u).append(Q);F(d,h,Q,f);m=h.p.direction=="rtl"?true:false;var o="<a href='javascript:void(0)' id='"+(m?"nData":"pData")+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>",s="<a href='javascript:void(0)' id='"+(m?"pData":"nData")+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>",E="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bClose+
280
- "</a>";if(j>0){var J=[];a.each(a(Q)[0].rows,function(i,w){J[i]=w});J.sort(function(i,w){if(i.rp>w.rp)return 1;if(i.rp<w.rp)return-1;return 0});a.each(J,function(i,w){a("tbody",Q).append(w)})}b.gbox="#gbox_"+p;var k=false;if(b.closeOnEscape===true){b.closeOnEscape=false;k=true}u=a("<span></span>").append(u).append("<table border='0' class='EditTable' id='"+e+"_2'><tbody><tr id='Act_Buttons'><td class='navButton ui-widget-content' width='"+b.labelswidth+"'>"+(m?s+o:o+s)+"</td><td class='EditButton ui-widget-content'>"+
281
- E+"</td></tr></tbody></table>");createModal(l,u,b,"#gview_"+h.p.id,a("#gview_"+h.p.id)[0]);if(m){a("#pData, #nData","#"+e+"_2").css("float","right");a(".EditButton","#"+e+"_2").css("text-align","left")}b.viewPagerButtons||a("#pData, #nData","#"+e+"_2").hide();u=null;a("#"+l.themodal).keydown(function(i){if(i.which===27){k&&hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:b.onClose});return false}if(b.navkeys[0]===true){if(i.which===b.navkeys[1]){a("#pData","#"+e+"_2").trigger("click");return false}if(i.which===
282
- b.navkeys[2]){a("#nData","#"+e+"_2").trigger("click");return false}}});b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.closeicon[0]===true)a("#cData","#"+e+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+H));viewModal("#"+l.themodal,{gbox:"#gbox_"+p,jqm:b.jqModal,modal:b.modal});a(".fm-button:not(.ui-state-disabled)","#"+e+"_2").hover(function(){a(this).addClass("ui-state-hover")},
283
- function(){a(this).removeClass("ui-state-hover")});q();a("#cData","#"+e+"_2").click(function(){hideModal("#"+l.themodal,{gb:"#gbox_"+p,jqm:b.jqModal,onClose:b.onClose});return false});a("#nData","#"+e+"_2").click(function(){a("#FormError","#"+e).hide();var i=t();i[0]=parseInt(i[0],10);if(i[0]!=-1&&i[1][i[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",a("#"+H),i[1][i[0]]);z(i[1][i[0]+1],h);a(h).jqGrid("setSelection",i[1][i[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",
284
- a("#"+H),i[1][i[0]+1]);C(i[0]+1,i[1].length-1)}q();return false});a("#pData","#"+e+"_2").click(function(){a("#FormError","#"+e).hide();var i=t();if(i[0]!=-1&&i[1][i[0]-1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("prev",a("#"+H),i[1][i[0]]);z(i[1][i[0]-1],h);a(h).jqGrid("setSelection",i[1][i[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+H),i[1][i[0]-1]);C(i[0]-1,i[1].length-1)}q();return false})}m=t();C(m[0],m[1].length-1)}})},delGridRow:function(d,b){c=
285
- b=a.extend({top:0,left:0,width:240,height:"auto",dataheight:"auto",modal:false,drag:true,resize:true,url:"",mtype:"POST",reloadAfterSubmit:true,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:true,closeOnEscape:false,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:false,serializeDelData:null,useDataProxy:false},a.jgrid.del,b||{});return this.each(function(){var q=this;if(q.grid)if(d){var C=typeof b.beforeShowForm===
286
- "function"?true:false,t=typeof b.afterShowForm==="function"?true:false,F=q.p.id,z={},h="DelTbl_"+F,p,H,e,l,f={themodal:"delmod"+F,modalhead:"delhd"+F,modalcontent:"delcnt"+F,scrollelm:h};if(jQuery.isArray(d))d=d.join();if(a("#"+f.themodal).html()!=null){a("#DelData>td","#"+h).text(d);a("#DelError","#"+h).hide();if(c.processing===true){c.processing=false;a("#dData","#"+h).removeClass("ui-state-active")}C&&b.beforeShowForm(a("#"+h));viewModal("#"+f.themodal,{gbox:"#gbox_"+F,jqm:b.jqModal,jqM:false,
287
- modal:b.modal})}else{var j=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px";j="<div id='"+h+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+j+";'>";j+="<table class='DelTable'><tbody>";j+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";j+="<tr id='DelData' style='display:none'><td >"+d+"</td></tr>";j+='<tr><td class="delmsg" style="white-space:pre;">'+b.msg+"</td></tr><tr><td >&#160;</td></tr>";j+="</tbody></table></div>";j+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+
288
- h+"_2'><tbody><tr><td class='DataTD ui-widget-content'></td></tr><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DelButton EditButton'>"+("<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>")+"</td></tr></tbody></table>";b.gbox="#gbox_"+F;createModal(f,j,b,"#gview_"+q.p.id,a("#gview_"+q.p.id)[0]);a(".fm-button",
289
- "#"+h+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});b.delicon=a.extend([true,"left","ui-icon-scissors"],b.delicon);b.cancelicon=a.extend([true,"left","ui-icon-cancel"],b.cancelicon);if(b.delicon[0]===true)a("#dData","#"+h+"_2").addClass(b.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.delicon[2]+"'></span>");if(b.cancelicon[0]===true)a("#eData","#"+h+"_2").addClass(b.cancelicon[1]==
290
- "right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.cancelicon[2]+"'></span>");a("#dData","#"+h+"_2").click(function(){var m=[true,""];z={};var u=a("#DelData>td","#"+h).text();if(typeof b.onclickSubmit==="function")z=b.onclickSubmit(c,u)||{};if(typeof b.beforeSubmit==="function")m=b.beforeSubmit(u);if(m[0]&&!c.processing){c.processing=true;a(this).addClass("ui-state-active");e=q.p.prmNames;p=a.extend({},c.delData,z);l=e.oper;p[l]=e.deloper;H=e.id;p[H]=u;var Q=a.extend({url:c.url?
291
- c.url:a(q).jqGrid("getGridParam","editurl"),type:b.mtype,data:a.isFunction(b.serializeDelData)?b.serializeDelData(p):p,complete:function(o,s){if(s!="success"){m[0]=false;m[1]=a.isFunction(c.errorTextFormat)?c.errorTextFormat(o):s+" Status: '"+o.statusText+"'. Error code: "+o.status}else if(typeof c.afterSubmit==="function")m=c.afterSubmit(o,p);if(m[0]===false){a("#DelError>td","#"+h).html(m[1]);a("#DelError","#"+h).show()}else{if(c.reloadAfterSubmit&&q.p.datatype!="local")a(q).trigger("reloadGrid");
292
- else{s=[];s=u.split(",");if(q.p.treeGrid===true)try{a(q).jqGrid("delTreeNode",s[0])}catch(E){}else for(var J=0;J<s.length;J++)a(q).jqGrid("delRowData",s[J]);q.p.selrow=null;q.p.selarrrow=[]}a.isFunction(c.afterComplete)&&setTimeout(function(){c.afterComplete(o,u)},500)}c.processing=false;a("#dData","#"+h+"_2").removeClass("ui-state-active");m[0]&&hideModal("#"+f.themodal,{gb:"#gbox_"+F,jqm:b.jqModal,onClose:c.onClose})},error:function(o,s,E){a("#DelError>td","#"+h).html(s+" : "+E);a("#DelError","#"+
293
- h).show();c.processing=false;a("#dData","#"+h+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,b.ajaxDelOptions);if(!Q.url&&!c.useDataProxy)if(a.isFunction(q.p.dataProxy))c.useDataProxy=true;else{m[0]=false;m[1]+=" "+a.jgrid.errors.nourl}if(m[0])c.useDataProxy?q.p.dataProxy.call(q,Q,"del_"+q.p.id):a.ajax(Q)}if(m[0]===false){a("#DelError>td","#"+h).html(m[1]);a("#DelError","#"+h).show()}return false});a("#eData","#"+h+"_2").click(function(){hideModal("#"+f.themodal,{gb:"#gbox_"+F,jqm:b.jqModal,
294
- onClose:c.onClose});return false});C&&b.beforeShowForm(a("#"+h));viewModal("#"+f.themodal,{gbox:"#gbox_"+F,jqm:b.jqModal,modal:b.modal})}t&&b.afterShowForm(a("#"+h));b.closeOnEscape===true&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+f.modalhead).focus()},0)}})},navGrid:function(d,b,q,C,t,F,z){b=a.extend({edit:true,editicon:"ui-icon-pencil",add:true,addicon:"ui-icon-plus",del:true,delicon:"ui-icon-trash",search:true,searchicon:"ui-icon-search",refresh:true,refreshicon:"ui-icon-refresh",
295
- refreshstate:"firstpage",view:false,viewicon:"ui-icon-document",position:"left",closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false},a.jgrid.nav,b||{});return this.each(function(){var h={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},p=this,H,e,l;if(!(!p.grid||typeof d!="string")){if(a("#"+h.themodal).html()===null){if(typeof window.innerWidth!="undefined"){H=window.innerWidth;e=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!=
296
- "undefined"&&document.documentElement.clientWidth!==0){H=document.documentElement.clientWidth;e=document.documentElement.clientHeight}else{H=1024;e=768}createModal(h,"<div>"+b.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+p.p.id,jqModal:true,drag:true,resize:true,caption:b.alertcap,top:e/2-25,left:H/2-100,width:200,height:"auto",closeOnEscape:b.closeOnEscape},"","",true)}H=1;if(b.cloneToTop&&p.p.toppager)H=2;for(e=0;e<H;e++){var f=a("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
297
- j,m;if(e===0){j=d;m=p.p.id;if(j==p.p.toppager){m+="_top";H=1}}else{j=p.p.toppager;m=p.p.id+"_top"}p.p.direction=="rtl"&&a(f).attr("dir","rtl").css("float","right");if(b.add){C=C||{};l=a("<td class='ui-pg-button ui-corner-all'></td>");a(l).append("<div class='ui-pg-div'><span class='ui-icon "+b.addicon+"'></span>"+b.addtext+"</div>");a("tr",f).append(l);a(l,f).attr({title:b.addtitle||"",id:C.id||"add_"+m}).click(function(){a(this).hasClass("ui-state-disabled")||(typeof b.addfunc=="function"?b.addfunc():
298
- a(p).jqGrid("editGridRow","new",C));return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(b.edit){l=a("<td class='ui-pg-button ui-corner-all'></td>");q=q||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+b.editicon+"'></span>"+b.edittext+"</div>");a("tr",f).append(l);a(l,f).attr({title:b.edittitle||"",id:q.id||"edit_"+m}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var u=
299
- p.p.selrow;if(u)typeof b.editfunc=="function"?b.editfunc(u):a(p).jqGrid("editGridRow",u,q);else{viewModal("#"+h.themodal,{gbox:"#gbox_"+p.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(b.view){l=a("<td class='ui-pg-button ui-corner-all'></td>");z=z||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+b.viewicon+"'></span>"+b.viewtext+
300
- "</div>");a("tr",f).append(l);a(l,f).attr({title:b.viewtitle||"",id:z.id||"view_"+m}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var u=p.p.selrow;if(u)a(p).jqGrid("viewGridRow",u,z);else{viewModal("#"+h.themodal,{gbox:"#gbox_"+p.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(b.del){l=a("<td class='ui-pg-button ui-corner-all'></td>");
301
- t=t||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+b.delicon+"'></span>"+b.deltext+"</div>");a("tr",f).append(l);a(l,f).attr({title:b.deltitle||"",id:t.id||"del_"+m}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var u;if(p.p.multiselect){u=p.p.selarrrow;if(u.length===0)u=null}else u=p.p.selrow;if(u)"function"==typeof b.delfunc?b.delfunc(u):a(p).jqGrid("delGridRow",u,t);else{viewModal("#"+h.themodal,{gbox:"#gbox_"+p.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
302
- a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(b.add||b.edit||b.del||b.view)a("tr",f).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");if(b.search){l=a("<td class='ui-pg-button ui-corner-all'></td>");F=F||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+b.searchicon+"'></span>"+b.searchtext+"</div>");a("tr",f).append(l);a(l,f).attr({title:b.searchtitle||"",id:F.id||"search_"+
303
- m}).click(function(){a(this).hasClass("ui-state-disabled")||a(p).jqGrid("searchGrid",F);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(b.refresh){l=a("<td class='ui-pg-button ui-corner-all'></td>");a(l).append("<div class='ui-pg-div'><span class='ui-icon "+b.refreshicon+"'></span>"+b.refreshtext+"</div>");a("tr",f).append(l);a(l,f).attr({title:b.refreshtitle||"",id:"refresh_"+m}).click(function(){if(!a(this).hasClass("ui-state-disabled")){a.isFunction(b.beforeRefresh)&&
304
- b.beforeRefresh();p.p.search=false;try{a("#fbox_"+p.p.id).searchFilter().reset({reload:false});a.isFunction(p.clearToolbar)&&p.clearToolbar(false)}catch(u){}switch(b.refreshstate){case "firstpage":a(p).trigger("reloadGrid",[{page:1}]);break;case "current":a(p).trigger("reloadGrid",[{current:true}]);break}a.isFunction(b.afterRefresh)&&b.afterRefresh()}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
305
- l=null}l=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+l+";visibility:hidden;' ></div>");l=a(f).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(j+"_"+b.position,j).append(f);if(p.p._nvtd){if(l>p.p._nvtd[0]){a(j+"_"+b.position,j).width(l);p.p._nvtd[0]=l}p.p._nvtd[1]=l}f=l=l=null}}})},navButtonAdd:function(d,b){b=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,
306
- position:"last",cursor:"pointer"},b||{});return this.each(function(){if(this.grid){if(d.indexOf("#")!==0)d="#"+d;var q=a(".navtable",d)[0],C=this;if(q){var t=a("<td></td>");b.buttonicon.toString().toUpperCase()=="NONE"?a(t).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+b.caption+"</div>"):a(t).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+b.buttonicon+"'></span>"+b.caption+"</div>");b.id&&a(t).attr("id",b.id);if(b.position==
307
- "first")q.rows[0].cells.length===0?a("tr",q).append(t):a("tr td:eq(0)",q).before(t);else a("tr",q).append(t);a(t,q).attr("title",b.title||"").click(function(F){a(this).hasClass("ui-state-disabled")||a.isFunction(b.onClickButton)&&b.onClickButton.call(C,F);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},navSeparatorAdd:function(d,b){b=a.extend({sepclass:"ui-separator",sepcontent:""},b||
308
- {});return this.each(function(){if(this.grid){if(d.indexOf("#")!==0)d="#"+d;var q=a(".navtable",d)[0];if(q){var C="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+b.sepclass+"'></span>"+b.sepcontent+"</td>";a("tr",q).append(C)}}})},GridToForm:function(d,b){return this.each(function(){var q=this;if(q.grid){var C=a(q).jqGrid("getRowData",d);if(C)for(var t in C)a("[name="+t+"]",b).is("input:radio")||a("[name="+t+"]",b).is("input:checkbox")?a("[name="+t+"]",b).each(function(){a(this).val()==
309
- C[t]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+t+"]",b).val(C[t])}})},FormToGrid:function(d,b,q,C){return this.each(function(){var t=this;if(t.grid){q||(q="set");C||(C="first");var F=a(b).serializeArray(),z={};a.each(F,function(h,p){z[p.name]=p.value});if(q=="add")a(t).jqGrid("addRowData",d,z,C);else q=="set"&&a(t).jqGrid("setRowData",d,z)}})}})})(jQuery);
310
- jQuery.fn.searchFilter=function(k,H){function I(e,l,v){this.$=e;this.add=function(a){a==null?e.find(".ui-add-last").click():e.find(".sf:eq("+a+") .ui-add").click();return this};this.del=function(a){a==null?e.find(".sf:last .ui-del").click():e.find(".sf:eq("+a+") .ui-del").click();return this};this.search=function(){e.find(".ui-search").click();return this};this.reset=function(a){if(a===undefined)a=false;e.find(".ui-reset").trigger("click",[a]);return this};this.close=function(){e.find(".ui-closer").click();
311
- return this};if(l!=null){function C(){jQuery(this).toggleClass("ui-state-hover");return false}function D(a){jQuery(this).toggleClass("ui-state-active",a.type=="mousedown");return false}function m(a,b){return"<option value='"+a+"'>"+b+"</option>"}function w(a,b,d){return"<select class='"+a+"'"+(d?" style='display:none;'":"")+">"+b+"</select>"}function E(a,b){a=e.find("tr.sf td.data "+a);a[0]!=null&&b(a)}function F(a,b){var d=e.find("tr.sf td.data "+a);d[0]!=null&&jQuery.each(b,function(){this.data!=
312
- null?d.bind(this.type,this.data,this.fn):d.bind(this.type,this.fn)})}var f=jQuery.extend({},jQuery.fn.searchFilter.defaults,v),n=-1,r="";jQuery.each(f.groupOps,function(){r+=m(this.op,this.text)});r="<select name='groupOp'>"+r+"</select>";e.html("").addClass("ui-searchFilter").append("<div class='ui-widget-overlay' style='z-index: -1'>&#160;</div><table class='ui-widget-content ui-corner-all'><thead><tr><td colspan='5' class='ui-widget-header ui-corner-all' style='line-height: 18px;'><div class='ui-closer ui-state-default ui-corner-all ui-helper-clearfix' style='float: right;'><span class='ui-icon ui-icon-close'></span></div>"+
313
- f.windowTitle+"</td></tr></thead><tbody><tr class='sf'><td class='fields'></td><td class='ops'></td><td class='data'></td><td><div class='ui-del ui-state-default ui-corner-all'><span class='ui-icon ui-icon-minus'></span></div></td><td><div class='ui-add ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plus'></span></div></td></tr><tr><td colspan='5' class='divider'><div>&#160;</div></td></tr></tbody><tfoot><tr><td colspan='3'><span class='ui-reset ui-state-default ui-corner-all' style='display: inline-block; float: left;'><span class='ui-icon ui-icon-arrowreturnthick-1-w' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+
314
- f.resetText+"</span></span><span class='ui-search ui-state-default ui-corner-all' style='display: inline-block; float: right;'><span class='ui-icon ui-icon-search' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+f.searchText+"</span></span><span class='matchText'>"+f.matchText+"</span> "+r+" <span class='rulesText'>"+f.rulesText+"</span></td><td>&#160;</td><td><div class='ui-add-last ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plusthick'></span></div></td></tr></tfoot></table>");
315
- var x=e.find("tr.sf"),G=x.find("td.fields"),y=x.find("td.ops"),o=x.find("td.data"),s="";jQuery.each(f.operators,function(){s+=m(this.op,this.text)});s=w("default",s,true);y.append(s);o.append("<input type='text' class='default' style='display:none;' />");var t="",z=false,p=false;jQuery.each(l,function(a){t+=m(this.itemval,this.text);if(this.ops!=null){z=true;var b="";jQuery.each(this.ops,function(){b+=m(this.op,this.text)});b=w("field"+a,b,true);y.append(b)}if(this.dataUrl!=null){if(a>n)n=a;p=true;
316
- var d=this.dataEvents,c=this.dataInit,g=this.buildSelect;jQuery.ajax(jQuery.extend({url:this.dataUrl,complete:function(h){h=g!=null?jQuery("<div />").append(g(h)):jQuery("<div />").append(h.responseText);h.find("select").addClass("field"+a).hide();o.append(h.html());c&&E(".field"+a,c);d&&F(".field"+a,d);a==n&&e.find("tr.sf td.fields select[name='field']").change()}},f.ajaxSelectOptions))}else if(this.dataValues!=null){p=true;var i="";jQuery.each(this.dataValues,function(){i+=m(this.value,this.text)});
317
- i=w("field"+a,i,true);o.append(i)}else if(this.dataEvents!=null||this.dataInit!=null){p=true;i="<input type='text' class='field"+a+"' />";o.append(i)}this.dataInit!=null&&a!=n&&E(".field"+a,this.dataInit);this.dataEvents!=null&&a!=n&&F(".field"+a,this.dataEvents)});t="<select name='field'>"+t+"</select>";G.append(t);l=G.find("select[name='field']");z?l.change(function(a){var b=a.target.selectedIndex;a=jQuery(a.target).parents("tr.sf").find("td.ops");a.find("select").removeAttr("name").hide();b=a.find(".field"+
318
- b);if(b[0]==null)b=a.find(".default");b.attr("name","op").show();return false}):y.find(".default").attr("name","op").show();p?l.change(function(a){var b=a.target.selectedIndex;a=jQuery(a.target).parents("tr.sf").find("td.data");a.find("select,input").removeClass("vdata").hide();b=a.find(".field"+b);if(b[0]==null)b=a.find(".default");b.show().addClass("vdata");return false}):o.find(".default").show().addClass("vdata");if(z||p)l.change();e.find(".ui-state-default").hover(C,C).mousedown(D).mouseup(D);
319
- e.find(".ui-closer").click(function(){f.onClose(jQuery(e.selector));return false});e.find(".ui-del").click(function(a){a=jQuery(a.target).parents(".sf");if(a.siblings(".sf").length>0){f.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&a.find(".hasDatepicker").datepicker("destroy");a.remove()}else{a.find("select[name='field']")[0].selectedIndex=0;a.find("select[name='op']")[0].selectedIndex=0;a.find(".data input").val("");a.find(".data select").each(function(){this.selectedIndex=0});a.find("select[name='field']").change(function(b){b.stopPropagation()})}return false});
320
- e.find(".ui-add").click(function(a){a=jQuery(a.target).parents(".sf");var b=a.clone(true).insertAfter(a);b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");if(f.clone){b.find("select[name='field']")[0].selectedIndex=a.find("select[name='field']")[0].selectedIndex;if(b.find("select[name='op']")[0]!=null)b.find("select[name='op']").focus()[0].selectedIndex=a.find("select[name='op']")[0].selectedIndex;var d=b.find("select.vdata");if(d[0]!=null)d[0].selectedIndex=a.find("select.vdata")[0].selectedIndex}else{b.find(".data input").val("");
321
- b.find("select[name='field']").focus()}f.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&a.find(".hasDatepicker").each(function(){var c=jQuery.data(this,"datepicker").settings;b.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(c)});b.find("select[name='field']").change(function(c){c.stopPropagation()});return false});e.find(".ui-search").click(function(){var a=jQuery(e.selector),b,d=a.find("select[name='groupOp'] :selected").val();b=f.stringResult?'{"groupOp":"'+
322
- d+'","rules":[':{groupOp:d,rules:[]};a.find(".sf").each(function(c){var g=jQuery(this).find("select[name='field'] :selected").val(),i=jQuery(this).find("select[name='op'] :selected").val(),h=jQuery(this).find("input.vdata,select.vdata :selected").val();h+="";h=h.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');if(f.stringResult){if(c>0)b+=",";b+='{"field":"'+g+'",';b+='"op":"'+i+'",';b+='"data":"'+h+'"}'}else b.rules.push({field:g,op:i,data:h})});if(f.stringResult)b+="]}";f.onSearch(b);return false});e.find(".ui-reset").click(function(a,
323
- b){a=jQuery(e.selector);a.find(".ui-del").click();a.find("select[name='groupOp']")[0].selectedIndex=0;f.onReset(b);return false});e.find(".ui-add-last").click(function(){var a=jQuery(e.selector+" .sf:last"),b=a.clone(true).insertAfter(a);b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");b.find(".data input").val("");b.find("select[name='field']").focus();f.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&a.find(".hasDatepicker").each(function(){var d=jQuery.data(this,
324
- "datepicker").settings;b.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(d)});b.find("select[name='field']").change(function(d){d.stopPropagation()});return false});this.setGroupOp=function(a){selDOMobj=e.find("select[name='groupOp']")[0];var b={},d=selDOMobj.options.length,c;for(c=0;c<d;c++)b[selDOMobj.options[c].value]=c;selDOMobj.selectedIndex=b[a];jQuery(selDOMobj).change(function(g){g.stopPropagation()})};this.setFilter=function(a){var b=a.sfref;a=a.filter;
325
- var d=[],c,g,i,h,j={};selDOMobj=b.find("select[name='field']")[0];c=0;for(i=selDOMobj.options.length;c<i;c++){j[selDOMobj.options[c].value]={index:c,ops:{}};d.push(selDOMobj.options[c].value)}c=0;for(i=d.length;c<i;c++){if(selDOMobj=b.find(".ops > select[class='field"+c+"']")[0]){g=0;for(h=selDOMobj.options.length;g<h;g++)j[d[c]].ops[selDOMobj.options[g].value]=g}if(selDOMobj=b.find(".data > select[class='field"+c+"']")[0]){j[d[c]].data={};g=0;for(h=selDOMobj.options.length;g<h;g++)j[d[c]].data[selDOMobj.options[g].value]=
326
- g}}var u,q,A,B;d=a.field;if(j[d])u=j[d].index;if(u!=null){q=j[d].ops[a.op];if(q===undefined){c=0;for(i=v.operators.length;c<i;c++)if(v.operators[c].op==a.op){q=c;break}}A=a.data;B=j[d].data==null?-1:j[d].data[A]}if(u!=null&&q!=null&&B!=null){b.find("select[name='field']")[0].selectedIndex=u;b.find("select[name='field']").change();b.find("select[name='op']")[0].selectedIndex=q;b.find("input.vdata").val(A);if(b=b.find("select.vdata")[0])b.selectedIndex=B;return true}else return false}}}return new I(this,
327
- k,H)};jQuery.fn.searchFilter.version="1.2.9";
328
- jQuery.fn.searchFilter.defaults={clone:true,datepickerFix:true,onReset:function(k){alert("Reset Clicked. Data Returned: "+k)},onSearch:function(k){alert("Search Clicked. Data Returned: "+k)},onClose:function(k){k.hide()},groupOps:[{op:"AND",text:"all"},{op:"OR",text:"any"}],operators:[{op:"eq",text:"is equal to"},{op:"ne",text:"is not equal to"},{op:"lt",text:"is less than"},{op:"le",text:"is less or equal to"},{op:"gt",text:"is greater than"},{op:"ge",text:"is greater or equal to"},{op:"in",text:"is in"},
198
+ (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+=
199
+ b.offsetLeft;d+=b.offsetTop}while(b=b.offsetParent)}return[c,d]},createModal:function(b,c,d,f,g,h){var e=document.createElement("div"),i,n=this;i=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 j=document.createElement("div");j.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";j.id=b.modalhead;a(j).append("<span class='ui-jqdialog-title'>"+d.caption+"</span>");var k=a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){k.addClass("ui-state-hover")},
200
+ function(){k.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");a(j).append(k);if(i){e.dir="rtl";a(".ui-jqdialog-title",j).css("float","right");a(".ui-jqdialog-titlebar-close",j).css("left","0.3em")}else{e.dir="ltr";a(".ui-jqdialog-title",j).css("float","left");a(".ui-jqdialog-titlebar-close",j).css("right","0.3em")}var m=document.createElement("div");a(m).addClass("ui-jqdialog-content ui-widget-content").attr("id",b.modalcontent);a(m).append(c);e.appendChild(m);
201
+ a(e).prepend(j);h===true?a("body").append(e):a(e).insertBefore(f);if(typeof d.jqModal==="undefined")d.jqModal=true;c={};if(a.fn.jqm&&d.jqModal===true){if(d.left===0&&d.top===0){m=[];m=this.findPos(g);d.left=m[0]+4;d.top=m[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",j).click(function(){var l=a("#"+b.themodal).data("onClose")||d.onClose,o=a("#"+b.themodal).data("gbox")||d.gbox;n.hideModal("#"+b.themodal,{gb:o,jqm:d.jqModal,
202
+ onClose:l});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]").first().css("z-index");d.zIndex=f?parseInt(f)+1:950}f=0;if(i&&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",
203
+ 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(j).css("cursor","move");if(a.fn.jqDrag)a(e).jqDrag(j);else try{a(e).draggable({handle:a("#"+j.id)})}catch(q){}}if(d.resize)if(a.fn.jqResize){a(e).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>");a("#"+b.themodal).jqResize(".jqResize",b.scrollelm?
204
+ "#"+b.scrollelm:false)}else try{a(e).resizable({handles:"se, sw",alsoResize:b.scrollelm?"#"+b.scrollelm:false})}catch(p){}d.closeOnEscape===true&&a(e).keydown(function(l){if(l.which==27){l=a("#"+b.themodal).data("onClose")||d.onClose;n.hideModal(this,{gb:d.gbox,jqm:d.jqModal,onClose:l})}})},viewModal:function(b,c){c=a.extend({toTop:true,overlay:10,modal:false,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():
205
+ 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>"+b+"</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,e=
206
+ this;if(a.fn.jqm&&!h)h=false;b="";if(g.buttons.length>0)for(f=0;f<g.buttons.length;f++){if(typeof g.buttons[f].id=="undefined")g.buttons[f].id="info_button_"+f;b+="<a href='javascript:void(0)' id='"+g.buttons[f].id+"' class='fm-button ui-state-default ui-corner-all'>"+g.buttons[f].text+"</a>"}f=isNaN(g.dataheight)?g.dataheight:g.dataheight+"px";var i="<div id='info_id'>";i+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+f+";"+("text-align:"+
207
+ g.align+";")+"'>"+c+"</div>";i+=d?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+g.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+d+"</a>"+b+"</div>":b!==""?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+g.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+
208
+ b+"</div>":"";i+="</div>";try{a("#info_dialog").attr("aria-hidden")=="false"&&this.hideModal("#info_dialog",{jqm:h});a("#info_dialog").remove()}catch(n){}this.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},i,g,"","",true);b&&a.each(g.buttons,function(k){a("#"+this.id,"#info_id").bind("click",function(){g.buttons[k].onClick.call(a("#info_dialog"));return false})});a("#closedialog","#info_id").click(function(){e.hideModal("#info_dialog",{jqm:h});
209
+ 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(k){k.w.hide().remove();k.o&&k.o.remove()},modal:g.modal,jqm:h});a.isFunction(g.afterOpen)&&g.afterOpen();try{a("#info_dialog").focus()}catch(j){}},createEl:function(b,c,d,f,g){function h(l,o){if(a.isFunction(o.dataInit)){l.id=o.id;o.dataInit(l);delete o.id;delete o.dataInit}if(o.dataEvents){a.each(o.dataEvents,
210
+ function(){this.data!==undefined?a(l).bind(this.type,this.data,this.fn):a(l).bind(this.type,this.fn)});delete o.dataEvents}return o}var e="";c.defaultValue&&delete c.defaultValue;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=="&nbsp;"||d=="&#160;"||d.length==1&&d.charCodeAt(0)==160)d="";e.value=d;c=h(e,c);a(e).attr(c).attr({role:"textbox",multiline:"true"});break;case "checkbox":e=document.createElement("input");
211
+ e.type="checkbox";if(c.value){var i=c.value.split(":");if(d===i[0]){e.checked=true;e.defaultChecked=true}e.value=i[0];a(e).attr("offval",i[1]);try{delete c.value}catch(n){}}else{i=d.toLowerCase();if(i.search(/(false|0|no|off|undefined)/i)<0&&i!==""){e.checked=true;e.defaultChecked=true;e.value=d}else e.value="on";a(e).attr("offval","off")}c=h(e,c);a(e).attr(c).attr("role","checkbox");break;case "select":e=document.createElement("select");e.setAttribute("role","select");var j,k=[];if(c.multiple===
212
+ true){j=true;e.multiple="multiple";a(e).attr("aria-multiselectable","true")}else j=false;if(typeof c.dataUrl!="undefined")a.ajax(a.extend({url:c.dataUrl,type:"GET",dataType:"html",success:function(l){try{delete c.dataUrl;delete c.value}catch(o){}if(typeof c.buildSelect!="undefined"){l=c.buildSelect(l);l=a(l).html();delete c.buildSelect}else l=a(l).html();if(l){a(e).append(l);c=h(e,c);if(typeof c.size==="undefined")c.size=j?3:1;if(j){k=d.split(",");k=a.map(k,function(r){return a.trim(r)})}else k[0]=
213
+ a.trim(d);a(e).attr(c);setTimeout(function(){a("option",e).each(function(r){if(r===0)this.selected="";a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),k)>-1||a.inArray(a.trim(a(this).val()),k)>-1){this.selected="selected";if(!j)return false}})},0)}}},g||{}));else if(c.value){if(j){k=d.split(",");k=a.map(k,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();if(typeof c.value==="string"){f=c.value.split(";");
214
+ for(i=0;i<f.length;i++){g=f[i].split(":");if(g.length>2)g[1]=a.map(g,function(l,o){if(o>0)return l}).join(":");b=document.createElement("option");b.setAttribute("role","option");b.value=g[0];b.innerHTML=g[1];if(!j&&(a.trim(g[0])==a.trim(d)||a.trim(g[1])==a.trim(d)))b.selected="selected";if(j&&(a.inArray(a.trim(g[1]),k)>-1||a.inArray(a.trim(g[0]),k)>-1))b.selected="selected";e.appendChild(b)}}else if(typeof c.value==="object"){f=c.value;for(i in f)if(f.hasOwnProperty(i)){b=document.createElement("option");
215
+ b.setAttribute("role","option");b.value=i;b.innerHTML=f[i];if(!j&&(a.trim(i)==a.trim(d)||a.trim(f[i])==a.trim(d)))b.selected="selected";if(j&&(a.inArray(a.trim(f[i]),k)>-1||a.inArray(a.trim(i),k)>-1))b.selected="selected";e.appendChild(b)}}c=h(e,c);try{delete c.value}catch(m){}a(e).attr(c)}break;case "text":case "password":case "button":i=b=="button"?"button":"textbox";e=document.createElement("input");e.type=b;e.value=d;c=h(e,c);if(b!="button")if(f)c.size||a(e).css({width:"98%"});else if(!c.size)c.size=
216
+ 20;a(e).attr(c).attr("role",i);break;case "image":case "file":e=document.createElement("input");e.type=b;c=h(e,c);a(e).attr(c);break;case "custom":e=document.createElement("span");try{if(a.isFunction(c.custom_element)){var q=c.custom_element.call(this,d,c);if(q){q=a(q).addClass("customelement").attr({id:c.id,name:c.name});a(e).empty().append(q)}else throw"e2";}else throw"e1";}catch(p){p=="e1"&&this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose);
217
+ p=="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 p==="string"?p:p.message,a.jgrid.edit.bClose)}break}return e},checkDate:function(b,c){var d=function(k){return k%4===0&&(k%100!==0||k%400===0)?29:28},f={},g;b=b.toLowerCase();g=b.indexOf("/")!=-1?"/":b.indexOf("-")!=-1?"-":b.indexOf(".")!=-1?".":"/";b=b.split(g);c=c.split(g);if(c.length!=3)return false;g=-1;for(var h,e=-1,i=-1,n=0;n<
218
+ b.length;n++){h=isNaN(c[n])?0:parseInt(c[n],10);f[b[n]]=h;h=b[n];if(h.indexOf("y")!=-1)g=n;if(h.indexOf("m")!=-1)i=n;if(h.indexOf("d")!=-1)e=n}h=b[g]=="y"||b[g]=="yyyy"?4:b[g]=="yy"?2:-1;n=function(k){for(var m=1;m<=k;m++){this[m]=31;if(m==4||m==6||m==9||m==11)this[m]=30;if(m==2)this[m]=29}return this}(12);var j;if(g===-1)return false;else{j=f[b[g]].toString();if(h==2&&j.length==1)h=1;if(j.length!=h||f[b[g]]===0&&c[g]!="00")return false}if(i===-1)return false;else{j=f[b[i]].toString();if(j.length<
219
+ 1||f[b[i]]<1||f[b[i]]>12)return false}if(e===-1)return false;else{j=f[b[e]].toString();if(j.length<1||f[b[e]]<1||f[b[e]]>31||f[b[i]]==2&&f[b[e]]>d(f[b[g]])||f[b[e]]>n[f[b[i]]])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,
220
+ c,d){var f,g,h,e;if(typeof c=="string"){g=0;for(e=d.p.colModel.length;g<e;g++)if(d.p.colModel[g].name==c){f=d.p.colModel[g].editrules;c=g;try{h=d.p.colModel[g].formoptions.label}catch(i){}break}}else if(c>=0)f=d.p.colModel[c].editrules;if(f){h||(h=d.p.colNames[c]);if(f.required===true)if(this.isEmpty(b))return[false,h+": "+a.jgrid.edit.msg.required,""];g=f.required===false?false:true;if(f.number===true)if(!(g===false&&this.isEmpty(b)))if(isNaN(b))return[false,h+": "+a.jgrid.edit.msg.number,""];if(typeof f.minValue!=
221
+ "undefined"&&!isNaN(f.minValue))if(parseFloat(b)<parseFloat(f.minValue))return[false,h+": "+a.jgrid.edit.msg.minValue+" "+f.minValue,""];if(typeof f.maxValue!="undefined"&&!isNaN(f.maxValue))if(parseFloat(b)>parseFloat(f.maxValue))return[false,h+": "+a.jgrid.edit.msg.maxValue+" "+f.maxValue,""];if(f.email===true)if(!(g===false&&this.isEmpty(b))){e=/^((([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;
222
+ if(!e.test(b))return[false,h+": "+a.jgrid.edit.msg.email,""]}if(f.integer===true)if(!(g===false&&this.isEmpty(b))){if(isNaN(b))return[false,h+": "+a.jgrid.edit.msg.integer,""];if(b%1!==0||b.indexOf(".")!=-1)return[false,h+": "+a.jgrid.edit.msg.integer,""]}if(f.date===true)if(!(g===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,h+": "+a.jgrid.edit.msg.date+
223
+ " - "+c,""]}if(f.time===true)if(!(g===false&&this.isEmpty(b)))if(!this.checkTime(b))return[false,h+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(f.url===true)if(!(g===false&&this.isEmpty(b))){e=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!e.test(b))return[false,h+": "+a.jgrid.edit.msg.url,""]}if(f.custom===true)if(!(g===false&&this.isEmpty(b)))if(a.isFunction(f.custom_func)){b=f.custom_func.call(d,b,h);return a.isArray(b)?
224
+ b:[false,a.jgrid.edit.msg.customarray,""]}else return[false,a.jgrid.edit.msg.customfcheck,""]}return[true,"",""]}})})(jQuery);
225
+ (function(a){var c=null;a.jgrid.extend({searchGrid:function(e){e=a.extend({recreateFilter:false,drag:true,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",loadDefaults:true,beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,closeAfterSearch:false,closeAfterReset:false,closeOnEscape:false,multipleSearch:false,cloneSearchRowOnAdd:true,sopt:null,stringResult:undefined,onClose:null,useDataProxy:false,overlay:true},a.jgrid.search,e||{});return this.each(function(){function b(l,
226
+ u){u=l.p.postData[u.sFilter];if(typeof u=="string")u=a.jgrid.parse(u);if(u){u.groupOp&&l.SearchFilter.setGroupOp(u.groupOp);if(u.rules){var t,I=0,i=u.rules.length;for(t=false;I<i;I++){t=u.rules[I];if(t.field!==undefined&&t.op!==undefined&&t.data!==undefined)(t=l.SearchFilter.setFilter({sfref:l.SearchFilter.$.find(".sf:last"),filter:a.extend({},t)}))&&l.SearchFilter.add()}}}}function p(l){if(e.onClose){var u=e.onClose(l);if(typeof u=="boolean"&&!u)return}l.hide();e.overlay===true&&a(".jqgrid-overlay:first",
227
+ "#gbox_"+w.p.id).hide()}function F(){var l=a(".ui-searchFilter").length;if(l>1){var u=a("#"+o).css("zIndex");a("#"+o).css({zIndex:parseInt(u,10)+l})}a("#"+o).show();e.overlay===true&&a(".jqgrid-overlay:first","#gbox_"+w.p.id).show();try{a(":input:visible","#"+o)[0].focus()}catch(t){}}function y(l){var u=l!==undefined,t=a("#"+w.p.id),I={};if(e.multipleSearch===false){I[e.sField]=l.rules[0].field;I[e.sValue]=l.rules[0].data;I[e.sOper]=l.rules[0].op}else I[e.sFilter]=l;t[0].p.search=u;a.extend(t[0].p.postData,
228
+ I);t.trigger("reloadGrid",[{page:1}]);e.closeAfterSearch&&p(a("#"+o))}function z(l){l=l&&l.hasOwnProperty("reload")?l.reload:true;var u=a("#"+w.p.id),t={};u[0].p.search=false;if(e.multipleSearch===false)t[e.sField]=t[e.sValue]=t[e.sOper]="";else t[e.sFilter]="";a.extend(u[0].p.postData,t);l&&u.trigger("reloadGrid",[{page:1}]);e.closeAfterReset&&p(a("#"+o))}var w=this;if(w.grid){var o="fbox_"+w.p.id,m=true;if(a.fn.searchFilter){e.recreateFilter===true&&a("#"+o).remove();if(a("#"+o).html()!=null){if(a.isFunction(e.beforeShowSearch)){m=
229
+ e.beforeShowSearch(a("#"+o));if(typeof m=="undefined")m=true}if(m!==false){F();a.isFunction(e.afterShowSearch)&&e.afterShowSearch(a("#"+o))}}else{var r=[],v=a("#"+w.p.id).jqGrid("getGridParam","colNames"),d=a("#"+w.p.id).jqGrid("getGridParam","colModel"),q=["eq","ne","lt","le","gt","ge","bw","bn","in","ni","ew","en","cn","nc"],h,j,k,E=[];if(e.sopt!==null)for(h=k=0;h<e.sopt.length;h++){if((j=a.inArray(e.sopt[h],q))!=-1){E[k]={op:e.sopt[h],text:e.odata[j]};k++}}else for(h=0;h<q.length;h++)E[h]={op:q[h],
230
+ text:e.odata[h]};a.each(d,function(l,u){var t=typeof u.search==="undefined"?true:u.search,I=u.hidden===true;l=a.extend({},{text:v[l],itemval:u.index||u.name},this.searchoptions);u=l.searchhidden===true;if(typeof l.sopt!=="undefined"){k=0;l.ops=[];if(l.sopt.length>0)for(h=0;h<l.sopt.length;h++)if((j=a.inArray(l.sopt[h],q))!=-1){l.ops[k]={op:l.sopt[h],text:e.odata[j]};k++}}if(typeof this.stype==="undefined")this.stype="text";if(this.stype=="select")if(l.dataUrl===undefined){var i;if(l.value)i=l.value;
231
+ else if(this.editoptions)i=this.editoptions.value;if(i){l.dataValues=[];if(typeof i==="string"){i=i.split(";");var f;for(h=0;h<i.length;h++){f=i[h].split(":");l.dataValues[h]={value:f[0],text:f[1]}}}else if(typeof i==="object"){h=0;for(f in i)if(i.hasOwnProperty(f)){l.dataValues[h]={value:f,text:i[f]};h++}}}}if(u&&t||t&&!I)r.push(l)});if(r.length>0){a("<div id='"+o+"' role='dialog' tabindex='-1'></div>").insertBefore("#gview_"+w.p.id);if(e.stringResult===undefined)e.stringResult=e.multipleSearch;
232
+ w.SearchFilter=a("#"+o).searchFilter(r,{groupOps:e.groupOps,operators:E,onClose:p,resetText:e.Reset,searchText:e.Find,windowTitle:e.caption,rulesText:e.rulesText,matchText:e.matchText,onSearch:y,onReset:z,stringResult:e.stringResult,ajaxSelectOptions:a.extend({},a.jgrid.ajaxOptions,w.p.ajaxSelectOptions||{}),clone:e.cloneSearchRowOnAdd});a(".ui-widget-overlay","#"+o).remove();w.p.direction=="rtl"&&a(".ui-closer","#"+o).css("float","left");if(e.drag===true){a("#"+o+" table thead tr:first td:first").css("cursor",
233
+ "move");if(jQuery.fn.jqDrag)a("#"+o).jqDrag(a("#"+o+" table thead tr:first td:first"));else try{a("#"+o).draggable({handle:a("#"+o+" table thead tr:first td:first")})}catch(P){}}if(e.multipleSearch===false){a(".ui-del, .ui-add, .ui-del, .ui-add-last, .matchText, .rulesText","#"+o).hide();a("select[name='groupOp']","#"+o).hide()}e.multipleSearch===true&&e.loadDefaults===true&&b(w,e);a.isFunction(e.onInitializeSearch)&&e.onInitializeSearch(a("#"+o));if(a.isFunction(e.beforeShowSearch)){m=e.beforeShowSearch(a("#"+
234
+ o));if(typeof m=="undefined")m=true}if(m!==false){F();a.isFunction(e.afterShowSearch)&&e.afterShowSearch(a("#"+o));e.closeOnEscape===true&&a("#"+o).keydown(function(l){l.which==27&&p(a("#"+o));l.which==13&&a(".ui-search",this).click()})}}}}}})},editGridRow:function(e,b){c=b=a.extend({top:0,left:0,width:300,height:"auto",dataheight:"auto",modal:false,overlay:10,drag:true,resize:true,url:null,mtype:"POST",clearAfterAdd:true,closeAfterEdit:false,reloadAfterSubmit:true,onInitializeForm:null,beforeInitData:null,
235
+ beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:false,jqModal:true,closeOnEscape:false,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[false,13],navkeys:[false,38,40],checkOnSubmit:false,checkOnUpdate:false,_savedData:{},processing:false,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:true},a.jgrid.edit,b||{});return this.each(function(){function p(){a(".FormElement",
236
+ "#"+j).each(function(){var g=a(".customelement",this);if(g.length){var n=a(g[0]).attr("name");a.each(d.p.colModel,function(){if(this.name==n&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{f[n]=this.editoptions.custom_value(a("#"+n,"#"+j),"get");if(f[n]===undefined)throw"e1";}catch(s){s=="e1"?a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,s.message,jQuery.jgrid.edit.bClose)}return true}})}else{switch(a(this).get(0).type){case "checkbox":if(a(this).attr("checked"))f[this.name]=
237
+ a(this).val();else{g=a(this).attr("offval");f[this.name]=g}break;case "select-one":f[this.name]=a("option:selected",this).val();J[this.name]=a("option:selected",this).text();break;case "select-multiple":f[this.name]=a(this).val();f[this.name]=f[this.name]?f[this.name].join(","):"";var x=[];a("option:selected",this).each(function(s,G){x[s]=a(G).text()});J[this.name]=x.join(",");break;case "password":case "text":case "textarea":case "button":f[this.name]=a(this).val();break}if(d.p.autoencode)f[this.name]=
238
+ a.jgrid.htmlEncode(f[this.name])}});return true}function F(g,n,x,s){for(var G,B,C,L=0,A,M,D,S=[],H=false,aa="",Q=1;Q<=s;Q++)aa+="<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>";if(g!="_empty")H=a(n).jqGrid("getInd",g);a(n.p.colModel).each(function(U){G=this.name;M=(B=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";if(G!=="cb"&&G!=="subgrid"&&this.editable===true&&G!=="rn"){if(H===false)A="";else if(G==n.p.ExpandColumn&&
239
+ n.p.treeGrid===true)A=a("td:eq("+U+")",n.rows[H]).text();else try{A=a.unformat(a("td:eq("+U+")",n.rows[H]),{rowId:g,colModel:this},U)}catch(da){A=a("td:eq("+U+")",n.rows[H]).html()}var W=a.extend({},this.editoptions||{},{id:G,name:G}),X=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),ba=parseInt(X.rowpos,10)||L+1,ea=parseInt((parseInt(X.colpos,10)||1)*2,10);if(g=="_empty"&&W.defaultValue)A=a.isFunction(W.defaultValue)?W.defaultValue():W.defaultValue;if(!this.edittype)this.edittype=
240
+ "text";if(d.p.autoencode)A=a.jgrid.htmlDecode(A);D=a.jgrid.createEl(this.edittype,W,A,false,a.extend({},a.jgrid.ajaxOptions,n.p.ajaxSelectOptions||{}));if(A===""&&this.edittype=="checkbox")A=a(D).attr("offval");if(A===""&&this.edittype=="select")A=a("option:eq(0)",D).text();if(c.checkOnSubmit||c.checkOnUpdate)c._savedData[G]=A;a(D).addClass("FormElement");if(this.edittype=="text"||this.edittype=="textarea")a(D).addClass("ui-widget-content ui-corner-all");C=a(x).find("tr[rowpos="+ba+"]");if(X.rowabove){W=
241
+ a("<tr><td class='contentinfo' colspan='"+s*2+"'>"+X.rowcontent+"</td></tr>");a(x).append(W);W[0].rp=ba}if(C.length===0){C=a("<tr "+M+" rowpos='"+ba+"'></tr>").addClass("FormData").attr("id","tr_"+G);a(C).append(aa);a(x).append(C);C[0].rp=ba}a("td:eq("+(ea-2)+")",C[0]).html(typeof X.label==="undefined"?n.p.colNames[U]:X.label);a("td:eq("+(ea-1)+")",C[0]).append(X.elmprefix).append(D).append(X.elmsuffix);S[L]=U;L++}});if(L>0){Q=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+
242
+ (s*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+n.p.id+"_id' value='"+g+"'/></td></tr>");Q[0].rp=L+999;a(x).append(Q);if(c.checkOnSubmit||c.checkOnUpdate)c._savedData[n.p.id+"_id"]=g}return S}function y(g,n,x){var s,G=0,B,C,L,A,M;if(c.checkOnSubmit||c.checkOnUpdate){c._savedData={};c._savedData[n.p.id+"_id"]=g}var D=n.p.colModel;if(g=="_empty"){a(D).each(function(){s=this.name;L=a.extend({},this.editoptions||{});C=a("#"+a.jgrid.jqID(s),"#"+x);if(C[0]!=null){A="";
243
+ if(L.defaultValue){A=a.isFunction(L.defaultValue)?L.defaultValue():L.defaultValue;if(C[0].type=="checkbox"){M=A.toLowerCase();if(M.search(/(false|0|no|off|undefined)/i)<0&&M!==""){C[0].checked=true;C[0].defaultChecked=true;C[0].value=A}else C.attr({checked:"",defaultChecked:""})}else C.val(A)}else if(C[0].type=="checkbox"){C[0].checked=false;C[0].defaultChecked=false;A=a(C).attr("offval")}else if(C[0].type&&C[0].type.substr(0,6)=="select")C[0].selectedIndex=0;else C.val(A);if(c.checkOnSubmit===true||
244
+ c.checkOnUpdate)c._savedData[s]=A}});a("#id_g","#"+x).val(g)}else{var S=a(n).jqGrid("getInd",g,true);if(S){a("td",S).each(function(H){s=D[H].name;if(s!=="cb"&&s!=="subgrid"&&s!=="rn"&&D[H].editable===true){if(s==n.p.ExpandColumn&&n.p.treeGrid===true)B=a(this).text();else try{B=a.unformat(a(this),{rowId:g,colModel:D[H]},H)}catch(aa){B=a(this).html()}if(d.p.autoencode)B=a.jgrid.htmlDecode(B);if(c.checkOnSubmit===true||c.checkOnUpdate)c._savedData[s]=B;s=a.jgrid.jqID(s);switch(D[H].edittype){case "password":case "text":case "button":case "image":a("#"+
245
+ s,"#"+x).val(B);break;case "textarea":if(B=="&nbsp;"||B=="&#160;"||B.length==1&&B.charCodeAt(0)==160)B="";a("#"+s,"#"+x).val(B);break;case "select":var Q=B.split(",");Q=a.map(Q,function(da){return a.trim(da)});a("#"+s+" option","#"+x).each(function(){this.selected=!D[H].editoptions.multiple&&(Q[0]==a.trim(a(this).text())||Q[0]==a.trim(a(this).val()))?true:D[H].editoptions.multiple?a.inArray(a.trim(a(this).text()),Q)>-1||a.inArray(a.trim(a(this).val()),Q)>-1?true:false:false});break;case "checkbox":B+=
246
+ "";if(D[H].editoptions&&D[H].editoptions.value)if(D[H].editoptions.value.split(":")[0]==B){a("#"+s,"#"+x).attr("checked",true);a("#"+s,"#"+x).attr("defaultChecked",true)}else{a("#"+s,"#"+x).attr("checked",false);a("#"+s,"#"+x).attr("defaultChecked","")}else{B=B.toLowerCase();if(B.search(/(false|0|no|off|undefined)/i)<0&&B!==""){a("#"+s,"#"+x).attr("checked",true);a("#"+s,"#"+x).attr("defaultChecked",true)}else{a("#"+s,"#"+x).attr("checked",false);a("#"+s,"#"+x).attr("defaultChecked","")}}break;case "custom":try{if(D[H].editoptions&&
247
+ a.isFunction(D[H].editoptions.custom_value))D[H].editoptions.custom_value(a("#"+s,"#"+x),"set",B);else throw"e1";}catch(U){U=="e1"?a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose):a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,U.message,jQuery.jgrid.edit.bClose)}break}G++}});G>0&&a("#id_g","#"+j).val(g)}}}function z(){var g,n=[true,"",""],x={},s=d.p.prmNames,G,B;if(a.isFunction(c.beforeCheckValues)){var C=c.beforeCheckValues(f,
248
+ a("#"+h),f[d.p.id+"_id"]=="_empty"?s.addoper:s.editoper);if(C&&typeof C==="object")f=C}for(var L in f)if(f.hasOwnProperty(L)){n=a.jgrid.checkValues(f[L],L,d);if(n[0]===false)break}if(n[0]){if(a.isFunction(c.onclickSubmit))x=c.onclickSubmit(c,f)||{};if(a.isFunction(c.beforeSubmit))n=c.beforeSubmit(f,a("#"+h))}if(n[0]&&!c.processing){c.processing=true;a("#sData","#"+j+"_2").addClass("ui-state-active");B=s.oper;G=s.id;f[B]=a.trim(f[d.p.id+"_id"])=="_empty"?s.addoper:s.editoper;if(f[B]!=s.addoper)f[G]=
249
+ f[d.p.id+"_id"];else if(f[G]===undefined)f[G]=f[d.p.id+"_id"];delete f[d.p.id+"_id"];f=a.extend(f,c.editData,x);x=a.extend({url:c.url?c.url:a(d).jqGrid("getGridParam","editurl"),type:c.mtype,data:a.isFunction(c.serializeEditData)?c.serializeEditData(f):f,complete:function(A,M){if(M!="success"){n[0]=false;n[1]=a.isFunction(c.errorTextFormat)?c.errorTextFormat(A):M+" Status: '"+A.statusText+"'. Error code: "+A.status}else if(a.isFunction(c.afterSubmit))n=c.afterSubmit(A,f);if(n[0]===false){a("#FormError>td",
250
+ "#"+j).html(n[1]);a("#FormError","#"+j).show()}else{a.each(d.p.colModel,function(){if(J[this.name]&&this.formatter&&this.formatter=="select")try{delete J[this.name]}catch(H){}});f=a.extend(f,J);d.p.autoencode&&a.each(f,function(H,aa){f[H]=a.jgrid.htmlDecode(aa)});c.reloadAfterSubmit=c.reloadAfterSubmit&&d.p.datatype!="local";if(f[B]==s.addoper){n[2]||(n[2]=parseInt(d.p.records,10)+1+"");f[G]=n[2];if(c.closeAfterAdd){if(c.reloadAfterSubmit)a(d).trigger("reloadGrid");else{a(d).jqGrid("addRowData",n[2],
251
+ f,b.addedrow);a(d).jqGrid("setSelection",n[2])}a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+q,jqm:b.jqModal,onClose:c.onClose})}else if(c.clearAfterAdd){c.reloadAfterSubmit?a(d).trigger("reloadGrid"):a(d).jqGrid("addRowData",n[2],f,b.addedrow);y("_empty",d,h)}else c.reloadAfterSubmit?a(d).trigger("reloadGrid"):a(d).jqGrid("addRowData",n[2],f,b.addedrow)}else{if(c.reloadAfterSubmit){a(d).trigger("reloadGrid");c.closeAfterEdit||setTimeout(function(){a(d).jqGrid("setSelection",f[G])},1E3)}else d.p.treeGrid===
252
+ true?a(d).jqGrid("setTreeRow",f[G],f):a(d).jqGrid("setRowData",f[G],f);c.closeAfterEdit&&a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+q,jqm:b.jqModal,onClose:c.onClose})}if(a.isFunction(c.afterComplete)){g=A;setTimeout(function(){c.afterComplete(g,f,a("#"+h));g=null},500)}}c.processing=false;if(c.checkOnSubmit||c.checkOnUpdate){a("#"+h).data("disabled",false);if(c._savedData[d.p.id+"_id"]!="_empty")for(var D in c._savedData)if(f[D])c._savedData[D]=f[D]}a("#sData","#"+j+"_2").removeClass("ui-state-active");
253
+ try{a(":input:visible","#"+h)[0].focus()}catch(S){}},error:function(A,M,D){a("#FormError>td","#"+j).html(M+" : "+D);a("#FormError","#"+j).show();c.processing=false;a("#"+h).data("disabled",false);a("#sData","#"+j+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,c.ajaxEditOptions);if(!x.url&&!c.useDataProxy)if(a.isFunction(d.p.dataProxy))c.useDataProxy=true;else{n[0]=false;n[1]+=" "+a.jgrid.errors.nourl}if(n[0])c.useDataProxy?d.p.dataProxy.call(d,x,"set_"+d.p.id):a.ajax(x)}if(n[0]===false){a("#FormError>td",
254
+ "#"+j).html(n[1]);a("#FormError","#"+j).show()}}function w(g,n){var x=false,s;for(s in g)if(g[s]!=n[s]){x=true;break}return x}function o(){var g=true;a("#FormError","#"+j).hide();if(c.checkOnUpdate){f={};J={};p();R=a.extend({},f,J);if(O=w(R,c._savedData)){a("#"+h).data("disabled",true);a(".confirm","#"+k.themodal).show();g=false}}return g}function m(){if(e!=="_empty"&&typeof d.p.savedRow!=="undefined"&&d.p.savedRow.length>0&&a.isFunction(a.fn.jqGrid.restoreRow))for(var g=0;g<d.p.savedRow.length;g++)if(d.p.savedRow[g].id==
255
+ e){a(d).jqGrid("restoreRow",e);break}}function r(g,n){g===0?a("#pData","#"+j+"_2").addClass("ui-state-disabled"):a("#pData","#"+j+"_2").removeClass("ui-state-disabled");g==n?a("#nData","#"+j+"_2").addClass("ui-state-disabled"):a("#nData","#"+j+"_2").removeClass("ui-state-disabled")}function v(){var g=a(d).jqGrid("getDataIDs"),n=a("#id_g","#"+j).val();return[a.inArray(n,g),g]}var d=this;if(d.grid&&e){var q=d.p.id,h="FrmGrid_"+q,j="TblGrid_"+q,k={themodal:"editmod"+q,modalhead:"edithd"+q,modalcontent:"editcnt"+
256
+ q,scrollelm:h},E=a.isFunction(c.beforeShowForm)?c.beforeShowForm:false,P=a.isFunction(c.afterShowForm)?c.afterShowForm:false,l=a.isFunction(c.beforeInitData)?c.beforeInitData:false,u=a.isFunction(c.onInitializeForm)?c.onInitializeForm:false,t=true,I=1,i=0,f,J,R,O;if(e=="new"){e="_empty";b.caption=b.addCaption}else b.caption=b.editCaption;b.recreateForm===true&&a("#"+k.themodal).html()!=null&&a("#"+k.themodal).remove();var T=true;if(b.checkOnUpdate&&b.jqModal&&!b.modal)T=false;if(a("#"+k.themodal).html()!=
257
+ null){if(l){t=l(a("#"+h));if(typeof t=="undefined")t=true}if(t===false)return;m();a(".ui-jqdialog-title","#"+k.modalhead).html(b.caption);a("#FormError","#"+j).hide();if(c.topinfo){a(".topinfo","#"+j+"_2").html(c.topinfo);a(".tinfo","#"+j+"_2").show()}else a(".tinfo","#"+j+"_2").hide();if(c.bottominfo){a(".bottominfo","#"+j+"_2").html(c.bottominfo);a(".binfo","#"+j+"_2").show()}else a(".binfo","#"+j+"_2").hide();y(e,d,h);e=="_empty"||!c.viewPagerButtons?a("#pData, #nData","#"+j+"_2").hide():a("#pData, #nData",
258
+ "#"+j+"_2").show();if(c.processing===true){c.processing=false;a("#sData","#"+j+"_2").removeClass("ui-state-active")}if(a("#"+h).data("disabled")===true){a(".confirm","#"+k.themodal).hide();a("#"+h).data("disabled",false)}E&&E(a("#"+h));a("#"+k.themodal).data("onClose",c.onClose);a.jgrid.viewModal("#"+k.themodal,{gbox:"#gbox_"+q,jqm:b.jqModal,jqM:false,overlay:b.overlay,modal:b.modal});T||a(".jqmOverlay").click(function(){if(!o())return false;a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+q,jqm:b.jqModal,
259
+ onClose:c.onClose});return false});P&&P(a("#"+h))}else{var K=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px";K=a("<form name='FormPost' id='"+h+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+K+";'></form>").data("disabled",false);var N=a("<table id='"+j+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");if(l){t=l(a("#"+h));if(typeof t=="undefined")t=true}if(t===false)return;m();a(d.p.colModel).each(function(){var g=
260
+ this.formoptions;I=Math.max(I,g?g.colpos||0:0);i=Math.max(i,g?g.rowpos||0:0)});a(K).append(N);l=a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+I*2+"'></td></tr>");l[0].rp=0;a(N).append(l);l=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+I*2+"'>"+c.topinfo+"</td></tr>");l[0].rp=0;a(N).append(l);t=(l=d.p.direction=="rtl"?true:false)?"nData":"pData";var V=l?"pData":"nData";F(e,d,N,I);t="<a href='javascript:void(0)' id='"+t+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>";
261
+ V="<a href='javascript:void(0)' id='"+V+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>";var Z="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>",$="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>";t="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+j+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+
262
+ (l?V+t:t+V)+"</td><td class='EditButton'>"+Z+$+"</td></tr>";t+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+c.bottominfo+"</td></tr>";t+="</tbody></table>";if(i>0){var Y=[];a.each(a(N)[0].rows,function(g,n){Y[g]=n});Y.sort(function(g,n){if(g.rp>n.rp)return 1;if(g.rp<n.rp)return-1;return 0});a.each(Y,function(g,n){a("tbody",N).append(n)})}b.gbox="#gbox_"+q;var ca=false;if(b.closeOnEscape===true){b.closeOnEscape=false;ca=true}K=a("<span></span>").append(K).append(t);
263
+ a.jgrid.createModal(k,K,b,"#gview_"+d.p.id,a("#gbox_"+d.p.id)[0]);if(l){a("#pData, #nData","#"+j+"_2").css("float","right");a(".EditButton","#"+j+"_2").css("text-align","left")}c.topinfo&&a(".tinfo","#"+j+"_2").show();c.bottominfo&&a(".binfo","#"+j+"_2").show();t=K=null;a("#"+k.themodal).keydown(function(g){var n=g.target;if(a("#"+h).data("disabled")===true)return false;if(c.savekey[0]===true&&g.which==c.savekey[1])if(n.tagName!="TEXTAREA"){a("#sData","#"+j+"_2").trigger("click");return false}if(g.which===
264
+ 27){if(!o())return false;ca&&a.jgrid.hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:c.onClose});return false}if(c.navkeys[0]===true){if(a("#id_g","#"+j).val()=="_empty")return true;if(g.which==c.navkeys[1]){a("#pData","#"+j+"_2").trigger("click");return false}if(g.which==c.navkeys[2]){a("#nData","#"+j+"_2").trigger("click");return false}}});if(b.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+k.themodal).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+k.themodal).unbind("click").click(function(){if(!o())return false;
265
+ a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+q,jqm:b.jqModal,onClose:c.onClose});return false})}b.saveicon=a.extend([true,"left","ui-icon-disk"],b.saveicon);b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.saveicon[0]===true)a("#sData","#"+j+"_2").addClass(b.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.saveicon[2]+"'></span>");if(b.closeicon[0]===true)a("#cData","#"+j+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":
266
+ "fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");if(c.checkOnSubmit||c.checkOnUpdate){Z="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bYes+"</a>";V="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bNo+"</a>";$="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bExit+"</a>";
267
+ K=b.zIndex||999;K++;a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+K+";display:none;'>&#160;"+(a.browser.msie&&a.browser.version==6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"")+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(K+1)+"'>"+b.saveData+"<br/><br/>"+Z+V+$+"</div>").insertAfter("#"+h);a("#sNew","#"+k.themodal).click(function(){z();a("#"+h).data("disabled",
268
+ false);a(".confirm","#"+k.themodal).hide();return false});a("#nNew","#"+k.themodal).click(function(){a(".confirm","#"+k.themodal).hide();a("#"+h).data("disabled",false);setTimeout(function(){a(":input","#"+h)[0].focus()},0);return false});a("#cNew","#"+k.themodal).click(function(){a(".confirm","#"+k.themodal).hide();a("#"+h).data("disabled",false);a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+q,jqm:b.jqModal,onClose:c.onClose});return false})}u&&u(a("#"+h));e=="_empty"||!c.viewPagerButtons?a("#pData,#nData",
269
+ "#"+j+"_2").hide():a("#pData,#nData","#"+j+"_2").show();E&&E(a("#"+h));a("#"+k.themodal).data("onClose",c.onClose);a.jgrid.viewModal("#"+k.themodal,{gbox:"#gbox_"+q,jqm:b.jqModal,overlay:b.overlay,modal:b.modal});T||a(".jqmOverlay").click(function(){if(!o())return false;a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+q,jqm:b.jqModal,onClose:c.onClose});return false});P&&P(a("#"+h));a(".fm-button","#"+k.themodal).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
270
+ a("#sData","#"+j+"_2").click(function(){f={};J={};a("#FormError","#"+j).hide();p();if(f[d.p.id+"_id"]=="_empty")z();else if(b.checkOnSubmit===true){R=a.extend({},f,J);if(O=w(R,c._savedData)){a("#"+h).data("disabled",true);a(".confirm","#"+k.themodal).show()}else z()}else z();return false});a("#cData","#"+j+"_2").click(function(){if(!o())return false;a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+q,jqm:b.jqModal,onClose:c.onClose});return false});a("#nData","#"+j+"_2").click(function(){if(!o())return false;
271
+ a("#FormError","#"+j).hide();var g=v();g[0]=parseInt(g[0],10);if(g[0]!=-1&&g[1][g[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",a("#"+h),g[1][g[0]]);y(g[1][g[0]+1],d,h);a(d).jqGrid("setSelection",g[1][g[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",a("#"+h),g[1][g[0]+1]);r(g[0]+1,g[1].length-1)}return false});a("#pData","#"+j+"_2").click(function(){if(!o())return false;a("#FormError","#"+j).hide();var g=v();if(g[0]!=-1&&g[1][g[0]-1]){a.isFunction(b.onclickPgButtons)&&
272
+ b.onclickPgButtons("prev",a("#"+h),g[1][g[0]]);y(g[1][g[0]-1],d,h);a(d).jqGrid("setSelection",g[1][g[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+h),g[1][g[0]-1]);r(g[0]-1,g[1].length-1)}return false})}E=v();r(E[0],E[1].length-1)}})},viewGridRow:function(e,b){b=a.extend({top:0,left:0,width:0,height:"auto",dataheight:"auto",modal:false,overlay:10,drag:true,resize:true,jqModal:true,closeOnEscape:false,labelswidth:"30%",closeicon:[],navkeys:[false,38,40],onClose:null,
273
+ beforeShowForm:null,beforeInitData:null,viewPagerButtons:true},a.jgrid.view,b||{});return this.each(function(){function p(){if(b.closeOnEscape===true||b.navkeys[0]===true)setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+d.modalhead).focus()},0)}function F(i,f,J,R){for(var O,T,K,N=0,V,Z,$=[],Y=false,ca="<td class='CaptionTD form-view-label ui-widget-content' width='"+b.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",g="",n=["integer",
274
+ "number","currency"],x=0,s=0,G,B,C,L=1;L<=R;L++)g+=L==1?ca:"<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";a(f.p.colModel).each(function(){T=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false;if(!T&&this.align==="right")if(this.formatter&&a.inArray(this.formatter,n)!==-1)x=Math.max(x,parseInt(this.width,10));else s=Math.max(s,parseInt(this.width,10))});G=x!==0?x:s!==0?s:0;Y=a(f).jqGrid("getInd",
275
+ i);a(f.p.colModel).each(function(A){O=this.name;B=false;Z=(T=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";C=typeof this.viewable!="boolean"?true:this.viewable;if(O!=="cb"&&O!=="subgrid"&&O!=="rn"&&C){V=Y===false?"":O==f.p.ExpandColumn&&f.p.treeGrid===true?a("td:eq("+A+")",f.rows[Y]).text():a("td:eq("+A+")",f.rows[Y]).html();B=this.align==="right"&&G!==0?true:false;a.extend({},this.editoptions||{},{id:O,name:O});var M=a.extend({},{rowabove:false,
276
+ rowcontent:""},this.formoptions||{}),D=parseInt(M.rowpos,10)||N+1,S=parseInt((parseInt(M.colpos,10)||1)*2,10);if(M.rowabove){var H=a("<tr><td class='contentinfo' colspan='"+R*2+"'>"+M.rowcontent+"</td></tr>");a(J).append(H);H[0].rp=D}K=a(J).find("tr[rowpos="+D+"]");if(K.length===0){K=a("<tr "+Z+" rowpos='"+D+"'></tr>").addClass("FormData").attr("id","trv_"+O);a(K).append(g);a(J).append(K);K[0].rp=D}a("td:eq("+(S-2)+")",K[0]).html("<b>"+(typeof M.label==="undefined"?f.p.colNames[A]:M.label)+"</b>");
277
+ a("td:eq("+(S-1)+")",K[0]).append("<span>"+V+"</span>").attr("id","v_"+O);B&&a("td:eq("+(S-1)+") span",K[0]).css({"text-align":"right",width:G+"px"});$[N]=A;N++}});if(N>0){i=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(R*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+i+"'/></td></tr>");i[0].rp=N+99;a(J).append(i)}return $}function y(i,f){var J,R,O=0,T,K;if(K=a(f).jqGrid("getInd",i,true)){a("td",K).each(function(N){J=
278
+ f.p.colModel[N].name;R=f.p.colModel[N].editrules&&f.p.colModel[N].editrules.edithidden===true?false:f.p.colModel[N].hidden===true?true:false;if(J!=="cb"&&J!=="subgrid"&&J!=="rn"){T=J==f.p.ExpandColumn&&f.p.treeGrid===true?a(this).text():a(this).html();a.extend({},f.p.colModel[N].editoptions||{});J=a.jgrid.jqID("v_"+J);a("#"+J+" span","#"+v).html(T);R&&a("#"+J,"#"+v).parents("tr:first").hide();O++}});O>0&&a("#id_g","#"+v).val(i)}}function z(i,f){i===0?a("#pData","#"+v+"_2").addClass("ui-state-disabled"):
279
+ a("#pData","#"+v+"_2").removeClass("ui-state-disabled");i==f?a("#nData","#"+v+"_2").addClass("ui-state-disabled"):a("#nData","#"+v+"_2").removeClass("ui-state-disabled")}function w(){var i=a(o).jqGrid("getDataIDs"),f=a("#id_g","#"+v).val();return[a.inArray(f,i),i]}var o=this;if(o.grid&&e){if(!b.imgpath)b.imgpath=o.p.imgpath;var m=o.p.id,r="ViewGrid_"+m,v="ViewTbl_"+m,d={themodal:"viewmod"+m,modalhead:"viewhd"+m,modalcontent:"viewcnt"+m,scrollelm:r},q=a.isFunction(b.beforeInitData)?b.beforeInitData:
280
+ false,h=true,j=1,k=0;if(a("#"+d.themodal).html()!=null){if(q){h=q(a("#"+r));if(typeof h=="undefined")h=true}if(h===false)return;a(".ui-jqdialog-title","#"+d.modalhead).html(b.caption);a("#FormError","#"+v).hide();y(e,o);a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+r));a.jgrid.viewModal("#"+d.themodal,{gbox:"#gbox_"+m,jqm:b.jqModal,jqM:false,overlay:b.overlay,modal:b.modal});p()}else{var E=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px";E=a("<form name='FormPost' id='"+r+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+
281
+ E+";'></form>");var P=a("<table id='"+v+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");if(q){h=q(a("#"+r));if(typeof h=="undefined")h=true}if(h===false)return;a(o.p.colModel).each(function(){var i=this.formoptions;j=Math.max(j,i?i.colpos||0:0);k=Math.max(k,i?i.rowpos||0:0)});a(E).append(P);F(e,o,P,j);q=o.p.direction=="rtl"?true:false;h="<a href='javascript:void(0)' id='"+(q?"nData":"pData")+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>";
282
+ var l="<a href='javascript:void(0)' id='"+(q?"pData":"nData")+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",u="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bClose+"</a>";if(k>0){var t=[];a.each(a(P)[0].rows,function(i,f){t[i]=f});t.sort(function(i,f){if(i.rp>f.rp)return 1;if(i.rp<f.rp)return-1;return 0});a.each(t,function(i,f){a("tbody",P).append(f)})}b.gbox="#gbox_"+m;var I=false;if(b.closeOnEscape===
283
+ true){b.closeOnEscape=false;I=true}E=a("<span></span>").append(E).append("<table border='0' class='EditTable' id='"+v+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+b.labelswidth+"'>"+(q?l+h:h+l)+"</td><td class='EditButton'>"+u+"</td></tr></tbody></table>");a.jgrid.createModal(d,E,b,"#gview_"+o.p.id,a("#gview_"+o.p.id)[0]);if(q){a("#pData, #nData","#"+v+"_2").css("float","right");a(".EditButton","#"+v+"_2").css("text-align","left")}b.viewPagerButtons||a("#pData, #nData","#"+v+"_2").hide();
284
+ E=null;a("#"+d.themodal).keydown(function(i){if(i.which===27){I&&a.jgrid.hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:b.onClose});return false}if(b.navkeys[0]===true){if(i.which===b.navkeys[1]){a("#pData","#"+v+"_2").trigger("click");return false}if(i.which===b.navkeys[2]){a("#nData","#"+v+"_2").trigger("click");return false}}});b.closeicon=a.extend([true,"left","ui-icon-close"],b.closeicon);if(b.closeicon[0]===true)a("#cData","#"+v+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":
285
+ "fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+r));a.jgrid.viewModal("#"+d.themodal,{gbox:"#gbox_"+m,jqm:b.jqModal,modal:b.modal});a(".fm-button:not(.ui-state-disabled)","#"+v+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});p();a("#cData","#"+v+"_2").click(function(){a.jgrid.hideModal("#"+d.themodal,{gb:"#gbox_"+m,jqm:b.jqModal,onClose:b.onClose});
286
+ return false});a("#nData","#"+v+"_2").click(function(){a("#FormError","#"+v).hide();var i=w();i[0]=parseInt(i[0],10);if(i[0]!=-1&&i[1][i[0]+1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("next",a("#"+r),i[1][i[0]]);y(i[1][i[0]+1],o);a(o).jqGrid("setSelection",i[1][i[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",a("#"+r),i[1][i[0]+1]);z(i[0]+1,i[1].length-1)}p();return false});a("#pData","#"+v+"_2").click(function(){a("#FormError","#"+v).hide();var i=w();if(i[0]!=
287
+ -1&&i[1][i[0]-1]){a.isFunction(b.onclickPgButtons)&&b.onclickPgButtons("prev",a("#"+r),i[1][i[0]]);y(i[1][i[0]-1],o);a(o).jqGrid("setSelection",i[1][i[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+r),i[1][i[0]-1]);z(i[0]-1,i[1].length-1)}p();return false})}E=w();z(E[0],E[1].length-1)}})},delGridRow:function(e,b){c=b=a.extend({top:0,left:0,width:240,height:"auto",dataheight:"auto",modal:false,overlay:10,drag:true,resize:true,url:"",mtype:"POST",reloadAfterSubmit:true,
288
+ beforeShowForm:null,beforeInitData:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:true,closeOnEscape:false,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:false,serializeDelData:null,useDataProxy:false},a.jgrid.del,b||{});return this.each(function(){var p=this;if(p.grid)if(e){var F=typeof b.beforeShowForm==="function"?true:false,y=typeof b.afterShowForm==="function"?true:false,z=a.isFunction(b.beforeInitData)?b.beforeInitData:false,
289
+ w=p.p.id,o={},m=true,r="DelTbl_"+w,v,d,q,h,j={themodal:"delmod"+w,modalhead:"delhd"+w,modalcontent:"delcnt"+w,scrollelm:r};if(jQuery.isArray(e))e=e.join();if(a("#"+j.themodal).html()!=null){if(z){m=z();if(typeof m=="undefined")m=true}if(m===false)return;a("#DelData>td","#"+r).text(e);a("#DelError","#"+r).hide();if(c.processing===true){c.processing=false;a("#dData","#"+r).removeClass("ui-state-active")}F&&b.beforeShowForm(a("#"+r));a.jgrid.viewModal("#"+j.themodal,{gbox:"#gbox_"+w,jqm:b.jqModal,jqM:false,
290
+ overlay:b.overlay,modal:b.modal})}else{if(z){m=z();if(typeof m=="undefined")m=true}if(m===false)return;z=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px";z="<div id='"+r+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+z+";'>";z+="<table class='DelTable'><tbody>";z+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";z+="<tr id='DelData' style='display:none'><td >"+e+"</td></tr>";z+='<tr><td class="delmsg" style="white-space:pre;">'+b.msg+
291
+ "</td></tr><tr><td >&#160;</td></tr>";z+="</tbody></table></div>";z+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+r+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr></tr><tr><td class='DelButton EditButton'>"+("<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>")+
292
+ "</td></tr></tbody></table>";b.gbox="#gbox_"+w;a.jgrid.createModal(j,z,b,"#gview_"+p.p.id,a("#gview_"+p.p.id)[0]);a(".fm-button","#"+r+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});b.delicon=a.extend([true,"left","ui-icon-scissors"],b.delicon);b.cancelicon=a.extend([true,"left","ui-icon-cancel"],b.cancelicon);if(b.delicon[0]===true)a("#dData","#"+r+"_2").addClass(b.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+
293
+ b.delicon[2]+"'></span>");if(b.cancelicon[0]===true)a("#eData","#"+r+"_2").addClass(b.cancelicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.cancelicon[2]+"'></span>");a("#dData","#"+r+"_2").click(function(){var k=[true,""];o={};var E=a("#DelData>td","#"+r).text();if(typeof b.onclickSubmit==="function")o=b.onclickSubmit(c,E)||{};if(typeof b.beforeSubmit==="function")k=b.beforeSubmit(E);if(k[0]&&!c.processing){c.processing=true;a(this).addClass("ui-state-active");
294
+ q=p.p.prmNames;v=a.extend({},c.delData,o);h=q.oper;v[h]=q.deloper;d=q.id;v[d]=E;var P=a.extend({url:c.url?c.url:a(p).jqGrid("getGridParam","editurl"),type:b.mtype,data:a.isFunction(b.serializeDelData)?b.serializeDelData(v):v,complete:function(l,u){if(u!="success"){k[0]=false;k[1]=a.isFunction(c.errorTextFormat)?c.errorTextFormat(l):u+" Status: '"+l.statusText+"'. Error code: "+l.status}else if(typeof c.afterSubmit==="function")k=c.afterSubmit(l,v);if(k[0]===false){a("#DelError>td","#"+r).html(k[1]);
295
+ a("#DelError","#"+r).show()}else{if(c.reloadAfterSubmit&&p.p.datatype!="local")a(p).trigger("reloadGrid");else{u=[];u=E.split(",");if(p.p.treeGrid===true)try{a(p).jqGrid("delTreeNode",u[0])}catch(t){}else for(var I=0;I<u.length;I++)a(p).jqGrid("delRowData",u[I]);p.p.selrow=null;p.p.selarrrow=[]}a.isFunction(c.afterComplete)&&setTimeout(function(){c.afterComplete(l,E)},500)}c.processing=false;a("#dData","#"+r+"_2").removeClass("ui-state-active");k[0]&&a.jgrid.hideModal("#"+j.themodal,{gb:"#gbox_"+
296
+ w,jqm:b.jqModal,onClose:c.onClose})},error:function(l,u,t){a("#DelError>td","#"+r).html(u+" : "+t);a("#DelError","#"+r).show();c.processing=false;a("#dData","#"+r+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,b.ajaxDelOptions);if(!P.url&&!c.useDataProxy)if(a.isFunction(p.p.dataProxy))c.useDataProxy=true;else{k[0]=false;k[1]+=" "+a.jgrid.errors.nourl}if(k[0])c.useDataProxy?p.p.dataProxy.call(p,P,"del_"+p.p.id):a.ajax(P)}if(k[0]===false){a("#DelError>td","#"+r).html(k[1]);a("#DelError",
297
+ "#"+r).show()}return false});a("#eData","#"+r+"_2").click(function(){a.jgrid.hideModal("#"+j.themodal,{gb:"#gbox_"+w,jqm:b.jqModal,onClose:c.onClose});return false});F&&b.beforeShowForm(a("#"+r));a.jgrid.viewModal("#"+j.themodal,{gbox:"#gbox_"+w,jqm:b.jqModal,overlay:b.overlay,modal:b.modal})}y&&b.afterShowForm(a("#"+r));b.closeOnEscape===true&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+j.modalhead).focus()},0)}})},navGrid:function(e,b,p,F,y,z,w){b=a.extend({edit:true,editicon:"ui-icon-pencil",
298
+ add:true,addicon:"ui-icon-plus",del:true,delicon:"ui-icon-trash",search:true,searchicon:"ui-icon-search",refresh:true,refreshicon:"ui-icon-refresh",refreshstate:"firstpage",view:false,viewicon:"ui-icon-document",position:"left",closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false},a.jgrid.nav,b||{});return this.each(function(){var o={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},m=this,r,v,d;if(!(!m.grid||typeof e!="string")){if(a("#"+o.themodal).html()===null){if(typeof window.innerWidth!=
299
+ "undefined"){r=window.innerWidth;v=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==0){r=document.documentElement.clientWidth;v=document.documentElement.clientHeight}else{r=1024;v=768}a.jgrid.createModal(o,"<div>"+b.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+m.p.id,jqModal:true,drag:true,resize:true,caption:b.alertcap,top:v/
300
+ 2-25,left:r/2-100,width:200,height:"auto",closeOnEscape:b.closeOnEscape},"","",true)}r=1;if(b.cloneToTop&&m.p.toppager)r=2;for(v=0;v<r;v++){var q=a("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),h,j;if(v===0){h=e;j=m.p.id;if(h==m.p.toppager){j+="_top";r=1}}else{h=m.p.toppager;j=m.p.id+"_top"}m.p.direction=="rtl"&&a(q).attr("dir","rtl").css("float","right");if(b.add){F=F||{};d=a("<td class='ui-pg-button ui-corner-all'></td>");
301
+ a(d).append("<div class='ui-pg-div'><span class='ui-icon "+b.addicon+"'></span>"+b.addtext+"</div>");a("tr",q).append(d);a(d,q).attr({title:b.addtitle||"",id:F.id||"add_"+j}).click(function(){a(this).hasClass("ui-state-disabled")||(typeof b.addfunc=="function"?b.addfunc():a(m).jqGrid("editGridRow","new",F));return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});d=null}if(b.edit){d=a("<td class='ui-pg-button ui-corner-all'></td>");
302
+ p=p||{};a(d).append("<div class='ui-pg-div'><span class='ui-icon "+b.editicon+"'></span>"+b.edittext+"</div>");a("tr",q).append(d);a(d,q).attr({title:b.edittitle||"",id:p.id||"edit_"+j}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var k=m.p.selrow;if(k)typeof b.editfunc=="function"?b.editfunc(k):a(m).jqGrid("editGridRow",k,p);else{a.jgrid.viewModal("#"+o.themodal,{gbox:"#gbox_"+m.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
303
+ a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});d=null}if(b.view){d=a("<td class='ui-pg-button ui-corner-all'></td>");w=w||{};a(d).append("<div class='ui-pg-div'><span class='ui-icon "+b.viewicon+"'></span>"+b.viewtext+"</div>");a("tr",q).append(d);a(d,q).attr({title:b.viewtitle||"",id:w.id||"view_"+j}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var k=m.p.selrow;if(k)a(m).jqGrid("viewGridRow",k,w);else{a.jgrid.viewModal("#"+o.themodal,{gbox:"#gbox_"+
304
+ m.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});d=null}if(b.del){d=a("<td class='ui-pg-button ui-corner-all'></td>");y=y||{};a(d).append("<div class='ui-pg-div'><span class='ui-icon "+b.delicon+"'></span>"+b.deltext+"</div>");a("tr",q).append(d);a(d,q).attr({title:b.deltitle||"",id:y.id||"del_"+j}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var k;
305
+ if(m.p.multiselect){k=m.p.selarrrow;if(k.length===0)k=null}else k=m.p.selrow;if(k)"function"==typeof b.delfunc?b.delfunc(k):a(m).jqGrid("delGridRow",k,y);else{a.jgrid.viewModal("#"+o.themodal,{gbox:"#gbox_"+m.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});d=null}if(b.add||b.edit||b.del||b.view)a("tr",q).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");
306
+ if(b.search){d=a("<td class='ui-pg-button ui-corner-all'></td>");z=z||{};a(d).append("<div class='ui-pg-div'><span class='ui-icon "+b.searchicon+"'></span>"+b.searchtext+"</div>");a("tr",q).append(d);a(d,q).attr({title:b.searchtitle||"",id:z.id||"search_"+j}).click(function(){a(this).hasClass("ui-state-disabled")||a(m).jqGrid("searchGrid",z);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
307
+ d=null}if(b.refresh){d=a("<td class='ui-pg-button ui-corner-all'></td>");a(d).append("<div class='ui-pg-div'><span class='ui-icon "+b.refreshicon+"'></span>"+b.refreshtext+"</div>");a("tr",q).append(d);a(d,q).attr({title:b.refreshtitle||"",id:"refresh_"+j}).click(function(){if(!a(this).hasClass("ui-state-disabled")){a.isFunction(b.beforeRefresh)&&b.beforeRefresh();m.p.search=false;try{a("#fbox_"+m.p.id).searchFilter().reset({reload:false});a.isFunction(m.clearToolbar)&&m.clearToolbar(false)}catch(k){}switch(b.refreshstate){case "firstpage":a(m).trigger("reloadGrid",
308
+ [{page:1}]);break;case "current":a(m).trigger("reloadGrid",[{current:true}]);break}a.isFunction(b.afterRefresh)&&b.afterRefresh()}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});d=null}d=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+d+";visibility:hidden;' ></div>");d=a(q).clone().appendTo("#testpg2").width();
309
+ a("#testpg2").remove();a(h+"_"+b.position,h).append(q);if(m.p._nvtd){if(d>m.p._nvtd[0]){a(h+"_"+b.position,h).width(d);m.p._nvtd[0]=d}m.p._nvtd[1]=d}q=d=d=null}}})},navButtonAdd:function(e,b){b=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var p=a(".navtable",e)[0],F=this;if(p){var y=a("<td></td>");b.buttonicon.toString().toUpperCase()=="NONE"?a(y).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+
310
+ b.caption+"</div>"):a(y).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+b.buttonicon+"'></span>"+b.caption+"</div>");b.id&&a(y).attr("id",b.id);if(b.position=="first")p.rows[0].cells.length===0?a("tr",p).append(y):a("tr td:eq(0)",p).before(y);else a("tr",p).append(y);a(y,p).attr("title",b.title||"").click(function(z){a(this).hasClass("ui-state-disabled")||a.isFunction(b.onClickButton)&&b.onClickButton.call(F,z);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
311
+ a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},navSeparatorAdd:function(e,b){b=a.extend({sepclass:"ui-separator",sepcontent:""},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var p=a(".navtable",e)[0];if(p){var F="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+b.sepclass+"'></span>"+b.sepcontent+"</td>";a("tr",p).append(F)}}})},GridToForm:function(e,b){return this.each(function(){var p=this;
312
+ if(p.grid){var F=a(p).jqGrid("getRowData",e);if(F)for(var y in F)a("[name="+y+"]",b).is("input:radio")||a("[name="+y+"]",b).is("input:checkbox")?a("[name="+y+"]",b).each(function(){a(this).val()==F[y]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+y+"]",b).val(F[y])}})},FormToGrid:function(e,b,p,F){return this.each(function(){var y=this;if(y.grid){p||(p="set");F||(F="first");var z=a(b).serializeArray(),w={};a.each(z,function(o,m){w[m.name]=m.value});if(p=="add")a(y).jqGrid("addRowData",
313
+ e,w,F);else p=="set"&&a(y).jqGrid("setRowData",e,w)}})}})})(jQuery);
314
+ jQuery.fn.searchFilter=function(k,H){function I(e,l,v){this.$=e;this.add=function(a){a==null?e.find(".ui-add-last").click():e.find(".sf:eq("+a+") .ui-add").click();return this};this.del=function(a){a==null?e.find(".sf:last .ui-del").click():e.find(".sf:eq("+a+") .ui-del").click();return this};this.search=function(){e.find(".ui-search").click();return this};this.reset=function(a){if(a===undefined)a=false;e.find(".ui-reset").trigger("click",[a]);return this};this.close=function(){e.find(".ui-closer").click();
315
+ return this};if(l!=null){function C(){jQuery(this).toggleClass("ui-state-hover");return false}function D(a){jQuery(this).toggleClass("ui-state-active",a.type=="mousedown");return false}function m(a,b){return"<option value='"+a+"'>"+b+"</option>"}function w(a,b,d){return"<select class='"+a+"'"+(d?" style='display:none;'":"")+">"+b+"</select>"}function E(a,b){a=e.find("tr.sf td.data "+a);a[0]!=null&&b(a)}function F(a,b){var d=e.find("tr.sf td.data "+a);d[0]!=null&&jQuery.each(b,function(){this.data!=
316
+ null?d.bind(this.type,this.data,this.fn):d.bind(this.type,this.fn)})}var f=jQuery.extend({},jQuery.fn.searchFilter.defaults,v),n=-1,r="";jQuery.each(f.groupOps,function(){r+=m(this.op,this.text)});r="<select name='groupOp'>"+r+"</select>";e.html("").addClass("ui-searchFilter").append("<div class='ui-widget-overlay' style='z-index: -1'>&#160;</div><table class='ui-widget-content ui-corner-all'><thead><tr><td colspan='5' class='ui-widget-header ui-corner-all' style='line-height: 18px;'><div class='ui-closer ui-state-default ui-corner-all ui-helper-clearfix' style='float: right;'><span class='ui-icon ui-icon-close'></span></div>"+
317
+ f.windowTitle+"</td></tr></thead><tbody><tr class='sf'><td class='fields'></td><td class='ops'></td><td class='data'></td><td><div class='ui-del ui-state-default ui-corner-all'><span class='ui-icon ui-icon-minus'></span></div></td><td><div class='ui-add ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plus'></span></div></td></tr><tr><td colspan='5' class='divider'><hr class='ui-widget-content' style='margin:1px'/></td></tr></tbody><tfoot><tr><td colspan='3'><span class='ui-reset ui-state-default ui-corner-all' style='display: inline-block; float: left;'><span class='ui-icon ui-icon-arrowreturnthick-1-w' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+
318
+ f.resetText+"</span></span><span class='ui-search ui-state-default ui-corner-all' style='display: inline-block; float: right;'><span class='ui-icon ui-icon-search' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>"+f.searchText+"</span></span><span class='matchText'>"+f.matchText+"</span> "+r+" <span class='rulesText'>"+f.rulesText+"</span></td><td>&#160;</td><td><div class='ui-add-last ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plusthick'></span></div></td></tr></tfoot></table>");
319
+ var x=e.find("tr.sf"),G=x.find("td.fields"),y=x.find("td.ops"),o=x.find("td.data"),s="";jQuery.each(f.operators,function(){s+=m(this.op,this.text)});s=w("default",s,true);y.append(s);o.append("<input type='text' class='default' style='display:none;' />");var t="",z=false,p=false;jQuery.each(l,function(a){t+=m(this.itemval,this.text);if(this.ops!=null){z=true;var b="";jQuery.each(this.ops,function(){b+=m(this.op,this.text)});b=w("field"+a,b,true);y.append(b)}if(this.dataUrl!=null){if(a>n)n=a;p=true;
320
+ var d=this.dataEvents,c=this.dataInit,g=this.buildSelect;jQuery.ajax(jQuery.extend({url:this.dataUrl,complete:function(h){h=g!=null?jQuery("<div />").append(g(h)):jQuery("<div />").append(h.responseText);h.find("select").addClass("field"+a).hide();o.append(h.html());c&&E(".field"+a,c);d&&F(".field"+a,d);a==n&&e.find("tr.sf td.fields select[name='field']").change()}},f.ajaxSelectOptions))}else if(this.dataValues!=null){p=true;var i="";jQuery.each(this.dataValues,function(){i+=m(this.value,this.text)});
321
+ i=w("field"+a,i,true);o.append(i)}else if(this.dataEvents!=null||this.dataInit!=null){p=true;i="<input type='text' class='field"+a+"' />";o.append(i)}this.dataInit!=null&&a!=n&&E(".field"+a,this.dataInit);this.dataEvents!=null&&a!=n&&F(".field"+a,this.dataEvents)});t="<select name='field'>"+t+"</select>";G.append(t);l=G.find("select[name='field']");z?l.change(function(a){var b=a.target.selectedIndex;a=jQuery(a.target).parents("tr.sf").find("td.ops");a.find("select").removeAttr("name").hide();b=a.find(".field"+
322
+ b);if(b[0]==null)b=a.find(".default");b.attr("name","op").show();return false}):y.find(".default").attr("name","op").show();p?l.change(function(a){var b=a.target.selectedIndex;a=jQuery(a.target).parents("tr.sf").find("td.data");a.find("select,input").removeClass("vdata").hide();b=a.find(".field"+b);if(b[0]==null)b=a.find(".default");b.show().addClass("vdata");return false}):o.find(".default").show().addClass("vdata");if(z||p)l.change();e.find(".ui-state-default").hover(C,C).mousedown(D).mouseup(D);
323
+ e.find(".ui-closer").click(function(){f.onClose(jQuery(e.selector));return false});e.find(".ui-del").click(function(a){a=jQuery(a.target).parents(".sf");if(a.siblings(".sf").length>0){f.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&a.find(".hasDatepicker").datepicker("destroy");a.remove()}else{a.find("select[name='field']")[0].selectedIndex=0;a.find("select[name='op']")[0].selectedIndex=0;a.find(".data input").val("");a.find(".data select").each(function(){this.selectedIndex=0});a.find("select[name='field']").change(function(b){b.stopPropagation()})}return false});
324
+ e.find(".ui-add").click(function(a){a=jQuery(a.target).parents(".sf");var b=a.clone(true).insertAfter(a);b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");if(f.clone){b.find("select[name='field']")[0].selectedIndex=a.find("select[name='field']")[0].selectedIndex;if(b.find("select[name='op']")[0]!=null)b.find("select[name='op']").focus()[0].selectedIndex=a.find("select[name='op']")[0].selectedIndex;var d=b.find("select.vdata");if(d[0]!=null)d[0].selectedIndex=a.find("select.vdata")[0].selectedIndex}else{b.find(".data input").val("");
325
+ b.find("select[name='field']").focus()}f.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&a.find(".hasDatepicker").each(function(){var c=jQuery.data(this,"datepicker").settings;b.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(c)});b.find("select[name='field']").change(function(c){c.stopPropagation()});return false});e.find(".ui-search").click(function(){var a=jQuery(e.selector),b,d=a.find("select[name='groupOp'] :selected").val();b=f.stringResult?'{"groupOp":"'+
326
+ d+'","rules":[':{groupOp:d,rules:[]};a.find(".sf").each(function(c){var g=jQuery(this).find("select[name='field'] :selected").val(),i=jQuery(this).find("select[name='op'] :selected").val(),h=jQuery(this).find("input.vdata,select.vdata :selected").val();h+="";h=h.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');if(f.stringResult){if(c>0)b+=",";b+='{"field":"'+g+'",';b+='"op":"'+i+'",';b+='"data":"'+h+'"}'}else b.rules.push({field:g,op:i,data:h})});if(f.stringResult)b+="]}";f.onSearch(b);return false});e.find(".ui-reset").click(function(a,
327
+ b){a=jQuery(e.selector);a.find(".ui-del").click();a.find("select[name='groupOp']")[0].selectedIndex=0;f.onReset(b);return false});e.find(".ui-add-last").click(function(){var a=jQuery(e.selector+" .sf:last"),b=a.clone(true).insertAfter(a);b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");b.find(".data input").val("");b.find("select[name='field']").focus();f.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&a.find(".hasDatepicker").each(function(){var d=jQuery.data(this,
328
+ "datepicker").settings;b.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(d)});b.find("select[name='field']").change(function(d){d.stopPropagation()});return false});this.setGroupOp=function(a){selDOMobj=e.find("select[name='groupOp']")[0];var b={},d=selDOMobj.options.length,c;for(c=0;c<d;c++)b[selDOMobj.options[c].value]=c;selDOMobj.selectedIndex=b[a];jQuery(selDOMobj).change(function(g){g.stopPropagation()})};this.setFilter=function(a){var b=a.sfref;a=a.filter;
329
+ var d=[],c,g,i,h,j={};selDOMobj=b.find("select[name='field']")[0];c=0;for(i=selDOMobj.options.length;c<i;c++){j[selDOMobj.options[c].value]={index:c,ops:{}};d.push(selDOMobj.options[c].value)}c=0;for(i=d.length;c<i;c++){if(selDOMobj=b.find(".ops > select[class='field"+c+"']")[0]){g=0;for(h=selDOMobj.options.length;g<h;g++)j[d[c]].ops[selDOMobj.options[g].value]=g}if(selDOMobj=b.find(".data > select[class='field"+c+"']")[0]){j[d[c]].data={};g=0;for(h=selDOMobj.options.length;g<h;g++)j[d[c]].data[selDOMobj.options[g].value]=
330
+ g}}var u,q,A,B;d=a.field;if(j[d])u=j[d].index;if(u!=null){q=j[d].ops[a.op];if(q===undefined){c=0;for(i=v.operators.length;c<i;c++)if(v.operators[c].op==a.op){q=c;break}}A=a.data;B=j[d].data==null?-1:j[d].data[A]}if(u!=null&&q!=null&&B!=null){b.find("select[name='field']")[0].selectedIndex=u;b.find("select[name='field']").change();b.find("select[name='op']")[0].selectedIndex=q;b.find("input.vdata").val(A);if(b=b.find("select.vdata")[0])b.selectedIndex=B;return true}else return false}}}return new I(this,
331
+ k,H)};jQuery.fn.searchFilter.version="1.2.9";
332
+ jQuery.fn.searchFilter.defaults={clone:true,datepickerFix:true,onReset:function(k){alert("Reset Clicked. Data Returned: "+k)},onSearch:function(k){alert("Search Clicked. Data Returned: "+k)},onClose:function(k){k.hide()},groupOps:[{op:"AND",text:"all"},{op:"OR",text:"any"}],operators:[{op:"eq",text:"is equal to"},{op:"ne",text:"is not equal to"},{op:"lt",text:"is less than"},{op:"le",text:"is less or equal to"},{op:"gt",text:"is greater than"},{op:"ge",text:"is greater or equal to"},{op:"in",text:"is in"},
329
333
  {op:"ni",text:"is not in"},{op:"bw",text:"begins with"},{op:"bn",text:"does not begin with"},{op:"ew",text:"ends with"},{op:"en",text:"does not end with"},{op:"cn",text:"contains"},{op:"nc",text:"does not contain"}],matchText:"match",rulesText:"rules",resetText:"Reset",searchText:"Search",stringResult:true,windowTitle:"Search Rules",ajaxSelectOptions:{}};
330
- (function(a){a.jgrid.extend({editRow:function(d,t,i,n,o,u,r,c,f){return this.each(function(){var b=this,k,l,s=0,p=null,q={},h,g;if(b.grid){h=a(b).jqGrid("getInd",d,true);if(h!==false)if((a(h).attr("editable")||"0")=="0"&&!a(h).hasClass("not-editable-row")){g=b.p.colModel;a("td",h).each(function(j){k=g[j].name;var v=b.p.treeGrid===true&&k==b.p.ExpandColumn;if(v)l=a("span:first",this).html();else try{l=a.unformat(this,{rowId:d,colModel:g[j]},j)}catch(m){l=a(this).html()}if(k!="cb"&&k!="subgrid"&&k!=
331
- "rn"){if(b.p.autoencode)l=a.jgrid.htmlDecode(l);q[k]=l;if(g[j].editable===true){if(p===null)p=j;v?a("span:first",this).html(""):a(this).html("");var e=a.extend({},g[j].editoptions||{},{id:d+"_"+k,name:k});if(!g[j].edittype)g[j].edittype="text";e=createEl(g[j].edittype,e,l,true,a.extend({},a.jgrid.ajaxOptions,b.p.ajaxSelectOptions||{}));a(e).addClass("editable");v?a("span:first",this).append(e):a(this).append(e);g[j].edittype=="select"&&g[j].editoptions.multiple===true&&a.browser.msie&&a(e).width(a(e).width());
332
- s++}}});if(s>0){q.id=d;b.p.savedRow.push(q);a(h).attr("editable","1");a("td:eq("+p+") input",h).focus();t===true&&a(h).bind("keydown",function(j){j.keyCode===27&&a(b).jqGrid("restoreRow",d,f);if(j.keyCode===13){if(j.target.tagName=="TEXTAREA")return true;a(b).jqGrid("saveRow",d,n,o,u,r,c,f);return false}j.stopPropagation()});a.isFunction(i)&&i(d)}}}})},saveRow:function(d,t,i,n,o,u,r){return this.each(function(){var c=this,f,b={},k={},l,s,p,q;if(c.grid){q=a(c).jqGrid("getInd",d,true);if(q!==false){l=
333
- a(q).attr("editable");i=i?i:c.p.editurl;if(l==="1"){var h;a("td",q).each(function(m){h=c.p.colModel[m];f=h.name;if(f!="cb"&&f!="subgrid"&&h.editable===true&&f!="rn"){switch(h.edittype){case "checkbox":var e=["Yes","No"];if(h.editoptions)e=h.editoptions.value.split(":");b[f]=a("input",this).attr("checked")?e[0]:e[1];break;case "text":case "password":case "textarea":case "button":b[f]=a("input, textarea",this).val();break;case "select":if(h.editoptions.multiple){e=a("select",this);var x=[];b[f]=a(e).val();
334
- b[f]=b[f]?b[f].join(","):"";a("select > option:selected",this).each(function(y,z){x[y]=a(z).text()});k[f]=x.join(",")}else{b[f]=a("select>option:selected",this).val();k[f]=a("select>option:selected",this).text()}if(h.formatter&&h.formatter=="select")k={};break;case "custom":try{if(h.editoptions&&a.isFunction(h.editoptions.custom_value)){b[f]=h.editoptions.custom_value(a(".customelement",this),"get");if(b[f]===undefined)throw"e2";}else throw"e1";}catch(w){w=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,
335
- "function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);w=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,w.message,jQuery.jgrid.edit.bClose)}break}p=checkValues(b[f],m,c);if(p[0]===false){p[1]=b[f]+" "+p[1];return false}if(c.p.autoencode)b[f]=a.jgrid.htmlEncode(b[f])}});if(p[0]===false)try{var g=findPos(a("#"+a.jgrid.jqID(d),c.grid.bDiv)[0]);info_dialog(a.jgrid.errors.errcap,
336
- p[1],a.jgrid.edit.bClose,{left:g[0],top:g[1]})}catch(j){alert(p[1])}else{if(b){var v;g=c.p.prmNames;v=g.oper;l=g.id;b[v]=g.editoper;b[l]=d;if(typeof c.p.inlineData=="undefined")c.p.inlineData={};if(typeof n=="undefined")n={};b=a.extend({},b,c.p.inlineData,n)}if(i=="clientArray"){b=a.extend({},b,k);c.p.autoencode&&a.each(b,function(m,e){b[m]=a.jgrid.htmlDecode(e)});l=a(c).jqGrid("setRowData",d,b);a(q).attr("editable","0");for(g=0;g<c.p.savedRow.length;g++)if(c.p.savedRow[g].id==d){s=g;break}s>=0&&
337
- c.p.savedRow.splice(s,1);a.isFunction(o)&&o(d,l)}else{a("#lui_"+c.p.id).show();a.ajax(a.extend({url:i,data:a.isFunction(c.p.serializeRowData)?c.p.serializeRowData(b):b,type:"POST",complete:function(m,e){a("#lui_"+c.p.id).hide();if(e==="success")if((a.isFunction(t)?t(m):true)===true){c.p.autoencode&&a.each(b,function(x,w){b[x]=a.jgrid.htmlDecode(w)});b=a.extend({},b,k);a(c).jqGrid("setRowData",d,b);a(q).attr("editable","0");for(e=0;e<c.p.savedRow.length;e++)if(c.p.savedRow[e].id==d){s=e;break}s>=0&&
338
- c.p.savedRow.splice(s,1);a.isFunction(o)&&o(d,m)}else a(c).jqGrid("restoreRow",d,r)},error:function(m,e){a("#lui_"+c.p.id).hide();a.isFunction(u)?u(d,m,e):alert("Error Row: "+d+" Result: "+m.status+":"+m.statusText+" Status: "+e);a(c).jqGrid("restoreRow",d,r)}},a.jgrid.ajaxOptions,c.p.ajaxRowOptions||{}))}a(q).unbind("keydown")}}}}})},restoreRow:function(d,t){return this.each(function(){var i=this,n,o,u={};if(i.grid){o=a(i).jqGrid("getInd",d,true);if(o!==false){for(var r=0;r<i.p.savedRow.length;r++)if(i.p.savedRow[r].id==
339
- d){n=r;break}if(n>=0){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+a.jgrid.jqID(o.id)).datepicker("hide")}catch(c){}a.each(i.p.colModel,function(){if(this.editable===true&&this.name in i.p.savedRow[n])u[this.name]=i.p.savedRow[n][this.name]});a(i).jqGrid("setRowData",d,u);a(o).attr("editable","0").unbind("keydown");i.p.savedRow.splice(n,1)}a.isFunction(t)&&t(d)}}})}})})(jQuery);
340
- (function(b){b.jgrid.extend({editCell:function(d,e,a){return this.each(function(){var c=this,h,f,g;if(!(!c.grid||c.p.cellEdit!==true)){e=parseInt(e,10);c.p.selrow=c.rows[d].id;c.p.knv||b(c).jqGrid("GridNav");if(c.p.savedRow.length>0){if(a===true)if(d==c.p.iRow&&e==c.p.iCol)return;b(c).jqGrid("saveCell",c.p.savedRow[0].id,c.p.savedRow[0].ic)}else window.setTimeout(function(){b("#"+c.p.knv).attr("tabindex","-1").focus()},0);h=c.p.colModel[e].name;if(!(h=="subgrid"||h=="cb"||h=="rn")){g=b("td:eq("+e+
341
- ")",c.rows[d]);if(c.p.colModel[e].editable===true&&a===true&&!g.hasClass("not-editable-cell")){if(parseInt(c.p.iCol,10)>=0&&parseInt(c.p.iRow,10)>=0){b("td:eq("+c.p.iCol+")",c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight");b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}b(g).addClass("edit-cell ui-state-highlight");b(c.rows[d]).addClass("selected-row ui-state-hover");try{f=b.unformat(g,{rowId:c.rows[d].id,colModel:c.p.colModel[e]},e)}catch(k){f=b(g).html()}if(c.p.autoencode)f=
342
- b.jgrid.htmlDecode(f);if(!c.p.colModel[e].edittype)c.p.colModel[e].edittype="text";c.p.savedRow.push({id:d,ic:e,name:h,v:f});if(b.isFunction(c.p.formatCell)){var j=c.p.formatCell(c.rows[d].id,h,f,d,e);if(j!==undefined)f=j}j=b.extend({},c.p.colModel[e].editoptions||{},{id:d+"_"+h,name:h});var i=createEl(c.p.colModel[e].edittype,j,f,true,b.extend({},b.jgrid.ajaxOptions,c.p.ajaxSelectOptions||{}));b.isFunction(c.p.beforeEditCell)&&c.p.beforeEditCell(c.rows[d].id,h,f,d,e);b(g).html("").append(i).attr("tabindex",
343
- "0");window.setTimeout(function(){b(i).focus()},0);b("input, select, textarea",g).bind("keydown",function(l){if(l.keyCode===27)if(b("input.hasDatepicker",g).length>0)b(".ui-datepicker").is(":hidden")?b(c).jqGrid("restoreCell",d,e):b("input.hasDatepicker",g).datepicker("hide");else b(c).jqGrid("restoreCell",d,e);l.keyCode===13&&b(c).jqGrid("saveCell",d,e);if(l.keyCode==9)if(c.grid.hDiv.loading)return false;else l.shiftKey?b(c).jqGrid("prevCell",d,e):b(c).jqGrid("nextCell",d,e);l.stopPropagation()});
344
- b.isFunction(c.p.afterEditCell)&&c.p.afterEditCell(c.rows[d].id,h,f,d,e)}else{if(parseInt(c.p.iCol,10)>=0&&parseInt(c.p.iRow,10)>=0){b("td:eq("+c.p.iCol+")",c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight");b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}g.addClass("edit-cell ui-state-highlight");b(c.rows[d]).addClass("selected-row ui-state-hover");if(b.isFunction(c.p.onSelectCell)){f=g.html().replace(/\&#160\;/ig,"");c.p.onSelectCell(c.rows[d].id,h,f,d,e)}}c.p.iCol=e;c.p.iRow=
345
- d}}})},saveCell:function(d,e){return this.each(function(){var a=this,c;if(!(!a.grid||a.p.cellEdit!==true)){c=a.p.savedRow.length>=1?0:null;if(c!==null){var h=b("td:eq("+e+")",a.rows[d]),f,g,k=a.p.colModel[e],j=k.name,i=b.jgrid.jqID(j);switch(k.edittype){case "select":if(k.editoptions.multiple){i=b("#"+d+"_"+i,a.rows[d]);var l=[];if(f=b(i).val())f.join(",");else f="";b("option:selected",i).each(function(m,p){l[m]=b(p).text()});g=l.join(",")}else{f=b("#"+d+"_"+i+">option:selected",a.rows[d]).val();
346
- g=b("#"+d+"_"+i+">option:selected",a.rows[d]).text()}if(k.formatter)g=f;break;case "checkbox":var n=["Yes","No"];if(k.editoptions)n=k.editoptions.value.split(":");g=f=b("#"+d+"_"+i,a.rows[d]).attr("checked")?n[0]:n[1];break;case "password":case "text":case "textarea":case "button":g=f=b("#"+d+"_"+i,a.rows[d]).val();break;case "custom":try{if(k.editoptions&&b.isFunction(k.editoptions.custom_value)){f=k.editoptions.custom_value(b(".customelement",h),"get");if(f===undefined)throw"e2";else g=f}else throw"e1";
347
- }catch(q){q=="e1"&&info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+b.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);q=="e2"?info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+b.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap,q.message,jQuery.jgrid.edit.bClose)}break}if(g!=a.p.savedRow[c].v){if(b.isFunction(a.p.beforeSaveCell))if(c=a.p.beforeSaveCell(a.rows[d].id,j,f,d,e))f=c;var r=checkValues(f,e,a);if(r[0]===true){c={};
348
- if(b.isFunction(a.p.beforeSubmitCell))(c=a.p.beforeSubmitCell(a.rows[d].id,j,f,d,e))||(c={});b("input.hasDatepicker",h).length>0&&b("input.hasDatepicker",h).datepicker("hide");if(a.p.cellsubmit=="remote")if(a.p.cellurl){var o={};if(a.p.autoencode)f=b.jgrid.htmlEncode(f);o[j]=f;n=a.p.prmNames;k=n.id;i=n.oper;o[k]=a.rows[d].id;o[i]=n.editoper;o=b.extend(c,o);b("#lui_"+a.p.id).show();a.grid.hDiv.loading=true;b.ajax(b.extend({url:a.p.cellurl,data:b.isFunction(a.p.serializeCellData)?a.p.serializeCellData(o):
349
- o,type:"POST",complete:function(m,p){b("#lui_"+a.p.id).hide();a.grid.hDiv.loading=false;if(p=="success")if(b.isFunction(a.p.afterSubmitCell)){m=a.p.afterSubmitCell(m,o.id,j,f,d,e);if(m[0]===true){b(h).empty();b(a).jqGrid("setCell",a.rows[d].id,e,g,false,false,true);b(h).addClass("dirty-cell");b(a.rows[d]).addClass("edited");b.isFunction(a.p.afterSaveCell)&&a.p.afterSaveCell(a.rows[d].id,j,f,d,e);a.p.savedRow.splice(0,1)}else{info_dialog(b.jgrid.errors.errcap,m[1],b.jgrid.edit.bClose);b(a).jqGrid("restoreCell",
350
- d,e)}}else{b(h).empty();b(a).jqGrid("setCell",a.rows[d].id,e,g,false,false,true);b(h).addClass("dirty-cell");b(a.rows[d]).addClass("edited");b.isFunction(a.p.afterSaveCell)&&a.p.afterSaveCell(a.rows[d].id,j,f,d,e);a.p.savedRow.splice(0,1)}},error:function(m,p){b("#lui_"+a.p.id).hide();a.grid.hDiv.loading=false;b.isFunction(a.p.errorCell)?a.p.errorCell(m,p):info_dialog(b.jgrid.errors.errcap,m.status+" : "+m.statusText+"<br/>"+p,b.jgrid.edit.bClose);b(a).jqGrid("restoreCell",d,e)}},b.jgrid.ajaxOptions,
351
- a.p.ajaxCellOptions||{}))}else try{info_dialog(b.jgrid.errors.errcap,b.jgrid.errors.nourl,b.jgrid.edit.bClose);b(a).jqGrid("restoreCell",d,e)}catch(s){}if(a.p.cellsubmit=="clientArray"){b(h).empty();b(a).jqGrid("setCell",a.rows[d].id,e,g,false,false,true);b(h).addClass("dirty-cell");b(a.rows[d]).addClass("edited");b.isFunction(a.p.afterSaveCell)&&a.p.afterSaveCell(a.rows[d].id,j,f,d,e);a.p.savedRow.splice(0,1)}}else try{window.setTimeout(function(){info_dialog(b.jgrid.errors.errcap,f+" "+r[1],b.jgrid.edit.bClose)},
352
- 100);b(a).jqGrid("restoreCell",d,e)}catch(t){}}else b(a).jqGrid("restoreCell",d,e)}b.browser.opera?b("#"+a.p.knv).attr("tabindex","-1").focus():window.setTimeout(function(){b("#"+a.p.knv).attr("tabindex","-1").focus()},0)}})},restoreCell:function(d,e){return this.each(function(){var a=this,c;if(!(!a.grid||a.p.cellEdit!==true)){c=a.p.savedRow.length>=1?0:null;if(c!==null){var h=b("td:eq("+e+")",a.rows[d]);if(b.isFunction(b.fn.datepicker))try{b("input.hasDatepicker",h).datepicker("hide")}catch(f){}b(h).empty().attr("tabindex",
353
- "-1");b(a).jqGrid("setCell",a.rows[d].id,e,a.p.savedRow[c].v,false,false,true);b.isFunction(a.p.afterRestoreCell)&&a.p.afterRestoreCell(a.rows[d].id,a.p.savedRow[c].v,d,e);a.p.savedRow.splice(0,1)}window.setTimeout(function(){b("#"+a.p.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(d,e){return this.each(function(){var a=this,c=false;if(!(!a.grid||a.p.cellEdit!==true)){for(var h=e+1;h<a.p.colModel.length;h++)if(a.p.colModel[h].editable===true){c=h;break}if(c!==false)b(a).jqGrid("editCell",
354
- d,c,true);else a.p.savedRow.length>0&&b(a).jqGrid("saveCell",d,e)}})},prevCell:function(d,e){return this.each(function(){var a=this,c=false;if(!(!a.grid||a.p.cellEdit!==true)){for(var h=e-1;h>=0;h--)if(a.p.colModel[h].editable===true){c=h;break}if(c!==false)b(a).jqGrid("editCell",d,c,true);else a.p.savedRow.length>0&&b(a).jqGrid("saveCell",d,e)}})},GridNav:function(){return this.each(function(){function d(g,k,j){if(j.substr(0,1)=="v"){var i=b(a.grid.bDiv)[0].clientHeight,l=b(a.grid.bDiv)[0].scrollTop,
355
- n=a.rows[g].offsetTop+a.rows[g].clientHeight,q=a.rows[g].offsetTop;if(j=="vd")if(n>=i)b(a.grid.bDiv)[0].scrollTop=b(a.grid.bDiv)[0].scrollTop+a.rows[g].clientHeight;if(j=="vu")if(q<l)b(a.grid.bDiv)[0].scrollTop=b(a.grid.bDiv)[0].scrollTop-a.rows[g].clientHeight}if(j=="h"){j=b(a.grid.bDiv)[0].clientWidth;i=b(a.grid.bDiv)[0].scrollLeft;l=a.rows[g].cells[k].offsetLeft;if(a.rows[g].cells[k].offsetLeft+a.rows[g].cells[k].clientWidth>=j+parseInt(i,10))b(a.grid.bDiv)[0].scrollLeft=b(a.grid.bDiv)[0].scrollLeft+
356
- a.rows[g].cells[k].clientWidth;else if(l<i)b(a.grid.bDiv)[0].scrollLeft=b(a.grid.bDiv)[0].scrollLeft-a.rows[g].cells[k].clientWidth}}function e(g,k){var j,i;if(k=="lft"){j=g+1;for(i=g;i>=0;i--)if(a.p.colModel[i].hidden!==true){j=i;break}}if(k=="rgt"){j=g-1;for(i=g;i<a.p.colModel.length;i++)if(a.p.colModel[i].hidden!==true){j=i;break}}return j}var a=this;if(!(!a.grid||a.p.cellEdit!==true)){a.p.knv=a.p.id+"_kn";var c=b("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span tabindex='-1' style='width:0px;height:0px;background-color:grey' id='"+
357
- a.p.knv+"'></span></span>"),h,f;b(c).insertBefore(a.grid.cDiv);b("#"+a.p.knv).focus().keydown(function(g){f=g.keyCode;if(a.p.direction=="rtl")if(f==37)f=39;else if(f==39)f=37;switch(f){case 38:if(a.p.iRow-1>=0){d(a.p.iRow-1,a.p.iCol,"vu");b(a).jqGrid("editCell",a.p.iRow-1,a.p.iCol,false)}break;case 40:if(a.p.iRow+1<=a.rows.length-1){d(a.p.iRow+1,a.p.iCol,"vd");b(a).jqGrid("editCell",a.p.iRow+1,a.p.iCol,false)}break;case 37:if(a.p.iCol-1>=0){h=e(a.p.iCol-1,"lft");d(a.p.iRow,h,"h");b(a).jqGrid("editCell",
358
- a.p.iRow,h,false)}break;case 39:if(a.p.iCol+1<=a.p.colModel.length-1){h=e(a.p.iCol+1,"rgt");d(a.p.iRow,h,"h");b(a).jqGrid("editCell",a.p.iRow,h,false)}break;case 13:parseInt(a.p.iCol,10)>=0&&parseInt(a.p.iRow,10)>=0&&b(a).jqGrid("editCell",a.p.iRow,a.p.iCol,true);break}return false})}})},getChangedCells:function(d){var e=[];d||(d="all");this.each(function(){var a=this,c;!a.grid||a.p.cellEdit!==true||b(a.rows).each(function(h){var f={};if(b(this).hasClass("edited")){b("td",this).each(function(g){c=
334
+ (function(a){a.jgrid.extend({editRow:function(d,u,i,n,o,r,s,c,f){return this.each(function(){var b=this,k,l,t=0,p=null,q={},h,g;if(b.grid){h=a(b).jqGrid("getInd",d,true);if(h!==false)if((a(h).attr("editable")||"0")=="0"&&!a(h).hasClass("not-editable-row")){g=b.p.colModel;a("td",h).each(function(j){k=g[j].name;var v=b.p.treeGrid===true&&k==b.p.ExpandColumn;if(v)l=a("span:first",this).html();else try{l=a.unformat(this,{rowId:d,colModel:g[j]},j)}catch(m){l=a(this).html()}if(k!="cb"&&k!="subgrid"&&k!=
335
+ "rn"){if(b.p.autoencode)l=a.jgrid.htmlDecode(l);q[k]=l;if(g[j].editable===true){if(p===null)p=j;v?a("span:first",this).html(""):a(this).html("");var e=a.extend({},g[j].editoptions||{},{id:d+"_"+k,name:k});if(!g[j].edittype)g[j].edittype="text";e=a.jgrid.createEl(g[j].edittype,e,l,true,a.extend({},a.jgrid.ajaxOptions,b.p.ajaxSelectOptions||{}));a(e).addClass("editable");v?a("span:first",this).append(e):a(this).append(e);g[j].edittype=="select"&&g[j].editoptions.multiple===true&&a.browser.msie&&a(e).width(a(e).width());
336
+ t++}}});if(t>0){q.id=d;b.p.savedRow.push(q);a(h).attr("editable","1");a("td:eq("+p+") input",h).focus();u===true&&a(h).bind("keydown",function(j){j.keyCode===27&&a(b).jqGrid("restoreRow",d,f);if(j.keyCode===13){if(j.target.tagName=="TEXTAREA")return true;a(b).jqGrid("saveRow",d,n,o,r,s,c,f);return false}j.stopPropagation()});a.isFunction(i)&&i.call(b,d)}}}})},saveRow:function(d,u,i,n,o,r,s){return this.each(function(){var c=this,f,b={},k={},l,t,p,q;if(c.grid){q=a(c).jqGrid("getInd",d,true);if(q!==
337
+ false){l=a(q).attr("editable");i=i?i:c.p.editurl;if(l==="1"){var h;a("td",q).each(function(m){h=c.p.colModel[m];f=h.name;if(f!="cb"&&f!="subgrid"&&h.editable===true&&f!="rn"){switch(h.edittype){case "checkbox":var e=["Yes","No"];if(h.editoptions)e=h.editoptions.value.split(":");b[f]=a("input",this).attr("checked")?e[0]:e[1];break;case "text":case "password":case "textarea":case "button":b[f]=a("input, textarea",this).val();break;case "select":if(h.editoptions.multiple){e=a("select",this);var x=[];
338
+ b[f]=a(e).val();b[f]=b[f]?b[f].join(","):"";a("select > option:selected",this).each(function(y,z){x[y]=a(z).text()});k[f]=x.join(",")}else{b[f]=a("select>option:selected",this).val();k[f]=a("select>option:selected",this).text()}if(h.formatter&&h.formatter=="select")k={};break;case "custom":try{if(h.editoptions&&a.isFunction(h.editoptions.custom_value)){b[f]=h.editoptions.custom_value.call(c,a(".customelement",this),"get");if(b[f]===undefined)throw"e2";}else throw"e1";}catch(w){w=="e1"&&a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,
339
+ "function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);w=="e2"?a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,w.message,jQuery.jgrid.edit.bClose)}break}p=a.jgrid.checkValues(b[f],m,c);if(p[0]===false){p[1]=b[f]+" "+p[1];return false}if(c.p.autoencode)b[f]=a.jgrid.htmlEncode(b[f])}});if(p[0]===false)try{var g=a.jgrid.findPos(a("#"+a.jgrid.jqID(d),c.grid.bDiv)[0]);
340
+ a.jgrid.info_dialog(a.jgrid.errors.errcap,p[1],a.jgrid.edit.bClose,{left:g[0],top:g[1]})}catch(j){alert(p[1])}else{if(b){var v;g=c.p.prmNames;v=g.oper;l=g.id;b[v]=g.editoper;b[l]=d;if(typeof c.p.inlineData=="undefined")c.p.inlineData={};if(typeof n=="undefined")n={};b=a.extend({},b,c.p.inlineData,n)}if(i=="clientArray"){b=a.extend({},b,k);c.p.autoencode&&a.each(b,function(m,e){b[m]=a.jgrid.htmlDecode(e)});l=a(c).jqGrid("setRowData",d,b);a(q).attr("editable","0");for(g=0;g<c.p.savedRow.length;g++)if(c.p.savedRow[g].id==
341
+ d){t=g;break}t>=0&&c.p.savedRow.splice(t,1);a.isFunction(o)&&o.call(c,d,l)}else{a("#lui_"+c.p.id).show();a.ajax(a.extend({url:i,data:a.isFunction(c.p.serializeRowData)?c.p.serializeRowData.call(c,b):b,type:"POST",complete:function(m,e){a("#lui_"+c.p.id).hide();if(e==="success")if((a.isFunction(u)?u.call(c,m):true)===true){c.p.autoencode&&a.each(b,function(x,w){b[x]=a.jgrid.htmlDecode(w)});b=a.extend({},b,k);a(c).jqGrid("setRowData",d,b);a(q).attr("editable","0");for(e=0;e<c.p.savedRow.length;e++)if(c.p.savedRow[e].id==
342
+ d){t=e;break}t>=0&&c.p.savedRow.splice(t,1);a.isFunction(o)&&o.call(c,d,m)}else{a.isFunction(r)&&r.call(c,d,m,e);a(c).jqGrid("restoreRow",d,s)}},error:function(m,e){a("#lui_"+c.p.id).hide();a.isFunction(r)?r.call(c,d,m,e):alert("Error Row: "+d+" Result: "+m.status+":"+m.statusText+" Status: "+e);a(c).jqGrid("restoreRow",d,s)}},a.jgrid.ajaxOptions,c.p.ajaxRowOptions||{}))}a(q).unbind("keydown")}}}}})},restoreRow:function(d,u){return this.each(function(){var i=this,n,o,r={};if(i.grid){o=a(i).jqGrid("getInd",
343
+ d,true);if(o!==false){for(var s=0;s<i.p.savedRow.length;s++)if(i.p.savedRow[s].id==d){n=s;break}if(n>=0){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+a.jgrid.jqID(o.id)).datepicker("hide")}catch(c){}a.each(i.p.colModel,function(){if(this.editable===true&&this.name in i.p.savedRow[n])r[this.name]=i.p.savedRow[n][this.name]});a(i).jqGrid("setRowData",d,r);a(o).attr("editable","0").unbind("keydown");i.p.savedRow.splice(n,1)}a.isFunction(u)&&u.call(i,d)}}})}})})(jQuery);
344
+ (function(b){b.jgrid.extend({editCell:function(d,e,a){return this.each(function(){var c=this,h,f,g;if(!(!c.grid||c.p.cellEdit!==true)){e=parseInt(e,10);c.p.selrow=c.rows[d].id;c.p.knv||b(c).jqGrid("GridNav");if(c.p.savedRow.length>0){if(a===true)if(d==c.p.iRow&&e==c.p.iCol)return;b(c).jqGrid("saveCell",c.p.savedRow[0].id,c.p.savedRow[0].ic)}else window.setTimeout(function(){b("#"+c.p.knv).attr("tabindex","-1").focus()},0);h=c.p.colModel[e].name;if(!(h=="subgrid"||h=="cb"||h=="rn")){g=b("td:eq("+e+
345
+ ")",c.rows[d]);if(c.p.colModel[e].editable===true&&a===true&&!g.hasClass("not-editable-cell")){if(parseInt(c.p.iCol,10)>=0&&parseInt(c.p.iRow,10)>=0){b("td:eq("+c.p.iCol+")",c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight");b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}b(g).addClass("edit-cell ui-state-highlight");b(c.rows[d]).addClass("selected-row ui-state-hover");try{f=b.unformat(g,{rowId:c.rows[d].id,colModel:c.p.colModel[e]},e)}catch(k){f=b(g).html()}if(c.p.autoencode)f=
346
+ b.jgrid.htmlDecode(f);if(!c.p.colModel[e].edittype)c.p.colModel[e].edittype="text";c.p.savedRow.push({id:d,ic:e,name:h,v:f});if(b.isFunction(c.p.formatCell)){var j=c.p.formatCell.call(c,c.rows[d].id,h,f,d,e);if(j!==undefined)f=j}j=b.extend({},c.p.colModel[e].editoptions||{},{id:d+"_"+h,name:h});var i=b.jgrid.createEl(c.p.colModel[e].edittype,j,f,true,b.extend({},b.jgrid.ajaxOptions,c.p.ajaxSelectOptions||{}));b.isFunction(c.p.beforeEditCell)&&c.p.beforeEditCell.call(c,c.rows[d].id,h,f,d,e);b(g).html("").append(i).attr("tabindex",
347
+ "0");window.setTimeout(function(){b(i).focus()},0);b("input, select, textarea",g).bind("keydown",function(l){if(l.keyCode===27)if(b("input.hasDatepicker",g).length>0)b(".ui-datepicker").is(":hidden")?b(c).jqGrid("restoreCell",d,e):b("input.hasDatepicker",g).datepicker("hide");else b(c).jqGrid("restoreCell",d,e);l.keyCode===13&&b(c).jqGrid("saveCell",d,e);if(l.keyCode==9)if(c.grid.hDiv.loading)return false;else l.shiftKey?b(c).jqGrid("prevCell",d,e):b(c).jqGrid("nextCell",d,e);l.stopPropagation()});
348
+ b.isFunction(c.p.afterEditCell)&&c.p.afterEditCell.call(c,c.rows[d].id,h,f,d,e)}else{if(parseInt(c.p.iCol,10)>=0&&parseInt(c.p.iRow,10)>=0){b("td:eq("+c.p.iCol+")",c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight");b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}g.addClass("edit-cell ui-state-highlight");b(c.rows[d]).addClass("selected-row ui-state-hover");if(b.isFunction(c.p.onSelectCell)){f=g.html().replace(/\&#160\;/ig,"");c.p.onSelectCell.call(c,c.rows[d].id,h,f,d,e)}}c.p.iCol=
349
+ e;c.p.iRow=d}}})},saveCell:function(d,e){return this.each(function(){var a=this,c;if(!(!a.grid||a.p.cellEdit!==true)){c=a.p.savedRow.length>=1?0:null;if(c!==null){var h=b("td:eq("+e+")",a.rows[d]),f,g,k=a.p.colModel[e],j=k.name,i=b.jgrid.jqID(j);switch(k.edittype){case "select":if(k.editoptions.multiple){i=b("#"+d+"_"+i,a.rows[d]);var l=[];if(f=b(i).val())f.join(",");else f="";b("option:selected",i).each(function(m,p){l[m]=b(p).text()});g=l.join(",")}else{f=b("#"+d+"_"+i+">option:selected",a.rows[d]).val();
350
+ g=b("#"+d+"_"+i+">option:selected",a.rows[d]).text()}if(k.formatter)g=f;break;case "checkbox":var n=["Yes","No"];if(k.editoptions)n=k.editoptions.value.split(":");g=f=b("#"+d+"_"+i,a.rows[d]).attr("checked")?n[0]:n[1];break;case "password":case "text":case "textarea":case "button":g=f=b("#"+d+"_"+i,a.rows[d]).val();break;case "custom":try{if(k.editoptions&&b.isFunction(k.editoptions.custom_value)){f=k.editoptions.custom_value.call(a,b(".customelement",h),"get");if(f===undefined)throw"e2";else g=f}else throw"e1";
351
+ }catch(q){q=="e1"&&b.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+b.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);q=="e2"?b.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+b.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):b.jgrid.info_dialog(jQuery.jgrid.errors.errcap,q.message,jQuery.jgrid.edit.bClose)}break}if(g!=a.p.savedRow[c].v){if(b.isFunction(a.p.beforeSaveCell))if(c=a.p.beforeSaveCell.call(a,a.rows[d].id,j,f,d,e))g=f=c;var r=b.jgrid.checkValues(f,
352
+ e,a);if(r[0]===true){c={};if(b.isFunction(a.p.beforeSubmitCell))(c=a.p.beforeSubmitCell.call(a,a.rows[d].id,j,f,d,e))||(c={});b("input.hasDatepicker",h).length>0&&b("input.hasDatepicker",h).datepicker("hide");if(a.p.cellsubmit=="remote")if(a.p.cellurl){var o={};if(a.p.autoencode)f=b.jgrid.htmlEncode(f);o[j]=f;n=a.p.prmNames;k=n.id;i=n.oper;o[k]=a.rows[d].id;o[i]=n.editoper;o=b.extend(c,o);b("#lui_"+a.p.id).show();a.grid.hDiv.loading=true;b.ajax(b.extend({url:a.p.cellurl,data:b.isFunction(a.p.serializeCellData)?
353
+ a.p.serializeCellData.call(a,o):o,type:"POST",complete:function(m,p){b("#lui_"+a.p.id).hide();a.grid.hDiv.loading=false;if(p=="success")if(b.isFunction(a.p.afterSubmitCell)){m=a.p.afterSubmitCell.call(a,m,o.id,j,f,d,e);if(m[0]===true){b(h).empty();b(a).jqGrid("setCell",a.rows[d].id,e,g,false,false,true);b(h).addClass("dirty-cell");b(a.rows[d]).addClass("edited");b.isFunction(a.p.afterSaveCell)&&a.p.afterSaveCell.call(a,a.rows[d].id,j,f,d,e);a.p.savedRow.splice(0,1)}else{b.jgrid.info_dialog(b.jgrid.errors.errcap,
354
+ m[1],b.jgrid.edit.bClose);b(a).jqGrid("restoreCell",d,e)}}else{b(h).empty();b(a).jqGrid("setCell",a.rows[d].id,e,g,false,false,true);b(h).addClass("dirty-cell");b(a.rows[d]).addClass("edited");b.isFunction(a.p.afterSaveCell)&&a.p.afterSaveCell.call(a,a.rows[d].id,j,f,d,e);a.p.savedRow.splice(0,1)}},error:function(m,p){b("#lui_"+a.p.id).hide();a.grid.hDiv.loading=false;b.isFunction(a.p.errorCell)?a.p.errorCell.call(a,m,p):b.jgrid.info_dialog(b.jgrid.errors.errcap,m.status+" : "+m.statusText+"<br/>"+
355
+ p,b.jgrid.edit.bClose);b(a).jqGrid("restoreCell",d,e)}},b.jgrid.ajaxOptions,a.p.ajaxCellOptions||{}))}else try{b.jgrid.info_dialog(b.jgrid.errors.errcap,b.jgrid.errors.nourl,b.jgrid.edit.bClose);b(a).jqGrid("restoreCell",d,e)}catch(s){}if(a.p.cellsubmit=="clientArray"){b(h).empty();b(a).jqGrid("setCell",a.rows[d].id,e,g,false,false,true);b(h).addClass("dirty-cell");b(a.rows[d]).addClass("edited");b.isFunction(a.p.afterSaveCell)&&a.p.afterSaveCell.call(a,a.rows[d].id,j,f,d,e);a.p.savedRow.splice(0,
356
+ 1)}}else try{window.setTimeout(function(){b.jgrid.info_dialog(b.jgrid.errors.errcap,f+" "+r[1],b.jgrid.edit.bClose)},100);b(a).jqGrid("restoreCell",d,e)}catch(t){}}else b(a).jqGrid("restoreCell",d,e)}b.browser.opera?b("#"+a.p.knv).attr("tabindex","-1").focus():window.setTimeout(function(){b("#"+a.p.knv).attr("tabindex","-1").focus()},0)}})},restoreCell:function(d,e){return this.each(function(){var a=this,c;if(!(!a.grid||a.p.cellEdit!==true)){c=a.p.savedRow.length>=1?0:null;if(c!==null){var h=b("td:eq("+
357
+ e+")",a.rows[d]);if(b.isFunction(b.fn.datepicker))try{b("input.hasDatepicker",h).datepicker("hide")}catch(f){}b(h).empty().attr("tabindex","-1");b(a).jqGrid("setCell",a.rows[d].id,e,a.p.savedRow[c].v,false,false,true);b.isFunction(a.p.afterRestoreCell)&&a.p.afterRestoreCell.call(a,a.rows[d].id,a.p.savedRow[c].v,d,e);a.p.savedRow.splice(0,1)}window.setTimeout(function(){b("#"+a.p.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(d,e){return this.each(function(){var a=this,c=false;if(!(!a.grid||
358
+ a.p.cellEdit!==true)){for(var h=e+1;h<a.p.colModel.length;h++)if(a.p.colModel[h].editable===true){c=h;break}if(c!==false)b(a).jqGrid("editCell",d,c,true);else a.p.savedRow.length>0&&b(a).jqGrid("saveCell",d,e)}})},prevCell:function(d,e){return this.each(function(){var a=this,c=false;if(!(!a.grid||a.p.cellEdit!==true)){for(var h=e-1;h>=0;h--)if(a.p.colModel[h].editable===true){c=h;break}if(c!==false)b(a).jqGrid("editCell",d,c,true);else a.p.savedRow.length>0&&b(a).jqGrid("saveCell",d,e)}})},GridNav:function(){return this.each(function(){function d(g,
359
+ k,j){if(j.substr(0,1)=="v"){var i=b(a.grid.bDiv)[0].clientHeight,l=b(a.grid.bDiv)[0].scrollTop,n=a.rows[g].offsetTop+a.rows[g].clientHeight,q=a.rows[g].offsetTop;if(j=="vd")if(n>=i)b(a.grid.bDiv)[0].scrollTop=b(a.grid.bDiv)[0].scrollTop+a.rows[g].clientHeight;if(j=="vu")if(q<l)b(a.grid.bDiv)[0].scrollTop=b(a.grid.bDiv)[0].scrollTop-a.rows[g].clientHeight}if(j=="h"){j=b(a.grid.bDiv)[0].clientWidth;i=b(a.grid.bDiv)[0].scrollLeft;l=a.rows[g].cells[k].offsetLeft;if(a.rows[g].cells[k].offsetLeft+a.rows[g].cells[k].clientWidth>=
360
+ j+parseInt(i,10))b(a.grid.bDiv)[0].scrollLeft=b(a.grid.bDiv)[0].scrollLeft+a.rows[g].cells[k].clientWidth;else if(l<i)b(a.grid.bDiv)[0].scrollLeft=b(a.grid.bDiv)[0].scrollLeft-a.rows[g].cells[k].clientWidth}}function e(g,k){var j,i;if(k=="lft"){j=g+1;for(i=g;i>=0;i--)if(a.p.colModel[i].hidden!==true){j=i;break}}if(k=="rgt"){j=g-1;for(i=g;i<a.p.colModel.length;i++)if(a.p.colModel[i].hidden!==true){j=i;break}}return j}var a=this;if(!(!a.grid||a.p.cellEdit!==true)){a.p.knv=a.p.id+"_kn";var c=b("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span tabindex='-1' style='width:0px;height:0px;background-color:grey' id='"+
361
+ a.p.knv+"'></span></span>"),h,f;b(c).insertBefore(a.grid.cDiv);b("#"+a.p.knv).focus().keydown(function(g){f=g.keyCode;if(a.p.direction=="rtl")if(f==37)f=39;else if(f==39)f=37;switch(f){case 38:if(a.p.iRow-1>0){d(a.p.iRow-1,a.p.iCol,"vu");b(a).jqGrid("editCell",a.p.iRow-1,a.p.iCol,false)}break;case 40:if(a.p.iRow+1<=a.rows.length-1){d(a.p.iRow+1,a.p.iCol,"vd");b(a).jqGrid("editCell",a.p.iRow+1,a.p.iCol,false)}break;case 37:if(a.p.iCol-1>=0){h=e(a.p.iCol-1,"lft");d(a.p.iRow,h,"h");b(a).jqGrid("editCell",
362
+ a.p.iRow,h,false)}break;case 39:if(a.p.iCol+1<=a.p.colModel.length-1){h=e(a.p.iCol+1,"rgt");d(a.p.iRow,h,"h");b(a).jqGrid("editCell",a.p.iRow,h,false)}break;case 13:parseInt(a.p.iCol,10)>=0&&parseInt(a.p.iRow,10)>=0&&b(a).jqGrid("editCell",a.p.iRow,a.p.iCol,true);break}return false})}})},getChangedCells:function(d){var e=[];d||(d="all");this.each(function(){var a=this,c;!a.grid||a.p.cellEdit!==true||b(a.rows).each(function(h){var f={};if(b(this).hasClass("edited")){b("td",this).each(function(g){c=
359
363
  a.p.colModel[g].name;if(c!=="cb"&&c!=="subgrid")if(d=="dirty"){if(b(this).hasClass("dirty-cell"))try{f[c]=b.unformat(this,{rowId:a.rows[h].id,colModel:a.p.colModel[g]},g)}catch(k){f[c]=b.jgrid.htmlDecode(b(this).html())}}else try{f[c]=b.unformat(this,{rowId:a.rows[h].id,colModel:a.p.colModel[g]},g)}catch(j){f[c]=b.jgrid.htmlDecode(b(this).html())}});f.id=this.id;e.push(f)}})});return e}})})(jQuery);
360
- (function(b){b.fn.jqm=function(a){var f={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:e,ajaxText:"",target:e,modal:e,toTop:e,onShow:e,onHide:e,onLoad:e};return this.each(function(){if(this._jqm)return i[this._jqm].c=b.extend({},i[this._jqm].c,a);l++;this._jqm=l;i[l]={c:b.extend(f,b.jqm.params,a),a:e,w:b(this).addClass("jqmID"+l),s:l};f.trigger&&b(this).jqmAddTrigger(f.trigger)})};b.fn.jqmAddClose=function(a){return o(this,a,"jqmHide")};b.fn.jqmAddTrigger=
361
- function(a){return o(this,a,"jqmShow")};b.fn.jqmShow=function(a){return this.each(function(){b.jqm.open(this._jqm,a)})};b.fn.jqmHide=function(a){return this.each(function(){b.jqm.close(this._jqm,a)})};b.jqm={hash:{},open:function(a,f){var c=i[a],d=c.c,h="."+d.closeClass,g=parseInt(c.w.css("z-index"));g=g>0?g:3E3;var j=b("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":g-1,opacity:d.overlay/100});if(c.a)return e;c.t=f;c.a=true;c.w.css("z-index",g);if(d.modal){k[0]||
362
- setTimeout(function(){p("bind")},1);k.push(a)}else if(d.overlay>0)d.closeoverlay&&c.w.jqmAddClose(j);else j=e;c.o=j?j.addClass(d.overlayClass).prependTo("body"):e;if(q){b("html,body").css({height:"100%",width:"100%"});if(j){j=j.css({position:"absolute"})[0];for(var m in{Top:1,Left:1})j.style.setExpression(m.toLowerCase(),"(_=(document.documentElement.scroll"+m+" || document.body.scroll"+m+"))+'px'")}}if(d.ajax){a=d.target||c.w;g=d.ajax;a=typeof a=="string"?b(a,c.w):b(a);g=g.substr(0,1)=="@"?b(f).attr(g.substring(1)):
363
- g;a.html(d.ajaxText).load(g,function(){d.onLoad&&d.onLoad.call(this,c);h&&c.w.jqmAddClose(b(h,c.w));r(c)})}else h&&c.w.jqmAddClose(b(h,c.w));d.toTop&&c.o&&c.w.before('<span id="jqmP'+c.w[0]._jqm+'"></span>').insertAfter(c.o);d.onShow?d.onShow(c):c.w.show();r(c);return e},close:function(a){a=i[a];if(!a.a)return e;a.a=e;if(k[0]){k.pop();k[0]||p("unbind")}a.c.toTop&&a.o&&b("#jqmP"+a.w[0]._jqm).after(a.w).remove();if(a.c.onHide)a.c.onHide(a);else{a.w.hide();a.o&&a.o.remove()}return e},params:{}};var l=
364
- 0,i=b.jqm.hash,k=[],q=b.browser.msie&&b.browser.version=="6.0",e=false,r=function(a){var f=b('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(q)if(a.o)a.o.html('<p style="width:100%;height:100%"/>').prepend(f);else b("iframe.jqm",a.w)[0]||a.w.prepend(f);s(a)},s=function(a){try{b(":input:visible",a.w)[0].focus()}catch(f){}},p=function(a){b(document)[a]("keypress",n)[a]("keydown",n)[a]("mousedown",n)},n=function(a){var f=i[k[k.length-1]];(a=!b(a.target).parents(".jqmID"+
364
+ (function(b){b.fn.jqm=function(a){var f={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:e,ajaxText:"",target:e,modal:e,toTop:e,onShow:e,onHide:e,onLoad:e};return this.each(function(){if(this._jqm)return i[this._jqm].c=b.extend({},i[this._jqm].c,a);l++;this._jqm=l;i[l]={c:b.extend(f,b.jqm.params,a),a:e,w:b(this).addClass("jqmID"+l),s:l};f.trigger&&b(this).jqmAddTrigger(f.trigger)})};b.fn.jqmAddClose=function(a){return o(this,a,"jqmHide")};b.fn.jqmAddTrigger=
365
+ function(a){return o(this,a,"jqmShow")};b.fn.jqmShow=function(a){return this.each(function(){b.jqm.open(this._jqm,a)})};b.fn.jqmHide=function(a){return this.each(function(){b.jqm.close(this._jqm,a)})};b.jqm={hash:{},open:function(a,f){var c=i[a],d=c.c,h="."+d.closeClass,g=parseInt(c.w.css("z-index"));g=g>0?g:3E3;var j=b("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":g-1,opacity:d.overlay/100});if(c.a)return e;c.t=f;c.a=true;c.w.css("z-index",g);if(d.modal){k[0]||
366
+ setTimeout(function(){p("bind")},1);k.push(a)}else if(d.overlay>0)d.closeoverlay&&c.w.jqmAddClose(j);else j=e;c.o=j?j.addClass(d.overlayClass).prependTo("body"):e;if(q){b("html,body").css({height:"100%",width:"100%"});if(j){j=j.css({position:"absolute"})[0];for(var m in{Top:1,Left:1})j.style.setExpression(m.toLowerCase(),"(_=(document.documentElement.scroll"+m+" || document.body.scroll"+m+"))+'px'")}}if(d.ajax){a=d.target||c.w;g=d.ajax;a=typeof a=="string"?b(a,c.w):b(a);g=g.substr(0,1)=="@"?b(f).attr(g.substring(1)):
367
+ g;a.html(d.ajaxText).load(g,function(){d.onLoad&&d.onLoad.call(this,c);h&&c.w.jqmAddClose(b(h,c.w));r(c)})}else h&&c.w.jqmAddClose(b(h,c.w));d.toTop&&c.o&&c.w.before('<span id="jqmP'+c.w[0]._jqm+'"></span>').insertAfter(c.o);d.onShow?d.onShow(c):c.w.show();r(c);return e},close:function(a){a=i[a];if(!a.a)return e;a.a=e;if(k[0]){k.pop();k[0]||p("unbind")}a.c.toTop&&a.o&&b("#jqmP"+a.w[0]._jqm).after(a.w).remove();if(a.c.onHide)a.c.onHide(a);else{a.w.hide();a.o&&a.o.remove()}return e},params:{}};var l=
368
+ 0,i=b.jqm.hash,k=[],q=b.browser.msie&&b.browser.version=="6.0",e=false,r=function(a){var f=b('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(q)if(a.o)a.o.html('<p style="width:100%;height:100%"/>').prepend(f);else b("iframe.jqm",a.w)[0]||a.w.prepend(f);s(a)},s=function(a){try{b(":input:visible",a.w)[0].focus()}catch(f){}},p=function(a){b(document)[a]("keypress",n)[a]("keydown",n)[a]("mousedown",n)},n=function(a){var f=i[k[k.length-1]];(a=!b(a.target).parents(".jqmID"+
365
369
  f.s)[0])&&s(f);return!a},o=function(a,f,c){return a.each(function(){var d=this._jqm;b(f).each(function(){if(!this[c]){this[c]=[];b(this).click(function(){for(var h in{jqmShow:1,jqmHide:1})for(var g in this[h])i[this[h][g]]&&i[this[h][g]].w[h](this);return e})}this[c].push(d)})})}})(jQuery);
366
- (function(b){b.fn.jqDrag=function(a){return l(this,a,"d")};b.fn.jqResize=function(a,e){return l(this,a,"r",e)};b.jqDnR={dnr:{},e:0,drag:function(a){if(c.k=="d")d.css({left:c.X+a.pageX-c.pX,top:c.Y+a.pageY-c.pY});else{d.css({width:Math.max(a.pageX-c.pX+c.W,0),height:Math.max(a.pageY-c.pY+c.H,0)});M1&&f.css({width:Math.max(a.pageX-M1.pX+M1.W,0),height:Math.max(a.pageY-M1.pY+M1.H,0)})}return false},stop:function(){b(document).unbind("mousemove",i.drag).unbind("mouseup",i.stop)}};var i=b.jqDnR,c=i.dnr,
367
- d=i.e,f,l=function(a,e,n,m){return a.each(function(){e=e?b(e,a):a;e.bind("mousedown",{e:a,k:n},function(g){var j=g.data,h={};d=j.e;f=m?b(m):false;if(d.css("position")!="relative")try{d.position(h)}catch(o){}c={X:h.left||k("left")||0,Y:h.top||k("top")||0,W:k("width")||d[0].scrollWidth||0,H:k("height")||d[0].scrollHeight||0,pX:g.pageX,pY:g.pageY,k:j.k};M1=f&&j.k!="d"?{X:h.left||f1("left")||0,Y:h.top||f1("top")||0,W:f[0].offsetWidth||f1("width")||0,H:f[0].offsetHeight||f1("height")||0,pX:g.pageX,pY:g.pageY,
368
- k:j.k}:false;b(document).mousemove(b.jqDnR.drag).mouseup(b.jqDnR.stop);return false})})},k=function(a){return parseInt(d.css(a))||false};f1=function(a){return parseInt(f.css(a))||false}})(jQuery);
369
- (function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var e=this;e.p.colNames.unshift("");e.p.colModel.unshift({name:"subgrid",width:a.browser.safari?e.p.subGridWidth+e.p.cellLayout:e.p.subGridWidth,sortable:false,resizable:false,hidedlg:true,search:false,fixed:true});e=e.p.subGridModel;if(e[0]){e[0].align=a.extend([],e[0].align||[]);for(var c=0;c<e[0].name.length;c++)e[0].align[c]=e[0].align[c]||"left"}})},addSubGridCell:function(e,c){var b="",n,k;this.each(function(){b=
370
- this.formatCol(e,c);n=this.p.gridview;k=this.p.id});return n===false?'<td role="grid" aria-describedby="'+k+'_subgrid" class="ui-sgcollapsed sgcollapsed" '+b+"><a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a></td>":'<td role="grid" aria-describedby="'+k+'_subgrid" '+b+"></td>"},addSubGrid:function(e,c){return this.each(function(){var b=this;if(b.grid){var n,k,p,t,s,u,o;a("td:eq("+c+")",e).click(function(){if(a(this).hasClass("sgcollapsed")){p=b.p.id;n=a(this).parent();
371
- t=c>=1?"<td colspan='"+c+"'>&#160;</td>":"";k=a(n).attr("id");o=true;if(a.isFunction(b.p.subGridBeforeExpand))o=b.p.subGridBeforeExpand(p+"_"+k,k);if(o===false)return false;s=0;a.each(b.p.colModel,function(){if(this.hidden===true||this.name=="rn"||this.name=="cb")s++});u="<tr role='row' class='ui-subgrid'>"+t+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon ui-icon-carat-1-sw'/></td><td colspan='"+parseInt(b.p.colNames.length-1-s,10)+"' class='ui-widget-content subgrid-data'><div id="+
372
- p+"_"+k+" class='tablediv'>";a(this).parent().after(u+"</div></td></tr>");a.isFunction(b.p.subGridRowExpanded)?b.p.subGridRowExpanded(p+"_"+k,k):x(n);a(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-minus'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded")}else if(a(this).hasClass("sgexpanded")){o=true;if(a.isFunction(b.p.subGridRowColapsed)){n=a(this).parent();k=a(n).attr("id");o=b.p.subGridRowColapsed(p+"_"+k,k)}if(o===false)return false;a(this).parent().next().remove(".ui-subgrid");
373
- a(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}return false});var x=function(g){var j,f,d,h;j=a(g).attr("id");f={nd_:(new Date).getTime()};f[b.p.prmNames.subgridid]=j;if(!b.p.subGridModel[0])return false;if(b.p.subGridModel[0].params)for(h=0;h<b.p.subGridModel[0].params.length;h++)for(d=0;d<b.p.colModel.length;d++)if(b.p.colModel[d].name==b.p.subGridModel[0].params[h])f[b.p.colModel[d].name]=a("td:eq("+
374
- d+")",g).text().replace(/\&#160\;/ig,"");if(!b.grid.hDiv.loading){b.grid.hDiv.loading=true;a("#load_"+b.p.id).show();if(!b.p.subgridtype)b.p.subgridtype=b.p.datatype;if(a.isFunction(b.p.subgridtype))b.p.subgridtype(f);else b.p.subgridtype=b.p.subgridtype.toLowerCase();switch(b.p.subgridtype){case "xml":case "json":a.ajax(a.extend({type:b.p.mtype,url:b.p.subGridUrl,dataType:b.p.subgridtype,data:a.isFunction(b.p.serializeSubGridData)?b.p.serializeSubGridData(f):f,complete:function(i){b.p.subgridtype==
375
- "xml"?v(i.responseXML,j):w(a.jgrid.parse(i.responseText),j)}},a.jgrid.ajaxOptions,b.p.ajaxSubgridOptions||{}));break}}return false},r=function(g,j,f){j=a("<td align='"+b.p.subGridModel[0].align[f]+"'></td>").html(j);a(g).append(j)},v=function(g,j){var f,d,h,i=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),l=a("<tr></tr>");for(d=0;d<b.p.subGridModel[0].name.length;d++){f=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+b.p.direction+"'></th>");a(f).html(b.p.subGridModel[0].name[d]);
376
- a(f).width(b.p.subGridModel[0].width[d]);a(l).append(f)}a(i).append(l);if(g){h=b.p.xmlReader.subgrid;a(h.root+" "+h.row,g).each(function(){l=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(h.repeatitems===true)a(h.cell,this).each(function(q){r(l,a(this).text()||"&#160;",q)});else{var m=b.p.subGridModel[0].mapping||b.p.subGridModel[0].name;if(m)for(d=0;d<m.length;d++)r(l,a(m[d],this).text()||"&#160;",d)}a(i).append(l)})}g=a("table:first",b.grid.bDiv).attr("id")+"_";a("#"+g+j).append(i);b.grid.hDiv.loading=
377
- false;a("#load_"+b.p.id).hide();return false},w=function(g,j){var f,d,h,i,l=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),m=a("<tr></tr>");for(d=0;d<b.p.subGridModel[0].name.length;d++){f=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+b.p.direction+"'></th>");a(f).html(b.p.subGridModel[0].name[d]);a(f).width(b.p.subGridModel[0].width[d]);a(m).append(f)}a(l).append(m);if(g){f=b.p.jsonReader.subgrid;g=g[f.root];if(typeof g!=="undefined")for(d=0;d<
378
- g.length;d++){h=g[d];m=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(f.repeatitems===true){if(f.cell)h=h[f.cell];for(i=0;i<h.length;i++)r(m,h[i]||"&#160;",i)}else{var q=b.p.subGridModel[0].mapping||b.p.subGridModel[0].name;if(q.length)for(i=0;i<q.length;i++)r(m,h[q[i]]||"&#160;",i)}a(l).append(m)}}d=a("table:first",b.grid.bDiv).attr("id")+"_";a("#"+d+j).append(l);b.grid.hDiv.loading=false;a("#load_"+b.p.id).hide();return false};b.subGridXml=function(g,j){v(g,j)};b.subGridJson=function(g,
379
- j){w(g,j)}}})},expandSubGridRow:function(e){return this.each(function(){var c=this;if(c.grid||e)if(c.p.subGrid===true)if(c=a(this).jqGrid("getInd",e,true))(c=a("td.sgcollapsed",c)[0])&&a(c).trigger("click")})},collapseSubGridRow:function(e){return this.each(function(){var c=this;if(c.grid||e)if(c.p.subGrid===true)if(c=a(this).jqGrid("getInd",e,true))(c=a("td.sgexpanded",c)[0])&&a(c).trigger("click")})},toggleSubGridRow:function(e){return this.each(function(){var c=this;if(c.grid||e)if(c.p.subGrid===
380
- true)if(c=a(this).jqGrid("getInd",e,true)){var b=a("td.sgcollapsed",c)[0];if(b)a(b).trigger("click");else(b=a("td.sgexpanded",c)[0])&&a(b).trigger("click")}})}})})(jQuery);
381
- (function(d){d.jgrid.extend({setTreeNode:function(b,c){return this.each(function(){var a=this;if(a.grid&&a.p.treeGrid){var f=a.p.expColInd,e=a.p.treeReader.expanded_field,k=a.p.treeReader.leaf_field,j=a.p.treeReader.level_field;c.level=b[j];if(a.p.treeGridModel=="nested"){var i=b[a.p.treeReader.left_field],h=b[a.p.treeReader.right_field];b[k]||(b[k]=parseInt(h,10)===parseInt(i,10)+1?"true":"false")}h=parseInt(b[j],10);if(a.p.tree_root_level===0){i=h+1;h=h}else{i=h;h=h-1}i="<div class='tree-wrap tree-wrap-"+
382
- a.p.direction+"' style='width:"+i*18+"px;'>";i+="<div style='"+(a.p.direction=="rtl"?"right:":"left:")+h*18+"px;' class='ui-icon ";if(b[k]=="true"||b[k]===true){i+=a.p.treeIcons.leaf+" tree-leaf'";b[k]=true;b[e]=false}else{if(b[e]=="true"||b[e]===true){i+=a.p.treeIcons.minus+" tree-minus treeclick'";b[e]=true}else{i+=a.p.treeIcons.plus+" tree-plus treeclick'";b[e]=false}b[k]=false}i+="</div></div>";if(!a.p.loadonce){b[a.p.localReader.id]=c.id;a.p.data.push(b);a.p._index[c.id]=a.p.data.length-1}if(parseInt(b[j],
383
- 10)!==parseInt(a.p.tree_root_level,10))d(a).jqGrid("isVisibleNode",b)||d(c).css("display","none");d("td:eq("+f+")",c).wrapInner("<span></span>").prepend(i);d(".treeclick",c).bind("click",function(g){g=d(g.target||g.srcElement,a.rows).closest("tr.jqgrow")[0].id;g=a.p._index[g];var l=a.p.treeReader.expanded_field;if(!a.p.data[g][a.p.treeReader.leaf_field])if(a.p.data[g][l]){d(a).jqGrid("collapseRow",a.p.data[g]);d(a).jqGrid("collapseNode",a.p.data[g])}else{d(a).jqGrid("expandRow",a.p.data[g]);d(a).jqGrid("expandNode",
384
- a.p.data[g])}return false});a.p.ExpandColClick===true&&d("span",c).css("cursor","pointer").bind("click",function(g){g=d(g.target||g.srcElement,a.rows).closest("tr.jqgrow")[0].id;var l=a.p._index[g],m=a.p.treeReader.expanded_field;if(!a.p.data[l][a.p.treeReader.leaf_field])if(a.p.data[l][m]){d(a).jqGrid("collapseRow",a.p.data[l]);d(a).jqGrid("collapseNode",a.p.data[l])}else{d(a).jqGrid("expandRow",a.p.data[l]);d(a).jqGrid("expandNode",a.p.data[l])}d(a).jqGrid("setSelection",g);return false})}})},setTreeGrid:function(){return this.each(function(){var b=
385
- this,c=0;if(b.p.treeGrid){b.p.treedatatype||d.extend(b.p,{treedatatype:b.p.datatype});b.p.subGrid=false;b.p.altRows=false;b.p.pgbuttons=false;b.p.pginput=false;b.p.multiselect=false;b.p.rowList=[];b.p.treeIcons=d.extend({plus:"ui-icon-triangle-1-"+(b.p.direction=="rtl"?"w":"e"),minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off"},b.p.treeIcons||{});if(b.p.treeGridModel=="nested")b.p.treeReader=d.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded"},
386
- b.p.treeReader);else if(b.p.treeGridModel=="adjacency")b.p.treeReader=d.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded"},b.p.treeReader);for(var a in b.p.colModel)if(b.p.colModel.hasOwnProperty(a)){if(b.p.colModel[a].name==b.p.ExpandColumn){b.p.expColInd=c;break}c++}if(!b.p.expColInd)b.p.expColInd=0;d.each(b.p.treeReader,function(f,e){if(e){b.p.colNames.push(e);b.p.colModel.push({name:e,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,
387
- editable:true,search:false})}})}})},expandRow:function(b){this.each(function(){var c=this;if(c.grid&&c.p.treeGrid){var a=d(c).jqGrid("getNodeChildren",b),f=c.p.treeReader.expanded_field;d(a).each(function(){var e=d.jgrid.getAccessor(this,c.p.localReader.id);d("#"+e,c.grid.bDiv).css("display","");this[f]&&d(c).jqGrid("expandRow",this)})}})},collapseRow:function(b){this.each(function(){var c=this;if(c.grid&&c.p.treeGrid){var a=d(c).jqGrid("getNodeChildren",b),f=c.p.treeReader.expanded_field;d(a).each(function(){var e=
388
- d.jgrid.getAccessor(this,c.p.localReader.id);d("#"+e,c.grid.bDiv).css("display","none");this[f]&&d(c).jqGrid("collapseRow",this)})}})},getRootNodes:function(){var b=[];this.each(function(){var c=this;if(c.grid&&c.p.treeGrid)switch(c.p.treeGridModel){case "nested":var a=c.p.treeReader.level_field;d(c.p.data).each(function(){parseInt(this[a],10)===parseInt(c.p.tree_root_level,10)&&b.push(this)});break;case "adjacency":var f=c.p.treeReader.parent_id_field;d(c.p.data).each(function(){if(this[f]===null||
389
- String(this[f]).toLowerCase()=="null")b.push(this)});break}});return b},getNodeDepth:function(b){var c=null;this.each(function(){if(this.grid&&this.p.treeGrid){var a=this;switch(a.p.treeGridModel){case "nested":c=parseInt(b[a.p.treeReader.level_field],10)-parseInt(a.p.tree_root_level,10);break;case "adjacency":c=d(a).jqGrid("getNodeAncestors",b).length;break}}});return c},getNodeParent:function(b){var c=null;this.each(function(){var a=this;if(a.grid&&a.p.treeGrid)switch(a.p.treeGridModel){case "nested":var f=
390
- a.p.treeReader.left_field,e=a.p.treeReader.right_field,k=a.p.treeReader.level_field,j=parseInt(b[f],10),i=parseInt(b[e],10),h=parseInt(b[k],10);d(this.p.data).each(function(){if(parseInt(this[k],10)===h-1&&parseInt(this[f],10)<j&&parseInt(this[e],10)>i){c=this;return false}});break;case "adjacency":var g=a.p.treeReader.parent_id_field;d(this.p.data).each(function(){if(this.id==b[g]){c=this;return false}});break}});return c},getNodeChildren:function(b){var c=[];this.each(function(){var a=this;if(a.grid&&
391
- a.p.treeGrid)switch(a.p.treeGridModel){case "nested":var f=a.p.treeReader.left_field,e=a.p.treeReader.right_field,k=a.p.treeReader.level_field,j=parseInt(b[f],10),i=parseInt(b[e],10),h=parseInt(b[k],10);d(this.p.data).each(function(){parseInt(this[k],10)===h+1&&parseInt(this[f],10)>j&&parseInt(this[e],10)<i&&c.push(this)});break;case "adjacency":var g=a.p.treeReader.parent_id_field;d(this.p.data).each(function(){this[g]==b.id&&c.push(this)});break}});return c},getFullTreeNode:function(b){var c=[];
392
- this.each(function(){var a=this,f;if(a.grid&&a.p.treeGrid)switch(a.p.treeGridModel){case "nested":var e=a.p.treeReader.left_field,k=a.p.treeReader.right_field,j=a.p.treeReader.level_field,i=parseInt(b[e],10),h=parseInt(b[k],10),g=parseInt(b[j],10);d(this.p.data).each(function(){parseInt(this[j],10)>=g&&parseInt(this[e],10)>=i&&parseInt(this[e],10)<=h&&c.push(this)});break;case "adjacency":c.push(b);var l=a.p.treeReader.parent_id_field;d(this.p.data).each(function(m){f=c.length;for(m=0;m<f;m++)if(c[m].id==
393
- this[l]){c.push(this);break}});break}});return c},getNodeAncestors:function(b){var c=[];this.each(function(){if(this.grid&&this.p.treeGrid)for(var a=d(this).jqGrid("getNodeParent",b);a;){c.push(a);a=d(this).jqGrid("getNodeParent",a)}});return c},isVisibleNode:function(b){var c=true;this.each(function(){var a=this;if(a.grid&&a.p.treeGrid){var f=d(a).jqGrid("getNodeAncestors",b),e=a.p.treeReader.expanded_field;d(f).each(function(){c=c&&this[e];if(!c)return false})}});return c},isNodeLoaded:function(b){var c;
394
- this.each(function(){var a=this;if(a.grid&&a.p.treeGrid){var f=a.p.treeReader.leaf_field;c=b.loaded!==undefined?b.loaded:b[f]||d(a).jqGrid("getNodeChildren",b).length>0?true:false}});return c},expandNode:function(b){return this.each(function(){if(this.grid&&this.p.treeGrid){var c=this.p.treeReader.expanded_field;if(!b[c]){var a=d.jgrid.getAccessor(b,this.p.localReader.id),f=d("#"+a,this.grid.bDiv)[0],e=this.p._index[a];if(d(this).jqGrid("isNodeLoaded",this.p.data[e])){b[c]=true;d("div.treeclick",
395
- f).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{b[c]=true;d("div.treeclick",f).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=f.rowIndex;this.p.datatype=this.p.treedatatype;this.p.treeGridModel=="nested"?d(this).jqGrid("setGridParam",{postData:{nodeid:a,n_left:b.lft,n_right:b.rgt,n_level:b.level}}):d(this).jqGrid("setGridParam",{postData:{nodeid:a,parentid:b.parent_id,n_level:b.level}});
396
- d(this).trigger("reloadGrid");this.p.treeGridModel=="nested"?d(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}}):d(this).jqGrid("setGridParam",{postData:{nodeid:"",parentid:"",n_level:""}})}}}})},collapseNode:function(b){return this.each(function(){if(this.grid&&this.p.treeGrid)if(b.expanded){b.expanded=false;var c=d.jgrid.getAccessor(b,this.p.localReader.id);c=d("#"+c,this.grid.bDiv)[0];d("div.treeclick",c).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+
397
- " tree-plus")}})},SortTree:function(b,c,a,f){return this.each(function(){if(this.grid&&this.p.treeGrid){var e,k,j,i=[],h=this,g;e=d(this).jqGrid("getRootNodes");e=d.jgrid.from(e);e.orderBy(b,c,a,f);g=e.select();e=0;for(k=g.length;e<k;e++){j=g[e];i.push(j);d(this).jqGrid("collectChildrenSortTree",i,j,b,c,a,f)}d.each(i,function(l){var m=d.jgrid.getAccessor(this,h.p.localReader.id);if(l===0){l=d("#"+m,h.grid.bDiv);d("td",l).each(function(n){d(this).css("width",h.grid.headers[n].width+"px")});h.grid.cols=
398
- l[0].cells}d("tbody",h.grid.bDiv).append(d("#"+m,h.grid.bDiv))});i=g=e=null}})},collectChildrenSortTree:function(b,c,a,f,e,k){return this.each(function(){if(this.grid&&this.p.treeGrid){var j,i,h,g;j=d(this).jqGrid("getNodeChildren",c);j=d.jgrid.from(j);j.orderBy(a,f,f,e,k);g=j.select();j=0;for(i=g.length;j<i;j++){h=g[j];b.push(h);d(this).jqGrid("collectChildrenSortTree",b,h,a,f,e,k)}}})},setTreeRow:function(b,c){var a=false;this.each(function(){var f=this;if(f.grid&&f.p.treeGrid)a=d(f).jqGrid("setRowData",
399
- b,c)});return a},delTreeNode:function(b){return this.each(function(){var c=this;if(c.grid&&c.p.treeGrid){var a=d(c).jqGrid("getInd",b,true);if(a){var f=d(c).jqGrid("getNodeChildren",a);if(f.length>0)for(var e=0;e<f.length;e++)d(c).jqGrid("delRowData",f[e].id);d(c).jqGrid("delRowData",a.id)}}})}})})(jQuery);
400
- (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(e,g){var f=b(g.xmlGrid.config,e)[0];g=b(g.xmlGrid.data,e)[0];var k;if(xmlJsonClass.xml2json&&b.jgrid.parse){f=xmlJsonClass.xml2json(f," ");f=b.jgrid.parse(f);for(var h in f)if(f.hasOwnProperty(h))k=f[h];if(g){h=f.grid.datatype;
401
- f.grid.datatype="xmlstring";f.grid.datastr=e;b(d).jqGrid(k).jqGrid("setGridParam",{datatype:h})}else b(d).jqGrid(k)}else alert("xml2json or parse are not present")},i=function(e,g){if(e&&typeof e=="string"){var f=b.jgrid.parse(e);e=f[g.jsonGrid.config];if(g=f[g.jsonGrid.data]){f=e.datatype;e.datatype="jsonstring";e.datastr=g;b(d).jqGrid(e).jqGrid("setGridParam",{datatype:f})}else b(d).jqGrid(e)}};switch(a.imptype){case "xml":b.ajax(b.extend({url:a.impurl,type:a.mtype,data:a.impData,dataType:"xml",
402
- complete:function(e,g){if(g=="success"){c(e.responseXML,a);b.isFunction(a.importComplete)&&a.importComplete(e)}}},a.ajaxOptions));break;case "xmlstring":if(a.impstring&&typeof a.impstring=="string"){var j=b.jgrid.stringToDoc(a.impstring);if(j){c(j,a);b.isFunction(a.importComplete)&&a.importComplete(j);a.impstring=null}j=null}break;case "json":b.ajax(b.extend({url:a.impurl,type:a.mtype,data:a.impData,dataType:"json",complete:function(e,g){if(g=="success"){i(e.responseText,a);b.isFunction(a.importComplete)&&
403
- a.importComplete(e)}}},a.ajaxOptions));break;case "jsonstring":if(a.impstring&&typeof a.impstring=="string"){i(a.impstring,a);b.isFunction(a.importComplete)&&a.importComplete(a.impstring);a.impstring=null}break}})},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);
404
- 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 i in c.treeReader)if(c.treeReader.hasOwnProperty(i)){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)+"</"+a.root+">";break;case "jsonstring":d="{"+xmlJsonClass.toJson(c,a.root,a.ident)+"}";if(c.postData.filters!==undefined){d=d.replace(/filters":"/,'filters":');d=d.replace(/}]}"/,
370
+ (function(b){b.fn.jqDrag=function(a){return l(this,a,"d")};b.fn.jqResize=function(a,e){return l(this,a,"r",e)};b.jqDnR={dnr:{},e:0,drag:function(a){if(c.k=="d")d.css({left:c.X+a.pageX-c.pX,top:c.Y+a.pageY-c.pY});else{d.css({width:Math.max(a.pageX-c.pX+c.W,0),height:Math.max(a.pageY-c.pY+c.H,0)});M1&&f.css({width:Math.max(a.pageX-M1.pX+M1.W,0),height:Math.max(a.pageY-M1.pY+M1.H,0)})}return false},stop:function(){b(document).unbind("mousemove",i.drag).unbind("mouseup",i.stop)}};var i=b.jqDnR,c=i.dnr,
371
+ d=i.e,f,l=function(a,e,n,m){return a.each(function(){e=e?b(e,a):a;e.bind("mousedown",{e:a,k:n},function(g){var j=g.data,h={};d=j.e;f=m?b(m):false;if(d.css("position")!="relative")try{d.position(h)}catch(o){}c={X:h.left||k("left")||0,Y:h.top||k("top")||0,W:k("width")||d[0].scrollWidth||0,H:k("height")||d[0].scrollHeight||0,pX:g.pageX,pY:g.pageY,k:j.k};M1=f&&j.k!="d"?{X:h.left||f1("left")||0,Y:h.top||f1("top")||0,W:f[0].offsetWidth||f1("width")||0,H:f[0].offsetHeight||f1("height")||0,pX:g.pageX,pY:g.pageY,
372
+ k:j.k}:false;try{b("input.hasDatepicker",d[0]).datepicker("hide")}catch(p){}b(document).mousemove(b.jqDnR.drag).mouseup(b.jqDnR.stop);return false})})},k=function(a){return parseInt(d.css(a))||false};f1=function(a){return parseInt(f.css(a))||false}})(jQuery);
373
+ (function(b){b.jgrid.extend({setSubGrid:function(){return this.each(function(){var e=this;e.p.colNames.unshift("");e.p.colModel.unshift({name:"subgrid",width:b.browser.safari?e.p.subGridWidth+e.p.cellLayout:e.p.subGridWidth,sortable:false,resizable:false,hidedlg:true,search:false,fixed:true});e=e.p.subGridModel;if(e[0]){e[0].align=b.extend([],e[0].align||[]);for(var c=0;c<e[0].name.length;c++)e[0].align[c]=e[0].align[c]||"left"}})},addSubGridCell:function(e,c){var a="",n,o;this.each(function(){a=
374
+ this.formatCol(e,c);n=this.p.gridview;o=this.p.id});return n===false?'<td role="grid" aria-describedby="'+o+'_subgrid" class="ui-sgcollapsed sgcollapsed" '+a+"><a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a></td>":'<td role="grid" aria-describedby="'+o+'_subgrid" '+a+"></td>"},addSubGrid:function(e,c){return this.each(function(){var a=this;if(a.grid){var n=function(g,j,f){j=b("<td align='"+a.p.subGridModel[0].align[f]+"'></td>").html(j);b(g).append(j)},o=function(g,j){var f,
375
+ d,h,i=b("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),k=b("<tr></tr>");for(d=0;d<a.p.subGridModel[0].name.length;d++){f=b("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+a.p.direction+"'></th>");b(f).html(a.p.subGridModel[0].name[d]);b(f).width(a.p.subGridModel[0].width[d]);b(k).append(f)}b(i).append(k);if(g){h=a.p.xmlReader.subgrid;b(h.root+" "+h.row,g).each(function(){k=b("<tr class='ui-widget-content ui-subtblcell'></tr>");if(h.repeatitems===true)b(h.cell,
376
+ this).each(function(q){n(k,b(this).text()||"&#160;",q)});else{var l=a.p.subGridModel[0].mapping||a.p.subGridModel[0].name;if(l)for(d=0;d<l.length;d++)n(k,b(l[d],this).text()||"&#160;",d)}b(i).append(k)})}g=b("table:first",a.grid.bDiv).attr("id")+"_";b("#"+g+j).append(i);a.grid.hDiv.loading=false;b("#load_"+a.p.id).hide();return false},u=function(g,j){var f,d,h,i,k=b("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),l=b("<tr></tr>");for(d=0;d<a.p.subGridModel[0].name.length;d++){f=
377
+ b("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+a.p.direction+"'></th>");b(f).html(a.p.subGridModel[0].name[d]);b(f).width(a.p.subGridModel[0].width[d]);b(l).append(f)}b(k).append(l);if(g){f=a.p.jsonReader.subgrid;g=g[f.root];if(typeof g!=="undefined")for(d=0;d<g.length;d++){h=g[d];l=b("<tr class='ui-widget-content ui-subtblcell'></tr>");if(f.repeatitems===true){if(f.cell)h=h[f.cell];for(i=0;i<h.length;i++)n(l,h[i]||"&#160;",i)}else{var q=a.p.subGridModel[0].mapping||a.p.subGridModel[0].name;
378
+ if(q.length)for(i=0;i<q.length;i++)n(l,h[q[i]]||"&#160;",i)}b(k).append(l)}}d=b("table:first",a.grid.bDiv).attr("id")+"_";b("#"+d+j).append(k);a.grid.hDiv.loading=false;b("#load_"+a.p.id).hide();return false},x=function(g){var j,f,d,h;j=b(g).attr("id");f={nd_:(new Date).getTime()};f[a.p.prmNames.subgridid]=j;if(!a.p.subGridModel[0])return false;if(a.p.subGridModel[0].params)for(h=0;h<a.p.subGridModel[0].params.length;h++)for(d=0;d<a.p.colModel.length;d++)if(a.p.colModel[d].name==a.p.subGridModel[0].params[h])f[a.p.colModel[d].name]=
379
+ b("td:eq("+d+")",g).text().replace(/\&#160\;/ig,"");if(!a.grid.hDiv.loading){a.grid.hDiv.loading=true;b("#load_"+a.p.id).show();if(!a.p.subgridtype)a.p.subgridtype=a.p.datatype;if(b.isFunction(a.p.subgridtype))a.p.subgridtype.call(a,f);else a.p.subgridtype=a.p.subgridtype.toLowerCase();switch(a.p.subgridtype){case "xml":case "json":b.ajax(b.extend({type:a.p.mtype,url:a.p.subGridUrl,dataType:a.p.subgridtype,data:b.isFunction(a.p.serializeSubGridData)?a.p.serializeSubGridData.call(a,f):f,complete:function(i){a.p.subgridtype==
380
+ "xml"?o(i.responseXML,j):u(b.jgrid.parse(i.responseText),j)}},b.jgrid.ajaxOptions,a.p.ajaxSubgridOptions||{}));break}}return false},r,m,s,v,t,w,p;b("td:eq("+c+")",e).click(function(){if(b(this).hasClass("sgcollapsed")){s=a.p.id;r=b(this).parent();v=c>=1?"<td colspan='"+c+"'>&#160;</td>":"";m=b(r).attr("id");p=true;if(b.isFunction(a.p.subGridBeforeExpand))p=a.p.subGridBeforeExpand.call(a,s+"_"+m,m);if(p===false)return false;t=0;b.each(a.p.colModel,function(){if(this.hidden===true||this.name=="rn"||
381
+ this.name=="cb")t++});w="<tr role='row' class='ui-subgrid'>"+v+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon ui-icon-carat-1-sw'/></td><td colspan='"+parseInt(a.p.colNames.length-1-t,10)+"' class='ui-widget-content subgrid-data'><div id="+s+"_"+m+" class='tablediv'>";b(this).parent().after(w+"</div></td></tr>");b.isFunction(a.p.subGridRowExpanded)?a.p.subGridRowExpanded.call(a,s+"_"+m,m):x(r);b(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-minus'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded")}else if(b(this).hasClass("sgexpanded")){p=
382
+ true;if(b.isFunction(a.p.subGridRowColapsed)){r=b(this).parent();m=b(r).attr("id");p=a.p.subGridRowColapsed.call(a,s+"_"+m,m)}if(p===false)return false;b(this).parent().next().remove(".ui-subgrid");b(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}return false});a.subGridXml=function(g,j){o(g,j)};a.subGridJson=function(g,j){u(g,j)}}})},expandSubGridRow:function(e){return this.each(function(){var c=this;if(c.grid||
383
+ e)if(c.p.subGrid===true)if(c=b(this).jqGrid("getInd",e,true))(c=b("td.sgcollapsed",c)[0])&&b(c).trigger("click")})},collapseSubGridRow:function(e){return this.each(function(){var c=this;if(c.grid||e)if(c.p.subGrid===true)if(c=b(this).jqGrid("getInd",e,true))(c=b("td.sgexpanded",c)[0])&&b(c).trigger("click")})},toggleSubGridRow:function(e){return this.each(function(){var c=this;if(c.grid||e)if(c.p.subGrid===true)if(c=b(this).jqGrid("getInd",e,true)){var a=b("td.sgcollapsed",c)[0];if(a)b(a).trigger("click");
384
+ else(a=b("td.sgexpanded",c)[0])&&b(a).trigger("click")}})}})})(jQuery);
385
+ (function(f){f.jgrid.extend({groupingSetup:function(){return this.each(function(){var c=this,b=c.p.groupingView;if(b!==null&&(typeof b==="object"||f.isFunction(b)))if(b.groupField.length){for(var a=0;a<b.groupField.length;a++){b.groupOrder[a]||(b.groupOrder[a]="asc");b.groupText[a]||(b.groupText[a]="{0}");if(typeof b.groupColumnShow[a]!="boolean")b.groupColumnShow[a]=true;if(typeof b.groupSummary[a]!="boolean")b.groupSummary[a]=false;b.groupColumnShow[a]===true?f(c).jqGrid("showCol",b.groupField[a]):
386
+ f(c).jqGrid("hideCol",b.groupField[a]);b.sortitems[a]=[];b.sortnames[a]=[];b.summaryval[a]=[];if(b.groupSummary[a]){b.summary[a]=[];for(var d=c.p.colModel,e=0,g=d.length;e<g;e++)d[e].summaryType&&b.summary[a].push({nm:d[e].name,st:d[e].summaryType,v:""})}}c.p.scroll=false;c.p.rownumbers=false;c.p.subGrid=false;c.p.treeGrid=false;c.p.gridview=true}else c.p.grouping=false;else c.p.grouping=false})},groupingPrepare:function(c,b,a,d){this.each(function(){b[0]+="";var e=b[0].toString().split(" ").join(""),
387
+ g=this.p.groupingView,j=this;if(a.hasOwnProperty(e))a[e].push(c);else{a[e]=[];a[e].push(c);g.sortitems[0].push(e);g.sortnames[0].push(f.trim(b[0].toString()));g.summaryval[0][e]=f.extend(true,[],g.summary[0])}g.groupSummary[0]&&f.each(g.summaryval[0][e],function(){this.v=f.isFunction(this.st)?this.st.call(j,this.v,this.nm,d):f(j).jqGrid("groupingCalculations."+this.st,this.v,this.nm,d)})});return a},groupingToggle:function(c){this.each(function(){var b=this.p.groupingView,a=c.lastIndexOf("_"),d=c.substring(0,
388
+ a+1);a=parseInt(c.substring(a+1),10)+1;var e=b.minusicon,g=b.plusicon;if(f("#"+c+" span").hasClass(e)){b.showSummaryOnHide&&b.groupSummary[0]?f("#"+c).nextUntil(".jqfoot").hide():f("#"+c).nextUntil("#"+d+String(a)).hide();f("#"+c+" span").removeClass(e).addClass(g)}else{f("#"+c).nextUntil("#"+d+String(a)).show();f("#"+c+" span").removeClass(g).addClass(e)}});return false},groupingRender:function(c,b){return this.each(function(){var a=this,d=a.p.groupingView,e="",g="",j,m="",n,q,k;if(!d.groupDataSorted){d.sortitems[0].sort();
389
+ d.sortnames[0].sort();if(d.groupOrder[0].toLowerCase()=="desc"){d.sortitems[0].reverse();d.sortnames[0].reverse()}}m=d.groupCollapse?d.plusicon:d.minusicon;m+=" tree-wrap-"+a.p.direction;for(k=0;k<b;){if(a.p.colModel[k].name==d.groupField[0]){q=k;break}k++}f.each(d.sortitems[0],function(h,l){j=a.p.id+"ghead_"+h;g="<span style='cursor:pointer;' class='ui-icon "+m+"' onclick=\"jQuery('#"+a.p.id+"').jqGrid('groupingToggle','"+j+"');return false;\"></span>";try{n=a.formatter(j,d.sortnames[0][h],q,d.sortitems[0])}catch(u){n=
390
+ d.sortnames[0][h]}e+='<tr id="'+j+'" role="row" class= "ui-widget-content jqgroup ui-row-'+a.p.direction+'"><td colspan="'+b+'">'+g+f.jgrid.format(d.groupText[0],n,c[l].length)+"</td></tr>";for(h=0;h<c[l].length;h++)e+=c[l][h].join("");if(d.groupSummary[0]){h="";if(d.groupCollapse&&!d.showSummaryOnHide)h=' style="display:none;"';e+="<tr"+h+' role="row" class="ui-widget-content jqfoot ui-row-'+a.p.direction+'">';h=d.summaryval[0][l];for(var o=a.p.colModel,p,r=c[l].length,i=0;i<b;i++){var s="<td "+
391
+ a.formatCol(i,1,"")+">&#160;</td>",t="{0}";f.each(h,function(){if(this.nm==o[i].name){if(o[i].summaryTpl)t=o[i].summaryTpl;if(this.st=="avg")if(this.v&&r>0)this.v/=r;try{p=a.formatter("",this.v,i,this)}catch(v){p=this.v}s="<td "+a.formatCol(i,1,"")+">"+f.jgrid.format(t,p)+"</td>";return false}});e+=s}e+="</tr>"}});f("#"+a.p.id+" tbody:first").append(e);e=null})},groupingGroupBy:function(c,b){return this.each(function(){var a=this;if(typeof c=="string")c=[c];var d=a.p.groupingView;a.p.grouping=true;
392
+ for(var e=0;e<d.groupField.length;e++)d.groupColumnShow[e]||f(a).jqGrid("showCol",d.groupField[e]);a.p.groupingView=f.extend(a.p.groupingView,b||{});d.groupField=c;f(a).trigger("reloadGrid")})},groupingRemove:function(c){return this.each(function(){var b=this;if(typeof c=="undefined")c=true;b.p.grouping=false;if(c===true){f("tr.jqgroup, tr.jqfoot","#"+b.p.id+" tbody:first").remove();f("tr.jqgrow:hidden","#"+b.p.id+" tbody:first").show()}else f(b).trigger("reloadGrid")})},groupingCalculations:{sum:function(c,
393
+ b,a){return parseFloat(c||0)+parseFloat(a[b]||0)},min:function(c,b,a){if(c==="")return parseFloat(a[b]||0);return Math.min(parseFloat(c),parseFloat(a[b]||0))},max:function(c,b,a){if(c==="")return parseFloat(a[b]||0);return Math.max(parseFloat(c),parseFloat(a[b]||0))},count:function(c,b,a){if(c==="")c=0;return a.hasOwnProperty(b)?c+1:0},avg:function(c,b,a){return parseFloat(c||0)+parseFloat(a[b]||0)}}})})(jQuery);
394
+ (function(d){d.jgrid.extend({setTreeNode:function(b,c){return this.each(function(){var a=this;if(a.grid&&a.p.treeGrid){var f=a.p.expColInd,e=a.p.treeReader.expanded_field,k=a.p.treeReader.leaf_field,i=a.p.treeReader.level_field,l=a.p.treeReader.loaded;c.level=b[i];if(a.p.treeGridModel=="nested"){var g=b[a.p.treeReader.left_field],j=b[a.p.treeReader.right_field];b[k]||(b[k]=parseInt(j,10)===parseInt(g,10)+1?"true":"false")}j=parseInt(b[i],10);if(a.p.tree_root_level===0){g=j+1;j=j}else{g=j;j=j-1}g=
395
+ "<div class='tree-wrap tree-wrap-"+a.p.direction+"' style='width:"+g*18+"px;'>";g+="<div style='"+(a.p.direction=="rtl"?"right:":"left:")+j*18+"px;' class='ui-icon ";if(b[l]!=undefined)b[l]=b[l]=="true"||b[l]===true?true:false;if(b[k]=="true"||b[k]===true){g+=a.p.treeIcons.leaf+" tree-leaf'";b[k]=true;b[e]=false}else{if(b[e]=="true"||b[e]===true){g+=a.p.treeIcons.minus+" tree-minus treeclick'";b[e]=true}else{g+=a.p.treeIcons.plus+" tree-plus treeclick'";b[e]=false}b[k]=false}g+="</div></div>";if(!a.p.loadonce){b[a.p.localReader.id]=
396
+ c.id;a.p.data.push(b);a.p._index[c.id]=a.p.data.length-1}if(parseInt(b[i],10)!==parseInt(a.p.tree_root_level,10))d(a).jqGrid("isVisibleNode",b)||d(c).css("display","none");d("td:eq("+f+")",c).wrapInner("<span></span>").prepend(g);d(".treeclick",c).bind("click",function(h){h=d(h.target||h.srcElement,a.rows).closest("tr.jqgrow")[0].id;h=a.p._index[h];var m=a.p.treeReader.expanded_field;if(!a.p.data[h][a.p.treeReader.leaf_field])if(a.p.data[h][m]){d(a).jqGrid("collapseRow",a.p.data[h]);d(a).jqGrid("collapseNode",
397
+ a.p.data[h])}else{d(a).jqGrid("expandRow",a.p.data[h]);d(a).jqGrid("expandNode",a.p.data[h])}return false});a.p.ExpandColClick===true&&d("span",c).css("cursor","pointer").bind("click",function(h){h=d(h.target||h.srcElement,a.rows).closest("tr.jqgrow")[0].id;var m=a.p._index[h],n=a.p.treeReader.expanded_field;if(!a.p.data[m][a.p.treeReader.leaf_field])if(a.p.data[m][n]){d(a).jqGrid("collapseRow",a.p.data[m]);d(a).jqGrid("collapseNode",a.p.data[m])}else{d(a).jqGrid("expandRow",a.p.data[m]);d(a).jqGrid("expandNode",
398
+ a.p.data[m])}d(a).jqGrid("setSelection",h);return false})}})},setTreeGrid:function(){return this.each(function(){var b=this,c=0;if(b.p.treeGrid){b.p.treedatatype||d.extend(b.p,{treedatatype:b.p.datatype});b.p.subGrid=false;b.p.altRows=false;b.p.pgbuttons=false;b.p.pginput=false;b.p.multiselect=false;b.p.rowList=[];b.p.treeIcons=d.extend({plus:"ui-icon-triangle-1-"+(b.p.direction=="rtl"?"w":"e"),minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off"},b.p.treeIcons||{});if(b.p.treeGridModel=="nested")b.p.treeReader=
399
+ d.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded"},b.p.treeReader);else if(b.p.treeGridModel=="adjacency")b.p.treeReader=d.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded"},b.p.treeReader);for(var a in b.p.colModel)if(b.p.colModel.hasOwnProperty(a)){if(b.p.colModel[a].name==b.p.ExpandColumn){b.p.expColInd=c;break}c++}if(!b.p.expColInd)b.p.expColInd=0;d.each(b.p.treeReader,
400
+ function(f,e){if(e){b.p.colNames.push(e);b.p.colModel.push({name:e,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})}})},expandRow:function(b){this.each(function(){var c=this;if(c.grid&&c.p.treeGrid){var a=d(c).jqGrid("getNodeChildren",b),f=c.p.treeReader.expanded_field;d(a).each(function(){var e=d.jgrid.getAccessor(this,c.p.localReader.id);d("#"+e,c.grid.bDiv).css("display","");this[f]&&d(c).jqGrid("expandRow",this)})}})},collapseRow:function(b){this.each(function(){var c=
401
+ this;if(c.grid&&c.p.treeGrid){var a=d(c).jqGrid("getNodeChildren",b),f=c.p.treeReader.expanded_field;d(a).each(function(){var e=d.jgrid.getAccessor(this,c.p.localReader.id);d("#"+e,c.grid.bDiv).css("display","none");this[f]&&d(c).jqGrid("collapseRow",this)})}})},getRootNodes:function(){var b=[];this.each(function(){var c=this;if(c.grid&&c.p.treeGrid)switch(c.p.treeGridModel){case "nested":var a=c.p.treeReader.level_field;d(c.p.data).each(function(){parseInt(this[a],10)===parseInt(c.p.tree_root_level,
402
+ 10)&&b.push(this)});break;case "adjacency":var f=c.p.treeReader.parent_id_field;d(c.p.data).each(function(){if(this[f]===null||String(this[f]).toLowerCase()=="null")b.push(this)});break}});return b},getNodeDepth:function(b){var c=null;this.each(function(){if(this.grid&&this.p.treeGrid){var a=this;switch(a.p.treeGridModel){case "nested":c=parseInt(b[a.p.treeReader.level_field],10)-parseInt(a.p.tree_root_level,10);break;case "adjacency":c=d(a).jqGrid("getNodeAncestors",b).length;break}}});return c},
403
+ getNodeParent:function(b){var c=null;this.each(function(){var a=this;if(a.grid&&a.p.treeGrid)switch(a.p.treeGridModel){case "nested":var f=a.p.treeReader.left_field,e=a.p.treeReader.right_field,k=a.p.treeReader.level_field,i=parseInt(b[f],10),l=parseInt(b[e],10),g=parseInt(b[k],10);d(this.p.data).each(function(){if(parseInt(this[k],10)===g-1&&parseInt(this[f],10)<i&&parseInt(this[e],10)>l){c=this;return false}});break;case "adjacency":var j=a.p.treeReader.parent_id_field,h=a.p.localReader.id;d(this.p.data).each(function(){if(this[h]==
404
+ b[j]){c=this;return false}});break}});return c},getNodeChildren:function(b){var c=[];this.each(function(){var a=this;if(a.grid&&a.p.treeGrid)switch(a.p.treeGridModel){case "nested":var f=a.p.treeReader.left_field,e=a.p.treeReader.right_field,k=a.p.treeReader.level_field,i=parseInt(b[f],10),l=parseInt(b[e],10),g=parseInt(b[k],10);d(this.p.data).each(function(){parseInt(this[k],10)===g+1&&parseInt(this[f],10)>i&&parseInt(this[e],10)<l&&c.push(this)});break;case "adjacency":var j=a.p.treeReader.parent_id_field,
405
+ h=a.p.localReader.id;d(this.p.data).each(function(){this[j]==b[h]&&c.push(this)});break}});return c},getFullTreeNode:function(b){var c=[];this.each(function(){var a=this,f;if(a.grid&&a.p.treeGrid)switch(a.p.treeGridModel){case "nested":var e=a.p.treeReader.left_field,k=a.p.treeReader.right_field,i=a.p.treeReader.level_field,l=parseInt(b[e],10),g=parseInt(b[k],10),j=parseInt(b[i],10);d(this.p.data).each(function(){parseInt(this[i],10)>=j&&parseInt(this[e],10)>=l&&parseInt(this[e],10)<=g&&c.push(this)});
406
+ break;case "adjacency":c.push(b);var h=a.p.treeReader.parent_id_field,m=a.p.localReader.id;d(this.p.data).each(function(n){f=c.length;for(n=0;n<f;n++)if(c[n][m]==this[h]){c.push(this);break}});break}});return c},getNodeAncestors:function(b){var c=[];this.each(function(){if(this.grid&&this.p.treeGrid)for(var a=d(this).jqGrid("getNodeParent",b);a;){c.push(a);a=d(this).jqGrid("getNodeParent",a)}});return c},isVisibleNode:function(b){var c=true;this.each(function(){var a=this;if(a.grid&&a.p.treeGrid){var f=
407
+ d(a).jqGrid("getNodeAncestors",b),e=a.p.treeReader.expanded_field;d(f).each(function(){c=c&&this[e];if(!c)return false})}});return c},isNodeLoaded:function(b){var c;this.each(function(){var a=this;if(a.grid&&a.p.treeGrid){var f=a.p.treeReader.leaf_field;c=b.loaded!==undefined?b.loaded:b[f]||d(a).jqGrid("getNodeChildren",b).length>0?true:false}});return c},expandNode:function(b){return this.each(function(){if(this.grid&&this.p.treeGrid){var c=this.p.treeReader.expanded_field;if(!b[c]){var a=d.jgrid.getAccessor(b,
408
+ this.p.localReader.id),f=d("#"+a,this.grid.bDiv)[0],e=this.p._index[a];if(d(this).jqGrid("isNodeLoaded",this.p.data[e])){b[c]=true;d("div.treeclick",f).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{b[c]=true;d("div.treeclick",f).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=f.rowIndex;this.p.datatype=this.p.treedatatype;this.p.treeGridModel=="nested"?d(this).jqGrid("setGridParam",
409
+ {postData:{nodeid:a,n_left:b.lft,n_right:b.rgt,n_level:b.level}}):d(this).jqGrid("setGridParam",{postData:{nodeid:a,parentid:b.parent_id,n_level:b.level}});d(this).trigger("reloadGrid");this.p.treeGridModel=="nested"?d(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}}):d(this).jqGrid("setGridParam",{postData:{nodeid:"",parentid:"",n_level:""}})}}}})},collapseNode:function(b){return this.each(function(){if(this.grid&&this.p.treeGrid)if(b.expanded){b.expanded=false;
410
+ var c=d.jgrid.getAccessor(b,this.p.localReader.id);c=d("#"+c,this.grid.bDiv)[0];d("div.treeclick",c).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(b,c,a,f){return this.each(function(){if(this.grid&&this.p.treeGrid){var e,k,i,l=[],g=this,j;e=d(this).jqGrid("getRootNodes");e=d.jgrid.from(e);e.orderBy(b,c,a,f);j=e.select();e=0;for(k=j.length;e<k;e++){i=j[e];l.push(i);d(this).jqGrid("collectChildrenSortTree",l,i,b,c,a,f)}d.each(l,
411
+ function(h){var m=d.jgrid.getAccessor(this,g.p.localReader.id);d("#"+g.p.id+" tbody tr:eq("+h+")").after(d("tr#"+m,g.grid.bDiv))});l=j=e=null}})},collectChildrenSortTree:function(b,c,a,f,e,k){return this.each(function(){if(this.grid&&this.p.treeGrid){var i,l,g,j;i=d(this).jqGrid("getNodeChildren",c);i=d.jgrid.from(i);i.orderBy(a,f,e,k);j=i.select();i=0;for(l=j.length;i<l;i++){g=j[i];b.push(g);d(this).jqGrid("collectChildrenSortTree",b,g,a,f,e,k)}}})},setTreeRow:function(b,c){var a=false;this.each(function(){var f=
412
+ this;if(f.grid&&f.p.treeGrid)a=d(f).jqGrid("setRowData",b,c)});return a},delTreeNode:function(b){return this.each(function(){var c=this;if(c.grid&&c.p.treeGrid){var a=d(c).jqGrid("getInd",b,true);if(a){var f=d(c).jqGrid("getNodeChildren",a);if(f.length>0)for(var e=0;e<f.length;e++)d(c).jqGrid("delRowData",f[e].id);d(c).jqGrid("delRowData",a.id)}}})}})})(jQuery);
413
+ (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(e,g){var f=b(g.xmlGrid.config,e)[0];g=b(g.xmlGrid.data,e)[0];var k;if(xmlJsonClass.xml2json&&b.jgrid.parse){f=xmlJsonClass.xml2json(f," ");f=b.jgrid.parse(f);for(var h in f)if(f.hasOwnProperty(h))k=f[h];if(g){h=f.grid.datatype;
414
+ f.grid.datatype="xmlstring";f.grid.datastr=e;b(d).jqGrid(k).jqGrid("setGridParam",{datatype:h})}else b(d).jqGrid(k)}else alert("xml2json or parse are not present")},i=function(e,g){if(e&&typeof e=="string"){var f=b.jgrid.parse(e);e=f[g.jsonGrid.config];if(g=f[g.jsonGrid.data]){f=e.datatype;e.datatype="jsonstring";e.datastr=g;b(d).jqGrid(e).jqGrid("setGridParam",{datatype:f})}else b(d).jqGrid(e)}};switch(a.imptype){case "xml":b.ajax(b.extend({url:a.impurl,type:a.mtype,data:a.impData,dataType:"xml",
415
+ complete:function(e,g){if(g=="success"){c(e.responseXML,a);b.isFunction(a.importComplete)&&a.importComplete(e)}}},a.ajaxOptions));break;case "xmlstring":if(a.impstring&&typeof a.impstring=="string"){var j=b.jgrid.stringToDoc(a.impstring);if(j){c(j,a);b.isFunction(a.importComplete)&&a.importComplete(j);a.impstring=null}j=null}break;case "json":b.ajax(b.extend({url:a.impurl,type:a.mtype,data:a.impData,dataType:"json",complete:function(e,g){if(g=="success"){i(e.responseText,a);b.isFunction(a.importComplete)&&
416
+ a.importComplete(e)}}},a.ajaxOptions));break;case "jsonstring":if(a.impstring&&typeof a.impstring=="string"){i(a.impstring,a);b.isFunction(a.importComplete)&&a.importComplete(a.impstring);a.impstring=null}break}})},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);
417
+ 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 i in c.treeReader)if(c.treeReader.hasOwnProperty(i)){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)+"</"+a.root+">";break;case "jsonstring":d="{"+xmlJsonClass.toJson(c,a.root,a.ident)+"}";if(c.postData.filters!==undefined){d=d.replace(/filters":"/,'filters":');d=d.replace(/}]}"/,
405
418
  "}]}")}break}}});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);
406
- var xmlJsonClass={xml2json:function(a,b){if(a.nodeType===9)a=a.documentElement;a=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+b+(b?a.replace(/\t/g,b):a.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,b){var g=function(d,c,j){var i="",k,h;if(d instanceof Array)if(d.length===0)i+=j+"<"+c+">__EMPTY_ARRAY_</"+c+">\n";else{k=0;for(h=d.length;k<h;k+=1){var l=j+g(d[k],c,j+"\t")+"\n";i+=l}}else if(typeof d==="object"){k=false;i+=j+"<"+c;for(h in d)if(d.hasOwnProperty(h))if(h.charAt(0)===
407
- "@")i+=" "+h.substr(1)+'="'+d[h].toString()+'"';else k=true;i+=k?">":"/>";if(k){for(h in d)if(d.hasOwnProperty(h))if(h==="#text")i+=d[h];else if(h==="#cdata")i+="<![CDATA["+d[h]+"]]\>";else if(h.charAt(0)!=="@")i+=g(d[h],h,j+"\t");i+=(i.charAt(i.length-1)==="\n"?j:"")+"</"+c+">"}}else i+=typeof d==="function"?j+"<"+c+"><![CDATA["+d+"]]\></"+c+">":d.toString()==='""'||d.toString().length===0?j+"<"+c+">__EMPTY_STRING_</"+c+">":j+"<"+c+">"+d.toString()+"</"+c+">";return i},e="",f;for(f in a)if(a.hasOwnProperty(f))e+=
408
- 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;e<a.attributes.length;e+=1)b["@"+a.attributes[e].nodeName]=(a.attributes[e].nodeValue||"").toString()}if(a.firstChild){var f=e=0,d=false,c;for(c=a.firstChild;c;c=c.nextSibling)if(c.nodeType===1)d=true;else if(c.nodeType===3&&c.nodeValue.match(/[^ \f\n\r\t\v]/))e+=1;else if(c.nodeType===4)f+=1;if(d)if(e<2&&f<2){this.removeWhite(a);for(c=
409
- a.firstChild;c;c=c.nextSibling)if(c.nodeType===3)b["#text"]=this.escape(c.nodeValue);else if(c.nodeType===4)if(g.test(c.nodeValue))b[c.nodeName]=[b[c.nodeName],c.nodeValue];else b["#cdata"]=this.escape(c.nodeValue);else if(b[c.nodeName])if(b[c.nodeName]instanceof Array)b[c.nodeName][b[c.nodeName].length]=this.toObj(c);else b[c.nodeName]=[b[c.nodeName],this.toObj(c)];else b[c.nodeName]=this.toObj(c)}else if(a.attributes.length)b["#text"]=this.escape(this.innerXml(a));else b=this.escape(this.innerXml(a));
410
- else if(e)if(a.attributes.length)b["#text"]=this.escape(this.innerXml(a));else{b=this.escape(this.innerXml(a));if(b==="__EMPTY_ARRAY_")b="[]";else if(b==="__EMPTY_STRING_")b=""}else if(f)if(f>1)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: "+
411
- a.nodeType);return b},toJson:function(a,b,g){var e=b?'"'+b+'"':"";if(a==="[]")e+=b?":[]":"[]";else if(a instanceof Array){var f,d,c=[];d=0;for(f=a.length;d<f;d+=1)c[d]=this.toJson(a[d],"",g+"\t");e+=(b?":[":"[")+(c.length>1?"\n"+g+"\t"+c.join(",\n"+g+"\t")+"\n"+g:c.join(""))+"]"}else if(a===null)e+=(b&&":")+"null";else if(typeof a==="object"){f=[];for(d in a)if(a.hasOwnProperty(d))f[f.length]=this.toJson(a[d],d,g+"\t");e+=(b?":{":"{")+(f.length>1?"\n"+g+"\t"+f.join(",\n"+g+"\t")+"\n"+g:f.join(""))+
412
- "}"}else if(typeof a==="string"){g=/function/i;f=a.toString();e+=/(^-?\d+\.?\d*$)/.test(f)||g.test(f)||f==="false"||f==="true"?(b&&":")+f:(b&&":")+'"'+a+'"'}else e+=(b&&":")+a.toString();return e},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<e.attributes.length;d+=1)f+=" "+e.attributes[d].nodeName+'="'+(e.attributes[d].nodeValue||"").toString()+'"';if(e.firstChild){f+=">";for(d=e.firstChild;d;d=d.nextSibling)f+=
413
- g(d);f+="</"+e.nodeName+">"}else f+="/>"}else if(e.nodeType===3)f+=e.nodeValue;else if(e.nodeType===4)f+="<![CDATA["+e.nodeValue+"]]\>";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);
419
+ var xmlJsonClass={xml2json:function(a,b){if(a.nodeType===9)a=a.documentElement;a=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+b+(b?a.replace(/\t/g,b):a.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,b){var g=function(d,c,j){var i="",k,h;if(d instanceof Array)if(d.length===0)i+=j+"<"+c+">__EMPTY_ARRAY_</"+c+">\n";else{k=0;for(h=d.length;k<h;k+=1){var l=j+g(d[k],c,j+"\t")+"\n";i+=l}}else if(typeof d==="object"){k=false;i+=j+"<"+c;for(h in d)if(d.hasOwnProperty(h))if(h.charAt(0)===
420
+ "@")i+=" "+h.substr(1)+'="'+d[h].toString()+'"';else k=true;i+=k?">":"/>";if(k){for(h in d)if(d.hasOwnProperty(h))if(h==="#text")i+=d[h];else if(h==="#cdata")i+="<![CDATA["+d[h]+"]]\>";else if(h.charAt(0)!=="@")i+=g(d[h],h,j+"\t");i+=(i.charAt(i.length-1)==="\n"?j:"")+"</"+c+">"}}else i+=typeof d==="function"?j+"<"+c+"><![CDATA["+d+"]]\></"+c+">":d.toString()==='""'||d.toString().length===0?j+"<"+c+">__EMPTY_STRING_</"+c+">":j+"<"+c+">"+d.toString()+"</"+c+">";return i},e="",f;for(f in a)if(a.hasOwnProperty(f))e+=
421
+ 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;e<a.attributes.length;e+=1)b["@"+a.attributes[e].nodeName]=(a.attributes[e].nodeValue||"").toString()}if(a.firstChild){var f=e=0,d=false,c;for(c=a.firstChild;c;c=c.nextSibling)if(c.nodeType===1)d=true;else if(c.nodeType===3&&c.nodeValue.match(/[^ \f\n\r\t\v]/))e+=1;else if(c.nodeType===4)f+=1;if(d)if(e<2&&f<2){this.removeWhite(a);for(c=
422
+ a.firstChild;c;c=c.nextSibling)if(c.nodeType===3)b["#text"]=this.escape(c.nodeValue);else if(c.nodeType===4)if(g.test(c.nodeValue))b[c.nodeName]=[b[c.nodeName],c.nodeValue];else b["#cdata"]=this.escape(c.nodeValue);else if(b[c.nodeName])if(b[c.nodeName]instanceof Array)b[c.nodeName][b[c.nodeName].length]=this.toObj(c);else b[c.nodeName]=[b[c.nodeName],this.toObj(c)];else b[c.nodeName]=this.toObj(c)}else if(a.attributes.length)b["#text"]=this.escape(this.innerXml(a));else b=this.escape(this.innerXml(a));
423
+ else if(e)if(a.attributes.length)b["#text"]=this.escape(this.innerXml(a));else{b=this.escape(this.innerXml(a));if(b==="__EMPTY_ARRAY_")b="[]";else if(b==="__EMPTY_STRING_")b=""}else if(f)if(f>1)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: "+
424
+ a.nodeType);return b},toJson:function(a,b,g){var e=b?'"'+b+'"':"";if(a==="[]")e+=b?":[]":"[]";else if(a instanceof Array){var f,d,c=[];d=0;for(f=a.length;d<f;d+=1)c[d]=this.toJson(a[d],"",g+"\t");e+=(b?":[":"[")+(c.length>1?"\n"+g+"\t"+c.join(",\n"+g+"\t")+"\n"+g:c.join(""))+"]"}else if(a===null)e+=(b&&":")+"null";else if(typeof a==="object"){f=[];for(d in a)if(a.hasOwnProperty(d))f[f.length]=this.toJson(a[d],d,g+"\t");e+=(b?":{":"{")+(f.length>1?"\n"+g+"\t"+f.join(",\n"+g+"\t")+"\n"+g:f.join(""))+
425
+ "}"}else if(typeof a==="string"){g=/function/i;f=a.toString();e+=/(^-?\d+\.?\d*$)/.test(f)||g.test(f)||f==="false"||f==="true"?(b&&":")+f:(b&&":")+'"'+a+'"'}else e+=(b&&":")+a.toString();return e},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<e.attributes.length;d+=1)f+=" "+e.attributes[d].nodeName+'="'+(e.attributes[d].nodeValue||"").toString()+'"';if(e.firstChild){f+=">";for(d=e.firstChild;d;d=d.nextSibling)f+=
426
+ g(d);f+="</"+e.nodeName+">"}else f+="/>"}else if(e.nodeType===3)f+=e.nodeValue;else if(e.nodeType===4)f+="<![CDATA["+e.nodeValue+"]]\>";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);
414
427
  b=g}else{b.nodeType===1&&this.removeWhite(b);b=b.nextSibling}return a}};
415
- (function(b){b.jgrid.extend({setColumns:function(a){a=b.extend({top:0,left:0,width:200,height:"auto",dataheight:"auto",modal:false,drag:true,beforeShowForm:null,afterShowForm:null,afterSubmitForm:null,closeOnEscape:true,ShrinkToFit:false,jqModal:false,saveicon:[true,"left","ui-icon-disk"],closeicon:[true,"left","ui-icon-close"],onClose:null,colnameview:true,closeAfterSubmit:true,updateAfterCheck:false,recreateForm:false},b.jgrid.col,a||{});return this.each(function(){var c=this;if(c.grid){var j=typeof a.beforeShowForm===
416
- "function"?true:false,k=typeof a.afterShowForm==="function"?true:false,l=typeof a.afterSubmitForm==="function"?true:false,e=c.p.id,d="ColTbl_"+e,f={themodal:"colmod"+e,modalhead:"colhd"+e,modalcontent:"colcnt"+e,scrollelm:d};a.recreateForm===true&&b("#"+f.themodal).html()!=null&&b("#"+f.themodal).remove();if(b("#"+f.themodal).html()!=null){j&&a.beforeShowForm(b("#"+d));viewModal("#"+f.themodal,{gbox:"#gbox_"+e,jqm:a.jqModal,jqM:false,modal:a.modal})}else{var g=isNaN(a.dataheight)?a.dataheight:a.dataheight+
417
- "px";g="<div id='"+d+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+g+";'>";g+="<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";for(i=0;i<this.p.colNames.length;i++)c.p.colModel[i].hidedlg||(g+="<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_"+this.p.colModel[i].name+"' class='cbox' value='T' "+(this.p.colModel[i].hidden===false?"checked":"")+"/><label for='col_"+this.p.colModel[i].name+"'>"+this.p.colNames[i]+
418
- (a.colnameview?" ("+this.p.colModel[i].name+")":"")+"</label></td></tr>");g+="</tbody></table></div>";g+="<table border='0' class='EditTable' id='"+d+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+(!a.updateAfterCheck?"<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+a.bSubmit+"</a>":"")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+
419
- a.bCancel+"</a>")+"</td></tr></tbody></table>";a.gbox="#gbox_"+e;createModal(f,g,a,"#gview_"+c.p.id,b("#gview_"+c.p.id)[0]);if(a.saveicon[0]==true)b("#dData","#"+d+"_2").addClass(a.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+a.saveicon[2]+"'></span>");if(a.closeicon[0]==true)b("#eData","#"+d+"_2").addClass(a.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+a.closeicon[2]+"'></span>");a.updateAfterCheck?
420
- b(":input","#"+d).click(function(){var h=this.id.substr(4);if(h){this.checked?b(c).jqGrid("showCol",h):b(c).jqGrid("hideCol",h);a.ShrinkToFit===true&&b(c).jqGrid("setGridWidth",c.grid.width-0.0010,true)}return this}):b("#dData","#"+d+"_2").click(function(){for(i=0;i<c.p.colModel.length;i++)if(!c.p.colModel[i].hidedlg){var h=c.p.colModel[i].name.replace(".","\\.");if(b("#col_"+h,"#"+d).attr("checked")){b(c).jqGrid("showCol",c.p.colModel[i].name);b("#col_"+h,"#"+d).attr("defaultChecked",true)}else{b(c).jqGrid("hideCol",
421
- c.p.colModel[i].name);b("#col_"+h,"#"+d).attr("defaultChecked","")}}a.ShrinkToFit===true&&b(c).jqGrid("setGridWidth",c.grid.width-0.0010,true);a.closeAfterSubmit&&hideModal("#"+f.themodal,{gb:"#gbox_"+e,jqm:a.jqModal,onClose:a.onClose});l&&a.afterSubmitForm(b("#"+d));return false});b("#eData","#"+d+"_2").click(function(){hideModal("#"+f.themodal,{gb:"#gbox_"+e,jqm:a.jqModal,onClose:a.onClose});return false});b("#dData, #eData","#"+d+"_2").hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});
422
- j&&a.beforeShowForm(b("#"+d));viewModal("#"+f.themodal,{gbox:"#gbox_"+e,jqm:a.jqModal,jqM:true,modal:a.modal})}k&&a.afterShowForm(b("#"+d))}})}})})(jQuery);
423
- (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]=
428
+ (function(b){b.jgrid.extend({setColumns:function(a){a=b.extend({top:0,left:0,width:200,height:"auto",dataheight:"auto",modal:false,drag:true,beforeShowForm:null,afterShowForm:null,afterSubmitForm:null,closeOnEscape:true,ShrinkToFit:false,jqModal:false,saveicon:[true,"left","ui-icon-disk"],closeicon:[true,"left","ui-icon-close"],onClose:null,colnameview:true,closeAfterSubmit:true,updateAfterCheck:false,recreateForm:false},b.jgrid.col,a||{});return this.each(function(){var c=this;if(c.grid){var j=typeof a.beforeShowForm===
429
+ "function"?true:false,k=typeof a.afterShowForm==="function"?true:false,l=typeof a.afterSubmitForm==="function"?true:false,e=c.p.id,d="ColTbl_"+e,f={themodal:"colmod"+e,modalhead:"colhd"+e,modalcontent:"colcnt"+e,scrollelm:d};a.recreateForm===true&&b("#"+f.themodal).html()!=null&&b("#"+f.themodal).remove();if(b("#"+f.themodal).html()!=null){j&&a.beforeShowForm(b("#"+d));b.jgrid.viewModal("#"+f.themodal,{gbox:"#gbox_"+e,jqm:a.jqModal,jqM:false,modal:a.modal})}else{var g=isNaN(a.dataheight)?a.dataheight:
430
+ a.dataheight+"px";g="<div id='"+d+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+g+";'>";g+="<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";for(i=0;i<this.p.colNames.length;i++)c.p.colModel[i].hidedlg||(g+="<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_"+this.p.colModel[i].name+"' class='cbox' value='T' "+(this.p.colModel[i].hidden===false?"checked":"")+"/><label for='col_"+this.p.colModel[i].name+
431
+ "'>"+this.p.colNames[i]+(a.colnameview?" ("+this.p.colModel[i].name+")":"")+"</label></td></tr>");g+="</tbody></table></div>";g+="<table border='0' class='EditTable' id='"+d+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+(!a.updateAfterCheck?"<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+a.bSubmit+"</a>":"")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+
432
+ a.bCancel+"</a>")+"</td></tr></tbody></table>";a.gbox="#gbox_"+e;b.jgrid.createModal(f,g,a,"#gview_"+c.p.id,b("#gview_"+c.p.id)[0]);if(a.saveicon[0]==true)b("#dData","#"+d+"_2").addClass(a.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+a.saveicon[2]+"'></span>");if(a.closeicon[0]==true)b("#eData","#"+d+"_2").addClass(a.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+a.closeicon[2]+"'></span>");a.updateAfterCheck?
433
+ b(":input","#"+d).click(function(){var h=this.id.substr(4);if(h){this.checked?b(c).jqGrid("showCol",h):b(c).jqGrid("hideCol",h);a.ShrinkToFit===true&&b(c).jqGrid("setGridWidth",c.grid.width-0.0010,true)}return this}):b("#dData","#"+d+"_2").click(function(){for(i=0;i<c.p.colModel.length;i++)if(!c.p.colModel[i].hidedlg){var h=c.p.colModel[i].name.replace(/\./g,"\\.");if(b("#col_"+h,"#"+d).attr("checked")){b(c).jqGrid("showCol",c.p.colModel[i].name);b("#col_"+h,"#"+d).attr("defaultChecked",true)}else{b(c).jqGrid("hideCol",
434
+ c.p.colModel[i].name);b("#col_"+h,"#"+d).attr("defaultChecked","")}}a.ShrinkToFit===true&&b(c).jqGrid("setGridWidth",c.grid.width-0.0010,true);a.closeAfterSubmit&&b.jgrid.hideModal("#"+f.themodal,{gb:"#gbox_"+e,jqm:a.jqModal,onClose:a.onClose});l&&a.afterSubmitForm(b("#"+d));return false});b("#eData","#"+d+"_2").click(function(){b.jgrid.hideModal("#"+f.themodal,{gb:"#gbox_"+e,jqm:a.jqModal,onClose:a.onClose});return false});b("#dData, #eData","#"+d+"_2").hover(function(){b(this).addClass("ui-state-hover")},
435
+ function(){b(this).removeClass("ui-state-hover")});j&&a.beforeShowForm(b("#"+d));b.jgrid.viewModal("#"+f.themodal,{gbox:"#gbox_"+e,jqm:a.jqModal,jqM:true,modal:a.modal})}k&&a.afterShowForm(b("#"+d))}})}})})(jQuery);
436
+ (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]=
424
437
  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);
425
- function tableToGrid(o,p){jQuery(o).each(function(){if(!this.grid){jQuery(this).width("99%");var a=jQuery(this).width(),f=jQuery("input[type=checkbox]:first",jQuery(this)),l=jQuery("input[type=radio]:first",jQuery(this)),b=f.length>0,q=!b&&l.length>0,m=b||q;f=f.attr("name")||l.attr("name");var c=[],g=[];jQuery("th",jQuery(this)).each(function(){if(c.length===0&&m){c.push({name:"__selection__",index:"__selection__",width:0,hidden:true});g.push("__selection__")}else{c.push({name:jQuery(this).attr("id")||
426
- jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),index:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),width:jQuery(this).width()||150});g.push(jQuery(this).html())}});var e=[],h=[],i=[];jQuery("tbody > tr",jQuery(this)).each(function(){var j={},d=0;jQuery("td",jQuery(this)).each(function(){if(d===0&&m){var k=jQuery("input",jQuery(this)),n=k.attr("value");h.push(n||e.length);k.attr("checked")&&i.push(n);j[c[d].name]=
427
- k.attr("value")}else j[c[d].name]=jQuery(this).html();d++});d>0&&e.push(j)});jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid(jQuery.extend({datatype:"local",width:a,colNames:g,colModel:c,multiselect:b},p||{}));for(a=0;a<e.length;a++){b=null;if(h.length>0)if((b=h[a])&&b.replace)b=encodeURIComponent(b).replace(/[.\-%]/g,"_");if(b===null)b=a+1;jQuery(this).jqGrid("addRowData",b,e[a])}for(a=0;a<i.length;a++)jQuery(this).jqGrid("setSelection",i[a])}})};
428
- (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,i){b=q.call(this,b,i);if(i&&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=
429
- 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 i(){c.p.disableClick=true}var c=this,g={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+
430
- " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(e,h){h.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10));h.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}},update:function(e,h){e=a(h.item).parent();e=a(">th",e);var j={};a.each(c.p.colModel,function(m){j[this.name]=m});var l=[];
431
- e.each(function(){var m=a(">div",this).get(0).id.replace(/^jqgh_/,"");m in j&&l.push(j[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(g,c.p.sortable.options);else if(a.isFunction(c.p.sortable))c.p.sortable={update:c.p.sortable};if(g.start){var d=g.start;g.start=function(e,h){i();d.call(this,e,h)}}else g.start=i;if(c.p.sortable.exclude)g.items+=":not("+c.p.sortable.exclude+
432
- ")";b.sortable(g).data("sortable").floating=true})},columnChooser:function(b){function i(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 g=this;if(!a("#colchooser_"+g[0].p.id).length){var d=a('<div id="colchooser_'+g[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),
433
- e=a("select",d);b=a.extend({width:420,height:240,classname:null,done:function(f){f&&g.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?g.jqGrid("showCol",h[this.value].name):g.jqGrid("hideCol",
434
- h[this.value].name)});var f=[];a("option[selected]",e).each(function(){f.push(parseInt(this.value,10))});a.each(f,function(){delete l[h[parseInt(this,10)].name]});a.each(l,function(){var k=parseInt(this,10);f=i(f,k,k)});b.done&&b.done.call(g,f)},cleanup:function(f){c(b.dlog,d,"destroy");c(b.msel,e,"destroy");d.remove();f&&b.done&&b.done.call(g)},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!");
435
- 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 h=g.jqGrid("getGridParam","colModel"),j=g.jqGrid("getGridParam","colNames"),l={},m=[];e.empty();a.each(h,function(f){l[this.name]=f;if(this.hidedlg)this.hidden||m.push(f);
436
- else e.append("<option value='"+f+"' "+(this.hidden?"":"selected='selected'")+">"+j[f]+"</option>")});var n=a.isFunction(b.dlog_opts)?b.dlog_opts.call(g,b):b.dlog_opts;c(b.dlog,d,n);n=a.isFunction(b.msel_opts)?b.msel_opts.call(g,b):b.msel_opts;c(b.msel,e,n)}},sortableRows:function(b){return this.each(function(){var i=this;if(i.grid)if(!i.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_=
437
- false;if(b.update&&a.isFunction(b.update)){b._update_=b.update;delete b.update}else b._update_=false;b.start=function(c,g){a(g.item).css("border-width","0px");a("td",g.item).each(function(h){this.style.width=i.grid.cols[h].style.width});if(i.p.subGrid){var d=a(g.item).attr("id");try{a(i).jqGrid("collapseSubGridRow",d)}catch(e){}}b._start_&&b._start_.apply(this,[c,g])};b.update=function(c,g){a(g.item).css("border-width","");i.updateColumns();i.p.rownumbers===true&&a("td.jqgrid-rownum",i.rows).each(function(d){a(this).html(d+
438
- 1)});b._update_&&b._update_.apply(this,[c,g])};a("tbody:first",i).sortable(b);a("tbody:first",i).disableSelection()}})},gridDnD:function(b){return this.each(function(){function i(){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("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof b=="string"&&b==
439
- "updateDnD"&&c.p.jqgdnd===true)i();else{b=a.extend({drag:function(d){return a.extend({start:function(e,h){if(c.p.subGrid){var j=a(h.helper).attr("id");try{a(c).jqGrid("collapseSubGridRow",j)}catch(l){}}for(j=0;j<a.data(c,"dnd").connectWith.length;j++)a(a.data(c,"dnd").connectWith[j]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(c,"dnd").connectWith[j]).jqGrid("addRowData","jqg_empty_row",{});h.helper.addClass("ui-state-highlight");a("td",h.helper).each(function(m){this.style.width=c.grid.headers[m].width+
440
- "px"});d.onstart&&a.isFunction(d.onstart)&&d.onstart.call(a(c),e,h)},stop:function(e,h){if(h.helper.dropped){var j=a(h.helper).attr("id");a(c).jqGrid("delRowData",j)}for(j=0;j<a.data(c,"dnd").connectWith.length;j++)a(a.data(c,"dnd").connectWith[j]).jqGrid("delRowData","jqg_empty_row");d.onstop&&a.isFunction(d.onstop)&&d.onstop.call(a(c),e,h)}},d.drag_opts||{})},drop:function(d){return a.extend({accept:function(e){var h=a(e).closest("table.ui-jqgrid-btable");if(a.data(h[0],"dnd")!==undefined){e=a.data(h[0],
441
- "dnd").connectWith;return a.inArray("#"+this.id,e)!=-1?true:false}return e},drop:function(e,h){var j=a(h.draggable).attr("id");j=a("#"+c.id).jqGrid("getRowData",j);if(!d.dropbyname){var l=0,m={},n,f=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var k in j){if(j.hasOwnProperty(k)&&f[l]){n=f[l].name;m[n]=j[k]}l++}j=m}catch(p){}}h.helper.dropped=true;if(d.beforedrop&&a.isFunction(d.beforedrop)){n=d.beforedrop.call(this,e,h,j,a("#"+c.id),a(this));if(typeof n!="undefined"&&n!==null&&typeof n==
442
- "object")j=n}if(h.helper.dropped){var o;if(d.autoid)if(a.isFunction(d.autoid))o=d.autoid.call(this,j);else{o=Math.ceil(Math.random()*1E3);o=d.autoidprefix+o}a("#"+this.id).jqGrid("addRowData",o,j,d.droppos)}d.ondrop&&a.isFunction(d.ondrop)&&d.ondrop.call(this,e,h,j)}},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},
443
- 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&&i();c.p.jqgdnd=true;for(var g=0;g<b.connectWith.length;g++)a(b.connectWith[g]).droppable(a.isFunction(b.drop)?b.drop.call(a(c),b):b.drop)}}}})},gridResize:function(b){return this.each(function(){var i=this;if(i.grid&&a.fn.resizable){b=a.extend({},b||{});if(b.alsoResize){b._alsoResize_=
444
- b.alsoResize;delete b.alsoResize}else b._alsoResize_=false;if(b.stop&&a.isFunction(b.stop)){b._stop_=b.stop;delete b.stop}else b._stop_=false;b.stop=function(c,g){a(i).jqGrid("setGridParam",{height:a("#gview_"+i.p.id+" .ui-jqgrid-bdiv").height()});a(i).jqGrid("setGridWidth",g.size.width,b.shrinkToFit);b._stop_&&b._stop_.call(i,c,g)};b.alsoResize=b._alsoResize_?eval("("+("{'#gview_"+i.p.id+" .ui-jqgrid-bdiv':true,'"+b._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+i.p.id);delete b._alsoResize_;
445
- a("#gbox_"+i.p.id).resizable(b)}})}})})(jQuery);
438
+ function tableToGrid(n,o){jQuery(n).each(function(){if(!this.grid){jQuery(this).width("99%");var a=jQuery(this).width(),d=jQuery("input[type=checkbox]:first",jQuery(this)),b=jQuery("input[type=radio]:first",jQuery(this));d=d.length>0;b=!d&&b.length>0;var l=d||b,c=[],g=[];jQuery("th",jQuery(this)).each(function(){if(c.length===0&&l){c.push({name:"__selection__",index:"__selection__",width:0,hidden:true});g.push("__selection__")}else{c.push({name:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),
439
+ index:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),width:jQuery(this).width()||150});g.push(jQuery(this).html())}});var f=[],h=[],i=[];jQuery("tbody > tr",jQuery(this)).each(function(){var j={},e=0;jQuery("td",jQuery(this)).each(function(){if(e===0&&l){var k=jQuery("input",jQuery(this)),m=k.attr("value");h.push(m||f.length);k.attr("checked")&&i.push(m);j[c[e].name]=k.attr("value")}else j[c[e].name]=jQuery(this).html();e++});e>0&&f.push(j)});
440
+ jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid(jQuery.extend({datatype:"local",width:a,colNames:g,colModel:c,multiselect:d},o||{}));for(a=0;a<f.length;a++){b=null;if(h.length>0)if((b=h[a])&&b.replace)b=encodeURIComponent(b).replace(/[.\-%]/g,"_");if(b===null)b=a+1;jQuery(this).jqGrid("addRowData",b,f[a])}for(a=0;a<i.length;a++)jQuery(this).jqGrid("setSelection",i[a])}})};
441
+ (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=
442
+ 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+
443
+ " 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=[];
444
+ 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+
445
+ ")";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('<div id="colchooser_'+h[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),
446
+ 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",
447
+ 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!");
448
+ 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);
449
+ else e.append("<option value='"+f+"' "+(this.hidden?"":"selected='selected'")+">"+i[f]+"</option>")});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_=
450
+ 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+
451
+ 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("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof b=="string"&&b==
452
+ "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<a.data(c,"dnd").connectWith.length;i++)a(a.data(c,"dnd").connectWith[i]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(c,"dnd").connectWith[i]).jqGrid("addRowData","jqg_empty_row",{});g.helper.addClass("ui-state-highlight");a("td",g.helper).each(function(m){this.style.width=c.grid.headers[m].width+
453
+ "px"});d.onstart&&a.isFunction(d.onstart)&&d.onstart.call(a(c),e,g)},stop:function(e,g){if(g.helper.dropped){var i=a(g.helper).attr("id");a(c).jqGrid("delRowData",i)}for(i=0;i<a.data(c,"dnd").connectWith.length;i++)a(a.data(c,"dnd").connectWith[i]).jqGrid("delRowData","jqg_empty_row");d.onstop&&a.isFunction(d.onstop)&&d.onstop.call(a(c),e,g)}},d.drag_opts||{})},drop:function(d){return a.extend({accept:function(e){if(!a(e).hasClass("jqgrow"))return e;var g=a(e).closest("table.ui-jqgrid-btable");if(g.length>
454
+ 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=
455
+ 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"},
456
+ 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;h<b.connectWith.length;h++)a(b.connectWith[h]).droppable(a.isFunction(b.drop)?b.drop.call(a(c),b):b.drop)}}}})},gridResize:function(b){return this.each(function(){var j=
457
+ this;if(j.grid&&a.fn.resizable){b=a.extend({},b||{});if(b.alsoResize){b._alsoResize_=b.alsoResize;delete b.alsoResize}else b._alsoResize_=false;if(b.stop&&a.isFunction(b.stop)){b._stop_=b.stop;delete b.stop}else b._stop_=false;b.stop=function(c,h){a(j).jqGrid("setGridParam",{height:a("#gview_"+j.p.id+" .ui-jqgrid-bdiv").height()});a(j).jqGrid("setGridWidth",h.size.width,b.shrinkToFit);b._stop_&&b._stop_.call(j,c,h)};b.alsoResize=b._alsoResize_?eval("("+("{'#gview_"+j.p.id+" .ui-jqgrid-bdiv':true,'"+
458
+ b._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+j.p.id);delete b._alsoResize_;a("#gbox_"+j.p.id).resizable(b)}})}})})(jQuery);