compass-jquery-plugin 0.3.2.6 → 0.3.2.7.nil

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. data/README.md +2 -1
  2. data/VERSION.yml +2 -2
  3. data/lib/handle_js_files.rb +21 -2
  4. data/templates/dynatree/jquery.dynatree.js +23 -20
  5. data/templates/dynatree/jquery.dynatree.min.js +38 -38
  6. data/templates/dynatree/jquery/dynatree/aero.scss +1 -1
  7. data/templates/dynatree/jquery/dynatree/aqua.scss +1 -1
  8. data/templates/dynatree/jquery/dynatree/crystal.scss +1 -1
  9. data/templates/dynatree/jquery/dynatree/xp.scss +2 -2
  10. data/templates/ical/jquery/ical.scss +10 -10
  11. data/templates/jqgrid/i18n/jqgrid/locale-lt.js +134 -0
  12. data/templates/jqgrid/i18n/jqgrid/locale-lt.min.js +7 -0
  13. data/templates/jqgrid/jquery.jqGrid.js +155 -65
  14. data/templates/jqgrid/jquery.jqGrid.min.js +396 -393
  15. data/templates/jqgrid/manifest.rb +2 -0
  16. data/templates/jqtouch/jquery.jqtouch.js +166 -195
  17. data/templates/jqtouch/jquery.jqtouch.min.js +1 -1
  18. data/templates/jqtouch/jquery/touch/apple.scss +5 -5
  19. data/templates/jqtouch/jquery/touch/default.scss +5 -5
  20. data/templates/jqtouch/jquery/touch/jqt.scss +12 -7
  21. data/templates/jqtouch/jquery/touch/jqtouch.scss +11 -13
  22. data/templates/jquery/history.adapter.jquery.js +54 -67
  23. data/templates/jquery/history.adapter.jquery.min.js +2 -2
  24. data/templates/jquery/history.html4.js +587 -680
  25. data/templates/jquery/history.html4.min.js +8 -18
  26. data/templates/jquery/history.js +1670 -1289
  27. data/templates/jquery/history.min.js +25 -21
  28. data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +1 -1
  29. data/templates/jquery/i18n/jquery.ui/datepicker-ar.min.js +1 -1
  30. data/templates/jquery/i18n/jquery.ui/datepicker-tj.js +23 -0
  31. data/templates/jquery/i18n/jquery.ui/datepicker-tj.min.js +2 -0
  32. data/templates/jquery/jquery-ui.js +97 -61
  33. data/templates/jquery/jquery-ui.min.js +175 -175
  34. data/templates/jquery/jquery.dst.js +86 -151
  35. data/templates/jquery/jquery/ui/_theme.scss +13 -13
  36. data/templates/jquery/json2.js +214 -214
  37. data/templates/jquery/manifest.rb +2 -0
  38. data/templates/mobile/jquery.mobile.js +324 -225
  39. data/templates/mobile/jquery.mobile.min.js +4 -4
  40. data/templates/mobile/jquery/mobile/_base.scss +60 -48
  41. data/templates/mobile/jquery/mobile/default.scss +57 -80
  42. data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
  43. data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
  44. data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
  45. data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
  46. data/templates/mobile/jquery/mobile/valencia.scss +61 -73
  47. data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
  48. data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
  49. data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
  50. data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
  51. data/templates/mobile/manifest.rb +0 -8
  52. data/templates/ribbon/jquery/ribbon/office.scss +12 -12
  53. data/templates/ribbon/jquery/ribbon/windows7.scss +12 -12
  54. data/templates/tiny_mce/manifest.rb +16 -0
  55. data/templates/tiny_mce/tiny_mce/jquery.tinymce.js +1 -1
  56. data/templates/tiny_mce/tiny_mce/langs/de.js +1 -0
  57. data/templates/tiny_mce/tiny_mce/langs/en.js +1 -222
  58. data/templates/tiny_mce/tiny_mce/plugins/advhr/css/advhr.css +1 -5
  59. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin.js +1 -1
  60. data/templates/tiny_mce/tiny_mce/plugins/advhr/editor_plugin_src.js +1 -57
  61. data/templates/tiny_mce/tiny_mce/plugins/advhr/js/rule.js +1 -43
  62. data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/de_dlg.js +1 -0
  63. data/templates/tiny_mce/tiny_mce/plugins/advhr/langs/en_dlg.js +1 -7
  64. data/templates/tiny_mce/tiny_mce/plugins/advhr/rule.htm +1 -58
  65. data/templates/tiny_mce/tiny_mce/plugins/advimage/css/advimage.css +1 -13
  66. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin.js +1 -1
  67. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin_src.js +1 -50
  68. data/templates/tiny_mce/tiny_mce/plugins/advimage/image.htm +1 -235
  69. data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +1 -445
  70. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/de_dlg.js +1 -0
  71. data/templates/tiny_mce/tiny_mce/plugins/advimage/langs/en_dlg.js +1 -45
  72. data/templates/tiny_mce/tiny_mce/plugins/advlink/css/advlink.css +1 -8
  73. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin.js +1 -1
  74. data/templates/tiny_mce/tiny_mce/plugins/advlink/editor_plugin_src.js +1 -61
  75. data/templates/tiny_mce/tiny_mce/plugins/advlink/js/advlink.js +1 -525
  76. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/de_dlg.js +1 -0
  77. data/templates/tiny_mce/tiny_mce/plugins/advlink/langs/en_dlg.js +1 -54
  78. data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +1 -338
  79. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -1
  80. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +1 -154
  81. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -1
  82. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +1 -119
  83. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin.js +1 -1
  84. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin_src.js +1 -431
  85. data/templates/tiny_mce/tiny_mce/plugins/autosave/langs/en.js +1 -4
  86. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin.js +1 -1
  87. data/templates/tiny_mce/tiny_mce/plugins/bbcode/editor_plugin_src.js +1 -120
  88. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
  89. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +1 -154
  90. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin.js +1 -1
  91. data/templates/tiny_mce/tiny_mce/plugins/directionality/editor_plugin_src.js +1 -82
  92. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin.js +1 -1
  93. data/templates/tiny_mce/tiny_mce/plugins/emotions/editor_plugin_src.js +1 -43
  94. data/templates/tiny_mce/tiny_mce/plugins/emotions/emotions.htm +1 -41
  95. data/templates/tiny_mce/tiny_mce/plugins/emotions/js/emotions.js +1 -22
  96. data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/de_dlg.js +1 -0
  97. data/templates/tiny_mce/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -20
  98. data/templates/tiny_mce/tiny_mce/plugins/example/dialog.htm +1 -22
  99. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin.js +1 -1
  100. data/templates/tiny_mce/tiny_mce/plugins/example/editor_plugin_src.js +1 -84
  101. data/templates/tiny_mce/tiny_mce/plugins/example/js/dialog.js +1 -19
  102. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en.js +1 -3
  103. data/templates/tiny_mce/tiny_mce/plugins/example/langs/en_dlg.js +1 -3
  104. data/templates/tiny_mce/tiny_mce/plugins/fullpage/css/fullpage.css +1 -182
  105. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
  106. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +1 -166
  107. data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +1 -571
  108. data/templates/tiny_mce/tiny_mce/plugins/fullpage/js/fullpage.js +1 -492
  109. data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/de_dlg.js +1 -0
  110. data/templates/tiny_mce/tiny_mce/plugins/fullpage/langs/en_dlg.js +1 -85
  111. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -1
  112. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/editor_plugin_src.js +1 -159
  113. data/templates/tiny_mce/tiny_mce/plugins/fullscreen/fullscreen.htm +1 -109
  114. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin.js +1 -1
  115. data/templates/tiny_mce/tiny_mce/plugins/iespell/editor_plugin_src.js +1 -54
  116. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -1
  117. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +1 -696
  118. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +1 -90
  119. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/template.htm +1 -387
  120. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -1
  121. data/templates/tiny_mce/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +1 -83
  122. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin.js +1 -1
  123. data/templates/tiny_mce/tiny_mce/plugins/layer/editor_plugin_src.js +1 -214
  124. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -1
  125. data/templates/tiny_mce/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +1 -139
  126. data/templates/tiny_mce/tiny_mce/plugins/media/css/media.css +1 -17
  127. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin.js +1 -1
  128. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin_src.js +1 -770
  129. data/templates/tiny_mce/tiny_mce/plugins/media/js/embed.js +1 -73
  130. data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +1 -340
  131. data/templates/tiny_mce/tiny_mce/plugins/media/langs/de_dlg.js +1 -0
  132. data/templates/tiny_mce/tiny_mce/plugins/media/langs/en_dlg.js +1 -109
  133. data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +1 -812
  134. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -1
  135. data/templates/tiny_mce/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +1 -53
  136. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -1
  137. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +1 -90
  138. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -1
  139. data/templates/tiny_mce/tiny_mce/plugins/pagebreak/editor_plugin_src.js +1 -74
  140. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -1
  141. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +1 -899
  142. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pastetext.js +1 -36
  143. data/templates/tiny_mce/tiny_mce/plugins/paste/js/pasteword.js +1 -51
  144. data/templates/tiny_mce/tiny_mce/plugins/paste/langs/de_dlg.js +1 -0
  145. data/templates/tiny_mce/tiny_mce/plugins/paste/langs/en_dlg.js +1 -5
  146. data/templates/tiny_mce/tiny_mce/plugins/paste/pastetext.htm +1 -27
  147. data/templates/tiny_mce/tiny_mce/plugins/paste/pasteword.htm +1 -21
  148. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin.js +1 -1
  149. data/templates/tiny_mce/tiny_mce/plugins/preview/editor_plugin_src.js +1 -53
  150. data/templates/tiny_mce/tiny_mce/plugins/preview/example.html +17 -16
  151. data/templates/tiny_mce/tiny_mce/plugins/preview/jscripts/embed.js +1 -73
  152. data/templates/tiny_mce/tiny_mce/plugins/preview/preview.html +10 -9
  153. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin.js +1 -1
  154. data/templates/tiny_mce/tiny_mce/plugins/print/editor_plugin_src.js +1 -34
  155. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin.js +1 -1
  156. data/templates/tiny_mce/tiny_mce/plugins/save/editor_plugin_src.js +1 -101
  157. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/css/searchreplace.css +1 -6
  158. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -1
  159. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/editor_plugin_src.js +1 -61
  160. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/js/searchreplace.js +1 -140
  161. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/de_dlg.js +1 -0
  162. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/langs/en_dlg.js +1 -16
  163. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/searchreplace.htm +1 -100
  164. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/css/content.css +1 -1
  165. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -1
  166. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +1 -415
  167. data/templates/tiny_mce/tiny_mce/plugins/style/css/props.css +1 -13
  168. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin.js +1 -1
  169. data/templates/tiny_mce/tiny_mce/plugins/style/editor_plugin_src.js +1 -55
  170. data/templates/tiny_mce/tiny_mce/plugins/style/js/props.js +1 -635
  171. data/templates/tiny_mce/tiny_mce/plugins/style/langs/de_dlg.js +1 -0
  172. data/templates/tiny_mce/tiny_mce/plugins/style/langs/en_dlg.js +1 -70
  173. data/templates/tiny_mce/tiny_mce/plugins/style/props.htm +1 -838
  174. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -1
  175. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin_src.js +1 -114
  176. data/templates/tiny_mce/tiny_mce/plugins/table/cell.htm +1 -178
  177. data/templates/tiny_mce/tiny_mce/plugins/table/css/cell.css +1 -17
  178. data/templates/tiny_mce/tiny_mce/plugins/table/css/row.css +1 -25
  179. data/templates/tiny_mce/tiny_mce/plugins/table/css/table.css +1 -13
  180. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -1
  181. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1 -1183
  182. data/templates/tiny_mce/tiny_mce/plugins/table/js/cell.js +1 -284
  183. data/templates/tiny_mce/tiny_mce/plugins/table/js/merge_cells.js +1 -27
  184. data/templates/tiny_mce/tiny_mce/plugins/table/js/row.js +1 -232
  185. data/templates/tiny_mce/tiny_mce/plugins/table/js/table.js +1 -450
  186. data/templates/tiny_mce/tiny_mce/plugins/table/langs/de_dlg.js +1 -0
  187. data/templates/tiny_mce/tiny_mce/plugins/table/langs/en_dlg.js +1 -74
  188. data/templates/tiny_mce/tiny_mce/plugins/table/merge_cells.htm +1 -32
  189. data/templates/tiny_mce/tiny_mce/plugins/table/row.htm +1 -157
  190. data/templates/tiny_mce/tiny_mce/plugins/table/table.htm +1 -188
  191. data/templates/tiny_mce/tiny_mce/plugins/template/blank.htm +1 -12
  192. data/templates/tiny_mce/tiny_mce/plugins/template/css/template.css +1 -23
  193. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin.js +1 -1
  194. data/templates/tiny_mce/tiny_mce/plugins/template/editor_plugin_src.js +1 -159
  195. data/templates/tiny_mce/tiny_mce/plugins/template/js/template.js +1 -106
  196. data/templates/tiny_mce/tiny_mce/plugins/template/langs/de_dlg.js +1 -0
  197. data/templates/tiny_mce/tiny_mce/plugins/template/langs/en_dlg.js +1 -15
  198. data/templates/tiny_mce/tiny_mce/plugins/template/template.htm +1 -31
  199. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin.js +1 -1
  200. data/templates/tiny_mce/tiny_mce/plugins/visualchars/editor_plugin_src.js +1 -83
  201. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin.js +1 -1
  202. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin_src.js +1 -114
  203. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/abbr.htm +1 -142
  204. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/acronym.htm +1 -142
  205. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/attributes.htm +1 -149
  206. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/cite.htm +1 -142
  207. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/attributes.css +1 -11
  208. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/css/popup.css +1 -9
  209. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/del.htm +1 -162
  210. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -1
  211. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +1 -132
  212. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/ins.htm +1 -162
  213. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/abbr.js +1 -28
  214. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/acronym.js +1 -28
  215. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/attributes.js +1 -125
  216. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/cite.js +1 -28
  217. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/del.js +1 -53
  218. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/element_common.js +1 -229
  219. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/js/ins.js +1 -53
  220. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/de_dlg.js +1 -0
  221. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +1 -32
  222. data/templates/tiny_mce/tiny_mce/themes/advanced/about.htm +1 -52
  223. data/templates/tiny_mce/tiny_mce/themes/advanced/anchor.htm +1 -26
  224. data/templates/tiny_mce/tiny_mce/themes/advanced/charmap.htm +1 -51
  225. data/templates/tiny_mce/tiny_mce/themes/advanced/color_picker.htm +1 -74
  226. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -1
  227. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1 -1328
  228. data/templates/tiny_mce/tiny_mce/themes/advanced/image.htm +1 -80
  229. data/templates/tiny_mce/tiny_mce/themes/advanced/js/about.js +1 -73
  230. data/templates/tiny_mce/tiny_mce/themes/advanced/js/anchor.js +1 -42
  231. data/templates/tiny_mce/tiny_mce/themes/advanced/js/charmap.js +1 -354
  232. data/templates/tiny_mce/tiny_mce/themes/advanced/js/color_picker.js +1 -329
  233. data/templates/tiny_mce/tiny_mce/themes/advanced/js/image.js +1 -247
  234. data/templates/tiny_mce/tiny_mce/themes/advanced/js/link.js +1 -153
  235. data/templates/tiny_mce/tiny_mce/themes/advanced/js/source_editor.js +1 -56
  236. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de.js +1 -0
  237. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de_dlg.js +1 -0
  238. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en.js +1 -68
  239. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/en_dlg.js +1 -54
  240. data/templates/tiny_mce/tiny_mce/themes/advanced/link.htm +1 -57
  241. data/templates/tiny_mce/tiny_mce/themes/advanced/shortcuts.htm +1 -47
  242. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css +1 -47
  243. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/dialog.css +1 -117
  244. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +1 -213
  245. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/content.css +1 -23
  246. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +1 -105
  247. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/ui.css +1 -101
  248. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css +1 -46
  249. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -116
  250. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +1 -215
  251. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +1 -8
  252. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +1 -5
  253. data/templates/tiny_mce/tiny_mce/themes/advanced/source_editor.htm +1 -25
  254. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template.js +1 -1
  255. data/templates/tiny_mce/tiny_mce/themes/simple/editor_template_src.js +1 -84
  256. data/templates/tiny_mce/tiny_mce/themes/simple/langs/de.js +1 -0
  257. data/templates/tiny_mce/tiny_mce/themes/simple/langs/en.js +1 -11
  258. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/content.css +1 -25
  259. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/ui.css +1 -32
  260. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/content.css +1 -17
  261. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/ui.css +1 -35
  262. data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -1
  263. data/templates/tiny_mce/tiny_mce/tiny_mce_popup.js +1 -5
  264. data/templates/tiny_mce/tiny_mce/utils/editable_selects.js +1 -70
  265. data/templates/tiny_mce/tiny_mce/utils/form_utils.js +1 -207
  266. data/templates/tiny_mce/tiny_mce/utils/mctabs.js +1 -162
  267. data/templates/tiny_mce/tiny_mce/utils/validate.js +1 -252
  268. metadata +32 -17
  269. data/templates/mobile/jquery/mobile/default/form-check-off.png +0 -0
  270. data/templates/mobile/jquery/mobile/default/form-check-on.png +0 -0
  271. data/templates/mobile/jquery/mobile/default/form-radio-off.png +0 -0
  272. data/templates/mobile/jquery/mobile/default/form-radio-on.png +0 -0
  273. data/templates/mobile/jquery/mobile/valencia/form-check-off.png +0 -0
  274. data/templates/mobile/jquery/mobile/valencia/form-check-on.png +0 -0
  275. data/templates/mobile/jquery/mobile/valencia/form-radio-off.png +0 -0
  276. data/templates/mobile/jquery/mobile/valencia/form-radio-on.png +0 -0
@@ -1,476 +1,479 @@
1
- (function(a){a.jgrid=a.jgrid||{};a.extend(a.jgrid,{htmlDecode:function(b){if(b=="&nbsp;"||b=="&#160;"||b.length==1&&b.charCodeAt(0)==160)return"";return!b?b:String(b).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(b){return!b?b:String(b).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(b){var e=a.makeArray(arguments).slice(1);if(b===undefined)b="";return b.replace(/\{(\d+)\}/g,function(c,
2
- f){return e[f]})},getCellIndex:function(b){b=a(b);if(b.is("tr"))return-1;b=(!b.is("td")&&!b.is("th")?b.closest("td,th"):b)[0];if(a.browser.msie)return a.inArray(b,b.parentNode.cells);return b.cellIndex},stripHtml:function(b){b+="";var e=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(b)return(b=b.replace(e,""))&&b!=="&nbsp;"&&b!=="&#160;"?b.replace(/\"/g,"'"):"";else return b},stringToDoc:function(b){var e;if(typeof b!=="string")return b;try{e=(new DOMParser).parseFromString(b,"text/xml")}catch(c){e=new ActiveXObject("Microsoft.XMLDOM");
3
- e.async=false;e.loadXML(b)}return e&&e.documentElement&&e.documentElement.tagName!="parsererror"?e:null},parse:function(b){b=b;if(b.substr(0,9)=="while(1);")b=b.substr(9);if(b.substr(0,2)=="/*")b=b.substr(2,b.length-4);b||(b="{}");return a.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(b):eval("("+b+")")},parseDate:function(b,e){var c={m:1,d:1,y:1970,h:0,i:0,s:0},f,g,j;f=/[\\\/:_;.,\t\T\s-]/;if(e&&e!==null&&e!==undefined){e=a.trim(e);e=e.split(f);b=b.split(f);
4
- var h=a.jgrid.formatter.date.monthNames,d=a.jgrid.formatter.date.AmPm,n=function(k,o){if(k===0){if(o==12)o=0}else if(o!=12)o+=12;return o};f=0;for(g=b.length;f<g;f++){if(b[f]=="M"){j=a.inArray(e[f],h);if(j!==-1&&j<12)e[f]=j+1}if(b[f]=="F"){j=a.inArray(e[f],h);if(j!==-1&&j>11)e[f]=j+1-12}if(b[f]=="a"){j=a.inArray(e[f],d);if(j!==-1&&j<2&&e[f]==d[j]){e[f]=j;c.h=n(e[f],c.h)}}if(b[f]=="A"){j=a.inArray(e[f],d);if(j!==-1&&j>1&&e[f]==d[j]){e[f]=j-2;c.h=n(e[f],c.h)}}if(e[f]!==undefined)c[b[f].toLowerCase()]=
5
- parseInt(e[f],10)}c.m=parseInt(c.m,10)-1;f=c.y;if(f>=70&&f<=99)c.y=1900+c.y;else if(f>=0&&f<=69)c.y=2E3+c.y}return new Date(c.y,c.m,c.d,c.h,c.i,c.s,0)},jqID:function(b){b+="";return b.replace(/([\.\:\[\]])/g,"\\$1")},getAccessor:function(b,e){var c,f,g=[],j;if(typeof e==="function")return e(b);c=b[e];if(c===undefined)try{if(typeof e==="string")g=e.split(".");if(j=g.length)for(c=b;c&&j--;){f=g.shift();c=c[f]}}catch(h){}return c},ajaxOptions:{},from:function(b){return new function(e,c){if(typeof e==
6
- "string")e=a.data(e);var f=this,g=e,j=true,h=false,d=c,n=/[\$,%]/g,k=null,o=null,m=false,l="",q=[],s=true;if(typeof e=="object"&&e.push){if(e.length>0)s=typeof e[0]!="object"?false:true}else throw"data provides is not an array";this._hasData=function(){return g===null?false:g.length===0?false:true};this._getStr=function(p){var r=[];h&&r.push("jQuery.trim(");r.push("String("+p+")");h&&r.push(")");j||r.push(".toLowerCase()");return r.join("")};this._strComp=function(p){return typeof p=="string"?".toString()":
7
- ""};this._group=function(p,r){return{field:p.toString(),unique:r,items:[]}};this._toStr=function(p){if(h)p=a.trim(p);j||(p=p.toLowerCase());return p=p.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"')};this._funcLoop=function(p){var r=[];a.each(g,function(v,y){r.push(p(y))});return r};this._append=function(p){if(d===null)d="";else d+=l===""?" && ":l;if(m)d+="!";d+="("+p+")";m=false;l=""};this._setCommand=function(p,r){k=p;o=r};this._resetNegate=function(){m=false};this._repeatCommand=function(p,
8
- r){if(k===null)return f;if(p!==null&&r!==null)return k(p,r);if(o===null)return k(p);if(!s)return k(p);return k(o,p)};this._equals=function(p,r){return f._compare(p,r,1)===0};this._compare=function(p,r,v){if(v===undefined)v=1;if(p===undefined)p=null;if(r===undefined)r=null;if(p===null&&r===null)return 0;if(p===null&&r!==null)return 1;if(p!==null&&r===null)return-1;if(!j&&typeof p!=="number"&&typeof r!=="number"){p=String(p).toLowerCase();r=String(r).toLowerCase()}if(p<r)return-v;if(p>r)return v;return 0};
9
- this._performSort=function(){if(q.length!==0)g=f._doSort(g,0)};this._doSort=function(p,r){var v=q[r].by,y=q[r].dir,D=q[r].type,G=q[r].datefmt;if(r==q.length-1)return f._getOrder(p,v,y,D,G);r++;v=f._getGroup(p,v,y,D,G);y=[];for(D=0;D<v.length;D++){G=f._doSort(v[D].items,r);for(var x=0;x<G.length;x++)y.push(G[x])}return y};this._getOrder=function(p,r,v,y,D){var G=[],x=[],B=v=="a"?1:-1,A,z;if(y===undefined)y="text";z=y=="float"||y=="number"||y=="currency"||y=="numeric"?function(R){R=parseFloat(String(R).replace(n,
10
- ""));return isNaN(R)?0:R}:y=="int"||y=="integer"?function(R){return R?parseFloat(String(R).replace(n,"")):0}:y=="date"||y=="datetime"?function(R){return a.jgrid.parseDate(D,R).getTime()}:a.isFunction(y)?y:function(R){R||(R="");return a.trim(String(R).toUpperCase())};a.each(p,function(R,U){A=r!==""?a.jgrid.getAccessor(U,r):U;if(A===undefined)A="";A=z(A,U);x.push({vSort:A,index:R})});x.sort(function(R,U){R=R.vSort;U=U.vSort;return f._compare(R,U,B)});y=0;for(var M=p.length;y<M;){v=x[y].index;G.push(p[v]);
11
- y++}return G};this._getGroup=function(p,r,v,y,D){var G=[],x=null,B=null,A;a.each(f._getOrder(p,r,v,y,D),function(z,M){A=a.jgrid.getAccessor(M,r);if(A===undefined)A="";if(!f._equals(B,A)){B=A;x!==null&&G.push(x);x=f._group(r,A)}x.items.push(M)});x!==null&&G.push(x);return G};this.ignoreCase=function(){j=false;return f};this.useCase=function(){j=true;return f};this.trim=function(){h=true;return f};this.noTrim=function(){h=false;return f};this.execute=function(){var p=d,r=[];if(p===null)return f;a.each(g,
12
- function(){eval(p)&&r.push(this)});g=r;return f};this.data=function(){return g};this.select=function(p){f._performSort();if(!f._hasData())return[];f.execute();if(a.isFunction(p)){var r=[];a.each(g,function(v,y){r.push(p(y))});return r}return g};this.hasMatch=function(){if(!f._hasData())return false;f.execute();return g.length>0};this.andNot=function(p,r,v){m=!m;return f.and(p,r,v)};this.orNot=function(p,r,v){m=!m;return f.or(p,r,v)};this.not=function(p,r,v){return f.andNot(p,r,v)};this.and=function(p,
13
- r,v){l=" && ";if(p===undefined)return f;return f._repeatCommand(p,r,v)};this.or=function(p,r,v){l=" || ";if(p===undefined)return f;return f._repeatCommand(p,r,v)};this.isNot=function(p){m=!m;return f.is(p)};this.is=function(p){f._append("this."+p);f._resetNegate();return f};this._compareValues=function(p,r,v,y,D){var G;G=s?"jQuery.jgrid.getAccessor(this,'"+r+"')":"this";if(v===undefined)v=null;var x=v,B=D.stype===undefined?"text":D.stype;if(v!==null)switch(B){case "int":case "integer":x=isNaN(Number(x))||
14
- x===""?"0":x;G="parseInt("+G+",10)";x="parseInt("+x+",10)";break;case "float":case "number":case "numeric":x=String(x).replace(n,"");x=isNaN(Number(x))||x===""?"0":x;G="parseFloat("+G+")";x="parseFloat("+x+")";break;case "date":case "datetime":x=String(a.jgrid.parseDate(D.newfmt||"Y-m-d",x).getTime());G='jQuery.jgrid.parseDate("'+D.srcfmt+'",'+G+").getTime()";break;default:G=f._getStr(G);x=f._getStr('"'+f._toStr(x)+'"')}f._append(G+" "+y+" "+x);f._setCommand(p,r);f._resetNegate();return f};this.equals=
15
- function(p,r,v){return f._compareValues(f.equals,p,r,"==",v)};this.notEquals=function(p,r,v){return f._compareValues(f.equals,p,r,"!==",v)};this.isNull=function(p,r,v){return f._compareValues(f.equals,p,null,"===",v)};this.greater=function(p,r,v){return f._compareValues(f.greater,p,r,">",v)};this.less=function(p,r,v){return f._compareValues(f.less,p,r,"<",v)};this.greaterOrEquals=function(p,r,v){return f._compareValues(f.greaterOrEquals,p,r,">=",v)};this.lessOrEquals=function(p,r,v){return f._compareValues(f.lessOrEquals,
16
- p,r,"<=",v)};this.startsWith=function(p,r){var v=r===undefined||r===null?p:r;v=h?a.trim(v.toString()).length:v.toString().length;if(s)f._append(f._getStr("jQuery.jgrid.getAccessor(this,'"+p+"')")+".substr(0,"+v+") == "+f._getStr('"'+f._toStr(r)+'"'));else{v=h?a.trim(r.toString()).length:r.toString().length;f._append(f._getStr("this")+".substr(0,"+v+") == "+f._getStr('"'+f._toStr(p)+'"'))}f._setCommand(f.startsWith,p);f._resetNegate();return f};this.endsWith=function(p,r){var v=r===undefined||r===
17
- null?p:r;v=h?a.trim(v.toString()).length:v.toString().length;s?f._append(f._getStr("jQuery.jgrid.getAccessor(this,'"+p+"')")+".substr("+f._getStr("jQuery.jgrid.getAccessor(this,'"+p+"')")+".length-"+v+","+v+') == "'+f._toStr(r)+'"'):f._append(f._getStr("this")+".substr("+f._getStr("this")+'.length-"'+f._toStr(p)+'".length,"'+f._toStr(p)+'".length) == "'+f._toStr(p)+'"');f._setCommand(f.endsWith,p);f._resetNegate();return f};this.contains=function(p,r){s?f._append(f._getStr("jQuery.jgrid.getAccessor(this,'"+
18
- p+"')")+'.indexOf("'+f._toStr(r)+'",0) > -1'):f._append(f._getStr("this")+'.indexOf("'+f._toStr(p)+'",0) > -1');f._setCommand(f.contains,p);f._resetNegate();return f};this.groupBy=function(p,r,v,y){if(!f._hasData())return null;return f._getGroup(g,p,r,v,y)};this.orderBy=function(p,r,v,y){r=r===undefined||r===null?"a":a.trim(r.toString().toLowerCase());if(v===null||v===undefined)v="text";if(y===null||y===undefined)y="Y-m-d";if(r=="desc"||r=="descending")r="d";if(r=="asc"||r=="ascending")r="a";q.push({by:p,
19
- dir:r,type:v,datefmt:y});return f};return f}(b,null)},extend:function(b){a.extend(a.fn.jqGrid,b);this.no_legacy_api||a.fn.extend(b)}});a.fn.jqGrid=function(b){if(typeof b=="string"){var e=a.jgrid.getAccessor(a.fn.jqGrid,b);if(!e)throw"jqGrid - No such method: "+b;var c=a.makeArray(arguments).slice(1);return e.apply(this,c)}return this.each(function(){if(!this.grid){var f=a.extend(true,{url:"",height:150,page:1,rowNum:20,rowTotal:null,records:0,pager:"",pgbuttons:true,pginput:true,colModel:[],rowList:[],
20
- colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",altRows:false,selarrrow:[],savedRow:[],shrinkToFit:true,xmlReader:{},jsonReader:{},subGrid:false,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,onHeaderClick:null,viewrecords:false,loadonce:false,
21
- multiselect:false,multikey:false,editurl:null,search:false,caption:"",hidegrid:true,hiddengrid:false,postData:{},userData:{},treeGrid:false,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:false,gridstate:"visible",cellEdit:false,cellsubmit:"remote",nv:0,loadui:"enable",
22
- toolbar:[false,""],scroll:false,multiboxonly:false,deselectAfterSort:true,scrollrows:false,autowidth:false,scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:false,rownumWidth:25,rownumbers:false,pagerpos:"center",recordpos:"right",footerrow:false,userDataOnFooter:false,hoverrows:true,altclass:"ui-priority-secondary",viewsortcols:[false,"vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false,headertitles:false,scrollTimeout:40,
23
- data:[],_index:{},grouping:false,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:false,sortitems:[],sortnames:[],groupDataSorted:false,summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus",minusicon:"ui-icon-circlesmall-minus"},ignoreCase:false,cmTemplate:{}},a.jgrid.defaults,b||{}),g={headers:[],cols:[],footers:[],dragStart:function(t,u,w){this.resizing={idx:t,startX:u.clientX,sOL:w[0]};this.hDiv.style.cursor="col-resize";this.curGbox=
24
- a("#rs_m"+a.jgrid.jqID(f.id),"#gbox_"+a.jgrid.jqID(f.id));this.curGbox.css({display:"block",left:w[0],top:w[1],height:w[2]});a.isFunction(f.resizeStart)&&f.resizeStart.call(this,u,t);document.onselectstart=function(){return false}},dragMove:function(t){if(this.resizing){var u=t.clientX-this.resizing.startX;t=this.headers[this.resizing.idx];var w=f.direction==="ltr"?t.width+u:t.width-u,C;if(w>33){this.curGbox.css({left:this.resizing.sOL+u});if(f.forceFit===true){C=this.headers[this.resizing.idx+f.nv];
25
- u=f.direction==="ltr"?C.width-u:C.width+u;if(u>33){t.newWidth=w;C.newWidth=u}}else{this.newWidth=f.direction==="ltr"?f.tblwidth+u:f.tblwidth-u;t.newWidth=w}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var t=this.resizing.idx,u=this.headers[t].newWidth||this.headers[t].width;u=parseInt(u,10);this.resizing=false;a("#rs_m"+a.jgrid.jqID(f.id)).css("display","none");f.colModel[t].width=u;this.headers[t].width=u;this.headers[t].el.style.width=u+"px";this.cols[t].style.width=
26
- u+"px";if(this.footers.length>0)this.footers[t].style.width=u+"px";if(f.forceFit===true){u=this.headers[t+f.nv].newWidth||this.headers[t+f.nv].width;this.headers[t+f.nv].width=u;this.headers[t+f.nv].el.style.width=u+"px";this.cols[t+f.nv].style.width=u+"px";if(this.footers.length>0)this.footers[t+f.nv].style.width=u+"px";f.colModel[t+f.nv].width=u}else{f.tblwidth=this.newWidth||f.tblwidth;a("table:first",this.bDiv).css("width",f.tblwidth+"px");a("table:first",this.hDiv).css("width",f.tblwidth+"px");
27
- this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(f.footerrow){a("table:first",this.sDiv).css("width",f.tblwidth+"px");this.sDiv.scrollLeft=this.bDiv.scrollLeft}}a.isFunction(f.resizeStop)&&f.resizeStop.call(this,u,t)}this.curGbox=null;document.onselectstart=function(){return true}},populateVisible:function(){g.timer&&clearTimeout(g.timer);g.timer=null;var t=a(g.bDiv).height();if(t){var u=a("table:first",g.bDiv),w=a("> tbody > tr:gt(0):visible:first",u).outerHeight()||g.prevRowHeight;if(w){g.prevRowHeight=
28
- w;var C=f.rowNum,E=g.scrollTop=g.bDiv.scrollTop,S=Math.round(u.position().top)-E,H=S+u.height();w=w*C;var X,K,N;if(H<t&&S<=0&&(f.lastpage===undefined||parseInt((H+E+w-1)/w,10)<=f.lastpage)){K=parseInt((t-H+w-1)/w,10);if(H>=0||K<2||f.scroll===true){X=Math.round((H+E)/w)+1;S=-1}else S=1}if(S>0){X=parseInt(E/w,10)+1;K=parseInt((E+t)/w,10)+2-X;N=true}if(K)if(!(f.lastpage&&X>f.lastpage||f.lastpage==1))if(g.hDiv.loading)g.timer=setTimeout(g.populateVisible,f.scrollTimeout);else{f.page=X;if(N){g.selectionPreserver(u[0]);
29
- g.emptyRows(g.bDiv,false,false)}g.populate(K)}}}},scrollGrid:function(){if(f.scroll){var t=g.bDiv.scrollTop;if(g.scrollTop===undefined)g.scrollTop=0;if(t!=g.scrollTop){g.scrollTop=t;g.timer&&clearTimeout(g.timer);g.timer=setTimeout(g.populateVisible,f.scrollTimeout)}}g.hDiv.scrollLeft=g.bDiv.scrollLeft;if(f.footerrow)g.sDiv.scrollLeft=g.bDiv.scrollLeft},selectionPreserver:function(t){var u=t.p,w=u.selrow,C=u.selarrrow?a.makeArray(u.selarrrow):null,E=t.grid.bDiv.scrollLeft,S=u.gridComplete;u.gridComplete=
30
- function(){u.selrow=null;u.selarrrow=[];if(u.multiselect&&C&&C.length>0)for(var H=0;H<C.length;H++)C[H]!=w&&a(t).jqGrid("setSelection",C[H],false);w&&a(t).jqGrid("setSelection",w,false);t.grid.bDiv.scrollLeft=E;u.gridComplete=S;u.gridComplete&&S()}}};if(this.tagName!="TABLE")alert("Element is not a table");else{a(this).empty().attr("tabindex","1");this.p=f;var j,h,d;if(this.p.colNames.length===0)for(j=0;j<this.p.colModel.length;j++)this.p.colNames[j]=this.p.colModel[j].label||this.p.colModel[j].name;
31
- if(this.p.colNames.length!==this.p.colModel.length)alert(a.jgrid.errors.model);else{var n=a("<div class='ui-jqgrid-view'></div>"),k,o=a.browser.msie?true:false,m=a.browser.safari?true:false;d=this;d.p.direction=a.trim(d.p.direction.toLowerCase());if(a.inArray(d.p.direction,["ltr","rtl"])==-1)d.p.direction="ltr";h=d.p.direction;a(n).insertBefore(this);a(this).appendTo(n).removeClass("scroll");var l=a("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");a(l).insertBefore(n).attr({id:"gbox_"+
32
- this.id,dir:h});a(n).appendTo(l).attr("id","gview_"+this.id);k=o&&a.browser.version<=6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"";a("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").append(k).insertBefore(n);a("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(n);a(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid",
33
- "aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var q=function(t,u){t=parseInt(t,10);return isNaN(t)?u?u:0:t},s=function(t,u,w,C,E,S){var H=d.p.colModel[t],X=H.align,K='style="',N=H.classes,Q=H.name,L=[];if(X)K+="text-align:"+X+";";if(H.hidden===true)K+="display:none;";if(u===0)K+="width: "+g.headers[t].width+"px;";else if(H.cellattr&&a.isFunction(H.cellattr))if((t=H.cellattr.call(d,E,w,C,H,S))&&typeof t==="string"){t=t.replace(/style/i,"style").replace(/title/i,"title");
34
- if(t.indexOf("title")>-1)H.title=false;if(t.indexOf("class")>-1)N=undefined;L=t.split("style");if(L.length===2){L[1]=a.trim(L[1].replace("=",""));if(L[1].indexOf("'")===0||L[1].indexOf('"')===0)L[1]=L[1].substring(1);K+=L[1].replace(/'/gi,'"')}else K+='"'}if(!L.length){L[0]="";K+='"'}K+=(N!==undefined?' class="'+N+'"':"")+(H.title&&w?' title="'+a.jgrid.stripHtml(w)+'"':"");K+=' aria-describedby="'+d.p.id+"_"+Q+'"';return K+L[0]},p=function(t){return t===undefined||t===null||t===""?"&#160;":d.p.autoencode?
35
- a.jgrid.htmlEncode(t):t+""},r=function(t,u,w,C,E){var S=d.p.colModel[w];if(typeof S.formatter!=="undefined"){t={rowId:t,colModel:S,gid:d.p.id,pos:w};u=a.isFunction(S.formatter)?S.formatter.call(d,u,t,C,E):a.fmatter?a.fn.fmatter(S.formatter,u,t,C,E):p(u)}else u=p(u);return u},v=function(t,u,w,C,E){u=r(t,u,w,E,"add");return'<td role="gridcell" '+s(w,C,u,E,t,true)+">"+u+"</td>"},y=function(t,u,w){var C='<input role="checkbox" type="checkbox" id="jqg_'+d.p.id+"_"+t+'" class="cbox" name="jqg_'+d.p.id+
36
- "_"+t+'"/>';return'<td role="gridcell" '+s(u,w,"",null,t,true)+">"+C+"</td>"},D=function(t,u,w,C){w=(parseInt(w,10)-1)*parseInt(C,10)+1+u;return'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+s(t,u,w,null,u,true)+">"+w+"</td>"},G=function(t){var u,w=[],C=0,E;for(E=0;E<d.p.colModel.length;E++){u=d.p.colModel[E];if(u.name!=="cb"&&u.name!=="subgrid"&&u.name!=="rn"){w[C]=t=="local"?u.name:t=="xml"?u.xmlmap||u.name:u.jsonmap||u.name;C++}}return w},x=function(t){var u=d.p.remapColumns;if(!u||
37
- !u.length)u=a.map(d.p.colModel,function(w,C){return C});if(t)u=a.map(u,function(w){return w<t?null:w-t});return u},B=function(t,u,w){if(d.p.deepempty)a("#"+a.jgrid.jqID(d.p.id)+" tbody:first tr:gt(0)").remove();else{var C=a("#"+a.jgrid.jqID(d.p.id)+" tbody:first tr:first")[0];a("#"+a.jgrid.jqID(d.p.id)+" tbody:first").empty().append(C)}if(u&&d.p.scroll){a(">div:first",t).css({height:"auto"}).children("div:first").css({height:0,display:"none"});t.scrollTop=0}if(w===true){d.p.data=[];d.p._index={}}},
38
- A=function(){var t=d.p.data.length,u,w,C;u=d.p.rownumbers===true?1:0;w=d.p.multiselect===true?1:0;C=d.p.subGrid===true?1:0;u=d.p.keyIndex===false||d.p.loadonce===true?d.p.localReader.id:d.p.colModel[d.p.keyIndex+w+C+u].name;for(w=0;w<t;w++){C=a.jgrid.getAccessor(d.p.data[w],u);d.p._index[C]=w}},z=function(t,u,w,C,E){var S=new Date,H=d.p.datatype!="local"&&d.p.loadonce||d.p.datatype=="xmlstring",X=d.p.datatype=="local"?"local":"xml";if(H){d.p.data=[];d.p._index={};d.p.localReader.id="_id_"}d.p.reccount=
39
- 0;if(a.isXMLDoc(t)){if(d.p.treeANode===-1&&!d.p.scroll){B(u,false,true);w=1}else w=w>1?w:1;var K,N,Q=0,L,Y=0,na=0,ga=0,fa,ha=[],qa,ea={},J,V,aa=[],Aa=d.p.altRows===true?" "+d.p.altclass:"";d.p.xmlReader.repeatitems||(ha=G(X));fa=d.p.keyIndex===false?d.p.xmlReader.id:d.p.keyIndex;if(ha.length>0&&!isNaN(fa)){if(d.p.remapColumns&&d.p.remapColumns.length)fa=a.inArray(fa,d.p.remapColumns);fa=ha[fa]}X=(fa+"").indexOf("[")===-1?ha.length?function(za,va){return a(fa,za).text()||va}:function(za,va){return a(d.p.xmlReader.cell,
40
- za).eq(fa).text()||va}:function(za,va){return za.getAttribute(fa.replace(/[\[\]]/g,""))||va};d.p.userData={};a(d.p.xmlReader.page,t).each(function(){d.p.page=this.textContent||this.text||0});a(d.p.xmlReader.total,t).each(function(){d.p.lastpage=this.textContent||this.text;if(d.p.lastpage===undefined)d.p.lastpage=1});a(d.p.xmlReader.records,t).each(function(){d.p.records=this.textContent||this.text||0});a(d.p.xmlReader.userdata,t).each(function(){d.p.userData[this.getAttribute("name")]=this.textContent||
41
- this.text});(t=a(d.p.xmlReader.root+" "+d.p.xmlReader.row,t))||(t=[]);var pa=t.length,ra=0,Ba={},xa;if(t&&pa){xa=parseInt(d.p.rowNum,10);var Fa=d.p.scroll?(parseInt(d.p.page,10)-1)*xa+1:1;if(E)xa*=E+1;E=a.isFunction(d.p.afterInsertRow);var Ea="";if(d.p.grouping&&d.p.groupingView.groupCollapse===true)Ea=' style="display:none;"';for(;ra<pa;){J=t[ra];V=X(J,Fa+ra);K=w===0?0:w+1;K=(K+ra)%2==1?Aa:"";aa.push("<tr"+Ea+' id="'+V+'" tabindex="-1" role="row" class ="ui-widget-content jqgrow ui-row-'+d.p.direction+
42
- ""+K+'">');if(d.p.rownumbers===true){aa.push(D(0,ra,d.p.page,d.p.rowNum));ga=1}if(d.p.multiselect===true){aa.push(y(V,ga,ra));Y=1}if(d.p.subGrid===true){aa.push(a(d).jqGrid("addSubGridCell",Y+ga,ra+w));na=1}if(d.p.xmlReader.repeatitems){qa||(qa=x(Y+na+ga));var Ja=a(d.p.xmlReader.cell,J);a.each(qa,function(za){var va=Ja[this];if(!va)return false;L=va.textContent||va.text;ea[d.p.colModel[za+Y+na+ga].name]=L;aa.push(v(V,L,za+Y+na+ga,ra+w,J))})}else for(K=0;K<ha.length;K++){L=a(ha[K],J).text();ea[d.p.colModel[K+
43
- Y+na+ga].name]=L;aa.push(v(V,L,K+Y+na+ga,ra+w,J))}aa.push("</tr>");if(d.p.grouping){K=d.p.groupingView.groupField.length;for(var Ha=[],Ia=0;Ia<K;Ia++)Ha.push(ea[d.p.groupingView.groupField[Ia]]);Ba=a(d).jqGrid("groupingPrepare",aa,Ha,Ba,ea);aa=[]}if(H||d.p.treeGrid===true){ea._id_=V;d.p.data.push(ea);d.p._index[V]=d.p.data.length-1}if(d.p.gridview===false){a("tbody:first",u).append(aa.join(""));E&&d.p.afterInsertRow.call(d,V,ea,J);aa=[]}ea={};Q++;ra++;if(Q==xa)break}}if(d.p.gridview===true){N=d.p.treeANode>
44
- -1?d.p.treeANode:0;if(d.p.grouping){a(d).jqGrid("groupingRender",Ba,d.p.colModel.length);Ba=null}else d.p.treeGrid===true&&N>0?a(d.rows[N]).after(aa.join("")):a("tbody:first",u).append(aa.join(""))}if(d.p.subGrid===true)try{a(d).jqGrid("addSubGrid",Y+ga)}catch(La){}d.p.totaltime=new Date-S;if(Q>0)if(d.p.records===0)d.p.records=pa;aa=null;if(d.p.treeGrid===true)try{a(d).jqGrid("setTreeNode",N+1,Q+N+1)}catch(Ma){}if(!d.p.treeGrid&&!d.p.scroll)d.grid.bDiv.scrollTop=0;d.p.reccount=Q;d.p.treeANode=-1;
45
- d.p.userDataOnFooter&&a(d).jqGrid("footerData","set",d.p.userData,true);if(H){d.p.records=pa;d.p.lastpage=Math.ceil(pa/xa)}C||d.updatepager(false,true);if(H)for(;Q<pa;){J=t[Q];V=X(J,Q);if(d.p.xmlReader.repeatitems){qa||(qa=x(Y+na+ga));var Ka=a(d.p.xmlReader.cell,J);a.each(qa,function(za){var va=Ka[this];if(!va)return false;L=va.textContent||va.text;ea[d.p.colModel[za+Y+na+ga].name]=L})}else for(K=0;K<ha.length;K++){L=a(ha[K],J).text();ea[d.p.colModel[K+Y+na+ga].name]=L}ea._id_=V;d.p.data.push(ea);
46
- d.p._index[V]=d.p.data.length-1;ea={};Q++}}},M=function(t,u,w,C,E){var S=new Date;if(t){if(d.p.treeANode===-1&&!d.p.scroll){B(u,false,true);w=1}else w=w>1?w:1;var H,X=d.p.datatype!="local"&&d.p.loadonce||d.p.datatype=="jsonstring";if(X){d.p.data=[];d.p._index={};d.p.localReader.id="_id_"}d.p.reccount=0;if(d.p.datatype=="local"){u=d.p.localReader;H="local"}else{u=d.p.jsonReader;H="json"}var K=0,N,Q,L=[],Y,na=0,ga=0,fa=0,ha,qa,ea={},J,V,aa=[],Aa=d.p.altRows===true?" "+d.p.altclass:"";d.p.page=a.jgrid.getAccessor(t,
47
- u.page)||0;ha=a.jgrid.getAccessor(t,u.total);d.p.lastpage=ha===undefined?1:ha;d.p.records=a.jgrid.getAccessor(t,u.records)||0;d.p.userData=a.jgrid.getAccessor(t,u.userdata)||{};u.repeatitems||(Y=L=G(H));H=d.p.keyIndex===false?u.id:d.p.keyIndex;if(L.length>0&&!isNaN(H)){if(d.p.remapColumns&&d.p.remapColumns.length)H=a.inArray(H,d.p.remapColumns);H=L[H]}(qa=a.jgrid.getAccessor(t,u.root))||(qa=[]);ha=qa.length;t=0;var pa=parseInt(d.p.rowNum,10),ra=d.p.scroll?(parseInt(d.p.page,10)-1)*pa+1:1;if(E)pa*=
48
- E+1;var Ba=a.isFunction(d.p.afterInsertRow),xa={},Fa="";if(d.p.grouping&&d.p.groupingView.groupCollapse===true)Fa=' style="display:none;"';for(;t<ha;){E=qa[t];V=a.jgrid.getAccessor(E,H);if(V===undefined){V=ra+t;if(L.length===0)if(u.cell)V=a.jgrid.getAccessor(E,u.cell)[H]||V}N=w===1?0:w;N=(N+t)%2==1?Aa:"";aa.push("<tr"+Fa+' id="'+V+'" tabindex="-1" role="row" class= "ui-widget-content jqgrow ui-row-'+d.p.direction+""+N+'">');if(d.p.rownumbers===true){aa.push(D(0,t,d.p.page,d.p.rowNum));fa=1}if(d.p.multiselect){aa.push(y(V,
49
- fa,t));na=1}if(d.p.subGrid){aa.push(a(d).jqGrid("addSubGridCell",na+fa,t+w));ga=1}if(u.repeatitems){if(u.cell)E=a.jgrid.getAccessor(E,u.cell);Y||(Y=x(na+ga+fa))}for(Q=0;Q<Y.length;Q++){N=a.jgrid.getAccessor(E,Y[Q]);aa.push(v(V,N,Q+na+ga+fa,t+w,E));ea[d.p.colModel[Q+na+ga+fa].name]=N}aa.push("</tr>");if(d.p.grouping){N=d.p.groupingView.groupField.length;Q=[];for(var Ea=0;Ea<N;Ea++)Q.push(ea[d.p.groupingView.groupField[Ea]]);xa=a(d).jqGrid("groupingPrepare",aa,Q,xa,ea);aa=[]}if(X||d.p.treeGrid===true){ea._id_=
50
- V;d.p.data.push(ea);d.p._index[V]=d.p.data.length-1}if(d.p.gridview===false){a("#"+a.jgrid.jqID(d.p.id)+" tbody:first").append(aa.join(""));Ba&&d.p.afterInsertRow.call(d,V,ea,E);aa=[]}ea={};K++;t++;if(K==pa)break}if(d.p.gridview===true){J=d.p.treeANode>-1?d.p.treeANode:0;if(d.p.grouping)a(d).jqGrid("groupingRender",xa,d.p.colModel.length);else d.p.treeGrid===true&&J>0?a(d.rows[J]).after(aa.join("")):a("#"+a.jgrid.jqID(d.p.id)+" tbody:first").append(aa.join(""))}if(d.p.subGrid===true)try{a(d).jqGrid("addSubGrid",
51
- na+fa)}catch(Ja){}d.p.totaltime=new Date-S;if(K>0)if(d.p.records===0)d.p.records=ha;if(d.p.treeGrid===true)try{a(d).jqGrid("setTreeNode",J+1,K+J+1)}catch(Ha){}if(!d.p.treeGrid&&!d.p.scroll)d.grid.bDiv.scrollTop=0;d.p.reccount=K;d.p.treeANode=-1;d.p.userDataOnFooter&&a(d).jqGrid("footerData","set",d.p.userData,true);if(X){d.p.records=ha;d.p.lastpage=Math.ceil(ha/pa)}C||d.updatepager(false,true);if(X)for(;K<ha&&qa[K];){E=qa[K];V=a.jgrid.getAccessor(E,H);if(V===undefined){V=ra+K;if(L.length===0)if(u.cell)V=
52
- a.jgrid.getAccessor(E,u.cell)[H]||V}if(E){if(u.repeatitems){if(u.cell)E=a.jgrid.getAccessor(E,u.cell);Y||(Y=x(na+ga+fa))}for(Q=0;Q<Y.length;Q++){N=a.jgrid.getAccessor(E,Y[Q]);ea[d.p.colModel[Q+na+ga+fa].name]=N}ea._id_=V;d.p.data.push(ea);d.p._index[V]=d.p.data.length-1;ea={}}K++}}},R=function(){function t(J){var V=0,aa,Aa,pa;if(J.groups!==undefined)for(aa=0;aa<J.groups.length;aa++){try{t(J.groups[aa])}catch(ra){alert(ra)}V++}if(J.rules!==undefined){if(V>0){var Ba=L.select();L=a.jgrid.from(Ba)}try{for(aa=
53
- 0;aa<J.rules.length;aa++){pa=J.rules[aa];Aa=J.groupOp.toString().toUpperCase();if(Q[pa.op]&&pa.field){if(V>0&&Aa&&Aa==="OR")L=L.or();L=Q[pa.op](L,Aa)(pa.field,pa.data,C[pa.field])}V++}}catch(xa){alert(xa)}}}var u,w=false,C={},E=[],S=[],H,X,K;if(a.isArray(d.p.data)){var N=d.p.grouping?d.p.groupingView:false;a.each(d.p.colModel,function(){X=this.sorttype||"text";if(X=="date"||X=="datetime"){if(this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"){H=this.formatoptions&&this.formatoptions.srcformat?
54
- this.formatoptions.srcformat:a.jgrid.formatter.date.srcformat;K=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:a.jgrid.formatter.date.newformat}else H=K=this.datefmt||"Y-m-d";C[this.name]={stype:X,srcfmt:H,newfmt:K}}else C[this.name]={stype:X,srcfmt:"",newfmt:""};if(d.p.grouping&&this.name==N.groupField[0]){var J=this.name;if(typeof this.index!="undefined")J=this.index;E[0]=C[J];S.push(J)}if(!w&&(this.index==d.p.sortname||this.name==d.p.sortname)){u=this.name;w=true}});
55
- if(d.p.treeGrid)a(d).jqGrid("SortTree",u,d.p.sortorder,C[u].stype,C[u].srcfmt);else{var Q={eq:function(J){return J.equals},ne:function(J){return J.notEquals},lt:function(J){return J.less},le:function(J){return J.lessOrEquals},gt:function(J){return J.greater},ge:function(J){return J.greaterOrEquals},cn:function(J){return J.contains},nc:function(J,V){return V==="OR"?J.orNot().contains:J.andNot().contains},bw:function(J){return J.startsWith},bn:function(J,V){return V==="OR"?J.orNot().startsWith:J.andNot().startsWith},
56
- en:function(J,V){return V==="OR"?J.orNot().endsWith:J.andNot().endsWith},ew:function(J){return J.endsWith},ni:function(J,V){return V==="OR"?J.orNot().equals:J.andNot().equals},"in":function(J){return J.equals},nu:function(J){return J.isNull},nn:function(J,V){return V==="OR"?J.orNot().isNull:J.andNot().isNull}},L=a.jgrid.from(d.p.data);if(d.p.ignoreCase)L=L.ignoreCase();if(d.p.search===true){var Y=d.p.postData.filters;if(Y){if(typeof Y=="string")Y=a.jgrid.parse(Y);t(Y)}else try{L=Q[d.p.postData.searchOper](L)(d.p.postData.searchField,
57
- d.p.postData.searchString,C[d.p.postData.searchField])}catch(na){}}if(d.p.grouping){L.orderBy(S,N.groupOrder[0],E[0].stype,E[0].srcfmt);N.groupDataSorted=true}if(u&&d.p.sortorder&&w)d.p.sortorder.toUpperCase()=="DESC"?L.orderBy(d.p.sortname,"d",C[u].stype,C[u].srcfmt):L.orderBy(d.p.sortname,"a",C[u].stype,C[u].srcfmt);Y=L.select();var ga=parseInt(d.p.rowNum,10),fa=Y.length,ha=parseInt(d.p.page,10),qa=Math.ceil(fa/ga),ea={};Y=Y.slice((ha-1)*ga,ha*ga);C=L=null;ea[d.p.localReader.total]=qa;ea[d.p.localReader.page]=
58
- ha;ea[d.p.localReader.records]=fa;ea[d.p.localReader.root]=Y;Y=null;return ea}}},U=function(){d.grid.hDiv.loading=true;if(!d.p.hiddengrid)switch(d.p.loadui){case "enable":a("#load_"+a.jgrid.jqID(d.p.id)).show();break;case "block":a("#lui_"+a.jgrid.jqID(d.p.id)).show();a("#load_"+a.jgrid.jqID(d.p.id)).show()}},ja=function(){d.grid.hDiv.loading=false;switch(d.p.loadui){case "enable":a("#load_"+a.jgrid.jqID(d.p.id)).hide();break;case "block":a("#lui_"+a.jgrid.jqID(d.p.id)).hide();a("#load_"+a.jgrid.jqID(d.p.id)).hide()}},
59
- $=function(t){if(!d.grid.hDiv.loading){var u=d.p.scroll&&t===false,w={},C,E=d.p.prmNames;if(d.p.page<=0)d.p.page=1;if(E.search!==null)w[E.search]=d.p.search;if(E.nd!==null)w[E.nd]=(new Date).getTime();if(E.rows!==null)w[E.rows]=d.p.rowNum;if(E.page!==null)w[E.page]=d.p.page;if(E.sort!==null)w[E.sort]=d.p.sortname;if(E.order!==null)w[E.order]=d.p.sortorder;if(d.p.rowTotal!==null&&E.totalrows!==null)w[E.totalrows]=d.p.rowTotal;var S=d.p.loadComplete,H=a.isFunction(S);H||(S=null);var X=0;t=t||1;if(t>
60
- 1)if(E.npage!==null){w[E.npage]=t;X=t-1;t=1}else S=function(N){d.p.page++;d.grid.hDiv.loading=false;H&&d.p.loadComplete.call(d,N);$(t-1)};else E.npage!==null&&delete d.p.postData[E.npage];if(d.p.grouping){a(d).jqGrid("groupingSetup");if(d.p.groupingView.groupDataSorted===true)w[E.sort]=d.p.groupingView.groupField[0]+" "+d.p.groupingView.groupOrder[0]+", "+w[E.sort]}a.extend(d.p.postData,w);var K=!d.p.scroll?1:d.rows.length-1;if(a.isFunction(d.p.datatype))d.p.datatype.call(d,d.p.postData,"load_"+d.p.id);
61
- else{a.isFunction(d.p.beforeRequest)&&d.p.beforeRequest.call(d);C=d.p.datatype.toLowerCase();switch(C){case "json":case "jsonp":case "xml":case "script":a.ajax(a.extend({url:d.p.url,type:d.p.mtype,dataType:C,data:a.isFunction(d.p.serializeGridData)?d.p.serializeGridData.call(d,d.p.postData):d.p.postData,success:function(N){C==="xml"?z(N,d.grid.bDiv,K,t>1,X):M(N,d.grid.bDiv,K,t>1,X);S&&S.call(d,N);u&&d.grid.populateVisible();if(d.p.loadonce||d.p.treeGrid)d.p.datatype="local";ja()},error:function(N,
62
- Q,L){a.isFunction(d.p.loadError)&&d.p.loadError.call(d,N,Q,L);ja()},beforeSend:function(N){U();a.isFunction(d.p.loadBeforeSend)&&d.p.loadBeforeSend.call(d,N)}},a.jgrid.ajaxOptions,d.p.ajaxGridOptions));break;case "xmlstring":U();w=a.jgrid.stringToDoc(d.p.datastr);z(w,d.grid.bDiv);H&&d.p.loadComplete.call(d,w);d.p.datatype="local";d.p.datastr=null;ja();break;case "jsonstring":U();w=typeof d.p.datastr=="string"?a.jgrid.parse(d.p.datastr):d.p.datastr;M(w,d.grid.bDiv);H&&d.p.loadComplete.call(d,w);d.p.datatype=
63
- "local";d.p.datastr=null;ja();break;case "local":case "clientside":U();d.p.datatype="local";w=R();M(w,d.grid.bDiv,K,t>1,X);S&&S.call(d,w);u&&d.grid.populateVisible();ja()}}}};k=function(t,u){var w="",C="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",E="",S,H,X,K,N=function(Q){var L;if(a.isFunction(d.p.onPaging))L=d.p.onPaging.call(d,Q);d.p.selrow=null;if(d.p.multiselect){d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",
64
- false)}d.p.savedRow=[];if(L=="stop")return false;return true};t=t.substr(1);S="pg_"+t;H=t+"_left";X=t+"_center";K=t+"_right";a("#"+a.jgrid.jqID(t)).append("<div id='"+S+"' 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='"+H+"' align='left'></td><td id='"+X+"' align='center' style='white-space:pre;'></td><td id='"+K+"' align='right'></td></tr></tbody></table></div>").attr("dir",
65
- "ltr");if(d.p.rowList.length>0){E="<td dir='"+h+"'>";E+="<select class='ui-pg-selbox' role='listbox'>";for(H=0;H<d.p.rowList.length;H++)E+='<option role="option" value="'+d.p.rowList[H]+'"'+(d.p.rowNum==d.p.rowList[H]?' selected="selected"':"")+">"+d.p.rowList[H]+"</option>";E+="</select></td>"}if(h=="rtl")C+=E;if(d.p.pginput===true)w="<td dir='"+h+"'>"+a.jgrid.format(d.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1'></span>")+
66
- "</td>";if(d.p.pgbuttons===true){H=["first"+u,"prev"+u,"next"+u,"last"+u];h=="rtl"&&H.reverse();C+="<td id='"+H[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";C+="<td id='"+H[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";C+=w!==""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+w+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":
67
- "";C+="<td id='"+H[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";C+="<td id='"+H[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else if(w!=="")C+=w;if(h=="ltr")C+=E;C+="</tr></tbody></table>";d.p.viewrecords===true&&a("td#"+t+"_"+d.p.recordpos,"#"+S).append("<div dir='"+h+"' style='text-align:"+d.p.recordpos+"' class='ui-paging-info'></div>");a("td#"+t+"_"+d.p.pagerpos,"#"+S).append(C);E=a(".ui-jqgrid").css("font-size")||
68
- "11px";a(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+E+";visibility:hidden;' ></div>");C=a(C).clone().appendTo("#testpg").width();a("#testpg").remove();if(C>0){if(w!=="")C+=50;a("td#"+t+"_"+d.p.pagerpos,"#"+S).width(C)}d.p._nvtd=[];d.p._nvtd[0]=C?Math.floor((d.p.width-C)/2):Math.floor(d.p.width/3);d.p._nvtd[1]=0;C=null;a(".ui-pg-selbox","#"+S).bind("change",function(){d.p.page=Math.round(d.p.rowNum*(d.p.page-1)/this.value-0.5)+1;d.p.rowNum=
69
- this.value;if(u)a(".ui-pg-selbox",d.p.pager).val(this.value);else d.p.toppager&&a(".ui-pg-selbox",d.p.toppager).val(this.value);if(!N("records"))return false;$();return false});if(d.p.pgbuttons===true){a(".ui-pg-button","#"+S).hover(function(){if(a(this).hasClass("ui-state-disabled"))this.style.cursor="default";else{a(this).addClass("ui-state-hover");this.style.cursor="pointer"}},function(){if(!a(this).hasClass("ui-state-disabled")){a(this).removeClass("ui-state-hover");this.style.cursor="default"}});
70
- a("#first"+u+", #prev"+u+", #next"+u+", #last"+u,"#"+t).click(function(){var Q=q(d.p.page,1),L=q(d.p.lastpage,1),Y=false,na=true,ga=true,fa=true,ha=true;if(L===0||L===1)ha=fa=ga=na=false;else if(L>1&&Q>=1)if(Q===1)ga=na=false;else{if(!(Q>1&&Q<L))if(Q===L)ha=fa=false}else if(L>1&&Q===0){ha=fa=false;Q=L-1}if(this.id==="first"+u&&na){d.p.page=1;Y=true}if(this.id==="prev"+u&&ga){d.p.page=Q-1;Y=true}if(this.id==="next"+u&&fa){d.p.page=Q+1;Y=true}if(this.id==="last"+u&&ha){d.p.page=L;Y=true}if(Y){if(!N(this.id))return false;
71
- $()}return false})}d.p.pginput===true&&a("input.ui-pg-input","#"+S).keypress(function(Q){if((Q.charCode?Q.charCode:Q.keyCode?Q.keyCode:0)==13){d.p.page=a(this).val()>0?a(this).val():d.p.page;if(!N("user"))return false;$();return false}return this})};var ia=function(t,u,w,C){if(d.p.colModel[u].sortable)if(!(d.p.savedRow.length>0)){if(!w){if(d.p.lastsort==u)if(d.p.sortorder=="asc")d.p.sortorder="desc";else{if(d.p.sortorder=="desc")d.p.sortorder="asc"}else d.p.sortorder=d.p.colModel[u].firstsortorder||
72
- "asc";d.p.page=1}if(C)if(d.p.lastsort==u&&d.p.sortorder==C&&!w)return;else d.p.sortorder=C;w=a("thead:first",d.grid.hDiv).get(0);a("tr th:eq("+d.p.lastsort+") span.ui-grid-ico-sort",w).addClass("ui-state-disabled");a("tr th:eq("+d.p.lastsort+")",w).attr("aria-selected","false");a("tr th:eq("+u+") span.ui-icon-"+d.p.sortorder,w).removeClass("ui-state-disabled");a("tr th:eq("+u+")",w).attr("aria-selected","true");if(!d.p.viewsortcols[0])if(d.p.lastsort!=u){a("tr th:eq("+d.p.lastsort+") span.s-ico",
73
- w).hide();a("tr th:eq("+u+") span.s-ico",w).show()}t=t.substring(5);d.p.sortname=d.p.colModel[u].index||t;w=d.p.sortorder;if(a.isFunction(d.p.onSortCol))if(d.p.onSortCol.call(d,t,u,w)=="stop"){d.p.lastsort=u;return}if(d.p.datatype=="local")d.p.deselectAfterSort&&a(d).jqGrid("resetSelection");else{d.p.selrow=null;d.p.multiselect&&a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false);d.p.selarrrow=[];d.p.savedRow=[]}if(d.p.scroll){w=d.grid.bDiv.scrollLeft;B(d.grid.bDiv,true,false);d.grid.hDiv.scrollLeft=
74
- w}d.p.subGrid&&d.p.datatype=="local"&&a("td.sgexpanded","#"+a.jgrid.jqID(d.p.id)).each(function(){a(this).trigger("click")});$();d.p.lastsort=u;if(d.p.sortname!=t&&u)d.p.lastsort=u}},sa=function(t){var u,w={},C=m?0:d.p.cellLayout;for(u=w[0]=w[1]=w[2]=0;u<=t;u++)if(d.p.colModel[u].hidden===false)w[0]+=d.p.colModel[u].width+C;if(d.p.direction=="rtl")w[0]=d.p.width-w[0];w[0]-=d.grid.bDiv.scrollLeft;if(a(d.grid.cDiv).is(":visible"))w[1]+=a(d.grid.cDiv).height()+parseInt(a(d.grid.cDiv).css("padding-top"),
1
+ (function(a){a.jgrid=a.jgrid||{};a.extend(a.jgrid,{htmlDecode:function(b){if(b&&(b=="&nbsp;"||b=="&#160;"||b.length==1&&b.charCodeAt(0)==160))return"";return!b?b:String(b).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(b){return!b?b:String(b).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(b){var e=a.makeArray(arguments).slice(1);if(b===undefined)b="";return b.replace(/\{(\d+)\}/g,
2
+ function(c,f){return e[f]})},getCellIndex:function(b){b=a(b);if(b.is("tr"))return-1;b=(!b.is("td")&&!b.is("th")?b.closest("td,th"):b)[0];if(a.browser.msie)return a.inArray(b,b.parentNode.cells);return b.cellIndex},stripHtml:function(b){b+="";var e=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(b)return(b=b.replace(e,""))&&b!=="&nbsp;"&&b!=="&#160;"?b.replace(/\"/g,"'"):"";else return b},stringToDoc:function(b){var e;if(typeof b!=="string")return b;try{e=(new DOMParser).parseFromString(b,"text/xml")}catch(c){e=
3
+ new ActiveXObject("Microsoft.XMLDOM");e.async=false;e.loadXML(b)}return e&&e.documentElement&&e.documentElement.tagName!="parsererror"?e:null},parse:function(b){b=b;if(b.substr(0,9)=="while(1);")b=b.substr(9);if(b.substr(0,2)=="/*")b=b.substr(2,b.length-4);b||(b="{}");return a.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(b):eval("("+b+")")},parseDate:function(b,e){var c={m:1,d:1,y:1970,h:0,i:0,s:0},f,g,j;f=/[\\\/:_;.,\t\T\s-]/;if(e&&e!==null&&e!==undefined){e=
4
+ a.trim(e);e=e.split(f);b=b.split(f);var h=a.jgrid.formatter.date.monthNames,d=a.jgrid.formatter.date.AmPm,o=function(k,n){if(k===0){if(n==12)n=0}else if(n!=12)n+=12;return n};f=0;for(g=b.length;f<g;f++){if(b[f]=="M"){j=a.inArray(e[f],h);if(j!==-1&&j<12)e[f]=j+1}if(b[f]=="F"){j=a.inArray(e[f],h);if(j!==-1&&j>11)e[f]=j+1-12}if(b[f]=="a"){j=a.inArray(e[f],d);if(j!==-1&&j<2&&e[f]==d[j]){e[f]=j;c.h=o(e[f],c.h)}}if(b[f]=="A"){j=a.inArray(e[f],d);if(j!==-1&&j>1&&e[f]==d[j]){e[f]=j-2;c.h=o(e[f],c.h)}}if(e[f]!==
5
+ undefined)c[b[f].toLowerCase()]=parseInt(e[f],10)}c.m=parseInt(c.m,10)-1;f=c.y;if(f>=70&&f<=99)c.y=1900+c.y;else if(f>=0&&f<=69)c.y=2E3+c.y}return new Date(c.y,c.m,c.d,c.h,c.i,c.s,0)},jqID:function(b){b+="";return b.replace(/([\.\:\[\]])/g,"\\$1")},guid:1,uidPref:"jqg",randId:function(b){return(b?b:a.jgrid.uidPref)+a.jgrid.guid++},getAccessor:function(b,e){var c,f,g=[],j;if(typeof e==="function")return e(b);c=b[e];if(c===undefined)try{if(typeof e==="string")g=e.split(".");if(j=g.length)for(c=b;c&&
6
+ j--;){f=g.shift();c=c[f]}}catch(h){}return c},ajaxOptions:{},from:function(b){return new function(e,c){if(typeof e=="string")e=a.data(e);var f=this,g=e,j=true,h=false,d=c,o=/[\$,%]/g,k=null,n=null,m=false,l="",q=[],s=true;if(typeof e=="object"&&e.push){if(e.length>0)s=typeof e[0]!="object"?false:true}else throw"data provides is not an array";this._hasData=function(){return g===null?false:g.length===0?false:true};this._getStr=function(p){var r=[];h&&r.push("jQuery.trim(");r.push("String("+p+")");h&&
7
+ r.push(")");j||r.push(".toLowerCase()");return r.join("")};this._strComp=function(p){return typeof p=="string"?".toString()":""};this._group=function(p,r){return{field:p.toString(),unique:r,items:[]}};this._toStr=function(p){if(h)p=a.trim(p);j||(p=p.toLowerCase());return p=p.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"')};this._funcLoop=function(p){var r=[];a.each(g,function(t,y){r.push(p(y))});return r};this._append=function(p){if(d===null)d="";else d+=l===""?" && ":l;if(m)d+="!";d+="("+p+
8
+ ")";m=false;l=""};this._setCommand=function(p,r){k=p;n=r};this._resetNegate=function(){m=false};this._repeatCommand=function(p,r){if(k===null)return f;if(p!==null&&r!==null)return k(p,r);if(n===null)return k(p);if(!s)return k(p);return k(n,p)};this._equals=function(p,r){return f._compare(p,r,1)===0};this._compare=function(p,r,t){if(t===undefined)t=1;if(p===undefined)p=null;if(r===undefined)r=null;if(p===null&&r===null)return 0;if(p===null&&r!==null)return 1;if(p!==null&&r===null)return-1;if(!j&&typeof p!==
9
+ "number"&&typeof r!=="number"){p=String(p).toLowerCase();r=String(r).toLowerCase()}if(p<r)return-t;if(p>r)return t;return 0};this._performSort=function(){if(q.length!==0)g=f._doSort(g,0)};this._doSort=function(p,r){var t=q[r].by,y=q[r].dir,B=q[r].type,G=q[r].datefmt;if(r==q.length-1)return f._getOrder(p,t,y,B,G);r++;t=f._getGroup(p,t,y,B,G);y=[];for(B=0;B<t.length;B++){G=f._doSort(t[B].items,r);for(var x=0;x<G.length;x++)y.push(G[x])}return y};this._getOrder=function(p,r,t,y,B){var G=[],x=[],C=t==
10
+ "a"?1:-1,A,z;if(y===undefined)y="text";z=y=="float"||y=="number"||y=="currency"||y=="numeric"?function(Q){Q=parseFloat(String(Q).replace(o,""));return isNaN(Q)?0:Q}:y=="int"||y=="integer"?function(Q){return Q?parseFloat(String(Q).replace(o,"")):0}:y=="date"||y=="datetime"?function(Q){return a.jgrid.parseDate(B,Q).getTime()}:a.isFunction(y)?y:function(Q){Q||(Q="");return a.trim(String(Q).toUpperCase())};a.each(p,function(Q,U){A=r!==""?a.jgrid.getAccessor(U,r):U;if(A===undefined)A="";A=z(A,U);x.push({vSort:A,
11
+ index:Q})});x.sort(function(Q,U){Q=Q.vSort;U=U.vSort;return f._compare(Q,U,C)});y=0;for(var M=p.length;y<M;){t=x[y].index;G.push(p[t]);y++}return G};this._getGroup=function(p,r,t,y,B){var G=[],x=null,C=null,A;a.each(f._getOrder(p,r,t,y,B),function(z,M){A=a.jgrid.getAccessor(M,r);if(A===undefined)A="";if(!f._equals(C,A)){C=A;x!==null&&G.push(x);x=f._group(r,A)}x.items.push(M)});x!==null&&G.push(x);return G};this.ignoreCase=function(){j=false;return f};this.useCase=function(){j=true;return f};this.trim=
12
+ function(){h=true;return f};this.noTrim=function(){h=false;return f};this.execute=function(){var p=d,r=[];if(p===null)return f;a.each(g,function(){eval(p)&&r.push(this)});g=r;return f};this.data=function(){return g};this.select=function(p){f._performSort();if(!f._hasData())return[];f.execute();if(a.isFunction(p)){var r=[];a.each(g,function(t,y){r.push(p(y))});return r}return g};this.hasMatch=function(){if(!f._hasData())return false;f.execute();return g.length>0};this.andNot=function(p,r,t){m=!m;return f.and(p,
13
+ r,t)};this.orNot=function(p,r,t){m=!m;return f.or(p,r,t)};this.not=function(p,r,t){return f.andNot(p,r,t)};this.and=function(p,r,t){l=" && ";if(p===undefined)return f;return f._repeatCommand(p,r,t)};this.or=function(p,r,t){l=" || ";if(p===undefined)return f;return f._repeatCommand(p,r,t)};this.isNot=function(p){m=!m;return f.is(p)};this.is=function(p){f._append("this."+p);f._resetNegate();return f};this._compareValues=function(p,r,t,y,B){var G;G=s?"jQuery.jgrid.getAccessor(this,'"+r+"')":"this";if(t===
14
+ undefined)t=null;var x=t,C=B.stype===undefined?"text":B.stype;if(t!==null)switch(C){case "int":case "integer":x=isNaN(Number(x))||x===""?"0":x;G="parseInt("+G+",10)";x="parseInt("+x+",10)";break;case "float":case "number":case "numeric":x=String(x).replace(o,"");x=isNaN(Number(x))||x===""?"0":x;G="parseFloat("+G+")";x="parseFloat("+x+")";break;case "date":case "datetime":x=String(a.jgrid.parseDate(B.newfmt||"Y-m-d",x).getTime());G='jQuery.jgrid.parseDate("'+B.srcfmt+'",'+G+").getTime()";break;default:G=
15
+ f._getStr(G);x=f._getStr('"'+f._toStr(x)+'"')}f._append(G+" "+y+" "+x);f._setCommand(p,r);f._resetNegate();return f};this.equals=function(p,r,t){return f._compareValues(f.equals,p,r,"==",t)};this.notEquals=function(p,r,t){return f._compareValues(f.equals,p,r,"!==",t)};this.isNull=function(p,r,t){return f._compareValues(f.equals,p,null,"===",t)};this.greater=function(p,r,t){return f._compareValues(f.greater,p,r,">",t)};this.less=function(p,r,t){return f._compareValues(f.less,p,r,"<",t)};this.greaterOrEquals=
16
+ function(p,r,t){return f._compareValues(f.greaterOrEquals,p,r,">=",t)};this.lessOrEquals=function(p,r,t){return f._compareValues(f.lessOrEquals,p,r,"<=",t)};this.startsWith=function(p,r){var t=r===undefined||r===null?p:r;t=h?a.trim(t.toString()).length:t.toString().length;if(s)f._append(f._getStr("jQuery.jgrid.getAccessor(this,'"+p+"')")+".substr(0,"+t+") == "+f._getStr('"'+f._toStr(r)+'"'));else{t=h?a.trim(r.toString()).length:r.toString().length;f._append(f._getStr("this")+".substr(0,"+t+") == "+
17
+ f._getStr('"'+f._toStr(p)+'"'))}f._setCommand(f.startsWith,p);f._resetNegate();return f};this.endsWith=function(p,r){var t=r===undefined||r===null?p:r;t=h?a.trim(t.toString()).length:t.toString().length;s?f._append(f._getStr("jQuery.jgrid.getAccessor(this,'"+p+"')")+".substr("+f._getStr("jQuery.jgrid.getAccessor(this,'"+p+"')")+".length-"+t+","+t+') == "'+f._toStr(r)+'"'):f._append(f._getStr("this")+".substr("+f._getStr("this")+'.length-"'+f._toStr(p)+'".length,"'+f._toStr(p)+'".length) == "'+f._toStr(p)+
18
+ '"');f._setCommand(f.endsWith,p);f._resetNegate();return f};this.contains=function(p,r){s?f._append(f._getStr("jQuery.jgrid.getAccessor(this,'"+p+"')")+'.indexOf("'+f._toStr(r)+'",0) > -1'):f._append(f._getStr("this")+'.indexOf("'+f._toStr(p)+'",0) > -1');f._setCommand(f.contains,p);f._resetNegate();return f};this.groupBy=function(p,r,t,y){if(!f._hasData())return null;return f._getGroup(g,p,r,t,y)};this.orderBy=function(p,r,t,y){r=r===undefined||r===null?"a":a.trim(r.toString().toLowerCase());if(t===
19
+ null||t===undefined)t="text";if(y===null||y===undefined)y="Y-m-d";if(r=="desc"||r=="descending")r="d";if(r=="asc"||r=="ascending")r="a";q.push({by:p,dir:r,type:t,datefmt:y});return f};return f}(b,null)},extend:function(b){a.extend(a.fn.jqGrid,b);this.no_legacy_api||a.fn.extend(b)}});a.fn.jqGrid=function(b){if(typeof b=="string"){var e=a.jgrid.getAccessor(a.fn.jqGrid,b);if(!e)throw"jqGrid - No such method: "+b;var c=a.makeArray(arguments).slice(1);return e.apply(this,c)}return this.each(function(){if(!this.grid){var f=
20
+ a.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,
21
+ 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",
22
+ 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,
23
+ "vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false,headertitles:false,scrollTimeout:40,data:[],_index:{},grouping:false,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:false,sortitems:[],sortnames:[],groupDataSorted:false,summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus",minusicon:"ui-icon-circlesmall-minus"},ignoreCase:false,cmTemplate:{}},a.jgrid.defaults,b||{}),
24
+ g={headers:[],cols:[],footers:[],dragStart:function(u,v,w){this.resizing={idx:u,startX:v.clientX,sOL:w[0]};this.hDiv.style.cursor="col-resize";this.curGbox=a("#rs_m"+a.jgrid.jqID(f.id),"#gbox_"+a.jgrid.jqID(f.id));this.curGbox.css({display:"block",left:w[0],top:w[1],height:w[2]});a.isFunction(f.resizeStart)&&f.resizeStart.call(this,v,u);document.onselectstart=function(){return false}},dragMove:function(u){if(this.resizing){var v=u.clientX-this.resizing.startX;u=this.headers[this.resizing.idx];var w=
25
+ f.direction==="ltr"?u.width+v:u.width-v,D;if(w>33){this.curGbox.css({left:this.resizing.sOL+v});if(f.forceFit===true){D=this.headers[this.resizing.idx+f.nv];v=f.direction==="ltr"?D.width-v:D.width+v;if(v>33){u.newWidth=w;D.newWidth=v}}else{this.newWidth=f.direction==="ltr"?f.tblwidth+v:f.tblwidth-v;u.newWidth=w}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var u=this.resizing.idx,v=this.headers[u].newWidth||this.headers[u].width;v=parseInt(v,10);this.resizing=false;a("#rs_m"+
26
+ a.jgrid.jqID(f.id)).css("display","none");f.colModel[u].width=v;this.headers[u].width=v;this.headers[u].el.style.width=v+"px";this.cols[u].style.width=v+"px";if(this.footers.length>0)this.footers[u].style.width=v+"px";if(f.forceFit===true){v=this.headers[u+f.nv].newWidth||this.headers[u+f.nv].width;this.headers[u+f.nv].width=v;this.headers[u+f.nv].el.style.width=v+"px";this.cols[u+f.nv].style.width=v+"px";if(this.footers.length>0)this.footers[u+f.nv].style.width=v+"px";f.colModel[u+f.nv].width=v}else{f.tblwidth=
27
+ this.newWidth||f.tblwidth;a("table:first",this.bDiv).css("width",f.tblwidth+"px");a("table:first",this.hDiv).css("width",f.tblwidth+"px");this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(f.footerrow){a("table:first",this.sDiv).css("width",f.tblwidth+"px");this.sDiv.scrollLeft=this.bDiv.scrollLeft}}a.isFunction(f.resizeStop)&&f.resizeStop.call(this,v,u)}this.curGbox=null;document.onselectstart=function(){return true}},populateVisible:function(){g.timer&&clearTimeout(g.timer);g.timer=null;var u=a(g.bDiv).height();
28
+ if(u){var v=a("table:first",g.bDiv),w=a("> tbody > tr:gt(0):visible:first",v).outerHeight()||g.prevRowHeight;if(w){g.prevRowHeight=w;var D=f.rowNum,E=g.scrollTop=g.bDiv.scrollTop,S=Math.round(v.position().top)-E,H=S+v.height();w=w*D;var X,K,N;if(H<u&&S<=0&&(f.lastpage===undefined||parseInt((H+E+w-1)/w,10)<=f.lastpage)){K=parseInt((u-H+w-1)/w,10);if(H>=0||K<2||f.scroll===true){X=Math.round((H+E)/w)+1;S=-1}else S=1}if(S>0){X=parseInt(E/w,10)+1;K=parseInt((E+u)/w,10)+2-X;N=true}if(K)if(!(f.lastpage&&
29
+ X>f.lastpage||f.lastpage==1))if(g.hDiv.loading)g.timer=setTimeout(g.populateVisible,f.scrollTimeout);else{f.page=X;if(N){g.selectionPreserver(v[0]);g.emptyRows(g.bDiv,false,false)}g.populate(K)}}}},scrollGrid:function(){if(f.scroll){var u=g.bDiv.scrollTop;if(g.scrollTop===undefined)g.scrollTop=0;if(u!=g.scrollTop){g.scrollTop=u;g.timer&&clearTimeout(g.timer);g.timer=setTimeout(g.populateVisible,f.scrollTimeout)}}g.hDiv.scrollLeft=g.bDiv.scrollLeft;if(f.footerrow)g.sDiv.scrollLeft=g.bDiv.scrollLeft},
30
+ selectionPreserver:function(u){var v=u.p,w=v.selrow,D=v.selarrrow?a.makeArray(v.selarrrow):null,E=u.grid.bDiv.scrollLeft,S=v.gridComplete;v.gridComplete=function(){v.selrow=null;v.selarrrow=[];if(v.multiselect&&D&&D.length>0)for(var H=0;H<D.length;H++)D[H]!=w&&a(u).jqGrid("setSelection",D[H],false);w&&a(u).jqGrid("setSelection",w,false);u.grid.bDiv.scrollLeft=E;v.gridComplete=S;v.gridComplete&&S()}}};if(this.tagName!="TABLE")alert("Element is not a table");else{a(this).empty().attr("tabindex","1");
31
+ this.p=f;var j,h,d;if(this.p.colNames.length===0)for(j=0;j<this.p.colModel.length;j++)this.p.colNames[j]=this.p.colModel[j].label||this.p.colModel[j].name;if(this.p.colNames.length!==this.p.colModel.length)alert(a.jgrid.errors.model);else{var o=a("<div class='ui-jqgrid-view'></div>"),k,n=a.browser.msie?true:false,m=a.browser.safari?true:false;d=this;d.p.direction=a.trim(d.p.direction.toLowerCase());if(a.inArray(d.p.direction,["ltr","rtl"])==-1)d.p.direction="ltr";h=d.p.direction;a(o).insertBefore(this);
32
+ a(this).appendTo(o).removeClass("scroll");var l=a("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");a(l).insertBefore(o).attr({id:"gbox_"+this.id,dir:h});a(o).appendTo(l).attr("id","gview_"+this.id);k=n&&a.browser.version<=6?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"";a("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").append(k).insertBefore(o);a("<div class='loading ui-state-default ui-state-active' id='load_"+
33
+ this.id+"'>"+this.p.loadtext+"</div>").insertBefore(o);a(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var q=function(u,v){u=parseInt(u,10);return isNaN(u)?v?v:0:u},s=function(u,v,w,D,E,S){var H=d.p.colModel[u],X=H.align,K='style="',N=H.classes,P=H.name,L=[];if(X)K+="text-align:"+X+";";if(H.hidden===true)K+="display:none;";if(v===0)K+="width: "+g.headers[u].width+"px;";else if(H.cellattr&&a.isFunction(H.cellattr))if((u=
34
+ H.cellattr.call(d,E,w,D,H,S))&&typeof u==="string"){u=u.replace(/style/i,"style").replace(/title/i,"title");if(u.indexOf("title")>-1)H.title=false;if(u.indexOf("class")>-1)N=undefined;L=u.split("style");if(L.length===2){L[1]=a.trim(L[1].replace("=",""));if(L[1].indexOf("'")===0||L[1].indexOf('"')===0)L[1]=L[1].substring(1);K+=L[1].replace(/'/gi,'"')}else K+='"'}if(!L.length){L[0]="";K+='"'}K+=(N!==undefined?' class="'+N+'"':"")+(H.title&&w?' title="'+a.jgrid.stripHtml(w)+'"':"");K+=' aria-describedby="'+
35
+ d.p.id+"_"+P+'"';return K+L[0]},p=function(u){return u===undefined||u===null||u===""?"&#160;":d.p.autoencode?a.jgrid.htmlEncode(u):u+""},r=function(u,v,w,D,E){var S=d.p.colModel[w];if(typeof S.formatter!=="undefined"){u={rowId:u,colModel:S,gid:d.p.id,pos:w};v=a.isFunction(S.formatter)?S.formatter.call(d,v,u,D,E):a.fmatter?a.fn.fmatter(S.formatter,v,u,D,E):p(v)}else v=p(v);return v},t=function(u,v,w,D,E){v=r(u,v,w,E,"add");return'<td role="gridcell" '+s(w,D,v,E,u,true)+">"+v+"</td>"},y=function(u,
36
+ v,w){var D='<input role="checkbox" type="checkbox" id="jqg_'+d.p.id+"_"+u+'" class="cbox" name="jqg_'+d.p.id+"_"+u+'"/>';return'<td role="gridcell" '+s(v,w,"",null,u,true)+">"+D+"</td>"},B=function(u,v,w,D){w=(parseInt(w,10)-1)*parseInt(D,10)+1+v;return'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+s(u,v,w,null,v,true)+">"+w+"</td>"},G=function(u){var v,w=[],D=0,E;for(E=0;E<d.p.colModel.length;E++){v=d.p.colModel[E];if(v.name!=="cb"&&v.name!=="subgrid"&&v.name!=="rn"){w[D]=u=="local"?
37
+ v.name:u=="xml"?v.xmlmap||v.name:v.jsonmap||v.name;D++}}return w},x=function(u){var v=d.p.remapColumns;if(!v||!v.length)v=a.map(d.p.colModel,function(w,D){return D});if(u)v=a.map(v,function(w){return w<u?null:w-u});return v},C=function(u,v,w){if(d.p.deepempty)a("#"+a.jgrid.jqID(d.p.id)+" tbody:first tr:gt(0)").remove();else{var D=a("#"+a.jgrid.jqID(d.p.id)+" tbody:first tr:first")[0];a("#"+a.jgrid.jqID(d.p.id)+" tbody:first").empty().append(D)}if(v&&d.p.scroll){a(">div:first",u).css({height:"auto"}).children("div:first").css({height:0,
38
+ display:"none"});u.scrollTop=0}if(w===true)if(d.p.treeGrid===true){d.p.data=[];d.p._index={}}},A=function(){var u=d.p.data.length,v,w,D;v=d.p.rownumbers===true?1:0;w=d.p.multiselect===true?1:0;D=d.p.subGrid===true?1:0;v=d.p.keyIndex===false||d.p.loadonce===true?d.p.localReader.id:d.p.colModel[d.p.keyIndex+w+D+v].name;for(w=0;w<u;w++){D=a.jgrid.getAccessor(d.p.data[w],v);d.p._index[D]=w}},z=function(u,v,w,D,E){var S=new Date,H=d.p.datatype!="local"&&d.p.loadonce||d.p.datatype=="xmlstring",X=d.p.datatype==
39
+ "local"?"local":"xml";if(H){d.p.data=[];d.p._index={};d.p.localReader.id="_id_"}d.p.reccount=0;if(a.isXMLDoc(u)){if(d.p.treeANode===-1&&!d.p.scroll){C(v,false,true);w=1}else w=w>1?w:1;var K,N,P=0,L,Y=0,ma=0,ga=0,fa,ha=[],qa,ea={},J,V,aa=[],Aa=d.p.altRows===true?" "+d.p.altclass:"";d.p.xmlReader.repeatitems||(ha=G(X));fa=d.p.keyIndex===false?d.p.xmlReader.id:d.p.keyIndex;if(ha.length>0&&!isNaN(fa)){if(d.p.remapColumns&&d.p.remapColumns.length)fa=a.inArray(fa,d.p.remapColumns);fa=ha[fa]}X=(fa+"").indexOf("[")===
40
+ -1?ha.length?function(ya,ua){return a(fa,ya).text()||ua}:function(ya,ua){return a(d.p.xmlReader.cell,ya).eq(fa).text()||ua}:function(ya,ua){return ya.getAttribute(fa.replace(/[\[\]]/g,""))||ua};d.p.userData={};a(d.p.xmlReader.page,u).each(function(){d.p.page=this.textContent||this.text||0});a(d.p.xmlReader.total,u).each(function(){d.p.lastpage=this.textContent||this.text;if(d.p.lastpage===undefined)d.p.lastpage=1});a(d.p.xmlReader.records,u).each(function(){d.p.records=this.textContent||this.text||
41
+ 0});a(d.p.xmlReader.userdata,u).each(function(){d.p.userData[this.getAttribute("name")]=this.textContent||this.text});(u=a(d.p.xmlReader.root+" "+d.p.xmlReader.row,u))||(u=[]);var pa=u.length,ra=0,Ba={},za;if(u&&pa){za=parseInt(d.p.rowNum,10);var Fa=d.p.scroll?a.jgrid.randId():1;if(E)za*=E+1;E=a.isFunction(d.p.afterInsertRow);var Ea="";if(d.p.grouping&&d.p.groupingView.groupCollapse===true)Ea=' style="display:none;"';for(;ra<pa;){J=u[ra];V=X(J,Fa+ra);K=w===0?0:w+1;K=(K+ra)%2==1?Aa:"";aa.push("<tr"+
42
+ Ea+' id="'+V+'" tabindex="-1" role="row" class ="ui-widget-content jqgrow ui-row-'+d.p.direction+""+K+'">');if(d.p.rownumbers===true){aa.push(B(0,ra,d.p.page,d.p.rowNum));ga=1}if(d.p.multiselect===true){aa.push(y(V,ga,ra));Y=1}if(d.p.subGrid===true){aa.push(a(d).jqGrid("addSubGridCell",Y+ga,ra+w));ma=1}if(d.p.xmlReader.repeatitems){qa||(qa=x(Y+ma+ga));var Ja=a(d.p.xmlReader.cell,J);a.each(qa,function(ya){var ua=Ja[this];if(!ua)return false;L=ua.textContent||ua.text;ea[d.p.colModel[ya+Y+ma+ga].name]=
43
+ L;aa.push(t(V,L,ya+Y+ma+ga,ra+w,J))})}else for(K=0;K<ha.length;K++){L=a(ha[K],J).text();ea[d.p.colModel[K+Y+ma+ga].name]=L;aa.push(t(V,L,K+Y+ma+ga,ra+w,J))}aa.push("</tr>");if(d.p.grouping){K=d.p.groupingView.groupField.length;for(var Ha=[],Ia=0;Ia<K;Ia++)Ha.push(ea[d.p.groupingView.groupField[Ia]]);Ba=a(d).jqGrid("groupingPrepare",aa,Ha,Ba,ea);aa=[]}if(H||d.p.treeGrid===true){ea._id_=V;d.p.data.push(ea);d.p._index[V]=d.p.data.length-1}if(d.p.gridview===false){a("tbody:first",v).append(aa.join(""));
44
+ E&&d.p.afterInsertRow.call(d,V,ea,J);aa=[]}ea={};P++;ra++;if(P==za)break}}if(d.p.gridview===true){N=d.p.treeANode>-1?d.p.treeANode:0;if(d.p.grouping){a(d).jqGrid("groupingRender",Ba,d.p.colModel.length);Ba=null}else d.p.treeGrid===true&&N>0?a(d.rows[N]).after(aa.join("")):a("tbody:first",v).append(aa.join(""))}if(d.p.subGrid===true)try{a(d).jqGrid("addSubGrid",Y+ga)}catch(La){}d.p.totaltime=new Date-S;if(P>0)if(d.p.records===0)d.p.records=pa;aa=null;if(d.p.treeGrid===true)try{a(d).jqGrid("setTreeNode",
45
+ N+1,P+N+1)}catch(Ma){}if(!d.p.treeGrid&&!d.p.scroll)d.grid.bDiv.scrollTop=0;d.p.reccount=P;d.p.treeANode=-1;d.p.userDataOnFooter&&a(d).jqGrid("footerData","set",d.p.userData,true);if(H){d.p.records=pa;d.p.lastpage=Math.ceil(pa/za)}D||d.updatepager(false,true);if(H)for(;P<pa;){J=u[P];V=X(J,P);if(d.p.xmlReader.repeatitems){qa||(qa=x(Y+ma+ga));var Ka=a(d.p.xmlReader.cell,J);a.each(qa,function(ya){var ua=Ka[this];if(!ua)return false;L=ua.textContent||ua.text;ea[d.p.colModel[ya+Y+ma+ga].name]=L})}else for(K=
46
+ 0;K<ha.length;K++){L=a(ha[K],J).text();ea[d.p.colModel[K+Y+ma+ga].name]=L}ea._id_=V;d.p.data.push(ea);d.p._index[V]=d.p.data.length-1;ea={};P++}}},M=function(u,v,w,D,E){var S=new Date;if(u){if(d.p.treeANode===-1&&!d.p.scroll){C(v,false,true);w=1}else w=w>1?w:1;var H,X=d.p.datatype!="local"&&d.p.loadonce||d.p.datatype=="jsonstring";if(X){d.p.data=[];d.p._index={};d.p.localReader.id="_id_"}d.p.reccount=0;if(d.p.datatype=="local"){v=d.p.localReader;H="local"}else{v=d.p.jsonReader;H="json"}var K=0,N,
47
+ P,L=[],Y,ma=0,ga=0,fa=0,ha,qa,ea={},J,V,aa=[],Aa=d.p.altRows===true?" "+d.p.altclass:"";d.p.page=a.jgrid.getAccessor(u,v.page)||0;ha=a.jgrid.getAccessor(u,v.total);d.p.lastpage=ha===undefined?1:ha;d.p.records=a.jgrid.getAccessor(u,v.records)||0;d.p.userData=a.jgrid.getAccessor(u,v.userdata)||{};v.repeatitems||(Y=L=G(H));H=d.p.keyIndex===false?v.id:d.p.keyIndex;if(L.length>0&&!isNaN(H)){if(d.p.remapColumns&&d.p.remapColumns.length)H=a.inArray(H,d.p.remapColumns);H=L[H]}(qa=a.jgrid.getAccessor(u,v.root))||
48
+ (qa=[]);ha=qa.length;u=0;var pa=parseInt(d.p.rowNum,10),ra=d.p.scroll?a.jgrid.randId():1;if(E)pa*=E+1;var Ba=a.isFunction(d.p.afterInsertRow),za={},Fa="";if(d.p.grouping&&d.p.groupingView.groupCollapse===true)Fa=' style="display:none;"';for(;u<ha;){E=qa[u];V=a.jgrid.getAccessor(E,H);if(V===undefined){V=ra+u;if(L.length===0)if(v.cell)V=a.jgrid.getAccessor(E,v.cell)[H]||V}N=w===1?0:w;N=(N+u)%2==1?Aa:"";aa.push("<tr"+Fa+' id="'+V+'" tabindex="-1" role="row" class= "ui-widget-content jqgrow ui-row-'+
49
+ d.p.direction+""+N+'">');if(d.p.rownumbers===true){aa.push(B(0,u,d.p.page,d.p.rowNum));fa=1}if(d.p.multiselect){aa.push(y(V,fa,u));ma=1}if(d.p.subGrid){aa.push(a(d).jqGrid("addSubGridCell",ma+fa,u+w));ga=1}if(v.repeatitems){if(v.cell)E=a.jgrid.getAccessor(E,v.cell);Y||(Y=x(ma+ga+fa))}for(P=0;P<Y.length;P++){N=a.jgrid.getAccessor(E,Y[P]);aa.push(t(V,N,P+ma+ga+fa,u+w,E));ea[d.p.colModel[P+ma+ga+fa].name]=N}aa.push("</tr>");if(d.p.grouping){N=d.p.groupingView.groupField.length;P=[];for(var Ea=0;Ea<N;Ea++)P.push(ea[d.p.groupingView.groupField[Ea]]);
50
+ za=a(d).jqGrid("groupingPrepare",aa,P,za,ea);aa=[]}if(X||d.p.treeGrid===true){ea._id_=V;d.p.data.push(ea);d.p._index[V]=d.p.data.length-1}if(d.p.gridview===false){a("#"+a.jgrid.jqID(d.p.id)+" tbody:first").append(aa.join(""));Ba&&d.p.afterInsertRow.call(d,V,ea,E);aa=[]}ea={};K++;u++;if(K==pa)break}if(d.p.gridview===true){J=d.p.treeANode>-1?d.p.treeANode:0;if(d.p.grouping)a(d).jqGrid("groupingRender",za,d.p.colModel.length);else d.p.treeGrid===true&&J>0?a(d.rows[J]).after(aa.join("")):a("#"+a.jgrid.jqID(d.p.id)+
51
+ " tbody:first").append(aa.join(""))}if(d.p.subGrid===true)try{a(d).jqGrid("addSubGrid",ma+fa)}catch(Ja){}d.p.totaltime=new Date-S;if(K>0)if(d.p.records===0)d.p.records=ha;if(d.p.treeGrid===true)try{a(d).jqGrid("setTreeNode",J+1,K+J+1)}catch(Ha){}if(!d.p.treeGrid&&!d.p.scroll)d.grid.bDiv.scrollTop=0;d.p.reccount=K;d.p.treeANode=-1;d.p.userDataOnFooter&&a(d).jqGrid("footerData","set",d.p.userData,true);if(X){d.p.records=ha;d.p.lastpage=Math.ceil(ha/pa)}D||d.updatepager(false,true);if(X)for(;K<ha&&qa[K];){E=
52
+ qa[K];V=a.jgrid.getAccessor(E,H);if(V===undefined){V=ra+K;if(L.length===0)if(v.cell)V=a.jgrid.getAccessor(E,v.cell)[H]||V}if(E){if(v.repeatitems){if(v.cell)E=a.jgrid.getAccessor(E,v.cell);Y||(Y=x(ma+ga+fa))}for(P=0;P<Y.length;P++){N=a.jgrid.getAccessor(E,Y[P]);ea[d.p.colModel[P+ma+ga+fa].name]=N}ea._id_=V;d.p.data.push(ea);d.p._index[V]=d.p.data.length-1;ea={}}K++}}},Q=function(){function u(J){var V=0,aa,Aa,pa;if(J.groups!==undefined)for(aa=0;aa<J.groups.length;aa++){try{u(J.groups[aa])}catch(ra){alert(ra)}V++}if(J.rules!==
53
+ undefined){if(V>0){var Ba=L.select();L=a.jgrid.from(Ba)}try{for(aa=0;aa<J.rules.length;aa++){pa=J.rules[aa];Aa=J.groupOp.toString().toUpperCase();if(P[pa.op]&&pa.field){if(V>0&&Aa&&Aa==="OR")L=L.or();L=P[pa.op](L,Aa)(pa.field,pa.data,D[pa.field])}V++}}catch(za){alert(za)}}}var v,w=false,D={},E=[],S=[],H,X,K;if(a.isArray(d.p.data)){var N=d.p.grouping?d.p.groupingView:false;a.each(d.p.colModel,function(){X=this.sorttype||"text";if(X=="date"||X=="datetime"){if(this.formatter&&typeof this.formatter===
54
+ "string"&&this.formatter=="date"){H=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat:a.jgrid.formatter.date.srcformat;K=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:a.jgrid.formatter.date.newformat}else H=K=this.datefmt||"Y-m-d";D[this.name]={stype:X,srcfmt:H,newfmt:K}}else D[this.name]={stype:X,srcfmt:"",newfmt:""};if(d.p.grouping&&this.name==N.groupField[0]){var J=this.name;if(typeof this.index!="undefined")J=this.index;E[0]=D[J];S.push(J)}if(!w&&
55
+ (this.index==d.p.sortname||this.name==d.p.sortname)){v=this.name;w=true}});if(d.p.treeGrid)a(d).jqGrid("SortTree",v,d.p.sortorder,D[v].stype,D[v].srcfmt);else{var P={eq:function(J){return J.equals},ne:function(J){return J.notEquals},lt:function(J){return J.less},le:function(J){return J.lessOrEquals},gt:function(J){return J.greater},ge:function(J){return J.greaterOrEquals},cn:function(J){return J.contains},nc:function(J,V){return V==="OR"?J.orNot().contains:J.andNot().contains},bw:function(J){return J.startsWith},
56
+ bn:function(J,V){return V==="OR"?J.orNot().startsWith:J.andNot().startsWith},en:function(J,V){return V==="OR"?J.orNot().endsWith:J.andNot().endsWith},ew:function(J){return J.endsWith},ni:function(J,V){return V==="OR"?J.orNot().equals:J.andNot().equals},"in":function(J){return J.equals},nu:function(J){return J.isNull},nn:function(J,V){return V==="OR"?J.orNot().isNull:J.andNot().isNull}},L=a.jgrid.from(d.p.data);if(d.p.ignoreCase)L=L.ignoreCase();if(d.p.search===true){var Y=d.p.postData.filters;if(Y){if(typeof Y==
57
+ "string")Y=a.jgrid.parse(Y);u(Y)}else try{L=P[d.p.postData.searchOper](L)(d.p.postData.searchField,d.p.postData.searchString,D[d.p.postData.searchField])}catch(ma){}}if(d.p.grouping){L.orderBy(S,N.groupOrder[0],E[0].stype,E[0].srcfmt);N.groupDataSorted=true}if(v&&d.p.sortorder&&w)d.p.sortorder.toUpperCase()=="DESC"?L.orderBy(d.p.sortname,"d",D[v].stype,D[v].srcfmt):L.orderBy(d.p.sortname,"a",D[v].stype,D[v].srcfmt);Y=L.select();var ga=parseInt(d.p.rowNum,10),fa=Y.length,ha=parseInt(d.p.page,10),qa=
58
+ Math.ceil(fa/ga),ea={};Y=Y.slice((ha-1)*ga,ha*ga);D=L=null;ea[d.p.localReader.total]=qa;ea[d.p.localReader.page]=ha;ea[d.p.localReader.records]=fa;ea[d.p.localReader.root]=Y;Y=null;return ea}}},U=function(){d.grid.hDiv.loading=true;if(!d.p.hiddengrid)switch(d.p.loadui){case "enable":a("#load_"+a.jgrid.jqID(d.p.id)).show();break;case "block":a("#lui_"+a.jgrid.jqID(d.p.id)).show();a("#load_"+a.jgrid.jqID(d.p.id)).show()}},ja=function(){d.grid.hDiv.loading=false;switch(d.p.loadui){case "enable":a("#load_"+
59
+ a.jgrid.jqID(d.p.id)).hide();break;case "block":a("#lui_"+a.jgrid.jqID(d.p.id)).hide();a("#load_"+a.jgrid.jqID(d.p.id)).hide()}},$=function(u){if(!d.grid.hDiv.loading){var v=d.p.scroll&&u===false,w={},D,E=d.p.prmNames;if(d.p.page<=0)d.p.page=1;if(E.search!==null)w[E.search]=d.p.search;if(E.nd!==null)w[E.nd]=(new Date).getTime();if(E.rows!==null)w[E.rows]=d.p.rowNum;if(E.page!==null)w[E.page]=d.p.page;if(E.sort!==null)w[E.sort]=d.p.sortname;if(E.order!==null)w[E.order]=d.p.sortorder;if(d.p.rowTotal!==
60
+ null&&E.totalrows!==null)w[E.totalrows]=d.p.rowTotal;var S=d.p.loadComplete,H=a.isFunction(S);H||(S=null);var X=0;u=u||1;if(u>1)if(E.npage!==null){w[E.npage]=u;X=u-1;u=1}else S=function(N){d.p.page++;d.grid.hDiv.loading=false;H&&d.p.loadComplete.call(d,N);$(u-1)};else E.npage!==null&&delete d.p.postData[E.npage];if(d.p.grouping){a(d).jqGrid("groupingSetup");if(d.p.groupingView.groupDataSorted===true)w[E.sort]=d.p.groupingView.groupField[0]+" "+d.p.groupingView.groupOrder[0]+", "+w[E.sort]}a.extend(d.p.postData,
61
+ w);var K=!d.p.scroll?1:d.rows.length-1;if(a.isFunction(d.p.datatype))d.p.datatype.call(d,d.p.postData,"load_"+d.p.id);else{a.isFunction(d.p.beforeRequest)&&d.p.beforeRequest.call(d);D=d.p.datatype.toLowerCase();switch(D){case "json":case "jsonp":case "xml":case "script":a.ajax(a.extend({url:d.p.url,type:d.p.mtype,dataType:D,data:a.isFunction(d.p.serializeGridData)?d.p.serializeGridData.call(d,d.p.postData):d.p.postData,success:function(N){D==="xml"?z(N,d.grid.bDiv,K,u>1,X):M(N,d.grid.bDiv,K,u>1,X);
62
+ S&&S.call(d,N);v&&d.grid.populateVisible();if(d.p.loadonce||d.p.treeGrid)d.p.datatype="local";ja()},error:function(N,P,L){a.isFunction(d.p.loadError)&&d.p.loadError.call(d,N,P,L);ja()},beforeSend:function(N){U();a.isFunction(d.p.loadBeforeSend)&&d.p.loadBeforeSend.call(d,N)}},a.jgrid.ajaxOptions,d.p.ajaxGridOptions));break;case "xmlstring":U();w=a.jgrid.stringToDoc(d.p.datastr);z(w,d.grid.bDiv);H&&d.p.loadComplete.call(d,w);d.p.datatype="local";d.p.datastr=null;ja();break;case "jsonstring":U();w=
63
+ typeof d.p.datastr=="string"?a.jgrid.parse(d.p.datastr):d.p.datastr;M(w,d.grid.bDiv);H&&d.p.loadComplete.call(d,w);d.p.datatype="local";d.p.datastr=null;ja();break;case "local":case "clientside":U();d.p.datatype="local";w=Q();M(w,d.grid.bDiv,K,u>1,X);S&&S.call(d,w);v&&d.grid.populateVisible();ja()}}}};k=function(u,v){var w="",D="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",E="",S,H,X,K,N=function(P){var L;if(a.isFunction(d.p.onPaging))L=
64
+ d.p.onPaging.call(d,P);d.p.selrow=null;if(d.p.multiselect){d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false)}d.p.savedRow=[];if(L=="stop")return false;return true};u=u.substr(1);S="pg_"+u;H=u+"_left";X=u+"_center";K=u+"_right";a("#"+a.jgrid.jqID(u)).append("<div id='"+S+"' 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='"+H+"' align='left'></td><td id='"+
65
+ X+"' align='center' style='white-space:pre;'></td><td id='"+K+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(d.p.rowList.length>0){E="<td dir='"+h+"'>";E+="<select class='ui-pg-selbox' role='listbox'>";for(H=0;H<d.p.rowList.length;H++)E+='<option role="option" value="'+d.p.rowList[H]+'"'+(d.p.rowNum==d.p.rowList[H]?' selected="selected"':"")+">"+d.p.rowList[H]+"</option>";E+="</select></td>"}if(h=="rtl")D+=E;if(d.p.pginput===true)w="<td dir='"+h+"'>"+a.jgrid.format(d.p.pgtext||
66
+ "","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1'></span>")+"</td>";if(d.p.pgbuttons===true){H=["first"+v,"prev"+v,"next"+v,"last"+v];h=="rtl"&&H.reverse();D+="<td id='"+H[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";D+="<td id='"+H[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";D+=w!==""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+
67
+ w+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":"";D+="<td id='"+H[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";D+="<td id='"+H[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else if(w!=="")D+=w;if(h=="ltr")D+=E;D+="</tr></tbody></table>";d.p.viewrecords===true&&a("td#"+u+"_"+d.p.recordpos,"#"+S).append("<div dir='"+h+"' style='text-align:"+d.p.recordpos+
68
+ "' class='ui-paging-info'></div>");a("td#"+u+"_"+d.p.pagerpos,"#"+S).append(D);E=a(".ui-jqgrid").css("font-size")||"11px";a(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+E+";visibility:hidden;' ></div>");D=a(D).clone().appendTo("#testpg").width();a("#testpg").remove();if(D>0){if(w!=="")D+=50;a("td#"+u+"_"+d.p.pagerpos,"#"+S).width(D)}d.p._nvtd=[];d.p._nvtd[0]=D?Math.floor((d.p.width-D)/2):Math.floor(d.p.width/3);d.p._nvtd[1]=0;D=null;a(".ui-pg-selbox",
69
+ "#"+S).bind("change",function(){d.p.page=Math.round(d.p.rowNum*(d.p.page-1)/this.value-0.5)+1;d.p.rowNum=this.value;if(v)a(".ui-pg-selbox",d.p.pager).val(this.value);else d.p.toppager&&a(".ui-pg-selbox",d.p.toppager).val(this.value);if(!N("records"))return false;$();return false});if(d.p.pgbuttons===true){a(".ui-pg-button","#"+S).hover(function(){if(a(this).hasClass("ui-state-disabled"))this.style.cursor="default";else{a(this).addClass("ui-state-hover");this.style.cursor="pointer"}},function(){if(!a(this).hasClass("ui-state-disabled")){a(this).removeClass("ui-state-hover");
70
+ this.style.cursor="default"}});a("#first"+v+", #prev"+v+", #next"+v+", #last"+v,"#"+u).click(function(){var P=q(d.p.page,1),L=q(d.p.lastpage,1),Y=false,ma=true,ga=true,fa=true,ha=true;if(L===0||L===1)ha=fa=ga=ma=false;else if(L>1&&P>=1)if(P===1)ga=ma=false;else{if(!(P>1&&P<L))if(P===L)ha=fa=false}else if(L>1&&P===0){ha=fa=false;P=L-1}if(this.id==="first"+v&&ma){d.p.page=1;Y=true}if(this.id==="prev"+v&&ga){d.p.page=P-1;Y=true}if(this.id==="next"+v&&fa){d.p.page=P+1;Y=true}if(this.id==="last"+v&&ha){d.p.page=
71
+ L;Y=true}if(Y){if(!N(this.id))return false;$()}return false})}d.p.pginput===true&&a("input.ui-pg-input","#"+S).keypress(function(P){if((P.charCode?P.charCode:P.keyCode?P.keyCode:0)==13){d.p.page=a(this).val()>0?a(this).val():d.p.page;if(!N("user"))return false;$();return false}return this})};var ia=function(u,v,w,D){if(d.p.colModel[v].sortable)if(!(d.p.savedRow.length>0)){if(!w){if(d.p.lastsort==v)if(d.p.sortorder=="asc")d.p.sortorder="desc";else{if(d.p.sortorder=="desc")d.p.sortorder="asc"}else d.p.sortorder=
72
+ d.p.colModel[v].firstsortorder||"asc";d.p.page=1}if(D)if(d.p.lastsort==v&&d.p.sortorder==D&&!w)return;else d.p.sortorder=D;w=a("thead:first",d.grid.hDiv).get(0);a("tr th:eq("+d.p.lastsort+") span.ui-grid-ico-sort",w).addClass("ui-state-disabled");a("tr th:eq("+d.p.lastsort+")",w).attr("aria-selected","false");a("tr th:eq("+v+") span.ui-icon-"+d.p.sortorder,w).removeClass("ui-state-disabled");a("tr th:eq("+v+")",w).attr("aria-selected","true");if(!d.p.viewsortcols[0])if(d.p.lastsort!=v){a("tr th:eq("+
73
+ d.p.lastsort+") span.s-ico",w).hide();a("tr th:eq("+v+") span.s-ico",w).show()}u=u.substring(5);d.p.sortname=d.p.colModel[v].index||u;w=d.p.sortorder;if(a.isFunction(d.p.onSortCol))if(d.p.onSortCol.call(d,u,v,w)=="stop"){d.p.lastsort=v;return}if(d.p.datatype=="local")d.p.deselectAfterSort&&a(d).jqGrid("resetSelection");else{d.p.selrow=null;d.p.multiselect&&a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false);d.p.selarrrow=[];d.p.savedRow=[]}if(d.p.scroll){w=d.grid.bDiv.scrollLeft;C(d.grid.bDiv,
74
+ true,false);d.grid.hDiv.scrollLeft=w}d.p.subGrid&&d.p.datatype=="local"&&a("td.sgexpanded","#"+a.jgrid.jqID(d.p.id)).each(function(){a(this).trigger("click")});$();d.p.lastsort=v;if(d.p.sortname!=u&&v)d.p.lastsort=v}},sa=function(u){var v,w={},D=m?0:d.p.cellLayout;for(v=w[0]=w[1]=w[2]=0;v<=u;v++)if(d.p.colModel[v].hidden===false)w[0]+=d.p.colModel[v].width+D;if(d.p.direction=="rtl")w[0]=d.p.width-w[0];w[0]-=d.grid.bDiv.scrollLeft;if(a(d.grid.cDiv).is(":visible"))w[1]+=a(d.grid.cDiv).height()+parseInt(a(d.grid.cDiv).css("padding-top"),
75
75
  10)+parseInt(a(d.grid.cDiv).css("padding-bottom"),10);if(d.p.toolbar[0]===true&&(d.p.toolbar[1]=="top"||d.p.toolbar[1]=="both"))w[1]+=a(d.grid.uDiv).height()+parseInt(a(d.grid.uDiv).css("border-top-width"),10)+parseInt(a(d.grid.uDiv).css("border-bottom-width"),10);if(d.p.toppager)w[1]+=a(d.grid.topDiv).height()+parseInt(a(d.grid.topDiv).css("border-bottom-width"),10);w[2]+=a(d.grid.bDiv).height()+a(d.grid.hDiv).height();return w};this.p.id=this.id;if(a.inArray(d.p.multikey,["shiftKey","altKey","ctrlKey"])==
76
- -1)d.p.multikey=false;d.p.keyIndex=false;for(j=0;j<d.p.colModel.length;j++){d.p.colModel[j]=a.extend({},d.p.cmTemplate,d.p.colModel[j].template||{},d.p.colModel[j]);if(d.p.keyIndex===false&&d.p.colModel[j].key===true)d.p.keyIndex=j}d.p.sortorder=d.p.sortorder.toLowerCase();if(d.p.grouping===true){d.p.scroll=false;d.p.rownumbers=false;d.p.subGrid=false;d.p.treeGrid=false;d.p.gridview=true}if(this.p.treeGrid===true){try{a(this).jqGrid("setTreeGrid")}catch(ya){}if(d.p.datatype!="local")d.p.localReader=
76
+ -1)d.p.multikey=false;d.p.keyIndex=false;for(j=0;j<d.p.colModel.length;j++){d.p.colModel[j]=a.extend({},d.p.cmTemplate,d.p.colModel[j].template||{},d.p.colModel[j]);if(d.p.keyIndex===false&&d.p.colModel[j].key===true)d.p.keyIndex=j}d.p.sortorder=d.p.sortorder.toLowerCase();if(d.p.grouping===true){d.p.scroll=false;d.p.rownumbers=false;d.p.subGrid=false;d.p.treeGrid=false;d.p.gridview=true}if(this.p.treeGrid===true){try{a(this).jqGrid("setTreeGrid")}catch(xa){}if(d.p.datatype!="local")d.p.localReader=
77
77
  {id:"_id_"}}if(this.p.subGrid)try{a(d).jqGrid("setSubGrid")}catch(Ca){}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:m?d.p.multiselectWidth+d.p.cellLayout:d.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:d.p.rownumWidth,sortable:false,
78
78
  resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}d.p.xmlReader=a.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"}},d.p.xmlReader);d.p.jsonReader=a.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"}},
79
- d.p.jsonReader);d.p.localReader=a.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"}},d.p.localReader);if(d.p.scroll){d.p.pgbuttons=false;d.p.pginput=false;d.p.rowList=[]}d.p.data.length&&A();var oa="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",Da,F,I,T,O,W,P,Z;F=Z="";if(d.p.shrinkToFit===true&&d.p.forceFit===true)for(j=d.p.colModel.length-1;j>=0;j--)if(!d.p.colModel[j].hidden){d.p.colModel[j].resizable=
80
- false;break}if(d.p.viewsortcols[1]=="horizontal"){Z=" ui-i-asc";F=" ui-i-desc"}Da=o?"class='ui-th-div-ie'":"";Z="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+Z+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+h+"'></span>";Z+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+F+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+h+"'></span></span>";for(j=0;j<this.p.colNames.length;j++){F=d.p.headertitles?' title="'+a.jgrid.stripHtml(d.p.colNames[j])+
79
+ d.p.jsonReader);d.p.localReader=a.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"}},d.p.localReader);if(d.p.scroll){d.p.pgbuttons=false;d.p.pginput=false;d.p.rowList=[]}d.p.data.length&&A();var oa="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",Da,F,I,T,O,W,R,Z;F=Z="";if(d.p.shrinkToFit===true&&d.p.forceFit===true)for(j=d.p.colModel.length-1;j>=0;j--)if(!d.p.colModel[j].hidden){d.p.colModel[j].resizable=
80
+ false;break}if(d.p.viewsortcols[1]=="horizontal"){Z=" ui-i-asc";F=" ui-i-desc"}Da=n?"class='ui-th-div-ie'":"";Z="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+Z+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+h+"'></span>";Z+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+F+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+h+"'></span></span>";for(j=0;j<this.p.colNames.length;j++){F=d.p.headertitles?' title="'+a.jgrid.stripHtml(d.p.colNames[j])+
81
81
  '"':"";oa+="<th id='"+d.p.id+"_"+d.p.colModel[j].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+h+"'"+F+">";F=d.p.colModel[j].index||d.p.colModel[j].name;oa+="<div id='jqgh_"+d.p.colModel[j].name+"' "+Da+">"+d.p.colNames[j];d.p.colModel[j].width=d.p.colModel[j].width?parseInt(d.p.colModel[j].width,10):150;if(typeof d.p.colModel[j].title!=="boolean")d.p.colModel[j].title=true;if(F==d.p.sortname)d.p.lastsort=j;oa+=Z+"</div></th>"}oa+="</tr></thead>";Z=null;a(this).append(oa);
82
- a("thead tr:first th",this).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});if(this.p.multiselect){var ka=[],ba;a("#cb_"+a.jgrid.jqID(d.p.id),this).bind("click",function(){d.p.selarrrow=[];if(this.checked){a("[id^=jqg_"+d.p.id+"_]").attr("checked","checked");a(d.rows).each(function(t){if(t>0)if(!a(this).hasClass("subgrid")&&!a(this).hasClass("jqgroup")){a(this).addClass("ui-state-highlight").attr("aria-selected","true");d.p.selarrrow.push(this.id);
83
- d.p.selrow=this.id}});ba=true;ka=[]}else{a("[id^=jqg_"+d.p.id+"_]").removeAttr("checked");a(d.rows).each(function(t){if(t>0)if(!a(this).hasClass("subgrid")){a(this).removeClass("ui-state-highlight").attr("aria-selected","false");ka.push(this.id)}});d.p.selrow=null;ba=false}if(a.isFunction(d.p.onSelectAll))d.p.onSelectAll.call(d,ba?d.p.selarrrow:ka,ba)})}if(d.p.autowidth===true){oa=a(l).innerWidth();d.p.width=oa>0?oa:"nw"}(function(){var t=0,u=d.p.cellLayout,w=0,C,E=d.p.scrollOffset,S,H=false,X,K=
84
- 0,N=0,Q=0,L;if(m)u=0;a.each(d.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){t+=q(this.width,0);if(this.fixed){K+=this.width;N+=this.width+u}else w++;Q++}});if(d.p.shrinkToFit===false)t+=u*Q;if(isNaN(d.p.width))d.p.width=g.width=t;else g.width=d.p.width;d.p.tblwidth=t;if(d.p.shrinkToFit===false&&d.p.forceFit===true)d.p.forceFit=false;if(d.p.shrinkToFit===true&&w>0){X=g.width-u*w-N;if(!isNaN(d.p.height)){X-=E;H=true}t=0;a.each(d.p.colModel,function(Y){if(this.hidden===
85
- false&&!this.fixed){this.width=S=Math.round(X*this.width/(d.p.tblwidth-K));t+=S;C=Y}});L=0;if(H){if(g.width-N-(t+u*w)!==E)L=g.width-N-(t+u*w)-E}else if(!H&&Math.abs(g.width-N-(t+u*w))!==1)L=g.width-N-(t+u*w);d.p.colModel[C].width+=L;d.p.tblwidth=t+L+K+Q*u;if(d.p.tblwidth>d.p.width){d.p.colModel[C].width-=d.p.tblwidth-parseInt(d.p.width,10);d.p.tblwidth=d.p.width}}})();a(l).css("width",g.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+d.p.id+"'>&#160;</div>");a(n).css("width",g.width+
86
- "px");oa=a("thead:first",d).get(0);var la="";if(d.p.footerrow)la+="<table role='grid' style='width:"+d.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+h+"'>";n=a("tr:first",oa);var da="<tr class='jqgfirstrow' role='row' style='height:auto'>";d.p.disableClick=false;a("th",n).each(function(t){I=d.p.colModel[t].width;if(typeof d.p.colModel[t].resizable==="undefined")d.p.colModel[t].resizable=true;if(d.p.colModel[t].resizable){T=
87
- document.createElement("span");a(T).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+h);a.browser.opera||a(T).css("cursor","col-resize");a(this).addClass(d.p.resizeclass)}else T="";a(this).css("width",I+"px").prepend(T);var u="";if(d.p.colModel[t].hidden){a(this).css("display","none");u="display:none;"}da+="<td role='gridcell' style='height:0px;width:"+I+"px;"+u+"'></td>";g.headers[t]={width:I,el:this};O=d.p.colModel[t].sortable;if(typeof O!=="boolean")O=d.p.colModel[t].sortable=true;
88
- u=d.p.colModel[t].name;u=="cb"||u=="subgrid"||u=="rn"||d.p.viewsortcols[2]&&a("div",this).addClass("ui-jqgrid-sortable");if(O)if(d.p.viewsortcols[0]){a("div span.s-ico",this).show();t==d.p.lastsort&&a("div span.ui-icon-"+d.p.sortorder,this).removeClass("ui-state-disabled")}else if(t==d.p.lastsort){a("div span.s-ico",this).show();a("div span.ui-icon-"+d.p.sortorder,this).removeClass("ui-state-disabled")}if(d.p.footerrow)la+="<td role='gridcell' "+s(t,0,"",null,"",false)+">&#160;</td>"}).mousedown(function(t){if(a(t.target).closest("th>span.ui-jqgrid-resize").length==
89
- 1){var u=a.jgrid.getCellIndex(this);if(d.p.forceFit===true){var w=d.p,C=u,E;for(E=u+1;E<d.p.colModel.length;E++)if(d.p.colModel[E].hidden!==true){C=E;break}w.nv=C-u}g.dragStart(u,t,sa(u));return false}}).click(function(t){if(d.p.disableClick)return d.p.disableClick=false;var u="th>div.ui-jqgrid-sortable",w,C;d.p.viewsortcols[2]||(u="th>div>span>span.ui-grid-ico-sort");t=a(t.target).closest(u);if(t.length==1){u=a.jgrid.getCellIndex(this);if(!d.p.viewsortcols[2]){w=true;C=t.attr("sort")}ia(a("div",
90
- this)[0].id,u,w,C);return false}});if(d.p.sortable&&a.fn.sortable)try{a(d).jqGrid("sortableColumns",n)}catch(ua){}if(d.p.footerrow)la+="</tr></tbody></table>";da+="</tr>";this.appendChild(document.createElement("tbody"));a(this).addClass("ui-jqgrid-btable").append(da);da=null;n=a("<table class='ui-jqgrid-htable' style='width:"+d.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(oa);var ca=d.p.caption&&d.p.hiddengrid===true?
91
- true:false;j=a("<div class='ui-jqgrid-hbox"+(h=="rtl"?"-rtl":"")+"'></div>");oa=null;g.hDiv=document.createElement("div");a(g.hDiv).css({width:g.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(j);a(j).append(n);n=null;ca&&a(g.hDiv).hide();if(d.p.pager){if(typeof d.p.pager=="string"){if(d.p.pager.substr(0,1)!="#")d.p.pager="#"+d.p.pager}else d.p.pager="#"+a(d.p.pager).attr("id");a(d.p.pager).css({width:g.width+"px"}).appendTo(l).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom");
92
- ca&&a(d.p.pager).hide();k(d.p.pager,"")}d.p.cellEdit===false&&d.p.hoverrows===true&&a(d).bind("mouseover",function(t){P=a(t.target).closest("tr.jqgrow");a(P).attr("class")!=="subgrid"&&a(P).addClass("ui-state-hover");return false}).bind("mouseout",function(t){P=a(t.target).closest("tr.jqgrow");a(P).removeClass("ui-state-hover");return false});var ta,ma;a(d).before(g.hDiv).click(function(t){W=t.target;var u=a(W).hasClass("cbox");P=a(W,d.rows).closest("tr.jqgrow");if(a(P).length===0)return this;var w=
93
- true;if(a.isFunction(d.p.beforeSelectRow))w=d.p.beforeSelectRow.call(d,P[0].id,t);if(W.tagName=="A"||(W.tagName=="INPUT"||W.tagName=="TEXTAREA"||W.tagName=="OPTION"||W.tagName=="SELECT")&&!u)return this;if(w===true){if(d.p.cellEdit===true)if(d.p.multiselect&&u)a(d).jqGrid("setSelection",P[0].id,true);else{ta=P[0].rowIndex;ma=a.jgrid.getCellIndex(W);try{a(d).jqGrid("editCell",ta,ma,true)}catch(C){}}else if(d.p.multikey)if(t[d.p.multikey])a(d).jqGrid("setSelection",P[0].id,true);else{if(d.p.multiselect&&
94
- u){u=a("[id^=jqg_"+d.p.id+"_]").attr("checked");a("[id^=jqg_"+d.p.id+"_]").attr("checked",!u)}}else{if(d.p.multiselect&&d.p.multiboxonly)if(!u){a(d.p.selarrrow).each(function(E,S){var H=d.rows.namedItem(S);a(H).removeClass("ui-state-highlight");a("#jqg_"+a.jgrid.jqID(d.p.id)+"_"+a.jgrid.jqID(S)).attr("checked",false)});d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false)}a(d).jqGrid("setSelection",P[0].id,true)}if(a.isFunction(d.p.onCellSelect)){ta=P[0].id;ma=a.jgrid.getCellIndex(W);
95
- d.p.onCellSelect.call(d,ta,ma,a(W).html(),t)}t.stopPropagation()}else return this}).bind("reloadGrid",function(t,u){if(d.p.treeGrid===true)d.p.datatype=d.p.treedatatype;u&&u.current&&d.grid.selectionPreserver(d);if(d.p.datatype=="local"){a(d).jqGrid("resetSelection");d.p.data.length&&A()}else if(!d.p.treeGrid){d.p.selrow=null;if(d.p.multiselect){d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false)}d.p.savedRow=[]}d.p.scroll&&B(d.grid.bDiv,true,false);if(u&&u.page){var w=
96
- u.page;if(w>d.p.lastpage)w=d.p.lastpage;if(w<1)w=1;d.p.page=w;d.grid.bDiv.scrollTop=d.grid.prevRowHeight?(w-1)*d.grid.prevRowHeight*d.p.rowNum:0}if(d.grid.prevRowHeight&&d.p.scroll){delete d.p.lastpage;d.grid.populateVisible()}else d.grid.populate();return false});a.isFunction(this.p.ondblClickRow)&&a(this).dblclick(function(t){W=t.target;P=a(W,d.rows).closest("tr.jqgrow");if(a(P).length===0)return false;ta=P[0].rowIndex;ma=a.jgrid.getCellIndex(W);d.p.ondblClickRow.call(d,a(P).attr("id"),ta,ma,t);
97
- return false});a.isFunction(this.p.onRightClickRow)&&a(this).bind("contextmenu",function(t){W=t.target;P=a(W,d.rows).closest("tr.jqgrow");if(a(P).length===0)return false;d.p.multiselect||a(d).jqGrid("setSelection",P[0].id,true);ta=P[0].rowIndex;ma=a.jgrid.getCellIndex(W);d.p.onRightClickRow.call(d,a(P).attr("id"),ta,ma,t);return false});g.bDiv=document.createElement("div");a(g.bDiv).append(a('<div style="position:relative;'+(o&&a.browser.version<8?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:d.p.height+
98
- (isNaN(d.p.height)?"":"px"),width:g.width+"px"}).scroll(g.scrollGrid);a("table:first",g.bDiv).css({width:d.p.tblwidth+"px"});if(o){a("tbody",this).size()==2&&a("tbody:gt(0)",this).remove();d.p.multikey&&a(g.bDiv).bind("selectstart",function(){return false})}else d.p.multikey&&a(g.bDiv).bind("mousedown",function(){return false});ca&&a(g.bDiv).hide();g.cDiv=document.createElement("div");var wa=d.p.hidegrid===true?a("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){wa.addClass("ui-state-hover")},
99
- function(){wa.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css(h=="rtl"?"left":"right","0px"):"";a(g.cDiv).append(wa).append("<span class='ui-jqgrid-title"+(h=="rtl"?"-rtl":"")+"'>"+d.p.caption+"</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");a(g.cDiv).insertBefore(g.hDiv);if(d.p.toolbar[0]){g.uDiv=document.createElement("div");if(d.p.toolbar[1]=="top")a(g.uDiv).insertBefore(g.hDiv);else d.p.toolbar[1]==
100
- "bottom"&&a(g.uDiv).insertAfter(g.hDiv);if(d.p.toolbar[1]=="both"){g.ubDiv=document.createElement("div");a(g.uDiv).insertBefore(g.hDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);a(g.ubDiv).insertAfter(g.hDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id);ca&&a(g.ubDiv).hide()}else a(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);ca&&a(g.uDiv).hide()}if(d.p.toppager){d.p.toppager=a.jgrid.jqID(d.p.id)+"_toppager";g.topDiv=
101
- a("<div id='"+d.p.toppager+"'></div>")[0];d.p.toppager="#"+d.p.toppager;a(g.topDiv).insertBefore(g.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width);k(d.p.toppager,"_t")}if(d.p.footerrow){g.sDiv=a("<div class='ui-jqgrid-sdiv'></div>")[0];j=a("<div class='ui-jqgrid-hbox"+(h=="rtl"?"-rtl":"")+"'></div>");a(g.sDiv).append(j).insertAfter(g.hDiv).width(g.width);a(j).append(la);g.footers=a(".ui-jqgrid-ftable",g.sDiv)[0].rows[0].cells;if(d.p.rownumbers)g.footers[0].className="ui-state-default jqgrid-rownum";
102
- ca&&a(g.sDiv).hide()}j=null;if(d.p.caption){var Ga=d.p.datatype;if(d.p.hidegrid===true){a(".ui-jqgrid-titlebar-close",g.cDiv).click(function(t){var u=a.isFunction(d.p.onHeaderClick),w=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",C,E=this;if(d.p.toolbar[0]===true){if(d.p.toolbar[1]=="both")w+=", #"+a(g.ubDiv).attr("id");w+=", #"+a(g.uDiv).attr("id")}C=a(w,"#gview_"+a.jgrid.jqID(d.p.id)).length;if(d.p.gridstate=="visible")a(w,"#gbox_"+a.jgrid.jqID(d.p.id)).slideUp("fast",function(){C--;
103
- if(C===0){a("span",E).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");d.p.gridstate="hidden";a("#gbox_"+a.jgrid.jqID(d.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(d.p.id)).hide();if(u)ca||d.p.onHeaderClick.call(d,d.p.gridstate,t)}});else d.p.gridstate=="hidden"&&a(w,"#gbox_"+a.jgrid.jqID(d.p.id)).slideDown("fast",function(){C--;if(C===0){a("span",E).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(ca){d.p.datatype=
104
- Ga;$();ca=false}d.p.gridstate="visible";a("#gbox_"+a.jgrid.jqID(d.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(d.p.id)).show();if(u)ca||d.p.onHeaderClick.call(d,d.p.gridstate,t)}});return false});if(ca){d.p.datatype="local";a(".ui-jqgrid-titlebar-close",g.cDiv).trigger("click")}}}else a(g.cDiv).hide();a(g.hDiv).after(g.bDiv).mousemove(function(t){if(g.resizing){g.dragMove(t);return false}});a(".ui-jqgrid-labels",g.hDiv).bind("selectstart",function(){return false});
105
- a(document).mouseup(function(){if(g.resizing){g.dragEnd();return false}return true});d.formatCol=s;d.sortData=ia;d.updatepager=function(t,u){var w,C,E,S,H,X,K,N="";E=parseInt(d.p.page,10)-1;if(E<0)E=0;E*=parseInt(d.p.rowNum,10);H=E+d.p.reccount;if(d.p.scroll){w=a("tbody:first > tr:gt(0)",d.grid.bDiv);E=H-w.length;d.p.reccount=w.length;if(C=w.outerHeight()||d.grid.prevRowHeight){w=E*C;C=parseInt(d.p.records,10)*C;a(">div:first",d.grid.bDiv).css({height:C}).children("div:first").css({height:w,display:w?
106
- "":"none"})}d.grid.bDiv.scrollLeft=d.grid.hDiv.scrollLeft}N=d.p.pager?d.p.pager:"";N+=d.p.toppager?N?","+d.p.toppager:d.p.toppager:"";if(N){K=a.jgrid.formatter.integer||{};w=q(d.p.page);C=q(d.p.lastpage);a(".selbox",N).attr("disabled",false);if(d.p.pginput===true){a(".ui-pg-input",N).val(d.p.page);a("#sp_1",N).html(a.fmatter?a.fmatter.util.NumberFormat(d.p.lastpage,K):d.p.lastpage)}if(d.p.viewrecords)if(d.p.reccount===0)a(".ui-paging-info",N).html(d.p.emptyrecords);else{S=E+1;X=d.p.records;if(a.fmatter){S=
107
- a.fmatter.util.NumberFormat(S,K);H=a.fmatter.util.NumberFormat(H,K);X=a.fmatter.util.NumberFormat(X,K)}a(".ui-paging-info",N).html(a.jgrid.format(d.p.recordtext,S,H,X))}if(d.p.pgbuttons===true){if(w<=0)w=C=0;if(w==1||w===0){a("#first, #prev",d.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");d.p.toppager&&a("#first_t, #prev_t",d.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#first, #prev",d.p.pager).removeClass("ui-state-disabled");d.p.toppager&&
108
- a("#first_t, #prev_t",d.p.toppager).removeClass("ui-state-disabled")}if(w==C||w===0){a("#next, #last",d.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");d.p.toppager&&a("#next_t, #last_t",d.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#next, #last",d.p.pager).removeClass("ui-state-disabled");d.p.toppager&&a("#next_t, #last_t",d.p.toppager).removeClass("ui-state-disabled")}}}t===true&&d.p.rownumbers===true&&a("td.jqgrid-rownum",d.rows).each(function(Q){a(this).html(E+
109
- 1+Q)});u&&d.p.jqgdnd&&a(d).jqGrid("gridDnD","updateDnD");a.isFunction(d.p.gridComplete)&&d.p.gridComplete.call(d)};d.refreshIndex=A;d.formatter=function(t,u,w,C,E){return r(t,u,w,C,E)};a.extend(g,{populate:$,emptyRows:B});this.grid=g;d.addXmlData=function(t){z(t,d.grid.bDiv)};d.addJSONData=function(t){M(t,d.grid.bDiv)};this.grid.cols=this.rows[0].cells;$();d.p.hiddengrid=false;a(window).unload(function(){d=null})}}}})};a.jgrid.extend({getGridParam:function(b){var e=this[0];if(e&&e.grid)return b?typeof e.p[b]!=
110
- "undefined"?e.p[b]:null:e.p},setGridParam:function(b){return this.each(function(){this.grid&&typeof b==="object"&&a.extend(true,this.p,b)})},getDataIDs:function(){var b=[],e=0,c,f=0;this.each(function(){if((c=this.rows.length)&&c>0)for(;e<c;){if(a(this.rows[e]).hasClass("jqgrow")){b[f]=this.rows[e].id;f++}e++}});return b},setSelection:function(b,e){return this.each(function(){function c(d){var n=a(f.grid.bDiv)[0].clientHeight,k=a(f.grid.bDiv)[0].scrollTop,o=f.rows[d].offsetTop;d=f.rows[d].clientHeight;
111
- if(o+d>=n+k)a(f.grid.bDiv)[0].scrollTop=o-(n+k)+d+k;else if(o<n+k)if(o<k)a(f.grid.bDiv)[0].scrollTop=o}var f=this,g,j,h;if(b!==undefined){e=e===false?false:true;if(j=f.rows.namedItem(b+"")){if(f.p.scrollrows===true){g=f.rows.namedItem(b).rowIndex;g>=0&&c(g)}if(f.p.multiselect){f.p.selrow=j.id;h=a.inArray(f.p.selrow,f.p.selarrrow);if(h===-1){j.className!=="ui-subgrid"&&a(j).addClass("ui-state-highlight").attr("aria-selected","true");g=true;a("#jqg_"+a.jgrid.jqID(f.p.id)+"_"+a.jgrid.jqID(f.p.selrow)).attr("checked",
112
- g);f.p.selarrrow.push(f.p.selrow)}else{j.className!=="ui-subgrid"&&a(j).removeClass("ui-state-highlight").attr("aria-selected","false");g=false;a("#jqg_"+a.jgrid.jqID(f.p.id)+"_"+a.jgrid.jqID(f.p.selrow)).attr("checked",g);f.p.selarrrow.splice(h,1);h=f.p.selarrrow[0];f.p.selrow=h===undefined?null:h}f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,j.id,g)}else if(j.className!=="ui-subgrid"){if(f.p.selrow!=j.id){a(f.rows.namedItem(f.p.selrow)).removeClass("ui-state-highlight").attr({"aria-selected":"false",
113
- tabindex:"-1"});a(j).addClass("ui-state-highlight").attr({"aria-selected":true,tabindex:"0"});g=true}else g=false;f.p.selrow=j.id;f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,j.id,g)}}}})},resetSelection:function(){return this.each(function(){var b=this,e;if(b.p.multiselect){a(b.p.selarrrow).each(function(c,f){e=b.rows.namedItem(f);a(e).removeClass("ui-state-highlight").attr("aria-selected","false");a("#jqg_"+a.jgrid.jqID(b.p.id)+"_"+a.jgrid.jqID(f)).attr("checked",false)});a("#cb_"+a.jgrid.jqID(b.p.id)).attr("checked",
114
- false);b.p.selarrrow=[]}else if(b.p.selrow){a("#"+a.jgrid.jqID(b.p.id)+" tbody:first tr#"+a.jgrid.jqID(b.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false");b.p.selrow=null}b.p.savedRow=[]})},getRowData:function(b){var e={},c,f=false,g,j=0;this.each(function(){var h=this,d,n;if(typeof b=="undefined"){f=true;c=[];g=h.rows.length}else{n=h.rows.namedItem(b);if(!n)return e;g=2}for(;j<g;){if(f)n=h.rows[j];if(a(n).hasClass("jqgrow")){a("td",n).each(function(k){d=h.p.colModel[k].name;
115
- if(d!=="cb"&&d!=="subgrid"&&d!=="rn")if(h.p.treeGrid===true&&d==h.p.ExpandColumn)e[d]=a.jgrid.htmlDecode(a("span:first",this).html());else try{e[d]=a.unformat(this,{rowId:n.id,colModel:h.p.colModel[k]},k)}catch(o){e[d]=a.jgrid.htmlDecode(a(this).html())}});if(f){c.push(e);e={}}}j++}});return c?c:e},delRowData:function(b){var e=false,c,f;this.each(function(){if(c=this.rows.namedItem(b)){a(c).remove();this.p.records--;this.p.reccount--;this.updatepager(true,false);e=true;if(this.p.multiselect){f=a.inArray(b,
116
- this.p.selarrrow);f!=-1&&this.p.selarrrow.splice(f,1)}if(b==this.p.selrow)this.p.selrow=null}else return false;if(this.p.datatype=="local"){var g=this.p._index[b];if(typeof g!="undefined"){this.p.data.splice(g,1);this.refreshIndex()}}if(this.p.altRows===true&&e){var j=this.p.altclass;a(this.rows).each(function(h){h%2==1?a(this).addClass(j):a(this).removeClass(j)})}});return e},setRowData:function(b,e,c){var f,g=true,j;this.each(function(){if(!this.grid)return false;var h=this,d,n,k=typeof c,o={};
117
- n=h.rows.namedItem(b);if(!n)return false;if(e)try{a(this.p.colModel).each(function(s){f=this.name;if(e[f]!==undefined){o[f]=this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"?a.unformat.date(e[f],this):e[f];d=h.formatter(b,e[f],s,e,"edit");j=this.title?{title:a.jgrid.stripHtml(d)}:{};h.p.treeGrid===true&&f==h.p.ExpandColumn?a("td:eq("+s+") > span:first",n).html(d).attr(j):a("td:eq("+s+")",n).html(d).attr(j)}});if(h.p.datatype=="local"){var m=h.p._index[b];if(h.p.treeGrid)for(var l in h.p.treeReader)o.hasOwnProperty(h.p.treeReader[l])&&
118
- delete o[h.p.treeReader[l]];if(typeof m!="undefined")h.p.data[m]=a.extend(true,h.p.data[m],o);o=null}}catch(q){g=false}if(g)if(k==="string")a(n).addClass(c);else k==="object"&&a(n).css(c)});return g},addRowData:function(b,e,c,f){c||(c="last");var g=false,j,h,d,n,k,o,m,l,q="",s,p,r,v,y;if(e){if(a.isArray(e)){s=true;c="last";p=b}else{e=[e];s=false}this.each(function(){var D=e.length;k=this.p.rownumbers===true?1:0;d=this.p.multiselect===true?1:0;n=this.p.subGrid===true?1:0;if(!s)if(typeof b!="undefined")b+=
119
- "";else{b=this.p.records+1+"";if(this.p.keyIndex!==false){p=this.p.colModel[this.p.keyIndex+d+n+k].name;if(typeof e[0][p]!="undefined")b=e[0][p]}}r=this.p.altclass;for(var G=0,x="",B={},A=a.isFunction(this.p.afterInsertRow)?true:false;G<D;){v=e[G];h="";if(s){try{b=v[p]}catch(z){b=this.p.records+1+""}x=this.p.altRows===true?(this.rows.length-1)%2===0?r:"":""}if(k){q=this.formatCol(0,1,"",null,b,true);h+='<td role="gridcell" aria-describedby="'+this.p.id+'_rn" class="ui-state-default jqgrid-rownum" '+
120
- q+">0</td>"}if(d){l='<input role="checkbox" type="checkbox" id="jqg_'+this.p.id+"_"+b+'" class="cbox"/>';q=this.formatCol(k,1,"",null,b,true);h+='<td role="gridcell" aria-describedby="'+this.p.id+'_cb" '+q+">"+l+"</td>"}if(n)h+=a(this).jqGrid("addSubGridCell",d+k,1);for(m=d+n+k;m<this.p.colModel.length;m++){y=this.p.colModel[m];j=y.name;B[j]=y.formatter&&typeof y.formatter==="string"&&y.formatter=="date"?a.unformat.date(v[j],y):v[j];l=this.formatter(b,a.jgrid.getAccessor(v,j),m,v,"edit");q=this.formatCol(m,
121
- 1,l,b,v,true);h+='<td role="gridcell" aria-describedby="'+this.p.id+"_"+j+'" '+q+">"+l+"</td>"}h='<tr id="'+b+'" role="row" tabindex="-1" class="ui-widget-content jqgrow ui-row-'+this.p.direction+" "+x+'">'+h+"</tr>";if(this.p.subGrid===true){h=a(h)[0];a(this).jqGrid("addSubGrid",h,d+k)}if(this.rows.length===0)a("table:first",this.grid.bDiv).append(h);else switch(c){case "last":a(this.rows[this.rows.length-1]).after(h);break;case "first":a(this.rows[0]).after(h);break;case "after":if(o=this.rows.namedItem(f))a(this.rows[o.rowIndex+
122
- 1]).hasClass("ui-subgrid")?a(this.rows[o.rowIndex+1]).after(h):a(o).after(h);break;case "before":if(o=this.rows.namedItem(f)){a(o).before(h);o=o.rowIndex}}this.p.records++;this.p.reccount++;A&&this.p.afterInsertRow.call(this,b,v,v);G++;if(this.p.datatype=="local"){B[this.p.localReader.id]=b;this.p._index[b]=this.p.data.length;this.p.data.push(B);B={}}}if(this.p.altRows===true&&!s)if(c=="last")(this.rows.length-1)%2==1&&a(this.rows[this.rows.length-1]).addClass(r);else a(this.rows).each(function(M){M%
123
- 2==1?a(this).addClass(r):a(this).removeClass(r)});this.updatepager(true,true);g=true})}return g},footerData:function(b,e,c){function f(n){for(var k in n)if(n.hasOwnProperty(k))return false;return true}var g,j=false,h={},d;if(typeof b=="undefined")b="get";if(typeof c!="boolean")c=true;b=b.toLowerCase();this.each(function(){var n=this,k;if(!n.grid||!n.p.footerrow)return false;if(b=="set")if(f(e))return false;j=true;a(this.p.colModel).each(function(o){g=this.name;if(b=="set"){if(e[g]!==undefined){k=
124
- c?n.formatter("",e[g],o,e,"edit"):e[g];d=this.title?{title:a.jgrid.stripHtml(k)}:{};a("tr.footrow td:eq("+o+")",n.grid.sDiv).html(k).attr(d);j=true}}else if(b=="get")h[g]=a("tr.footrow td:eq("+o+")",n.grid.sDiv).html()})});return b=="get"?h:j},ShowHideCol:function(b,e){return this.each(function(){var c=this,f=false;if(c.grid){if(typeof b==="string")b=[b];e=e!="none"?"":"none";var g=e===""?true:false;a(this.p.colModel).each(function(j){if(a.inArray(this.name,b)!==-1&&this.hidden===g){a("tr",c.grid.hDiv).each(function(){a(this).children("th:eq("+
125
- j+")").css("display",e)});a(c.rows).each(function(){a(this).children("td:eq("+j+")").css("display",e)});c.p.footerrow&&a(c.grid.sDiv).children("td:eq("+j+")").css("display",e);if(e=="none")c.p.tblwidth-=this.width+c.p.cellLayout;else c.p.tblwidth+=this.width;this.hidden=!g;f=true}});if(f===true){a("table:first",c.grid.hDiv).width(c.p.tblwidth);a("table:first",c.grid.bDiv).width(c.p.tblwidth);c.grid.hDiv.scrollLeft=c.grid.bDiv.scrollLeft;if(c.p.footerrow){a("table:first",c.grid.sDiv).width(c.p.tblwidth);
126
- c.grid.sDiv.scrollLeft=c.grid.bDiv.scrollLeft}c.p.shrinkToFit===true&&a(c).jqGrid("setGridWidth",c.grid.width-0.0010,true)}}})},hideCol:function(b){return this.each(function(){a(this).jqGrid("ShowHideCol",b,"none")})},showCol:function(b){return this.each(function(){a(this).jqGrid("ShowHideCol",b,"")})},remapColumns:function(b,e,c){function f(h){var d;d=h.length?a.makeArray(h):a.extend({},h);a.each(b,function(n){h[n]=d[this]})}function g(h,d){a(">tr"+(d||""),h).each(function(){var n=this,k=a.makeArray(n.cells);
127
- a.each(b,function(){var o=k[this];o&&n.appendChild(o)})})}var j=this.get(0);f(j.p.colModel);f(j.p.colNames);f(j.grid.headers);g(a("thead:first",j.grid.hDiv),c&&":not(.ui-jqgrid-labels)");e&&g(a("#"+a.jgrid.jqID(j.p.id)+" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot");j.p.footerrow&&g(a("tbody:first",j.grid.sDiv));if(j.p.remapColumns)if(j.p.remapColumns.length)f(j.p.remapColumns);else j.p.remapColumns=a.makeArray(b);j.p.lastsort=a.inArray(j.p.lastsort,b);if(j.p.treeGrid)j.p.expColInd=a.inArray(j.p.expColInd,
128
- b)},setGridWidth:function(b,e){return this.each(function(){if(this.grid){var c=this,f,g=0,j=c.p.cellLayout,h,d=0,n=false,k=c.p.scrollOffset,o,m=0,l=0,q=0,s;if(typeof e!="boolean")e=c.p.shrinkToFit;if(!isNaN(b)){b=parseInt(b,10);c.grid.width=c.p.width=b;a("#gbox_"+a.jgrid.jqID(c.p.id)).css("width",b+"px");a("#gview_"+a.jgrid.jqID(c.p.id)).css("width",b+"px");a(c.grid.bDiv).css("width",b+"px");a(c.grid.hDiv).css("width",b+"px");c.p.pager&&a(c.p.pager).css("width",b+"px");c.p.toppager&&a(c.p.toppager).css("width",
129
- b+"px");if(c.p.toolbar[0]===true){a(c.grid.uDiv).css("width",b+"px");c.p.toolbar[1]=="both"&&a(c.grid.ubDiv).css("width",b+"px")}c.p.footerrow&&a(c.grid.sDiv).css("width",b+"px");if(e===false&&c.p.forceFit===true)c.p.forceFit=false;if(e===true){if(a.browser.safari)j=0;a.each(c.p.colModel,function(){if(this.hidden===false){g+=parseInt(this.width,10);if(this.fixed){l+=this.width;m+=this.width+j}else d++;q++}});if(d!==0){c.p.tblwidth=g;o=b-j*d-m;if(!isNaN(c.p.height))if(a(c.grid.bDiv)[0].clientHeight<
130
- a(c.grid.bDiv)[0].scrollHeight||c.rows.length===1){n=true;o-=k}g=0;var p=c.grid.cols.length>0;a.each(c.p.colModel,function(r){if(this.hidden===false&&!this.fixed){f=Math.round(o*this.width/(c.p.tblwidth-l));if(!(f<0)){this.width=f;g+=f;c.grid.headers[r].width=f;c.grid.headers[r].el.style.width=f+"px";if(c.p.footerrow)c.grid.footers[r].style.width=f+"px";if(p)c.grid.cols[r].style.width=f+"px";h=r}}});s=0;if(n){if(b-m-(g+j*d)!==k)s=b-m-(g+j*d)-k}else if(Math.abs(b-m-(g+j*d))!==1)s=b-m-(g+j*d);c.p.colModel[h].width+=
131
- s;c.p.tblwidth=g+s+l+j*q;if(c.p.tblwidth>b){n=c.p.tblwidth-parseInt(b,10);c.p.tblwidth=b;f=c.p.colModel[h].width-=n}else f=c.p.colModel[h].width;c.grid.headers[h].width=f;c.grid.headers[h].el.style.width=f+"px";if(p)c.grid.cols[h].style.width=f+"px";a("table:first",c.grid.bDiv).css("width",c.p.tblwidth+"px");a("table:first",c.grid.hDiv).css("width",c.p.tblwidth+"px");c.grid.hDiv.scrollLeft=c.grid.bDiv.scrollLeft;if(c.p.footerrow){c.grid.footers[h].style.width=f+"px";a("table:first",c.grid.sDiv).css("width",
132
- c.p.tblwidth+"px")}}}}}})},setGridHeight:function(b){return this.each(function(){if(this.grid){a(this.grid.bDiv).css({height:b+(isNaN(b)?"":"px")});this.p.height=b;this.p.scroll&&this.grid.populateVisible()}})},setCaption:function(b){return this.each(function(){this.p.caption=b;a("span.ui-jqgrid-title",this.grid.cDiv).html(b);a(this.grid.cDiv).show()})},setLabel:function(b,e,c,f){return this.each(function(){var g=-1;if(this.grid){if(isNaN(b))a(this.p.colModel).each(function(d){if(this.name==b){g=
133
- d;return false}});else g=parseInt(b,10);if(g>=0){var j=a("tr.ui-jqgrid-labels th:eq("+g+")",this.grid.hDiv);if(e){var h=a(".s-ico",j);a("[id^=jqgh_]",j).empty().html(e).append(h);this.p.colNames[g]=e}if(c)typeof c==="string"?a(j).addClass(c):a(j).css(c);typeof f==="object"&&a(j).attr(f)}}})},setCell:function(b,e,c,f,g,j){return this.each(function(){var h=-1,d,n;if(this.grid){if(isNaN(e))a(this.p.colModel).each(function(o){if(this.name==e){h=o;return false}});else h=parseInt(e,10);if(h>=0)if(d=this.rows.namedItem(b)){var k=
134
- a("td:eq("+h+")",d);if(c!==""||j===true){d=this.formatter(b,c,h,d,"edit");n=this.p.colModel[h].title?{title:a.jgrid.stripHtml(d)}:{};this.p.treeGrid&&a(".tree-wrap",a(k)).length>0?a("span",a(k)).html(d).attr(n):a(k).html(d).attr(n);if(this.p.datatype=="local"){d=this.p.colModel[h];c=d.formatter&&typeof d.formatter==="string"&&d.formatter=="date"?a.unformat.date(c,d):c;n=this.p._index[b];if(typeof n!="undefined")this.p.data[n][d.name]=c}}if(typeof f==="string")a(k).addClass(f);else f&&a(k).css(f);
135
- typeof g==="object"&&a(k).attr(g)}}})},getCell:function(b,e){var c=false;this.each(function(){var f=-1;if(this.grid){if(isNaN(e))a(this.p.colModel).each(function(h){if(this.name===e){f=h;return false}});else f=parseInt(e,10);if(f>=0){var g=this.rows.namedItem(b);if(g)try{c=a.unformat(a("td:eq("+f+")",g),{rowId:g.id,colModel:this.p.colModel[f]},f)}catch(j){c=a.jgrid.htmlDecode(a("td:eq("+f+")",g).html())}}}});return c},getCol:function(b,e,c){var f=[],g,j=0,h=0,d=0,n;e=typeof e!="boolean"?false:e;if(typeof c==
136
- "undefined")c=false;this.each(function(){var k=-1;if(this.grid){if(isNaN(b))a(this.p.colModel).each(function(q){if(this.name===b){k=q;return false}});else k=parseInt(b,10);if(k>=0){var o=this.rows.length,m=0;if(o&&o>0){for(;m<o;){if(a(this.rows[m]).hasClass("jqgrow")){try{g=a.unformat(a(this.rows[m].cells[k]),{rowId:this.rows[m].id,colModel:this.p.colModel[k]},k)}catch(l){g=a.jgrid.htmlDecode(this.rows[m].cells[k].innerHTML)}if(c){n=parseFloat(g);j+=n;h=Math.min(h,n);d=Math.max(h,n)}else e?f.push({id:this.rows[m].id,
137
- value:g}):f.push(g)}m++}if(c)switch(c.toLowerCase()){case "sum":f=j;break;case "avg":f=j/o;break;case "count":f=o;break;case "min":f=h;break;case "max":f=d}}}}});return f},clearGridData:function(b){return this.each(function(){if(this.grid){if(typeof b!="boolean")b=false;if(this.p.deepempty)a("#"+a.jgrid.jqID(this.p.id)+" tbody:first tr:gt(0)").remove();else{var e=a("#"+a.jgrid.jqID(this.p.id)+" tbody:first tr:first")[0];a("#"+a.jgrid.jqID(this.p.id)+" tbody:first").empty().append(e)}this.p.footerrow&&
138
- b&&a(".ui-jqgrid-ftable td",this.grid.sDiv).html("&#160;");this.p.selrow=null;this.p.selarrrow=[];this.p.savedRow=[];this.p.records=0;this.p.page=1;this.p.lastpage=0;this.p.reccount=0;this.p.data=[];this.p_index={};this.updatepager(true,false)}})},getInd:function(b,e){var c=false,f;this.each(function(){if(f=this.rows.namedItem(b))c=e===true?f:f.rowIndex});return c},bindKeys:function(b){var e=a.extend({onEnter:null,onSpace:null,onLeftKey:null,onRightKey:null,scrollingRows:true},b||{});return this.each(function(){var c=
139
- this;a("body").is("[role]")||a("body").attr("role","application");c.p.scrollrows=e.scrollingRows;a(c).keydown(function(f){var g=a(c).find("tr[tabindex=0]")[0],j,h,d,n=c.p.treeReader.expanded_field;if(g){d=c.p._index[g.id];if(f.keyCode===37||f.keyCode===38||f.keyCode===39||f.keyCode===40){if(f.keyCode===38){h=g.previousSibling;j="";if(h)if(a(h).is(":hidden"))for(;h;){h=h.previousSibling;if(!a(h).is(":hidden")&&a(h).hasClass("jqgrow")){j=h.id;break}}else j=h.id;a(c).jqGrid("setSelection",j)}if(f.keyCode===
140
- 40){h=g.nextSibling;j="";if(h)if(a(h).is(":hidden"))for(;h;){h=h.nextSibling;if(!a(h).is(":hidden")&&a(h).hasClass("jqgrow")){j=h.id;break}}else j=h.id;a(c).jqGrid("setSelection",j)}if(f.keyCode===37){c.p.treeGrid&&c.p.data[d][n]&&a(g).find("div.treeclick").trigger("click");a.isFunction(e.onLeftKey)&&e.onLeftKey.call(c,c.p.selrow)}if(f.keyCode===39){c.p.treeGrid&&!c.p.data[d][n]&&a(g).find("div.treeclick").trigger("click");a.isFunction(e.onRightKey)&&e.onRightKey.call(c,c.p.selrow)}return false}else if(f.keyCode===
141
- 13){a.isFunction(e.onEnter)&&e.onEnter.call(c,c.p.selrow);return false}else if(f.keyCode===32){a.isFunction(e.onSpace)&&e.onSpace.call(c,c.p.selrow);return false}}})})},unbindKeys:function(){return this.each(function(){a(this).unbind("keydown")})}})})(jQuery);
82
+ a("thead tr:first th",this).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});if(this.p.multiselect){var ka=[],ba;a("#cb_"+a.jgrid.jqID(d.p.id),this).bind("click",function(){d.p.selarrrow=[];if(this.checked){a("[id^=jqg_"+d.p.id+"_]").attr("checked","checked");a(d.rows).each(function(u){if(u>0)if(!a(this).hasClass("subgrid")&&!a(this).hasClass("jqgroup")){a(this).addClass("ui-state-highlight").attr("aria-selected","true");d.p.selarrrow.push(this.id);
83
+ d.p.selrow=this.id}});ba=true;ka=[]}else{a("[id^=jqg_"+d.p.id+"_]").removeAttr("checked");a(d.rows).each(function(u){if(u>0)if(!a(this).hasClass("subgrid")){a(this).removeClass("ui-state-highlight").attr("aria-selected","false");ka.push(this.id)}});d.p.selrow=null;ba=false}if(a.isFunction(d.p.onSelectAll))d.p.onSelectAll.call(d,ba?d.p.selarrrow:ka,ba)})}if(d.p.autowidth===true){oa=a(l).innerWidth();d.p.width=oa>0?oa:"nw"}(function(){var u=0,v=d.p.cellLayout,w=0,D,E=d.p.scrollOffset,S,H=false,X,K=
84
+ 0,N=0,P=0,L;if(m)v=0;a.each(d.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){u+=q(this.width,0);if(this.fixed){K+=this.width;N+=this.width+v}else w++;P++}});if(d.p.shrinkToFit===false)u+=v*P;if(isNaN(d.p.width))d.p.width=g.width=u;else g.width=d.p.width;d.p.tblwidth=u;if(d.p.shrinkToFit===false&&d.p.forceFit===true)d.p.forceFit=false;if(d.p.shrinkToFit===true&&w>0){X=g.width-v*w-N;if(!isNaN(d.p.height)){X-=E;H=true}u=0;a.each(d.p.colModel,function(Y){if(this.hidden===
85
+ false&&!this.fixed){this.width=S=Math.round(X*this.width/(d.p.tblwidth-K));u+=S;D=Y}});L=0;if(H){if(g.width-N-(u+v*w)!==E)L=g.width-N-(u+v*w)-E}else if(!H&&Math.abs(g.width-N-(u+v*w))!==1)L=g.width-N-(u+v*w);d.p.colModel[D].width+=L;d.p.tblwidth=u+L+K+P*v;if(d.p.tblwidth>d.p.width){d.p.colModel[D].width-=d.p.tblwidth-parseInt(d.p.width,10);d.p.tblwidth=d.p.width}}})();a(l).css("width",g.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+d.p.id+"'>&#160;</div>");a(o).css("width",g.width+
86
+ "px");oa=a("thead:first",d).get(0);var la="";if(d.p.footerrow)la+="<table role='grid' style='width:"+d.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+h+"'>";o=a("tr:first",oa);var da="<tr class='jqgfirstrow' role='row' style='height:auto'>";d.p.disableClick=false;a("th",o).each(function(u){I=d.p.colModel[u].width;if(typeof d.p.colModel[u].resizable==="undefined")d.p.colModel[u].resizable=true;if(d.p.colModel[u].resizable){T=
87
+ document.createElement("span");a(T).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+h);a.browser.opera||a(T).css("cursor","col-resize");a(this).addClass(d.p.resizeclass)}else T="";a(this).css("width",I+"px").prepend(T);var v="";if(d.p.colModel[u].hidden){a(this).css("display","none");v="display:none;"}da+="<td role='gridcell' style='height:0px;width:"+I+"px;"+v+"'></td>";g.headers[u]={width:I,el:this};O=d.p.colModel[u].sortable;if(typeof O!=="boolean")O=d.p.colModel[u].sortable=true;
88
+ v=d.p.colModel[u].name;v=="cb"||v=="subgrid"||v=="rn"||d.p.viewsortcols[2]&&a("div",this).addClass("ui-jqgrid-sortable");if(O)if(d.p.viewsortcols[0]){a("div span.s-ico",this).show();u==d.p.lastsort&&a("div span.ui-icon-"+d.p.sortorder,this).removeClass("ui-state-disabled")}else if(u==d.p.lastsort){a("div span.s-ico",this).show();a("div span.ui-icon-"+d.p.sortorder,this).removeClass("ui-state-disabled")}if(d.p.footerrow)la+="<td role='gridcell' "+s(u,0,"",null,"",false)+">&#160;</td>"}).mousedown(function(u){if(a(u.target).closest("th>span.ui-jqgrid-resize").length==
89
+ 1){var v=a.jgrid.getCellIndex(this);if(d.p.forceFit===true){var w=d.p,D=v,E;for(E=v+1;E<d.p.colModel.length;E++)if(d.p.colModel[E].hidden!==true){D=E;break}w.nv=D-v}g.dragStart(v,u,sa(v));return false}}).click(function(u){if(d.p.disableClick)return d.p.disableClick=false;var v="th>div.ui-jqgrid-sortable",w,D;d.p.viewsortcols[2]||(v="th>div>span>span.ui-grid-ico-sort");u=a(u.target).closest(v);if(u.length==1){v=a.jgrid.getCellIndex(this);if(!d.p.viewsortcols[2]){w=true;D=u.attr("sort")}ia(a("div",
90
+ this)[0].id,v,w,D);return false}});if(d.p.sortable&&a.fn.sortable)try{a(d).jqGrid("sortableColumns",o)}catch(ta){}if(d.p.footerrow)la+="</tr></tbody></table>";da+="</tr>";this.appendChild(document.createElement("tbody"));a(this).addClass("ui-jqgrid-btable").append(da);da=null;o=a("<table class='ui-jqgrid-htable' style='width:"+d.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(oa);var ca=d.p.caption&&d.p.hiddengrid===true?
91
+ true:false;j=a("<div class='ui-jqgrid-hbox"+(h=="rtl"?"-rtl":"")+"'></div>");oa=null;g.hDiv=document.createElement("div");a(g.hDiv).css({width:g.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(j);a(j).append(o);o=null;ca&&a(g.hDiv).hide();if(d.p.pager){if(typeof d.p.pager=="string"){if(d.p.pager.substr(0,1)!="#")d.p.pager="#"+d.p.pager}else d.p.pager="#"+a(d.p.pager).attr("id");a(d.p.pager).css({width:g.width+"px"}).appendTo(l).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom");
92
+ ca&&a(d.p.pager).hide();k(d.p.pager,"")}d.p.cellEdit===false&&d.p.hoverrows===true&&a(d).bind("mouseover",function(u){R=a(u.target).closest("tr.jqgrow");a(R).attr("class")!=="subgrid"&&a(R).addClass("ui-state-hover");return false}).bind("mouseout",function(u){R=a(u.target).closest("tr.jqgrow");a(R).removeClass("ui-state-hover");return false});var va,na;a(d).before(g.hDiv).click(function(u){W=u.target;var v=a(W).hasClass("cbox");R=a(W,d.rows).closest("tr.jqgrow");if(a(R).length===0)return this;var w=
93
+ true;if(a.isFunction(d.p.beforeSelectRow))w=d.p.beforeSelectRow.call(d,R[0].id,u);if(W.tagName=="A"||(W.tagName=="INPUT"||W.tagName=="TEXTAREA"||W.tagName=="OPTION"||W.tagName=="SELECT")&&!v)return this;if(w===true){if(d.p.cellEdit===true)if(d.p.multiselect&&v)a(d).jqGrid("setSelection",R[0].id,true);else{va=R[0].rowIndex;na=a.jgrid.getCellIndex(W);try{a(d).jqGrid("editCell",va,na,true)}catch(D){}}else if(d.p.multikey)if(u[d.p.multikey])a(d).jqGrid("setSelection",R[0].id,true);else{if(d.p.multiselect&&
94
+ v){v=a("[id^=jqg_"+d.p.id+"_]").attr("checked");a("[id^=jqg_"+d.p.id+"_]").attr("checked",!v)}}else{if(d.p.multiselect&&d.p.multiboxonly)if(!v){a(d.p.selarrrow).each(function(E,S){var H=d.rows.namedItem(S);a(H).removeClass("ui-state-highlight");a("#jqg_"+a.jgrid.jqID(d.p.id)+"_"+a.jgrid.jqID(S)).attr("checked",false)});d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false)}a(d).jqGrid("setSelection",R[0].id,true)}if(a.isFunction(d.p.onCellSelect)){va=R[0].id;na=a.jgrid.getCellIndex(W);
95
+ d.p.onCellSelect.call(d,va,na,a(W).html(),u)}u.stopPropagation()}else return this}).bind("reloadGrid",function(u,v){if(d.p.treeGrid===true)d.p.datatype=d.p.treedatatype;v&&v.current&&d.grid.selectionPreserver(d);if(d.p.datatype=="local"){a(d).jqGrid("resetSelection");d.p.data.length&&A()}else if(!d.p.treeGrid){d.p.selrow=null;if(d.p.multiselect){d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false)}d.p.savedRow=[]}d.p.scroll&&C(d.grid.bDiv,true,false);if(v&&v.page){var w=
96
+ v.page;if(w>d.p.lastpage)w=d.p.lastpage;if(w<1)w=1;d.p.page=w;d.grid.bDiv.scrollTop=d.grid.prevRowHeight?(w-1)*d.grid.prevRowHeight*d.p.rowNum:0}if(d.grid.prevRowHeight&&d.p.scroll){delete d.p.lastpage;d.grid.populateVisible()}else d.grid.populate();return false});a.isFunction(this.p.ondblClickRow)&&a(this).dblclick(function(u){W=u.target;R=a(W,d.rows).closest("tr.jqgrow");if(a(R).length===0)return false;va=R[0].rowIndex;na=a.jgrid.getCellIndex(W);d.p.ondblClickRow.call(d,a(R).attr("id"),va,na,u);
97
+ return false});g.bDiv=document.createElement("div");a(g.bDiv).append(a('<div style="position:relative;'+(n&&a.browser.version<8?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:d.p.height+(isNaN(d.p.height)?"":"px"),width:g.width+"px"}).scroll(g.scrollGrid);a("table:first",g.bDiv).css({width:d.p.tblwidth+"px"});if(n){a("tbody",this).size()==2&&a("tbody:gt(0)",this).remove();d.p.multikey&&a(g.bDiv).bind("selectstart",function(){return false})}else d.p.multikey&&
98
+ a(g.bDiv).bind("mousedown",function(){return false});ca&&a(g.bDiv).hide();g.cDiv=document.createElement("div");var wa=d.p.hidegrid===true?a("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){wa.addClass("ui-state-hover")},function(){wa.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css(h=="rtl"?"left":"right","0px"):"";a(g.cDiv).append(wa).append("<span class='ui-jqgrid-title"+(h=="rtl"?
99
+ "-rtl":"")+"'>"+d.p.caption+"</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");a(g.cDiv).insertBefore(g.hDiv);if(d.p.toolbar[0]){g.uDiv=document.createElement("div");if(d.p.toolbar[1]=="top")a(g.uDiv).insertBefore(g.hDiv);else d.p.toolbar[1]=="bottom"&&a(g.uDiv).insertAfter(g.hDiv);if(d.p.toolbar[1]=="both"){g.ubDiv=document.createElement("div");a(g.uDiv).insertBefore(g.hDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);a(g.ubDiv).insertAfter(g.hDiv).addClass("ui-userdata ui-state-default").attr("id",
100
+ "tb_"+this.id);ca&&a(g.ubDiv).hide()}else a(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);ca&&a(g.uDiv).hide()}if(d.p.toppager){d.p.toppager=a.jgrid.jqID(d.p.id)+"_toppager";g.topDiv=a("<div id='"+d.p.toppager+"'></div>")[0];d.p.toppager="#"+d.p.toppager;a(g.topDiv).insertBefore(g.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width);k(d.p.toppager,"_t")}if(d.p.footerrow){g.sDiv=a("<div class='ui-jqgrid-sdiv'></div>")[0];j=a("<div class='ui-jqgrid-hbox"+
101
+ (h=="rtl"?"-rtl":"")+"'></div>");a(g.sDiv).append(j).insertAfter(g.hDiv).width(g.width);a(j).append(la);g.footers=a(".ui-jqgrid-ftable",g.sDiv)[0].rows[0].cells;if(d.p.rownumbers)g.footers[0].className="ui-state-default jqgrid-rownum";ca&&a(g.sDiv).hide()}j=null;if(d.p.caption){var Ga=d.p.datatype;if(d.p.hidegrid===true){a(".ui-jqgrid-titlebar-close",g.cDiv).click(function(u){var v=a.isFunction(d.p.onHeaderClick),w=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",D,E=this;if(d.p.toolbar[0]===
102
+ true){if(d.p.toolbar[1]=="both")w+=", #"+a(g.ubDiv).attr("id");w+=", #"+a(g.uDiv).attr("id")}D=a(w,"#gview_"+a.jgrid.jqID(d.p.id)).length;if(d.p.gridstate=="visible")a(w,"#gbox_"+a.jgrid.jqID(d.p.id)).slideUp("fast",function(){D--;if(D===0){a("span",E).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");d.p.gridstate="hidden";a("#gbox_"+a.jgrid.jqID(d.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(d.p.id)).hide();if(v)ca||d.p.onHeaderClick.call(d,
103
+ d.p.gridstate,u)}});else d.p.gridstate=="hidden"&&a(w,"#gbox_"+a.jgrid.jqID(d.p.id)).slideDown("fast",function(){D--;if(D===0){a("span",E).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(ca){d.p.datatype=Ga;$();ca=false}d.p.gridstate="visible";a("#gbox_"+a.jgrid.jqID(d.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(d.p.id)).show();if(v)ca||d.p.onHeaderClick.call(d,d.p.gridstate,u)}});return false});if(ca){d.p.datatype="local";a(".ui-jqgrid-titlebar-close",
104
+ g.cDiv).trigger("click")}}}else a(g.cDiv).hide();a(g.hDiv).after(g.bDiv).mousemove(function(u){if(g.resizing){g.dragMove(u);return false}});a(".ui-jqgrid-labels",g.hDiv).bind("selectstart",function(){return false});a(document).mouseup(function(){if(g.resizing){g.dragEnd();return false}return true});d.formatCol=s;d.sortData=ia;d.updatepager=function(u,v){var w,D,E,S,H,X,K,N="";E=parseInt(d.p.page,10)-1;if(E<0)E=0;E*=parseInt(d.p.rowNum,10);H=E+d.p.reccount;if(d.p.scroll){w=a("tbody:first > tr:gt(0)",
105
+ d.grid.bDiv);E=H-w.length;d.p.reccount=w.length;if(D=w.outerHeight()||d.grid.prevRowHeight){w=E*D;D=parseInt(d.p.records,10)*D;a(">div:first",d.grid.bDiv).css({height:D}).children("div:first").css({height:w,display:w?"":"none"})}d.grid.bDiv.scrollLeft=d.grid.hDiv.scrollLeft}N=d.p.pager?d.p.pager:"";N+=d.p.toppager?N?","+d.p.toppager:d.p.toppager:"";if(N){K=a.jgrid.formatter.integer||{};w=q(d.p.page);D=q(d.p.lastpage);a(".selbox",N).attr("disabled",false);if(d.p.pginput===true){a(".ui-pg-input",N).val(d.p.page);
106
+ a("#sp_1",N).html(a.fmatter?a.fmatter.util.NumberFormat(d.p.lastpage,K):d.p.lastpage)}if(d.p.viewrecords)if(d.p.reccount===0)a(".ui-paging-info",N).html(d.p.emptyrecords);else{S=E+1;X=d.p.records;if(a.fmatter){S=a.fmatter.util.NumberFormat(S,K);H=a.fmatter.util.NumberFormat(H,K);X=a.fmatter.util.NumberFormat(X,K)}a(".ui-paging-info",N).html(a.jgrid.format(d.p.recordtext,S,H,X))}if(d.p.pgbuttons===true){if(w<=0)w=D=0;if(w==1||w===0){a("#first, #prev",d.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");
107
+ d.p.toppager&&a("#first_t, #prev_t",d.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#first, #prev",d.p.pager).removeClass("ui-state-disabled");d.p.toppager&&a("#first_t, #prev_t",d.p.toppager).removeClass("ui-state-disabled")}if(w==D||w===0){a("#next, #last",d.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");d.p.toppager&&a("#next_t, #last_t",d.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#next, #last",d.p.pager).removeClass("ui-state-disabled");
108
+ d.p.toppager&&a("#next_t, #last_t",d.p.toppager).removeClass("ui-state-disabled")}}}u===true&&d.p.rownumbers===true&&a("td.jqgrid-rownum",d.rows).each(function(P){a(this).html(E+1+P)});v&&d.p.jqgdnd&&a(d).jqGrid("gridDnD","updateDnD");a.isFunction(d.p.gridComplete)&&d.p.gridComplete.call(d)};d.refreshIndex=A;d.formatter=function(u,v,w,D,E){return r(u,v,w,D,E)};a.extend(g,{populate:$,emptyRows:C});this.grid=g;d.addXmlData=function(u){z(u,d.grid.bDiv)};d.addJSONData=function(u){M(u,d.grid.bDiv)};this.grid.cols=
109
+ this.rows[0].cells;$();d.p.hiddengrid=false;a(window).unload(function(){d=null})}}}})};a.jgrid.extend({getGridParam:function(b){var e=this[0];if(e&&e.grid)return b?typeof e.p[b]!="undefined"?e.p[b]:null:e.p},setGridParam:function(b){return this.each(function(){this.grid&&typeof b==="object"&&a.extend(true,this.p,b)})},getDataIDs:function(){var b=[],e=0,c,f=0;this.each(function(){if((c=this.rows.length)&&c>0)for(;e<c;){if(a(this.rows[e]).hasClass("jqgrow")){b[f]=this.rows[e].id;f++}e++}});return b},
110
+ setSelection:function(b,e){return this.each(function(){function c(d){var o=a(f.grid.bDiv)[0].clientHeight,k=a(f.grid.bDiv)[0].scrollTop,n=f.rows[d].offsetTop;d=f.rows[d].clientHeight;if(n+d>=o+k)a(f.grid.bDiv)[0].scrollTop=n-(o+k)+d+k;else if(n<o+k)if(n<k)a(f.grid.bDiv)[0].scrollTop=n}var f=this,g,j,h;if(b!==undefined){e=e===false?false:true;if(j=f.rows.namedItem(b+"")){if(f.p.scrollrows===true){g=f.rows.namedItem(b).rowIndex;g>=0&&c(g)}if(f.p.multiselect){f.p.selrow=j.id;h=a.inArray(f.p.selrow,f.p.selarrrow);
111
+ if(h===-1){j.className!=="ui-subgrid"&&a(j).addClass("ui-state-highlight").attr("aria-selected","true");g=true;a("#jqg_"+a.jgrid.jqID(f.p.id)+"_"+a.jgrid.jqID(f.p.selrow)).attr("checked",g);f.p.selarrrow.push(f.p.selrow)}else{j.className!=="ui-subgrid"&&a(j).removeClass("ui-state-highlight").attr("aria-selected","false");g=false;a("#jqg_"+a.jgrid.jqID(f.p.id)+"_"+a.jgrid.jqID(f.p.selrow)).attr("checked",g);f.p.selarrrow.splice(h,1);h=f.p.selarrrow[0];f.p.selrow=h===undefined?null:h}f.p.onSelectRow&&
112
+ e&&f.p.onSelectRow.call(f,j.id,g)}else if(j.className!=="ui-subgrid"){if(f.p.selrow!=j.id){a(f.rows.namedItem(f.p.selrow)).removeClass("ui-state-highlight").attr({"aria-selected":"false",tabindex:"-1"});a(j).addClass("ui-state-highlight").attr({"aria-selected":true,tabindex:"0"});g=true}else g=false;f.p.selrow=j.id;f.p.onSelectRow&&e&&f.p.onSelectRow.call(f,j.id,g)}}}})},resetSelection:function(){return this.each(function(){var b=this,e;if(b.p.multiselect){a(b.p.selarrrow).each(function(c,f){e=b.rows.namedItem(f);
113
+ a(e).removeClass("ui-state-highlight").attr("aria-selected","false");a("#jqg_"+a.jgrid.jqID(b.p.id)+"_"+a.jgrid.jqID(f)).attr("checked",false)});a("#cb_"+a.jgrid.jqID(b.p.id)).attr("checked",false);b.p.selarrrow=[]}else if(b.p.selrow){a("#"+a.jgrid.jqID(b.p.id)+" tbody:first tr#"+a.jgrid.jqID(b.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false");b.p.selrow=null}b.p.savedRow=[]})},getRowData:function(b){var e={},c,f=false,g,j=0;this.each(function(){var h=this,d,o;if(typeof b==
114
+ "undefined"){f=true;c=[];g=h.rows.length}else{o=h.rows.namedItem(b);if(!o)return e;g=2}for(;j<g;){if(f)o=h.rows[j];if(a(o).hasClass("jqgrow")){a("td",o).each(function(k){d=h.p.colModel[k].name;if(d!=="cb"&&d!=="subgrid"&&d!=="rn")if(h.p.treeGrid===true&&d==h.p.ExpandColumn)e[d]=a.jgrid.htmlDecode(a("span:first",this).html());else try{e[d]=a.unformat(this,{rowId:o.id,colModel:h.p.colModel[k]},k)}catch(n){e[d]=a.jgrid.htmlDecode(a(this).html())}});if(f){c.push(e);e={}}}j++}});return c?c:e},delRowData:function(b){var e=
115
+ false,c,f;this.each(function(){if(c=this.rows.namedItem(b)){a(c).remove();this.p.records--;this.p.reccount--;this.updatepager(true,false);e=true;if(this.p.multiselect){f=a.inArray(b,this.p.selarrrow);f!=-1&&this.p.selarrrow.splice(f,1)}if(b==this.p.selrow)this.p.selrow=null}else return false;if(this.p.datatype=="local"){var g=this.p._index[b];if(typeof g!="undefined"){this.p.data.splice(g,1);this.refreshIndex()}}if(this.p.altRows===true&&e){var j=this.p.altclass;a(this.rows).each(function(h){h%2==
116
+ 1?a(this).addClass(j):a(this).removeClass(j)})}});return e},setRowData:function(b,e,c){var f,g=true,j;this.each(function(){if(!this.grid)return false;var h=this,d,o,k=typeof c,n={};o=h.rows.namedItem(b);if(!o)return false;if(e)try{a(this.p.colModel).each(function(s){f=this.name;if(e[f]!==undefined){n[f]=this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"?a.unformat.date(e[f],this):e[f];d=h.formatter(b,e[f],s,e,"edit");j=this.title?{title:a.jgrid.stripHtml(d)}:{};h.p.treeGrid===
117
+ true&&f==h.p.ExpandColumn?a("td:eq("+s+") > span:first",o).html(d).attr(j):a("td:eq("+s+")",o).html(d).attr(j)}});if(h.p.datatype=="local"){var m=h.p._index[b];if(h.p.treeGrid)for(var l in h.p.treeReader)n.hasOwnProperty(h.p.treeReader[l])&&delete n[h.p.treeReader[l]];if(typeof m!="undefined")h.p.data[m]=a.extend(true,h.p.data[m],n);n=null}}catch(q){g=false}if(g)if(k==="string")a(o).addClass(c);else k==="object"&&a(o).css(c)});return g},addRowData:function(b,e,c,f){c||(c="last");var g=false,j,h,d,
118
+ o,k,n,m,l,q="",s,p,r,t,y;if(e){if(a.isArray(e)){s=true;c="last";p=b}else{e=[e];s=false}this.each(function(){var B=e.length;k=this.p.rownumbers===true?1:0;d=this.p.multiselect===true?1:0;o=this.p.subGrid===true?1:0;if(!s)if(typeof b!="undefined")b+="";else{b=a.jgrid.randId();if(this.p.keyIndex!==false){p=this.p.colModel[this.p.keyIndex+d+o+k].name;if(typeof e[0][p]!="undefined")b=e[0][p]}}r=this.p.altclass;for(var G=0,x="",C={},A=a.isFunction(this.p.afterInsertRow)?true:false;G<B;){t=e[G];h="";if(s){try{b=
119
+ t[p]}catch(z){b=a.jgrid.randId()}x=this.p.altRows===true?(this.rows.length-1)%2===0?r:"":""}if(k){q=this.formatCol(0,1,"",null,b,true);h+='<td role="gridcell" aria-describedby="'+this.p.id+'_rn" class="ui-state-default jqgrid-rownum" '+q+">0</td>"}if(d){l='<input role="checkbox" type="checkbox" id="jqg_'+this.p.id+"_"+b+'" class="cbox"/>';q=this.formatCol(k,1,"",null,b,true);h+='<td role="gridcell" aria-describedby="'+this.p.id+'_cb" '+q+">"+l+"</td>"}if(o)h+=a(this).jqGrid("addSubGridCell",d+k,1);
120
+ for(m=d+o+k;m<this.p.colModel.length;m++){y=this.p.colModel[m];j=y.name;C[j]=y.formatter&&typeof y.formatter==="string"&&y.formatter=="date"?a.unformat.date(t[j],y):t[j];l=this.formatter(b,a.jgrid.getAccessor(t,j),m,t,"edit");q=this.formatCol(m,1,l,b,t,true);h+='<td role="gridcell" aria-describedby="'+this.p.id+"_"+j+'" '+q+">"+l+"</td>"}h='<tr id="'+b+'" role="row" tabindex="-1" class="ui-widget-content jqgrow ui-row-'+this.p.direction+" "+x+'">'+h+"</tr>";if(this.p.subGrid===true){h=a(h)[0];a(this).jqGrid("addSubGrid",
121
+ h,d+k)}if(this.rows.length===0)a("table:first",this.grid.bDiv).append(h);else switch(c){case "last":a(this.rows[this.rows.length-1]).after(h);break;case "first":a(this.rows[0]).after(h);break;case "after":if(n=this.rows.namedItem(f))a(this.rows[n.rowIndex+1]).hasClass("ui-subgrid")?a(this.rows[n.rowIndex+1]).after(h):a(n).after(h);break;case "before":if(n=this.rows.namedItem(f)){a(n).before(h);n=n.rowIndex}}this.p.records++;this.p.reccount++;A&&this.p.afterInsertRow.call(this,b,t,t);G++;if(this.p.datatype==
122
+ "local"){C[this.p.localReader.id]=b;this.p._index[b]=this.p.data.length;this.p.data.push(C);C={}}}if(this.p.altRows===true&&!s)if(c=="last")(this.rows.length-1)%2==1&&a(this.rows[this.rows.length-1]).addClass(r);else a(this.rows).each(function(M){M%2==1?a(this).addClass(r):a(this).removeClass(r)});this.updatepager(true,true);g=true})}return g},footerData:function(b,e,c){function f(o){for(var k in o)if(o.hasOwnProperty(k))return false;return true}var g,j=false,h={},d;if(typeof b=="undefined")b="get";
123
+ if(typeof c!="boolean")c=true;b=b.toLowerCase();this.each(function(){var o=this,k;if(!o.grid||!o.p.footerrow)return false;if(b=="set")if(f(e))return false;j=true;a(this.p.colModel).each(function(n){g=this.name;if(b=="set"){if(e[g]!==undefined){k=c?o.formatter("",e[g],n,e,"edit"):e[g];d=this.title?{title:a.jgrid.stripHtml(k)}:{};a("tr.footrow td:eq("+n+")",o.grid.sDiv).html(k).attr(d);j=true}}else if(b=="get")h[g]=a("tr.footrow td:eq("+n+")",o.grid.sDiv).html()})});return b=="get"?h:j},ShowHideCol:function(b,
124
+ e){return this.each(function(){var c=this,f=false;if(c.grid){if(typeof b==="string")b=[b];e=e!="none"?"":"none";var g=e===""?true:false;a(this.p.colModel).each(function(j){if(a.inArray(this.name,b)!==-1&&this.hidden===g){a("tr",c.grid.hDiv).each(function(){a(this).children("th:eq("+j+")").css("display",e)});a(c.rows).each(function(){a(this).children("td:eq("+j+")").css("display",e)});c.p.footerrow&&a(c.grid.sDiv).children("td:eq("+j+")").css("display",e);if(e=="none")c.p.tblwidth-=this.width+c.p.cellLayout;
125
+ else c.p.tblwidth+=this.width;this.hidden=!g;f=true}});if(f===true){a("table:first",c.grid.hDiv).width(c.p.tblwidth);a("table:first",c.grid.bDiv).width(c.p.tblwidth);c.grid.hDiv.scrollLeft=c.grid.bDiv.scrollLeft;if(c.p.footerrow){a("table:first",c.grid.sDiv).width(c.p.tblwidth);c.grid.sDiv.scrollLeft=c.grid.bDiv.scrollLeft}c.p.shrinkToFit===true&&a(c).jqGrid("setGridWidth",c.grid.width-0.0010,true)}}})},hideCol:function(b){return this.each(function(){a(this).jqGrid("ShowHideCol",b,"none")})},showCol:function(b){return this.each(function(){a(this).jqGrid("ShowHideCol",
126
+ b,"")})},remapColumns:function(b,e,c){function f(h){var d;d=h.length?a.makeArray(h):a.extend({},h);a.each(b,function(o){h[o]=d[this]})}function g(h,d){a(">tr"+(d||""),h).each(function(){var o=this,k=a.makeArray(o.cells);a.each(b,function(){var n=k[this];n&&o.appendChild(n)})})}var j=this.get(0);f(j.p.colModel);f(j.p.colNames);f(j.grid.headers);g(a("thead:first",j.grid.hDiv),c&&":not(.ui-jqgrid-labels)");e&&g(a("#"+a.jgrid.jqID(j.p.id)+" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot");j.p.footerrow&&
127
+ g(a("tbody:first",j.grid.sDiv));if(j.p.remapColumns)if(j.p.remapColumns.length)f(j.p.remapColumns);else j.p.remapColumns=a.makeArray(b);j.p.lastsort=a.inArray(j.p.lastsort,b);if(j.p.treeGrid)j.p.expColInd=a.inArray(j.p.expColInd,b)},setGridWidth:function(b,e){return this.each(function(){if(this.grid){var c=this,f,g=0,j=c.p.cellLayout,h,d=0,o=false,k=c.p.scrollOffset,n,m=0,l=0,q=0,s;if(typeof e!="boolean")e=c.p.shrinkToFit;if(!isNaN(b)){b=parseInt(b,10);c.grid.width=c.p.width=b;a("#gbox_"+a.jgrid.jqID(c.p.id)).css("width",
128
+ b+"px");a("#gview_"+a.jgrid.jqID(c.p.id)).css("width",b+"px");a(c.grid.bDiv).css("width",b+"px");a(c.grid.hDiv).css("width",b+"px");c.p.pager&&a(c.p.pager).css("width",b+"px");c.p.toppager&&a(c.p.toppager).css("width",b+"px");if(c.p.toolbar[0]===true){a(c.grid.uDiv).css("width",b+"px");c.p.toolbar[1]=="both"&&a(c.grid.ubDiv).css("width",b+"px")}c.p.footerrow&&a(c.grid.sDiv).css("width",b+"px");if(e===false&&c.p.forceFit===true)c.p.forceFit=false;if(e===true){if(a.browser.safari)j=0;a.each(c.p.colModel,
129
+ function(){if(this.hidden===false){g+=parseInt(this.width,10);if(this.fixed){l+=this.width;m+=this.width+j}else d++;q++}});if(d!==0){c.p.tblwidth=g;n=b-j*d-m;if(!isNaN(c.p.height))if(a(c.grid.bDiv)[0].clientHeight<a(c.grid.bDiv)[0].scrollHeight||c.rows.length===1){o=true;n-=k}g=0;var p=c.grid.cols.length>0;a.each(c.p.colModel,function(r){if(this.hidden===false&&!this.fixed){f=Math.round(n*this.width/(c.p.tblwidth-l));if(!(f<0)){this.width=f;g+=f;c.grid.headers[r].width=f;c.grid.headers[r].el.style.width=
130
+ f+"px";if(c.p.footerrow)c.grid.footers[r].style.width=f+"px";if(p)c.grid.cols[r].style.width=f+"px";h=r}}});s=0;if(o){if(b-m-(g+j*d)!==k)s=b-m-(g+j*d)-k}else if(Math.abs(b-m-(g+j*d))!==1)s=b-m-(g+j*d);c.p.colModel[h].width+=s;c.p.tblwidth=g+s+l+j*q;if(c.p.tblwidth>b){o=c.p.tblwidth-parseInt(b,10);c.p.tblwidth=b;f=c.p.colModel[h].width-=o}else f=c.p.colModel[h].width;c.grid.headers[h].width=f;c.grid.headers[h].el.style.width=f+"px";if(p)c.grid.cols[h].style.width=f+"px";a("table:first",c.grid.bDiv).css("width",
131
+ c.p.tblwidth+"px");a("table:first",c.grid.hDiv).css("width",c.p.tblwidth+"px");c.grid.hDiv.scrollLeft=c.grid.bDiv.scrollLeft;if(c.p.footerrow){c.grid.footers[h].style.width=f+"px";a("table:first",c.grid.sDiv).css("width",c.p.tblwidth+"px")}}}}}})},setGridHeight:function(b){return this.each(function(){if(this.grid){a(this.grid.bDiv).css({height:b+(isNaN(b)?"":"px")});this.p.height=b;this.p.scroll&&this.grid.populateVisible()}})},setCaption:function(b){return this.each(function(){this.p.caption=b;a("span.ui-jqgrid-title",
132
+ this.grid.cDiv).html(b);a(this.grid.cDiv).show()})},setLabel:function(b,e,c,f){return this.each(function(){var g=-1;if(this.grid){if(isNaN(b))a(this.p.colModel).each(function(d){if(this.name==b){g=d;return false}});else g=parseInt(b,10);if(g>=0){var j=a("tr.ui-jqgrid-labels th:eq("+g+")",this.grid.hDiv);if(e){var h=a(".s-ico",j);a("[id^=jqgh_]",j).empty().html(e).append(h);this.p.colNames[g]=e}if(c)typeof c==="string"?a(j).addClass(c):a(j).css(c);typeof f==="object"&&a(j).attr(f)}}})},setCell:function(b,
133
+ e,c,f,g,j){return this.each(function(){var h=-1,d,o;if(this.grid){if(isNaN(e))a(this.p.colModel).each(function(n){if(this.name==e){h=n;return false}});else h=parseInt(e,10);if(h>=0)if(d=this.rows.namedItem(b)){var k=a("td:eq("+h+")",d);if(c!==""||j===true){d=this.formatter(b,c,h,d,"edit");o=this.p.colModel[h].title?{title:a.jgrid.stripHtml(d)}:{};this.p.treeGrid&&a(".tree-wrap",a(k)).length>0?a("span",a(k)).html(d).attr(o):a(k).html(d).attr(o);if(this.p.datatype=="local"){d=this.p.colModel[h];c=d.formatter&&
134
+ typeof d.formatter==="string"&&d.formatter=="date"?a.unformat.date(c,d):c;o=this.p._index[b];if(typeof o!="undefined")this.p.data[o][d.name]=c}}if(typeof f==="string")a(k).addClass(f);else f&&a(k).css(f);typeof g==="object"&&a(k).attr(g)}}})},getCell:function(b,e){var c=false;this.each(function(){var f=-1;if(this.grid){if(isNaN(e))a(this.p.colModel).each(function(h){if(this.name===e){f=h;return false}});else f=parseInt(e,10);if(f>=0){var g=this.rows.namedItem(b);if(g)try{c=a.unformat(a("td:eq("+f+
135
+ ")",g),{rowId:g.id,colModel:this.p.colModel[f]},f)}catch(j){c=a.jgrid.htmlDecode(a("td:eq("+f+")",g).html())}}}});return c},getCol:function(b,e,c){var f=[],g,j=0,h=0,d=0,o;e=typeof e!="boolean"?false:e;if(typeof c=="undefined")c=false;this.each(function(){var k=-1;if(this.grid){if(isNaN(b))a(this.p.colModel).each(function(q){if(this.name===b){k=q;return false}});else k=parseInt(b,10);if(k>=0){var n=this.rows.length,m=0;if(n&&n>0){for(;m<n;){if(a(this.rows[m]).hasClass("jqgrow")){try{g=a.unformat(a(this.rows[m].cells[k]),
136
+ {rowId:this.rows[m].id,colModel:this.p.colModel[k]},k)}catch(l){g=a.jgrid.htmlDecode(this.rows[m].cells[k].innerHTML)}if(c){o=parseFloat(g);j+=o;h=Math.min(h,o);d=Math.max(h,o)}else e?f.push({id:this.rows[m].id,value:g}):f.push(g)}m++}if(c)switch(c.toLowerCase()){case "sum":f=j;break;case "avg":f=j/n;break;case "count":f=n;break;case "min":f=h;break;case "max":f=d}}}}});return f},clearGridData:function(b){return this.each(function(){if(this.grid){if(typeof b!="boolean")b=false;if(this.p.deepempty)a("#"+
137
+ a.jgrid.jqID(this.p.id)+" tbody:first tr:gt(0)").remove();else{var e=a("#"+a.jgrid.jqID(this.p.id)+" tbody:first tr:first")[0];a("#"+a.jgrid.jqID(this.p.id)+" tbody:first").empty().append(e)}this.p.footerrow&&b&&a(".ui-jqgrid-ftable td",this.grid.sDiv).html("&#160;");this.p.selrow=null;this.p.selarrrow=[];this.p.savedRow=[];this.p.records=0;this.p.page=1;this.p.lastpage=0;this.p.reccount=0;this.p.data=[];this.p_index={};this.updatepager(true,false)}})},getInd:function(b,e){var c=false,f;this.each(function(){if(f=
138
+ this.rows.namedItem(b))c=e===true?f:f.rowIndex});return c},bindKeys:function(b){var e=a.extend({onEnter:null,onSpace:null,onLeftKey:null,onRightKey:null,scrollingRows:true},b||{});return this.each(function(){var c=this;a("body").is("[role]")||a("body").attr("role","application");c.p.scrollrows=e.scrollingRows;a(c).keydown(function(f){var g=a(c).find("tr[tabindex=0]")[0],j,h,d,o=c.p.treeReader.expanded_field;if(g){d=c.p._index[g.id];if(f.keyCode===37||f.keyCode===38||f.keyCode===39||f.keyCode===40){if(f.keyCode===
139
+ 38){h=g.previousSibling;j="";if(h)if(a(h).is(":hidden"))for(;h;){h=h.previousSibling;if(!a(h).is(":hidden")&&a(h).hasClass("jqgrow")){j=h.id;break}}else j=h.id;a(c).jqGrid("setSelection",j)}if(f.keyCode===40){h=g.nextSibling;j="";if(h)if(a(h).is(":hidden"))for(;h;){h=h.nextSibling;if(!a(h).is(":hidden")&&a(h).hasClass("jqgrow")){j=h.id;break}}else j=h.id;a(c).jqGrid("setSelection",j)}if(f.keyCode===37){c.p.treeGrid&&c.p.data[d][o]&&a(g).find("div.treeclick").trigger("click");a.isFunction(e.onLeftKey)&&
140
+ e.onLeftKey.call(c,c.p.selrow)}if(f.keyCode===39){c.p.treeGrid&&!c.p.data[d][o]&&a(g).find("div.treeclick").trigger("click");a.isFunction(e.onRightKey)&&e.onRightKey.call(c,c.p.selrow)}return false}else if(f.keyCode===13){a.isFunction(e.onEnter)&&e.onEnter.call(c,c.p.selrow);return false}else if(f.keyCode===32){a.isFunction(e.onSpace)&&e.onSpace.call(c,c.p.selrow);return false}}})})},unbindKeys:function(){return this.each(function(){a(this).unbind("keydown")})},getLocalRow:function(b){var e=false,
141
+ c;this.each(function(){if(typeof b!=="undefined"){c=this.p._index[b];if(c>=0)e=this.p.data[c]}});return e}})})(jQuery);
142
142
  (function(a){a.jgrid.extend({getColProp:function(b){var e={},c=this[0];if(!c.grid)return false;c=c.p.colModel;for(var f=0;f<c.length;f++)if(c[f].name==b){e=c[f];break}return e},setColProp:function(b,e){return this.each(function(){if(this.grid)if(e)for(var c=this.p.colModel,f=0;f<c.length;f++)if(c[f].name==b){a.extend(this.p.colModel[f],e);break}})},sortGrid:function(b,e,c){return this.each(function(){var f=-1;if(this.grid){if(!b)b=this.p.sortname;for(var g=0;g<this.p.colModel.length;g++)if(this.p.colModel[g].index==
143
143
  b||this.p.colModel[g].name==b){f=g;break}if(f!=-1){g=this.p.colModel[f].sortable;if(typeof g!=="boolean")g=true;if(typeof e!=="boolean")e=false;g&&this.sortData("jqgh_"+b,f,e,c)}}})},GridDestroy:function(){return this.each(function(){if(this.grid){this.p.pager&&a(this.p.pager).remove();var b=this.id;try{a("#gbox_"+b).remove()}catch(e){}}})},GridUnload:function(){return this.each(function(){if(this.grid){var b={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");
144
144
  var e=document.createElement("table");a(e).attr({id:b.id});e.className=b.cl;b=this.id;a(e).removeClass("ui-jqgrid-btable");if(a(this.p.pager).parents("#gbox_"+b).length===1){a(e).insertBefore("#gbox_"+b).show();a(this.p.pager).insertBefore("#gbox_"+b)}else a(e).insertBefore("#gbox_"+b).show();a("#gbox_"+b).remove()}})},setGridState:function(b){return this.each(function(){if(this.grid)if(b=="hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+this.p.id).slideUp("fast");this.p.pager&&a(this.p.pager).slideUp("fast");
145
145
  this.p.toppager&&a(this.p.toppager).slideUp("fast");if(this.p.toolbar[0]===true){this.p.toolbar[1]=="both"&&a(this.grid.ubDiv).slideUp("fast");a(this.grid.uDiv).slideUp("fast")}this.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+this.p.id).slideUp("fast");a(".ui-jqgrid-titlebar-close span",this.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");this.p.gridstate="hidden"}else if(b=="visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+this.p.id).slideDown("fast");
146
146
  this.p.pager&&a(this.p.pager).slideDown("fast");this.p.toppager&&a(this.p.toppager).slideDown("fast");if(this.p.toolbar[0]===true){this.p.toolbar[1]=="both"&&a(this.grid.ubDiv).slideDown("fast");a(this.grid.uDiv).slideDown("fast")}this.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+this.p.id).slideDown("fast");a(".ui-jqgrid-titlebar-close span",this.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");this.p.gridstate="visible"}})},filterToolbar:function(b){b=a.extend({autosearch:true,
147
- searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND",defaultSearch:"bw"},b||{});return this.each(function(){function e(h,d){var n=a(h);n[0]&&jQuery.each(d,function(){this.data!==undefined?n.bind(this.type,this.data,this.fn):n.bind(this.type,this.fn)})}var c=this;if(!this.ftoolbar){var f=function(){var h={},d=0,n,k,o={},m;a.each(c.p.colModel,function(){k=this.index||this.name;switch(this.stype){case "select":m=this.searchoptions&&
148
- this.searchoptions.sopt?this.searchoptions.sopt[0]:"eq";if(n=a("#gs_"+a.jgrid.jqID(k),c.grid.hDiv).val()){h[k]=n;o[k]=m;d++}else try{delete c.p.postData[k]}catch(v){}break;case "text":m=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:b.defaultSearch;if(n=a("#gs_"+a.jgrid.jqID(k),c.grid.hDiv).val()){h[k]=n;o[k]=m;d++}else try{delete c.p.postData[k]}catch(y){}}});var l=d>0?true:false;if(b.stringResult===true||c.p.datatype=="local"){var q='{"groupOp":"'+b.groupOp+'","rules":[',
149
- s=0;a.each(h,function(v,y){if(s>0)q+=",";q+='{"field":"'+v+'",';q+='"op":"'+o[v]+'",';y+="";q+='"data":"'+y.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';s++});q+="]}";a.extend(c.p.postData,{filters:q});a.each(["searchField","searchString","searchOper"],function(v,y){c.p.postData.hasOwnProperty(y)&&delete c.p.postData[y]})}else a.extend(c.p.postData,h);var p;if(c.p.searchurl){p=c.p.url;a(c).jqGrid("setGridParam",{url:c.p.searchurl})}var r=false;if(a.isFunction(b.beforeSearch))r=b.beforeSearch.call(c);
150
- r||a(c).jqGrid("setGridParam",{search:l}).trigger("reloadGrid",[{page:1}]);p&&a(c).jqGrid("setGridParam",{url:p});a.isFunction(b.afterSearch)&&b.afterSearch()},g=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),j;a.each(c.p.colModel,function(){var h=this,d,n,k,o;n=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+c.p.direction+"'></th>");d=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");this.hidden===true&&a(n).css("display","none");
151
- this.search=this.search===false?false:true;if(typeof this.stype=="undefined")this.stype="text";k=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(o=this.surl||k.dataUrl)a.ajax(a.extend({url:o,dataType:"html",complete:function(p){if(k.buildSelect!==undefined)(p=k.buildSelect(p))&&a(d).append(p);else a(d).append(p.responseText);k.defaultValue&&a("select",d).val(k.defaultValue);a("select",d).attr({name:h.index||h.name,id:"gs_"+h.name});k.attr&&a("select",d).attr(k.attr);
152
- a("select",d).css({width:"100%"});k.dataInit!==undefined&&k.dataInit(a("select",d)[0]);k.dataEvents!==undefined&&e(a("select",d)[0],k.dataEvents);b.autosearch===true&&a("select",d).change(function(){f();return false});p=null}},a.jgrid.ajaxOptions,c.p.ajaxSelectOptions||{}));else{var m;if(h.searchoptions&&h.searchoptions.value)m=h.searchoptions.value;else if(h.editoptions&&h.editoptions.value)m=h.editoptions.value;if(m){o=document.createElement("select");o.style.width="100%";a(o).attr({name:h.index||
153
- h.name,id:"gs_"+h.name});var l,q;if(typeof m==="string"){m=m.split(";");for(var s=0;s<m.length;s++){l=m[s].split(":");q=document.createElement("option");q.value=l[0];q.innerHTML=l[1];o.appendChild(q)}}else if(typeof m==="object")for(l in m)if(m.hasOwnProperty(l)){q=document.createElement("option");q.value=l;q.innerHTML=m[l];o.appendChild(q)}k.defaultValue&&a(o).val(k.defaultValue);k.attr&&a(o).attr(k.attr);k.dataInit!==undefined&&k.dataInit(o);k.dataEvents!==undefined&&e(o,k.dataEvents);a(d).append(o);
154
- b.autosearch===true&&a(o).change(function(){f();return false})}}break;case "text":o=k.defaultValue?k.defaultValue:"";a(d).append("<input type='text' style='width:95%;padding:0px;' name='"+(h.index||h.name)+"' id='gs_"+h.name+"' value='"+o+"'/>");k.attr&&a("input",d).attr(k.attr);k.dataInit!==undefined&&k.dataInit(a("input",d)[0]);k.dataEvents!==undefined&&e(a("input",d)[0],k.dataEvents);if(b.autosearch===true)b.searchOnEnter?a("input",d).keypress(function(p){if((p.charCode?p.charCode:p.keyCode?p.keyCode:
155
- 0)==13){f();return false}return this}):a("input",d).keydown(function(p){switch(p.which){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:j&&clearTimeout(j);j=setTimeout(function(){f()},500)}})}a(n).append(d);a(g).append(n)});a("table thead",c.grid.hDiv).append(g);this.ftoolbar=true;this.triggerToolbar=f;this.clearToolbar=function(h){var d={},n,k=0,o;h=typeof h!="boolean"?true:h;a.each(c.p.colModel,function(){n=this.searchoptions&&this.searchoptions.defaultValue?
156
- this.searchoptions.defaultValue:"";o=this.index||this.name;switch(this.stype){case "select":var r;a("#gs_"+a.jgrid.jqID(o)+" option",c.grid.hDiv).each(function(D){if(D===0)this.selected=true;if(a(this).text()==n){this.selected=true;r=a(this).val();return false}});if(r){d[o]=r;k++}else try{delete c.p.postData[o]}catch(v){}break;case "text":a("#gs_"+a.jgrid.jqID(o),c.grid.hDiv).val(n);if(n){d[o]=n;k++}else try{delete c.p.postData[o]}catch(y){}}});var m=k>0?true:false;if(b.stringResult===true||c.p.datatype==
157
- "local"){var l='{"groupOp":"'+b.groupOp+'","rules":[',q=0;a.each(d,function(r,v){if(q>0)l+=",";l+='{"field":"'+r+'",';l+='"op":"eq",';v+="";l+='"data":"'+v.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';q++});l+="]}";a.extend(c.p.postData,{filters:l});a.each(["searchField","searchString","searchOper"],function(r,v){c.p.postData.hasOwnProperty(v)&&delete c.p.postData[v]})}else a.extend(c.p.postData,d);var s;if(c.p.searchurl){s=c.p.url;a(c).jqGrid("setGridParam",{url:c.p.searchurl})}var p=false;if(a.isFunction(b.beforeClear))p=
147
+ searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND",defaultSearch:"bw"},b||{});return this.each(function(){function e(h,d){var o=a(h);o[0]&&jQuery.each(d,function(){this.data!==undefined?o.bind(this.type,this.data,this.fn):o.bind(this.type,this.fn)})}var c=this;if(!this.ftoolbar){var f=function(){var h={},d=0,o,k,n={},m;a.each(c.p.colModel,function(){k=this.index||this.name;switch(this.stype){case "select":m=this.searchoptions&&
148
+ this.searchoptions.sopt?this.searchoptions.sopt[0]:"eq";if(o=a("#gs_"+a.jgrid.jqID(k),c.grid.hDiv).val()){h[k]=o;n[k]=m;d++}else try{delete c.p.postData[k]}catch(t){}break;case "text":m=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:b.defaultSearch;if(o=a("#gs_"+a.jgrid.jqID(k),c.grid.hDiv).val()){h[k]=o;n[k]=m;d++}else try{delete c.p.postData[k]}catch(y){}}});var l=d>0?true:false;if(b.stringResult===true||c.p.datatype=="local"){var q='{"groupOp":"'+b.groupOp+'","rules":[',
149
+ s=0;a.each(h,function(t,y){if(s>0)q+=",";q+='{"field":"'+t+'",';q+='"op":"'+n[t]+'",';y+="";q+='"data":"'+y.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';s++});q+="]}";a.extend(c.p.postData,{filters:q});a.each(["searchField","searchString","searchOper"],function(t,y){c.p.postData.hasOwnProperty(y)&&delete c.p.postData[y]})}else a.extend(c.p.postData,h);var p;if(c.p.searchurl){p=c.p.url;a(c).jqGrid("setGridParam",{url:c.p.searchurl})}var r=false;if(a.isFunction(b.beforeSearch))r=b.beforeSearch.call(c);
150
+ r||a(c).jqGrid("setGridParam",{search:l}).trigger("reloadGrid",[{page:1}]);p&&a(c).jqGrid("setGridParam",{url:p});a.isFunction(b.afterSearch)&&b.afterSearch()},g=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),j;a.each(c.p.colModel,function(){var h=this,d,o,k,n;o=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+c.p.direction+"'></th>");d=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");this.hidden===true&&a(o).css("display","none");
151
+ this.search=this.search===false?false:true;if(typeof this.stype=="undefined")this.stype="text";k=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(n=this.surl||k.dataUrl)a.ajax(a.extend({url:n,dataType:"html",complete:function(p){if(k.buildSelect!==undefined)(p=k.buildSelect(p))&&a(d).append(p);else a(d).append(p.responseText);k.defaultValue&&a("select",d).val(k.defaultValue);a("select",d).attr({name:h.index||h.name,id:"gs_"+h.name});k.attr&&a("select",d).attr(k.attr);
152
+ a("select",d).css({width:"100%"});k.dataInit!==undefined&&k.dataInit(a("select",d)[0]);k.dataEvents!==undefined&&e(a("select",d)[0],k.dataEvents);b.autosearch===true&&a("select",d).change(function(){f();return false});p=null}},a.jgrid.ajaxOptions,c.p.ajaxSelectOptions||{}));else{var m;if(h.searchoptions&&h.searchoptions.value)m=h.searchoptions.value;else if(h.editoptions&&h.editoptions.value)m=h.editoptions.value;if(m){n=document.createElement("select");n.style.width="100%";a(n).attr({name:h.index||
153
+ h.name,id:"gs_"+h.name});var l,q;if(typeof m==="string"){m=m.split(";");for(var s=0;s<m.length;s++){l=m[s].split(":");q=document.createElement("option");q.value=l[0];q.innerHTML=l[1];n.appendChild(q)}}else if(typeof m==="object")for(l in m)if(m.hasOwnProperty(l)){q=document.createElement("option");q.value=l;q.innerHTML=m[l];n.appendChild(q)}k.defaultValue&&a(n).val(k.defaultValue);k.attr&&a(n).attr(k.attr);k.dataInit!==undefined&&k.dataInit(n);k.dataEvents!==undefined&&e(n,k.dataEvents);a(d).append(n);
154
+ b.autosearch===true&&a(n).change(function(){f();return false})}}break;case "text":n=k.defaultValue?k.defaultValue:"";a(d).append("<input type='text' style='width:95%;padding:0px;' name='"+(h.index||h.name)+"' id='gs_"+h.name+"' value='"+n+"'/>");k.attr&&a("input",d).attr(k.attr);k.dataInit!==undefined&&k.dataInit(a("input",d)[0]);k.dataEvents!==undefined&&e(a("input",d)[0],k.dataEvents);if(b.autosearch===true)b.searchOnEnter?a("input",d).keypress(function(p){if((p.charCode?p.charCode:p.keyCode?p.keyCode:
155
+ 0)==13){f();return false}return this}):a("input",d).keydown(function(p){switch(p.which){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:j&&clearTimeout(j);j=setTimeout(function(){f()},500)}})}a(o).append(d);a(g).append(o)});a("table thead",c.grid.hDiv).append(g);this.ftoolbar=true;this.triggerToolbar=f;this.clearToolbar=function(h){var d={},o,k=0,n;h=typeof h!="boolean"?true:h;a.each(c.p.colModel,function(){o=this.searchoptions&&this.searchoptions.defaultValue?
156
+ this.searchoptions.defaultValue:"";n=this.index||this.name;switch(this.stype){case "select":var r;a("#gs_"+a.jgrid.jqID(n)+" option",c.grid.hDiv).each(function(B){if(B===0)this.selected=true;if(a(this).text()==o){this.selected=true;r=a(this).val();return false}});if(r){d[n]=r;k++}else try{delete c.p.postData[n]}catch(t){}break;case "text":a("#gs_"+a.jgrid.jqID(n),c.grid.hDiv).val(o);if(o){d[n]=o;k++}else try{delete c.p.postData[n]}catch(y){}}});var m=k>0?true:false;if(b.stringResult===true||c.p.datatype==
157
+ "local"){var l='{"groupOp":"'+b.groupOp+'","rules":[',q=0;a.each(d,function(r,t){if(q>0)l+=",";l+='{"field":"'+r+'",';l+='"op":"eq",';t+="";l+='"data":"'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';q++});l+="]}";a.extend(c.p.postData,{filters:l});a.each(["searchField","searchString","searchOper"],function(r,t){c.p.postData.hasOwnProperty(t)&&delete c.p.postData[t]})}else a.extend(c.p.postData,d);var s;if(c.p.searchurl){s=c.p.url;a(c).jqGrid("setGridParam",{url:c.p.searchurl})}var p=false;if(a.isFunction(b.beforeClear))p=
158
158
  b.beforeClear.call(c);p||h&&a(c).jqGrid("setGridParam",{search:m}).trigger("reloadGrid",[{page:1}]);s&&a(c).jqGrid("setGridParam",{url:s});a.isFunction(b.afterClear)&&b.afterClear()};this.toggleToolbar=function(){var h=a("tr.ui-search-toolbar",c.grid.hDiv);h.css("display")=="none"?h.show():h.hide()}}})}})})(jQuery);
159
- (function(a){a.fn.jqm=function(o){var m={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:g,ajaxText:"",target:g,modal:g,toTop:g,onShow:g,onHide:g,onLoad:g};return this.each(function(){if(this._jqm)return e[this._jqm].c=a.extend({},e[this._jqm].c,o);b++;this._jqm=b;e[b]={c:a.extend(m,a.jqm.params,o),a:g,w:a(this).addClass("jqmID"+b),s:b};m.trigger&&a(this).jqmAddTrigger(m.trigger)})};a.fn.jqmAddClose=function(o){return k(this,o,"jqmHide")};a.fn.jqmAddTrigger=
160
- function(o){return k(this,o,"jqmShow")};a.fn.jqmShow=function(o){return this.each(function(){a.jqm.open(this._jqm,o)})};a.fn.jqmHide=function(o){return this.each(function(){a.jqm.close(this._jqm,o)})};a.jqm={hash:{},open:function(o,m){var l=e[o],q=l.c,s="."+q.closeClass,p=parseInt(l.w.css("z-index"));p=p>0?p:3E3;var r=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":p-1,opacity:q.overlay/100});if(l.a)return g;l.t=m;l.a=true;l.w.css("z-index",p);if(q.modal){c[0]||
161
- setTimeout(function(){d("bind")},1);c.push(o)}else if(q.overlay>0)q.closeoverlay&&l.w.jqmAddClose(r);else r=g;l.o=r?r.addClass(q.overlayClass).prependTo("body"):g;if(f){a("html,body").css({height:"100%",width:"100%"});if(r){r=r.css({position:"absolute"})[0];for(var v in{Top:1,Left:1})r.style.setExpression(v.toLowerCase(),"(_=(document.documentElement.scroll"+v+" || document.body.scroll"+v+"))+'px'")}}if(q.ajax){p=q.target||l.w;r=q.ajax;p=typeof p=="string"?a(p,l.w):a(p);r=r.substr(0,1)=="@"?a(m).attr(r.substring(1)):
162
- r;p.html(q.ajaxText).load(r,function(){q.onLoad&&q.onLoad.call(this,l);s&&l.w.jqmAddClose(a(s,l.w));j(l)})}else s&&l.w.jqmAddClose(a(s,l.w));q.toTop&&l.o&&l.w.before('<span id="jqmP'+l.w[0]._jqm+'"></span>').insertAfter(l.o);q.onShow?q.onShow(l):l.w.show();j(l);return g},close:function(o){o=e[o];if(!o.a)return g;o.a=g;if(c[0]){c.pop();c[0]||d("unbind")}o.c.toTop&&o.o&&a("#jqmP"+o.w[0]._jqm).after(o.w).remove();if(o.c.onHide)o.c.onHide(o);else{o.w.hide();o.o&&o.o.remove()}return g},params:{}};var b=
163
- 0,e=a.jqm.hash,c=[],f=a.browser.msie&&a.browser.version=="6.0",g=false,j=function(o){var m=a('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(f)if(o.o)o.o.html('<p style="width:100%;height:100%"/>').prepend(m);else a("iframe.jqm",o.w)[0]||o.w.prepend(m);h(o)},h=function(o){try{a(":input:visible",o.w)[0].focus()}catch(m){}},d=function(o){a(document)[o]("keypress",n)[o]("keydown",n)[o]("mousedown",n)},n=function(o){var m=e[c[c.length-1]];(o=!a(o.target).parents(".jqmID"+
164
- m.s)[0])&&h(m);return!o},k=function(o,m,l){return o.each(function(){var q=this._jqm;a(m).each(function(){if(!this[l]){this[l]=[];a(this).click(function(){for(var s in{jqmShow:1,jqmHide:1})for(var p in this[s])e[this[s][p]]&&e[this[s][p]].w[s](this);return g})}this[l].push(q)})})}})(jQuery);
159
+ (function(a){a.fn.jqm=function(n){var m={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:g,ajaxText:"",target:g,modal:g,toTop:g,onShow:g,onHide:g,onLoad:g};return this.each(function(){if(this._jqm)return e[this._jqm].c=a.extend({},e[this._jqm].c,n);b++;this._jqm=b;e[b]={c:a.extend(m,a.jqm.params,n),a:g,w:a(this).addClass("jqmID"+b),s:b};m.trigger&&a(this).jqmAddTrigger(m.trigger)})};a.fn.jqmAddClose=function(n){return k(this,n,"jqmHide")};a.fn.jqmAddTrigger=
160
+ function(n){return k(this,n,"jqmShow")};a.fn.jqmShow=function(n){return this.each(function(){a.jqm.open(this._jqm,n)})};a.fn.jqmHide=function(n){return this.each(function(){a.jqm.close(this._jqm,n)})};a.jqm={hash:{},open:function(n,m){var l=e[n],q=l.c,s="."+q.closeClass,p=parseInt(l.w.css("z-index"));p=p>0?p:3E3;var r=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":p-1,opacity:q.overlay/100});if(l.a)return g;l.t=m;l.a=true;l.w.css("z-index",p);if(q.modal){c[0]||
161
+ setTimeout(function(){d("bind")},1);c.push(n)}else if(q.overlay>0)q.closeoverlay&&l.w.jqmAddClose(r);else r=g;l.o=r?r.addClass(q.overlayClass).prependTo("body"):g;if(f){a("html,body").css({height:"100%",width:"100%"});if(r){r=r.css({position:"absolute"})[0];for(var t in{Top:1,Left:1})r.style.setExpression(t.toLowerCase(),"(_=(document.documentElement.scroll"+t+" || document.body.scroll"+t+"))+'px'")}}if(q.ajax){p=q.target||l.w;r=q.ajax;p=typeof p=="string"?a(p,l.w):a(p);r=r.substr(0,1)=="@"?a(m).attr(r.substring(1)):
162
+ r;p.html(q.ajaxText).load(r,function(){q.onLoad&&q.onLoad.call(this,l);s&&l.w.jqmAddClose(a(s,l.w));j(l)})}else s&&l.w.jqmAddClose(a(s,l.w));q.toTop&&l.o&&l.w.before('<span id="jqmP'+l.w[0]._jqm+'"></span>').insertAfter(l.o);q.onShow?q.onShow(l):l.w.show();j(l);return g},close:function(n){n=e[n];if(!n.a)return g;n.a=g;if(c[0]){c.pop();c[0]||d("unbind")}n.c.toTop&&n.o&&a("#jqmP"+n.w[0]._jqm).after(n.w).remove();if(n.c.onHide)n.c.onHide(n);else{n.w.hide();n.o&&n.o.remove()}return g},params:{}};var b=
163
+ 0,e=a.jqm.hash,c=[],f=a.browser.msie&&a.browser.version=="6.0",g=false,j=function(n){var m=a('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(f)if(n.o)n.o.html('<p style="width:100%;height:100%"/>').prepend(m);else a("iframe.jqm",n.w)[0]||n.w.prepend(m);h(n)},h=function(n){try{a(":input:visible",n.w)[0].focus()}catch(m){}},d=function(n){a(document)[n]("keypress",o)[n]("keydown",o)[n]("mousedown",o)},o=function(n){var m=e[c[c.length-1]];(n=!a(n.target).parents(".jqmID"+
164
+ m.s)[0])&&h(m);return!n},k=function(n,m,l){return n.each(function(){var q=this._jqm;a(m).each(function(){if(!this[l]){this[l]=[];a(this).click(function(){for(var s in{jqmShow:1,jqmHide:1})for(var p in this[s])e[this[s][p]]&&e[this[s][p]].w[s](this);return g})}this[l].push(q)})})}})(jQuery);
165
165
  (function(a){a.fn.jqDrag=function(h){return g(this,h,"d")};a.fn.jqResize=function(h,d){return g(this,h,"r",d)};a.jqDnR={dnr:{},e:0,drag:function(h){if(e.k=="d")c.css({left:e.X+h.pageX-e.pX,top:e.Y+h.pageY-e.pY});else{c.css({width:Math.max(h.pageX-e.pX+e.W,0),height:Math.max(h.pageY-e.pY+e.H,0)});M1&&f.css({width:Math.max(h.pageX-M1.pX+M1.W,0),height:Math.max(h.pageY-M1.pY+M1.H,0)})}return false},stop:function(){a(document).unbind("mousemove",b.drag).unbind("mouseup",b.stop)}};var b=a.jqDnR,e=b.dnr,
166
- c=b.e,f,g=function(h,d,n,k){return h.each(function(){d=d?a(d,h):h;d.bind("mousedown",{e:h,k:n},function(o){var m=o.data,l={};c=m.e;f=k?a(k):false;if(c.css("position")!="relative")try{c.position(l)}catch(q){}e={X:l.left||j("left")||0,Y:l.top||j("top")||0,W:j("width")||c[0].scrollWidth||0,H:j("height")||c[0].scrollHeight||0,pX:o.pageX,pY:o.pageY,k:m.k};M1=f&&m.k!="d"?{X:l.left||f1("left")||0,Y:l.top||f1("top")||0,W:f[0].offsetWidth||f1("width")||0,H:f[0].offsetHeight||f1("height")||0,pX:o.pageX,pY:o.pageY,
167
- k:m.k}:false;try{a("input.hasDatepicker",c[0]).datepicker("hide")}catch(s){}a(document).mousemove(a.jqDnR.drag).mouseup(a.jqDnR.stop);return false})})},j=function(h){return parseInt(c.css(h))||false};f1=function(h){return parseInt(f.css(h))||false}})(jQuery);
168
- var xmlJsonClass={xml2json:function(a,b){if(a.nodeType===9)a=a.documentElement;var e=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+b+(b?e.replace(/\t/g,b):e.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,b){var e=function(g,j,h){var d="",n,k;if(g instanceof Array)if(g.length===0)d+=h+"<"+j+">__EMPTY_ARRAY_</"+j+">\n";else{n=0;for(k=g.length;n<k;n+=1){var o=h+e(g[n],j,h+"\t")+"\n";d+=o}}else if(typeof g==="object"){n=false;d+=h+"<"+j;for(k in g)if(g.hasOwnProperty(k))if(k.charAt(0)===
169
- "@")d+=" "+k.substr(1)+'="'+g[k].toString()+'"';else n=true;d+=n?">":"/>";if(n){for(k in g)if(g.hasOwnProperty(k))if(k==="#text")d+=g[k];else if(k==="#cdata")d+="<![CDATA["+g[k]+"]]\>";else if(k.charAt(0)!=="@")d+=e(g[k],k,h+"\t");d+=(d.charAt(d.length-1)==="\n"?h:"")+"</"+j+">"}}else d+=typeof g==="function"?h+"<"+j+"><![CDATA["+g+"]]\></"+j+">":g.toString()==='""'||g.toString().length===0?h+"<"+j+">__EMPTY_STRING_</"+j+">":h+"<"+j+">"+g.toString()+"</"+j+">";return d},c="",f;for(f in a)if(a.hasOwnProperty(f))c+=
166
+ c=b.e,f,g=function(h,d,o,k){return h.each(function(){d=d?a(d,h):h;d.bind("mousedown",{e:h,k:o},function(n){var m=n.data,l={};c=m.e;f=k?a(k):false;if(c.css("position")!="relative")try{c.position(l)}catch(q){}e={X:l.left||j("left")||0,Y:l.top||j("top")||0,W:j("width")||c[0].scrollWidth||0,H:j("height")||c[0].scrollHeight||0,pX:n.pageX,pY:n.pageY,k:m.k};M1=f&&m.k!="d"?{X:l.left||f1("left")||0,Y:l.top||f1("top")||0,W:f[0].offsetWidth||f1("width")||0,H:f[0].offsetHeight||f1("height")||0,pX:n.pageX,pY:n.pageY,
167
+ k:m.k}:false;if(a("input.hasDatepicker",c[0])[0])try{a("input.hasDatepicker",c[0]).datepicker("hide")}catch(s){}a(document).mousemove(a.jqDnR.drag).mouseup(a.jqDnR.stop);return false})})},j=function(h){return parseInt(c.css(h))||false};f1=function(h){return parseInt(f.css(h))||false}})(jQuery);
168
+ var xmlJsonClass={xml2json:function(a,b){if(a.nodeType===9)a=a.documentElement;var e=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+b+(b?e.replace(/\t/g,b):e.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,b){var e=function(g,j,h){var d="",o,k;if(g instanceof Array)if(g.length===0)d+=h+"<"+j+">__EMPTY_ARRAY_</"+j+">\n";else{o=0;for(k=g.length;o<k;o+=1){var n=h+e(g[o],j,h+"\t")+"\n";d+=n}}else if(typeof g==="object"){o=false;d+=h+"<"+j;for(k in g)if(g.hasOwnProperty(k))if(k.charAt(0)===
169
+ "@")d+=" "+k.substr(1)+'="'+g[k].toString()+'"';else o=true;d+=o?">":"/>";if(o){for(k in g)if(g.hasOwnProperty(k))if(k==="#text")d+=g[k];else if(k==="#cdata")d+="<![CDATA["+g[k]+"]]\>";else if(k.charAt(0)!=="@")d+=e(g[k],k,h+"\t");d+=(d.charAt(d.length-1)==="\n"?h:"")+"</"+j+">"}}else d+=typeof g==="function"?h+"<"+j+"><![CDATA["+g+"]]\></"+j+">":g.toString()==='""'||g.toString().length===0?h+"<"+j+">__EMPTY_STRING_</"+j+">":h+"<"+j+">"+g.toString()+"</"+j+">";return d},c="",f;for(f in a)if(a.hasOwnProperty(f))c+=
170
170
  e(a[f],f,"");return b?c.replace(/\t/g,b):c.replace(/\t|\n/g,"")},toObj:function(a){var b={},e=/function/i;if(a.nodeType===1){if(a.attributes.length){var c;for(c=0;c<a.attributes.length;c+=1)b["@"+a.attributes[c].nodeName]=(a.attributes[c].nodeValue||"").toString()}if(a.firstChild){var f=c=0,g=false,j;for(j=a.firstChild;j;j=j.nextSibling)if(j.nodeType===1)g=true;else if(j.nodeType===3&&j.nodeValue.match(/[^ \f\n\r\t\v]/))c+=1;else if(j.nodeType===4)f+=1;if(g)if(c<2&&f<2){this.removeWhite(a);for(j=
171
171
  a.firstChild;j;j=j.nextSibling)if(j.nodeType===3)b["#text"]=this.escape(j.nodeValue);else if(j.nodeType===4)if(e.test(j.nodeValue))b[j.nodeName]=[b[j.nodeName],j.nodeValue];else b["#cdata"]=this.escape(j.nodeValue);else if(b[j.nodeName])if(b[j.nodeName]instanceof Array)b[j.nodeName][b[j.nodeName].length]=this.toObj(j);else b[j.nodeName]=[b[j.nodeName],this.toObj(j)];else b[j.nodeName]=this.toObj(j)}else if(a.attributes.length)b["#text"]=this.escape(this.innerXml(a));else b=this.escape(this.innerXml(a));
172
172
  else if(c)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(j=a.firstChild;j;j=j.nextSibling)if(e.test(a.firstChild.nodeValue)){b=a.firstChild.nodeValue;break}else b["#cdata"]=this.escape(j.nodeValue)}if(!a.attributes.length&&!a.firstChild)b=null}else if(a.nodeType===9)b=this.toObj(a.documentElement);else alert("unhandled node type: "+
173
- a.nodeType);return b},toJson:function(a,b,e,c){if(c===undefined)c=true;var f=b?'"'+b+'"':"",g="\t",j="\n";if(!c)j=g="";if(a==="[]")f+=b?":[]":"[]";else if(a instanceof Array){var h,d,n=[];d=0;for(h=a.length;d<h;d+=1)n[d]=this.toJson(a[d],"",e+g,c);f+=(b?":[":"[")+(n.length>1?j+e+g+n.join(","+j+e+g)+j+e:n.join(""))+"]"}else if(a===null)f+=(b&&":")+"null";else if(typeof a==="object"){h=[];for(d in a)if(a.hasOwnProperty(d))h[h.length]=this.toJson(a[d],d,e+g,c);f+=(b?":{":"{")+(h.length>1?j+e+g+h.join(","+
173
+ a.nodeType);return b},toJson:function(a,b,e,c){if(c===undefined)c=true;var f=b?'"'+b+'"':"",g="\t",j="\n";if(!c)j=g="";if(a==="[]")f+=b?":[]":"[]";else if(a instanceof Array){var h,d,o=[];d=0;for(h=a.length;d<h;d+=1)o[d]=this.toJson(a[d],"",e+g,c);f+=(b?":[":"[")+(o.length>1?j+e+g+o.join(","+j+e+g)+j+e:o.join(""))+"]"}else if(a===null)f+=(b&&":")+"null";else if(typeof a==="object"){h=[];for(d in a)if(a.hasOwnProperty(d))h[h.length]=this.toJson(a[d],d,e+g,c);f+=(b?":{":"{")+(h.length>1?j+e+g+h.join(","+
174
174
  j+e+g)+j+e:h.join(""))+"}"}else f+=typeof a==="string"?(b&&":")+'"'+a.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"':(b&&":")+'"'+a.toString()+'"';return f},innerXml:function(a){var b="";if("innerHTML"in a)b=a.innerHTML;else{var e=function(c){var f="",g;if(c.nodeType===1){f+="<"+c.nodeName;for(g=0;g<c.attributes.length;g+=1)f+=" "+c.attributes[g].nodeName+'="'+(c.attributes[g].nodeValue||"").toString()+'"';if(c.firstChild){f+=">";for(g=c.firstChild;g;g=g.nextSibling)f+=e(g);f+="</"+c.nodeName+">"}else f+=
175
175
  "/>"}else if(c.nodeType===3)f+=c.nodeValue;else if(c.nodeType===4)f+="<![CDATA["+c.nodeValue+"]]\>";return f};for(a=a.firstChild;a;a=a.nextSibling)b+=e(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 e=b.nextSibling;a.removeChild(b);b=e}else{b.nodeType===1&&this.removeWhite(b);
176
176
  b=b.nextSibling}return a}};
177
177
  (function(a){a.fmatter={};a.extend(a.fmatter,{isBoolean:function(b){return typeof b==="boolean"},isObject:function(b){return b&&(typeof b==="object"||a.isFunction(b))||false},isString:function(b){return typeof b==="string"},isNumber:function(b){return typeof b==="number"&&isFinite(b)},isNull:function(b){return b===null},isUndefined:function(b){return typeof b==="undefined"},isValue:function(b){return this.isObject(b)||this.isString(b)||this.isNumber(b)||this.isBoolean(b)},isEmpty:function(b){if(!this.isString(b)&&
178
178
  this.isValue(b))return false;else if(!this.isValue(b))return true;b=a.trim(b).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,"");return b===""}});a.fn.fmatter=function(b,e,c,f,g){var j=e;c=a.extend({},a.jgrid.formatter,c);if(a.fn.fmatter[b])j=a.fn.fmatter[b](e,c,f,g);return j};a.fmatter.util={NumberFormat:function(b,e){a.fmatter.isNumber(b)||(b*=1);if(a.fmatter.isNumber(b)){var c=b<0,f=b+"",g=e.decimalSeparator?e.decimalSeparator:".",j;if(a.fmatter.isNumber(e.decimalPlaces)){var h=e.decimalPlaces;
179
- f=Math.pow(10,h);f=Math.round(b*f)/f+"";j=f.lastIndexOf(".");if(h>0){if(j<0){f+=g;j=f.length-1}else if(g!==".")f=f.replace(".",g);for(;f.length-1-j<h;)f+="0"}}if(e.thousandsSeparator){h=e.thousandsSeparator;j=f.lastIndexOf(g);j=j>-1?j:f.length;g=f.substring(j);for(var d=-1,n=j;n>0;n--){d++;if(d%3===0&&n!==j&&(!c||n>1))g=h+g;g=f.charAt(n-1)+g}f=g}f=e.prefix?e.prefix+f:f;return f=e.suffix?f+e.suffix:f}else return b},DateFormat:function(b,e,c,f){var g=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,
180
- j=typeof e==="string"?e.match(g):null;g=function(v,y){v=String(v);for(y=parseInt(y,10)||2;v.length<y;)v="0"+v;return v};var h={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},d=0,n,k=["i18n"];k.i18n={dayNames:f.dayNames,monthNames:f.monthNames};if(b in f.masks)b=f.masks[b];if(e.constructor===Number){if(String(b).toLowerCase()=="u")e*=1E3;d=new Date(e)}else if(e.constructor===Date)d=e;else if(j!==null){d=new Date(parseInt(j[1],10));if(j[3]){b=Number(j[5])*60+Number(j[6]);b*=j[4]=="-"?1:-1;b-=d.getTimezoneOffset();
181
- d.setTime(Number(Number(d)+b*60*1E3))}}else{e=String(e).split(/[\\\/:_;.,\t\T\s-]/);b=b.split(/[\\\/:_;.,\t\T\s-]/);j=0;for(n=b.length;j<n;j++){if(b[j]=="M"){d=a.inArray(e[j],k.i18n.monthNames);if(d!==-1&&d<12)e[j]=d+1}if(b[j]=="F"){d=a.inArray(e[j],k.i18n.monthNames);if(d!==-1&&d>11)e[j]=d+1-12}if(e[j])h[b[j].toLowerCase()]=parseInt(e[j],10)}if(h.f)h.m=h.f;if(h.m===0&&h.y===0&&h.d===0)return"&#160;";h.m=parseInt(h.m,10)-1;d=h.y;if(d>=70&&d<=99)h.y=1900+h.y;else if(d>=0&&d<=69)h.y=2E3+h.y;d=new Date(h.y,
182
- h.m,h.d,h.h,h.i,h.s,h.u)}if(c in f.masks)c=f.masks[c];else c||(c="Y-m-d");b=d.getHours();e=d.getMinutes();h=d.getDate();j=d.getMonth()+1;n=d.getTimezoneOffset();var o=d.getSeconds(),m=d.getMilliseconds(),l=d.getDay(),q=d.getFullYear(),s=(l+6)%7+1,p=(new Date(q,j-1,h)-new Date(q,0,1))/864E5,r={d:g(h),D:k.i18n.dayNames[l],j:h,l:k.i18n.dayNames[l+7],N:s,S:f.S(h),w:l,z:p,W:s<5?Math.floor((p+s-1)/7)+1:Math.floor((p+s-1)/7)||(((new Date(q-1,0,1)).getDay()+6)%7<4?53:52),F:k.i18n.monthNames[j-1+12],m:g(j),
183
- M:k.i18n.monthNames[j-1],n:j,t:"?",L:"?",o:"?",Y:q,y:String(q).substring(2),a:b<12?f.AmPm[0]:f.AmPm[1],A:b<12?f.AmPm[2]:f.AmPm[3],B:"?",g:b%12||12,G:b,h:g(b%12||12),H:g(b),i:g(e),s:g(o),u:m,e:"?",I:"?",O:(n>0?"-":"+")+g(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4),P:"?",T:(String(d).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(d/
184
- 1E3)};return c.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(v){return v in r?r[v]:v.substring(1)})}};a.fn.fmatter.defaultFormat=function(b,e){return a.fmatter.isValue(b)&&b!==""?b:e.defaultValue?e.defaultValue:"&#160;"};a.fn.fmatter.email=function(b,e){return a.fmatter.isEmpty(b)?a.fn.fmatter.defaultFormat(b,e):'<a href="mailto:'+b+'">'+b+"</a>"};a.fn.fmatter.checkbox=function(b,e){var c=a.extend({},e.checkbox),f;a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,
179
+ f=Math.pow(10,h);f=Math.round(b*f)/f+"";j=f.lastIndexOf(".");if(h>0){if(j<0){f+=g;j=f.length-1}else if(g!==".")f=f.replace(".",g);for(;f.length-1-j<h;)f+="0"}}if(e.thousandsSeparator){h=e.thousandsSeparator;j=f.lastIndexOf(g);j=j>-1?j:f.length;g=f.substring(j);for(var d=-1,o=j;o>0;o--){d++;if(d%3===0&&o!==j&&(!c||o>1))g=h+g;g=f.charAt(o-1)+g}f=g}f=e.prefix?e.prefix+f:f;return f=e.suffix?f+e.suffix:f}else return b},DateFormat:function(b,e,c,f){var g=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,
180
+ j=typeof e==="string"?e.match(g):null;g=function(t,y){t=String(t);for(y=parseInt(y,10)||2;t.length<y;)t="0"+t;return t};var h={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},d=0,o,k=["i18n"];k.i18n={dayNames:f.dayNames,monthNames:f.monthNames};if(b in f.masks)b=f.masks[b];if(e.constructor===Number){if(String(b).toLowerCase()=="u")e*=1E3;d=new Date(e)}else if(e.constructor===Date)d=e;else if(j!==null){d=new Date(parseInt(j[1],10));if(j[3]){b=Number(j[5])*60+Number(j[6]);b*=j[4]=="-"?1:-1;b-=d.getTimezoneOffset();
181
+ d.setTime(Number(Number(d)+b*60*1E3))}}else{e=String(e).split(/[\\\/:_;.,\t\T\s-]/);b=b.split(/[\\\/:_;.,\t\T\s-]/);j=0;for(o=b.length;j<o;j++){if(b[j]=="M"){d=a.inArray(e[j],k.i18n.monthNames);if(d!==-1&&d<12)e[j]=d+1}if(b[j]=="F"){d=a.inArray(e[j],k.i18n.monthNames);if(d!==-1&&d>11)e[j]=d+1-12}if(e[j])h[b[j].toLowerCase()]=parseInt(e[j],10)}if(h.f)h.m=h.f;if(h.m===0&&h.y===0&&h.d===0)return"&#160;";h.m=parseInt(h.m,10)-1;d=h.y;if(d>=70&&d<=99)h.y=1900+h.y;else if(d>=0&&d<=69)h.y=2E3+h.y;d=new Date(h.y,
182
+ h.m,h.d,h.h,h.i,h.s,h.u)}if(c in f.masks)c=f.masks[c];else c||(c="Y-m-d");b=d.getHours();e=d.getMinutes();h=d.getDate();j=d.getMonth()+1;o=d.getTimezoneOffset();var n=d.getSeconds(),m=d.getMilliseconds(),l=d.getDay(),q=d.getFullYear(),s=(l+6)%7+1,p=(new Date(q,j-1,h)-new Date(q,0,1))/864E5,r={d:g(h),D:k.i18n.dayNames[l],j:h,l:k.i18n.dayNames[l+7],N:s,S:f.S(h),w:l,z:p,W:s<5?Math.floor((p+s-1)/7)+1:Math.floor((p+s-1)/7)||(((new Date(q-1,0,1)).getDay()+6)%7<4?53:52),F:k.i18n.monthNames[j-1+12],m:g(j),
183
+ M:k.i18n.monthNames[j-1],n:j,t:"?",L:"?",o:"?",Y:q,y:String(q).substring(2),a:b<12?f.AmPm[0]:f.AmPm[1],A:b<12?f.AmPm[2]:f.AmPm[3],B:"?",g:b%12||12,G:b,h:g(b%12||12),H:g(b),i:g(e),s:g(n),u:m,e:"?",I:"?",O:(o>0?"-":"+")+g(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4),P:"?",T:(String(d).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(d/
184
+ 1E3)};return c.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(t){return t in r?r[t]:t.substring(1)})}};a.fn.fmatter.defaultFormat=function(b,e){return a.fmatter.isValue(b)&&b!==""?b:e.defaultValue?e.defaultValue:"&#160;"};a.fn.fmatter.email=function(b,e){return a.fmatter.isEmpty(b)?a.fn.fmatter.defaultFormat(b,e):'<a href="mailto:'+b+'">'+b+"</a>"};a.fn.fmatter.checkbox=function(b,e){var c=a.extend({},e.checkbox),f;a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,
185
185
  e.colModel.formatoptions));f=c.disabled===true?'disabled="disabled"':"";if(a.fmatter.isEmpty(b)||a.fmatter.isUndefined(b))b=a.fn.fmatter.defaultFormat(b,c);b+="";b=b.toLowerCase();return'<input type="checkbox" '+(b.search(/(false|0|no|off)/i)<0?" checked='checked' ":"")+' value="'+b+'" offval="no" '+f+"/>"};a.fn.fmatter.link=function(b,e){var c={target:e.target},f="";a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,e.colModel.formatoptions));if(c.target)f="target="+c.target;return a.fmatter.isEmpty(b)?
186
186
  a.fn.fmatter.defaultFormat(b,e):"<a "+f+' href="'+b+'">'+b+"</a>"};a.fn.fmatter.showlink=function(b,e){var c={baseLinkUrl:e.baseLinkUrl,showAction:e.showAction,addParam:e.addParam||"",target:e.target,idName:e.idName},f="";a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,e.colModel.formatoptions));if(c.target)f="target="+c.target;c=c.baseLinkUrl+c.showAction+"?"+c.idName+"="+e.rowId+c.addParam;return a.fmatter.isString(b)||a.fmatter.isNumber(b)?"<a "+f+' href="'+c+'">'+b+"</a>":a.fn.fmatter.defaultFormat(b,
187
187
  e)};a.fn.fmatter.integer=function(b,e){var c=a.extend({},e.integer);a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,e.colModel.formatoptions));if(a.fmatter.isEmpty(b))return c.defaultValue;return a.fmatter.util.NumberFormat(b,c)};a.fn.fmatter.number=function(b,e){var c=a.extend({},e.number);a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,e.colModel.formatoptions));if(a.fmatter.isEmpty(b))return c.defaultValue;return a.fmatter.util.NumberFormat(b,c)};a.fn.fmatter.currency=
188
188
  function(b,e){var c=a.extend({},e.currency);a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,e.colModel.formatoptions));if(a.fmatter.isEmpty(b))return c.defaultValue;return a.fmatter.util.NumberFormat(b,c)};a.fn.fmatter.date=function(b,e,c,f){c=a.extend({},e.date);a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend({},c,e.colModel.formatoptions));return!c.reformatAfterEdit&&f=="edit"?a.fn.fmatter.defaultFormat(b,e):a.fmatter.isEmpty(b)?a.fn.fmatter.defaultFormat(b,e):a.fmatter.util.DateFormat(c.srcformat,
189
- b,c.newformat,c)};a.fn.fmatter.select=function(b,e){b+="";var c=false,f=[];if(a.fmatter.isUndefined(e.colModel.formatoptions)){if(!a.fmatter.isUndefined(e.colModel.editoptions))c=e.colModel.editoptions.value}else c=e.colModel.formatoptions.value;if(c){var g=e.colModel.editoptions.multiple===true?true:false,j=[],h;if(g){j=b.split(",");j=a.map(j,function(o){return a.trim(o)})}if(a.fmatter.isString(c))for(var d=c.split(";"),n=0,k=0;k<d.length;k++){h=d[k].split(":");if(h.length>2)h[1]=jQuery.map(h,function(o,
190
- m){if(m>0)return o}).join(":");if(g){if(jQuery.inArray(h[0],j)>-1){f[n]=h[1];n++}}else if(a.trim(h[0])==a.trim(b)){f[0]=h[1];break}}else if(a.fmatter.isObject(c))if(g)f=jQuery.map(j,function(o){return c[o]});else f[0]=c[b]||""}b=f.join(", ");return b===""?a.fn.fmatter.defaultFormat(b,e):b};a.fn.fmatter.rowactions=function(b,e,c,f){var g={keys:false,editbutton:true,delbutton:true,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{oper:"edit"},url:null,delOptions:{}};
189
+ b,c.newformat,c)};a.fn.fmatter.select=function(b,e){b+="";var c=false,f=[];if(a.fmatter.isUndefined(e.colModel.formatoptions)){if(!a.fmatter.isUndefined(e.colModel.editoptions))c=e.colModel.editoptions.value}else c=e.colModel.formatoptions.value;if(c){var g=e.colModel.editoptions.multiple===true?true:false,j=[],h;if(g){j=b.split(",");j=a.map(j,function(n){return a.trim(n)})}if(a.fmatter.isString(c))for(var d=c.split(";"),o=0,k=0;k<d.length;k++){h=d[k].split(":");if(h.length>2)h[1]=jQuery.map(h,function(n,
190
+ m){if(m>0)return n}).join(":");if(g){if(jQuery.inArray(h[0],j)>-1){f[o]=h[1];o++}}else if(a.trim(h[0])==a.trim(b)){f[0]=h[1];break}}else if(a.fmatter.isObject(c))if(g)f=jQuery.map(j,function(n){return c[n]});else f[0]=c[b]||""}b=f.join(", ");return b===""?a.fn.fmatter.defaultFormat(b,e):b};a.fn.fmatter.rowactions=function(b,e,c,f){var g={keys:false,editbutton:true,delbutton:true,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{oper:"edit"},url:null,delOptions:{}};
191
191
  f=a("#"+e)[0].p.colModel[f];a.fmatter.isUndefined(f.formatoptions)||(g=a.extend(g,f.formatoptions));f=function(h){g.afterSave&&g.afterSave(h);a("tr#"+b+" div.ui-inline-edit, tr#"+b+" div.ui-inline-del","#"+e).show();a("tr#"+b+" div.ui-inline-save, tr#"+b+" div.ui-inline-cancel","#"+e).hide()};var j=function(h){g.afterRestore&&g.afterRestore(h);a("tr#"+b+" div.ui-inline-edit, tr#"+b+" div.ui-inline-del","#"+e).show();a("tr#"+b+" div.ui-inline-save, tr#"+b+" div.ui-inline-cancel","#"+e).hide()};switch(c){case "edit":a("#"+
192
192
  e).jqGrid("editRow",b,g.keys,g.onEdit,g.onSuccess,g.url,g.extraparam,f,g.onError,j);a("tr#"+b+" div.ui-inline-edit, tr#"+b+" div.ui-inline-del","#"+e).hide();a("tr#"+b+" div.ui-inline-save, tr#"+b+" div.ui-inline-cancel","#"+e).show();break;case "save":if(a("#"+e).jqGrid("saveRow",b,g.onSuccess,g.url,g.extraparam,f,g.onError,j)){a("tr#"+b+" div.ui-inline-edit, tr#"+b+" div.ui-inline-del","#"+e).show();a("tr#"+b+" div.ui-inline-save, tr#"+b+" div.ui-inline-cancel","#"+e).hide()}break;case "cancel":a("#"+
193
193
  e).jqGrid("restoreRow",b,j);a("tr#"+b+" div.ui-inline-edit, tr#"+b+" div.ui-inline-del","#"+e).show();a("tr#"+b+" div.ui-inline-save, tr#"+b+" div.ui-inline-cancel","#"+e).hide();break;case "del":a("#"+e).jqGrid("delGridRow",b,g.delOptions)}};a.fn.fmatter.actions=function(b,e){var c={keys:false,editbutton:true,delbutton:true};a.fmatter.isUndefined(e.colModel.formatoptions)||(c=a.extend(c,e.colModel.formatoptions));var f=e.rowId,g="",j;if(typeof f=="undefined"||a.fmatter.isEmpty(f))return"";if(c.editbutton){j=
194
194
  "onclick=$.fn.fmatter.rowactions('"+f+"','"+e.gid+"','edit',"+e.pos+");";g=g+"<div style='margin-left:8px;'><div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+j+"><span class='ui-icon ui-icon-pencil'></span></div>"}if(c.delbutton){j="onclick=$.fn.fmatter.rowactions('"+f+"','"+e.gid+"','del',"+e.pos+");";g=g+"<div title='"+a.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+j+"><span class='ui-icon ui-icon-trash'></span></div>"}j=
195
195
  "onclick=$.fn.fmatter.rowactions('"+f+"','"+e.gid+"','save',"+e.pos+");";g=g+"<div title='"+a.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save'><span class='ui-icon ui-icon-disk' "+j+"></span></div>";j="onclick=$.fn.fmatter.rowactions('"+f+"','"+e.gid+"','cancel',"+e.pos+");";return g=g+"<div title='"+a.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' "+j+"></span></div></div>"};
196
- a.unformat=function(b,e,c,f){var g,j=e.colModel.formatter,h=e.colModel.formatoptions||{},d=/([\.\*\_\'\(\)\{\}\+\?\\])/g,n=e.colModel.unformat||a.fn.fmatter[j]&&a.fn.fmatter[j].unformat;if(typeof n!=="undefined"&&a.isFunction(n))g=n(a(b).text(),e,b);else if(!a.fmatter.isUndefined(j)&&a.fmatter.isString(j)){g=a.jgrid.formatter||{};switch(j){case "integer":h=a.extend({},g.integer,h);e=h.thousandsSeparator.replace(d,"\\$1");e=RegExp(e,"g");g=a(b).text().replace(e,"");break;case "number":h=a.extend({},
196
+ a.unformat=function(b,e,c,f){var g,j=e.colModel.formatter,h=e.colModel.formatoptions||{},d=/([\.\*\_\'\(\)\{\}\+\?\\])/g,o=e.colModel.unformat||a.fn.fmatter[j]&&a.fn.fmatter[j].unformat;if(typeof o!=="undefined"&&a.isFunction(o))g=o(a(b).text(),e,b);else if(!a.fmatter.isUndefined(j)&&a.fmatter.isString(j)){g=a.jgrid.formatter||{};switch(j){case "integer":h=a.extend({},g.integer,h);e=h.thousandsSeparator.replace(d,"\\$1");e=RegExp(e,"g");g=a(b).text().replace(e,"");break;case "number":h=a.extend({},
197
197
  g.number,h);e=h.thousandsSeparator.replace(d,"\\$1");e=RegExp(e,"g");g=a(b).text().replace(e,"").replace(h.decimalSeparator,".");break;case "currency":h=a.extend({},g.currency,h);e=h.thousandsSeparator.replace(d,"\\$1");e=RegExp(e,"g");g=a(b).text().replace(e,"").replace(h.decimalSeparator,".").replace(h.prefix,"").replace(h.suffix,"");break;case "checkbox":h=e.colModel.editoptions?e.colModel.editoptions.value.split(":"):["Yes","No"];g=a("input",b).attr("checked")?h[0]:h[1];break;case "select":g=
198
- a.unformat.select(b,e,c,f);break;case "actions":return"";default:g=a(b).text()}}return g?g:f===true?a(b).text():a.jgrid.htmlDecode(a(b).html())};a.unformat.select=function(b,e,c,f){c=[];b=a(b).text();if(f===true)return b;e=a.extend({},e.colModel.editoptions);if(e.value){var g=e.value;e=e.multiple===true?true:false;f=[];var j;if(e){f=b.split(",");f=a.map(f,function(k){return a.trim(k)})}if(a.fmatter.isString(g))for(var h=g.split(";"),d=0,n=0;n<h.length;n++){j=h[n].split(":");if(j.length>2)j[1]=jQuery.map(j,
199
- function(k,o){if(o>0)return k}).join(":");if(e){if(jQuery.inArray(j[1],f)>-1){c[d]=j[0];d++}}else if(a.trim(j[1])==a.trim(b)){c[0]=j[0];break}}else if(a.fmatter.isObject(g)||a.isArray(g)){e||(f[0]=b);c=jQuery.map(f,function(k){var o;a.each(g,function(m,l){if(l==k){o=m;return false}});if(typeof o!="undefined")return o})}return c.join(", ")}else return b||""};a.unformat.date=function(b,e){var c=a.jgrid.formatter.date||{};a.fmatter.isUndefined(e.formatoptions)||(c=a.extend({},c,e.formatoptions));return a.fmatter.isEmpty(b)?
198
+ a.unformat.select(b,e,c,f);break;case "actions":return"";default:g=a(b).text()}}return g?g:f===true?a(b).text():a.jgrid.htmlDecode(a(b).html())};a.unformat.select=function(b,e,c,f){c=[];b=a(b).text();if(f===true)return b;e=a.extend({},e.colModel.editoptions);if(e.value){var g=e.value;e=e.multiple===true?true:false;f=[];var j;if(e){f=b.split(",");f=a.map(f,function(k){return a.trim(k)})}if(a.fmatter.isString(g))for(var h=g.split(";"),d=0,o=0;o<h.length;o++){j=h[o].split(":");if(j.length>2)j[1]=jQuery.map(j,
199
+ function(k,n){if(n>0)return k}).join(":");if(e){if(jQuery.inArray(j[1],f)>-1){c[d]=j[0];d++}}else if(a.trim(j[1])==a.trim(b)){c[0]=j[0];break}}else if(a.fmatter.isObject(g)||a.isArray(g)){e||(f[0]=b);c=jQuery.map(f,function(k){var n;a.each(g,function(m,l){if(l==k){n=m;return false}});if(typeof n!="undefined")return n})}return c.join(", ")}else return b||""};a.unformat.date=function(b,e){var c=a.jgrid.formatter.date||{};a.fmatter.isUndefined(e.formatoptions)||(c=a.extend({},c,e.formatoptions));return a.fmatter.isEmpty(b)?
200
200
  a.fn.fmatter.defaultFormat(b,e):a.fmatter.util.DateFormat(c.newformat,b,c.srcformat,c)}})(jQuery);
201
201
  (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,e){e=a.extend({jqm:true,gb:""},e||{});if(e.onClose){var c=e.onClose(b);if(typeof c=="boolean"&&!c)return}if(a.fn.jqm&&e.jqm===true)a(b).attr("aria-hidden","true").jqmHide();else{if(e.gb!=="")try{a(".jqgrid-overlay:first",e.gb).hide()}catch(f){}a(b).hide().attr("aria-hidden","true")}},findPos:function(b){var e=0,c=0;if(b.offsetParent){do{e+=
202
- b.offsetLeft;c+=b.offsetTop}while(b=b.offsetParent)}return[e,c]},createModal:function(b,e,c,f,g,j){var h=document.createElement("div"),d,n=this;d=a(c.gbox).attr("dir")=="rtl"?true:false;h.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";h.id=b.themodal;var k=document.createElement("div");k.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";k.id=b.modalhead;a(k).append("<span class='ui-jqdialog-title'>"+c.caption+"</span>");var o=a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){o.addClass("ui-state-hover")},
203
- function(){o.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");a(k).append(o);if(d){h.dir="rtl";a(".ui-jqdialog-title",k).css("float","right");a(".ui-jqdialog-titlebar-close",k).css("left","0.3em")}else{h.dir="ltr";a(".ui-jqdialog-title",k).css("float","left");a(".ui-jqdialog-titlebar-close",k).css("right","0.3em")}var m=document.createElement("div");a(m).addClass("ui-jqdialog-content ui-widget-content").attr("id",b.modalcontent);a(m).append(e);h.appendChild(m);
204
- a(h).prepend(k);j===true?a("body").append(h):a(h).insertBefore(f);if(typeof c.jqModal==="undefined")c.jqModal=true;e={};if(a.fn.jqm&&c.jqModal===true){if(c.left===0&&c.top===0){m=[];m=this.findPos(g);c.left=m[0]+4;c.top=m[1]+4}e.top=c.top+"px";e.left=c.left}else if(c.left!==0||c.top!==0){e.left=c.left;e.top=c.top+"px"}a("a.ui-jqdialog-titlebar-close",k).click(function(){var s=a("#"+b.themodal).data("onClose")||c.onClose,p=a("#"+b.themodal).data("gbox")||c.gbox;n.hideModal("#"+b.themodal,{gb:p,jqm:c.jqModal,
205
- onClose:s});return false});if(c.width===0||!c.width)c.width=300;if(c.height===0||!c.height)c.height=200;if(!c.zIndex){f=a(f).parents("*[role=dialog]").first().css("z-index");c.zIndex=f?parseInt(f,10)+1:950}f=0;if(d&&e.left&&!j){f=a(c.gbox).width()-(!isNaN(c.width)?parseInt(c.width,10):0)-8;e.left=parseInt(e.left,10)+parseInt(f,10)}if(e.left)e.left+="px";a(h).css(a.extend({width:isNaN(c.width)?"auto":c.width+"px",height:isNaN(c.height)?"auto":c.height+"px",zIndex:c.zIndex,overflow:"hidden"},e)).attr({tabIndex:"-1",
206
- role:"dialog","aria-labelledby":b.modalhead,"aria-hidden":"true"});if(typeof c.drag=="undefined")c.drag=true;if(typeof c.resize=="undefined")c.resize=true;if(c.drag){a(k).css("cursor","move");if(a.fn.jqDrag)a(h).jqDrag(k);else try{a(h).draggable({handle:a("#"+k.id)})}catch(l){}}if(c.resize)if(a.fn.jqResize){a(h).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?
207
- "#"+b.scrollelm:false)}else try{a(h).resizable({handles:"se, sw",alsoResize:b.scrollelm?"#"+b.scrollelm:false})}catch(q){}c.closeOnEscape===true&&a(h).keydown(function(s){if(s.which==27){s=a("#"+b.themodal).data("onClose")||c.onClose;n.hideModal(this,{gb:c.gbox,jqm:c.jqModal,onClose:s})}})},viewModal:function(b,e){e=a.extend({toTop:true,overlay:10,modal:false,onShow:this.showModal,onHide:this.closeModal,gbox:"",jqm:true,jqM:true},e||{});if(a.fn.jqm&&e.jqm===true)e.jqM?a(b).attr("aria-hidden","false").jqm(e).jqmShow():
208
- a(b).attr("aria-hidden","false").jqmShow();else{if(e.gbox!==""){a(".jqgrid-overlay:first",e.gbox).show();a(b).data("gbox",e.gbox)}a(b).show().attr("aria-hidden","false");try{a(":input:visible",b)[0].focus()}catch(c){}}},info_dialog:function(b,e,c,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 j=g.jqModal,h=
209
- this;if(a.fn.jqm&&!j)j=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 d="<div id='info_id'>";d+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+f+";"+("text-align:"+
210
- g.align+";")+"'>"+e+"</div>";d+=c?"<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'>"+c+"</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;'>"+
211
- b+"</div>":"";d+="</div>";try{a("#info_dialog").attr("aria-hidden")=="false"&&this.hideModal("#info_dialog",{jqm:j});a("#info_dialog").remove()}catch(n){}this.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},d,g,"","",true);b&&a.each(g.buttons,function(o){a("#"+this.id,"#info_id").bind("click",function(){g.buttons[o].onClick.call(a("#info_dialog"));return false})});a("#closedialog","#info_id").click(function(){h.hideModal("#info_dialog",{jqm:j});
212
- 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(o){o.w.hide().remove();o.o&&o.o.remove()},modal:g.modal,jqm:j});a.isFunction(g.afterOpen)&&g.afterOpen();try{a("#info_dialog").focus()}catch(k){}},createEl:function(b,e,c,f,g){function j(q,s){a.isFunction(s.dataInit)&&s.dataInit(q);s.dataEvents&&a.each(s.dataEvents,
213
- function(){this.data!==undefined?a(q).bind(this.type,this.data,this.fn):a(q).bind(this.type,this.fn)});return s}function h(q,s){var p=["dataInit","dataEvents","value","dataUrl","buildSelect"];a.each(s,function(r,v){a.inArray(r,p)===-1&&a(d).attr(r,v)})}var d="";switch(b){case "textarea":d=document.createElement("textarea");if(f)e.cols||a(d).css({width:"98%"});else if(!e.cols)e.cols=20;if(!e.rows)e.rows=2;if(c=="&nbsp;"||c=="&#160;"||c.length==1&&c.charCodeAt(0)==160)c="";d.value=c;h(d,e);e=j(d,e);
214
- a(d).attr({role:"textbox",multiline:"true"});break;case "checkbox":d=document.createElement("input");d.type="checkbox";if(e.value){var n=e.value.split(":");if(c===n[0]){d.checked=true;d.defaultChecked=true}d.value=n[0];a(d).attr("offval",n[1])}else{n=c.toLowerCase();if(n.search(/(false|0|no|off|undefined)/i)<0&&n!==""){d.checked=true;d.defaultChecked=true;d.value=c}else d.value="on";a(d).attr("offval","off")}h(d,e);e=j(d,e);a(d).attr("role","checkbox");break;case "select":d=document.createElement("select");
215
- d.setAttribute("role","select");var k,o=[];if(e.multiple===true){k=true;d.multiple="multiple";a(d).attr("aria-multiselectable","true")}else k=false;if(typeof e.dataUrl!="undefined")a.ajax(a.extend({url:e.dataUrl,type:"GET",dataType:"html",success:function(q){if(typeof e.buildSelect!="undefined"){q=e.buildSelect(q);q=a(q).html()}else q=a(q).html();if(q){a(d).append(q);h(d,e);e=j(d,e);if(typeof e.size==="undefined")e.size=k?3:1;if(k){o=c.split(",");o=a.map(o,function(s){return a.trim(s)})}else o[0]=
216
- a.trim(c);setTimeout(function(){a("option",d).each(function(){a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),o)>-1||a.inArray(a.trim(a(this).val()),o)>-1){this.selected="selected";if(!k)return false}})},0)}}},g||{}));else if(e.value){if(k){o=c.split(",");o=a.map(o,function(q){return a.trim(q)});if(typeof e.size==="undefined")e.size=3}else e.size=1;if(typeof e.value==="function")e.value=e.value();if(typeof e.value==="string"){f=e.value.split(";");for(n=0;n<f.length;n++){g=f[n].split(":");
217
- if(g.length>2)g[1]=a.map(g,function(q,s){if(s>0)return q}).join(":");b=document.createElement("option");b.setAttribute("role","option");b.value=g[0];b.innerHTML=g[1];if(!k&&(a.trim(g[0])==a.trim(c)||a.trim(g[1])==a.trim(c)))b.selected="selected";if(k&&(a.inArray(a.trim(g[1]),o)>-1||a.inArray(a.trim(g[0]),o)>-1))b.selected="selected";d.appendChild(b)}}else if(typeof e.value==="object"){f=e.value;for(n in f)if(f.hasOwnProperty(n)){b=document.createElement("option");b.setAttribute("role","option");b.value=
218
- n;b.innerHTML=f[n];if(!k&&(a.trim(n)==a.trim(c)||a.trim(f[n])==a.trim(c)))b.selected="selected";if(k&&(a.inArray(a.trim(f[n]),o)>-1||a.inArray(a.trim(n),o)>-1))b.selected="selected";d.appendChild(b)}}h(d,e);e=j(d,e)}break;case "text":case "password":case "button":n=b=="button"?"button":"textbox";d=document.createElement("input");d.type=b;d.value=c;h(d,e);e=j(d,e);if(b!="button")if(f)e.size||a(d).css({width:"98%"});else if(!e.size)e.size=20;a(d).attr("role",n);break;case "image":case "file":d=document.createElement("input");
219
- d.type=b;h(d,e);e=j(d,e);break;case "custom":d=document.createElement("span");try{if(a.isFunction(e.custom_element)){var m=e.custom_element.call(this,c,e);if(m){m=a(m).addClass("customelement").attr({id:e.id,name:e.name});a(d).empty().append(m)}else throw"e2";}else throw"e1";}catch(l){l=="e1"&&this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose);l=="e2"?this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.novalue,
220
- a.jgrid.edit.bClose):this.info_dialog(a.jgrid.errors.errcap,typeof l==="string"?l:l.message,a.jgrid.edit.bClose)}}return d},checkDate:function(b,e){var c={},f;b=b.toLowerCase();f=b.indexOf("/")!=-1?"/":b.indexOf("-")!=-1?"-":b.indexOf(".")!=-1?".":"/";b=b.split(f);e=e.split(f);if(e.length!=3)return false;f=-1;for(var g,j=-1,h=-1,d=0;d<b.length;d++){g=isNaN(e[d])?0:parseInt(e[d],10);c[b[d]]=g;g=b[d];if(g.indexOf("y")!=-1)f=d;if(g.indexOf("m")!=-1)h=d;if(g.indexOf("d")!=-1)j=d}g=b[f]=="y"||b[f]=="yyyy"?
221
- 4:b[f]=="yy"?2:-1;d=function(k){for(var o=1;o<=k;o++){this[o]=31;if(o==4||o==6||o==9||o==11)this[o]=30;if(o==2)this[o]=29}return this}(12);var n;if(f===-1)return false;else{n=c[b[f]].toString();if(g==2&&n.length==1)g=1;if(n.length!=g||c[b[f]]===0&&e[f]!="00")return false}if(h===-1)return false;else{n=c[b[h]].toString();if(n.length<1||c[b[h]]<1||c[b[h]]>12)return false}if(j===-1)return false;else{n=c[b[j]].toString();if(n.length<1||c[b[j]]<1||c[b[j]]>31||c[b[h]]==2&&c[b[j]]>(c[b[f]]%4===0&&(c[b[f]]%
222
- 100!==0||c[b[f]]%400===0)?29:28)||c[b[j]]>d[c[b[h]]])return false}return true},isEmpty:function(b){return b.match(/^\s+$/)||b===""?true:false},checkTime:function(b){var e=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!this.isEmpty(b))if(b=b.match(e)){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,e,c,f,g){var j,h;if(typeof f==="undefined")if(typeof e=="string"){f=0;for(g=c.p.colModel.length;f<g;f++)if(c.p.colModel[f].name==
223
- e){j=c.p.colModel[f].editrules;e=f;try{h=c.p.colModel[f].formoptions.label}catch(d){}break}}else{if(e>=0)j=c.p.colModel[e].editrules}else{j=f;h=g===undefined?"_":g}if(j){h||(h=c.p.colNames[e]);if(j.required===true)if(this.isEmpty(b))return[false,h+": "+a.jgrid.edit.msg.required,""];f=j.required===false?false:true;if(j.number===true)if(!(f===false&&this.isEmpty(b)))if(isNaN(b))return[false,h+": "+a.jgrid.edit.msg.number,""];if(typeof j.minValue!="undefined"&&!isNaN(j.minValue))if(parseFloat(b)<parseFloat(j.minValue))return[false,
224
- h+": "+a.jgrid.edit.msg.minValue+" "+j.minValue,""];if(typeof j.maxValue!="undefined"&&!isNaN(j.maxValue))if(parseFloat(b)>parseFloat(j.maxValue))return[false,h+": "+a.jgrid.edit.msg.maxValue+" "+j.maxValue,""];if(j.email===true)if(!(f===false&&this.isEmpty(b))){g=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
202
+ b.offsetLeft;c+=b.offsetTop}while(b=b.offsetParent)}return[e,c]},createModal:function(b,e,c,f,g,j,h){var d=document.createElement("div"),o,k=this;h=a.extend({},h||{});o=a(c.gbox).attr("dir")=="rtl"?true:false;d.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";d.id=b.themodal;var n=document.createElement("div");n.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";n.id=b.modalhead;a(n).append("<span class='ui-jqdialog-title'>"+c.caption+"</span>");var m=
203
+ a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){m.addClass("ui-state-hover")},function(){m.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");a(n).append(m);if(o){d.dir="rtl";a(".ui-jqdialog-title",n).css("float","right");a(".ui-jqdialog-titlebar-close",n).css("left","0.3em")}else{d.dir="ltr";a(".ui-jqdialog-title",n).css("float","left");a(".ui-jqdialog-titlebar-close",n).css("right","0.3em")}var l=document.createElement("div");
204
+ a(l).addClass("ui-jqdialog-content ui-widget-content").attr("id",b.modalcontent);a(l).append(e);d.appendChild(l);a(d).prepend(n);if(j===true)a("body").append(d);else typeof j=="string"?a(j).append(d):a(d).insertBefore(f);a(d).css(h);if(typeof c.jqModal==="undefined")c.jqModal=true;e={};if(a.fn.jqm&&c.jqModal===true){if(c.left===0&&c.top===0&&c.overlay){h=[];h=this.findPos(g);c.left=h[0]+4;c.top=h[1]+4}e.top=c.top+"px";e.left=c.left}else if(c.left!==0||c.top!==0){e.left=c.left;e.top=c.top+"px"}a("a.ui-jqdialog-titlebar-close",
205
+ n).click(function(){var p=a("#"+b.themodal).data("onClose")||c.onClose,r=a("#"+b.themodal).data("gbox")||c.gbox;k.hideModal("#"+b.themodal,{gb:r,jqm:c.jqModal,onClose:p});return false});if(c.width===0||!c.width)c.width=300;if(c.height===0||!c.height)c.height=200;if(!c.zIndex){f=a(f).parents("*[role=dialog]").filter(":first").css("z-index");c.zIndex=f?parseInt(f,10)+1:950}f=0;if(o&&e.left&&!j){f=a(c.gbox).width()-(!isNaN(c.width)?parseInt(c.width,10):0)-8;e.left=parseInt(e.left,10)+parseInt(f,10)}if(e.left)e.left+=
206
+ "px";a(d).css(a.extend({width:isNaN(c.width)?"auto":c.width+"px",height:isNaN(c.height)?"auto":c.height+"px",zIndex:c.zIndex,overflow:"hidden"},e)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":b.modalhead,"aria-hidden":"true"});if(typeof c.drag=="undefined")c.drag=true;if(typeof c.resize=="undefined")c.resize=true;if(c.drag){a(n).css("cursor","move");if(a.fn.jqDrag)a(d).jqDrag(n);else try{a(d).draggable({handle:a("#"+n.id)})}catch(q){}}if(c.resize)if(a.fn.jqResize){a(d).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>");
207
+ a("#"+b.themodal).jqResize(".jqResize",b.scrollelm?"#"+b.scrollelm:false)}else try{a(d).resizable({handles:"se, sw",alsoResize:b.scrollelm?"#"+b.scrollelm:false})}catch(s){}c.closeOnEscape===true&&a(d).keydown(function(p){if(p.which==27){p=a("#"+b.themodal).data("onClose")||c.onClose;k.hideModal(this,{gb:c.gbox,jqm:c.jqModal,onClose:p})}})},viewModal:function(b,e){e=a.extend({toTop:true,overlay:10,modal:false,onShow:this.showModal,onHide:this.closeModal,gbox:"",jqm:true,jqM:true},e||{});if(a.fn.jqm&&
208
+ e.jqm===true)e.jqM?a(b).attr("aria-hidden","false").jqm(e).jqmShow():a(b).attr("aria-hidden","false").jqmShow();else{if(e.gbox!==""){a(".jqgrid-overlay:first",e.gbox).show();a(b).data("gbox",e.gbox)}a(b).show().attr("aria-hidden","false");try{a(":input:visible",b)[0].focus()}catch(c){}}},info_dialog:function(b,e,c,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",
209
+ buttonalign:"center",buttons:[]};a.extend(g,f||{});var j=g.jqModal,h=this;if(a.fn.jqm&&!j)j=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 d="<div id='info_id'>";d+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+
210
+ f+";"+("text-align:"+g.align+";")+"'>"+e+"</div>";d+=c?"<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'>"+c+"</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;'>"+
211
+ b+"</div>":"";d+="</div>";try{a("#info_dialog").attr("aria-hidden")=="false"&&this.hideModal("#info_dialog",{jqm:j});a("#info_dialog").remove()}catch(o){}this.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},d,g,"","",true);b&&a.each(g.buttons,function(n){a("#"+this.id,"#info_id").bind("click",function(){g.buttons[n].onClick.call(a("#info_dialog"));return false})});a("#closedialog","#info_id").click(function(){h.hideModal("#info_dialog",{jqm:j});
212
+ 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(n){n.w.hide().remove();n.o&&n.o.remove()},modal:g.modal,jqm:j});a.isFunction(g.afterOpen)&&g.afterOpen();try{a("#info_dialog").focus()}catch(k){}},createEl:function(b,e,c,f,g){function j(l,q){a.isFunction(q.dataInit)&&q.dataInit(l);q.dataEvents&&a.each(q.dataEvents,
213
+ function(){this.data!==undefined?a(l).bind(this.type,this.data,this.fn):a(l).bind(this.type,this.fn)});return q}function h(l,q){var s=["dataInit","dataEvents","dataUrl","buildSelect","sopt","searchhidden","defaultValue","attr"];a.each(q,function(p,r){a.inArray(p,s)===-1&&a(l).attr(p,r)});q.hasOwnProperty("id")||a(l).attr("id",a.jgrid.randId())}var d="";switch(b){case "textarea":d=document.createElement("textarea");if(f)e.cols||a(d).css({width:"98%"});else if(!e.cols)e.cols=20;if(!e.rows)e.rows=2;
214
+ if(c=="&nbsp;"||c=="&#160;"||c.length==1&&c.charCodeAt(0)==160)c="";d.value=c;h(d,e);e=j(d,e);a(d).attr({role:"textbox",multiline:"true"});break;case "checkbox":d=document.createElement("input");d.type="checkbox";if(e.value){b=e.value.split(":");if(c===b[0]){d.checked=true;d.defaultChecked=true}d.value=b[0];a(d).attr("offval",b[1])}else{b=c.toLowerCase();if(b.search(/(false|0|no|off|undefined)/i)<0&&b!==""){d.checked=true;d.defaultChecked=true;d.value=c}else d.value="on";a(d).attr("offval","off")}h(d,
215
+ e);e=j(d,e);a(d).attr("role","checkbox");break;case "select":d=document.createElement("select");d.setAttribute("role","select");f=[];if(e.multiple===true){b=true;d.multiple="multiple";a(d).attr("aria-multiselectable","true")}else b=false;if(typeof e.dataUrl!="undefined")a.ajax(a.extend({url:e.dataUrl,type:"GET",dataType:"html",context:{elem:d,options:e,vl:c},success:function(l){var q=[],s=this.elem,p=this.vl,r=a.extend({},this.options),t=r.multiple===true;if(typeof r.buildSelect!="undefined"){l=r.buildSelect(l);
216
+ l=a(l).html()}else l=a(l).html();if(l){a(s).append(l);h(s,r);r=j(s,r);if(typeof r.size==="undefined")r.size=t?3:1;if(t){q=p.split(",");q=a.map(q,function(y){return a.trim(y)})}else q[0]=a.trim(p);setTimeout(function(){a("option",s).each(function(){a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),q)>-1||a.inArray(a.trim(a(this).val()),q)>-1)this.selected="selected"})},0)}}},g||{}));else if(e.value){var o;if(b){f=c.split(",");f=a.map(f,function(l){return a.trim(l)});if(typeof e.size===
217
+ "undefined")e.size=3}else e.size=1;if(typeof e.value==="function")e.value=e.value();var k,n;if(typeof e.value==="string"){k=e.value.split(";");for(o=0;o<k.length;o++){n=k[o].split(":");if(n.length>2)n[1]=a.map(n,function(l,q){if(q>0)return l}).join(":");g=document.createElement("option");g.setAttribute("role","option");g.value=n[0];g.innerHTML=n[1];if(!b&&(a.trim(n[0])==a.trim(c)||a.trim(n[1])==a.trim(c)))g.selected="selected";if(b&&(a.inArray(a.trim(n[1]),f)>-1||a.inArray(a.trim(n[0]),f)>-1))g.selected=
218
+ "selected";d.appendChild(g)}}else if(typeof e.value==="object"){k=e.value;for(o in k)if(k.hasOwnProperty(o)){g=document.createElement("option");g.setAttribute("role","option");g.value=o;g.innerHTML=k[o];if(!b&&(a.trim(o)==a.trim(c)||a.trim(k[o])==a.trim(c)))g.selected="selected";if(b&&(a.inArray(a.trim(k[o]),f)>-1||a.inArray(a.trim(o),f)>-1))g.selected="selected";d.appendChild(g)}}h(d,e);e=j(d,e)}break;case "text":case "password":case "button":o=b=="button"?"button":"textbox";d=document.createElement("input");
219
+ d.type=b;d.value=c;h(d,e);e=j(d,e);if(b!="button")if(f)e.size||a(d).css({width:"98%"});else if(!e.size)e.size=20;a(d).attr("role",o);break;case "image":case "file":d=document.createElement("input");d.type=b;h(d,e);e=j(d,e);break;case "custom":d=document.createElement("span");try{if(a.isFunction(e.custom_element))if(k=e.custom_element.call(this,c,e)){k=a(k).addClass("customelement").attr({id:e.id,name:e.name});a(d).empty().append(k)}else throw"e2";else throw"e1";}catch(m){m=="e1"&&this.info_dialog(a.jgrid.errors.errcap,
220
+ "function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose);m=="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 m==="string"?m:m.message,a.jgrid.edit.bClose)}}return d},checkDate:function(b,e){var c={},f;b=b.toLowerCase();f=b.indexOf("/")!=-1?"/":b.indexOf("-")!=-1?"-":b.indexOf(".")!=-1?".":"/";b=b.split(f);e=e.split(f);if(e.length!=3)return false;f=-1;for(var g,j=
221
+ -1,h=-1,d=0;d<b.length;d++){g=isNaN(e[d])?0:parseInt(e[d],10);c[b[d]]=g;g=b[d];if(g.indexOf("y")!=-1)f=d;if(g.indexOf("m")!=-1)h=d;if(g.indexOf("d")!=-1)j=d}g=b[f]=="y"||b[f]=="yyyy"?4:b[f]=="yy"?2:-1;d=function(k){for(var n=1;n<=k;n++){this[n]=31;if(n==4||n==6||n==9||n==11)this[n]=30;if(n==2)this[n]=29}return this}(12);var o;if(f===-1)return false;else{o=c[b[f]].toString();if(g==2&&o.length==1)g=1;if(o.length!=g||c[b[f]]===0&&e[f]!="00")return false}if(h===-1)return false;else{o=c[b[h]].toString();
222
+ if(o.length<1||c[b[h]]<1||c[b[h]]>12)return false}if(j===-1)return false;else{o=c[b[j]].toString();if(o.length<1||c[b[j]]<1||c[b[j]]>31||c[b[h]]==2&&c[b[j]]>(c[b[f]]%4===0&&(c[b[f]]%100!==0||c[b[f]]%400===0)?29:28)||c[b[j]]>d[c[b[h]]])return false}return true},isEmpty:function(b){return b.match(/^\s+$/)||b===""?true:false},checkTime:function(b){var e=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!this.isEmpty(b))if(b=b.match(e)){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;
223
+ return true},checkValues:function(b,e,c,f,g){var j,h;if(typeof f==="undefined")if(typeof e=="string"){f=0;for(g=c.p.colModel.length;f<g;f++)if(c.p.colModel[f].name==e){j=c.p.colModel[f].editrules;e=f;try{h=c.p.colModel[f].formoptions.label}catch(d){}break}}else{if(e>=0)j=c.p.colModel[e].editrules}else{j=f;h=g===undefined?"_":g}if(j){h||(h=c.p.colNames[e]);if(j.required===true)if(this.isEmpty(b))return[false,h+": "+a.jgrid.edit.msg.required,""];f=j.required===false?false:true;if(j.number===true)if(!(f===
224
+ false&&this.isEmpty(b)))if(isNaN(b))return[false,h+": "+a.jgrid.edit.msg.number,""];if(typeof j.minValue!="undefined"&&!isNaN(j.minValue))if(parseFloat(b)<parseFloat(j.minValue))return[false,h+": "+a.jgrid.edit.msg.minValue+" "+j.minValue,""];if(typeof j.maxValue!="undefined"&&!isNaN(j.maxValue))if(parseFloat(b)>parseFloat(j.maxValue))return[false,h+": "+a.jgrid.edit.msg.maxValue+" "+j.maxValue,""];if(j.email===true)if(!(f===false&&this.isEmpty(b))){g=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
225
225
  if(!g.test(b))return[false,h+": "+a.jgrid.edit.msg.email,""]}if(j.integer===true)if(!(f===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(j.date===true)if(!(f===false&&this.isEmpty(b))){e=c.p.colModel[e].formatoptions&&c.p.colModel[e].formatoptions.newformat?c.p.colModel[e].formatoptions.newformat:c.p.colModel[e].datefmt||"Y-m-d";if(!this.checkDate(e,b))return[false,h+": "+a.jgrid.edit.msg.date+
226
226
  " - "+e,""]}if(j.time===true)if(!(f===false&&this.isEmpty(b)))if(!this.checkTime(b))return[false,h+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(j.url===true)if(!(f===false&&this.isEmpty(b))){g=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!g.test(b))return[false,h+": "+a.jgrid.edit.msg.url,""]}if(j.custom===true)if(!(f===false&&this.isEmpty(b)))if(a.isFunction(j.custom_func)){b=j.custom_func.call(c,b,h);return a.isArray(b)?
227
227
  b:[false,a.jgrid.edit.msg.customarray,""]}else return[false,a.jgrid.edit.msg.customfcheck,""]}return[true,"",""]}})})(jQuery);
228
228
  (function(a){a.fn.jqFilter=function(b){if(typeof b==="string"){var e=a.fn.jqFilter[b];if(!e)throw"jqFilter - No such method: "+b;var c=a.makeArray(arguments).slice(1);return e.apply(this,c)}var f=a.extend(true,{filter:null,columns:[],onChange:null,checkValues:null,error:false,errmsg:"",errorcheck:true,showQuery:true,sopt:null,ops:[{name:"eq",description:"equal",operator:"="},{name:"ne",description:"not equal",operator:"<>"},{name:"lt",description:"less",operator:"<"},{name:"le",description:"less or equal",
229
229
  operator:"<="},{name:"gt",description:"greater",operator:">"},{name:"ge",description:"greater or equal",operator:">="},{name:"bw",description:"begins with",operator:"LIKE"},{name:"bn",description:"does not begin with",operator:"NOT LIKE"},{name:"in",description:"in",operator:"IN"},{name:"ni",description:"not in",operator:"NOT IN"},{name:"ew",description:"ends with",operator:"LIKE"},{name:"en",description:"does not end with",operator:"NOT LIKE"},{name:"cn",description:"contains",operator:"LIKE"},{name:"nc",
230
230
  description:"does not contain",operator:"NOT LIKE"},{name:"nu",description:"is null",operator:"IS NULL"},{name:"nn",description:"is not null",operator:"IS NOT NULL"}],numopts:["eq","ne","lt","le","gt","ge","nu","nn","in","ni"],stropts:["eq","ne","bw","bn","ew","en","cn","nc","nu","nn","in","ni"],_gridsopt:[],groupOps:["AND","OR"],groupButton:true},b||{});return this.each(function(){if(!this.filter){this.p=f;if(this.p.filter===null||this.p.filter===undefined)this.p.filter={groupOp:this.p.groupOps[0],
231
- rules:[],groups:[]};var g,j=this.p.columns.length,h,d=/msie/i.test(navigator.userAgent)&&!win.opera;if(this.p._gridsopt.length)for(g=0;g<this.p._gridsopt.length;g++)this.p.ops[g].description=this.p._gridsopt[g];this.p.initFilter=a.extend(true,{},this.p.filter);if(j){for(g=0;g<j;g++){h=this.p.columns[g];if(h.stype)h.inputtype=h.stype;else if(!h.inputtype)h.inputtype="text";if(h.sorttype)h.searchtype=h.sorttype;else if(!h.searchtype)h.searchtype="string";if(h.hidden===undefined)h.hidden=false;if(!h.label)h.label=
232
- h.name;if(h.index)h.name=h.index;if(!h.hasOwnProperty("searchoptions"))h.searchoptions={};if(!h.hasOwnProperty("searchrules"))h.searchrules={}}this.p.showQuery&&a(this).append("<table class='queryresult ui-widget ui-widget-content' style='display:block;max-width:440px;border:0px none;'><tbody><tr><td class='query'></td></tr></tbody></table>");var n=function(k,o){var m=[true,""];if(a.isFunction(o.searchrules))m=o.searchrules(k,o);else if(a.jgrid&&a.jgrid.checkValues)try{m=a.jgrid.checkValues(k,-1,
233
- null,o.searchrules,o.label)}catch(l){}if(m&&m.length&&m[0]===false){f.error=!m[0];f.errmsg=m[1]}};this.onchange=function(){this.p.error=false;this.p.errmsg="";return a.isFunction(this.p.onChange)?this.p.onChange.call(this,this.p):false};this.reDraw=function(){a("table.group:first",this).remove();var k=this.createTableForGroup(f.filter,null);a(this).append(k)};this.createTableForGroup=function(k,o){var m=this,l,q=a("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody>");
234
- o===null&&a(q).append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='left'></th></tr>");var s=a("<tr></tr>");a(q).append(s);var p=a("<th colspan='5' align='left'></th>");s.append(p);var r=a("<select class='opsel'></select>");p.append(r);s="";var v;for(l=0;l<f.groupOps.length;l++){v=k.groupOp===m.p.groupOps[l]?" selected='selected'":"";s+="<option value='"+m.p.groupOps[l]+"'"+v+">"+m.p.groupOps[l]+"</option>"}r.append(s).bind("change",function(){k.groupOp=a(r).val();
235
- m.onchange()});s="<span></span>";if(this.p.groupButton){s=a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>");s.bind("click",function(){if(k.groups===undefined)k.groups=[];k.groups.push({groupOp:f.groupOps[0],rules:[],groups:[]});m.reDraw();m.onchange();return false})}p.append(s);s=a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>");var y;s.bind("click",function(){if(k.rules===undefined)k.rules=[];for(l=0;l<m.p.columns.length;l++){var D=typeof m.p.columns[l].search===
236
- "undefined"?true:m.p.columns[l].search,G=m.p.columns[l].hidden===true;if(m.p.columns[l].searchoptions.searchhidden===true&&D||D&&!G){y=m.p.columns[l];break}}k.rules.push({field:y.name,op:(y.searchoptions.sopt?y.searchoptions.sopt:m.p.sopt?m.p.sopt:y.searchtype==="string"?m.p.stropts:m.p.numopts)[0],data:""});m.reDraw();return false});p.append(s);if(o!==null){s=a("<input type='button' value='-' title='Delete group' class='delete-group'/>");p.append(s);s.bind("click",function(){for(l=0;l<o.groups.length;l++)if(o.groups[l]===
237
- k){o.groups.splice(l,1);break}m.reDraw();m.onchange();return false})}if(k.groups!==undefined)for(l=0;l<k.groups.length;l++){p=a("<tr></tr>");q.append(p);s=a("<td class='first'></td>");p.append(s);s=a("<td colspan='4'></td>");s.append(this.createTableForGroup(k.groups[l],k));p.append(s)}if(k.groupOp===undefined)k.groupOp=m.p.groupOps[0];if(k.rules!==undefined)for(l=0;l<k.rules.length;l++)q.append(this.createTableRowForRule(k.rules[l],k));return q};this.createTableRowForRule=function(k,o){var m=this,
238
- l=a("<tr></tr>"),q,s,p,r,v="",y;l.append("<td class='first'></td>");var D=a("<td class='columns'></td>");l.append(D);var G=a("<select></select>");D.append(G);G.bind("change",function(){k.field=a(G).val();p=a(this).parents("tr:first");for(q=0;q<m.p.columns.length;q++)if(m.p.columns[q].name===k.field){r=m.p.columns[q];break}if(r){r.searchoptions.id=Math.floor(Math.random()*1E4).toString();if(d)if(!r.searchoptions.size)r.searchoptions.size=10;var A=a.jgrid.createEl(r.inputtype,r.searchoptions,"",true,
231
+ rules:[],groups:[]};var g,j=this.p.columns.length,h,d=/msie/i.test(navigator.userAgent)&&!window.opera;if(this.p._gridsopt.length)for(g=0;g<this.p._gridsopt.length;g++)this.p.ops[g].description=this.p._gridsopt[g];this.p.initFilter=a.extend(true,{},this.p.filter);if(j){for(g=0;g<j;g++){h=this.p.columns[g];if(h.stype)h.inputtype=h.stype;else if(!h.inputtype)h.inputtype="text";if(h.sorttype)h.searchtype=h.sorttype;else if(!h.searchtype)h.searchtype="string";if(h.hidden===undefined)h.hidden=false;if(!h.label)h.label=
232
+ h.name;if(h.index)h.name=h.index;if(!h.hasOwnProperty("searchoptions"))h.searchoptions={};if(!h.hasOwnProperty("searchrules"))h.searchrules={}}this.p.showQuery&&a(this).append("<table class='queryresult ui-widget ui-widget-content' style='display:block;max-width:440px;border:0px none;'><tbody><tr><td class='query'></td></tr></tbody></table>");var o=function(k,n){var m=[true,""];if(a.isFunction(n.searchrules))m=n.searchrules(k,n);else if(a.jgrid&&a.jgrid.checkValues)try{m=a.jgrid.checkValues(k,-1,
233
+ null,n.searchrules,n.label)}catch(l){}if(m&&m.length&&m[0]===false){f.error=!m[0];f.errmsg=m[1]}};this.onchange=function(){this.p.error=false;this.p.errmsg="";return a.isFunction(this.p.onChange)?this.p.onChange.call(this,this.p):false};this.reDraw=function(){a("table.group:first",this).remove();var k=this.createTableForGroup(f.filter,null);a(this).append(k)};this.createTableForGroup=function(k,n){var m=this,l,q=a("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody></tbody></table>");
234
+ n===null&&a(q).append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='left'></th></tr>");var s=a("<tr></tr>");a(q).append(s);var p=a("<th colspan='5' align='left'></th>");s.append(p);var r=a("<select class='opsel'></select>");p.append(r);s="";var t;for(l=0;l<f.groupOps.length;l++){t=k.groupOp===m.p.groupOps[l]?" selected='selected'":"";s+="<option value='"+m.p.groupOps[l]+"'"+t+">"+m.p.groupOps[l]+"</option>"}r.append(s).bind("change",function(){k.groupOp=a(r).val();
235
+ m.onchange()});s="<span></span>";if(this.p.groupButton){s=a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>");s.bind("click",function(){if(k.groups===undefined)k.groups=[];k.groups.push({groupOp:f.groupOps[0],rules:[],groups:[]});m.reDraw();m.onchange();return false})}p.append(s);s=a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>");var y;s.bind("click",function(){if(k.rules===undefined)k.rules=[];for(l=0;l<m.p.columns.length;l++){var B=typeof m.p.columns[l].search===
236
+ "undefined"?true:m.p.columns[l].search,G=m.p.columns[l].hidden===true;if(m.p.columns[l].searchoptions.searchhidden===true&&B||B&&!G){y=m.p.columns[l];break}}k.rules.push({field:y.name,op:(y.searchoptions.sopt?y.searchoptions.sopt:m.p.sopt?m.p.sopt:y.searchtype==="string"?m.p.stropts:m.p.numopts)[0],data:""});m.reDraw();return false});p.append(s);if(n!==null){s=a("<input type='button' value='-' title='Delete group' class='delete-group'/>");p.append(s);s.bind("click",function(){for(l=0;l<n.groups.length;l++)if(n.groups[l]===
237
+ k){n.groups.splice(l,1);break}m.reDraw();m.onchange();return false})}if(k.groups!==undefined)for(l=0;l<k.groups.length;l++){p=a("<tr></tr>");q.append(p);s=a("<td class='first'></td>");p.append(s);s=a("<td colspan='4'></td>");s.append(this.createTableForGroup(k.groups[l],k));p.append(s)}if(k.groupOp===undefined)k.groupOp=m.p.groupOps[0];if(k.rules!==undefined)for(l=0;l<k.rules.length;l++)q.append(this.createTableRowForRule(k.rules[l],k));return q};this.createTableRowForRule=function(k,n){var m=this,
238
+ l=a("<tr></tr>"),q,s,p,r,t="",y;l.append("<td class='first'></td>");var B=a("<td class='columns'></td>");l.append(B);var G=a("<select></select>");B.append(G);G.bind("change",function(){k.field=a(G).val();p=a(this).parents("tr:first");for(q=0;q<m.p.columns.length;q++)if(m.p.columns[q].name===k.field){r=m.p.columns[q];break}if(r){r.searchoptions.id=a.jgrid.randId();if(d&&r.inputtype==="text")if(!r.searchoptions.size)r.searchoptions.size=10;var A=a.jgrid.createEl(r.inputtype,r.searchoptions,"",true,
239
239
  m.p.ajaxSelectOptions,true);a(A).addClass("input-elm");s=r.searchoptions.sopt?r.searchoptions.sopt:m.p.sopt?m.p.sopt:r.searchtype==="string"?m.p.stropts:m.p.numopts;var z="",M="";for(q=0;q<m.p.ops.length;q++)if(a.inArray(m.p.ops[q].name,s)!==-1){M=k.op===m.p.ops[q].name?" selected=selected":"";z+="<option value='"+m.p.ops[q].name+"'"+M+">"+m.p.ops[q].description+"</option>"}a(".selectopts",p).empty().append(z);a(".data",p).empty().append(A);a(".input-elm",p).bind("change",function(){k.data=a(this).val();
240
- if(a.isArray(k.data))k.data=k.data.join(",");m.onchange()});setTimeout(function(){k.data=a(A).val();m.onchange()},0)}});for(q=D=0;q<m.p.columns.length;q++){y=typeof m.p.columns[q].search==="undefined"?true:m.p.columns[q].search;var x=m.p.columns[q].hidden===true;if(m.p.columns[q].searchoptions.searchhidden===true&&y||y&&!x){y="";if(k.field===m.p.columns[q].name){y=" selected='selected'";D=q}v+="<option value='"+m.p.columns[q].name+"'"+y+">"+m.p.columns[q].label+"</option>"}}G.append(v);v=a("<td class='operators'></td>");
241
- l.append(v);r=f.columns[D];r.searchoptions.id=Math.floor(Math.random()*1E4).toString();if(d)if(!r.searchoptions.size)r.searchoptions.size=10;D=a.jgrid.createEl(r.inputtype,r.searchoptions,k.data,true,m.p.ajaxSelectOptions,true);var B=a("<select class='selectopts'></select>");v.append(B);B.bind("change",function(){k.op=a(B).val();p=a(this).parents("tr:first");var A=a(".input-elm",p)[0];if(k.op==="nu"||k.op==="nn"){k.data="";A.value="";A.setAttribute("readonly","true");A.setAttribute("disabled","true")}else{A.removeAttribute("readonly");
242
- A.removeAttribute("disabled")}m.onchange()});s=r.searchoptions.sopt?r.searchoptions.sopt:m.p.sopt?m.p.sopt:r.searchtype==="string"?f.stropts:m.p.numopts;v="";for(q=0;q<m.p.ops.length;q++)if(a.inArray(m.p.ops[q].name,s)!==-1){y=k.op===m.p.ops[q].name?" selected='selected'":"";v+="<option value='"+m.p.ops[q].name+"'"+y+">"+m.p.ops[q].description+"</option>"}B.append(v);v=a("<td class='data'></td>");l.append(v);v.append(D);a(D).addClass("input-elm").bind("change",function(){k.data=a(this).val();if(a.isArray(k.data))k.data=
243
- k.data.join(",");m.onchange()});v=a("<td></td>");l.append(v);D=a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");v.append(D);D.bind("click",function(){for(q=0;q<o.rules.length;q++)if(o.rules[q]===k){o.rules.splice(q,1);break}m.reDraw();m.onchange();return false});return l};this.getStringForGroup=function(k){var o="(",m;if(k.groups!==undefined)for(m=0;m<k.groups.length;m++){if(o.length>1)o+=" "+k.groupOp+" ";try{o+=this.getStringForGroup(k.groups[m])}catch(l){alert(l)}}if(k.rules!==
244
- undefined)try{for(m=0;m<k.rules.length;m++){if(o.length>1)o+=" "+k.groupOp+" ";o+=this.getStringForRule(k.rules[m])}}catch(q){alert(q)}o+=")";return o==="()"?"":o};this.getStringForRule=function(k){var o="",m="",l,q;for(l=0;l<this.p.ops.length;l++)if(this.p.ops[l].name===k.op){o=this.p.ops[l].operator;m=this.p.ops[l].name;break}for(l=0;l<this.p.columns.length;l++)if(this.p.columns[l].name===k.field){q=this.p.columns[l];break}l=k.data;if(m==="bw"||m==="bn")l+="%";if(m==="ew"||m==="en")l="%"+l;if(m===
245
- "cn"||m==="nc")l="%"+l+"%";if(m==="in"||m==="ni")l=" ("+l+")";f.errorcheck&&n(k.data,q);return a.inArray(q.searchtype,["int","integer","float","number","currency"])!==-1||m==="nn"||m==="nu"?k.field+" "+o+" "+l:k.field+" "+o+' "'+l+'"'};this.resetFilter=function(){this.p.filter=a.extend(true,{},this.p.initFilter);this.reDraw();this.onchange()};this.hideError=function(){a("th.ui-state-error",this).html("");a("tr.error",this).hide()};this.showError=function(){a("th.ui-state-error",this).html(this.p.errmsg);
246
- a("tr.error",this).show()};this.toUserFriendlyString=function(){return this.getStringForGroup(f.filter)};this.toString=function(){function k(m){var l="(",q;if(m.groups!==undefined)for(q=0;q<m.groups.length;q++){if(l.length>1)l+=m.groupOp==="OR"?" || ":" && ";l+=k(m.groups[q])}if(m.rules!==undefined)for(q=0;q<m.rules.length;q++){if(l.length>1)l+=m.groupOp==="OR"?" || ":" && ";l=l;var s=m.rules[q];if(o.p.errorcheck){var p=void 0,r=void 0;for(p=0;p<o.p.columns.length;p++)if(o.p.columns[p].name===s.field){r=
247
- o.p.columns[p];break}r&&n(s.data,r)}l=l+(s.op+"(item."+s.field+",'"+s.data+"')")}l+=")";return l==="()"?"":l}var o=this;return k(this.p.filter)};this.reDraw();this.p.showQuery&&this.onchange();this.filter=true}}})};a.extend(a.fn.jqFilter,{toSQLString:function(){var b="";this.each(function(){b=this.toUserFriendlyString()});return b},filterData:function(){var b;this.each(function(){b=this.p.filter});return b},getParameter:function(b){if(b!==undefined)if(this.p.hasOwnProperty(b))return this.p[b];return this.p},
240
+ if(a.isArray(k.data))k.data=k.data.join(",");m.onchange()});setTimeout(function(){k.data=a(A).val();m.onchange()},0)}});for(q=B=0;q<m.p.columns.length;q++){y=typeof m.p.columns[q].search==="undefined"?true:m.p.columns[q].search;var x=m.p.columns[q].hidden===true;if(m.p.columns[q].searchoptions.searchhidden===true&&y||y&&!x){y="";if(k.field===m.p.columns[q].name){y=" selected='selected'";B=q}t+="<option value='"+m.p.columns[q].name+"'"+y+">"+m.p.columns[q].label+"</option>"}}G.append(t);t=a("<td class='operators'></td>");
241
+ l.append(t);r=f.columns[B];r.searchoptions.id=a.jgrid.randId();if(d&&r.inputtype==="text")if(!r.searchoptions.size)r.searchoptions.size=10;B=a.jgrid.createEl(r.inputtype,r.searchoptions,k.data,true,m.p.ajaxSelectOptions,true);var C=a("<select class='selectopts'></select>");t.append(C);C.bind("change",function(){k.op=a(C).val();p=a(this).parents("tr:first");var A=a(".input-elm",p)[0];if(k.op==="nu"||k.op==="nn"){k.data="";A.value="";A.setAttribute("readonly","true");A.setAttribute("disabled","true")}else{A.removeAttribute("readonly");
242
+ A.removeAttribute("disabled")}m.onchange()});s=r.searchoptions.sopt?r.searchoptions.sopt:m.p.sopt?m.p.sopt:r.searchtype==="string"?f.stropts:m.p.numopts;t="";for(q=0;q<m.p.ops.length;q++)if(a.inArray(m.p.ops[q].name,s)!==-1){y=k.op===m.p.ops[q].name?" selected='selected'":"";t+="<option value='"+m.p.ops[q].name+"'"+y+">"+m.p.ops[q].description+"</option>"}C.append(t);t=a("<td class='data'></td>");l.append(t);t.append(B);a(B).addClass("input-elm").bind("change",function(){k.data=a(this).val();if(a.isArray(k.data))k.data=
243
+ k.data.join(",");m.onchange()});t=a("<td></td>");l.append(t);B=a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");t.append(B);B.bind("click",function(){for(q=0;q<n.rules.length;q++)if(n.rules[q]===k){n.rules.splice(q,1);break}m.reDraw();m.onchange();return false});return l};this.getStringForGroup=function(k){var n="(",m;if(k.groups!==undefined)for(m=0;m<k.groups.length;m++){if(n.length>1)n+=" "+k.groupOp+" ";try{n+=this.getStringForGroup(k.groups[m])}catch(l){alert(l)}}if(k.rules!==
244
+ undefined)try{for(m=0;m<k.rules.length;m++){if(n.length>1)n+=" "+k.groupOp+" ";n+=this.getStringForRule(k.rules[m])}}catch(q){alert(q)}n+=")";return n==="()"?"":n};this.getStringForRule=function(k){var n="",m="",l,q;for(l=0;l<this.p.ops.length;l++)if(this.p.ops[l].name===k.op){n=this.p.ops[l].operator;m=this.p.ops[l].name;break}for(l=0;l<this.p.columns.length;l++)if(this.p.columns[l].name===k.field){q=this.p.columns[l];break}l=k.data;if(m==="bw"||m==="bn")l+="%";if(m==="ew"||m==="en")l="%"+l;if(m===
245
+ "cn"||m==="nc")l="%"+l+"%";if(m==="in"||m==="ni")l=" ("+l+")";f.errorcheck&&o(k.data,q);return a.inArray(q.searchtype,["int","integer","float","number","currency"])!==-1||m==="nn"||m==="nu"?k.field+" "+n+" "+l:k.field+" "+n+' "'+l+'"'};this.resetFilter=function(){this.p.filter=a.extend(true,{},this.p.initFilter);this.reDraw();this.onchange()};this.hideError=function(){a("th.ui-state-error",this).html("");a("tr.error",this).hide()};this.showError=function(){a("th.ui-state-error",this).html(this.p.errmsg);
246
+ a("tr.error",this).show()};this.toUserFriendlyString=function(){return this.getStringForGroup(f.filter)};this.toString=function(){function k(m){var l="(",q;if(m.groups!==undefined)for(q=0;q<m.groups.length;q++){if(l.length>1)l+=m.groupOp==="OR"?" || ":" && ";l+=k(m.groups[q])}if(m.rules!==undefined)for(q=0;q<m.rules.length;q++){if(l.length>1)l+=m.groupOp==="OR"?" || ":" && ";l=l;var s=m.rules[q];if(n.p.errorcheck){var p=void 0,r=void 0;for(p=0;p<n.p.columns.length;p++)if(n.p.columns[p].name===s.field){r=
247
+ n.p.columns[p];break}r&&o(s.data,r)}l=l+(s.op+"(item."+s.field+",'"+s.data+"')")}l+=")";return l==="()"?"":l}var n=this;return k(this.p.filter)};this.reDraw();this.p.showQuery&&this.onchange();this.filter=true}}})};a.extend(a.fn.jqFilter,{toSQLString:function(){var b="";this.each(function(){b=this.toUserFriendlyString()});return b},filterData:function(){var b;this.each(function(){b=this.p.filter});return b},getParameter:function(b){if(b!==undefined)if(this.p.hasOwnProperty(b))return this.p[b];return this.p},
248
248
  resetFilter:function(){return this.each(function(){this.resetFilter()})},addFilter:function(b){if(typeof b==="string")b=jQuery.jgrid.parse(b);this.each(function(){this.p.filter=b;this.reDraw();this.onchange()})}})})(jQuery);
249
249
  (function(a){var b=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,multipleGroup:false,top:0,left:0,jqModal:true,modal:false,resize:false,width:450,height:"auto",dataheight:"auto",showQuery:false,errorcheck:true,
250
- sopt:null,stringResult:undefined,onClose:null,onSearch:null,onReset:null,toTop:true,overlay:10,columns:[]},a.jgrid.search,e||{});return this.each(function(){function c(){if(a.isFunction(e.beforeShowSearch)){j=e.beforeShowSearch(a("#"+g));if(typeof j==="undefined")j=true}if(j){a.jgrid.viewModal("#"+h.themodal,{gbox:"#gbox_"+g,jqm:e.jqModal,modal:e.modal,overlay:e.overlay,toTop:e.toTop});a.isFunction(e.afterShowSearch)&&e.afterShowSearch(a("#"+g))}}var f=this;if(f.grid){var g="fbox_"+f.p.id,j=true,
251
- h={themodal:"editmod"+g,modalhead:"edithd"+g,modalcontent:"editcnt"+g,scrollelm:g},d=f.p.postData[e.sFilter];if(typeof d==="string")d=a.jgrid.parse(d);e.recreateFilter===true&&a("#"+h.themodal).remove();if(a("#"+h.themodal).html()!==null)c();else{var n=a("<span><div id='"+g+"' class='searchFilter' style='overflow:auto'></div></span>").insertBefore("#gview_"+f.p.id);a.isFunction(e.onInitializeSearch)&&e.onInitializeSearch(a("#"+g));var k=a.extend([],f.p.colModel),o="<a href='javascript:void(0)' id='"+
252
- g+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-reset'><span class='ui-icon ui-icon-search'></span>"+e.Find+"</a>",m="<a href='javascript:void(0)' id='"+g+"_reset' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-search'><span class='ui-icon ui-icon-arrowreturnthick-1-w'></span>"+e.Reset+"</a>",l="";if(e.showQuery)l="<a href='javascript:void(0)' id='"+g+"_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>";
253
- o="<table class='EditTable' style='border:0px none;margin-top:5px' id='"+g+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:left'>"+m+"</td><td class='EditButton'>"+l+o+"</td></tr></tbody></table>";var q,s=false;if(e.columns.length)k=e.columns;else a.each(k,function(p,r){if(!r.label)r.label=f.p.colNames[p];if(!s){var v=typeof r.search==="undefined"?true:r.search,y=r.hidden===true;if(r.searchoptions&&r.searchoptions.searchhidden===
254
- true&&v||v&&!y){s=true;q=r.index||r.name}}});if(!d&&q||e.multipleSearch===false)d={groupOp:"AND",rules:[{field:q,op:"eq",data:""}]};a("#"+g).jqFilter({columns:k,filter:e.loadDefaults?d:null,showQuery:e.showQuery,errorcheck:e.errorcheck,sopt:e.sopt,groupButton:e.multipleGroup,_gridsopt:a.jgrid.search.odata,onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString())}});n.append(o);if(e.multipleSearch===false){a(".add-rule","#"+g).hide();a(".delete-rule","#"+g).hide()}a.isFunction(e.onInitializeSearch)&&
255
- e.onInitializeSearch(a("#"+g));a.jgrid.createModal(h,n,e,"#gview_"+f.p.id,a("#gbox_"+f.p.id)[0]);l&&a("#"+g+"_query").bind("click",function(){a(".queryresult",n).toggle();return false});if(e.stringResult===undefined)e.stringResult=e.multipleSearch;a("#"+g+"_search").bind("click",function(){var p=a("#"+g),r={},v,y=p.jqFilter("filterData");if(e.errorcheck){p[0].hideError();e.showQuery||p.jqFilter("toSQLString");if(p[0].p.error){p[0].showError();return false}}if(e.stringResult){try{v=xmlJsonClass.toJson(y,
256
- "","",false)}catch(D){try{v=JSON.stringify(y)}catch(G){}}if(typeof v==="string"){r[e.sFilter]=v;a.each([e.sField,e.sValue,e.sOper],function(){r[this]=""})}}else if(e.multipleSearch){r[e.sFilter]=y;a.each([e.sField,e.sValue,e.sOper],function(){r[this]=""})}else{r[e.sField]=y.rules[0].field;r[e.sValue]=y.rules[0].data;r[e.sOper]=y.rules[0].op;r[e.sFilter]=""}f.p.search=true;a.extend(f.p.postData,r);a.isFunction(e.onSearch)&&e.onSearch();a(f).trigger("reloadGrid",[{page:1}]);e.closeAfterSearch&&a.jgrid.hideModal("#"+
257
- h.themodal,{gb:"#gbox_"+f.p.id,jqm:e.jqModal,onClose:e.onClose});return false});a("#"+g+"_reset").bind("click",function(){var p={},r=a("#"+g);f.p.search=false;if(e.multipleSearch===false)p[e.sField]=p[e.sValue]=p[e.sOper]="";else p[e.sFilter]="";r[0].resetFilter();a.extend(f.p.postData,p);a.isFunction(e.onReset)&&e.onReset();a(f).trigger("reloadGrid",[{page:1}]);return false});c();a(".fm-button:not(.ui-state-disabled)",n).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},
258
- editGridRow:function(e,c){b=c=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,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",
259
- 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,c||{});return this.each(function(){function f(){a(".FormElement","#"+p).each(function(){var F=a(".customelement",this);if(F.length){var I=a(F[0]).attr("name");a.each(l.p.colModel,function(){if(this.name===I&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{z[I]=
260
- this.editoptions.custom_value(a("#"+a.jgrid.jqID(I),"#"+p),"get");if(z[I]===undefined)throw"e1";}catch(O){O==="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,O.message,jQuery.jgrid.edit.bClose)}return true}})}else{switch(a(this).get(0).type){case "checkbox":if(a(this).attr("checked"))z[this.name]=a(this).val();else{F=a(this).attr("offval");z[this.name]=F}break;case "select-one":z[this.name]=
261
- a("option:selected",this).val();M[this.name]=a("option:selected",this).text();break;case "select-multiple":z[this.name]=a(this).val();z[this.name]=z[this.name]?z[this.name].join(","):"";var T=[];a("option:selected",this).each(function(O,W){T[O]=a(W).text()});M[this.name]=T.join(",");break;case "password":case "text":case "textarea":case "button":z[this.name]=a(this).val()}if(l.p.autoencode)z[this.name]=a.jgrid.htmlEncode(z[this.name])}});return true}function g(F,I,T,O){var W,P,Z,ka=0,ba,la,da,ua=
262
- [],ca=false,ta="",ma;for(ma=1;ma<=O;ma++)ta+="<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>";if(F!="_empty")ca=a(I).jqGrid("getInd",F);a(I.p.colModel).each(function(wa){W=this.name;la=(P=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";if(W!=="cb"&&W!=="subgrid"&&this.editable===true&&W!=="rn"){if(ca===false)ba="";else if(W==I.p.ExpandColumn&&I.p.treeGrid===true)ba=a("td:eq("+wa+")",I.rows[ca]).text();else try{ba=a.unformat(a("td:eq("+
263
- wa+")",I.rows[ca]),{rowId:F,colModel:this},wa)}catch(Ga){ba=a("td:eq("+wa+")",I.rows[ca]).text()}var t=a.extend({},this.editoptions||{},{id:W,name:W}),u=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),w=parseInt(u.rowpos,10)||ka+1,C=parseInt((parseInt(u.colpos,10)||1)*2,10);if(F=="_empty"&&t.defaultValue)ba=a.isFunction(t.defaultValue)?t.defaultValue():t.defaultValue;if(!this.edittype)this.edittype="text";if(l.p.autoencode)ba=a.jgrid.htmlDecode(ba);da=a.jgrid.createEl(this.edittype,
264
- t,ba,false,a.extend({},a.jgrid.ajaxOptions,I.p.ajaxSelectOptions||{}));if(ba===""&&this.edittype=="checkbox")ba=a(da).attr("offval");if(ba===""&&this.edittype=="select")ba=a("option:eq(0)",da).text();if(b.checkOnSubmit||b.checkOnUpdate)b._savedData[W]=ba;a(da).addClass("FormElement");if(this.edittype=="text"||this.edittype=="textarea")a(da).addClass("ui-widget-content ui-corner-all");Z=a(T).find("tr[rowpos="+w+"]");if(u.rowabove){t=a("<tr><td class='contentinfo' colspan='"+O*2+"'>"+u.rowcontent+"</td></tr>");
265
- a(T).append(t);t[0].rp=w}if(Z.length===0){Z=a("<tr "+la+" rowpos='"+w+"'></tr>").addClass("FormData").attr("id","tr_"+W);a(Z).append(ta);a(T).append(Z);Z[0].rp=w}a("td:eq("+(C-2)+")",Z[0]).html(typeof u.label==="undefined"?I.p.colNames[wa]:u.label);a("td:eq("+(C-1)+")",Z[0]).append(u.elmprefix).append(da).append(u.elmsuffix);ua[ka]=wa;ka++}});if(ka>0){ma=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(O*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+
266
- I.p.id+"_id' value='"+F+"'/></td></tr>");ma[0].rp=ka+999;a(T).append(ma);if(b.checkOnSubmit||b.checkOnUpdate)b._savedData[I.p.id+"_id"]=F}return ua}function j(F,I,T){var O,W=0,P,Z,ka,ba,la;if(b.checkOnSubmit||b.checkOnUpdate){b._savedData={};b._savedData[I.p.id+"_id"]=F}var da=I.p.colModel;if(F=="_empty"){a(da).each(function(){O=this.name;ka=a.extend({},this.editoptions||{});if((Z=a("#"+a.jgrid.jqID(O),"#"+T))&&Z[0]!==null){ba="";if(ka.defaultValue){ba=a.isFunction(ka.defaultValue)?ka.defaultValue():
267
- ka.defaultValue;if(Z[0].type=="checkbox"){la=ba.toLowerCase();if(la.search(/(false|0|no|off|undefined)/i)<0&&la!==""){Z[0].checked=true;Z[0].defaultChecked=true;Z[0].value=ba}else Z.attr({checked:"",defaultChecked:""})}else Z.val(ba)}else if(Z[0].type=="checkbox"){Z[0].checked=false;Z[0].defaultChecked=false;ba=a(Z).attr("offval")}else if(Z[0].type&&Z[0].type.substr(0,6)=="select")Z[0].selectedIndex=0;else Z.val(ba);if(b.checkOnSubmit===true||b.checkOnUpdate)b._savedData[O]=ba}});a("#id_g","#"+T).val(F)}else{var ua=
268
- a(I).jqGrid("getInd",F,true);if(ua){a("td",ua).each(function(ca){O=da[ca].name;if(O!=="cb"&&O!=="subgrid"&&O!=="rn"&&da[ca].editable===true){if(O==I.p.ExpandColumn&&I.p.treeGrid===true)P=a(this).text();else try{P=a.unformat(a(this),{rowId:F,colModel:da[ca]},ca)}catch(ta){P=a(this).text()}if(l.p.autoencode)P=a.jgrid.htmlDecode(P);if(b.checkOnSubmit===true||b.checkOnUpdate)b._savedData[O]=P;O=a.jgrid.jqID(O);switch(da[ca].edittype){case "password":case "text":case "button":case "image":a("#"+O,"#"+
269
- T).val(P);break;case "textarea":if(P=="&nbsp;"||P=="&#160;"||P.length==1&&P.charCodeAt(0)==160)P="";a("#"+O,"#"+T).val(P);break;case "select":var ma=P.split(",");ma=a.map(ma,function(Ga){return a.trim(Ga)});a("#"+O+" option","#"+T).each(function(){this.selected=!da[ca].editoptions.multiple&&(ma[0]==a.trim(a(this).text())||ma[0]==a.trim(a(this).val()))?true:da[ca].editoptions.multiple?a.inArray(a.trim(a(this).text()),ma)>-1||a.inArray(a.trim(a(this).val()),ma)>-1?true:false:false});break;case "checkbox":P+=
270
- "";if(da[ca].editoptions&&da[ca].editoptions.value)if(da[ca].editoptions.value.split(":")[0]==P){a("#"+O,"#"+T).attr("checked",true);a("#"+O,"#"+T).attr("defaultChecked",true)}else{a("#"+O,"#"+T).attr("checked",false);a("#"+O,"#"+T).attr("defaultChecked","")}else{P=P.toLowerCase();if(P.search(/(false|0|no|off|undefined)/i)<0&&P!==""){a("#"+O,"#"+T).attr("checked",true);a("#"+O,"#"+T).attr("defaultChecked",true)}else{a("#"+O,"#"+T).attr("checked",false);a("#"+O,"#"+T).attr("defaultChecked","")}}break;
271
- case "custom":try{if(da[ca].editoptions&&a.isFunction(da[ca].editoptions.custom_value))da[ca].editoptions.custom_value(a("#"+O,"#"+T),"set",P);else throw"e1";}catch(wa){wa=="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,wa.message,jQuery.jgrid.edit.bClose)}}W++}});W>0&&a("#id_g","#"+p).val(F)}}}function h(){var F,I=[true,"",""],T={},O=l.p.prmNames,W,P,Z,ka;if(a.isFunction(b.beforeCheckValues)){var ba=
272
- b.beforeCheckValues(z,a("#"+s),z[l.p.id+"_id"]=="_empty"?O.addoper:O.editoper);if(ba&&typeof ba==="object")z=ba}for(Z in z)if(z.hasOwnProperty(Z)){I=a.jgrid.checkValues(z[Z],Z,l);if(I[0]===false)break}if(I[0]){if(a.isFunction(b.onclickSubmit))T=b.onclickSubmit(b,z)||{};if(a.isFunction(b.beforeSubmit))I=b.beforeSubmit(z,a("#"+s))}if(I[0]&&!b.processing){b.processing=true;a("#sData","#"+p+"_2").addClass("ui-state-active");P=O.oper;W=O.id;z[P]=a.trim(z[l.p.id+"_id"])=="_empty"?O.addoper:O.editoper;if(z[P]!=
273
- O.addoper)z[W]=z[l.p.id+"_id"];else if(z[W]===undefined)z[W]=z[l.p.id+"_id"];delete z[l.p.id+"_id"];z=a.extend(z,b.editData,T);if(l.p.treeGrid===true){if(z[P]==O.addoper){ka=a(l).jqGrid("getGridParam","selrow");z[l.p.treeGridModel=="adjacency"?l.p.treeReader.parent_id_field:"parent_id"]=ka}for(i in l.p.treeReader){T=l.p.treeReader[i];if(z.hasOwnProperty(T))z[P]==O.addoper&&i==="parent_id_field"||delete z[T]}}if(l.p.restful){b.mtype=z.id=="_empty"?"POST":"PUT";b.url=z.id=="_empty"?l.p.url:l.p.url+
274
- "/"+z.id}T=a.extend({url:b.url?b.url:a(l).jqGrid("getGridParam","editurl"),type:b.mtype,data:a.isFunction(b.serializeEditData)?b.serializeEditData(z):z,complete:function(la,da){if(da!="success"){I[0]=false;I[1]=a.isFunction(b.errorTextFormat)?b.errorTextFormat(la):da+" Status: '"+la.statusText+"'. Error code: "+la.status}else if(a.isFunction(b.afterSubmit))I=b.afterSubmit(la,z);if(I[0]===false){a("#FormError>td","#"+p).html(I[1]);a("#FormError","#"+p).show()}else{a.each(l.p.colModel,function(){if(M[this.name]&&
275
- this.formatter&&this.formatter=="select")try{delete M[this.name]}catch(ta){}});z=a.extend(z,M);l.p.autoencode&&a.each(z,function(ta,ma){z[ta]=a.jgrid.htmlDecode(ma)});b.reloadAfterSubmit=b.reloadAfterSubmit&&l.p.datatype!="local";if(z[P]==O.addoper){I[2]||(I[2]=parseInt(l.p.records,10)+1+"");z[W]=I[2];if(b.closeAfterAdd){if(b.reloadAfterSubmit)a(l).trigger("reloadGrid");else if(l.p.treeGrid===true)a(l).jqGrid("addChildNode",I[2],ka,z);else{a(l).jqGrid("addRowData",I[2],z,c.addedrow);a(l).jqGrid("setSelection",
276
- I[2])}a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose})}else if(b.clearAfterAdd){if(b.reloadAfterSubmit)a(l).trigger("reloadGrid");else l.p.treeGrid===true?a(l).jqGrid("addChildNode",I[2],ka,z):a(l).jqGrid("addRowData",I[2],z,c.addedrow);j("_empty",l,s)}else if(b.reloadAfterSubmit)a(l).trigger("reloadGrid");else l.p.treeGrid===true?a(l).jqGrid("addChildNode",I[2],ka,z):a(l).jqGrid("addRowData",I[2],z,c.addedrow)}else{if(b.reloadAfterSubmit){a(l).trigger("reloadGrid");
277
- b.closeAfterEdit||setTimeout(function(){a(l).jqGrid("setSelection",z[W])},1E3)}else l.p.treeGrid===true?a(l).jqGrid("setTreeRow",z[W],z):a(l).jqGrid("setRowData",z[W],z);b.closeAfterEdit&&a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose})}if(a.isFunction(b.afterComplete)){F=la;setTimeout(function(){b.afterComplete(F,z,a("#"+s));F=null},500)}if(b.checkOnSubmit||b.checkOnUpdate){a("#"+s).data("disabled",false);if(b._savedData[l.p.id+"_id"]!="_empty")for(var ua in b._savedData)if(z[ua])b._savedData[ua]=
278
- z[ua]}}b.processing=false;a("#sData","#"+p+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+s)[0].focus()}catch(ca){}}},a.jgrid.ajaxOptions,b.ajaxEditOptions);if(!T.url&&!b.useDataProxy)if(a.isFunction(l.p.dataProxy))b.useDataProxy=true;else{I[0]=false;I[1]+=" "+a.jgrid.errors.nourl}if(I[0])b.useDataProxy?l.p.dataProxy.call(l,T,"set_"+l.p.id):a.ajax(T)}if(I[0]===false){a("#FormError>td","#"+p).html(I[1]);a("#FormError","#"+p).show()}}function d(F,I){var T=false,O;for(O in F)if(F[O]!=
279
- I[O]){T=true;break}return T}function n(){var F=true;a("#FormError","#"+p).hide();if(b.checkOnUpdate){z={};M={};f();R=a.extend({},z,M);if(U=d(R,b._savedData)){a("#"+s).data("disabled",true);a(".confirm","#"+r.themodal).show();F=false}}return F}function k(){if(e!=="_empty"&&typeof l.p.savedRow!=="undefined"&&l.p.savedRow.length>0&&a.isFunction(a.fn.jqGrid.restoreRow))for(var F=0;F<l.p.savedRow.length;F++)if(l.p.savedRow[F].id==e){a(l).jqGrid("restoreRow",e);break}}function o(F,I){F===0?a("#pData","#"+
280
- p+"_2").addClass("ui-state-disabled"):a("#pData","#"+p+"_2").removeClass("ui-state-disabled");F==I?a("#nData","#"+p+"_2").addClass("ui-state-disabled"):a("#nData","#"+p+"_2").removeClass("ui-state-disabled")}function m(){var F=a(l).jqGrid("getDataIDs"),I=a("#id_g","#"+p).val();return[a.inArray(I,F),F]}var l=this;if(l.grid&&e){var q=l.p.id,s="FrmGrid_"+q,p="TblGrid_"+q,r={themodal:"editmod"+q,modalhead:"edithd"+q,modalcontent:"editcnt"+q,scrollelm:s},v=a.isFunction(b.beforeShowForm)?b.beforeShowForm:
281
- false,y=a.isFunction(b.afterShowForm)?b.afterShowForm:false,D=a.isFunction(b.beforeInitData)?b.beforeInitData:false,G=a.isFunction(b.onInitializeForm)?b.onInitializeForm:false,x=true,B=1,A=0,z,M,R,U;if(e==="new"){e="_empty";c.caption=b.addCaption}else c.caption=b.editCaption;c.recreateForm===true&&a("#"+r.themodal).html()!==null&&a("#"+r.themodal).remove();var ja=true;if(c.checkOnUpdate&&c.jqModal&&!c.modal)ja=false;if(a("#"+r.themodal).html()!==null){if(D){x=D(a("#"+s));if(typeof x=="undefined")x=
282
- true}if(x===false)return;k();a(".ui-jqdialog-title","#"+r.modalhead).html(c.caption);a("#FormError","#"+p).hide();if(b.topinfo){a(".topinfo","#"+p+"_2").html(b.topinfo);a(".tinfo","#"+p+"_2").show()}else a(".tinfo","#"+p+"_2").hide();if(b.bottominfo){a(".bottominfo","#"+p+"_2").html(b.bottominfo);a(".binfo","#"+p+"_2").show()}else a(".binfo","#"+p+"_2").hide();j(e,l,s);e=="_empty"||!b.viewPagerButtons?a("#pData, #nData","#"+p+"_2").hide():a("#pData, #nData","#"+p+"_2").show();if(b.processing===true){b.processing=
283
- false;a("#sData","#"+p+"_2").removeClass("ui-state-active")}if(a("#"+s).data("disabled")===true){a(".confirm","#"+r.themodal).hide();a("#"+s).data("disabled",false)}v&&v(a("#"+s));a("#"+r.themodal).data("onClose",b.onClose);a.jgrid.viewModal("#"+r.themodal,{gbox:"#gbox_"+q,jqm:c.jqModal,jqM:false,overlay:c.overlay,modal:c.modal});ja||a(".jqmOverlay").click(function(){if(!n())return false;a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false});y&&y(a("#"+s))}else{var $=
284
- isNaN(c.dataheight)?c.dataheight:c.dataheight+"px";$=a("<form name='FormPost' id='"+s+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+$+";'></form>").data("disabled",false);var ia=a("<table id='"+p+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");if(D){x=D(a("#"+s));if(typeof x=="undefined")x=true}if(x===false)return;k();a(l.p.colModel).each(function(){var F=this.formoptions;B=Math.max(B,F?F.colpos||0:
285
- 0);A=Math.max(A,F?F.rowpos||0:0)});a($).append(ia);D=a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+B*2+"'></td></tr>");D[0].rp=0;a(ia).append(D);D=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+B*2+"'>"+b.topinfo+"</td></tr>");D[0].rp=0;a(ia).append(D);x=(D=l.p.direction=="rtl"?true:false)?"nData":"pData";var sa=D?"pData":"nData";g(e,l,ia,B);x="<a href='javascript:void(0)' id='"+x+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>";
286
- sa="<a href='javascript:void(0)' id='"+sa+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>";var ya="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+c.bSubmit+"</a>",Ca="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+c.bCancel+"</a>";x="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+p+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+
287
- (D?sa+x:x+sa)+"</td><td class='EditButton'>"+ya+Ca+"</td></tr>";x+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+b.bottominfo+"</td></tr>";x+="</tbody></table>";if(A>0){var oa=[];a.each(a(ia)[0].rows,function(F,I){oa[F]=I});oa.sort(function(F,I){if(F.rp>I.rp)return 1;if(F.rp<I.rp)return-1;return 0});a.each(oa,function(F,I){a("tbody",ia).append(I)})}c.gbox="#gbox_"+q;var Da=false;if(c.closeOnEscape===true){c.closeOnEscape=false;Da=true}$=a("<span></span>").append($).append(x);
288
- a.jgrid.createModal(r,$,c,"#gview_"+l.p.id,a("#gbox_"+l.p.id)[0]);if(D){a("#pData, #nData","#"+p+"_2").css("float","right");a(".EditButton","#"+p+"_2").css("text-align","left")}b.topinfo&&a(".tinfo","#"+p+"_2").show();b.bottominfo&&a(".binfo","#"+p+"_2").show();x=$=null;a("#"+r.themodal).keydown(function(F){var I=F.target;if(a("#"+s).data("disabled")===true)return false;if(b.savekey[0]===true&&F.which==b.savekey[1])if(I.tagName!="TEXTAREA"){a("#sData","#"+p+"_2").trigger("click");return false}if(F.which===
289
- 27){if(!n())return false;Da&&a.jgrid.hideModal(this,{gb:c.gbox,jqm:c.jqModal,onClose:b.onClose});return false}if(b.navkeys[0]===true){if(a("#id_g","#"+p).val()=="_empty")return true;if(F.which==b.navkeys[1]){a("#pData","#"+p+"_2").trigger("click");return false}if(F.which==b.navkeys[2]){a("#nData","#"+p+"_2").trigger("click");return false}}});if(c.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+r.themodal).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+r.themodal).unbind("click").click(function(){if(!n())return false;
290
- a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false})}c.saveicon=a.extend([true,"left","ui-icon-disk"],c.saveicon);c.closeicon=a.extend([true,"left","ui-icon-close"],c.closeicon);if(c.saveicon[0]===true)a("#sData","#"+p+"_2").addClass(c.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.saveicon[2]+"'></span>");if(c.closeicon[0]===true)a("#cData","#"+p+"_2").addClass(c.closeicon[1]=="right"?"fm-button-icon-right":
291
- "fm-button-icon-left").append("<span class='ui-icon "+c.closeicon[2]+"'></span>");if(b.checkOnSubmit||b.checkOnUpdate){ya="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+c.bYes+"</a>";sa="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+c.bNo+"</a>";Ca="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+c.bExit+"</a>";
292
- $=c.zIndex||999;$++;a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+$+";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:"+($+1)+"'>"+c.saveData+"<br/><br/>"+ya+sa+Ca+"</div>").insertAfter("#"+s);a("#sNew","#"+r.themodal).click(function(){h();a("#"+s).data("disabled",
293
- false);a(".confirm","#"+r.themodal).hide();return false});a("#nNew","#"+r.themodal).click(function(){a(".confirm","#"+r.themodal).hide();a("#"+s).data("disabled",false);setTimeout(function(){a(":input","#"+s)[0].focus()},0);return false});a("#cNew","#"+r.themodal).click(function(){a(".confirm","#"+r.themodal).hide();a("#"+s).data("disabled",false);a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false})}G&&G(a("#"+s));e=="_empty"||!b.viewPagerButtons?a("#pData,#nData",
294
- "#"+p+"_2").hide():a("#pData,#nData","#"+p+"_2").show();v&&v(a("#"+s));a("#"+r.themodal).data("onClose",b.onClose);a.jgrid.viewModal("#"+r.themodal,{gbox:"#gbox_"+q,jqm:c.jqModal,overlay:c.overlay,modal:c.modal});ja||a(".jqmOverlay").click(function(){if(!n())return false;a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false});y&&y(a("#"+s));a(".fm-button","#"+r.themodal).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
295
- a("#sData","#"+p+"_2").click(function(){z={};M={};a("#FormError","#"+p).hide();f();if(z[l.p.id+"_id"]=="_empty")h();else if(c.checkOnSubmit===true){R=a.extend({},z,M);if(U=d(R,b._savedData)){a("#"+s).data("disabled",true);a(".confirm","#"+r.themodal).show()}else h()}else h();return false});a("#cData","#"+p+"_2").click(function(){if(!n())return false;a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false});a("#nData","#"+p+"_2").click(function(){if(!n())return false;
296
- a("#FormError","#"+p).hide();var F=m();F[0]=parseInt(F[0],10);if(F[0]!=-1&&F[1][F[0]+1]){a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons("next",a("#"+s),F[1][F[0]]);j(F[1][F[0]+1],l,s);a(l).jqGrid("setSelection",F[1][F[0]+1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("next",a("#"+s),F[1][F[0]+1]);o(F[0]+1,F[1].length-1)}return false});a("#pData","#"+p+"_2").click(function(){if(!n())return false;a("#FormError","#"+p).hide();var F=m();if(F[0]!=-1&&F[1][F[0]-1]){a.isFunction(c.onclickPgButtons)&&
297
- c.onclickPgButtons("prev",a("#"+s),F[1][F[0]]);j(F[1][F[0]-1],l,s);a(l).jqGrid("setSelection",F[1][F[0]-1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("prev",a("#"+s),F[1][F[0]-1]);o(F[0]-1,F[1].length-1)}return false})}v=m();o(v[0],v[1].length-1)}})},viewGridRow:function(e,c){c=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,
298
- beforeShowForm:null,beforeInitData:null,viewPagerButtons:true},a.jgrid.view,c||{});return this.each(function(){function f(){if(c.closeOnEscape===true||c.navkeys[0]===true)setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+l.modalhead).focus()},0)}function g(A,z,M,R){for(var U,ja,$,ia=0,sa,ya,Ca=[],oa=false,Da="<td class='CaptionTD form-view-label ui-widget-content' width='"+c.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",F="",I=["integer",
299
- "number","currency"],T=0,O=0,W,P,Z,ka=1;ka<=R;ka++)F+=ka==1?Da:"<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";a(z.p.colModel).each(function(){ja=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false;if(!ja&&this.align==="right")if(this.formatter&&a.inArray(this.formatter,I)!==-1)T=Math.max(T,parseInt(this.width,10));else O=Math.max(O,parseInt(this.width,10))});W=T!==0?T:O!==0?O:0;oa=
300
- a(z).jqGrid("getInd",A);a(z.p.colModel).each(function(ba){U=this.name;P=false;ya=(ja=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";Z=typeof this.viewable!="boolean"?true:this.viewable;if(U!=="cb"&&U!=="subgrid"&&U!=="rn"&&Z){sa=oa===false?"":U==z.p.ExpandColumn&&z.p.treeGrid===true?a("td:eq("+ba+")",z.rows[oa]).text():a("td:eq("+ba+")",z.rows[oa]).html();P=this.align==="right"&&W!==0?true:false;a.extend({},this.editoptions||{},{id:U,
301
- name:U});var la=a.extend({},{rowabove:false,rowcontent:""},this.formoptions||{}),da=parseInt(la.rowpos,10)||ia+1,ua=parseInt((parseInt(la.colpos,10)||1)*2,10);if(la.rowabove){var ca=a("<tr><td class='contentinfo' colspan='"+R*2+"'>"+la.rowcontent+"</td></tr>");a(M).append(ca);ca[0].rp=da}$=a(M).find("tr[rowpos="+da+"]");if($.length===0){$=a("<tr "+ya+" rowpos='"+da+"'></tr>").addClass("FormData").attr("id","trv_"+U);a($).append(F);a(M).append($);$[0].rp=da}a("td:eq("+(ua-2)+")",$[0]).html("<b>"+(typeof la.label===
302
- "undefined"?z.p.colNames[ba]:la.label)+"</b>");a("td:eq("+(ua-1)+")",$[0]).append("<span>"+sa+"</span>").attr("id","v_"+U);P&&a("td:eq("+(ua-1)+") span",$[0]).css({"text-align":"right",width:W+"px"});Ca[ia]=ba;ia++}});if(ia>0){A=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='"+A+"'/></td></tr>");A[0].rp=ia+99;a(M).append(A)}return Ca}function j(A,z){var M,R,U=0,ja,$;
303
- if($=a(z).jqGrid("getInd",A,true)){a("td",$).each(function(ia){M=z.p.colModel[ia].name;R=z.p.colModel[ia].editrules&&z.p.colModel[ia].editrules.edithidden===true?false:z.p.colModel[ia].hidden===true?true:false;if(M!=="cb"&&M!=="subgrid"&&M!=="rn"){ja=M==z.p.ExpandColumn&&z.p.treeGrid===true?a(this).text():a(this).html();a.extend({},z.p.colModel[ia].editoptions||{});M=a.jgrid.jqID("v_"+M);a("#"+M+" span","#"+m).html(ja);R&&a("#"+M,"#"+m).parents("tr:first").hide();U++}});U>0&&a("#id_g","#"+m).val(A)}}
304
- function h(A,z){A===0?a("#pData","#"+m+"_2").addClass("ui-state-disabled"):a("#pData","#"+m+"_2").removeClass("ui-state-disabled");A==z?a("#nData","#"+m+"_2").addClass("ui-state-disabled"):a("#nData","#"+m+"_2").removeClass("ui-state-disabled")}function d(){var A=a(n).jqGrid("getDataIDs"),z=a("#id_g","#"+m).val();return[a.inArray(z,A),A]}var n=this;if(n.grid&&e){if(!c.imgpath)c.imgpath=n.p.imgpath;var k=n.p.id,o="ViewGrid_"+k,m="ViewTbl_"+k,l={themodal:"viewmod"+k,modalhead:"viewhd"+k,modalcontent:"viewcnt"+
305
- k,scrollelm:o},q=a.isFunction(c.beforeInitData)?c.beforeInitData:false,s=true,p=1,r=0;if(a("#"+l.themodal).html()!==null){if(q){s=q(a("#"+o));if(typeof s=="undefined")s=true}if(s===false)return;a(".ui-jqdialog-title","#"+l.modalhead).html(c.caption);a("#FormError","#"+m).hide();j(e,n);a.isFunction(c.beforeShowForm)&&c.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+l.themodal,{gbox:"#gbox_"+k,jqm:c.jqModal,jqM:false,overlay:c.overlay,modal:c.modal});f()}else{var v=isNaN(c.dataheight)?c.dataheight:
306
- c.dataheight+"px";v=a("<form name='FormPost' id='"+o+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+v+";'></form>");var y=a("<table id='"+m+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");if(q){s=q(a("#"+o));if(typeof s=="undefined")s=true}if(s===false)return;a(n.p.colModel).each(function(){var A=this.formoptions;p=Math.max(p,A?A.colpos||0:0);r=Math.max(r,A?A.rowpos||0:0)});a(v).append(y);g(e,n,y,
307
- p);q=n.p.direction=="rtl"?true:false;s="<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>";var D="<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>",G="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+c.bClose+"</a>";if(r>0){var x=[];
308
- a.each(a(y)[0].rows,function(A,z){x[A]=z});x.sort(function(A,z){if(A.rp>z.rp)return 1;if(A.rp<z.rp)return-1;return 0});a.each(x,function(A,z){a("tbody",y).append(z)})}c.gbox="#gbox_"+k;var B=false;if(c.closeOnEscape===true){c.closeOnEscape=false;B=true}v=a("<span></span>").append(v).append("<table border='0' class='EditTable' id='"+m+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+c.labelswidth+"'>"+(q?D+s:s+D)+"</td><td class='EditButton'>"+G+"</td></tr></tbody></table>");a.jgrid.createModal(l,
309
- v,c,"#gview_"+n.p.id,a("#gview_"+n.p.id)[0]);if(q){a("#pData, #nData","#"+m+"_2").css("float","right");a(".EditButton","#"+m+"_2").css("text-align","left")}c.viewPagerButtons||a("#pData, #nData","#"+m+"_2").hide();v=null;a("#"+l.themodal).keydown(function(A){if(A.which===27){B&&a.jgrid.hideModal(this,{gb:c.gbox,jqm:c.jqModal,onClose:c.onClose});return false}if(c.navkeys[0]===true){if(A.which===c.navkeys[1]){a("#pData","#"+m+"_2").trigger("click");return false}if(A.which===c.navkeys[2]){a("#nData",
310
- "#"+m+"_2").trigger("click");return false}}});c.closeicon=a.extend([true,"left","ui-icon-close"],c.closeicon);if(c.closeicon[0]===true)a("#cData","#"+m+"_2").addClass(c.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.closeicon[2]+"'></span>");a.isFunction(c.beforeShowForm)&&c.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+l.themodal,{gbox:"#gbox_"+k,jqm:c.jqModal,modal:c.modal});a(".fm-button:not(.ui-state-disabled)","#"+m+"_2").hover(function(){a(this).addClass("ui-state-hover")},
311
- function(){a(this).removeClass("ui-state-hover")});f();a("#cData","#"+m+"_2").click(function(){a.jgrid.hideModal("#"+l.themodal,{gb:"#gbox_"+k,jqm:c.jqModal,onClose:c.onClose});return false});a("#nData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var A=d();A[0]=parseInt(A[0],10);if(A[0]!=-1&&A[1][A[0]+1]){a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons("next",a("#"+o),A[1][A[0]]);j(A[1][A[0]+1],n);a(n).jqGrid("setSelection",A[1][A[0]+1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("next",
312
- a("#"+o),A[1][A[0]+1]);h(A[0]+1,A[1].length-1)}f();return false});a("#pData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var A=d();if(A[0]!=-1&&A[1][A[0]-1]){a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons("prev",a("#"+o),A[1][A[0]]);j(A[1][A[0]-1],n);a(n).jqGrid("setSelection",A[1][A[0]-1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("prev",a("#"+o),A[1][A[0]-1]);h(A[0]-1,A[1].length-1)}f();return false})}v=d();h(v[0],v[1].length-1)}})},delGridRow:function(e,c){b=
313
- c=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,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,c||{});return this.each(function(){var f=this;if(f.grid)if(e){var g=
314
- typeof c.beforeShowForm==="function"?true:false,j=typeof c.afterShowForm==="function"?true:false,h=a.isFunction(c.beforeInitData)?c.beforeInitData:false,d=f.p.id,n={},k=true,o="DelTbl_"+d,m,l,q,s,p={themodal:"delmod"+d,modalhead:"delhd"+d,modalcontent:"delcnt"+d,scrollelm:o};if(jQuery.isArray(e))e=e.join();if(a("#"+p.themodal).html()!==null){if(h){k=h(a("#"+o));if(typeof k=="undefined")k=true}if(k===false)return;a("#DelData>td","#"+o).text(e);a("#DelError","#"+o).hide();if(b.processing===true){b.processing=
315
- false;a("#dData","#"+o).removeClass("ui-state-active")}g&&c.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+p.themodal,{gbox:"#gbox_"+d,jqm:c.jqModal,jqM:false,overlay:c.overlay,modal:c.modal})}else{var r=isNaN(c.dataheight)?c.dataheight:c.dataheight+"px";r="<div id='"+o+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+r+";'>";r+="<table class='DelTable'><tbody>";r+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";r+="<tr id='DelData' style='display:none'><td >"+
316
- e+"</td></tr>";r+='<tr><td class="delmsg" style="white-space:pre;">'+c.msg+"</td></tr><tr><td >&#160;</td></tr>";r+="</tbody></table></div>";r+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+o+"_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'>"+c.bSubmit+"</a>")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+
317
- c.bCancel+"</a>")+"</td></tr></tbody></table>";c.gbox="#gbox_"+d;a.jgrid.createModal(p,r,c,"#gview_"+f.p.id,a("#gview_"+f.p.id)[0]);if(h){k=h(a("#"+o));if(typeof k=="undefined")k=true}if(k===false)return;a(".fm-button","#"+o+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});c.delicon=a.extend([true,"left","ui-icon-scissors"],c.delicon);c.cancelicon=a.extend([true,"left","ui-icon-cancel"],c.cancelicon);if(c.delicon[0]===true)a("#dData","#"+
318
- o+"_2").addClass(c.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.delicon[2]+"'></span>");if(c.cancelicon[0]===true)a("#eData","#"+o+"_2").addClass(c.cancelicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.cancelicon[2]+"'></span>");a("#dData","#"+o+"_2").click(function(){var v=[true,""];n={};var y=a("#DelData>td","#"+o).text();if(typeof c.onclickSubmit==="function")n=c.onclickSubmit(b,y)||{};if(typeof c.beforeSubmit===
319
- "function")v=c.beforeSubmit(y);if(v[0]&&!b.processing){b.processing=true;a(this).addClass("ui-state-active");q=f.p.prmNames;m=a.extend({},b.delData,n);s=q.oper;m[s]=q.deloper;l=q.id;m[l]=y;if(f.p.restful){c.mtype="DELETE";b.url=f.p.url+"/"+y}var D=a.extend({url:b.url?b.url:a(f).jqGrid("getGridParam","editurl"),type:c.mtype,data:a.isFunction(c.serializeDelData)?c.serializeDelData(m):m,complete:function(G,x){if(x!="success"){v[0]=false;v[1]=a.isFunction(b.errorTextFormat)?b.errorTextFormat(G):x+" Status: '"+
320
- G.statusText+"'. Error code: "+G.status}else if(typeof b.afterSubmit==="function")v=b.afterSubmit(G,m);if(v[0]===false){a("#DelError>td","#"+o).html(v[1]);a("#DelError","#"+o).show()}else{if(b.reloadAfterSubmit&&f.p.datatype!="local")a(f).trigger("reloadGrid");else{var B=[];B=y.split(",");if(f.p.treeGrid===true)try{a(f).jqGrid("delTreeNode",B[0])}catch(A){}else for(var z=0;z<B.length;z++)a(f).jqGrid("delRowData",B[z]);f.p.selrow=null;f.p.selarrrow=[]}a.isFunction(b.afterComplete)&&setTimeout(function(){b.afterComplete(G,
321
- y)},500)}b.processing=false;a("#dData","#"+o+"_2").removeClass("ui-state-active");v[0]&&a.jgrid.hideModal("#"+p.themodal,{gb:"#gbox_"+d,jqm:c.jqModal,onClose:b.onClose})}},a.jgrid.ajaxOptions,c.ajaxDelOptions);if(!D.url&&!b.useDataProxy)if(a.isFunction(f.p.dataProxy))b.useDataProxy=true;else{v[0]=false;v[1]+=" "+a.jgrid.errors.nourl}if(v[0])b.useDataProxy?f.p.dataProxy.call(f,D,"del_"+f.p.id):a.ajax(D)}if(v[0]===false){a("#DelError>td","#"+o).html(v[1]);a("#DelError","#"+o).show()}return false});
322
- a("#eData","#"+o+"_2").click(function(){a.jgrid.hideModal("#"+p.themodal,{gb:"#gbox_"+d,jqm:c.jqModal,onClose:b.onClose});return false});g&&c.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+p.themodal,{gbox:"#gbox_"+d,jqm:c.jqModal,overlay:c.overlay,modal:c.modal})}j&&c.afterShowForm(a("#"+o));c.closeOnEscape===true&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+p.modalhead).focus()},0)}})},navGrid:function(e,c,f,g,j,h,d){c=a.extend({edit:true,editicon:"ui-icon-pencil",add:true,addicon:"ui-icon-plus",
323
- 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,c||{});return this.each(function(){if(!this.nav){var n={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},k=this,o,m,l;if(!(!k.grid||typeof e!="string")){if(a("#"+n.themodal).html()===null){if(typeof window.innerWidth!=
324
- "undefined"){o=window.innerWidth;m=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==0){o=document.documentElement.clientWidth;m=document.documentElement.clientHeight}else{o=1024;m=768}a.jgrid.createModal(n,"<div>"+c.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+k.p.id,jqModal:true,drag:true,resize:true,caption:c.alertcap,top:m/
325
- 2-25,left:o/2-100,width:200,height:"auto",closeOnEscape:c.closeOnEscape},"","",true)}o=1;if(c.cloneToTop&&k.p.toppager)o=2;for(m=0;m<o;m++){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>"),s,p;if(m===0){s=e;p=k.p.id;if(s==k.p.toppager){p+="_top";o=1}}else{s=k.p.toppager;p=k.p.id+"_top"}k.p.direction=="rtl"&&a(q).attr("dir","rtl").css("float","right");if(c.add){g=g||{};l=a("<td class='ui-pg-button ui-corner-all'></td>");
326
- a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.addicon+"'></span>"+c.addtext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.addtitle||"",id:g.id||"add_"+p}).click(function(){a(this).hasClass("ui-state-disabled")||(typeof c.addfunc=="function"?c.addfunc():a(k).jqGrid("editGridRow","new",g));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(c.edit){l=a("<td class='ui-pg-button ui-corner-all'></td>");
327
- f=f||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.editicon+"'></span>"+c.edittext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.edittitle||"",id:f.id||"edit_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var r=k.p.selrow;if(r)typeof c.editfunc=="function"?c.editfunc(r):a(k).jqGrid("editGridRow",r,f);else{a.jgrid.viewModal("#"+n.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
328
- a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(c.view){l=a("<td class='ui-pg-button ui-corner-all'></td>");d=d||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.viewicon+"'></span>"+c.viewtext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.viewtitle||"",id:d.id||"view_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var r=k.p.selrow;if(r)a(k).jqGrid("viewGridRow",r,d);else{a.jgrid.viewModal("#"+n.themodal,{gbox:"#gbox_"+
329
- k.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(c.del){l=a("<td class='ui-pg-button ui-corner-all'></td>");j=j||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.delicon+"'></span>"+c.deltext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.deltitle||"",id:j.id||"del_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var r;
330
- if(k.p.multiselect){r=k.p.selarrrow;if(r.length===0)r=null}else r=k.p.selrow;if(r)"function"==typeof c.delfunc?c.delfunc(r):a(k).jqGrid("delGridRow",r,j);else{a.jgrid.viewModal("#"+n.themodal,{gbox:"#gbox_"+k.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(c.add||c.edit||c.del||c.view)a("tr",q).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");
331
- if(c.search){l=a("<td class='ui-pg-button ui-corner-all'></td>");h=h||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.searchicon+"'></span>"+c.searchtext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.searchtitle||"",id:h.id||"search_"+p}).click(function(){a(this).hasClass("ui-state-disabled")||a(k).jqGrid("searchGrid",h);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
332
- l=null}if(c.refresh){l=a("<td class='ui-pg-button ui-corner-all'></td>");a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.refreshicon+"'></span>"+c.refreshtext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.refreshtitle||"",id:"refresh_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){a.isFunction(c.beforeRefresh)&&c.beforeRefresh();k.p.search=false;try{var r=k.p.id;k.p.postData.filters="";a("#fbox_"+r).jqFilter("resetFilter");a.isFunction(k.clearToolbar)&&k.clearToolbar(false)}catch(v){}switch(c.refreshstate){case "firstpage":a(k).trigger("reloadGrid",
333
- [{page:1}]);break;case "current":a(k).trigger("reloadGrid",[{current:true}])}a.isFunction(c.afterRefresh)&&c.afterRefresh()}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}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(q).clone().appendTo("#testpg2").width();
334
- a("#testpg2").remove();a(s+"_"+c.position,s).append(q);if(k.p._nvtd){if(l>k.p._nvtd[0]){a(s+"_"+c.position,s).width(l);k.p._nvtd[0]=l}k.p._nvtd[1]=l}q=l=l=null;this.nav=true}}}})},navButtonAdd:function(e,c){c=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},c||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0],g=this;if(f)if(!(c.id&&a("#"+c.id,f).html()!==null)){var j=a("<td></td>");
335
- c.buttonicon.toString().toUpperCase()=="NONE"?a(j).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+c.caption+"</div>"):a(j).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+c.buttonicon+"'></span>"+c.caption+"</div>");c.id&&a(j).attr("id",c.id);if(c.position=="first")f.rows[0].cells.length===0?a("tr",f).append(j):a("tr td:eq(0)",f).before(j);else a("tr",f).append(j);a(j,f).attr("title",c.title||"").click(function(h){a(this).hasClass("ui-state-disabled")||
336
- a.isFunction(c.onClickButton)&&c.onClickButton.call(g,h);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(e,c){c=a.extend({sepclass:"ui-separator",sepcontent:""},c||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0];if(f){var g="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+c.sepclass+
337
- "'></span>"+c.sepcontent+"</td>";a("tr",f).append(g)}}})},GridToForm:function(e,c){return this.each(function(){if(this.grid){var f=a(this).jqGrid("getRowData",e);if(f)for(var g in f)a("[name="+a.jgrid.jqID(g)+"]",c).is("input:radio")||a("[name="+a.jgrid.jqID(g)+"]",c).is("input:checkbox")?a("[name="+a.jgrid.jqID(g)+"]",c).each(function(){a(this).val()==f[g]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+a.jgrid.jqID(g)+"]",c).val(f[g])}})},FormToGrid:function(e,c,f,g){return this.each(function(){if(this.grid){f||
338
- (f="set");g||(g="first");var j=a(c).serializeArray(),h={};a.each(j,function(d,n){h[n.name]=n.value});if(f=="add")a(this).jqGrid("addRowData",e,h,g);else f=="set"&&a(this).jqGrid("setRowData",e,h)}})}})})(jQuery);
339
- (function(a){a.jgrid.extend({editRow:function(b,e,c,f,g,j,h,d,n){var k={keys:e||false,oneditfunc:c||null,successfunc:f||null,url:g||null,extraparam:j||{},aftersavefunc:h||null,errorfunc:d||null,afterrestorefunc:n||null,restoreAfterErorr:true},o=a.makeArray(arguments).slice(1),m;m=o[0]&&typeof o[0]=="object"&&!a.isFunction(o[0])?a.extend(k,o[0]):k;return this.each(function(){var l=this,q,s,p=0,r=null,v={},y,D;if(l.grid){y=a(l).jqGrid("getInd",b,true);if(y!==false)if((a(y).attr("editable")||"0")=="0"&&
340
- !a(y).hasClass("not-editable-row")){D=l.p.colModel;a("td",y).each(function(G){q=D[G].name;var x=l.p.treeGrid===true&&q==l.p.ExpandColumn;if(x)s=a("span:first",this).html();else try{s=a.unformat(this,{rowId:b,colModel:D[G]},G)}catch(B){s=a(this).html()}if(q!="cb"&&q!="subgrid"&&q!="rn"){if(l.p.autoencode)s=a.jgrid.htmlDecode(s);v[q]=s;if(D[G].editable===true){if(r===null)r=G;x?a("span:first",this).html(""):a(this).html("");var A=a.extend({},D[G].editoptions||{},{id:b+"_"+q,name:q});if(!D[G].edittype)D[G].edittype=
341
- "text";A=a.jgrid.createEl(D[G].edittype,A,s,true,a.extend({},a.jgrid.ajaxOptions,l.p.ajaxSelectOptions||{}));a(A).addClass("editable");x?a("span:first",this).append(A):a(this).append(A);D[G].edittype=="select"&&D[G].editoptions.multiple===true&&a.browser.msie&&a(A).width(a(A).width());p++}}});if(p>0){v.id=b;l.p.savedRow.push(v);a(y).attr("editable","1");a("td:eq("+r+") input",y).focus();m.keys===true&&a(y).bind("keydown",function(G){G.keyCode===27&&a(l).jqGrid("restoreRow",b,n);if(G.keyCode===13){if(G.target.tagName==
342
- "TEXTAREA")return true;a(l).jqGrid("saveRow",b,m);return false}G.stopPropagation()});a.isFunction(m.oneditfunc)&&m.oneditfunc.call(l,b)}}}})},saveRow:function(b,e,c,f,g,j,h){var d={successfunc:e||null,url:c||null,extraparam:f||{},aftersavefunc:g||null,errorfunc:j||null,afterrestorefunc:h||null,restoreAfterErorr:true},n=a.makeArray(arguments).slice(1),k;k=n[0]&&typeof n[0]=="object"&&!a.isFunction(n[0])?a.extend(d,n[0]):d;var o=false,m=this[0],l,q={},s={},p,r,v;if(!m.grid)return o;v=a(m).jqGrid("getInd",
343
- b,true);if(v===false)return o;d=a(v).attr("editable");k.url=k.url?k.url:m.p.editurl;if(d==="1"){var y;a("td",v).each(function(x){y=m.p.colModel[x];l=y.name;if(l!="cb"&&l!="subgrid"&&y.editable===true&&l!="rn"&&!a(this).hasClass("not-editable-cell")){switch(y.edittype){case "checkbox":var B=["Yes","No"];if(y.editoptions)B=y.editoptions.value.split(":");q[l]=a("input",this).attr("checked")?B[0]:B[1];break;case "text":case "password":case "textarea":case "button":q[l]=a("input, textarea",this).val();
344
- break;case "select":if(y.editoptions.multiple){B=a("select",this);var A=[];q[l]=a(B).val();q[l]=q[l]?q[l].join(","):"";a("select > option:selected",this).each(function(M,R){A[M]=a(R).text()});s[l]=A.join(",")}else{q[l]=a("select>option:selected",this).val();s[l]=a("select>option:selected",this).text()}if(y.formatter&&y.formatter=="select")s={};break;case "custom":try{if(y.editoptions&&a.isFunction(y.editoptions.custom_value)){q[l]=y.editoptions.custom_value.call(m,a(".customelement",this),"get");
250
+ sopt:null,stringResult:undefined,onClose:null,onSearch:null,onReset:null,toTop:true,overlay:10,columns:[],tmplNames:null,tmplFilters:null,tmplLabel:" Template: ",showOnLoad:false,layer:null},a.jgrid.search,e||{});return this.each(function(){function c(){if(a.isFunction(e.beforeShowSearch)){j=e.beforeShowSearch(a("#"+g));if(typeof j==="undefined")j=true}if(j){a.jgrid.viewModal("#"+h.themodal,{gbox:"#gbox_"+g,jqm:e.jqModal,modal:e.modal,overlay:e.overlay,toTop:e.toTop});a.isFunction(e.afterShowSearch)&&
251
+ e.afterShowSearch(a("#"+g))}}var f=this;if(f.grid){var g="fbox_"+f.p.id,j=true,h={themodal:"searchmod"+g,modalhead:"searchhd"+g,modalcontent:"searchcnt"+g,scrollelm:g},d=f.p.postData[e.sFilter];if(typeof d==="string")d=a.jgrid.parse(d);e.recreateFilter===true&&a("#"+h.themodal).remove();if(a("#"+h.themodal).html()!==null)c();else{var o=a("<span><div id='"+g+"' class='searchFilter' style='overflow:auto'></div></span>").insertBefore("#gview_"+f.p.id);a.isFunction(e.onInitializeSearch)&&e.onInitializeSearch(a("#"+
252
+ g));var k=a.extend([],f.p.colModel),n="<a href='javascript:void(0)' id='"+g+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>"+e.Find+"</a>",m="<a href='javascript:void(0)' id='"+g+"_reset' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-search'><span class='ui-icon ui-icon-arrowreturnthick-1-w'></span>"+e.Reset+"</a>",l="",q="",s,p=false;if(e.showQuery)l="<a href='javascript:void(0)' id='"+
253
+ g+"_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>";if(e.columns.length)k=e.columns;else a.each(k,function(r,t){if(!t.label)t.label=f.p.colNames[r];if(!p){var y=typeof t.search==="undefined"?true:t.search,B=t.hidden===true;if(t.searchoptions&&t.searchoptions.searchhidden===true&&y||y&&!B){p=true;s=t.index||t.name}}});if(!d&&s||e.multipleSearch===false)d={groupOp:"AND",rules:[{field:s,op:"eq",data:""}]};p=false;if(e.tmplNames&&
254
+ e.tmplNames.length){p=true;q=e.tmplLabel;q+="<select class='ui-template'>";q+="<option value='default'>Default</option>";a.each(e.tmplNames,function(r,t){q+="<option value='"+r+"'>"+t+"</option>"});q+="</select>"}n="<table class='EditTable' style='border:0px none;margin-top:5px' id='"+g+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:left'>"+m+q+"</td><td class='EditButton'>"+l+n+"</td></tr></tbody></table>";
255
+ a("#"+g).jqFilter({columns:k,filter:e.loadDefaults?d:null,showQuery:e.showQuery,errorcheck:e.errorcheck,sopt:e.sopt,groupButton:e.multipleGroup,_gridsopt:a.jgrid.search.odata,onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString())}});o.append(n);p&&e.tmplFilters&&e.tmplFilters.length&&a(".ui-template",o).bind("change",function(){var r=a(this).val();r=="default"?a("#"+g).jqFilter("addFilter",d):a("#"+g).jqFilter("addFilter",e.tmplFilters[parseInt(r,10)]);return false});
256
+ if(e.multipleSearch===false){a(".add-rule","#"+g).hide();a(".delete-rule","#"+g).hide()}a.isFunction(e.onInitializeSearch)&&e.onInitializeSearch(a("#"+g));e.layer?a.jgrid.createModal(h,o,e,"#gview_"+f.p.id,a("#gbox_"+f.p.id)[0],"#"+e.layer,{position:"relative"}):a.jgrid.createModal(h,o,e,"#gview_"+f.p.id,a("#gbox_"+f.p.id)[0]);l&&a("#"+g+"_query").bind("click",function(){a(".queryresult",o).toggle();return false});if(e.stringResult===undefined)e.stringResult=e.multipleSearch;a("#"+g+"_search").bind("click",
257
+ function(){var r=a("#"+g),t={},y,B=r.jqFilter("filterData");if(e.errorcheck){r[0].hideError();e.showQuery||r.jqFilter("toSQLString");if(r[0].p.error){r[0].showError();return false}}if(e.stringResult){try{y=xmlJsonClass.toJson(B,"","",false)}catch(G){try{y=JSON.stringify(B)}catch(x){}}if(typeof y==="string"){t[e.sFilter]=y;a.each([e.sField,e.sValue,e.sOper],function(){t[this]=""})}}else if(e.multipleSearch){t[e.sFilter]=B;a.each([e.sField,e.sValue,e.sOper],function(){t[this]=""})}else{t[e.sField]=
258
+ B.rules[0].field;t[e.sValue]=B.rules[0].data;t[e.sOper]=B.rules[0].op;t[e.sFilter]=""}f.p.search=true;a.extend(f.p.postData,t);a.isFunction(e.onSearch)&&e.onSearch();a(f).trigger("reloadGrid",[{page:1}]);e.closeAfterSearch&&a.jgrid.hideModal("#"+h.themodal,{gb:"#gbox_"+f.p.id,jqm:e.jqModal,onClose:e.onClose});return false});a("#"+g+"_reset").bind("click",function(){var r={},t=a("#"+g);f.p.search=false;if(e.multipleSearch===false)r[e.sField]=r[e.sValue]=r[e.sOper]="";else r[e.sFilter]="";t[0].resetFilter();
259
+ p&&a(".ui-template",o).val("default");a.extend(f.p.postData,r);a.isFunction(e.onReset)&&e.onReset();a(f).trigger("reloadGrid",[{page:1}]);return false});c();a(".fm-button:not(.ui-state-disabled)",o).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},editGridRow:function(e,c){b=c=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,
260
+ reloadAfterSubmit:true,onInitializeForm:null,beforeInitData:null,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,
261
+ viewPagerButtons:true},a.jgrid.edit,c||{});return this.each(function(){function f(){a(".FormElement","#"+p).each(function(){var F=a(".customelement",this);if(F.length){var I=a(F[0]).attr("name");a.each(l.p.colModel,function(){if(this.name===I&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{z[I]=this.editoptions.custom_value(a("#"+a.jgrid.jqID(I),"#"+p),"get");if(z[I]===undefined)throw"e1";}catch(O){O==="e1"?a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+
262
+ a.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose):a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,O.message,jQuery.jgrid.edit.bClose)}return true}})}else{switch(a(this).get(0).type){case "checkbox":if(a(this).attr("checked"))z[this.name]=a(this).val();else{F=a(this).attr("offval");z[this.name]=F}break;case "select-one":z[this.name]=a("option:selected",this).val();M[this.name]=a("option:selected",this).text();break;case "select-multiple":z[this.name]=a(this).val();z[this.name]=z[this.name]?z[this.name].join(","):
263
+ "";var T=[];a("option:selected",this).each(function(O,W){T[O]=a(W).text()});M[this.name]=T.join(",");break;case "password":case "text":case "textarea":case "button":z[this.name]=a(this).val()}if(l.p.autoencode)z[this.name]=a.jgrid.htmlEncode(z[this.name])}});return true}function g(F,I,T,O){var W,R,Z,ka=0,ba,la,da,ta=[],ca=false,va="",na;for(na=1;na<=O;na++)va+="<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>";if(F!="_empty")ca=a(I).jqGrid("getInd",F);a(I.p.colModel).each(function(wa){W=
264
+ this.name;la=(R=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":"";if(W!=="cb"&&W!=="subgrid"&&this.editable===true&&W!=="rn"){if(ca===false)ba="";else if(W==I.p.ExpandColumn&&I.p.treeGrid===true)ba=a("td:eq("+wa+")",I.rows[ca]).text();else try{ba=a.unformat(a("td:eq("+wa+")",I.rows[ca]),{rowId:F,colModel:this},wa)}catch(Ga){ba=a("td:eq("+wa+")",I.rows[ca]).text()}var u=a.extend({},this.editoptions||{},{id:W,name:W}),v=a.extend({},{elmprefix:"",
265
+ elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),w=parseInt(v.rowpos,10)||ka+1,D=parseInt((parseInt(v.colpos,10)||1)*2,10);if(F=="_empty"&&u.defaultValue)ba=a.isFunction(u.defaultValue)?u.defaultValue():u.defaultValue;if(!this.edittype)this.edittype="text";if(l.p.autoencode)ba=a.jgrid.htmlDecode(ba);da=a.jgrid.createEl(this.edittype,u,ba,false,a.extend({},a.jgrid.ajaxOptions,I.p.ajaxSelectOptions||{}));if(ba===""&&this.edittype=="checkbox")ba=a(da).attr("offval");if(ba===""&&this.edittype==
266
+ "select")ba=a("option:eq(0)",da).text();if(b.checkOnSubmit||b.checkOnUpdate)b._savedData[W]=ba;a(da).addClass("FormElement");if(this.edittype=="text"||this.edittype=="textarea")a(da).addClass("ui-widget-content ui-corner-all");Z=a(T).find("tr[rowpos="+w+"]");if(v.rowabove){u=a("<tr><td class='contentinfo' colspan='"+O*2+"'>"+v.rowcontent+"</td></tr>");a(T).append(u);u[0].rp=w}if(Z.length===0){Z=a("<tr "+la+" rowpos='"+w+"'></tr>").addClass("FormData").attr("id","tr_"+W);a(Z).append(va);a(T).append(Z);
267
+ Z[0].rp=w}a("td:eq("+(D-2)+")",Z[0]).html(typeof v.label==="undefined"?I.p.colNames[wa]:v.label);a("td:eq("+(D-1)+")",Z[0]).append(v.elmprefix).append(da).append(v.elmsuffix);ta[ka]=wa;ka++}});if(ka>0){na=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(O*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+I.p.id+"_id' value='"+F+"'/></td></tr>");na[0].rp=ka+999;a(T).append(na);if(b.checkOnSubmit||b.checkOnUpdate)b._savedData[I.p.id+
268
+ "_id"]=F}return ta}function j(F,I,T){var O,W=0,R,Z,ka,ba,la;if(b.checkOnSubmit||b.checkOnUpdate){b._savedData={};b._savedData[I.p.id+"_id"]=F}var da=I.p.colModel;if(F=="_empty"){a(da).each(function(){O=this.name;ka=a.extend({},this.editoptions||{});if((Z=a("#"+a.jgrid.jqID(O),"#"+T))&&Z[0]!==null){ba="";if(ka.defaultValue){ba=a.isFunction(ka.defaultValue)?ka.defaultValue():ka.defaultValue;if(Z[0].type=="checkbox"){la=ba.toLowerCase();if(la.search(/(false|0|no|off|undefined)/i)<0&&la!==""){Z[0].checked=
269
+ true;Z[0].defaultChecked=true;Z[0].value=ba}else Z.attr({checked:"",defaultChecked:""})}else Z.val(ba)}else if(Z[0].type=="checkbox"){Z[0].checked=false;Z[0].defaultChecked=false;ba=a(Z).attr("offval")}else if(Z[0].type&&Z[0].type.substr(0,6)=="select")Z[0].selectedIndex=0;else Z.val(ba);if(b.checkOnSubmit===true||b.checkOnUpdate)b._savedData[O]=ba}});a("#id_g","#"+T).val(F)}else{var ta=a(I).jqGrid("getInd",F,true);if(ta){a("td",ta).each(function(ca){O=da[ca].name;if(O!=="cb"&&O!=="subgrid"&&O!==
270
+ "rn"&&da[ca].editable===true){if(O==I.p.ExpandColumn&&I.p.treeGrid===true)R=a(this).text();else try{R=a.unformat(a(this),{rowId:F,colModel:da[ca]},ca)}catch(va){R=a(this).text()}if(l.p.autoencode)R=a.jgrid.htmlDecode(R);if(b.checkOnSubmit===true||b.checkOnUpdate)b._savedData[O]=R;O=a.jgrid.jqID(O);switch(da[ca].edittype){case "password":case "text":case "button":case "image":a("#"+O,"#"+T).val(R);break;case "textarea":if(R=="&nbsp;"||R=="&#160;"||R.length==1&&R.charCodeAt(0)==160)R="";a("#"+O,"#"+
271
+ T).val(R);break;case "select":var na=R.split(",");na=a.map(na,function(Ga){return a.trim(Ga)});a("#"+O+" option","#"+T).each(function(){this.selected=!da[ca].editoptions.multiple&&(na[0]==a.trim(a(this).text())||na[0]==a.trim(a(this).val()))?true:da[ca].editoptions.multiple?a.inArray(a.trim(a(this).text()),na)>-1||a.inArray(a.trim(a(this).val()),na)>-1?true:false:false});break;case "checkbox":R+="";if(da[ca].editoptions&&da[ca].editoptions.value)if(da[ca].editoptions.value.split(":")[0]==R){a("#"+
272
+ O,"#"+T).attr("checked",true);a("#"+O,"#"+T).attr("defaultChecked",true)}else{a("#"+O,"#"+T).attr("checked",false);a("#"+O,"#"+T).attr("defaultChecked","")}else{R=R.toLowerCase();if(R.search(/(false|0|no|off|undefined)/i)<0&&R!==""){a("#"+O,"#"+T).attr("checked",true);a("#"+O,"#"+T).attr("defaultChecked",true)}else{a("#"+O,"#"+T).attr("checked",false);a("#"+O,"#"+T).attr("defaultChecked","")}}break;case "custom":try{if(da[ca].editoptions&&a.isFunction(da[ca].editoptions.custom_value))da[ca].editoptions.custom_value(a("#"+
273
+ O,"#"+T),"set",R);else throw"e1";}catch(wa){wa=="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,wa.message,jQuery.jgrid.edit.bClose)}}W++}});W>0&&a("#id_g","#"+p).val(F)}}}function h(){var F,I=[true,"",""],T={},O=l.p.prmNames,W,R,Z,ka;if(a.isFunction(b.beforeCheckValues)){var ba=b.beforeCheckValues(z,a("#"+s),z[l.p.id+"_id"]=="_empty"?O.addoper:O.editoper);if(ba&&typeof ba===
274
+ "object")z=ba}for(Z in z)if(z.hasOwnProperty(Z)){I=a.jgrid.checkValues(z[Z],Z,l);if(I[0]===false)break}if(I[0]){if(a.isFunction(b.onclickSubmit))T=b.onclickSubmit(b,z)||{};if(a.isFunction(b.beforeSubmit))I=b.beforeSubmit(z,a("#"+s))}if(I[0]&&!b.processing){b.processing=true;a("#sData","#"+p+"_2").addClass("ui-state-active");R=O.oper;W=O.id;z[R]=a.trim(z[l.p.id+"_id"])=="_empty"?O.addoper:O.editoper;if(z[R]!=O.addoper)z[W]=z[l.p.id+"_id"];else if(z[W]===undefined)z[W]=z[l.p.id+"_id"];delete z[l.p.id+
275
+ "_id"];z=a.extend(z,b.editData,T);if(l.p.treeGrid===true){if(z[R]==O.addoper){ka=a(l).jqGrid("getGridParam","selrow");z[l.p.treeGridModel=="adjacency"?l.p.treeReader.parent_id_field:"parent_id"]=ka}for(i in l.p.treeReader){T=l.p.treeReader[i];if(z.hasOwnProperty(T))z[R]==O.addoper&&i==="parent_id_field"||delete z[T]}}if(l.p.restful){b.mtype=z.id=="_empty"?"POST":"PUT";b.url=z.id=="_empty"?l.p.url:l.p.url+"/"+z.id}T=a.extend({url:b.url?b.url:a(l).jqGrid("getGridParam","editurl"),type:b.mtype,data:a.isFunction(b.serializeEditData)?
276
+ b.serializeEditData(z):z,complete:function(la,da){if(da!="success"){I[0]=false;I[1]=a.isFunction(b.errorTextFormat)?b.errorTextFormat(la):da+" Status: '"+la.statusText+"'. Error code: "+la.status}else if(a.isFunction(b.afterSubmit))I=b.afterSubmit(la,z);if(I[0]===false){a("#FormError>td","#"+p).html(I[1]);a("#FormError","#"+p).show()}else{a.each(l.p.colModel,function(){if(M[this.name]&&this.formatter&&this.formatter=="select")try{delete M[this.name]}catch(va){}});z=a.extend(z,M);l.p.autoencode&&a.each(z,
277
+ function(va,na){z[va]=a.jgrid.htmlDecode(na)});b.reloadAfterSubmit=b.reloadAfterSubmit&&l.p.datatype!="local";if(z[R]==O.addoper){I[2]||(I[2]=a.jgrid.randId());z[W]=I[2];if(b.closeAfterAdd){if(b.reloadAfterSubmit)a(l).trigger("reloadGrid");else if(l.p.treeGrid===true)a(l).jqGrid("addChildNode",I[2],ka,z);else{a(l).jqGrid("addRowData",I[2],z,c.addedrow);a(l).jqGrid("setSelection",I[2])}a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose})}else if(b.clearAfterAdd){if(b.reloadAfterSubmit)a(l).trigger("reloadGrid");
278
+ else l.p.treeGrid===true?a(l).jqGrid("addChildNode",I[2],ka,z):a(l).jqGrid("addRowData",I[2],z,c.addedrow);j("_empty",l,s)}else if(b.reloadAfterSubmit)a(l).trigger("reloadGrid");else l.p.treeGrid===true?a(l).jqGrid("addChildNode",I[2],ka,z):a(l).jqGrid("addRowData",I[2],z,c.addedrow)}else{if(b.reloadAfterSubmit){a(l).trigger("reloadGrid");b.closeAfterEdit||setTimeout(function(){a(l).jqGrid("setSelection",z[W])},1E3)}else l.p.treeGrid===true?a(l).jqGrid("setTreeRow",z[W],z):a(l).jqGrid("setRowData",
279
+ z[W],z);b.closeAfterEdit&&a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose})}if(a.isFunction(b.afterComplete)){F=la;setTimeout(function(){b.afterComplete(F,z,a("#"+s));F=null},500)}if(b.checkOnSubmit||b.checkOnUpdate){a("#"+s).data("disabled",false);if(b._savedData[l.p.id+"_id"]!="_empty")for(var ta in b._savedData)if(z[ta])b._savedData[ta]=z[ta]}}b.processing=false;a("#sData","#"+p+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+s)[0].focus()}catch(ca){}}},
280
+ a.jgrid.ajaxOptions,b.ajaxEditOptions);if(!T.url&&!b.useDataProxy)if(a.isFunction(l.p.dataProxy))b.useDataProxy=true;else{I[0]=false;I[1]+=" "+a.jgrid.errors.nourl}if(I[0])b.useDataProxy?l.p.dataProxy.call(l,T,"set_"+l.p.id):a.ajax(T)}if(I[0]===false){a("#FormError>td","#"+p).html(I[1]);a("#FormError","#"+p).show()}}function d(F,I){var T=false,O;for(O in F)if(F[O]!=I[O]){T=true;break}return T}function o(){var F=true;a("#FormError","#"+p).hide();if(b.checkOnUpdate){z={};M={};f();Q=a.extend({},z,M);
281
+ if(U=d(Q,b._savedData)){a("#"+s).data("disabled",true);a(".confirm","#"+r.themodal).show();F=false}}return F}function k(){if(e!=="_empty"&&typeof l.p.savedRow!=="undefined"&&l.p.savedRow.length>0&&a.isFunction(a.fn.jqGrid.restoreRow))for(var F=0;F<l.p.savedRow.length;F++)if(l.p.savedRow[F].id==e){a(l).jqGrid("restoreRow",e);break}}function n(F,I){F===0?a("#pData","#"+p+"_2").addClass("ui-state-disabled"):a("#pData","#"+p+"_2").removeClass("ui-state-disabled");F==I?a("#nData","#"+p+"_2").addClass("ui-state-disabled"):
282
+ a("#nData","#"+p+"_2").removeClass("ui-state-disabled")}function m(){var F=a(l).jqGrid("getDataIDs"),I=a("#id_g","#"+p).val();return[a.inArray(I,F),F]}var l=this;if(l.grid&&e){var q=l.p.id,s="FrmGrid_"+q,p="TblGrid_"+q,r={themodal:"editmod"+q,modalhead:"edithd"+q,modalcontent:"editcnt"+q,scrollelm:s},t=a.isFunction(b.beforeShowForm)?b.beforeShowForm:false,y=a.isFunction(b.afterShowForm)?b.afterShowForm:false,B=a.isFunction(b.beforeInitData)?b.beforeInitData:false,G=a.isFunction(b.onInitializeForm)?
283
+ b.onInitializeForm:false,x=true,C=1,A=0,z,M,Q,U;if(e==="new"){e="_empty";c.caption=b.addCaption}else c.caption=b.editCaption;c.recreateForm===true&&a("#"+r.themodal).html()!==null&&a("#"+r.themodal).remove();var ja=true;if(c.checkOnUpdate&&c.jqModal&&!c.modal)ja=false;if(a("#"+r.themodal).html()!==null){if(B){x=B(a("#"+s));if(typeof x=="undefined")x=true}if(x===false)return;k();a(".ui-jqdialog-title","#"+r.modalhead).html(c.caption);a("#FormError","#"+p).hide();if(b.topinfo){a(".topinfo","#"+p+"_2").html(b.topinfo);
284
+ a(".tinfo","#"+p+"_2").show()}else a(".tinfo","#"+p+"_2").hide();if(b.bottominfo){a(".bottominfo","#"+p+"_2").html(b.bottominfo);a(".binfo","#"+p+"_2").show()}else a(".binfo","#"+p+"_2").hide();j(e,l,s);e=="_empty"||!b.viewPagerButtons?a("#pData, #nData","#"+p+"_2").hide():a("#pData, #nData","#"+p+"_2").show();if(b.processing===true){b.processing=false;a("#sData","#"+p+"_2").removeClass("ui-state-active")}if(a("#"+s).data("disabled")===true){a(".confirm","#"+r.themodal).hide();a("#"+s).data("disabled",
285
+ false)}t&&t(a("#"+s));a("#"+r.themodal).data("onClose",b.onClose);a.jgrid.viewModal("#"+r.themodal,{gbox:"#gbox_"+q,jqm:c.jqModal,jqM:false,overlay:c.overlay,modal:c.modal});ja||a(".jqmOverlay").click(function(){if(!o())return false;a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false});y&&y(a("#"+s))}else{var $=isNaN(c.dataheight)?c.dataheight:c.dataheight+"px";$=a("<form name='FormPost' id='"+s+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+
286
+ $+";'></form>").data("disabled",false);var ia=a("<table id='"+p+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");if(B){x=B(a("#"+s));if(typeof x=="undefined")x=true}if(x===false)return;k();a(l.p.colModel).each(function(){var F=this.formoptions;C=Math.max(C,F?F.colpos||0:0);A=Math.max(A,F?F.rowpos||0:0)});a($).append(ia);B=a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+C*2+"'></td></tr>");B[0].rp=0;a(ia).append(B);B=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+
287
+ C*2+"'>"+b.topinfo+"</td></tr>");B[0].rp=0;a(ia).append(B);x=(B=l.p.direction=="rtl"?true:false)?"nData":"pData";var sa=B?"pData":"nData";g(e,l,ia,C);x="<a href='javascript:void(0)' id='"+x+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>";sa="<a href='javascript:void(0)' id='"+sa+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>";var xa="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+
288
+ c.bSubmit+"</a>",Ca="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+c.bCancel+"</a>";x="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+p+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(B?sa+x:x+sa)+"</td><td class='EditButton'>"+xa+Ca+"</td></tr>";x+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+b.bottominfo+
289
+ "</td></tr>";x+="</tbody></table>";if(A>0){var oa=[];a.each(a(ia)[0].rows,function(F,I){oa[F]=I});oa.sort(function(F,I){if(F.rp>I.rp)return 1;if(F.rp<I.rp)return-1;return 0});a.each(oa,function(F,I){a("tbody",ia).append(I)})}c.gbox="#gbox_"+q;var Da=false;if(c.closeOnEscape===true){c.closeOnEscape=false;Da=true}$=a("<span></span>").append($).append(x);a.jgrid.createModal(r,$,c,"#gview_"+l.p.id,a("#gbox_"+l.p.id)[0]);if(B){a("#pData, #nData","#"+p+"_2").css("float","right");a(".EditButton","#"+p+"_2").css("text-align",
290
+ "left")}b.topinfo&&a(".tinfo","#"+p+"_2").show();b.bottominfo&&a(".binfo","#"+p+"_2").show();x=$=null;a("#"+r.themodal).keydown(function(F){var I=F.target;if(a("#"+s).data("disabled")===true)return false;if(b.savekey[0]===true&&F.which==b.savekey[1])if(I.tagName!="TEXTAREA"){a("#sData","#"+p+"_2").trigger("click");return false}if(F.which===27){if(!o())return false;Da&&a.jgrid.hideModal(this,{gb:c.gbox,jqm:c.jqModal,onClose:b.onClose});return false}if(b.navkeys[0]===true){if(a("#id_g","#"+p).val()==
291
+ "_empty")return true;if(F.which==b.navkeys[1]){a("#pData","#"+p+"_2").trigger("click");return false}if(F.which==b.navkeys[2]){a("#nData","#"+p+"_2").trigger("click");return false}}});if(c.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+r.themodal).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+r.themodal).unbind("click").click(function(){if(!o())return false;a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false})}c.saveicon=a.extend([true,
292
+ "left","ui-icon-disk"],c.saveicon);c.closeicon=a.extend([true,"left","ui-icon-close"],c.closeicon);if(c.saveicon[0]===true)a("#sData","#"+p+"_2").addClass(c.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.saveicon[2]+"'></span>");if(c.closeicon[0]===true)a("#cData","#"+p+"_2").addClass(c.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.closeicon[2]+"'></span>");if(b.checkOnSubmit||b.checkOnUpdate){xa=
293
+ "<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+c.bYes+"</a>";sa="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+c.bNo+"</a>";Ca="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+c.bExit+"</a>";$=c.zIndex||999;$++;a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+$+";display:none;'>&#160;"+
294
+ (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:"+($+1)+"'>"+c.saveData+"<br/><br/>"+xa+sa+Ca+"</div>").insertAfter("#"+s);a("#sNew","#"+r.themodal).click(function(){h();a("#"+s).data("disabled",false);a(".confirm","#"+r.themodal).hide();return false});a("#nNew","#"+r.themodal).click(function(){a(".confirm",
295
+ "#"+r.themodal).hide();a("#"+s).data("disabled",false);setTimeout(function(){a(":input","#"+s)[0].focus()},0);return false});a("#cNew","#"+r.themodal).click(function(){a(".confirm","#"+r.themodal).hide();a("#"+s).data("disabled",false);a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false})}G&&G(a("#"+s));e=="_empty"||!b.viewPagerButtons?a("#pData,#nData","#"+p+"_2").hide():a("#pData,#nData","#"+p+"_2").show();t&&t(a("#"+s));a("#"+r.themodal).data("onClose",
296
+ b.onClose);a.jgrid.viewModal("#"+r.themodal,{gbox:"#gbox_"+q,jqm:c.jqModal,overlay:c.overlay,modal:c.modal});ja||a(".jqmOverlay").click(function(){if(!o())return false;a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false});y&&y(a("#"+s));a(".fm-button","#"+r.themodal).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a("#sData","#"+p+"_2").click(function(){z={};M={};a("#FormError","#"+p).hide();f();if(z[l.p.id+
297
+ "_id"]=="_empty")h();else if(c.checkOnSubmit===true){Q=a.extend({},z,M);if(U=d(Q,b._savedData)){a("#"+s).data("disabled",true);a(".confirm","#"+r.themodal).show()}else h()}else h();return false});a("#cData","#"+p+"_2").click(function(){if(!o())return false;a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+q,jqm:c.jqModal,onClose:b.onClose});return false});a("#nData","#"+p+"_2").click(function(){if(!o())return false;a("#FormError","#"+p).hide();var F=m();F[0]=parseInt(F[0],10);if(F[0]!=-1&&F[1][F[0]+1]){a.isFunction(c.onclickPgButtons)&&
298
+ c.onclickPgButtons("next",a("#"+s),F[1][F[0]]);j(F[1][F[0]+1],l,s);a(l).jqGrid("setSelection",F[1][F[0]+1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("next",a("#"+s),F[1][F[0]+1]);n(F[0]+1,F[1].length-1)}return false});a("#pData","#"+p+"_2").click(function(){if(!o())return false;a("#FormError","#"+p).hide();var F=m();if(F[0]!=-1&&F[1][F[0]-1]){a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons("prev",a("#"+s),F[1][F[0]]);j(F[1][F[0]-1],l,s);a(l).jqGrid("setSelection",F[1][F[0]-
299
+ 1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("prev",a("#"+s),F[1][F[0]-1]);n(F[0]-1,F[1].length-1)}return false})}t=m();n(t[0],t[1].length-1)}})},viewGridRow:function(e,c){c=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,beforeShowForm:null,beforeInitData:null,viewPagerButtons:true},a.jgrid.view,c||{});return this.each(function(){function f(){if(c.closeOnEscape===
300
+ true||c.navkeys[0]===true)setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+l.modalhead).focus()},0)}function g(A,z,M,Q){for(var U,ja,$,ia=0,sa,xa,Ca=[],oa=false,Da="<td class='CaptionTD form-view-label ui-widget-content' width='"+c.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",F="",I=["integer","number","currency"],T=0,O=0,W,R,Z,ka=1;ka<=Q;ka++)F+=ka==1?Da:"<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";
301
+ a(z.p.colModel).each(function(){ja=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false;if(!ja&&this.align==="right")if(this.formatter&&a.inArray(this.formatter,I)!==-1)T=Math.max(T,parseInt(this.width,10));else O=Math.max(O,parseInt(this.width,10))});W=T!==0?T:O!==0?O:0;oa=a(z).jqGrid("getInd",A);a(z.p.colModel).each(function(ba){U=this.name;R=false;xa=(ja=this.editrules&&this.editrules.edithidden===true?false:this.hidden===true?true:false)?"style='display:none'":
302
+ "";Z=typeof this.viewable!="boolean"?true:this.viewable;if(U!=="cb"&&U!=="subgrid"&&U!=="rn"&&Z){sa=oa===false?"":U==z.p.ExpandColumn&&z.p.treeGrid===true?a("td:eq("+ba+")",z.rows[oa]).text():a("td:eq("+ba+")",z.rows[oa]).html();R=this.align==="right"&&W!==0?true:false;a.extend({},this.editoptions||{},{id:U,name:U});var la=a.extend({},{rowabove:false,rowcontent:""},this.formoptions||{}),da=parseInt(la.rowpos,10)||ia+1,ta=parseInt((parseInt(la.colpos,10)||1)*2,10);if(la.rowabove){var ca=a("<tr><td class='contentinfo' colspan='"+
303
+ Q*2+"'>"+la.rowcontent+"</td></tr>");a(M).append(ca);ca[0].rp=da}$=a(M).find("tr[rowpos="+da+"]");if($.length===0){$=a("<tr "+xa+" rowpos='"+da+"'></tr>").addClass("FormData").attr("id","trv_"+U);a($).append(F);a(M).append($);$[0].rp=da}a("td:eq("+(ta-2)+")",$[0]).html("<b>"+(typeof la.label==="undefined"?z.p.colNames[ba]:la.label)+"</b>");a("td:eq("+(ta-1)+")",$[0]).append("<span>"+sa+"</span>").attr("id","v_"+U);R&&a("td:eq("+(ta-1)+") span",$[0]).css({"text-align":"right",width:W+"px"});Ca[ia]=
304
+ ba;ia++}});if(ia>0){A=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(Q*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+A+"'/></td></tr>");A[0].rp=ia+99;a(M).append(A)}return Ca}function j(A,z){var M,Q,U=0,ja,$;if($=a(z).jqGrid("getInd",A,true)){a("td",$).each(function(ia){M=z.p.colModel[ia].name;Q=z.p.colModel[ia].editrules&&z.p.colModel[ia].editrules.edithidden===true?false:z.p.colModel[ia].hidden===true?true:false;
305
+ if(M!=="cb"&&M!=="subgrid"&&M!=="rn"){ja=M==z.p.ExpandColumn&&z.p.treeGrid===true?a(this).text():a(this).html();a.extend({},z.p.colModel[ia].editoptions||{});M=a.jgrid.jqID("v_"+M);a("#"+M+" span","#"+m).html(ja);Q&&a("#"+M,"#"+m).parents("tr:first").hide();U++}});U>0&&a("#id_g","#"+m).val(A)}}function h(A,z){A===0?a("#pData","#"+m+"_2").addClass("ui-state-disabled"):a("#pData","#"+m+"_2").removeClass("ui-state-disabled");A==z?a("#nData","#"+m+"_2").addClass("ui-state-disabled"):a("#nData","#"+m+
306
+ "_2").removeClass("ui-state-disabled")}function d(){var A=a(o).jqGrid("getDataIDs"),z=a("#id_g","#"+m).val();return[a.inArray(z,A),A]}var o=this;if(o.grid&&e){if(!c.imgpath)c.imgpath=o.p.imgpath;var k=o.p.id,n="ViewGrid_"+k,m="ViewTbl_"+k,l={themodal:"viewmod"+k,modalhead:"viewhd"+k,modalcontent:"viewcnt"+k,scrollelm:n},q=a.isFunction(c.beforeInitData)?c.beforeInitData:false,s=true,p=1,r=0;if(a("#"+l.themodal).html()!==null){if(q){s=q(a("#"+n));if(typeof s=="undefined")s=true}if(s===false)return;
307
+ a(".ui-jqdialog-title","#"+l.modalhead).html(c.caption);a("#FormError","#"+m).hide();j(e,o);a.isFunction(c.beforeShowForm)&&c.beforeShowForm(a("#"+n));a.jgrid.viewModal("#"+l.themodal,{gbox:"#gbox_"+k,jqm:c.jqModal,jqM:false,overlay:c.overlay,modal:c.modal});f()}else{var t=isNaN(c.dataheight)?c.dataheight:c.dataheight+"px";t=a("<form name='FormPost' id='"+n+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+t+";'></form>");var y=a("<table id='"+m+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
308
+ if(q){s=q(a("#"+n));if(typeof s=="undefined")s=true}if(s===false)return;a(o.p.colModel).each(function(){var A=this.formoptions;p=Math.max(p,A?A.colpos||0:0);r=Math.max(r,A?A.rowpos||0:0)});a(t).append(y);g(e,o,y,p);q=o.p.direction=="rtl"?true:false;s="<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>";var B="<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>",
309
+ G="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+c.bClose+"</a>";if(r>0){var x=[];a.each(a(y)[0].rows,function(A,z){x[A]=z});x.sort(function(A,z){if(A.rp>z.rp)return 1;if(A.rp<z.rp)return-1;return 0});a.each(x,function(A,z){a("tbody",y).append(z)})}c.gbox="#gbox_"+k;var C=false;if(c.closeOnEscape===true){c.closeOnEscape=false;C=true}t=a("<span></span>").append(t).append("<table border='0' class='EditTable' id='"+m+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+
310
+ c.labelswidth+"'>"+(q?B+s:s+B)+"</td><td class='EditButton'>"+G+"</td></tr></tbody></table>");a.jgrid.createModal(l,t,c,"#gview_"+o.p.id,a("#gview_"+o.p.id)[0]);if(q){a("#pData, #nData","#"+m+"_2").css("float","right");a(".EditButton","#"+m+"_2").css("text-align","left")}c.viewPagerButtons||a("#pData, #nData","#"+m+"_2").hide();t=null;a("#"+l.themodal).keydown(function(A){if(A.which===27){C&&a.jgrid.hideModal(this,{gb:c.gbox,jqm:c.jqModal,onClose:c.onClose});return false}if(c.navkeys[0]===true){if(A.which===
311
+ c.navkeys[1]){a("#pData","#"+m+"_2").trigger("click");return false}if(A.which===c.navkeys[2]){a("#nData","#"+m+"_2").trigger("click");return false}}});c.closeicon=a.extend([true,"left","ui-icon-close"],c.closeicon);if(c.closeicon[0]===true)a("#cData","#"+m+"_2").addClass(c.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.closeicon[2]+"'></span>");a.isFunction(c.beforeShowForm)&&c.beforeShowForm(a("#"+n));a.jgrid.viewModal("#"+l.themodal,{gbox:"#gbox_"+
312
+ k,jqm:c.jqModal,modal:c.modal});a(".fm-button:not(.ui-state-disabled)","#"+m+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});f();a("#cData","#"+m+"_2").click(function(){a.jgrid.hideModal("#"+l.themodal,{gb:"#gbox_"+k,jqm:c.jqModal,onClose:c.onClose});return false});a("#nData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var A=d();A[0]=parseInt(A[0],10);if(A[0]!=-1&&A[1][A[0]+1]){a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons("next",
313
+ a("#"+n),A[1][A[0]]);j(A[1][A[0]+1],o);a(o).jqGrid("setSelection",A[1][A[0]+1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("next",a("#"+n),A[1][A[0]+1]);h(A[0]+1,A[1].length-1)}f();return false});a("#pData","#"+m+"_2").click(function(){a("#FormError","#"+m).hide();var A=d();if(A[0]!=-1&&A[1][A[0]-1]){a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons("prev",a("#"+n),A[1][A[0]]);j(A[1][A[0]-1],o);a(o).jqGrid("setSelection",A[1][A[0]-1]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons("prev",
314
+ a("#"+n),A[1][A[0]-1]);h(A[0]-1,A[1].length-1)}f();return false})}t=d();h(t[0],t[1].length-1)}})},delGridRow:function(e,c){b=c=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,beforeShowForm:null,beforeInitData:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:true,closeOnEscape:false,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:false,
315
+ serializeDelData:null,useDataProxy:false},a.jgrid.del,c||{});return this.each(function(){var f=this;if(f.grid)if(e){var g=typeof c.beforeShowForm==="function"?true:false,j=typeof c.afterShowForm==="function"?true:false,h=a.isFunction(c.beforeInitData)?c.beforeInitData:false,d=f.p.id,o={},k=true,n="DelTbl_"+d,m,l,q,s,p={themodal:"delmod"+d,modalhead:"delhd"+d,modalcontent:"delcnt"+d,scrollelm:n};if(jQuery.isArray(e))e=e.join();if(a("#"+p.themodal).html()!==null){if(h){k=h(a("#"+n));if(typeof k=="undefined")k=
316
+ true}if(k===false)return;a("#DelData>td","#"+n).text(e);a("#DelError","#"+n).hide();if(b.processing===true){b.processing=false;a("#dData","#"+n).removeClass("ui-state-active")}g&&c.beforeShowForm(a("#"+n));a.jgrid.viewModal("#"+p.themodal,{gbox:"#gbox_"+d,jqm:c.jqModal,jqM:false,overlay:c.overlay,modal:c.modal})}else{var r=isNaN(c.dataheight)?c.dataheight:c.dataheight+"px";r="<div id='"+n+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+r+";'>";r+="<table class='DelTable'><tbody>";
317
+ r+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";r+="<tr id='DelData' style='display:none'><td >"+e+"</td></tr>";r+='<tr><td class="delmsg" style="white-space:pre;">'+c.msg+"</td></tr><tr><td >&#160;</td></tr>";r+="</tbody></table></div>";r+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+n+"_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'>"+
318
+ c.bSubmit+"</a>")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+c.bCancel+"</a>")+"</td></tr></tbody></table>";c.gbox="#gbox_"+d;a.jgrid.createModal(p,r,c,"#gview_"+f.p.id,a("#gview_"+f.p.id)[0]);if(h){k=h(a("#"+n));if(typeof k=="undefined")k=true}if(k===false)return;a(".fm-button","#"+n+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});c.delicon=a.extend([true,"left","ui-icon-scissors"],
319
+ c.delicon);c.cancelicon=a.extend([true,"left","ui-icon-cancel"],c.cancelicon);if(c.delicon[0]===true)a("#dData","#"+n+"_2").addClass(c.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.delicon[2]+"'></span>");if(c.cancelicon[0]===true)a("#eData","#"+n+"_2").addClass(c.cancelicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.cancelicon[2]+"'></span>");a("#dData","#"+n+"_2").click(function(){var t=[true,""];
320
+ o={};var y=a("#DelData>td","#"+n).text();if(typeof c.onclickSubmit==="function")o=c.onclickSubmit(b,y)||{};if(typeof c.beforeSubmit==="function")t=c.beforeSubmit(y);if(t[0]&&!b.processing){b.processing=true;a(this).addClass("ui-state-active");q=f.p.prmNames;m=a.extend({},b.delData,o);s=q.oper;m[s]=q.deloper;l=q.id;m[l]=y;if(f.p.restful){c.mtype="DELETE";b.url=f.p.url+"/"+y}var B=a.extend({url:b.url?b.url:a(f).jqGrid("getGridParam","editurl"),type:c.mtype,data:a.isFunction(c.serializeDelData)?c.serializeDelData(m):
321
+ m,complete:function(G,x){if(x!="success"){t[0]=false;t[1]=a.isFunction(b.errorTextFormat)?b.errorTextFormat(G):x+" Status: '"+G.statusText+"'. Error code: "+G.status}else if(typeof b.afterSubmit==="function")t=b.afterSubmit(G,m);if(t[0]===false){a("#DelError>td","#"+n).html(t[1]);a("#DelError","#"+n).show()}else{if(b.reloadAfterSubmit&&f.p.datatype!="local")a(f).trigger("reloadGrid");else{var C=[];C=y.split(",");if(f.p.treeGrid===true)try{a(f).jqGrid("delTreeNode",C[0])}catch(A){}else for(var z=0;z<
322
+ C.length;z++)a(f).jqGrid("delRowData",C[z]);f.p.selrow=null;f.p.selarrrow=[]}a.isFunction(b.afterComplete)&&setTimeout(function(){b.afterComplete(G,y)},500)}b.processing=false;a("#dData","#"+n+"_2").removeClass("ui-state-active");t[0]&&a.jgrid.hideModal("#"+p.themodal,{gb:"#gbox_"+d,jqm:c.jqModal,onClose:b.onClose})}},a.jgrid.ajaxOptions,c.ajaxDelOptions);if(!B.url&&!b.useDataProxy)if(a.isFunction(f.p.dataProxy))b.useDataProxy=true;else{t[0]=false;t[1]+=" "+a.jgrid.errors.nourl}if(t[0])b.useDataProxy?
323
+ f.p.dataProxy.call(f,B,"del_"+f.p.id):a.ajax(B)}if(t[0]===false){a("#DelError>td","#"+n).html(t[1]);a("#DelError","#"+n).show()}return false});a("#eData","#"+n+"_2").click(function(){a.jgrid.hideModal("#"+p.themodal,{gb:"#gbox_"+d,jqm:c.jqModal,onClose:b.onClose});return false});g&&c.beforeShowForm(a("#"+n));a.jgrid.viewModal("#"+p.themodal,{gbox:"#gbox_"+d,jqm:c.jqModal,overlay:c.overlay,modal:c.modal})}j&&c.afterShowForm(a("#"+n));c.closeOnEscape===true&&setTimeout(function(){a(".ui-jqdialog-titlebar-close",
324
+ "#"+p.modalhead).focus()},0)}})},navGrid:function(e,c,f,g,j,h,d){c=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",refreshstate:"firstpage",view:false,viewicon:"ui-icon-document",position:"left",closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false},a.jgrid.nav,c||{});return this.each(function(){if(!this.nav){var o={themodal:"alertmod",
325
+ modalhead:"alerthd",modalcontent:"alertcnt"},k=this,n,m,l;if(!(!k.grid||typeof e!="string")){if(a("#"+o.themodal).html()===null){if(typeof window.innerWidth!="undefined"){n=window.innerWidth;m=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==0){n=document.documentElement.clientWidth;m=document.documentElement.clientHeight}else{n=1024;m=768}a.jgrid.createModal(o,"<div>"+c.alerttext+
326
+ "</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+k.p.id,jqModal:true,drag:true,resize:true,caption:c.alertcap,top:m/2-25,left:n/2-100,width:200,height:"auto",closeOnEscape:c.closeOnEscape},"","",true)}n=1;if(c.cloneToTop&&k.p.toppager)n=2;for(m=0;m<n;m++){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>"),s,p;if(m===0){s=e;p=k.p.id;if(s==k.p.toppager){p+=
327
+ "_top";n=1}}else{s=k.p.toppager;p=k.p.id+"_top"}k.p.direction=="rtl"&&a(q).attr("dir","rtl").css("float","right");if(c.add){g=g||{};l=a("<td class='ui-pg-button ui-corner-all'></td>");a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.addicon+"'></span>"+c.addtext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.addtitle||"",id:g.id||"add_"+p}).click(function(){a(this).hasClass("ui-state-disabled")||(typeof c.addfunc=="function"?c.addfunc():a(k).jqGrid("editGridRow","new",g));return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
328
+ a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(c.edit){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 "+c.editicon+"'></span>"+c.edittext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.edittitle||"",id:f.id||"edit_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var r=k.p.selrow;if(r)typeof c.editfunc=="function"?c.editfunc(r):a(k).jqGrid("editGridRow",r,f);
329
+ else{a.jgrid.viewModal("#"+o.themodal,{gbox:"#gbox_"+k.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(c.view){l=a("<td class='ui-pg-button ui-corner-all'></td>");d=d||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.viewicon+"'></span>"+c.viewtext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.viewtitle||"",id:d.id||"view_"+
330
+ p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var r=k.p.selrow;if(r)a(k).jqGrid("viewGridRow",r,d);else{a.jgrid.viewModal("#"+o.themodal,{gbox:"#gbox_"+k.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(c.del){l=a("<td class='ui-pg-button ui-corner-all'></td>");j=j||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+
331
+ c.delicon+"'></span>"+c.deltext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.deltitle||"",id:j.id||"del_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var r;if(k.p.multiselect){r=k.p.selarrrow;if(r.length===0)r=null}else r=k.p.selrow;if(r)"function"==typeof c.delfunc?c.delfunc(r):a(k).jqGrid("delGridRow",r,j);else{a.jgrid.viewModal("#"+o.themodal,{gbox:"#gbox_"+k.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
332
+ a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});l=null}if(c.add||c.edit||c.del||c.view)a("tr",q).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");if(c.search){l=a("<td class='ui-pg-button ui-corner-all'></td>");h=h||{};a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.searchicon+"'></span>"+c.searchtext+"</div>");a("tr",q).append(l);a(l,q).attr({title:c.searchtitle||"",id:h.id||"search_"+
333
+ p}).click(function(){a(this).hasClass("ui-state-disabled")||a(k).jqGrid("searchGrid",h);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});h.showOnLoad&&h.showOnLoad===true&&a(l,q).click();l=null}if(c.refresh){l=a("<td class='ui-pg-button ui-corner-all'></td>");a(l).append("<div class='ui-pg-div'><span class='ui-icon "+c.refreshicon+"'></span>"+c.refreshtext+"</div>");a("tr",q).append(l);a(l,
334
+ q).attr({title:c.refreshtitle||"",id:"refresh_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){a.isFunction(c.beforeRefresh)&&c.beforeRefresh();k.p.search=false;try{var r=k.p.id;k.p.postData.filters="";a("#fbox_"+r).jqFilter("resetFilter");a.isFunction(k.clearToolbar)&&k.clearToolbar(false)}catch(t){}switch(c.refreshstate){case "firstpage":a(k).trigger("reloadGrid",[{page:1}]);break;case "current":a(k).trigger("reloadGrid",[{current:true}])}a.isFunction(c.afterRefresh)&&c.afterRefresh()}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
335
+ a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});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(q).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(s+"_"+c.position,s).append(q);if(k.p._nvtd){if(l>k.p._nvtd[0]){a(s+"_"+c.position,s).width(l);k.p._nvtd[0]=l}k.p._nvtd[1]=l}q=l=l=null;this.nav=true}}}})},navButtonAdd:function(e,
336
+ c){c=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},c||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0],g=this;if(f)if(!(c.id&&a("#"+c.id,f).html()!==null)){var j=a("<td></td>");c.buttonicon.toString().toUpperCase()=="NONE"?a(j).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+c.caption+"</div>"):a(j).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+
337
+ c.buttonicon+"'></span>"+c.caption+"</div>");c.id&&a(j).attr("id",c.id);if(c.position=="first")f.rows[0].cells.length===0?a("tr",f).append(j):a("tr td:eq(0)",f).before(j);else a("tr",f).append(j);a(j,f).attr("title",c.title||"").click(function(h){a(this).hasClass("ui-state-disabled")||a.isFunction(c.onClickButton)&&c.onClickButton.call(g,h);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},
338
+ navSeparatorAdd:function(e,c){c=a.extend({sepclass:"ui-separator",sepcontent:""},c||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0];if(f){var g="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+c.sepclass+"'></span>"+c.sepcontent+"</td>";a("tr",f).append(g)}}})},GridToForm:function(e,c){return this.each(function(){if(this.grid){var f=a(this).jqGrid("getRowData",e);if(f)for(var g in f)a("[name="+a.jgrid.jqID(g)+"]",c).is("input:radio")||
339
+ a("[name="+a.jgrid.jqID(g)+"]",c).is("input:checkbox")?a("[name="+a.jgrid.jqID(g)+"]",c).each(function(){a(this).val()==f[g]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+a.jgrid.jqID(g)+"]",c).val(f[g])}})},FormToGrid:function(e,c,f,g){return this.each(function(){if(this.grid){f||(f="set");g||(g="first");var j=a(c).serializeArray(),h={};a.each(j,function(d,o){h[o.name]=o.value});if(f=="add")a(this).jqGrid("addRowData",e,h,g);else f=="set"&&a(this).jqGrid("setRowData",
340
+ e,h)}})}})})(jQuery);
341
+ (function(a){a.jgrid.extend({editRow:function(b,e,c,f,g,j,h,d,o){var k={keys:e||false,oneditfunc:c||null,successfunc:f||null,url:g||null,extraparam:j||{},aftersavefunc:h||null,errorfunc:d||null,afterrestorefunc:o||null,restoreAfterErorr:true},n=a.makeArray(arguments).slice(1),m;m=n[0]&&typeof n[0]=="object"&&!a.isFunction(n[0])?a.extend(k,n[0]):k;return this.each(function(){var l=this,q,s,p=0,r=null,t={},y,B;if(l.grid){y=a(l).jqGrid("getInd",b,true);if(y!==false)if((a(y).attr("editable")||"0")=="0"&&
342
+ !a(y).hasClass("not-editable-row")){B=l.p.colModel;a("td",y).each(function(G){q=B[G].name;var x=l.p.treeGrid===true&&q==l.p.ExpandColumn;if(x)s=a("span:first",this).html();else try{s=a.unformat(this,{rowId:b,colModel:B[G]},G)}catch(C){s=a(this).html()}if(q!="cb"&&q!="subgrid"&&q!="rn"){if(l.p.autoencode)s=a.jgrid.htmlDecode(s);t[q]=s;if(B[G].editable===true){if(r===null)r=G;x?a("span:first",this).html(""):a(this).html("");var A=a.extend({},B[G].editoptions||{},{id:b+"_"+q,name:q});if(!B[G].edittype)B[G].edittype=
343
+ "text";A=a.jgrid.createEl(B[G].edittype,A,s,true,a.extend({},a.jgrid.ajaxOptions,l.p.ajaxSelectOptions||{}));a(A).addClass("editable");x?a("span:first",this).append(A):a(this).append(A);B[G].edittype=="select"&&B[G].editoptions.multiple===true&&a.browser.msie&&a(A).width(a(A).width());p++}}});if(p>0){t.id=b;l.p.savedRow.push(t);a(y).attr("editable","1");a("td:eq("+r+") input",y).focus();m.keys===true&&a(y).bind("keydown",function(G){G.keyCode===27&&a(l).jqGrid("restoreRow",b,o);if(G.keyCode===13){if(G.target.tagName==
344
+ "TEXTAREA")return true;a(l).jqGrid("saveRow",b,m);return false}G.stopPropagation()});a.isFunction(m.oneditfunc)&&m.oneditfunc.call(l,b)}}}})},saveRow:function(b,e,c,f,g,j,h){var d={successfunc:e||null,url:c||null,extraparam:f||{},aftersavefunc:g||null,errorfunc:j||null,afterrestorefunc:h||null,restoreAfterErorr:true},o=a.makeArray(arguments).slice(1),k;k=o[0]&&typeof o[0]=="object"&&!a.isFunction(o[0])?a.extend(d,o[0]):d;var n=false,m=this[0],l,q={},s={},p,r,t;if(!m.grid)return n;t=a(m).jqGrid("getInd",
345
+ b,true);if(t===false)return n;d=a(t).attr("editable");k.url=k.url?k.url:m.p.editurl;if(d==="1"){var y;a("td",t).each(function(x){y=m.p.colModel[x];l=y.name;if(l!="cb"&&l!="subgrid"&&y.editable===true&&l!="rn"&&!a(this).hasClass("not-editable-cell")){switch(y.edittype){case "checkbox":var C=["Yes","No"];if(y.editoptions)C=y.editoptions.value.split(":");q[l]=a("input",this).attr("checked")?C[0]:C[1];break;case "text":case "password":case "textarea":case "button":q[l]=a("input, textarea",this).val();
346
+ break;case "select":if(y.editoptions.multiple){C=a("select",this);var A=[];q[l]=a(C).val();q[l]=q[l]?q[l].join(","):"";a("select > option:selected",this).each(function(M,Q){A[M]=a(Q).text()});s[l]=A.join(",")}else{q[l]=a("select>option:selected",this).val();s[l]=a("select>option:selected",this).text()}if(y.formatter&&y.formatter=="select")s={};break;case "custom":try{if(y.editoptions&&a.isFunction(y.editoptions.custom_value)){q[l]=y.editoptions.custom_value.call(m,a(".customelement",this),"get");
345
347
  if(q[l]===undefined)throw"e2";}else throw"e1";}catch(z){z=="e1"&&a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);z=="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,z.message,jQuery.jgrid.edit.bClose)}}r=a.jgrid.checkValues(q[l],x,m);if(r[0]===false){r[1]=q[l]+" "+r[1];return false}if(m.p.autoencode)q[l]=
346
- a.jgrid.htmlEncode(q[l])}});if(r[0]===false){try{var D=a.jgrid.findPos(a("#"+a.jgrid.jqID(b),m.grid.bDiv)[0]);a.jgrid.info_dialog(a.jgrid.errors.errcap,r[1],a.jgrid.edit.bClose,{left:D[0],top:D[1]})}catch(G){alert(r[1])}return o}if(q){d=m.p.prmNames;n=d.oper;D=d.id;q[n]=d.editoper;q[D]=b;if(typeof m.p.inlineData=="undefined")m.p.inlineData={};q=a.extend({},q,m.p.inlineData,k.extraparam)}if(k.url=="clientArray"){q=a.extend({},q,s);m.p.autoencode&&a.each(q,function(x,B){q[x]=a.jgrid.htmlDecode(B)});
347
- D=a(m).jqGrid("setRowData",b,q);a(v).attr("editable","0");for(d=0;d<m.p.savedRow.length;d++)if(m.p.savedRow[d].id==b){p=d;break}p>=0&&m.p.savedRow.splice(p,1);a.isFunction(k.aftersavefunc)&&k.aftersavefunc.call(m,b,D);o=true}else{a("#lui_"+m.p.id).show();if(m.p.restful){mtype="PUT";k.url=k.url+"/"+b}else mtype="POST";a.ajax(a.extend({url:k.url,data:a.isFunction(m.p.serializeRowData)?m.p.serializeRowData.call(m,q):q,type:mtype,async:false,complete:function(x,B){a("#lui_"+m.p.id).hide();if(B==="success")if((a.isFunction(k.succesfunc)?
348
- k.succesfunc.call(m,x):true)===true){m.p.autoencode&&a.each(q,function(z,M){q[z]=a.jgrid.htmlDecode(M)});q=a.extend({},q,s);a(m).jqGrid("setRowData",b,q);a(v).attr("editable","0");for(var A=0;A<m.p.savedRow.length;A++)if(m.p.savedRow[A].id==b){p=A;break}p>=0&&m.p.savedRow.splice(p,1);a.isFunction(k.aftersavefunc)&&k.aftersavefunc.call(m,b,x);o=true}else{a.isFunction(k.errorfunc)&&k.errorfunc.call(m,b,x,B);k.restoreAfterError===true&&a(m).jqGrid("restoreRow",b,k.afterrestorefunc)}},error:function(x,
349
- B){a("#lui_"+m.p.id).hide();if(a.isFunction(k.errorfunc))k.errorfunc.call(m,b,x,B);else try{jQuery.jgrid.info_dialog(jQuery.jgrid.errors.errcap,'<div class="ui-state-error">'+x.responseText+"</div>",jQuery.jgrid.edit.bClose,{buttonalign:"right"})}catch(A){alert(x.responseText)}k.restoreAfterError===true&&a(m).jqGrid("restoreRow",b,k.afterrestorefunc)}},a.jgrid.ajaxOptions,m.p.ajaxRowOptions||{}))}a(v).unbind("keydown")}return o},restoreRow:function(b,e){return this.each(function(){var c=this,f,g,
348
+ a.jgrid.htmlEncode(q[l])}});if(r[0]===false){try{var B=a.jgrid.findPos(a("#"+a.jgrid.jqID(b),m.grid.bDiv)[0]);a.jgrid.info_dialog(a.jgrid.errors.errcap,r[1],a.jgrid.edit.bClose,{left:B[0],top:B[1]})}catch(G){alert(r[1])}return n}if(q){d=m.p.prmNames;o=d.oper;B=d.id;q[o]=d.editoper;q[B]=b;if(typeof m.p.inlineData=="undefined")m.p.inlineData={};q=a.extend({},q,m.p.inlineData,k.extraparam)}if(k.url=="clientArray"){q=a.extend({},q,s);m.p.autoencode&&a.each(q,function(x,C){q[x]=a.jgrid.htmlDecode(C)});
349
+ B=a(m).jqGrid("setRowData",b,q);a(t).attr("editable","0");for(d=0;d<m.p.savedRow.length;d++)if(m.p.savedRow[d].id==b){p=d;break}p>=0&&m.p.savedRow.splice(p,1);a.isFunction(k.aftersavefunc)&&k.aftersavefunc.call(m,b,B);n=true}else{a("#lui_"+m.p.id).show();if(m.p.restful){mtype="PUT";k.url=k.url+"/"+b}else mtype="POST";a.ajax(a.extend({url:k.url,data:a.isFunction(m.p.serializeRowData)?m.p.serializeRowData.call(m,q):q,type:mtype,async:false,complete:function(x,C){a("#lui_"+m.p.id).hide();if(C==="success")if((a.isFunction(k.succesfunc)?
350
+ k.succesfunc.call(m,x):true)===true){m.p.autoencode&&a.each(q,function(z,M){q[z]=a.jgrid.htmlDecode(M)});q=a.extend({},q,s);a(m).jqGrid("setRowData",b,q);a(t).attr("editable","0");for(var A=0;A<m.p.savedRow.length;A++)if(m.p.savedRow[A].id==b){p=A;break}p>=0&&m.p.savedRow.splice(p,1);a.isFunction(k.aftersavefunc)&&k.aftersavefunc.call(m,b,x);n=true}else{a.isFunction(k.errorfunc)&&k.errorfunc.call(m,b,x,C);k.restoreAfterError===true&&a(m).jqGrid("restoreRow",b,k.afterrestorefunc)}},error:function(x,
351
+ C){a("#lui_"+m.p.id).hide();if(a.isFunction(k.errorfunc))k.errorfunc.call(m,b,x,C);else try{jQuery.jgrid.info_dialog(jQuery.jgrid.errors.errcap,'<div class="ui-state-error">'+x.responseText+"</div>",jQuery.jgrid.edit.bClose,{buttonalign:"right"})}catch(A){alert(x.responseText)}k.restoreAfterError===true&&a(m).jqGrid("restoreRow",b,k.afterrestorefunc)}},a.jgrid.ajaxOptions,m.p.ajaxRowOptions||{}))}a(t).unbind("keydown")}return n},restoreRow:function(b,e){return this.each(function(){var c=this,f,g,
350
352
  j={};if(c.grid){g=a(c).jqGrid("getInd",b,true);if(g!==false){for(var h=0;h<c.p.savedRow.length;h++)if(c.p.savedRow[h].id==b){f=h;break}if(f>=0){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+a.jgrid.jqID(g.id)).datepicker("hide")}catch(d){}a.each(c.p.colModel,function(){if(this.editable===true&&this.name in c.p.savedRow[f]&&!a(this).hasClass("not-editable-cell"))j[this.name]=c.p.savedRow[f][this.name]});a(c).jqGrid("setRowData",b,j);a(g).attr("editable","0").unbind("keydown");c.p.savedRow.splice(f,
351
353
  1)}a.isFunction(e)&&e.call(c,b)}}})}})})(jQuery);
352
354
  (function(a){a.jgrid.extend({editCell:function(b,e,c){return this.each(function(){var f=this,g,j,h;if(!(!f.grid||f.p.cellEdit!==true)){e=parseInt(e,10);f.p.selrow=f.rows[b].id;f.p.knv||a(f).jqGrid("GridNav");if(f.p.savedRow.length>0){if(c===true)if(b==f.p.iRow&&e==f.p.iCol)return;a(f).jqGrid("saveCell",f.p.savedRow[0].id,f.p.savedRow[0].ic)}else window.setTimeout(function(){a("#"+f.p.knv).attr("tabindex","-1").focus()},0);g=f.p.colModel[e].name;if(!(g=="subgrid"||g=="cb"||g=="rn")){h=a("td:eq("+e+
353
355
  ")",f.rows[b]);if(f.p.colModel[e].editable===true&&c===true&&!h.hasClass("not-editable-cell")){if(parseInt(f.p.iCol,10)>=0&&parseInt(f.p.iRow,10)>=0){a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight");a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover")}a(h).addClass("edit-cell ui-state-highlight");a(f.rows[b]).addClass("selected-row ui-state-hover");try{j=a.unformat(h,{rowId:f.rows[b].id,colModel:f.p.colModel[e]},e)}catch(d){j=a(h).html()}if(f.p.autoencode)j=
354
- a.jgrid.htmlDecode(j);if(!f.p.colModel[e].edittype)f.p.colModel[e].edittype="text";f.p.savedRow.push({id:b,ic:e,name:g,v:j});if(a.isFunction(f.p.formatCell)){var n=f.p.formatCell.call(f,f.rows[b].id,g,j,b,e);if(n!==undefined)j=n}n=a.extend({},f.p.colModel[e].editoptions||{},{id:b+"_"+g,name:g});var k=a.jgrid.createEl(f.p.colModel[e].edittype,n,j,true,a.extend({},a.jgrid.ajaxOptions,f.p.ajaxSelectOptions||{}));a.isFunction(f.p.beforeEditCell)&&f.p.beforeEditCell.call(f,f.rows[b].id,g,j,b,e);a(h).html("").append(k).attr("tabindex",
355
- "0");window.setTimeout(function(){a(k).focus()},0);a("input, select, textarea",h).bind("keydown",function(o){if(o.keyCode===27)if(a("input.hasDatepicker",h).length>0)a(".ui-datepicker").is(":hidden")?a(f).jqGrid("restoreCell",b,e):a("input.hasDatepicker",h).datepicker("hide");else a(f).jqGrid("restoreCell",b,e);o.keyCode===13&&a(f).jqGrid("saveCell",b,e);if(o.keyCode==9)if(f.grid.hDiv.loading)return false;else o.shiftKey?a(f).jqGrid("prevCell",b,e):a(f).jqGrid("nextCell",b,e);o.stopPropagation()});
356
+ a.jgrid.htmlDecode(j);if(!f.p.colModel[e].edittype)f.p.colModel[e].edittype="text";f.p.savedRow.push({id:b,ic:e,name:g,v:j});if(a.isFunction(f.p.formatCell)){var o=f.p.formatCell.call(f,f.rows[b].id,g,j,b,e);if(o!==undefined)j=o}o=a.extend({},f.p.colModel[e].editoptions||{},{id:b+"_"+g,name:g});var k=a.jgrid.createEl(f.p.colModel[e].edittype,o,j,true,a.extend({},a.jgrid.ajaxOptions,f.p.ajaxSelectOptions||{}));a.isFunction(f.p.beforeEditCell)&&f.p.beforeEditCell.call(f,f.rows[b].id,g,j,b,e);a(h).html("").append(k).attr("tabindex",
357
+ "0");window.setTimeout(function(){a(k).focus()},0);a("input, select, textarea",h).bind("keydown",function(n){if(n.keyCode===27)if(a("input.hasDatepicker",h).length>0)a(".ui-datepicker").is(":hidden")?a(f).jqGrid("restoreCell",b,e):a("input.hasDatepicker",h).datepicker("hide");else a(f).jqGrid("restoreCell",b,e);n.keyCode===13&&a(f).jqGrid("saveCell",b,e);if(n.keyCode==9)if(f.grid.hDiv.loading)return false;else n.shiftKey?a(f).jqGrid("prevCell",b,e):a(f).jqGrid("nextCell",b,e);n.stopPropagation()});
356
358
  a.isFunction(f.p.afterEditCell)&&f.p.afterEditCell.call(f,f.rows[b].id,g,j,b,e)}else{if(parseInt(f.p.iCol,10)>=0&&parseInt(f.p.iRow,10)>=0){a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight");a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover")}h.addClass("edit-cell ui-state-highlight");a(f.rows[b]).addClass("selected-row ui-state-hover");if(a.isFunction(f.p.onSelectCell)){j=h.html().replace(/\&#160\;/ig,"");f.p.onSelectCell.call(f,f.rows[b].id,g,j,b,e)}}f.p.iCol=
357
- e;f.p.iRow=b}}})},saveCell:function(b,e){return this.each(function(){var c=this,f;if(!(!c.grid||c.p.cellEdit!==true)){f=c.p.savedRow.length>=1?0:null;if(f!==null){var g=a("td:eq("+e+")",c.rows[b]),j,h,d=c.p.colModel[e],n=d.name,k=a.jgrid.jqID(n);switch(d.edittype){case "select":if(d.editoptions.multiple){k=a("#"+b+"_"+k,c.rows[b]);var o=[];if(j=a(k).val())j.join(",");else j="";a("option:selected",k).each(function(v,y){o[v]=a(y).text()});h=o.join(",")}else{j=a("#"+b+"_"+k+">option:selected",c.rows[b]).val();
359
+ e;f.p.iRow=b}}})},saveCell:function(b,e){return this.each(function(){var c=this,f;if(!(!c.grid||c.p.cellEdit!==true)){f=c.p.savedRow.length>=1?0:null;if(f!==null){var g=a("td:eq("+e+")",c.rows[b]),j,h,d=c.p.colModel[e],o=d.name,k=a.jgrid.jqID(o);switch(d.edittype){case "select":if(d.editoptions.multiple){k=a("#"+b+"_"+k,c.rows[b]);var n=[];if(j=a(k).val())j.join(",");else j="";a("option:selected",k).each(function(t,y){n[t]=a(y).text()});h=n.join(",")}else{j=a("#"+b+"_"+k+">option:selected",c.rows[b]).val();
358
360
  h=a("#"+b+"_"+k+">option:selected",c.rows[b]).text()}if(d.formatter)h=j;break;case "checkbox":var m=["Yes","No"];if(d.editoptions)m=d.editoptions.value.split(":");h=j=a("#"+b+"_"+k,c.rows[b]).attr("checked")?m[0]:m[1];break;case "password":case "text":case "textarea":case "button":h=j=a("#"+b+"_"+k,c.rows[b]).val();break;case "custom":try{if(d.editoptions&&a.isFunction(d.editoptions.custom_value)){j=d.editoptions.custom_value.call(c,a(".customelement",g),"get");if(j===undefined)throw"e2";else h=j}else throw"e1";
359
- }catch(l){l=="e1"&&a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);l=="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,l.message,jQuery.jgrid.edit.bClose)}}if(h!=c.p.savedRow[f].v){if(a.isFunction(c.p.beforeSaveCell))if(f=c.p.beforeSaveCell.call(c,c.rows[b].id,n,j,b,e))h=j=f;var q=a.jgrid.checkValues(j,
360
- e,c);if(q[0]===true){f={};if(a.isFunction(c.p.beforeSubmitCell))(f=c.p.beforeSubmitCell.call(c,c.rows[b].id,n,j,b,e))||(f={});a("input.hasDatepicker",g).length>0&&a("input.hasDatepicker",g).datepicker("hide");if(c.p.cellsubmit=="remote")if(c.p.cellurl){var s={};if(c.p.autoencode)j=a.jgrid.htmlEncode(j);s[n]=j;m=c.p.prmNames;d=m.id;k=m.oper;s[d]=c.rows[b].id;s[k]=m.editoper;s=a.extend(f,s);a("#lui_"+c.p.id).show();c.grid.hDiv.loading=true;a.ajax(a.extend({url:c.p.cellurl,data:a.isFunction(c.p.serializeCellData)?
361
- c.p.serializeCellData.call(c,s):s,type:"POST",complete:function(v,y){a("#lui_"+c.p.id).hide();c.grid.hDiv.loading=false;if(y=="success")if(a.isFunction(c.p.afterSubmitCell)){var D=c.p.afterSubmitCell.call(c,v,s.id,n,j,b,e);if(D[0]===true){a(g).empty();a(c).jqGrid("setCell",c.rows[b].id,e,h,false,false,true);a(g).addClass("dirty-cell");a(c.rows[b]).addClass("edited");a.isFunction(c.p.afterSaveCell)&&c.p.afterSaveCell.call(c,c.rows[b].id,n,j,b,e);c.p.savedRow.splice(0,1)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,
362
- D[1],a.jgrid.edit.bClose);a(c).jqGrid("restoreCell",b,e)}}else{a(g).empty();a(c).jqGrid("setCell",c.rows[b].id,e,h,false,false,true);a(g).addClass("dirty-cell");a(c.rows[b]).addClass("edited");a.isFunction(c.p.afterSaveCell)&&c.p.afterSaveCell.call(c,c.rows[b].id,n,j,b,e);c.p.savedRow.splice(0,1)}},error:function(v,y){a("#lui_"+c.p.id).hide();c.grid.hDiv.loading=false;a.isFunction(c.p.errorCell)?c.p.errorCell.call(c,v,y):a.jgrid.info_dialog(a.jgrid.errors.errcap,v.status+" : "+v.statusText+"<br/>"+
363
- y,a.jgrid.edit.bClose);a(c).jqGrid("restoreCell",b,e)}},a.jgrid.ajaxOptions,c.p.ajaxCellOptions||{}))}else try{a.jgrid.info_dialog(a.jgrid.errors.errcap,a.jgrid.errors.nourl,a.jgrid.edit.bClose);a(c).jqGrid("restoreCell",b,e)}catch(p){}if(c.p.cellsubmit=="clientArray"){a(g).empty();a(c).jqGrid("setCell",c.rows[b].id,e,h,false,false,true);a(g).addClass("dirty-cell");a(c.rows[b]).addClass("edited");a.isFunction(c.p.afterSaveCell)&&c.p.afterSaveCell.call(c,c.rows[b].id,n,j,b,e);c.p.savedRow.splice(0,
361
+ }catch(l){l=="e1"&&a.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);l=="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,l.message,jQuery.jgrid.edit.bClose)}}if(h!=c.p.savedRow[f].v){if(a.isFunction(c.p.beforeSaveCell))if(f=c.p.beforeSaveCell.call(c,c.rows[b].id,o,j,b,e))h=j=f;var q=a.jgrid.checkValues(j,
362
+ e,c);if(q[0]===true){f={};if(a.isFunction(c.p.beforeSubmitCell))(f=c.p.beforeSubmitCell.call(c,c.rows[b].id,o,j,b,e))||(f={});a("input.hasDatepicker",g).length>0&&a("input.hasDatepicker",g).datepicker("hide");if(c.p.cellsubmit=="remote")if(c.p.cellurl){var s={};if(c.p.autoencode)j=a.jgrid.htmlEncode(j);s[o]=j;m=c.p.prmNames;d=m.id;k=m.oper;s[d]=c.rows[b].id;s[k]=m.editoper;s=a.extend(f,s);a("#lui_"+c.p.id).show();c.grid.hDiv.loading=true;a.ajax(a.extend({url:c.p.cellurl,data:a.isFunction(c.p.serializeCellData)?
363
+ c.p.serializeCellData.call(c,s):s,type:"POST",complete:function(t,y){a("#lui_"+c.p.id).hide();c.grid.hDiv.loading=false;if(y=="success")if(a.isFunction(c.p.afterSubmitCell)){var B=c.p.afterSubmitCell.call(c,t,s.id,o,j,b,e);if(B[0]===true){a(g).empty();a(c).jqGrid("setCell",c.rows[b].id,e,h,false,false,true);a(g).addClass("dirty-cell");a(c.rows[b]).addClass("edited");a.isFunction(c.p.afterSaveCell)&&c.p.afterSaveCell.call(c,c.rows[b].id,o,j,b,e);c.p.savedRow.splice(0,1)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,
364
+ B[1],a.jgrid.edit.bClose);a(c).jqGrid("restoreCell",b,e)}}else{a(g).empty();a(c).jqGrid("setCell",c.rows[b].id,e,h,false,false,true);a(g).addClass("dirty-cell");a(c.rows[b]).addClass("edited");a.isFunction(c.p.afterSaveCell)&&c.p.afterSaveCell.call(c,c.rows[b].id,o,j,b,e);c.p.savedRow.splice(0,1)}},error:function(t,y){a("#lui_"+c.p.id).hide();c.grid.hDiv.loading=false;a.isFunction(c.p.errorCell)?c.p.errorCell.call(c,t,y):a.jgrid.info_dialog(a.jgrid.errors.errcap,t.status+" : "+t.statusText+"<br/>"+
365
+ y,a.jgrid.edit.bClose);a(c).jqGrid("restoreCell",b,e)}},a.jgrid.ajaxOptions,c.p.ajaxCellOptions||{}))}else try{a.jgrid.info_dialog(a.jgrid.errors.errcap,a.jgrid.errors.nourl,a.jgrid.edit.bClose);a(c).jqGrid("restoreCell",b,e)}catch(p){}if(c.p.cellsubmit=="clientArray"){a(g).empty();a(c).jqGrid("setCell",c.rows[b].id,e,h,false,false,true);a(g).addClass("dirty-cell");a(c.rows[b]).addClass("edited");a.isFunction(c.p.afterSaveCell)&&c.p.afterSaveCell.call(c,c.rows[b].id,o,j,b,e);c.p.savedRow.splice(0,
364
366
  1)}}else try{window.setTimeout(function(){a.jgrid.info_dialog(a.jgrid.errors.errcap,j+" "+q[1],a.jgrid.edit.bClose)},100);a(c).jqGrid("restoreCell",b,e)}catch(r){}}else a(c).jqGrid("restoreCell",b,e)}a.browser.opera?a("#"+c.p.knv).attr("tabindex","-1").focus():window.setTimeout(function(){a("#"+c.p.knv).attr("tabindex","-1").focus()},0)}})},restoreCell:function(b,e){return this.each(function(){var c=this,f;if(!(!c.grid||c.p.cellEdit!==true)){f=c.p.savedRow.length>=1?0:null;if(f!==null){var g=a("td:eq("+
365
367
  e+")",c.rows[b]);if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker",g).datepicker("hide")}catch(j){}a(g).empty().attr("tabindex","-1");a(c).jqGrid("setCell",c.rows[b].id,e,c.p.savedRow[f].v,false,false,true);a.isFunction(c.p.afterRestoreCell)&&c.p.afterRestoreCell.call(c,c.rows[b].id,c.p.savedRow[f].v,b,e);c.p.savedRow.splice(0,1)}window.setTimeout(function(){a("#"+c.p.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(b,e){return this.each(function(){var c=false;if(!(!this.grid||
366
368
  this.p.cellEdit!==true)){for(var f=e+1;f<this.p.colModel.length;f++)if(this.p.colModel[f].editable===true){c=f;break}if(c!==false)a(this).jqGrid("editCell",b,c,true);else this.p.savedRow.length>0&&a(this).jqGrid("saveCell",b,e)}})},prevCell:function(b,e){return this.each(function(){var c=false;if(!(!this.grid||this.p.cellEdit!==true)){for(var f=e-1;f>=0;f--)if(this.p.colModel[f].editable===true){c=f;break}if(c!==false)a(this).jqGrid("editCell",b,c,true);else this.p.savedRow.length>0&&a(this).jqGrid("saveCell",
367
- b,e)}})},GridNav:function(){return this.each(function(){function b(h,d,n){if(n.substr(0,1)=="v"){var k=a(c.grid.bDiv)[0].clientHeight,o=a(c.grid.bDiv)[0].scrollTop,m=c.rows[h].offsetTop+c.rows[h].clientHeight,l=c.rows[h].offsetTop;if(n=="vd")if(m>=k)a(c.grid.bDiv)[0].scrollTop=a(c.grid.bDiv)[0].scrollTop+c.rows[h].clientHeight;if(n=="vu")if(l<o)a(c.grid.bDiv)[0].scrollTop=a(c.grid.bDiv)[0].scrollTop-c.rows[h].clientHeight}if(n=="h"){n=a(c.grid.bDiv)[0].clientWidth;k=a(c.grid.bDiv)[0].scrollLeft;o=
368
- c.rows[h].cells[d].offsetLeft;if(c.rows[h].cells[d].offsetLeft+c.rows[h].cells[d].clientWidth>=n+parseInt(k,10))a(c.grid.bDiv)[0].scrollLeft=a(c.grid.bDiv)[0].scrollLeft+c.rows[h].cells[d].clientWidth;else if(o<k)a(c.grid.bDiv)[0].scrollLeft=a(c.grid.bDiv)[0].scrollLeft-c.rows[h].cells[d].clientWidth}}function e(h,d){var n,k;if(d=="lft"){n=h+1;for(k=h;k>=0;k--)if(c.p.colModel[k].hidden!==true){n=k;break}}if(d=="rgt"){n=h-1;for(k=h;k<c.p.colModel.length;k++)if(c.p.colModel[k].hidden!==true){n=k;break}}return n}
369
+ b,e)}})},GridNav:function(){return this.each(function(){function b(h,d,o){if(o.substr(0,1)=="v"){var k=a(c.grid.bDiv)[0].clientHeight,n=a(c.grid.bDiv)[0].scrollTop,m=c.rows[h].offsetTop+c.rows[h].clientHeight,l=c.rows[h].offsetTop;if(o=="vd")if(m>=k)a(c.grid.bDiv)[0].scrollTop=a(c.grid.bDiv)[0].scrollTop+c.rows[h].clientHeight;if(o=="vu")if(l<n)a(c.grid.bDiv)[0].scrollTop=a(c.grid.bDiv)[0].scrollTop-c.rows[h].clientHeight}if(o=="h"){o=a(c.grid.bDiv)[0].clientWidth;k=a(c.grid.bDiv)[0].scrollLeft;n=
370
+ c.rows[h].cells[d].offsetLeft;if(c.rows[h].cells[d].offsetLeft+c.rows[h].cells[d].clientWidth>=o+parseInt(k,10))a(c.grid.bDiv)[0].scrollLeft=a(c.grid.bDiv)[0].scrollLeft+c.rows[h].cells[d].clientWidth;else if(n<k)a(c.grid.bDiv)[0].scrollLeft=a(c.grid.bDiv)[0].scrollLeft-c.rows[h].cells[d].clientWidth}}function e(h,d){var o,k;if(d=="lft"){o=h+1;for(k=h;k>=0;k--)if(c.p.colModel[k].hidden!==true){o=k;break}}if(d=="rgt"){o=h-1;for(k=h;k<c.p.colModel.length;k++)if(c.p.colModel[k].hidden!==true){o=k;break}}return o}
369
371
  var c=this;if(!(!c.grid||c.p.cellEdit!==true)){c.p.knv=c.p.id+"_kn";var f=a("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span tabindex='-1' style='width:0px;height:0px;background-color:grey' id='"+c.p.knv+"'></span></span>"),g,j;a(f).insertBefore(c.grid.cDiv);a("#"+c.p.knv).focus().keydown(function(h){j=h.keyCode;if(c.p.direction=="rtl")if(j==37)j=39;else if(j==39)j=37;switch(j){case 38:if(c.p.iRow-1>0){b(c.p.iRow-1,c.p.iCol,"vu");a(c).jqGrid("editCell",c.p.iRow-1,c.p.iCol,
370
372
  false)}break;case 40:if(c.p.iRow+1<=c.rows.length-1){b(c.p.iRow+1,c.p.iCol,"vd");a(c).jqGrid("editCell",c.p.iRow+1,c.p.iCol,false)}break;case 37:if(c.p.iCol-1>=0){g=e(c.p.iCol-1,"lft");b(c.p.iRow,g,"h");a(c).jqGrid("editCell",c.p.iRow,g,false)}break;case 39:if(c.p.iCol+1<=c.p.colModel.length-1){g=e(c.p.iCol+1,"rgt");b(c.p.iRow,g,"h");a(c).jqGrid("editCell",c.p.iRow,g,false)}break;case 13:parseInt(c.p.iCol,10)>=0&&parseInt(c.p.iRow,10)>=0&&a(c).jqGrid("editCell",c.p.iRow,c.p.iCol,true)}return false})}})},
371
373
  getChangedCells:function(b){var e=[];b||(b="all");this.each(function(){var c=this,f;!c.grid||c.p.cellEdit!==true||a(c.rows).each(function(g){var j={};if(a(this).hasClass("edited")){a("td",this).each(function(h){f=c.p.colModel[h].name;if(f!=="cb"&&f!=="subgrid")if(b=="dirty"){if(a(this).hasClass("dirty-cell"))try{j[f]=a.unformat(this,{rowId:c.rows[g].id,colModel:c.p.colModel[h]},h)}catch(d){j[f]=a.jgrid.htmlDecode(a(this).html())}}else try{j[f]=a.unformat(this,{rowId:c.rows[g].id,colModel:c.p.colModel[h]},
372
- h)}catch(n){j[f]=a.jgrid.htmlDecode(a(this).html())}});j.id=this.id;e.push(j)}})});return e}})})(jQuery);
374
+ h)}catch(o){j[f]=a.jgrid.htmlDecode(a(this).html())}});j.id=this.id;e.push(j)}})});return e}})})(jQuery);
373
375
  (function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var b;this.p.subGridOptions=a.extend({plusicon:"ui-icon-plus",minusicon:"ui-icon-minus",openicon:"ui-icon-carat-1-sw",expandOnLoad:false,delayOnLoad:50,selectOnExpand:false,reloadOnExpand:true},this.p.subGridOptions||{});this.p.colNames.unshift("");this.p.colModel.unshift({name:"subgrid",width:a.browser.safari?this.p.subGridWidth+this.p.cellLayout:this.p.subGridWidth,sortable:false,resizable:false,hidedlg:true,search:false,
374
376
  fixed:true});b=this.p.subGridModel;if(b[0]){b[0].align=a.extend([],b[0].align||[]);for(var e=0;e<b[0].name.length;e++)b[0].align[e]=b[0].align[e]||"left"}})},addSubGridCell:function(b,e){var c="",f,g;this.each(function(){c=this.formatCol(b,e);g=this.p.id;f=this.p.subGridOptions.plusicon});return'<td role="grid" aria-describedby="'+g+'_subgrid" class="ui-sgcollapsed sgcollapsed" '+c+"><a href='javascript:void(0);'><span class='ui-icon "+f+"'></span></a></td>"},addSubGrid:function(b){return this.each(function(){var e=
375
- this;if(e.grid){var c=function(l,q,s){q=a("<td align='"+e.p.subGridModel[0].align[s]+"'></td>").html(q);a(l).append(q)},f=function(l,q){var s,p,r,v=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),y=a("<tr></tr>");for(p=0;p<e.p.subGridModel[0].name.length;p++){s=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+e.p.direction+"'></th>");a(s).html(e.p.subGridModel[0].name[p]);a(s).width(e.p.subGridModel[0].width[p]);a(y).append(s)}a(v).append(y);if(l){r=
376
- e.p.xmlReader.subgrid;a(r.root+" "+r.row,l).each(function(){y=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(r.repeatitems===true)a(r.cell,this).each(function(G){c(y,a(this).text()||"&#160;",G)});else{var D=e.p.subGridModel[0].mapping||e.p.subGridModel[0].name;if(D)for(p=0;p<D.length;p++)c(y,a(D[p],this).text()||"&#160;",p)}a(v).append(y)})}s=a("table:first",e.grid.bDiv).attr("id")+"_";a("#"+s+q).append(v);e.grid.hDiv.loading=false;a("#load_"+e.p.id).hide();return false},g=function(l,q){var s,
377
- p,r,v,y,D=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),G=a("<tr></tr>");for(p=0;p<e.p.subGridModel[0].name.length;p++){s=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+e.p.direction+"'></th>");a(s).html(e.p.subGridModel[0].name[p]);a(s).width(e.p.subGridModel[0].width[p]);a(G).append(s)}a(D).append(G);if(l){v=e.p.jsonReader.subgrid;s=l[v.root];if(typeof s!=="undefined")for(p=0;p<s.length;p++){r=s[p];G=a("<tr class='ui-widget-content ui-subtblcell'></tr>");
378
- if(v.repeatitems===true){if(v.cell)r=r[v.cell];for(y=0;y<r.length;y++)c(G,r[y]||"&#160;",y)}else{var x=e.p.subGridModel[0].mapping||e.p.subGridModel[0].name;if(x.length)for(y=0;y<x.length;y++)c(G,r[x[y]]||"&#160;",y)}a(D).append(G)}}p=a("table:first",e.grid.bDiv).attr("id")+"_";a("#"+p+q).append(D);e.grid.hDiv.loading=false;a("#load_"+e.p.id).hide();return false},j=function(l){var q,s,p,r;q=a(l).attr("id");s={nd_:(new Date).getTime()};s[e.p.prmNames.subgridid]=q;if(!e.p.subGridModel[0])return false;
377
+ this;if(e.grid){var c=function(l,q,s){q=a("<td align='"+e.p.subGridModel[0].align[s]+"'></td>").html(q);a(l).append(q)},f=function(l,q){var s,p,r,t=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),y=a("<tr></tr>");for(p=0;p<e.p.subGridModel[0].name.length;p++){s=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+e.p.direction+"'></th>");a(s).html(e.p.subGridModel[0].name[p]);a(s).width(e.p.subGridModel[0].width[p]);a(y).append(s)}a(t).append(y);if(l){r=
378
+ e.p.xmlReader.subgrid;a(r.root+" "+r.row,l).each(function(){y=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(r.repeatitems===true)a(r.cell,this).each(function(G){c(y,a(this).text()||"&#160;",G)});else{var B=e.p.subGridModel[0].mapping||e.p.subGridModel[0].name;if(B)for(p=0;p<B.length;p++)c(y,a(B[p],this).text()||"&#160;",p)}a(t).append(y)})}s=a("table:first",e.grid.bDiv).attr("id")+"_";a("#"+s+q).append(t);e.grid.hDiv.loading=false;a("#load_"+e.p.id).hide();return false},g=function(l,q){var s,
379
+ p,r,t,y,B=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),G=a("<tr></tr>");for(p=0;p<e.p.subGridModel[0].name.length;p++){s=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+e.p.direction+"'></th>");a(s).html(e.p.subGridModel[0].name[p]);a(s).width(e.p.subGridModel[0].width[p]);a(G).append(s)}a(B).append(G);if(l){t=e.p.jsonReader.subgrid;s=l[t.root];if(typeof s!=="undefined")for(p=0;p<s.length;p++){r=s[p];G=a("<tr class='ui-widget-content ui-subtblcell'></tr>");
380
+ if(t.repeatitems===true){if(t.cell)r=r[t.cell];for(y=0;y<r.length;y++)c(G,r[y]||"&#160;",y)}else{var x=e.p.subGridModel[0].mapping||e.p.subGridModel[0].name;if(x.length)for(y=0;y<x.length;y++)c(G,r[x[y]]||"&#160;",y)}a(B).append(G)}}p=a("table:first",e.grid.bDiv).attr("id")+"_";a("#"+p+q).append(B);e.grid.hDiv.loading=false;a("#load_"+e.p.id).hide();return false},j=function(l){var q,s,p,r;q=a(l).attr("id");s={nd_:(new Date).getTime()};s[e.p.prmNames.subgridid]=q;if(!e.p.subGridModel[0])return false;
379
381
  if(e.p.subGridModel[0].params)for(r=0;r<e.p.subGridModel[0].params.length;r++)for(p=0;p<e.p.colModel.length;p++)if(e.p.colModel[p].name==e.p.subGridModel[0].params[r])s[e.p.colModel[p].name]=a("td:eq("+p+")",l).text().replace(/\&#160\;/ig,"");if(!e.grid.hDiv.loading){e.grid.hDiv.loading=true;a("#load_"+e.p.id).show();if(!e.p.subgridtype)e.p.subgridtype=e.p.datatype;if(a.isFunction(e.p.subgridtype))e.p.subgridtype.call(e,s);else e.p.subgridtype=e.p.subgridtype.toLowerCase();switch(e.p.subgridtype){case "xml":case "json":a.ajax(a.extend({type:e.p.mtype,
380
- url:e.p.subGridUrl,dataType:e.p.subgridtype,data:a.isFunction(e.p.serializeSubGridData)?e.p.serializeSubGridData.call(e,s):s,complete:function(v){e.p.subgridtype=="xml"?f(v.responseXML,q):g(a.jgrid.parse(v.responseText),q)}},a.jgrid.ajaxOptions,e.p.ajaxSubgridOptions||{}))}}return false},h,d,n,k=0,o,m;a.each(e.p.colModel,function(){if(this.hidden===true||this.name=="rn"||this.name=="cb")k++});a(e.rows).each(function(l){var q=this;if(a(q).hasClass("jqgrow")){a(this.cells[b]).bind("click",function(){m=
381
- q.nextSibling;if(a(this).hasClass("sgcollapsed")){d=e.p.id;h=q.id;if(e.p.subGridOptions.reloadOnExpand===true||e.p.subGridOptions.reloadOnExpand===false&&!a(m).hasClass("ui-subgrid")){n=b>=1?"<td colspan='"+b+"'>&#160;</td>":"";o=true;if(a.isFunction(e.p.subGridBeforeExpand))o=e.p.subGridBeforeExpand.call(e,d+"_"+h,h);if(o===false)return false;a(q).after("<tr role='row' class='ui-subgrid'>"+n+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+e.p.subGridOptions.openicon+"'></span></td><td colspan='"+
382
- parseInt(e.p.colNames.length-1-k,10)+"' class='ui-widget-content subgrid-data'><div id="+d+"_"+h+" class='tablediv'></div></td></tr>");a.isFunction(e.p.subGridRowExpanded)?e.p.subGridRowExpanded.call(e,d+"_"+h,h):j(q)}else a(m).show();a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+e.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");e.p.subGridOptions.selectOnExpand&&a(e).jqGrid("setSelection",h)}else if(a(this).hasClass("sgexpanded")){o=
383
- true;if(a.isFunction(e.p.subGridRowColapsed)){h=q.id;o=e.p.subGridRowColapsed.call(e,d+"_"+h,h)}if(o===false)return false;if(e.p.subGridOptions.reloadOnExpand===true)a(m).remove(".ui-subgrid");else a(m).hasClass("ui-subgrid")&&a(m).hide();a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+e.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}return false});e.p.subGridOptions.expandOnLoad===true&&setTimeout(function(){a(q.cells[b]).trigger("click")},
382
+ url:e.p.subGridUrl,dataType:e.p.subgridtype,data:a.isFunction(e.p.serializeSubGridData)?e.p.serializeSubGridData.call(e,s):s,complete:function(t){e.p.subgridtype=="xml"?f(t.responseXML,q):g(a.jgrid.parse(t.responseText),q)}},a.jgrid.ajaxOptions,e.p.ajaxSubgridOptions||{}))}}return false},h,d,o,k=0,n,m;a.each(e.p.colModel,function(){if(this.hidden===true||this.name=="rn"||this.name=="cb")k++});a(e.rows).each(function(l){var q=this;if(a(q).hasClass("jqgrow")){a(this.cells[b]).bind("click",function(){m=
383
+ q.nextSibling;if(a(this).hasClass("sgcollapsed")){d=e.p.id;h=q.id;if(e.p.subGridOptions.reloadOnExpand===true||e.p.subGridOptions.reloadOnExpand===false&&!a(m).hasClass("ui-subgrid")){o=b>=1?"<td colspan='"+b+"'>&#160;</td>":"";n=true;if(a.isFunction(e.p.subGridBeforeExpand))n=e.p.subGridBeforeExpand.call(e,d+"_"+h,h);if(n===false)return false;a(q).after("<tr role='row' class='ui-subgrid'>"+o+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+e.p.subGridOptions.openicon+"'></span></td><td colspan='"+
384
+ parseInt(e.p.colNames.length-1-k,10)+"' class='ui-widget-content subgrid-data'><div id="+d+"_"+h+" class='tablediv'></div></td></tr>");a.isFunction(e.p.subGridRowExpanded)?e.p.subGridRowExpanded.call(e,d+"_"+h,h):j(q)}else a(m).show();a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+e.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");e.p.subGridOptions.selectOnExpand&&a(e).jqGrid("setSelection",h)}else if(a(this).hasClass("sgexpanded")){n=
385
+ true;if(a.isFunction(e.p.subGridRowColapsed)){h=q.id;n=e.p.subGridRowColapsed.call(e,d+"_"+h,h)}if(n===false)return false;if(e.p.subGridOptions.reloadOnExpand===true)a(m).remove(".ui-subgrid");else a(m).hasClass("ui-subgrid")&&a(m).hide();a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+e.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}return false});e.p.subGridOptions.expandOnLoad===true&&setTimeout(function(){a(q.cells[b]).trigger("click")},
384
386
  l*e.p.subGridOptions.delayOnLoad)}});e.subGridXml=function(l,q){f(l,q)};e.subGridJson=function(l,q){g(l,q)}}})},expandSubGridRow:function(b){return this.each(function(){if(this.grid||b)if(this.p.subGrid===true){var e=a(this).jqGrid("getInd",b,true);if(e)(e=a("td.sgcollapsed",e)[0])&&a(e).trigger("click")}})},collapseSubGridRow:function(b){return this.each(function(){if(this.grid||b)if(this.p.subGrid===true){var e=a(this).jqGrid("getInd",b,true);if(e)(e=a("td.sgexpanded",e)[0])&&a(e).trigger("click")}})},
385
387
  toggleSubGridRow:function(b){return this.each(function(){if(this.grid||b)if(this.p.subGrid===true){var e=a(this).jqGrid("getInd",b,true);if(e){var c=a("td.sgcollapsed",e)[0];if(c)a(c).trigger("click");else(c=a("td.sgexpanded",e)[0])&&a(c).trigger("click")}}})}})})(jQuery);
386
- (function(a){a.jgrid.extend({setTreeNode:function(b,e){return this.each(function(){var c=this;if(c.grid&&c.p.treeGrid)for(var f=c.p.expColInd,g=c.p.treeReader.expanded_field,j=c.p.treeReader.leaf_field,h=c.p.treeReader.level_field,d=c.p.treeReader.icon_field,n=c.p.treeReader.loaded,k,o,m,l;b<e;){l=c.p.data[c.p._index[c.rows[b].id]];if(c.p.treeGridModel=="nested"){k=parseInt(l[c.p.treeReader.left_field],10);o=parseInt(l[c.p.treeReader.right_field],10);l[j]||(l[j]=o===k+1?"true":"false")}k=parseInt(l[h],
387
- 10);if(c.p.tree_root_level===0){m=k+1;o=k}else{m=k;o=k-1}m="<div class='tree-wrap tree-wrap-"+c.p.direction+"' style='width:"+m*18+"px;'>";m+="<div style='"+(c.p.direction=="rtl"?"right:":"left:")+o*18+"px;' class='ui-icon ";if(l[n]!==undefined)l[n]=l[n]=="true"||l[n]===true?true:false;if(l[j]=="true"||l[j]===true){m+=(l[d]!==undefined&&l[d]!==""?l[d]:c.p.treeIcons.leaf)+" tree-leaf treeclick'";l[j]=true;o="leaf"}else{l[j]=false;o=""}l[g]=(l[g]=="true"||l[g]===true?true:false)&&l[n];m+=l[g]===true?
388
- c.p.treeIcons.minus+" tree-minus treeclick'":c.p.treeIcons.plus+" tree-plus treeclick'";m+="</div></div>";a(c.rows[b].cells[f]).wrapInner("<span class='cell-wrapper"+o+"'></span>").prepend(m);if(k!==parseInt(c.p.tree_root_level,10))(l=(l=a(c).jqGrid("getNodeParent",l))&&l.hasOwnProperty(g)?l[g]:true)||a(c.rows[b]).css("display","none");a(c.rows[b].cells[f]).find("div.treeclick").bind("click",function(q){q=a(q.target||q.srcElement,c.rows).closest("tr.jqgrow")[0].id;q=c.p._index[q];if(!c.p.data[q][j])if(c.p.data[q][g]){a(c).jqGrid("collapseRow",
389
- c.p.data[q]);a(c).jqGrid("collapseNode",c.p.data[q])}else{a(c).jqGrid("expandRow",c.p.data[q]);a(c).jqGrid("expandNode",c.p.data[q])}return false});c.p.ExpandColClick===true&&a(c.rows[b].cells[f]).find("span.cell-wrapper").css("cursor","pointer").bind("click",function(q){q=a(q.target||q.srcElement,c.rows).closest("tr.jqgrow")[0].id;var s=c.p._index[q];if(!c.p.data[s][j])if(c.p.data[s][g]){a(c).jqGrid("collapseRow",c.p.data[s]);a(c).jqGrid("collapseNode",c.p.data[s])}else{a(c).jqGrid("expandRow",c.p.data[s]);
390
- a(c).jqGrid("expandNode",c.p.data[s])}a(c).jqGrid("setSelection",q);return false});b++}})},setTreeGrid:function(){return this.each(function(){var b=this,e=0,c=false,f,g,j=[];if(b.p.treeGrid){b.p.treedatatype||a.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.gridview=true;b.p.multiselect=false;b.p.rowList=[];b.p.expColInd=0;b.p.treeIcons=a.extend({plus:"ui-icon-triangle-1-"+(b.p.direction=="rtl"?"w":"e"),minus:"ui-icon-triangle-1-s",
391
- leaf:"ui-icon-radio-off"},b.p.treeIcons||{});if(b.p.treeGridModel=="nested")b.p.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},b.p.treeReader);else if(b.p.treeGridModel=="adjacency")b.p.treeReader=a.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},b.p.treeReader);for(g in b.p.colModel)if(b.p.colModel.hasOwnProperty(g)){f=
392
- b.p.colModel[g].name;if(f==b.p.ExpandColumn&&!c){c=true;b.p.expColInd=e}e++;for(var h in b.p.treeReader)b.p.treeReader[h]==f&&j.push(f)}a.each(b.p.treeReader,function(d,n){if(n&&a.inArray(n,j)===-1){b.p.colNames.push(n);b.p.colModel.push({name:n,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})}})},expandRow:function(b){this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var c=a(e).jqGrid("getNodeChildren",b),f=e.p.treeReader.expanded_field;a(c).each(function(){var g=
393
- a.jgrid.getAccessor(this,e.p.localReader.id);a("#"+g,e.grid.bDiv).css("display","");this[f]&&a(e).jqGrid("expandRow",this)})}})},collapseRow:function(b){this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var c=a(e).jqGrid("getNodeChildren",b),f=e.p.treeReader.expanded_field;a(c).each(function(){var g=a.jgrid.getAccessor(this,e.p.localReader.id);a("#"+g,e.grid.bDiv).css("display","none");this[f]&&a(e).jqGrid("collapseRow",this)})}})},getRootNodes:function(){var b=[];this.each(function(){var e=
394
- this;if(e.grid&&e.p.treeGrid)switch(e.p.treeGridModel){case "nested":var c=e.p.treeReader.level_field;a(e.p.data).each(function(){parseInt(this[c],10)===parseInt(e.p.tree_root_level,10)&&b.push(this)});break;case "adjacency":var f=e.p.treeReader.parent_id_field;a(e.p.data).each(function(){if(this[f]===null||String(this[f]).toLowerCase()=="null")b.push(this)})}});return b},getNodeDepth:function(b){var e=null;this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":e=
395
- parseInt(b[this.p.treeReader.level_field],10)-parseInt(this.p.tree_root_level,10);break;case "adjacency":e=a(this).jqGrid("getNodeAncestors",b).length}});return e},getNodeParent:function(b){var e=null;this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var c=this.p.treeReader.left_field,f=this.p.treeReader.right_field,g=this.p.treeReader.level_field,j=parseInt(b[c],10),h=parseInt(b[f],10),d=parseInt(b[g],10);a(this.p.data).each(function(){if(parseInt(this[g],
396
- 10)===d-1&&parseInt(this[c],10)<j&&parseInt(this[f],10)>h){e=this;return false}});break;case "adjacency":var n=this.p.treeReader.parent_id_field,k=this.p.localReader.id;a(this.p.data).each(function(){if(this[k]==b[n]){e=this;return false}})}});return e},getNodeChildren:function(b){var e=[];this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var c=this.p.treeReader.left_field,f=this.p.treeReader.right_field,g=this.p.treeReader.level_field,j=parseInt(b[c],10),
397
- h=parseInt(b[f],10),d=parseInt(b[g],10);a(this.p.data).each(function(){parseInt(this[g],10)===d+1&&parseInt(this[c],10)>j&&parseInt(this[f],10)<h&&e.push(this)});break;case "adjacency":var n=this.p.treeReader.parent_id_field,k=this.p.localReader.id;a(this.p.data).each(function(){this[n]==b[k]&&e.push(this)})}});return e},getFullTreeNode:function(b){var e=[];this.each(function(){var c;if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var f=this.p.treeReader.left_field,g=this.p.treeReader.right_field,
398
- j=this.p.treeReader.level_field,h=parseInt(b[f],10),d=parseInt(b[g],10),n=parseInt(b[j],10);a(this.p.data).each(function(){parseInt(this[j],10)>=n&&parseInt(this[f],10)>=h&&parseInt(this[f],10)<=d&&e.push(this)});break;case "adjacency":if(b){e.push(b);var k=this.p.treeReader.parent_id_field,o=this.p.localReader.id;a(this.p.data).each(function(m){c=e.length;for(m=0;m<c;m++)if(e[m][o]==this[k]){e.push(this);break}})}}});return e},getNodeAncestors:function(b){var e=[];this.each(function(){if(this.grid&&
399
- this.p.treeGrid)for(var c=a(this).jqGrid("getNodeParent",b);c;){e.push(c);c=a(this).jqGrid("getNodeParent",c)}});return e},isVisibleNode:function(b){var e=true;this.each(function(){if(this.grid&&this.p.treeGrid){var c=a(this).jqGrid("getNodeAncestors",b),f=this.p.treeReader.expanded_field;a(c).each(function(){e=e&&this[f];if(!e)return false})}});return e},isNodeLoaded:function(b){var e;this.each(function(){if(this.grid&&this.p.treeGrid){var c=this.p.treeReader.leaf_field;e=b!==undefined?b.loaded!==
400
- undefined?b.loaded:b[c]||a(this).jqGrid("getNodeChildren",b).length>0?true:false:false}});return e},expandNode:function(b){return this.each(function(){if(this.grid&&this.p.treeGrid){var e=this.p.treeReader.expanded_field,c=this.p.treeReader.parent_id_field,f=this.p.treeReader.loaded,g=this.p.treeReader.level_field,j=this.p.treeReader.left_field,h=this.p.treeReader.right_field;if(!b[e]){var d=a.jgrid.getAccessor(b,this.p.localReader.id),n=a("#"+d,this.grid.bDiv)[0],k=this.p._index[d];if(a(this).jqGrid("isNodeLoaded",
401
- this.p.data[k])){b[e]=true;a("div.treeclick",n).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{b[e]=true;a("div.treeclick",n).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=n.rowIndex;this.p.datatype=this.p.treedatatype;this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:d,n_left:b[j],n_right:b[h],n_level:b[g]}}):a(this).jqGrid("setGridParam",{postData:{nodeid:d,
402
- parentid:b[c],n_level:b[g]}});a(this).trigger("reloadGrid");b[f]=true;this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}}):a(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 e=a.jgrid.getAccessor(b,this.p.localReader.id);e=a("#"+e,this.grid.bDiv)[0];a("div.treeclick",e).removeClass(this.p.treeIcons.minus+
403
- " tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(b,e,c,f){return this.each(function(){if(this.grid&&this.p.treeGrid){var g,j,h,d=[],n=this,k;g=a(this).jqGrid("getRootNodes");g=a.jgrid.from(g);g.orderBy(b,e,c,f);k=g.select();g=0;for(j=k.length;g<j;g++){h=k[g];d.push(h);a(this).jqGrid("collectChildrenSortTree",d,h,b,e,c,f)}a.each(d,function(o){var m=a.jgrid.getAccessor(this,n.p.localReader.id);a("#"+n.p.id+" tbody tr:eq("+o+")").after(a("tr#"+m,n.grid.bDiv))});d=k=g=
404
- null}})},collectChildrenSortTree:function(b,e,c,f,g,j){return this.each(function(){if(this.grid&&this.p.treeGrid){var h,d,n,k;h=a(this).jqGrid("getNodeChildren",e);h=a.jgrid.from(h);h.orderBy(c,f,g,j);k=h.select();h=0;for(d=k.length;h<d;h++){n=k[h];b.push(n);a(this).jqGrid("collectChildrenSortTree",b,n,c,f,g,j)}}})},setTreeRow:function(b,e){var c=false;this.each(function(){if(this.grid&&this.p.treeGrid)c=a(this).jqGrid("setRowData",b,e)});return c},delTreeNode:function(b){return this.each(function(){var e=
405
- this.p.localReader.id,c=this.p.treeReader.left_field,f=this.p.treeReader.right_field,g,j,h;if(this.grid&&this.p.treeGrid){var d=this.p._index[b];if(d!==undefined){g=parseInt(this.p.data[d][f],10);j=g-parseInt(this.p.data[d][c],10)+1;d=a(this).jqGrid("getFullTreeNode",this.p.data[d]);if(d.length>0)for(var n=0;n<d.length;n++)a(this).jqGrid("delRowData",d[n][e]);if(this.p.treeGridModel==="nested"){e=a.jgrid.from(this.p.data).greater(c,g,{stype:"integer"}).select();if(e.length)for(h in e)e[h][c]=parseInt(e[h][c],
406
- 10)-j;e=a.jgrid.from(this.p.data).greater(f,g,{stype:"integer"}).select();if(e.length)for(h in e)e[h][f]=parseInt(e[h][f],10)-j}}}})},addChildNode:function(b,e,c){var f=this[0];if(c){var g=f.p.treeReader.expanded_field,j=f.p.treeReader.leaf_field,h=f.p.treeReader.level_field,d=f.p.treeReader.parent_id_field,n=f.p.treeReader.left_field,k=f.p.treeReader.right_field,o=f.p.treeReader.loaded,m,l,q,s,p;m=0;var r=e,v;if(!b){p=f.p.data.length-1;if(p>=0)for(;p>=0;){m=Math.max(m,parseInt(f.p.data[p][f.p.localReader.id],
407
- 10));p--}b=m+1}var y=a(f).jqGrid("getInd",e);v=false;if(e===undefined||e===null||e===""){r=e=null;m="last";s=f.p.tree_root_level;p=f.p.data.length+1}else{m="after";l=f.p._index[e];q=f.p.data[l];e=q[f.p.localReader.id];s=parseInt(q[h],10)+1;p=a(f).jqGrid("getFullTreeNode",q);if(p.length){r=p=p[p.length-1][f.p.localReader.id];p=a(f).jqGrid("getInd",r)+1}else p=a(f).jqGrid("getInd",e)+1;if(q[j]){v=true;q[g]=true;a(f.rows[y]).find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper").end().find("div.tree-leaf").removeClass(f.p.treeIcons.leaf+
408
- " tree-leaf").addClass(f.p.treeIcons.minus+" tree-minus");f.p.data[l][j]=false;q[o]=true}}l=p+1;c[g]=false;c[o]=true;c[h]=s;c[j]=true;if(f.p.treeGridModel==="adjacency")c[d]=e;if(f.p.treeGridModel==="nested"){var D;if(e!==null){j=parseInt(q[k],10);h=a.jgrid.from(f.p.data);h=h.greaterOrEquals(k,j,{stype:"integer"});h=h.select();if(h.length)for(D in h){h[D][n]=h[D][n]>j?parseInt(h[D][n],10)+2:h[D][n];h[D][k]=h[D][k]>=j?parseInt(h[D][k],10)+2:h[D][k]}c[n]=j;c[k]=j+1}else{j=parseInt(a(f).jqGrid("getCol",
409
- k,false,"max"),10);h=a.jgrid.from(f.p.data).greater(n,j,{stype:"integer"}).select();if(h.length)for(D in h)h[D][n]=parseInt(h[D][n],10)+2;h=a.jgrid.from(f.p.data).greater(k,j,{stype:"integer"}).select();if(h.length)for(D in h)h[D][k]=parseInt(h[D][k],10)+2;c[n]=j+1;c[k]=j+2}}if(e===null||a(f).jqGrid("isNodeLoaded",q)||v){a(f).jqGrid("addRowData",b,c,m,r);a(f).jqGrid("setTreeNode",p,l)}q&&!q[g]&&a(f.rows[y]).find("div.treeclick").click()}}})})(jQuery);
410
- (function(a){a.jgrid.extend({groupingSetup:function(){return this.each(function(){var b=this.p.groupingView;if(b!==null&&(typeof b==="object"||a.isFunction(b)))if(b.groupField.length){for(var e=0;e<b.groupField.length;e++){b.groupOrder[e]||(b.groupOrder[e]="asc");b.groupText[e]||(b.groupText[e]="{0}");if(typeof b.groupColumnShow[e]!="boolean")b.groupColumnShow[e]=true;if(typeof b.groupSummary[e]!="boolean")b.groupSummary[e]=false;b.groupColumnShow[e]===true?a(this).jqGrid("showCol",b.groupField[e]):
411
- a(this).jqGrid("hideCol",b.groupField[e]);b.sortitems[e]=[];b.sortnames[e]=[];b.summaryval[e]=[];if(b.groupSummary[e]){b.summary[e]=[];for(var c=this.p.colModel,f=0,g=c.length;f<g;f++)c[f].summaryType&&b.summary[e].push({nm:c[f].name,st:c[f].summaryType,v:""})}}this.p.scroll=false;this.p.rownumbers=false;this.p.subGrid=false;this.p.treeGrid=false;this.p.gridview=true}else this.p.grouping=false;else this.p.grouping=false})},groupingPrepare:function(b,e,c,f){this.each(function(){e[0]+="";var g=e[0].toString().split(" ").join(""),
412
- j=this.p.groupingView,h=this;if(c.hasOwnProperty(g))c[g].push(b);else{c[g]=[];c[g].push(b);j.sortitems[0].push(g);j.sortnames[0].push(a.trim(e[0].toString()));j.summaryval[0][g]=a.extend(true,[],j.summary[0])}j.groupSummary[0]&&a.each(j.summaryval[0][g],function(){this.v=a.isFunction(this.st)?this.st.call(h,this.v,this.nm,f):a(h).jqGrid("groupingCalculations."+this.st,this.v,this.nm,f)})});return c},groupingToggle:function(b){this.each(function(){var e=this.p.groupingView,c=b.lastIndexOf("_"),f=b.substring(0,
413
- c+1);c=parseInt(b.substring(c+1),10)+1;var g=e.minusicon,j=e.plusicon,h=a("#"+b)[0].nextSibling,d=a("#"+b+" span.tree-wrap-"+this.p.direction),n=false;if(d.hasClass(g)){if(e.showSummaryOnHide&&e.groupSummary[0]){if(h)for(;h;){if(a(h).hasClass("jqfoot"))break;a(h).hide();h=h.nextSibling}}else if(h)for(;h;){if(a(h).attr("id")==f+String(c))break;a(h).hide();h=h.nextSibling}d.removeClass(g).addClass(j);n=true}else{if(h)for(;h;){if(a(h).attr("id")==f+String(c))break;a(h).show();h=h.nextSibling}d.removeClass(j).addClass(g);
414
- n=false}a.isFunction(this.p.onClickGroup)&&this.p.onClickGroup.call(this,b,n)});return false},groupingRender:function(b,e){return this.each(function(){var c=this,f=c.p.groupingView,g="",j="",h,d="",n,k,o;if(!f.groupDataSorted){f.sortitems[0].sort();f.sortnames[0].sort();if(f.groupOrder[0].toLowerCase()=="desc"){f.sortitems[0].reverse();f.sortnames[0].reverse()}}d=f.groupCollapse?f.plusicon:f.minusicon;d+=" tree-wrap-"+c.p.direction;for(o=0;o<e;){if(c.p.colModel[o].name==f.groupField[0]){k=o;break}o++}a.each(f.sortitems[0],
415
- function(m,l){h=c.p.id+"ghead_"+m;j="<span style='cursor:pointer;' class='ui-icon "+d+"' onclick=\"jQuery('#"+c.p.id+"').jqGrid('groupingToggle','"+h+"');return false;\"></span>";try{n=c.formatter(h,f.sortnames[0][m],k,f.sortitems[0])}catch(q){n=f.sortnames[0][m]}g+='<tr id="'+h+'" role="row" class= "ui-widget-content jqgroup ui-row-'+c.p.direction+'"><td colspan="'+e+'">'+j+a.jgrid.format(f.groupText[0],n,b[l].length)+"</td></tr>";for(var s=0;s<b[l].length;s++)g+=b[l][s].join("");if(f.groupSummary[0]){s=
416
- "";if(f.groupCollapse&&!f.showSummaryOnHide)s=' style="display:none;"';g+="<tr"+s+' role="row" class="ui-widget-content jqfoot ui-row-'+c.p.direction+'">';s=f.summaryval[0][l];for(var p=c.p.colModel,r,v=b[l].length,y=0;y<e;y++){var D="<td "+c.formatCol(y,1,"")+">&#160;</td>",G="{0}";a.each(s,function(){if(this.nm==p[y].name){if(p[y].summaryTpl)G=p[y].summaryTpl;if(this.st=="avg")if(this.v&&v>0)this.v/=v;try{r=c.formatter("",this.v,y,this)}catch(x){r=this.v}D="<td "+c.formatCol(y,1,"")+">"+a.jgrid.format(G,
417
- r)+"</td>";return false}});g+=D}g+="</tr>"}});a("#"+c.p.id+" tbody:first").append(g);g=null})},groupingGroupBy:function(b,e){return this.each(function(){if(typeof b=="string")b=[b];var c=this.p.groupingView;this.p.grouping=true;for(var f=0;f<c.groupField.length;f++)c.groupColumnShow[f]||a(this).jqGrid("showCol",c.groupField[f]);this.p.groupingView=a.extend(this.p.groupingView,e||{});c.groupField=b;a(this).trigger("reloadGrid")})},groupingRemove:function(b){return this.each(function(){if(typeof b==
418
- "undefined")b=true;this.p.grouping=false;if(b===true){a("tr.jqgroup, tr.jqfoot","#"+this.p.id+" tbody:first").remove();a("tr.jqgrow:hidden","#"+this.p.id+" tbody:first").show()}else a(this).trigger("reloadGrid")})},groupingCalculations:{sum:function(b,e,c){return parseFloat(b||0)+parseFloat(c[e]||0)},min:function(b,e,c){if(b==="")return parseFloat(c[e]||0);return Math.min(parseFloat(b),parseFloat(c[e]||0))},max:function(b,e,c){if(b==="")return parseFloat(c[e]||0);return Math.max(parseFloat(b),parseFloat(c[e]||
419
- 0))},count:function(b,e,c){if(b==="")b=0;return c.hasOwnProperty(e)?b+1:0},avg:function(b,e,c){return parseFloat(b||0)+parseFloat(c[e]||0)}}})})(jQuery);
420
- (function(a){a.jgrid.extend({jqGridImport:function(b){b=a.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},b||{});return this.each(function(){var e=this,c=function(j,h){var d=a(h.xmlGrid.config,j)[0],n=a(h.xmlGrid.data,j)[0],k;if(xmlJsonClass.xml2json&&a.jgrid.parse){d=xmlJsonClass.xml2json(d," ");d=a.jgrid.parse(d);for(var o in d)if(d.hasOwnProperty(o))k=d[o];if(n){n=d.grid.datatype;
421
- d.grid.datatype="xmlstring";d.grid.datastr=j;a(e).jqGrid(k).jqGrid("setGridParam",{datatype:n})}else a(e).jqGrid(k)}else alert("xml2json or parse are not present")},f=function(j,h){if(j&&typeof j=="string"){var d=a.jgrid.parse(j),n=d[h.jsonGrid.config];if(d=d[h.jsonGrid.data]){var k=n.datatype;n.datatype="jsonstring";n.datastr=d;a(e).jqGrid(n).jqGrid("setGridParam",{datatype:k})}else a(e).jqGrid(n)}};switch(b.imptype){case "xml":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"xml",
388
+ (function(a){a.jgrid.extend({setTreeNode:function(b,e){return this.each(function(){var c=this;if(c.grid&&c.p.treeGrid)for(var f=c.p.expColInd,g=c.p.treeReader.expanded_field,j=c.p.treeReader.leaf_field,h=c.p.treeReader.level_field,d=c.p.treeReader.icon_field,o=c.p.treeReader.loaded,k,n,m,l;b<e;){l=c.p.data[c.p._index[c.rows[b].id]];if(c.p.treeGridModel=="nested")if(!l[j]){k=parseInt(l[c.p.treeReader.left_field],10);n=parseInt(l[c.p.treeReader.right_field],10);l[j]=n===k+1?"true":"false";c.rows[b].cells[c.p._treeleafpos].innerHTML=
389
+ l[j]}k=parseInt(l[h],10);if(c.p.tree_root_level===0){m=k+1;n=k}else{m=k;n=k-1}m="<div class='tree-wrap tree-wrap-"+c.p.direction+"' style='width:"+m*18+"px;'>";m+="<div style='"+(c.p.direction=="rtl"?"right:":"left:")+n*18+"px;' class='ui-icon ";if(l[o]!==undefined)l[o]=l[o]=="true"||l[o]===true?true:false;if(l[j]=="true"||l[j]===true){m+=(l[d]!==undefined&&l[d]!==""?l[d]:c.p.treeIcons.leaf)+" tree-leaf treeclick'";l[j]=true;n="leaf"}else{l[j]=false;n=""}l[g]=(l[g]=="true"||l[g]===true?true:false)&&
390
+ l[o];m+=l[g]===true?c.p.treeIcons.minus+" tree-minus treeclick'":c.p.treeIcons.plus+" tree-plus treeclick'";m+="</div></div>";a(c.rows[b].cells[f]).wrapInner("<span class='cell-wrapper"+n+"'></span>").prepend(m);if(k!==parseInt(c.p.tree_root_level,10))(l=(l=a(c).jqGrid("getNodeParent",l))&&l.hasOwnProperty(g)?l[g]:true)||a(c.rows[b]).css("display","none");a(c.rows[b].cells[f]).find("div.treeclick").bind("click",function(q){q=a(q.target||q.srcElement,c.rows).closest("tr.jqgrow")[0].id;q=c.p._index[q];
391
+ if(!c.p.data[q][j])if(c.p.data[q][g]){a(c).jqGrid("collapseRow",c.p.data[q]);a(c).jqGrid("collapseNode",c.p.data[q])}else{a(c).jqGrid("expandRow",c.p.data[q]);a(c).jqGrid("expandNode",c.p.data[q])}return false});c.p.ExpandColClick===true&&a(c.rows[b].cells[f]).find("span.cell-wrapper").css("cursor","pointer").bind("click",function(q){q=a(q.target||q.srcElement,c.rows).closest("tr.jqgrow")[0].id;var s=c.p._index[q];if(!c.p.data[s][j])if(c.p.data[s][g]){a(c).jqGrid("collapseRow",c.p.data[s]);a(c).jqGrid("collapseNode",
392
+ c.p.data[s])}else{a(c).jqGrid("expandRow",c.p.data[s]);a(c).jqGrid("expandNode",c.p.data[s])}a(c).jqGrid("setSelection",q);return false});b++}})},setTreeGrid:function(){return this.each(function(){var b=this,e=0,c=false,f,g,j=[];if(b.p.treeGrid){b.p.treedatatype||a.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.gridview=true;b.p.multiselect=false;b.p.rowList=[];b.p.expColInd=0;b.p.treeIcons=a.extend({plus:"ui-icon-triangle-1-"+
393
+ (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=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},b.p.treeReader);else if(b.p.treeGridModel=="adjacency")b.p.treeReader=a.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},
394
+ b.p.treeReader);for(g in b.p.colModel)if(b.p.colModel.hasOwnProperty(g)){f=b.p.colModel[g].name;if(f==b.p.ExpandColumn&&!c){c=true;b.p.expColInd=e}e++;for(var h in b.p.treeReader)b.p.treeReader[h]==f&&j.push(f)}a.each(b.p.treeReader,function(d,o){if(o&&a.inArray(o,j)===-1){if(d==="leaf_field")b.p._treeleafpos=e;e++;b.p.colNames.push(o);b.p.colModel.push({name:o,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})}})},expandRow:function(b){this.each(function(){var e=
395
+ this;if(e.grid&&e.p.treeGrid){var c=a(e).jqGrid("getNodeChildren",b),f=e.p.treeReader.expanded_field;a(c).each(function(){var g=a.jgrid.getAccessor(this,e.p.localReader.id);a("#"+g,e.grid.bDiv).css("display","");this[f]&&a(e).jqGrid("expandRow",this)})}})},collapseRow:function(b){this.each(function(){var e=this;if(e.grid&&e.p.treeGrid){var c=a(e).jqGrid("getNodeChildren",b),f=e.p.treeReader.expanded_field;a(c).each(function(){var g=a.jgrid.getAccessor(this,e.p.localReader.id);a("#"+g,e.grid.bDiv).css("display",
396
+ "none");this[f]&&a(e).jqGrid("collapseRow",this)})}})},getRootNodes:function(){var b=[];this.each(function(){var e=this;if(e.grid&&e.p.treeGrid)switch(e.p.treeGridModel){case "nested":var c=e.p.treeReader.level_field;a(e.p.data).each(function(){parseInt(this[c],10)===parseInt(e.p.tree_root_level,10)&&b.push(this)});break;case "adjacency":var f=e.p.treeReader.parent_id_field;a(e.p.data).each(function(){if(this[f]===null||String(this[f]).toLowerCase()=="null")b.push(this)})}});return b},getNodeDepth:function(b){var e=
397
+ null;this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":e=parseInt(b[this.p.treeReader.level_field],10)-parseInt(this.p.tree_root_level,10);break;case "adjacency":e=a(this).jqGrid("getNodeAncestors",b).length}});return e},getNodeParent:function(b){var e=null;this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var c=this.p.treeReader.left_field,f=this.p.treeReader.right_field,g=this.p.treeReader.level_field,j=parseInt(b[c],
398
+ 10),h=parseInt(b[f],10),d=parseInt(b[g],10);a(this.p.data).each(function(){if(parseInt(this[g],10)===d-1&&parseInt(this[c],10)<j&&parseInt(this[f],10)>h){e=this;return false}});break;case "adjacency":var o=this.p.treeReader.parent_id_field,k=this.p.localReader.id;a(this.p.data).each(function(){if(this[k]==b[o]){e=this;return false}})}});return e},getNodeChildren:function(b){var e=[];this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var c=this.p.treeReader.left_field,
399
+ f=this.p.treeReader.right_field,g=this.p.treeReader.level_field,j=parseInt(b[c],10),h=parseInt(b[f],10),d=parseInt(b[g],10);a(this.p.data).each(function(){parseInt(this[g],10)===d+1&&parseInt(this[c],10)>j&&parseInt(this[f],10)<h&&e.push(this)});break;case "adjacency":var o=this.p.treeReader.parent_id_field,k=this.p.localReader.id;a(this.p.data).each(function(){this[o]==b[k]&&e.push(this)})}});return e},getFullTreeNode:function(b){var e=[];this.each(function(){var c;if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var f=
400
+ this.p.treeReader.left_field,g=this.p.treeReader.right_field,j=this.p.treeReader.level_field,h=parseInt(b[f],10),d=parseInt(b[g],10),o=parseInt(b[j],10);a(this.p.data).each(function(){parseInt(this[j],10)>=o&&parseInt(this[f],10)>=h&&parseInt(this[f],10)<=d&&e.push(this)});break;case "adjacency":if(b){e.push(b);var k=this.p.treeReader.parent_id_field,n=this.p.localReader.id;a(this.p.data).each(function(m){c=e.length;for(m=0;m<c;m++)if(e[m][n]==this[k]){e.push(this);break}})}}});return e},getNodeAncestors:function(b){var e=
401
+ [];this.each(function(){if(this.grid&&this.p.treeGrid)for(var c=a(this).jqGrid("getNodeParent",b);c;){e.push(c);c=a(this).jqGrid("getNodeParent",c)}});return e},isVisibleNode:function(b){var e=true;this.each(function(){if(this.grid&&this.p.treeGrid){var c=a(this).jqGrid("getNodeAncestors",b),f=this.p.treeReader.expanded_field;a(c).each(function(){e=e&&this[f];if(!e)return false})}});return e},isNodeLoaded:function(b){var e;this.each(function(){if(this.grid&&this.p.treeGrid){var c=this.p.treeReader.leaf_field;
402
+ e=b!==undefined?b.loaded!==undefined?b.loaded:b[c]||a(this).jqGrid("getNodeChildren",b).length>0?true:false:false}});return e},expandNode:function(b){return this.each(function(){if(this.grid&&this.p.treeGrid){var e=this.p.treeReader.expanded_field,c=this.p.treeReader.parent_id_field,f=this.p.treeReader.loaded,g=this.p.treeReader.level_field,j=this.p.treeReader.left_field,h=this.p.treeReader.right_field;if(!b[e]){var d=a.jgrid.getAccessor(b,this.p.localReader.id),o=a("#"+d,this.grid.bDiv)[0],k=this.p._index[d];
403
+ if(a(this).jqGrid("isNodeLoaded",this.p.data[k])){b[e]=true;a("div.treeclick",o).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{b[e]=true;a("div.treeclick",o).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=o.rowIndex;this.p.datatype=this.p.treedatatype;this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:d,n_left:b[j],n_right:b[h],n_level:b[g]}}):a(this).jqGrid("setGridParam",
404
+ {postData:{nodeid:d,parentid:b[c],n_level:b[g]}});a(this).trigger("reloadGrid");b[f]=true;this.p.treeGridModel=="nested"?a(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}}):a(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 e=a.jgrid.getAccessor(b,this.p.localReader.id);e=a("#"+e,this.grid.bDiv)[0];a("div.treeclick",
405
+ e).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(b,e,c,f){return this.each(function(){if(this.grid&&this.p.treeGrid){var g,j,h,d=[],o=this,k;g=a(this).jqGrid("getRootNodes");g=a.jgrid.from(g);g.orderBy(b,e,c,f);k=g.select();g=0;for(j=k.length;g<j;g++){h=k[g];d.push(h);a(this).jqGrid("collectChildrenSortTree",d,h,b,e,c,f)}a.each(d,function(n){var m=a.jgrid.getAccessor(this,o.p.localReader.id);a("#"+o.p.id+" tbody tr:eq("+n+")").after(a("tr#"+
406
+ m,o.grid.bDiv))});d=k=g=null}})},collectChildrenSortTree:function(b,e,c,f,g,j){return this.each(function(){if(this.grid&&this.p.treeGrid){var h,d,o,k;h=a(this).jqGrid("getNodeChildren",e);h=a.jgrid.from(h);h.orderBy(c,f,g,j);k=h.select();h=0;for(d=k.length;h<d;h++){o=k[h];b.push(o);a(this).jqGrid("collectChildrenSortTree",b,o,c,f,g,j)}}})},setTreeRow:function(b,e){var c=false;this.each(function(){if(this.grid&&this.p.treeGrid)c=a(this).jqGrid("setRowData",b,e)});return c},delTreeNode:function(b){return this.each(function(){var e=
407
+ this.p.localReader.id,c=this.p.treeReader.left_field,f=this.p.treeReader.right_field,g,j,h;if(this.grid&&this.p.treeGrid){var d=this.p._index[b];if(d!==undefined){g=parseInt(this.p.data[d][f],10);j=g-parseInt(this.p.data[d][c],10)+1;d=a(this).jqGrid("getFullTreeNode",this.p.data[d]);if(d.length>0)for(var o=0;o<d.length;o++)a(this).jqGrid("delRowData",d[o][e]);if(this.p.treeGridModel==="nested"){e=a.jgrid.from(this.p.data).greater(c,g,{stype:"integer"}).select();if(e.length)for(h in e)e[h][c]=parseInt(e[h][c],
408
+ 10)-j;e=a.jgrid.from(this.p.data).greater(f,g,{stype:"integer"}).select();if(e.length)for(h in e)e[h][f]=parseInt(e[h][f],10)-j}}}})},addChildNode:function(b,e,c){var f=this[0];if(c){var g=f.p.treeReader.expanded_field,j=f.p.treeReader.leaf_field,h=f.p.treeReader.level_field,d=f.p.treeReader.parent_id_field,o=f.p.treeReader.left_field,k=f.p.treeReader.right_field,n=f.p.treeReader.loaded,m,l,q,s,p;m=0;var r=e,t;if(!b){p=f.p.data.length-1;if(p>=0)for(;p>=0;){m=Math.max(m,parseInt(f.p.data[p][f.p.localReader.id],
409
+ 10));p--}b=m+1}var y=a(f).jqGrid("getInd",e);t=false;if(e===undefined||e===null||e===""){r=e=null;m="last";s=f.p.tree_root_level;p=f.p.data.length+1}else{m="after";l=f.p._index[e];q=f.p.data[l];e=q[f.p.localReader.id];s=parseInt(q[h],10)+1;p=a(f).jqGrid("getFullTreeNode",q);if(p.length){r=p=p[p.length-1][f.p.localReader.id];p=a(f).jqGrid("getInd",r)+1}else p=a(f).jqGrid("getInd",e)+1;if(q[j]){t=true;q[g]=true;a(f.rows[y]).find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper").end().find("div.tree-leaf").removeClass(f.p.treeIcons.leaf+
410
+ " tree-leaf").addClass(f.p.treeIcons.minus+" tree-minus");f.p.data[l][j]=false;q[n]=true}}l=p+1;c[g]=false;c[n]=true;c[h]=s;c[j]=true;if(f.p.treeGridModel==="adjacency")c[d]=e;if(f.p.treeGridModel==="nested"){var B;if(e!==null){j=parseInt(q[k],10);h=a.jgrid.from(f.p.data);h=h.greaterOrEquals(k,j,{stype:"integer"});h=h.select();if(h.length)for(B in h){h[B][o]=h[B][o]>j?parseInt(h[B][o],10)+2:h[B][o];h[B][k]=h[B][k]>=j?parseInt(h[B][k],10)+2:h[B][k]}c[o]=j;c[k]=j+1}else{j=parseInt(a(f).jqGrid("getCol",
411
+ k,false,"max"),10);h=a.jgrid.from(f.p.data).greater(o,j,{stype:"integer"}).select();if(h.length)for(B in h)h[B][o]=parseInt(h[B][o],10)+2;h=a.jgrid.from(f.p.data).greater(k,j,{stype:"integer"}).select();if(h.length)for(B in h)h[B][k]=parseInt(h[B][k],10)+2;c[o]=j+1;c[k]=j+2}}if(e===null||a(f).jqGrid("isNodeLoaded",q)||t){a(f).jqGrid("addRowData",b,c,m,r);a(f).jqGrid("setTreeNode",p,l)}q&&!q[g]&&a(f.rows[y]).find("div.treeclick").click()}}})})(jQuery);
412
+ (function(a){a.jgrid.extend({groupingSetup:function(){return this.each(function(){var b=this.p.groupingView;if(b!==null&&(typeof b==="object"||a.isFunction(b)))if(b.groupField.length){if(typeof b.visibiltyOnNextGrouping=="undefined")b.visibiltyOnNextGrouping=[];for(var e=0;e<b.groupField.length;e++){b.groupOrder[e]||(b.groupOrder[e]="asc");b.groupText[e]||(b.groupText[e]="{0}");if(typeof b.groupColumnShow[e]!="boolean")b.groupColumnShow[e]=true;if(typeof b.groupSummary[e]!="boolean")b.groupSummary[e]=
413
+ false;if(b.groupColumnShow[e]===true){b.visibiltyOnNextGrouping[e]=true;a(this).jqGrid("showCol",b.groupField[e])}else{b.visibiltyOnNextGrouping[e]=a("#"+this.p.id+"_"+b.groupField[e]).is(":visible");a(this).jqGrid("hideCol",b.groupField[e])}b.sortitems[e]=[];b.sortnames[e]=[];b.summaryval[e]=[];if(b.groupSummary[e]){b.summary[e]=[];for(var c=this.p.colModel,f=0,g=c.length;f<g;f++)c[f].summaryType&&b.summary[e].push({nm:c[f].name,st:c[f].summaryType,v:""})}}this.p.scroll=false;this.p.rownumbers=false;
414
+ this.p.subGrid=false;this.p.treeGrid=false;this.p.gridview=true}else this.p.grouping=false;else this.p.grouping=false})},groupingPrepare:function(b,e,c,f){this.each(function(){e[0]+="";var g=e[0].toString().split(" ").join(""),j=this.p.groupingView,h=this;if(c.hasOwnProperty(g))c[g].push(b);else{c[g]=[];c[g].push(b);j.sortitems[0].push(g);j.sortnames[0].push(a.trim(e[0].toString()));j.summaryval[0][g]=a.extend(true,[],j.summary[0])}j.groupSummary[0]&&a.each(j.summaryval[0][g],function(){this.v=a.isFunction(this.st)?
415
+ this.st.call(h,this.v,this.nm,f):a(h).jqGrid("groupingCalculations."+this.st,this.v,this.nm,f)})});return c},groupingToggle:function(b){this.each(function(){var e=this.p.groupingView,c=b.lastIndexOf("_"),f=b.substring(0,c+1);c=parseInt(b.substring(c+1),10)+1;var g=e.minusicon,j=e.plusicon,h=a("#"+b)[0].nextSibling,d=a("#"+b+" span.tree-wrap-"+this.p.direction),o=false;if(d.hasClass(g)){if(e.showSummaryOnHide&&e.groupSummary[0]){if(h)for(;h;){if(a(h).hasClass("jqfoot"))break;a(h).hide();h=h.nextSibling}}else if(h)for(;h;){if(a(h).attr("id")==
416
+ f+String(c))break;a(h).hide();h=h.nextSibling}d.removeClass(g).addClass(j);o=true}else{if(h)for(;h;){if(a(h).attr("id")==f+String(c))break;a(h).show();h=h.nextSibling}d.removeClass(j).addClass(g);o=false}a.isFunction(this.p.onClickGroup)&&this.p.onClickGroup.call(this,b,o)});return false},groupingRender:function(b,e){return this.each(function(){var c=this,f=c.p.groupingView,g="",j="",h,d="",o,k,n;if(!f.groupDataSorted){f.sortitems[0].sort();f.sortnames[0].sort();if(f.groupOrder[0].toLowerCase()==
417
+ "desc"){f.sortitems[0].reverse();f.sortnames[0].reverse()}}d=f.groupCollapse?f.plusicon:f.minusicon;d+=" tree-wrap-"+c.p.direction;for(n=0;n<e;){if(c.p.colModel[n].name==f.groupField[0]){k=n;break}n++}a.each(f.sortitems[0],function(m,l){h=c.p.id+"ghead_"+m;j="<span style='cursor:pointer;' class='ui-icon "+d+"' onclick=\"jQuery('#"+c.p.id+"').jqGrid('groupingToggle','"+h+"');return false;\"></span>";try{o=c.formatter(h,f.sortnames[0][m],k,f.sortitems[0])}catch(q){o=f.sortnames[0][m]}g+='<tr id="'+
418
+ h+'" role="row" class= "ui-widget-content jqgroup ui-row-'+c.p.direction+'"><td colspan="'+e+'">'+j+a.jgrid.format(f.groupText[0],o,b[l].length)+"</td></tr>";for(var s=0;s<b[l].length;s++)g+=b[l][s].join("");if(f.groupSummary[0]){s="";if(f.groupCollapse&&!f.showSummaryOnHide)s=' style="display:none;"';g+="<tr"+s+' role="row" class="ui-widget-content jqfoot ui-row-'+c.p.direction+'">';s=f.summaryval[0][l];for(var p=c.p.colModel,r,t=b[l].length,y=0;y<e;y++){var B="<td "+c.formatCol(y,1,"")+">&#160;</td>",
419
+ G="{0}";a.each(s,function(){if(this.nm==p[y].name){if(p[y].summaryTpl)G=p[y].summaryTpl;if(this.st=="avg")if(this.v&&t>0)this.v/=t;try{r=c.formatter("",this.v,y,this)}catch(x){r=this.v}B="<td "+c.formatCol(y,1,"")+">"+a.jgrid.format(G,r)+"</td>";return false}});g+=B}g+="</tr>"}});a("#"+c.p.id+" tbody:first").append(g);g=null})},groupingGroupBy:function(b,e){return this.each(function(){if(typeof b=="string")b=[b];var c=this.p.groupingView;this.p.grouping=true;for(var f=0;f<c.groupField.length;f++)!c.groupColumnShow[f]&&
420
+ c.visibiltyOnNextGrouping[f]&&a(this).jqGrid("showCol",c.groupField[f]);for(f=0;f<b.length;f++)c.visibiltyOnNextGrouping[f]=a("#"+this.p.id+"_"+b[f]).is(":visible");this.p.groupingView=a.extend(this.p.groupingView,e||{});c.groupField=b;a(this).trigger("reloadGrid")})},groupingRemove:function(b){return this.each(function(){if(typeof b=="undefined")b=true;this.p.grouping=false;if(b===true){for(var e=this.p.groupingView,c=0;c<e.groupField.length;c++)!e.groupColumnShow[c]&&e.visibiltyOnNextGrouping[c]&&
421
+ a(this).jqGrid("showCol",e.groupField);a("tr.jqgroup, tr.jqfoot","#"+this.p.id+" tbody:first").remove();a("tr.jqgrow:hidden","#"+this.p.id+" tbody:first").show()}else a(this).trigger("reloadGrid")})},groupingCalculations:{sum:function(b,e,c){return parseFloat(b||0)+parseFloat(c[e]||0)},min:function(b,e,c){if(b==="")return parseFloat(c[e]||0);return Math.min(parseFloat(b),parseFloat(c[e]||0))},max:function(b,e,c){if(b==="")return parseFloat(c[e]||0);return Math.max(parseFloat(b),parseFloat(c[e]||0))},
422
+ count:function(b,e,c){if(b==="")b=0;return c.hasOwnProperty(e)?b+1:0},avg:function(b,e,c){return parseFloat(b||0)+parseFloat(c[e]||0)}}})})(jQuery);
423
+ (function(a){a.jgrid.extend({jqGridImport:function(b){b=a.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},b||{});return this.each(function(){var e=this,c=function(j,h){var d=a(h.xmlGrid.config,j)[0],o=a(h.xmlGrid.data,j)[0],k;if(xmlJsonClass.xml2json&&a.jgrid.parse){d=xmlJsonClass.xml2json(d," ");d=a.jgrid.parse(d);for(var n in d)if(d.hasOwnProperty(n))k=d[n];if(o){o=d.grid.datatype;
424
+ d.grid.datatype="xmlstring";d.grid.datastr=j;a(e).jqGrid(k).jqGrid("setGridParam",{datatype:o})}else a(e).jqGrid(k)}else alert("xml2json or parse are not present")},f=function(j,h){if(j&&typeof j=="string"){var d=a.jgrid.parse(j),o=d[h.jsonGrid.config];if(d=d[h.jsonGrid.data]){var k=o.datatype;o.datatype="jsonstring";o.datastr=d;a(e).jqGrid(o).jqGrid("setGridParam",{datatype:k})}else a(e).jqGrid(o)}};switch(b.imptype){case "xml":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"xml",
422
425
  complete:function(j,h){if(h=="success"){c(j.responseXML,b);a.isFunction(b.importComplete)&&b.importComplete(j)}}},b.ajaxOptions));break;case "xmlstring":if(b.impstring&&typeof b.impstring=="string"){var g=a.jgrid.stringToDoc(b.impstring);if(g){c(g,b);a.isFunction(b.importComplete)&&b.importComplete(g);b.impstring=null}g=null}break;case "json":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"json",complete:function(j,h){if(h=="success"){f(j.responseText,b);a.isFunction(b.importComplete)&&
423
426
  b.importComplete(j)}}},b.ajaxOptions));break;case "jsonstring":if(b.impstring&&typeof b.impstring=="string"){f(b.impstring,b);a.isFunction(b.importComplete)&&b.importComplete(b.impstring);b.impstring=null}}})},jqGridExport:function(b){b=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},b||{});var e=null;this.each(function(){if(this.grid){var c=a.extend({},a(this).jqGrid("getGridParam"));if(c.rownumbers){c.colNames.splice(0,1);c.colModel.splice(0,1)}if(c.multiselect){c.colNames.splice(0,1);c.colModel.splice(0,
424
427
  1)}if(c.subGrid){c.colNames.splice(0,1);c.colModel.splice(0,1)}c.knv=null;if(c.treeGrid)for(var f in c.treeReader)if(c.treeReader.hasOwnProperty(f)){c.colNames.splice(c.colNames.length-1);c.colModel.splice(c.colModel.length-1)}switch(b.exptype){case "xmlstring":e="<"+b.root+">"+xmlJsonClass.json2xml(c,b.ident)+"</"+b.root+">";break;case "jsonstring":e="{"+xmlJsonClass.toJson(c,b.root,b.ident)+"}";if(c.postData.filters!==undefined){e=e.replace(/filters":"/,'filters":');e=e.replace(/}]}"/,"}]}")}}}});
425
428
  return e},excelExport:function(b){b=a.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},b||{});return this.each(function(){if(this.grid){var e;if(b.exptype=="remote"){e=a.extend({},this.p.postData);e[b.oper]=b.tag;e=jQuery.param(e);e=b.url.indexOf("?")!=-1?b.url+"&"+e:b.url+"?"+e;window.location=e}}})}})})(jQuery);
426
429
  (function(a){if(a.browser.msie&&a.browser.version==8)a.expr[":"].hidden=function(e){return e.offsetWidth===0||e.offsetHeight===0||e.style.display=="none"};a.jgrid._multiselect=false;if(a.ui)if(a.ui.multiselect){if(a.ui.multiselect.prototype._setSelected){var b=a.ui.multiselect.prototype._setSelected;a.ui.multiselect.prototype._setSelected=function(e,c){var f=b.call(this,e,c);if(c&&this.selectedList){var g=this.element;this.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(g)})}return f}}if(a.ui.multiselect.prototype.destroy)a.ui.multiselect.prototype.destroy=
427
430
  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(e){return this.each(function(){function c(){f.p.disableClick=true}var f=this,g={tolerance:"pointer",axis:"x",scrollSensitivity:"1",items:">th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)",placeholder:{element:function(h){return a(document.createElement(h[0].nodeName)).addClass(h[0].className+
428
- " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(h,d){d.height(h.currentItem.innerHeight()-parseInt(h.currentItem.css("paddingTop")||0,10)-parseInt(h.currentItem.css("paddingBottom")||0,10));d.width(h.currentItem.innerWidth()-parseInt(h.currentItem.css("paddingLeft")||0,10)-parseInt(h.currentItem.css("paddingRight")||0,10))}},update:function(h,d){var n=a(d.item).parent();n=a(">th",n);var k={};a.each(f.p.colModel,function(m){k[this.name]=m});var o=
429
- [];n.each(function(){var m=a(">div",this).get(0).id.replace(/^jqgh_/,"");m in k&&o.push(k[m])});a(f).jqGrid("remapColumns",o,true,true);a.isFunction(f.p.sortable.update)&&f.p.sortable.update(o);setTimeout(function(){f.p.disableClick=false},50)}};if(f.p.sortable.options)a.extend(g,f.p.sortable.options);else if(a.isFunction(f.p.sortable))f.p.sortable={update:f.p.sortable};if(g.start){var j=g.start;g.start=function(h,d){c();j.call(this,h,d)}}else g.start=c;if(f.p.sortable.exclude)g.items+=":not("+f.p.sortable.exclude+
431
+ " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(h,d){d.height(h.currentItem.innerHeight()-parseInt(h.currentItem.css("paddingTop")||0,10)-parseInt(h.currentItem.css("paddingBottom")||0,10));d.width(h.currentItem.innerWidth()-parseInt(h.currentItem.css("paddingLeft")||0,10)-parseInt(h.currentItem.css("paddingRight")||0,10))}},update:function(h,d){var o=a(d.item).parent();o=a(">th",o);var k={};a.each(f.p.colModel,function(m){k[this.name]=m});var n=
432
+ [];o.each(function(){var m=a(">div",this).get(0).id.replace(/^jqgh_/,"");m in k&&n.push(k[m])});a(f).jqGrid("remapColumns",n,true,true);a.isFunction(f.p.sortable.update)&&f.p.sortable.update(n);setTimeout(function(){f.p.disableClick=false},50)}};if(f.p.sortable.options)a.extend(g,f.p.sortable.options);else if(a.isFunction(f.p.sortable))f.p.sortable={update:f.p.sortable};if(g.start){var j=g.start;g.start=function(h,d){c();j.call(this,h,d)}}else g.start=c;if(f.p.sortable.exclude)g.items+=":not("+f.p.sortable.exclude+
430
433
  ")";e.sortable(g).data("sortable").floating=true})},columnChooser:function(e){function c(m,l){if(m)if(typeof m=="string")a.fn[m]&&a.fn[m].apply(l,a.makeArray(arguments).slice(2));else a.isFunction(m)&&m.apply(l,a.makeArray(arguments).slice(2))}var f=this;if(!a("#colchooser_"+f[0].p.id).length){var g=a('<div id="colchooser_'+f[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),j=a("select",g);e=a.extend({width:420,height:240,classname:null,
431
434
  done:function(m){m&&f.jqGrid("remapColumns",m,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(m){var l={};l[m.bSubmit]=function(){m.apply_perm();m.cleanup(false)};l[m.bCancel]=function(){m.cleanup(true)};return{buttons:l,close:function(){m.cleanup(true)},modal:m.modal?m.modal:false,resizable:m.resizable?m.resizable:true,width:m.width+20}},apply_perm:function(){a("option",j).each(function(){this.selected?f.jqGrid("showCol",h[this.value].name):f.jqGrid("hideCol",h[this.value].name)});var m=
432
- [];a("option[selected]",j).each(function(){m.push(parseInt(this.value,10))});a.each(m,function(){delete n[h[parseInt(this,10)].name]});a.each(n,function(){var l=parseInt(this,10);var q=m,s=l;if(s>=0){var p=q.slice(),r=p.splice(s,Math.max(q.length-s,s));if(s>q.length)s=q.length;p[s]=l;m=p.concat(r)}else m=void 0});e.done&&e.done.call(f,m)},cleanup:function(m){c(e.dlog,g,"destroy");c(e.msel,j,"destroy");g.remove();m&&e.done&&e.done.call(f)},msel_opts:{}},a.jgrid.col,e||{});if(a.ui)if(a.ui.multiselect)if(e.msel==
435
+ [];a("option[selected]",j).each(function(){m.push(parseInt(this.value,10))});a.each(m,function(){delete o[h[parseInt(this,10)].name]});a.each(o,function(){var l=parseInt(this,10);var q=m,s=l;if(s>=0){var p=q.slice(),r=p.splice(s,Math.max(q.length-s,s));if(s>q.length)s=q.length;p[s]=l;m=p.concat(r)}else m=void 0});e.done&&e.done.call(f,m)},cleanup:function(m){c(e.dlog,g,"destroy");c(e.msel,j,"destroy");g.remove();m&&e.done&&e.done.call(f)},msel_opts:{}},a.jgrid.col,e||{});if(a.ui)if(a.ui.multiselect)if(e.msel==
433
436
  "multiselect"){if(!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");return}e.msel_opts=a.extend(a.ui.multiselect.defaults,e.msel_opts)}e.caption&&g.attr("title",e.caption);if(e.classname){g.addClass(e.classname);j.addClass(e.classname)}if(e.width){a(">div",g).css({width:e.width,margin:"0 auto"});j.css("width",e.width)}if(e.height){a(">div",g).css("height",e.height);j.css("height",e.height-10)}var h=f.jqGrid("getGridParam","colModel"),
434
- d=f.jqGrid("getGridParam","colNames"),n={},k=[];j.empty();a.each(h,function(m){n[this.name]=m;if(this.hidedlg)this.hidden||k.push(m);else j.append("<option value='"+m+"' "+(this.hidden?"":"selected='selected'")+">"+d[m]+"</option>")});var o=a.isFunction(e.dlog_opts)?e.dlog_opts.call(f,e):e.dlog_opts;c(e.dlog,g,o);o=a.isFunction(e.msel_opts)?e.msel_opts.call(f,e):e.msel_opts;c(e.msel,j,o)}},sortableRows:function(e){return this.each(function(){var c=this;if(c.grid)if(!c.p.treeGrid)if(a.fn.sortable){e=
437
+ d=f.jqGrid("getGridParam","colNames"),o={},k=[];j.empty();a.each(h,function(m){o[this.name]=m;if(this.hidedlg)this.hidden||k.push(m);else j.append("<option value='"+m+"' "+(this.hidden?"":"selected='selected'")+">"+d[m]+"</option>")});var n=a.isFunction(e.dlog_opts)?e.dlog_opts.call(f,e):e.dlog_opts;c(e.dlog,g,n);n=a.isFunction(e.msel_opts)?e.msel_opts.call(f,e):e.msel_opts;c(e.msel,j,n)}},sortableRows:function(e){return this.each(function(){var c=this;if(c.grid)if(!c.p.treeGrid)if(a.fn.sortable){e=
435
438
  a.extend({cursor:"move",axis:"y",items:".jqgrow"},e||{});if(e.start&&a.isFunction(e.start)){e._start_=e.start;delete e.start}else e._start_=false;if(e.update&&a.isFunction(e.update)){e._update_=e.update;delete e.update}else e._update_=false;e.start=function(f,g){a(g.item).css("border-width","0px");a("td",g.item).each(function(d){this.style.width=c.grid.cols[d].style.width});if(c.p.subGrid){var j=a(g.item).attr("id");try{a(c).jqGrid("collapseSubGridRow",j)}catch(h){}}e._start_&&e._start_.apply(this,
436
439
  [f,g])};e.update=function(f,g){a(g.item).css("border-width","");c.p.rownumbers===true&&a("td.jqgrid-rownum",c.rows).each(function(j){a(this).html(j+1)});e._update_&&e._update_.apply(this,[f,g])};a("tbody:first",c).sortable(e);a("tbody:first",c).disableSelection()}})},gridDnD:function(e){return this.each(function(){function c(){var j=a.data(f,"dnd");a("tr.jqgrow:not(.ui-draggable)",f).draggable(a.isFunction(j.drag)?j.drag.call(a(f),j):j.drag)}var f=this;if(f.grid)if(!f.p.treeGrid)if(a.fn.draggable&&
437
- a.fn.droppable){a("#jqgrid_dnd").html()===null&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof e=="string"&&e=="updateDnD"&&f.p.jqgdnd===true)c();else{e=a.extend({drag:function(j){return a.extend({start:function(h,d){if(f.p.subGrid){var n=a(d.helper).attr("id");try{a(f).jqGrid("collapseSubGridRow",n)}catch(k){}}for(n=0;n<a.data(f,"dnd").connectWith.length;n++)a(a.data(f,"dnd").connectWith[n]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(f,"dnd").connectWith[n]).jqGrid("addRowData",
438
- "jqg_empty_row",{});d.helper.addClass("ui-state-highlight");a("td",d.helper).each(function(o){this.style.width=f.grid.headers[o].width+"px"});j.onstart&&a.isFunction(j.onstart)&&j.onstart.call(a(f),h,d)},stop:function(h,d){if(d.helper.dropped){var n=a(d.helper).attr("id");a(f).jqGrid("delRowData",n)}for(n=0;n<a.data(f,"dnd").connectWith.length;n++)a(a.data(f,"dnd").connectWith[n]).jqGrid("delRowData","jqg_empty_row");j.onstop&&a.isFunction(j.onstop)&&j.onstop.call(a(f),h,d)}},j.drag_opts||{})},drop:function(j){return a.extend({accept:function(h){if(!a(h).hasClass("jqgrow"))return h;
439
- var d=a(h).closest("table.ui-jqgrid-btable");if(d.length>0&&a.data(d[0],"dnd")!==undefined){h=a.data(d[0],"dnd").connectWith;return a.inArray("#"+this.id,h)!=-1?true:false}return h},drop:function(h,d){if(a(d.draggable).hasClass("jqgrow")){var n=a(d.draggable).attr("id");n=d.draggable.parent().parent().jqGrid("getRowData",n);if(!j.dropbyname){var k=0,o={},m,l=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var q in n){if(n.hasOwnProperty(q)&&l[k]){m=l[k].name;o[m]=n[q]}k++}n=o}catch(s){}}d.helper.dropped=
440
- true;if(j.beforedrop&&a.isFunction(j.beforedrop)){m=j.beforedrop.call(this,h,d,n,a("#"+f.id),a(this));if(typeof m!="undefined"&&m!==null&&typeof m=="object")n=m}if(d.helper.dropped){var p;if(j.autoid)if(a.isFunction(j.autoid))p=j.autoid.call(this,n);else{p=Math.ceil(Math.random()*1E3);p=j.autoidprefix+p}a("#"+this.id).jqGrid("addRowData",p,n,j.droppos)}j.ondrop&&a.isFunction(j.ondrop)&&j.ondrop.call(this,h,d,n)}}},j.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",
440
+ a.fn.droppable){a("#jqgrid_dnd").html()===null&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof e=="string"&&e=="updateDnD"&&f.p.jqgdnd===true)c();else{e=a.extend({drag:function(j){return a.extend({start:function(h,d){if(f.p.subGrid){var o=a(d.helper).attr("id");try{a(f).jqGrid("collapseSubGridRow",o)}catch(k){}}for(o=0;o<a.data(f,"dnd").connectWith.length;o++)a(a.data(f,"dnd").connectWith[o]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(f,"dnd").connectWith[o]).jqGrid("addRowData",
441
+ "jqg_empty_row",{});d.helper.addClass("ui-state-highlight");a("td",d.helper).each(function(n){this.style.width=f.grid.headers[n].width+"px"});j.onstart&&a.isFunction(j.onstart)&&j.onstart.call(a(f),h,d)},stop:function(h,d){if(d.helper.dropped){var o=a(d.helper).attr("id");a(f).jqGrid("delRowData",o)}for(o=0;o<a.data(f,"dnd").connectWith.length;o++)a(a.data(f,"dnd").connectWith[o]).jqGrid("delRowData","jqg_empty_row");j.onstop&&a.isFunction(j.onstop)&&j.onstop.call(a(f),h,d)}},j.drag_opts||{})},drop:function(j){return a.extend({accept:function(h){if(!a(h).hasClass("jqgrow"))return h;
442
+ var d=a(h).closest("table.ui-jqgrid-btable");if(d.length>0&&a.data(d[0],"dnd")!==undefined){h=a.data(d[0],"dnd").connectWith;return a.inArray("#"+this.id,h)!=-1?true:false}return h},drop:function(h,d){if(a(d.draggable).hasClass("jqgrow")){var o=a(d.draggable).attr("id");o=d.draggable.parent().parent().jqGrid("getRowData",o);if(!j.dropbyname){var k=0,n={},m,l=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var q in o){if(o.hasOwnProperty(q)&&l[k]){m=l[k].name;n[m]=o[q]}k++}o=n}catch(s){}}d.helper.dropped=
443
+ true;if(j.beforedrop&&a.isFunction(j.beforedrop)){m=j.beforedrop.call(this,h,d,o,a("#"+f.id),a(this));if(typeof m!="undefined"&&m!==null&&typeof m=="object")o=m}if(d.helper.dropped){var p;if(j.autoid)if(a.isFunction(j.autoid))p=j.autoid.call(this,o);else{p=Math.ceil(Math.random()*1E3);p=j.autoidprefix+p}a("#"+this.id).jqGrid("addRowData",p,o,j.droppos)}j.ondrop&&a.isFunction(j.ondrop)&&j.ondrop.call(this,h,d,o)}}},j.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",
441
444
  hoverClass:"ui-state-hover"},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},e||{});if(e.connectWith){e.connectWith=e.connectWith.split(",");e.connectWith=a.map(e.connectWith,function(j){return a.trim(j)});a.data(f,"dnd",e);f.p.reccount!="0"&&!f.p.jqgdnd&&c();f.p.jqgdnd=true;for(var g=0;g<e.connectWith.length;g++)a(e.connectWith[g]).droppable(a.isFunction(e.drop)?e.drop.call(a(f),e):e.drop)}}}})},
442
445
  gridResize:function(e){return this.each(function(){var c=this;if(c.grid&&a.fn.resizable){e=a.extend({},e||{});if(e.alsoResize){e._alsoResize_=e.alsoResize;delete e.alsoResize}else e._alsoResize_=false;if(e.stop&&a.isFunction(e.stop)){e._stop_=e.stop;delete e.stop}else e._stop_=false;e.stop=function(f,g){a(c).jqGrid("setGridParam",{height:a("#gview_"+c.p.id+" .ui-jqgrid-bdiv").height()});a(c).jqGrid("setGridWidth",g.size.width,e.shrinkToFit);e._stop_&&e._stop_.call(c,f,g)};e.alsoResize=e._alsoResize_?
443
446
  eval("("+("{'#gview_"+c.p.id+" .ui-jqgrid-bdiv':true,'"+e._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+c.p.id);delete e._alsoResize_;a("#gbox_"+c.p.id).resizable(e)}})}})})(jQuery);
444
447
  function tableToGrid(a,b){jQuery(a).each(function(){if(!this.grid){jQuery(this).width("99%");var e=jQuery(this).width(),c=jQuery("input[type=checkbox]:first",jQuery(this)),f=jQuery("input[type=radio]:first",jQuery(this));c=c.length>0;f=!c&&f.length>0;var g=c||f,j=[],h=[];jQuery("th",jQuery(this)).each(function(){if(j.length===0&&g){j.push({name:"__selection__",index:"__selection__",width:0,hidden:true});h.push("__selection__")}else{j.push({name:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),
445
- index:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),width:jQuery(this).width()||150});h.push(jQuery(this).html())}});var d=[],n=[],k=[];jQuery("tbody > tr",jQuery(this)).each(function(){var o={},m=0;jQuery("td",jQuery(this)).each(function(){if(m===0&&g){var l=jQuery("input",jQuery(this)),q=l.attr("value");n.push(q||d.length);l.attr("checked")&&k.push(q);o[j[m].name]=l.attr("value")}else o[j[m].name]=jQuery(this).html();m++});m>0&&d.push(o)});
446
- jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid(jQuery.extend({datatype:"local",width:e,colNames:h,colModel:j,multiselect:c},b||{}));for(e=0;e<d.length;e++){f=null;if(n.length>0)if((f=n[e])&&f.replace)f=encodeURIComponent(f).replace(/[.\-%]/g,"_");if(f===null)f=e+1;jQuery(this).jqGrid("addRowData",f,d[e])}for(e=0;e<k.length;e++)jQuery(this).jqGrid("setSelection",k[e])}})}(function(a){a.jgrid.extend({contextMenu:function(){alert("ContextMenu extension");return false}})})(jQuery);
448
+ index:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),width:jQuery(this).width()||150});h.push(jQuery(this).html())}});var d=[],o=[],k=[];jQuery("tbody > tr",jQuery(this)).each(function(){var n={},m=0;jQuery("td",jQuery(this)).each(function(){if(m===0&&g){var l=jQuery("input",jQuery(this)),q=l.attr("value");o.push(q||d.length);l.attr("checked")&&k.push(q);n[j[m].name]=l.attr("value")}else n[j[m].name]=jQuery(this).html();m++});m>0&&d.push(n)});
449
+ jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid(jQuery.extend({datatype:"local",width:e,colNames:h,colModel:j,multiselect:c},b||{}));for(e=0;e<d.length;e++){f=null;if(o.length>0)if((f=o[e])&&f.replace)f=encodeURIComponent(f).replace(/[.\-%]/g,"_");if(f===null)f=e+1;jQuery(this).jqGrid("addRowData",f,d[e])}for(e=0;e<k.length;e++)jQuery(this).jqGrid("setSelection",k[e])}})}(function(a){a.jgrid.extend({contextMenu:function(){alert("ContextMenu extension");return false}})})(jQuery);
447
450
  (function(a){a.jgrid.extend({getPostData:function(){var b=this[0];if(b.grid)return b.p.postData},setPostData:function(b){var e=this[0];if(e.grid)if(typeof b==="object")e.p.postData=b;else alert("Error: cannot add a non-object postData value. postData unchanged.")},appendPostData:function(b){var e=this[0];if(e.grid)typeof b==="object"?a.extend(e.p.postData,b):alert("Error: cannot append a non-object postData value. postData unchanged.")},setPostDataItem:function(b,e){var c=this[0];if(c.grid)c.p.postData[b]=
448
451
  e},getPostDataItem:function(b){var e=this[0];if(e.grid)return e.p.postData[b]},removePostDataItem:function(b){var e=this[0];e.grid&&delete e.p.postData[b]},getUserData:function(){var b=this[0];if(b.grid)return b.p.userData},getUserDataItem:function(b){var e=this[0];if(e.grid)return e.p.userData[b]}})})(jQuery);
449
452
  (function(a){a.jgrid.extend({setColumns:function(b){b=a.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},a.jgrid.col,b||{});return this.each(function(){var e=this;if(e.grid){var c=typeof b.beforeShowForm===
450
- "function"?true:false,f=typeof b.afterShowForm==="function"?true:false,g=typeof b.afterSubmitForm==="function"?true:false,j=e.p.id,h="ColTbl_"+j,d={themodal:"colmod"+j,modalhead:"colhd"+j,modalcontent:"colcnt"+j,scrollelm:h};b.recreateForm===true&&a("#"+d.themodal).html()!=null&&a("#"+d.themodal).remove();if(a("#"+d.themodal).html()!=null){c&&b.beforeShowForm(a("#"+h));a.jgrid.viewModal("#"+d.themodal,{gbox:"#gbox_"+j,jqm:b.jqModal,jqM:false,modal:b.modal})}else{var n=isNaN(b.dataheight)?b.dataheight:
451
- b.dataheight+"px";n="<div id='"+h+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+n+";'>";n+="<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";for(i=0;i<this.p.colNames.length;i++)e.p.colModel[i].hidedlg||(n+="<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+
452
- "'>"+this.p.colNames[i]+(b.colnameview?" ("+this.p.colModel[i].name+")":"")+"</label></td></tr>");n+="</tbody></table></div>";n+="<table border='0' class='EditTable' id='"+h+"_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'>"+(!b.updateAfterCheck?"<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'>"+
453
- b.bCancel+"</a>")+"</td></tr></tbody></table>";b.gbox="#gbox_"+j;a.jgrid.createModal(d,n,b,"#gview_"+e.p.id,a("#gview_"+e.p.id)[0]);if(b.saveicon[0]==true)a("#dData","#"+h+"_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("#eData","#"+h+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");b.updateAfterCheck?
453
+ "function"?true:false,f=typeof b.afterShowForm==="function"?true:false,g=typeof b.afterSubmitForm==="function"?true:false,j=e.p.id,h="ColTbl_"+j,d={themodal:"colmod"+j,modalhead:"colhd"+j,modalcontent:"colcnt"+j,scrollelm:h};b.recreateForm===true&&a("#"+d.themodal).html()!=null&&a("#"+d.themodal).remove();if(a("#"+d.themodal).html()!=null){c&&b.beforeShowForm(a("#"+h));a.jgrid.viewModal("#"+d.themodal,{gbox:"#gbox_"+j,jqm:b.jqModal,jqM:false,modal:b.modal})}else{var o=isNaN(b.dataheight)?b.dataheight:
454
+ b.dataheight+"px";o="<div id='"+h+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+o+";'>";o+="<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";for(i=0;i<this.p.colNames.length;i++)e.p.colModel[i].hidedlg||(o+="<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+
455
+ "'>"+this.p.colNames[i]+(b.colnameview?" ("+this.p.colModel[i].name+")":"")+"</label></td></tr>");o+="</tbody></table></div>";o+="<table border='0' class='EditTable' id='"+h+"_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'>"+(!b.updateAfterCheck?"<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'>"+
456
+ b.bCancel+"</a>")+"</td></tr></tbody></table>";b.gbox="#gbox_"+j;a.jgrid.createModal(d,o,b,"#gview_"+e.p.id,a("#gview_"+e.p.id)[0]);if(b.saveicon[0]==true)a("#dData","#"+h+"_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("#eData","#"+h+"_2").addClass(b.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");b.updateAfterCheck?
454
457
  a(":input","#"+h).click(function(){var k=this.id.substr(4);if(k){this.checked?a(e).jqGrid("showCol",k):a(e).jqGrid("hideCol",k);b.ShrinkToFit===true&&a(e).jqGrid("setGridWidth",e.grid.width-0.0010,true)}return this}):a("#dData","#"+h+"_2").click(function(){for(i=0;i<e.p.colModel.length;i++)if(!e.p.colModel[i].hidedlg){var k=e.p.colModel[i].name.replace(/\./g,"\\.");if(a("#col_"+k,"#"+h).attr("checked")){a(e).jqGrid("showCol",e.p.colModel[i].name);a("#col_"+k,"#"+h).attr("defaultChecked",true)}else{a(e).jqGrid("hideCol",
455
458
  e.p.colModel[i].name);a("#col_"+k,"#"+h).attr("defaultChecked","")}}b.ShrinkToFit===true&&a(e).jqGrid("setGridWidth",e.grid.width-0.0010,true);b.closeAfterSubmit&&a.jgrid.hideModal("#"+d.themodal,{gb:"#gbox_"+j,jqm:b.jqModal,onClose:b.onClose});g&&b.afterSubmitForm(a("#"+h));return false});a("#eData","#"+h+"_2").click(function(){a.jgrid.hideModal("#"+d.themodal,{gb:"#gbox_"+j,jqm:b.jqModal,onClose:b.onClose});return false});a("#dData, #eData","#"+h+"_2").hover(function(){a(this).addClass("ui-state-hover")},
456
459
  function(){a(this).removeClass("ui-state-hover")});c&&b.beforeShowForm(a("#"+h));a.jgrid.viewModal("#"+d.themodal,{gbox:"#gbox_"+j,jqm:b.jqModal,jqM:true,modal:b.modal})}f&&b.afterShowForm(a("#"+h))}})}})})(jQuery);
457
460
  jQuery.fn.searchFilter=function(a,b){return new function(e,c,f){this.$=e;this.add=function(x){x==null?e.find(".ui-add-last").click():e.find(".sf:eq("+x+") .ui-add").click();return this};this.del=function(x){x==null?e.find(".sf:last .ui-del").click():e.find(".sf:eq("+x+") .ui-del").click();return this};this.search=function(){e.find(".ui-search").click();return this};this.reset=function(x){if(x===undefined)x=false;e.find(".ui-reset").trigger("click",[x]);return this};this.close=function(){e.find(".ui-closer").click();
458
- return this};if(c!=null){var g=function(){jQuery(this).toggleClass("ui-state-hover");return false},j=function(x){jQuery(this).toggleClass("ui-state-active",x.type=="mousedown");return false},h=function(x,B){return"<option value='"+x+"'>"+B+"</option>"},d=function(x,B,A){return"<select class='"+x+"'"+(A?" style='display:none;'":"")+">"+B+"</select>"},n=function(x,B){var A=e.find("tr.sf td.data "+x);A[0]!=null&&B(A)},k=function(x,B){var A=e.find("tr.sf td.data "+x);A[0]!=null&&jQuery.each(B,function(){this.data!=
459
- null?A.bind(this.type,this.data,this.fn):A.bind(this.type,this.fn)})},o=jQuery.extend({},jQuery.fn.searchFilter.defaults,f),m=-1,l="";jQuery.each(o.groupOps,function(){l+=h(this.op,this.text)});l="<select name='groupOp'>"+l+"</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>"+
460
- o.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;'>"+
461
- o.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;'>"+o.searchText+"</span></span><span class='matchText'>"+o.matchText+"</span> "+l+" <span class='rulesText'>"+o.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>");
462
- var q=e.find("tr.sf"),s=q.find("td.fields"),p=q.find("td.ops"),r=q.find("td.data"),v="";jQuery.each(o.operators,function(){v+=h(this.op,this.text)});v=d("default",v,true);p.append(v);r.append("<input type='text' class='default' style='display:none;' />");var y="",D=false,G=false;jQuery.each(c,function(x){y+=h(this.itemval,this.text);if(this.ops!=null){D=true;var B="";jQuery.each(this.ops,function(){B+=h(this.op,this.text)});B=d("field"+x,B,true);p.append(B)}if(this.dataUrl!=null){if(x>m)m=x;G=true;
463
- var A=this.dataEvents,z=this.dataInit,M=this.buildSelect;jQuery.ajax(jQuery.extend({url:this.dataUrl,complete:function(U){U=M!=null?jQuery("<div />").append(M(U)):jQuery("<div />").append(U.responseText);U.find("select").addClass("field"+x).hide();r.append(U.html());z&&n(".field"+x,z);A&&k(".field"+x,A);x==m&&e.find("tr.sf td.fields select[name='field']").change()}},o.ajaxSelectOptions))}else if(this.dataValues!=null){G=true;var R="";jQuery.each(this.dataValues,function(){R+=h(this.value,this.text)});
464
- R=d("field"+x,R,true);r.append(R)}else if(this.dataEvents!=null||this.dataInit!=null){G=true;R="<input type='text' class='field"+x+"' />";r.append(R)}this.dataInit!=null&&x!=m&&n(".field"+x,this.dataInit);this.dataEvents!=null&&x!=m&&k(".field"+x,this.dataEvents)});y="<select name='field'>"+y+"</select>";s.append(y);c=s.find("select[name='field']");D?c.change(function(x){var B=x.target.selectedIndex;x=jQuery(x.target).parents("tr.sf").find("td.ops");x.find("select").removeAttr("name").hide();B=x.find(".field"+
465
- B);if(B[0]==null)B=x.find(".default");B.attr("name","op").show();return false}):p.find(".default").attr("name","op").show();G?c.change(function(x){var B=x.target.selectedIndex;x=jQuery(x.target).parents("tr.sf").find("td.data");x.find("select,input").removeClass("vdata").hide();B=x.find(".field"+B);if(B[0]==null)B=x.find(".default");B.show().addClass("vdata");return false}):r.find(".default").show().addClass("vdata");if(D||G)c.change();e.find(".ui-state-default").hover(g,g).mousedown(j).mouseup(j);
466
- e.find(".ui-closer").click(function(){o.onClose(jQuery(e.selector));return false});e.find(".ui-del").click(function(x){x=jQuery(x.target).parents(".sf");if(x.siblings(".sf").length>0){o.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&x.find(".hasDatepicker").datepicker("destroy");x.remove()}else{x.find("select[name='field']")[0].selectedIndex=0;x.find("select[name='op']")[0].selectedIndex=0;x.find(".data input").val("");x.find(".data select").each(function(){this.selectedIndex=0});x.find("select[name='field']").change(function(B){B.stopPropagation()})}return false});
467
- e.find(".ui-add").click(function(x){x=jQuery(x.target).parents(".sf");var B=x.clone(true).insertAfter(x);B.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");if(o.clone){B.find("select[name='field']")[0].selectedIndex=x.find("select[name='field']")[0].selectedIndex;if(B.find("select[name='op']")[0]!=null)B.find("select[name='op']").focus()[0].selectedIndex=x.find("select[name='op']")[0].selectedIndex;var A=B.find("select.vdata");if(A[0]!=null)A[0].selectedIndex=x.find("select.vdata")[0].selectedIndex}else{B.find(".data input").val("");
468
- B.find("select[name='field']").focus()}o.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&x.find(".hasDatepicker").each(function(){var z=jQuery.data(this,"datepicker").settings;B.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(z)});B.find("select[name='field']").change(function(z){z.stopPropagation()});return false});e.find(".ui-search").click(function(){var x=jQuery(e.selector),B,A=x.find("select[name='groupOp'] :selected").val();B=o.stringResult?'{"groupOp":"'+
469
- A+'","rules":[':{groupOp:A,rules:[]};x.find(".sf").each(function(z){var M=jQuery(this).find("select[name='field'] :selected").val(),R=jQuery(this).find("select[name='op'] :selected").val(),U=jQuery(this).find("input.vdata,select.vdata :selected").val();U+="";if(o.stringResult){U=U.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');if(z>0)B+=",";B+='{"field":"'+M+'",';B+='"op":"'+R+'",';B+='"data":"'+U+'"}'}else B.rules.push({field:M,op:R,data:U})});if(o.stringResult)B+="]}";o.onSearch(B);return false});e.find(".ui-reset").click(function(x,
470
- B){var A=jQuery(e.selector);A.find(".ui-del").click();A.find("select[name='groupOp']")[0].selectedIndex=0;o.onReset(B);return false});e.find(".ui-add-last").click(function(){var x=jQuery(e.selector+" .sf:last"),B=x.clone(true).insertAfter(x);B.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");B.find(".data input").val("");B.find("select[name='field']").focus();o.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&x.find(".hasDatepicker").each(function(){var A=jQuery.data(this,
471
- "datepicker").settings;B.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(A)});B.find("select[name='field']").change(function(A){A.stopPropagation()});return false});this.setGroupOp=function(x){selDOMobj=e.find("select[name='groupOp']")[0];var B={},A=selDOMobj.options.length,z;for(z=0;z<A;z++)B[selDOMobj.options[z].value]=z;selDOMobj.selectedIndex=B[x];jQuery(selDOMobj).change(function(M){M.stopPropagation()})};this.setFilter=function(x){var B=x.sfref;x=x.filter;
472
- var A=[],z,M,R,U,ja={};selDOMobj=B.find("select[name='field']")[0];z=0;for(R=selDOMobj.options.length;z<R;z++){ja[selDOMobj.options[z].value]={index:z,ops:{}};A.push(selDOMobj.options[z].value)}z=0;for(R=A.length;z<R;z++){if(selDOMobj=B.find(".ops > select[class='field"+z+"']")[0]){M=0;for(U=selDOMobj.options.length;M<U;M++)ja[A[z]].ops[selDOMobj.options[M].value]=M}if(selDOMobj=B.find(".data > select[class='field"+z+"']")[0]){ja[A[z]].data={};M=0;for(U=selDOMobj.options.length;M<U;M++)ja[A[z]].data[selDOMobj.options[M].value]=
473
- M}}var $,ia,sa,ya;A=x.field;if(ja[A])$=ja[A].index;if($!=null){ia=ja[A].ops[x.op];if(ia===undefined){z=0;for(R=f.operators.length;z<R;z++)if(f.operators[z].op==x.op){ia=z;break}}sa=x.data;ya=ja[A].data==null?-1:ja[A].data[sa]}if($!=null&&ia!=null&&ya!=null){B.find("select[name='field']")[0].selectedIndex=$;B.find("select[name='field']").change();B.find("select[name='op']")[0].selectedIndex=ia;B.find("input.vdata").val(sa);if(B=B.find("select.vdata")[0])B.selectedIndex=ya;return true}else return false}}}(this,
461
+ return this};if(c!=null){var g=function(){jQuery(this).toggleClass("ui-state-hover");return false},j=function(x){jQuery(this).toggleClass("ui-state-active",x.type=="mousedown");return false},h=function(x,C){return"<option value='"+x+"'>"+C+"</option>"},d=function(x,C,A){return"<select class='"+x+"'"+(A?" style='display:none;'":"")+">"+C+"</select>"},o=function(x,C){var A=e.find("tr.sf td.data "+x);A[0]!=null&&C(A)},k=function(x,C){var A=e.find("tr.sf td.data "+x);A[0]!=null&&jQuery.each(C,function(){this.data!=
462
+ null?A.bind(this.type,this.data,this.fn):A.bind(this.type,this.fn)})},n=jQuery.extend({},jQuery.fn.searchFilter.defaults,f),m=-1,l="";jQuery.each(n.groupOps,function(){l+=h(this.op,this.text)});l="<select name='groupOp'>"+l+"</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>"+
463
+ n.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;'>"+
464
+ n.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;'>"+n.searchText+"</span></span><span class='matchText'>"+n.matchText+"</span> "+l+" <span class='rulesText'>"+n.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>");
465
+ var q=e.find("tr.sf"),s=q.find("td.fields"),p=q.find("td.ops"),r=q.find("td.data"),t="";jQuery.each(n.operators,function(){t+=h(this.op,this.text)});t=d("default",t,true);p.append(t);r.append("<input type='text' class='default' style='display:none;' />");var y="",B=false,G=false;jQuery.each(c,function(x){y+=h(this.itemval,this.text);if(this.ops!=null){B=true;var C="";jQuery.each(this.ops,function(){C+=h(this.op,this.text)});C=d("field"+x,C,true);p.append(C)}if(this.dataUrl!=null){if(x>m)m=x;G=true;
466
+ var A=this.dataEvents,z=this.dataInit,M=this.buildSelect;jQuery.ajax(jQuery.extend({url:this.dataUrl,complete:function(U){U=M!=null?jQuery("<div />").append(M(U)):jQuery("<div />").append(U.responseText);U.find("select").addClass("field"+x).hide();r.append(U.html());z&&o(".field"+x,z);A&&k(".field"+x,A);x==m&&e.find("tr.sf td.fields select[name='field']").change()}},n.ajaxSelectOptions))}else if(this.dataValues!=null){G=true;var Q="";jQuery.each(this.dataValues,function(){Q+=h(this.value,this.text)});
467
+ Q=d("field"+x,Q,true);r.append(Q)}else if(this.dataEvents!=null||this.dataInit!=null){G=true;Q="<input type='text' class='field"+x+"' />";r.append(Q)}this.dataInit!=null&&x!=m&&o(".field"+x,this.dataInit);this.dataEvents!=null&&x!=m&&k(".field"+x,this.dataEvents)});y="<select name='field'>"+y+"</select>";s.append(y);c=s.find("select[name='field']");B?c.change(function(x){var C=x.target.selectedIndex;x=jQuery(x.target).parents("tr.sf").find("td.ops");x.find("select").removeAttr("name").hide();C=x.find(".field"+
468
+ C);if(C[0]==null)C=x.find(".default");C.attr("name","op").show();return false}):p.find(".default").attr("name","op").show();G?c.change(function(x){var C=x.target.selectedIndex;x=jQuery(x.target).parents("tr.sf").find("td.data");x.find("select,input").removeClass("vdata").hide();C=x.find(".field"+C);if(C[0]==null)C=x.find(".default");C.show().addClass("vdata");return false}):r.find(".default").show().addClass("vdata");if(B||G)c.change();e.find(".ui-state-default").hover(g,g).mousedown(j).mouseup(j);
469
+ e.find(".ui-closer").click(function(){n.onClose(jQuery(e.selector));return false});e.find(".ui-del").click(function(x){x=jQuery(x.target).parents(".sf");if(x.siblings(".sf").length>0){n.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&x.find(".hasDatepicker").datepicker("destroy");x.remove()}else{x.find("select[name='field']")[0].selectedIndex=0;x.find("select[name='op']")[0].selectedIndex=0;x.find(".data input").val("");x.find(".data select").each(function(){this.selectedIndex=0});x.find("select[name='field']").change(function(C){C.stopPropagation()})}return false});
470
+ e.find(".ui-add").click(function(x){x=jQuery(x.target).parents(".sf");var C=x.clone(true).insertAfter(x);C.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");if(n.clone){C.find("select[name='field']")[0].selectedIndex=x.find("select[name='field']")[0].selectedIndex;if(C.find("select[name='op']")[0]!=null)C.find("select[name='op']").focus()[0].selectedIndex=x.find("select[name='op']")[0].selectedIndex;var A=C.find("select.vdata");if(A[0]!=null)A[0].selectedIndex=x.find("select.vdata")[0].selectedIndex}else{C.find(".data input").val("");
471
+ C.find("select[name='field']").focus()}n.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&x.find(".hasDatepicker").each(function(){var z=jQuery.data(this,"datepicker").settings;C.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(z)});C.find("select[name='field']").change(function(z){z.stopPropagation()});return false});e.find(".ui-search").click(function(){var x=jQuery(e.selector),C,A=x.find("select[name='groupOp'] :selected").val();C=n.stringResult?'{"groupOp":"'+
472
+ A+'","rules":[':{groupOp:A,rules:[]};x.find(".sf").each(function(z){var M=jQuery(this).find("select[name='field'] :selected").val(),Q=jQuery(this).find("select[name='op'] :selected").val(),U=jQuery(this).find("input.vdata,select.vdata :selected").val();U+="";if(n.stringResult){U=U.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');if(z>0)C+=",";C+='{"field":"'+M+'",';C+='"op":"'+Q+'",';C+='"data":"'+U+'"}'}else C.rules.push({field:M,op:Q,data:U})});if(n.stringResult)C+="]}";n.onSearch(C);return false});e.find(".ui-reset").click(function(x,
473
+ C){var A=jQuery(e.selector);A.find(".ui-del").click();A.find("select[name='groupOp']")[0].selectedIndex=0;n.onReset(C);return false});e.find(".ui-add-last").click(function(){var x=jQuery(e.selector+" .sf:last"),C=x.clone(true).insertAfter(x);C.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");C.find(".data input").val("");C.find("select[name='field']").focus();n.datepickerFix===true&&jQuery.fn.datepicker!==undefined&&x.find(".hasDatepicker").each(function(){var A=jQuery.data(this,
474
+ "datepicker").settings;C.find("#"+this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(A)});C.find("select[name='field']").change(function(A){A.stopPropagation()});return false});this.setGroupOp=function(x){selDOMobj=e.find("select[name='groupOp']")[0];var C={},A=selDOMobj.options.length,z;for(z=0;z<A;z++)C[selDOMobj.options[z].value]=z;selDOMobj.selectedIndex=C[x];jQuery(selDOMobj).change(function(M){M.stopPropagation()})};this.setFilter=function(x){var C=x.sfref;x=x.filter;
475
+ var A=[],z,M,Q,U,ja={};selDOMobj=C.find("select[name='field']")[0];z=0;for(Q=selDOMobj.options.length;z<Q;z++){ja[selDOMobj.options[z].value]={index:z,ops:{}};A.push(selDOMobj.options[z].value)}z=0;for(Q=A.length;z<Q;z++){if(selDOMobj=C.find(".ops > select[class='field"+z+"']")[0]){M=0;for(U=selDOMobj.options.length;M<U;M++)ja[A[z]].ops[selDOMobj.options[M].value]=M}if(selDOMobj=C.find(".data > select[class='field"+z+"']")[0]){ja[A[z]].data={};M=0;for(U=selDOMobj.options.length;M<U;M++)ja[A[z]].data[selDOMobj.options[M].value]=
476
+ M}}var $,ia,sa,xa;A=x.field;if(ja[A])$=ja[A].index;if($!=null){ia=ja[A].ops[x.op];if(ia===undefined){z=0;for(Q=f.operators.length;z<Q;z++)if(f.operators[z].op==x.op){ia=z;break}}sa=x.data;xa=ja[A].data==null?-1:ja[A].data[sa]}if($!=null&&ia!=null&&xa!=null){C.find("select[name='field']")[0].selectedIndex=$;C.find("select[name='field']").change();C.find("select[name='op']")[0].selectedIndex=ia;C.find("input.vdata").val(sa);if(C=C.find("select.vdata")[0])C.selectedIndex=xa;return true}else return false}}}(this,
474
477
  a,b)};jQuery.fn.searchFilter.version="1.2.9";
475
478
  jQuery.fn.searchFilter.defaults={clone:true,datepickerFix:true,onReset:function(a){alert("Reset Clicked. Data Returned: "+a)},onSearch:function(a){alert("Search Clicked. Data Returned: "+a)},onClose:function(a){a.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"},
476
479
  {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:{}};