jquery.jqGrid.min.js 294 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561
/* 
 * jqGrid  4.4.0 - jQuery Grid 
 * Copyright (c) 2008, Tony Tomov, tony@trirand.com 
 * Dual licensed under the MIT and GPL licenses 
 * http://www.opensource.org/licenses/mit-license.php 
 * http://www.gnu.org/licenses/gpl-2.0.html 
 * Date:2012-06-14 
 * Modules: grid.base.js; grid.common.js; grid.formedit.js; grid.filter.js; grid.jqueryui.js; 
 */
(function (b) {
    b.jgrid = b.jgrid || {};
    b.extend(b.jgrid, {version: "4.4.0", htmlDecode: function (b) {
        return b && ("&nbsp;" == b || "&#160;" == b || 1 === b.length && 160 === b.charCodeAt(0)) ? "" : !b ? b : ("" + b).replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&")
    }, htmlEncode: function (b) {
        return!b ? b : ("" + b).replace(/&/g, "&amp;").replace(/\"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
    }, format: function (f) {
        var e = b.makeArray(arguments).slice(1);
        void 0 === f && (f = "");
        return f.replace(/\{(\d+)\}/g,
            function (b, d) {
                return e[d]
            })
    }, getCellIndex: function (f) {
        f = b(f);
        if (f.is("tr"))return-1;
        f = (!f.is("td") && !f.is("th") ? f.closest("td,th") : f)[0];
        return b.browser.msie ? b.inArray(f, f.parentNode.cells) : f.cellIndex
    }, stripHtml: function (b) {
        var b = b + "", e = /<("[^"]*"|'[^']*'|[^'">])*>/gi;
        return b ? (b = b.replace(e, "")) && "&nbsp;" !== b && "&#160;" !== b ? b.replace(/\"/g, "'") : "" : b
    }, stripPref: function (f, e) {
        var c = b.type(f);
        if ("string" == c || "number" == c)f = "" + f, e = "" !== f ? ("" + e).replace("" + f, "") : e;
        return e
    }, stringToDoc: function (b) {
        var e;
        if ("string" !== typeof b)return b;
        try {
            e = (new DOMParser).parseFromString(b, "text/xml")
        } catch (c) {
            e = new ActiveXObject("Microsoft.XMLDOM"), e.async = !1, e.loadXML(b)
        }
        return e && e.documentElement && "parsererror" != e.documentElement.tagName ? e : null
    }, parse: function (f) {
        "while(1);" == f.substr(0, 9) && (f = f.substr(9));
        "/*" == f.substr(0, 2) && (f = f.substr(2, f.length - 4));
        f || (f = "{}");
        return!0 === b.jgrid.useJSON && "object" === typeof JSON && "function" === typeof JSON.parse ? JSON.parse(f) : eval("(" + f + ")")
    }, parseDate: function (f, e) {
        var c =
        {m: 1, d: 1, y: 1970, h: 0, i: 0, s: 0, u: 0}, d, a, h;
        d = /[\\\/:_;.,\t\T\s-]/;
        if (e && null !== e && void 0 !== e) {
            e = b.trim(e);
            e = e.split(d);
            void 0 !== b.jgrid.formatter.date.masks[f] && (f = b.jgrid.formatter.date.masks[f]);
            var f = f.split(d), g = b.jgrid.formatter.date.monthNames, i = b.jgrid.formatter.date.AmPm, j = function (a, b) {
                0 === a ? 12 === b && (b = 0) : 12 !== b && (b += 12);
                return b
            };
            d = 0;
            for (a = f.length; d < a; d++)"M" == f[d] && (h = b.inArray(e[d], g), -1 !== h && 12 > h && (e[d] = h + 1, c.m = e[d])), "F" == f[d] && (h = b.inArray(e[d], g), -1 !== h && 11 < h && (e[d] = h + 1 - 12, c.m = e[d])),
                "a" == f[d] && (h = b.inArray(e[d], i), -1 !== h && 2 > h && e[d] == i[h] && (e[d] = h, c.h = j(e[d], c.h))), "A" == f[d] && (h = b.inArray(e[d], i), -1 !== h && 1 < h && e[d] == i[h] && (e[d] = h - 2, c.h = j(e[d], c.h))), void 0 !== e[d] && (c[f[d].toLowerCase()] = parseInt(e[d], 10));
            c.m = parseInt(c.m, 10) - 1;
            d = c.y;
            70 <= d && 99 >= d ? c.y = 1900 + c.y : 0 <= d && 69 >= d && (c.y = 2E3 + c.y);
            void 0 !== c.j && (c.d = c.j);
            void 0 !== c.n && (c.m = parseInt(c.n, 10) - 1)
        }
        return new Date(c.y, c.m, c.d, c.h, c.i, c.s, c.u)
    }, jqID: function (b) {
        return("" + b).replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&")
    },
        guid: 1, uidPref: "jqg", randId: function (f) {
            return(f ? f : b.jgrid.uidPref) + b.jgrid.guid++
        }, getAccessor: function (b, e) {
            var c, d, a = [], h;
            if ("function" === typeof e)return e(b);
            c = b[e];
            if (void 0 === c)try {
                if ("string" === typeof e && (a = e.split(".")), h = a.length)for (c = b; c && h--;)d = a.shift(), c = c[d]
            } catch (g) {
            }
            return c
        }, getXmlData: function (f, e, c) {
            var d = "string" === typeof e ? e.match(/^(.*)\[(\w+)\]$/) : null;
            if ("function" === typeof e)return e(f);
            if (d && d[2])return d[1] ? b(d[1], f).attr(d[2]) : b(f).attr(d[2]);
            f = b(e, f);
            return c ? f : 0 < f.length ?
                b(f).text() : void 0
        }, cellWidth: function () {
            var f = b("<div class='ui-jqgrid' style='left:10000px'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;'></td></tr></table></div>"), e = f.appendTo("body").find("td").width();
            f.remove();
            return 5 !== e
        }, ajaxOptions: {}, from: function (f) {
            return new function (e, c) {
                "string" == typeof e && (e = b.data(e));
                var d = this, a = e, h = !0, f = !1, i = c, j = /[\$,%]/g, l = null, k = null, m = 0, o = !1, p = "", v = [], u = !0;
                if ("object" == typeof e && e.push)0 < e.length && (u = "object" != typeof e[0] ? !1 : !0); else throw"data provides is not an array";
                this._hasData = function () {
                    return null === a ? !1 : 0 === a.length ? !1 : !0
                };
                this._getStr = function (a) {
                    var b = [];
                    f && b.push("jQuery.trim(");
                    b.push("String(" + a + ")");
                    f && b.push(")");
                    h || b.push(".toLowerCase()");
                    return b.join("")
                };
                this._strComp = function (a) {
                    return"string" == typeof a ? ".toString()" : ""
                };
                this._group = function (a, b) {
                    return{field: a.toString(), unique: b, items: []}
                };
                this._toStr = function (a) {
                    f && (a = b.trim(a));
                    a = a.toString().replace(/\\/g, "\\\\").replace(/\"/g,
                        '\\"');
                    return h ? a : a.toLowerCase()
                };
                this._funcLoop = function (d) {
                    var c = [];
                    b.each(a, function (a, b) {
                        c.push(d(b))
                    });
                    return c
                };
                this._append = function (a) {
                    var b;
                    i = null === i ? "" : i + ("" === p ? " && " : p);
                    for (b = 0; b < m; b++)i += "(";
                    o && (i += "!");
                    i += "(" + a + ")";
                    o = !1;
                    p = "";
                    m = 0
                };
                this._setCommand = function (a, b) {
                    l = a;
                    k = b
                };
                this._resetNegate = function () {
                    o = !1
                };
                this._repeatCommand = function (a, b) {
                    return null === l ? d : null !== a && null !== b ? l(a, b) : null === k || !u ? l(a) : l(k, a)
                };
                this._equals = function (a, b) {
                    return 0 === d._compare(a, b, 1)
                };
                this._compare = function (a, b, d) {
                    var c = Object.prototype.toString;
                    void 0 === d && (d = 1);
                    void 0 === a && (a = null);
                    void 0 === b && (b = null);
                    if (null === a && null === b)return 0;
                    if (null === a && null !== b)return 1;
                    if (null !== a && null === b)return-1;
                    if ("[object Date]" === c.call(a) && "[object Date]" === c.call(b))return a < b ? -d : a > b ? d : 0;
                    !h && "number" !== typeof a && "number" !== typeof b && (a = ("" + a).toLowerCase(), b = ("" + b).toLowerCase());
                    return a < b ? -d : a > b ? d : 0
                };
                this._performSort = function () {
                    0 !== v.length && (a = d._doSort(a, 0))
                };
                this._doSort = function (a, b) {
                    var c = v[b].by, f = v[b].dir,
                        h = v[b].type, e = v[b].datefmt;
                    if (b == v.length - 1)return d._getOrder(a, c, f, h, e);
                    b++;
                    c = d._getGroup(a, c, f, h, e);
                    f = [];
                    for (h = 0; h < c.length; h++)for (var e = d._doSort(c[h].items, b), g = 0; g < e.length; g++)f.push(e[g]);
                    return f
                };
                this._getOrder = function (a, c, h, f, e) {
                    var g = [], i = [], l = "a" == h ? 1 : -1, k, m;
                    void 0 === f && (f = "text");
                    m = "float" == f || "number" == f || "currency" == f || "numeric" == f ? function (a) {
                        a = parseFloat(("" + a).replace(j, ""));
                        return isNaN(a) ? 0 : a
                    } : "int" == f || "integer" == f ? function (a) {
                        return a ? parseFloat(("" + a).replace(j, "")) : 0
                    } : "date" ==
                        f || "datetime" == f ? function (a) {
                        return b.jgrid.parseDate(e, a).getTime()
                    } : b.isFunction(f) ? f : function (a) {
                        a || (a = "");
                        return b.trim(("" + a).toUpperCase())
                    };
                    b.each(a, function (a, d) {
                        k = "" !== c ? b.jgrid.getAccessor(d, c) : d;
                        void 0 === k && (k = "");
                        k = m(k, d);
                        i.push({vSort: k, index: a})
                    });
                    i.sort(function (a, b) {
                        a = a.vSort;
                        b = b.vSort;
                        return d._compare(a, b, l)
                    });
                    for (var f = 0, o = a.length; f < o;)h = i[f].index, g.push(a[h]), f++;
                    return g
                };
                this._getGroup = function (a, c, f, h, e) {
                    var g = [], i = null, j = null, k;
                    b.each(d._getOrder(a, c, f, h, e), function (a, f) {
                        k =
                            b.jgrid.getAccessor(f, c);
                        void 0 === k && (k = "");
                        d._equals(j, k) || (j = k, null !== i && g.push(i), i = d._group(c, k));
                        i.items.push(f)
                    });
                    null !== i && g.push(i);
                    return g
                };
                this.ignoreCase = function () {
                    h = !1;
                    return d
                };
                this.useCase = function () {
                    h = !0;
                    return d
                };
                this.trim = function () {
                    f = !0;
                    return d
                };
                this.noTrim = function () {
                    f = !1;
                    return d
                };
                this.execute = function () {
                    var c = i, f = [];
                    if (null === c)return d;
                    b.each(a, function () {
                        eval(c) && f.push(this)
                    });
                    a = f;
                    return d
                };
                this.data = function () {
                    return a
                };
                this.select = function (c) {
                    d._performSort();
                    if (!d._hasData())return[];
                    d.execute();
                    if (b.isFunction(c)) {
                        var f = [];
                        b.each(a, function (a, b) {
                            f.push(c(b))
                        });
                        return f
                    }
                    return a
                };
                this.hasMatch = function () {
                    if (!d._hasData())return!1;
                    d.execute();
                    return 0 < a.length
                };
                this.andNot = function (a, b, c) {
                    o = !o;
                    return d.and(a, b, c)
                };
                this.orNot = function (a, b, c) {
                    o = !o;
                    return d.or(a, b, c)
                };
                this.not = function (a, b, c) {
                    return d.andNot(a, b, c)
                };
                this.and = function (a, b, c) {
                    p = " && ";
                    return void 0 === a ? d : d._repeatCommand(a, b, c)
                };
                this.or = function (a, b, c) {
                    p = " || ";
                    return void 0 === a ? d : d._repeatCommand(a, b, c)
                };
                this.orBegin =
                    function () {
                        m++;
                        return d
                    };
                this.orEnd = function () {
                    null !== i && (i += ")");
                    return d
                };
                this.isNot = function (a) {
                    o = !o;
                    return d.is(a)
                };
                this.is = function (a) {
                    d._append("this." + a);
                    d._resetNegate();
                    return d
                };
                this._compareValues = function (a, c, f, h, e) {
                    var g;
                    g = u ? "jQuery.jgrid.getAccessor(this,'" + c + "')" : "this";
                    void 0 === f && (f = null);
                    var i = f, k = void 0 === e.stype ? "text" : e.stype;
                    if (null !== f)switch (k) {
                        case "int":
                        case "integer":
                            i = isNaN(Number(i)) || "" === i ? "0" : i;
                            g = "parseInt(" + g + ",10)";
                            i = "parseInt(" + i + ",10)";
                            break;
                        case "float":
                        case "number":
                        case "numeric":
                            i =
                                ("" + i).replace(j, "");
                            i = isNaN(Number(i)) || "" === i ? "0" : i;
                            g = "parseFloat(" + g + ")";
                            i = "parseFloat(" + i + ")";
                            break;
                        case "date":
                        case "datetime":
                            i = "" + b.jgrid.parseDate(e.newfmt || "Y-m-d", i).getTime();
                            g = 'jQuery.jgrid.parseDate("' + e.srcfmt + '",' + g + ").getTime()";
                            break;
                        default:
                            g = d._getStr(g), i = d._getStr('"' + d._toStr(i) + '"')
                    }
                    d._append(g + " " + h + " " + i);
                    d._setCommand(a, c);
                    d._resetNegate();
                    return d
                };
                this.equals = function (a, b, c) {
                    return d._compareValues(d.equals, a, b, "==", c)
                };
                this.notEquals = function (a, b, c) {
                    return d._compareValues(d.equals,
                        a, b, "!==", c)
                };
                this.isNull = function (a, b, c) {
                    return d._compareValues(d.equals, a, null, "===", c)
                };
                this.greater = function (a, b, c) {
                    return d._compareValues(d.greater, a, b, ">", c)
                };
                this.less = function (a, b, c) {
                    return d._compareValues(d.less, a, b, "<", c)
                };
                this.greaterOrEquals = function (a, b, c) {
                    return d._compareValues(d.greaterOrEquals, a, b, ">=", c)
                };
                this.lessOrEquals = function (a, b, c) {
                    return d._compareValues(d.lessOrEquals, a, b, "<=", c)
                };
                this.startsWith = function (a, c) {
                    var h = void 0 === c || null === c ? a : c, h = f ? b.trim(h.toString()).length :
                        h.toString().length;
                    u ? d._append(d._getStr("jQuery.jgrid.getAccessor(this,'" + a + "')") + ".substr(0," + h + ") == " + d._getStr('"' + d._toStr(c) + '"')) : (h = f ? b.trim(c.toString()).length : c.toString().length, d._append(d._getStr("this") + ".substr(0," + h + ") == " + d._getStr('"' + d._toStr(a) + '"')));
                    d._setCommand(d.startsWith, a);
                    d._resetNegate();
                    return d
                };
                this.endsWith = function (a, c) {
                    var h = void 0 === c || null === c ? a : c, h = f ? b.trim(h.toString()).length : h.toString().length;
                    u ? d._append(d._getStr("jQuery.jgrid.getAccessor(this,'" + a +
                        "')") + ".substr(" + d._getStr("jQuery.jgrid.getAccessor(this,'" + a + "')") + ".length-" + h + "," + h + ') == "' + d._toStr(c) + '"') : d._append(d._getStr("this") + ".substr(" + d._getStr("this") + '.length-"' + d._toStr(a) + '".length,"' + d._toStr(a) + '".length) == "' + d._toStr(a) + '"');
                    d._setCommand(d.endsWith, a);
                    d._resetNegate();
                    return d
                };
                this.contains = function (a, b) {
                    u ? d._append(d._getStr("jQuery.jgrid.getAccessor(this,'" + a + "')") + '.indexOf("' + d._toStr(b) + '",0) > -1') : d._append(d._getStr("this") + '.indexOf("' + d._toStr(a) + '",0) > -1');
                    d._setCommand(d.contains, a);
                    d._resetNegate();
                    return d
                };
                this.groupBy = function (b, c, f, h) {
                    return!d._hasData() ? null : d._getGroup(a, b, c, f, h)
                };
                this.orderBy = function (a, c, f, h) {
                    c = void 0 === c || null === c ? "a" : b.trim(c.toString().toLowerCase());
                    if (null === f || void 0 === f)f = "text";
                    if (null === h || void 0 === h)h = "Y-m-d";
                    if ("desc" == c || "descending" == c)c = "d";
                    if ("asc" == c || "ascending" == c)c = "a";
                    v.push({by: a, dir: c, type: f, datefmt: h});
                    return d
                };
                return d
            }(f, null)
        }, extend: function (f) {
            b.extend(b.fn.jqGrid, f);
            this.no_legacy_api || b.fn.extend(f)
        }});
    b.fn.jqGrid = function (f) {
        if ("string" == typeof f) {
            var e = b.jgrid.getAccessor(b.fn.jqGrid, f);
            if (!e)throw"jqGrid - No such method: " + f;
            var c = b.makeArray(arguments).slice(1);
            return e.apply(this, c)
        }
        return this.each(function () {
            if (!this.grid) {
                var d = b.extend(!0, {url: "", height: 150, page: 1, rowNum: 20, rowTotal: null, records: 0, pager: "", pgbuttons: !0, pginput: !0, colModel: [], rowList: [], colNames: [], sortorder: "asc", sortname: "", datatype: "xml", mtype: "GET", altRows: !1, selarrrow: [], savedRow: [], shrinkToFit: !0, xmlReader: {}, jsonReader: {},
                    subGrid: !1, subGridModel: [], reccount: 0, lastpage: 0, lastsort: 0, selrow: null, beforeSelectRow: null, onSelectRow: null, onSortCol: null, ondblClickRow: null, onRightClickRow: null, onPaging: null, onSelectAll: null, loadComplete: null, gridComplete: null, loadError: null, loadBeforeSend: null, afterInsertRow: null, beforeRequest: null, beforeProcessing: null, onHeaderClick: null, viewrecords: !1, loadonce: !1, multiselect: !1, multikey: !1, editurl: null, search: !1, caption: "", hidegrid: !0, hiddengrid: !1, postData: {}, userData: {}, treeGrid: !1, treeGridModel: "nested",
                    treeReader: {}, treeANode: -1, ExpandColumn: null, tree_root_level: 0, prmNames: {page: "page", rows: "rows", sort: "sidx", order: "sord", search: "_search", nd: "nd", id: "id", oper: "oper", editoper: "edit", addoper: "add", deloper: "del", subgridid: "id", npage: null, totalrows: "totalrows"}, forceFit: !1, gridstate: "visible", cellEdit: !1, cellsubmit: "remote", nv: 0, loadui: "enable", toolbar: [!1, ""], scroll: !1, multiboxonly: !1, deselectAfterSort: !0, scrollrows: !1, autowidth: !1, scrollOffset: 18, cellLayout: 5, subGridWidth: 20, multiselectWidth: 20, gridview: !1,
                    rownumWidth: 25, rownumbers: !1, pagerpos: "center", recordpos: "right", footerrow: !1, userDataOnFooter: !1, hoverrows: !0, altclass: "ui-priority-secondary", viewsortcols: [!1, "vertical", !0], resizeclass: "", autoencode: !1, remapColumns: [], ajaxGridOptions: {}, direction: "ltr", toppager: !1, headertitles: !1, scrollTimeout: 40, data: [], _index: {}, grouping: !1, groupingView: {groupField: [], groupOrder: [], groupText: [], groupColumnShow: [], groupSummary: [], showSummaryOnHide: !1, sortitems: [], sortnames: [], summary: [], summaryval: [], plusicon: "ui-icon-circlesmall-plus",
                        minusicon: "ui-icon-circlesmall-minus"}, ignoreCase: !1, cmTemplate: {}, idPrefix: ""}, b.jgrid.defaults, f || {}), a = this, c = {headers: [], cols: [], footers: [], dragStart: function (c, e, f) {
                    this.resizing = {idx: c, startX: e.clientX, sOL: f[0]};
                    this.hDiv.style.cursor = "col-resize";
                    this.curGbox = b("#rs_m" + b.jgrid.jqID(d.id), "#gbox_" + b.jgrid.jqID(d.id));
                    this.curGbox.css({display: "block", left: f[0], top: f[1], height: f[2]});
                    b(a).triggerHandler("jqGridResizeStart", [e, c]);
                    b.isFunction(d.resizeStart) && d.resizeStart.call(this, e, c);
                    document.onselectstart =
                        function () {
                            return!1
                        }
                }, dragMove: function (a) {
                    if (this.resizing) {
                        var b = a.clientX - this.resizing.startX, a = this.headers[this.resizing.idx], c = "ltr" === d.direction ? a.width + b : a.width - b, e;
                        33 < c && (this.curGbox.css({left: this.resizing.sOL + b}), !0 === d.forceFit ? (e = this.headers[this.resizing.idx + d.nv], b = "ltr" === d.direction ? e.width - b : e.width + b, 33 < b && (a.newWidth = c, e.newWidth = b)) : (this.newWidth = "ltr" === d.direction ? d.tblwidth + b : d.tblwidth - b, a.newWidth = c))
                    }
                }, dragEnd: function () {
                    this.hDiv.style.cursor = "default";
                    if (this.resizing) {
                        var c =
                            this.resizing.idx, e = this.headers[c].newWidth || this.headers[c].width, e = parseInt(e, 10);
                        this.resizing = !1;
                        b("#rs_m" + b.jgrid.jqID(d.id)).css("display", "none");
                        d.colModel[c].width = e;
                        this.headers[c].width = e;
                        this.headers[c].el.style.width = e + "px";
                        this.cols[c].style.width = e + "px";
                        0 < this.footers.length && (this.footers[c].style.width = e + "px");
                        !0 === d.forceFit ? (e = this.headers[c + d.nv].newWidth || this.headers[c + d.nv].width, this.headers[c + d.nv].width = e, this.headers[c + d.nv].el.style.width = e + "px", this.cols[c + d.nv].style.width =
                            e + "px", 0 < this.footers.length && (this.footers[c + d.nv].style.width = e + "px"), d.colModel[c + d.nv].width = e) : (d.tblwidth = this.newWidth || d.tblwidth, b("table:first", this.bDiv).css("width", d.tblwidth + "px"), b("table:first", this.hDiv).css("width", d.tblwidth + "px"), this.hDiv.scrollLeft = this.bDiv.scrollLeft, d.footerrow && (b("table:first", this.sDiv).css("width", d.tblwidth + "px"), this.sDiv.scrollLeft = this.bDiv.scrollLeft));
                        b(a).triggerHandler("jqGridResizeStop", [e, c]);
                        b.isFunction(d.resizeStop) && d.resizeStop.call(this,
                            e, c)
                    }
                    this.curGbox = null;
                    document.onselectstart = function () {
                        return!0
                    }
                }, populateVisible: function () {
                    c.timer && clearTimeout(c.timer);
                    c.timer = null;
                    var a = b(c.bDiv).height();
                    if (a) {
                        var e = b("table:first", c.bDiv), f, G;
                        if (e[0].rows.length)try {
                            G = (f = e[0].rows[1]) ? b(f).outerHeight() || c.prevRowHeight : c.prevRowHeight
                        } catch (g) {
                            G = c.prevRowHeight
                        }
                        if (G) {
                            c.prevRowHeight = G;
                            var i = d.rowNum;
                            f = c.scrollTop = c.bDiv.scrollTop;
                            var j = Math.round(e.position().top) - f, k = j + e.height();
                            G *= i;
                            var y, z, B;
                            if (k < a && 0 >= j && (void 0 === d.lastpage || parseInt((k +
                                f + G - 1) / G, 10) <= d.lastpage))z = parseInt((a - k + G - 1) / G, 10), 0 <= k || 2 > z || !0 === d.scroll ? (y = Math.round((k + f) / G) + 1, j = -1) : j = 1;
                            0 < j && (y = parseInt(f / G, 10) + 1, z = parseInt((f + a) / G, 10) + 2 - y, B = !0);
                            if (z && !(d.lastpage && y > d.lastpage || 1 == d.lastpage || y === d.page && y === d.lastpage))c.hDiv.loading ? c.timer = setTimeout(c.populateVisible, d.scrollTimeout) : (d.page = y, B && (c.selectionPreserver(e[0]), c.emptyRows.call(e[0], !1, !1)), c.populate(z))
                        }
                    }
                }, scrollGrid: function (a) {
                    if (d.scroll) {
                        var b = c.bDiv.scrollTop;
                        void 0 === c.scrollTop && (c.scrollTop =
                            0);
                        b != c.scrollTop && (c.scrollTop = b, c.timer && clearTimeout(c.timer), c.timer = setTimeout(c.populateVisible, d.scrollTimeout))
                    }
                    c.hDiv.scrollLeft = c.bDiv.scrollLeft;
                    d.footerrow && (c.sDiv.scrollLeft = c.bDiv.scrollLeft);
                    a && a.stopPropagation()
                }, selectionPreserver: function (a) {
                    var c = a.p, d = c.selrow, e = c.selarrrow ? b.makeArray(c.selarrrow) : null, f = a.grid.bDiv.scrollLeft, g = function () {
                        var h;
                        c.selrow = null;
                        c.selarrrow = [];
                        if (c.multiselect && e && 0 < e.length)for (h = 0; h < e.length; h++)e[h] != d && b(a).jqGrid("setSelection", e[h], !1, null);
                        d && b(a).jqGrid("setSelection", d, !1, null);
                        a.grid.bDiv.scrollLeft = f;
                        b(a).unbind(".selectionPreserver", g)
                    };
                    b(a).bind("jqGridGridComplete.selectionPreserver", g)
                }};
                if ("TABLE" != this.tagName.toUpperCase())alert("Element is not a table"); else if (void 0 !== document.documentMode && 5 >= document.documentMode)alert("Grid can not be used in this ('quirks') mode!"); else {
                    b(this).empty().attr("tabindex", "1");
                    this.p = d;
                    this.p.useProp = !!b.fn.prop;
                    var e, i;
                    if (0 === this.p.colNames.length)for (e = 0; e < this.p.colModel.length; e++)this.p.colNames[e] =
                        this.p.colModel[e].label || this.p.colModel[e].name;
                    if (this.p.colNames.length !== this.p.colModel.length)alert(b.jgrid.errors.model); else {
                        var j = b("<div class='ui-jqgrid-view'></div>"), l, k = b.browser.msie ? !0 : !1;
                        a.p.direction = b.trim(a.p.direction.toLowerCase());
                        -1 == b.inArray(a.p.direction, ["ltr", "rtl"]) && (a.p.direction = "ltr");
                        i = a.p.direction;
                        b(j).insertBefore(this);
                        b(this).appendTo(j).removeClass("scroll");
                        var m = b("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");
                        b(m).insertBefore(j).attr({id: "gbox_" +
                            this.id, dir: i});
                        b(j).appendTo(m).attr("id", "gview_" + this.id);
                        l = k && 6 >= b.browser.version ? '<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>' : "";
                        b("<div class='ui-widget-overlay jqgrid-overlay' id='lui_" + this.id + "'></div>").append(l).insertBefore(j);
                        b("<div class='loading ui-state-default ui-state-active' id='load_" + this.id + "'>" + this.p.loadtext + "</div>").insertBefore(j);
                        b(this).attr({cellspacing: "0", cellpadding: "0", border: "0", role: "grid",
                            "aria-multiselectable": !!this.p.multiselect, "aria-labelledby": "gbox_" + this.id});
                        var o = function (a, b) {
                            a = parseInt(a, 10);
                            return isNaN(a) ? b ? b : 0 : a
                        }, p = function (d, e, f, g, i, j) {
                            var K = a.p.colModel[d], k = K.align, y = 'style="', z = K.classes, B = K.name, q = [];
                            k && (y = y + ("text-align:" + k + ";"));
                            K.hidden === true && (y = y + "display:none;");
                            if (e === 0)y = y + ("width: " + c.headers[d].width + "px;"); else if (K.cellattr && b.isFunction(K.cellattr))if ((d = K.cellattr.call(a, i, f, g, K, j)) && typeof d === "string") {
                                d = d.replace(/style/i, "style").replace(/title/i,
                                    "title");
                                if (d.indexOf("title") > -1)K.title = false;
                                d.indexOf("class") > -1 && (z = void 0);
                                q = d.split("style");
                                if (q.length === 2) {
                                    q[1] = b.trim(q[1].replace("=", ""));
                                    if (q[1].indexOf("'") === 0 || q[1].indexOf('"') === 0)q[1] = q[1].substring(1);
                                    y = y + q[1].replace(/'/gi, '"')
                                } else y = y + '"'
                            }
                            if (!q.length) {
                                q[0] = "";
                                y = y + '"'
                            }
                            y = y + ((z !== void 0 ? ' class="' + z + '"' : "") + (K.title && f ? ' title="' + b.jgrid.stripHtml(f) + '"' : ""));
                            y = y + (' aria-describedby="' + a.p.id + "_" + B + '"');
                            return y + q[0]
                        }, v = function (c) {
                            return c === void 0 || c === null || c === "" ? "&#160;" :
                                a.p.autoencode ? b.jgrid.htmlEncode(c) : c + ""
                        }, u = function (c, d, e, f, g) {
                            var h = a.p.colModel[e];
                            if (typeof h.formatter !== "undefined") {
                                c = {rowId: c, colModel: h, gid: a.p.id, pos: e};
                                d = b.isFunction(h.formatter) ? h.formatter.call(a, d, c, f, g) : b.fmatter ? b.fn.fmatter.call(a, h.formatter, d, c, f, g) : v(d)
                            } else d = v(d);
                            return d
                        }, M = function (a, b, c, d, e) {
                            b = u(a, b, c, e, "add");
                            return'<td role="gridcell" ' + p(c, d, b, e, a, true) + ">" + b + "</td>"
                        }, F = function (b, c, d) {
                            var e = '<input role="checkbox" type="checkbox" id="jqg_' + a.p.id + "_" + b + '" class="cbox" name="jqg_' +
                                a.p.id + "_" + b + '"/>';
                            return'<td role="gridcell" ' + p(c, d, "", null, b, true) + ">" + e + "</td>"
                        }, Z = function (a, b, c, d) {
                            c = (parseInt(c, 10) - 1) * parseInt(d, 10) + 1 + b;
                            return'<td role="gridcell" class="ui-state-default jqgrid-rownum" ' + p(a, b, c, null, b, true) + ">" + c + "</td>"
                        }, U = function (b) {
                            var c, d = [], e = 0, f;
                            for (f = 0; f < a.p.colModel.length; f++) {
                                c = a.p.colModel[f];
                                if (c.name !== "cb" && c.name !== "subgrid" && c.name !== "rn") {
                                    d[e] = b == "local" ? c.name : b == "xml" || b === "xmlstring" ? c.xmlmap || c.name : c.jsonmap || c.name;
                                    e++
                                }
                            }
                            return d
                        }, V = function (c) {
                            var d =
                                a.p.remapColumns;
                            if (!d || !d.length)d = b.map(a.p.colModel, function (a, b) {
                                return b
                            });
                            c && (d = b.map(d, function (a) {
                                return a < c ? null : a - c
                            }));
                            return d
                        }, N = function (a, c) {
                            var d;
                            if (this.p.deepempty)b(this.rows).slice(1).remove(); else {
                                d = this.rows.length > 0 ? this.rows[0] : null;
                                b(this.firstChild).empty().append(d)
                            }
                            if (a && this.p.scroll) {
                                b(this.grid.bDiv.firstChild).css({height: "auto"});
                                b(this.grid.bDiv.firstChild.firstChild).css({height: 0, display: "none"});
                                if (this.grid.bDiv.scrollTop !== 0)this.grid.bDiv.scrollTop = 0
                            }
                            if (c ===
                                true && this.p.treeGrid) {
                                this.p.data = [];
                                this.p._index = {}
                            }
                        }, S = function () {
                            var c = a.p.data.length, d, e, f;
                            d = a.p.rownumbers === true ? 1 : 0;
                            e = a.p.multiselect === true ? 1 : 0;
                            f = a.p.subGrid === true ? 1 : 0;
                            d = a.p.keyIndex === false || a.p.loadonce === true ? a.p.localReader.id : a.p.colModel[a.p.keyIndex + e + f + d].name;
                            for (e = 0; e < c; e++) {
                                f = b.jgrid.getAccessor(a.p.data[e], d);
                                a.p._index[f] = e
                            }
                        }, J = function (c, d, e, f, g) {
                            var h = "-1", i = "", j, d = d ? "display:none;" : "", e = "ui-widget-content jqgrow ui-row-" + a.p.direction + e, f = b.isFunction(a.p.rowattr) ? a.p.rowattr.call(a,
                                f, g) : {};
                            if (!b.isEmptyObject(f)) {
                                if (f.hasOwnProperty("id")) {
                                    c = f.id;
                                    delete f.id
                                }
                                if (f.hasOwnProperty("tabindex")) {
                                    h = f.tabindex;
                                    delete f.tabindex
                                }
                                if (f.hasOwnProperty("style")) {
                                    d = d + f.style;
                                    delete f.style
                                }
                                if (f.hasOwnProperty("class")) {
                                    e = e + (" " + f["class"]);
                                    delete f["class"]
                                }
                                try {
                                    delete f.role
                                } catch (k) {
                                }
                                for (j in f)f.hasOwnProperty(j) && (i = i + (" " + j + "=" + f[j]))
                            }
                            return'<tr role="row" id="' + c + '" tabindex="' + h + '" class="' + e + '"' + (d === "" ? "" : ' style="' + d + '"') + i + ">"
                        }, $ = function (c, d, e, f, g) {
                            var h = new Date, i = a.p.datatype !=
                                "local" && a.p.loadonce || a.p.datatype == "xmlstring", j = a.p.xmlReader, k = a.p.datatype == "local" ? "local" : "xml";
                            if (i) {
                                a.p.data = [];
                                a.p._index = {};
                                a.p.localReader.id = "_id_"
                            }
                            a.p.reccount = 0;
                            if (b.isXMLDoc(c)) {
                                if (a.p.treeANode === -1 && !a.p.scroll) {
                                    N.call(a, false, true);
                                    e = 1
                                } else e = e > 1 ? e : 1;
                                var z, B, q = 0, l, s = a.p.multiselect === true ? 1 : 0, P = a.p.subGrid === true ? 1 : 0, m = a.p.rownumbers === true ? 1 : 0, o, p = [], u, n = {}, r, w, C = [], v = a.p.altRows === true ? " " + a.p.altclass : "", A;
                                j.repeatitems || (p = U(k));
                                o = a.p.keyIndex === false ? b.isFunction(j.id) ? j.id.call(a,
                                    c) : j.id : a.p.keyIndex;
                                if (p.length > 0 && !isNaN(o)) {
                                    a.p.remapColumns && a.p.remapColumns.length && (o = b.inArray(o, a.p.remapColumns));
                                    o = p[o]
                                }
                                k = (o + "").indexOf("[") === -1 ? p.length ? function (a, c) {
                                    return b(o, a).text() || c
                                } : function (a, c) {
                                    return b(j.cell, a).eq(o).text() || c
                                } : function (a, b) {
                                    return a.getAttribute(o.replace(/[\[\]]/g, "")) || b
                                };
                                a.p.userData = {};
                                a.p.page = b.jgrid.getXmlData(c, j.page) || 0;
                                a.p.lastpage = b.jgrid.getXmlData(c, j.total);
                                if (a.p.lastpage === void 0)a.p.lastpage = 1;
                                a.p.records = b.jgrid.getXmlData(c, j.records) ||
                                    0;
                                b.isFunction(j.userdata) ? a.p.userData = j.userdata.call(a, c) || {} : b.jgrid.getXmlData(c, j.userdata, true).each(function () {
                                    a.p.userData[this.getAttribute("name")] = b(this).text()
                                });
                                c = b.jgrid.getXmlData(c, j.root, true);
                                (c = b.jgrid.getXmlData(c, j.row, true)) || (c = []);
                                var t = c.length, H = 0, Q = [], x = parseInt(a.p.rowNum, 10);
                                if (t > 0 && a.p.page <= 0)a.p.page = 1;
                                if (c && t) {
                                    var D = a.p.scroll ? b.jgrid.randId() : 1;
                                    g && (x = x * (g + 1));
                                    for (var g = b.isFunction(a.p.afterInsertRow), E = a.p.grouping && a.p.groupingView.groupCollapse === true; H < t;) {
                                        r =
                                            c[H];
                                        w = k(r, D + H);
                                        w = a.p.idPrefix + w;
                                        z = e === 0 ? 0 : e + 1;
                                        A = (z + H) % 2 == 1 ? v : "";
                                        var I = C.length;
                                        C.push("");
                                        m && C.push(Z(0, H, a.p.page, a.p.rowNum));
                                        s && C.push(F(w, m, H));
                                        P && C.push(b(a).jqGrid("addSubGridCell", s + m, H + e));
                                        if (j.repeatitems) {
                                            u || (u = V(s + P + m));
                                            var L = b.jgrid.getXmlData(r, j.cell, true);
                                            b.each(u, function (b) {
                                                var c = L[this];
                                                if (!c)return false;
                                                l = c.textContent || c.text;
                                                n[a.p.colModel[b + s + P + m].name] = l;
                                                C.push(M(w, l, b + s + P + m, H + e, r))
                                            })
                                        } else for (z = 0; z < p.length; z++) {
                                            l = b.jgrid.getXmlData(r, p[z]);
                                            n[a.p.colModel[z + s + P + m].name] =
                                                l;
                                            C.push(M(w, l, z + s + P + m, H + e, r))
                                        }
                                        C[I] = J(w, E, A, n, r);
                                        C.push("</tr>");
                                        if (a.p.grouping) {
                                            Q = b(a).jqGrid("groupingPrepare", C, Q, n, H);
                                            C = []
                                        }
                                        if (i || a.p.treeGrid === true) {
                                            n._id_ = w;
                                            a.p.data.push(n);
                                            a.p._index[w] = a.p.data.length - 1
                                        }
                                        if (a.p.gridview === false) {
                                            b("tbody:first", d).append(C.join(""));
                                            b(a).triggerHandler("jqGridAfterInsertRow", [w, n, r]);
                                            g && a.p.afterInsertRow.call(a, w, n, r);
                                            C = []
                                        }
                                        n = {};
                                        q++;
                                        H++;
                                        if (q == x)break
                                    }
                                }
                                if (a.p.gridview === true) {
                                    B = a.p.treeANode > -1 ? a.p.treeANode : 0;
                                    if (a.p.grouping) {
                                        b(a).jqGrid("groupingRender",
                                            Q, a.p.colModel.length);
                                        Q = null
                                    } else a.p.treeGrid === true && B > 0 ? b(a.rows[B]).after(C.join("")) : b("tbody:first", d).append(C.join(""))
                                }
                                if (a.p.subGrid === true)try {
                                    b(a).jqGrid("addSubGrid", s + m)
                                } catch (R) {
                                }
                                a.p.totaltime = new Date - h;
                                if (q > 0 && a.p.records === 0)a.p.records = t;
                                C = null;
                                if (a.p.treeGrid === true)try {
                                    b(a).jqGrid("setTreeNode", B + 1, q + B + 1)
                                } catch (S) {
                                }
                                if (!a.p.treeGrid && !a.p.scroll)a.grid.bDiv.scrollTop = 0;
                                a.p.reccount = q;
                                a.p.treeANode = -1;
                                a.p.userDataOnFooter && b(a).jqGrid("footerData", "set", a.p.userData, true);
                                if (i) {
                                    a.p.records =
                                        t;
                                    a.p.lastpage = Math.ceil(t / x)
                                }
                                f || a.updatepager(false, true);
                                if (i)for (; q < t;) {
                                    r = c[q];
                                    w = k(r, q + D);
                                    w = a.p.idPrefix + w;
                                    if (j.repeatitems) {
                                        u || (u = V(s + P + m));
                                        var O = b.jgrid.getXmlData(r, j.cell, true);
                                        b.each(u, function (b) {
                                            var c = O[this];
                                            if (!c)return false;
                                            l = c.textContent || c.text;
                                            n[a.p.colModel[b + s + P + m].name] = l
                                        })
                                    } else for (z = 0; z < p.length; z++) {
                                        l = b.jgrid.getXmlData(r, p[z]);
                                        n[a.p.colModel[z + s + P + m].name] = l
                                    }
                                    n._id_ = w;
                                    a.p.data.push(n);
                                    a.p._index[w] = a.p.data.length - 1;
                                    n = {};
                                    q++
                                }
                            }
                        }, aa = function (c, d, e, f, g) {
                            d = new Date;
                            if (c) {
                                if (a.p.treeANode === -1 && !a.p.scroll) {
                                    N.call(a, false, true);
                                    e = 1
                                } else e = e > 1 ? e : 1;
                                var h, i, j = a.p.datatype != "local" && a.p.loadonce || a.p.datatype == "jsonstring";
                                if (j) {
                                    a.p.data = [];
                                    a.p._index = {};
                                    a.p.localReader.id = "_id_"
                                }
                                a.p.reccount = 0;
                                if (a.p.datatype == "local") {
                                    h = a.p.localReader;
                                    i = "local"
                                } else {
                                    h = a.p.jsonReader;
                                    i = "json"
                                }
                                var k = 0, l, B, q = [], m, s = a.p.multiselect ? 1 : 0, o = a.p.subGrid ? 1 : 0, p = a.p.rownumbers === true ? 1 : 0, n, u, t = {}, v, r, w = [], C = a.p.altRows === true ? " " + a.p.altclass : "", A;
                                a.p.page = b.jgrid.getAccessor(c, h.page) || 0;
                                n = b.jgrid.getAccessor(c,
                                    h.total);
                                a.p.lastpage = n === void 0 ? 1 : n;
                                a.p.records = b.jgrid.getAccessor(c, h.records) || 0;
                                a.p.userData = b.jgrid.getAccessor(c, h.userdata) || {};
                                h.repeatitems || (m = q = U(i));
                                i = a.p.keyIndex === false ? b.isFunction(h.id) ? h.id.call(a, c) : h.id : a.p.keyIndex;
                                if (q.length > 0 && !isNaN(i)) {
                                    a.p.remapColumns && a.p.remapColumns.length && (i = b.inArray(i, a.p.remapColumns));
                                    i = q[i]
                                }
                                (u = b.jgrid.getAccessor(c, h.root)) || (u = []);
                                n = u.length;
                                c = 0;
                                if (n > 0 && a.p.page <= 0)a.p.page = 1;
                                var x = parseInt(a.p.rowNum, 10), D = a.p.scroll ? b.jgrid.randId() : 1;
                                g && (x =
                                    x * (g + 1));
                                for (var H = b.isFunction(a.p.afterInsertRow), Q = [], E = a.p.grouping && a.p.groupingView.groupCollapse === true; c < n;) {
                                    g = u[c];
                                    r = b.jgrid.getAccessor(g, i);
                                    if (r === void 0) {
                                        r = D + c;
                                        if (q.length === 0 && h.cell) {
                                            l = b.jgrid.getAccessor(g, h.cell);
                                            r = l !== void 0 ? l[i] || r : r
                                        }
                                    }
                                    r = a.p.idPrefix + r;
                                    l = e === 1 ? 0 : e;
                                    A = (l + c) % 2 == 1 ? C : "";
                                    var I = w.length;
                                    w.push("");
                                    p && w.push(Z(0, c, a.p.page, a.p.rowNum));
                                    s && w.push(F(r, p, c));
                                    o && w.push(b(a).jqGrid("addSubGridCell", s + p, c + e));
                                    if (h.repeatitems) {
                                        h.cell && (g = b.jgrid.getAccessor(g, h.cell));
                                        m || (m = V(s +
                                            o + p))
                                    }
                                    for (B = 0; B < m.length; B++) {
                                        l = b.jgrid.getAccessor(g, m[B]);
                                        w.push(M(r, l, B + s + o + p, c + e, g));
                                        t[a.p.colModel[B + s + o + p].name] = l
                                    }
                                    w[I] = J(r, E, A, t, g);
                                    w.push("</tr>");
                                    if (a.p.grouping) {
                                        Q = b(a).jqGrid("groupingPrepare", w, Q, t, c);
                                        w = []
                                    }
                                    if (j || a.p.treeGrid === true) {
                                        t._id_ = r;
                                        a.p.data.push(t);
                                        a.p._index[r] = a.p.data.length - 1
                                    }
                                    if (a.p.gridview === false) {
                                        b("#" + b.jgrid.jqID(a.p.id) + " tbody:first").append(w.join(""));
                                        b(a).triggerHandler("jqGridAfterInsertRow", [r, t, g]);
                                        H && a.p.afterInsertRow.call(a, r, t, g);
                                        w = []
                                    }
                                    t = {};
                                    k++;
                                    c++;
                                    if (k ==
                                        x)break
                                }
                                if (a.p.gridview === true) {
                                    v = a.p.treeANode > -1 ? a.p.treeANode : 0;
                                    a.p.grouping ? b(a).jqGrid("groupingRender", Q, a.p.colModel.length) : a.p.treeGrid === true && v > 0 ? b(a.rows[v]).after(w.join("")) : b("#" + b.jgrid.jqID(a.p.id) + " tbody:first").append(w.join(""))
                                }
                                if (a.p.subGrid === true)try {
                                    b(a).jqGrid("addSubGrid", s + p)
                                } catch (L) {
                                }
                                a.p.totaltime = new Date - d;
                                if (k > 0 && a.p.records === 0)a.p.records = n;
                                if (a.p.treeGrid === true)try {
                                    b(a).jqGrid("setTreeNode", v + 1, k + v + 1)
                                } catch (O) {
                                }
                                if (!a.p.treeGrid && !a.p.scroll)a.grid.bDiv.scrollTop =
                                    0;
                                a.p.reccount = k;
                                a.p.treeANode = -1;
                                a.p.userDataOnFooter && b(a).jqGrid("footerData", "set", a.p.userData, true);
                                if (j) {
                                    a.p.records = n;
                                    a.p.lastpage = Math.ceil(n / x)
                                }
                                f || a.updatepager(false, true);
                                if (j)for (; k < n && u[k];) {
                                    g = u[k];
                                    r = b.jgrid.getAccessor(g, i);
                                    if (r === void 0) {
                                        r = D + k;
                                        q.length === 0 && h.cell && (r = b.jgrid.getAccessor(g, h.cell)[i] || r)
                                    }
                                    if (g) {
                                        r = a.p.idPrefix + r;
                                        if (h.repeatitems) {
                                            h.cell && (g = b.jgrid.getAccessor(g, h.cell));
                                            m || (m = V(s + o + p))
                                        }
                                        for (B = 0; B < m.length; B++) {
                                            l = b.jgrid.getAccessor(g, m[B]);
                                            t[a.p.colModel[B + s + o + p].name] =
                                                l
                                        }
                                        t._id_ = r;
                                        a.p.data.push(t);
                                        a.p._index[r] = a.p.data.length - 1;
                                        t = {}
                                    }
                                    k++
                                }
                            }
                        }, ma = function () {
                            function c(d) {
                                var e = 0, g, h, i, j, T;
                                if (d.groups !== void 0) {
                                    (h = d.groups.length && d.groupOp.toString().toUpperCase() === "OR") && s.orBegin();
                                    for (g = 0; g < d.groups.length; g++) {
                                        e > 0 && h && s.or();
                                        try {
                                            c(d.groups[g])
                                        } catch (k) {
                                            alert(k)
                                        }
                                        e++
                                    }
                                    h && s.orEnd()
                                }
                                if (d.rules !== void 0) {
                                    if (e > 0) {
                                        h = s.select();
                                        s = b.jgrid.from(h);
                                        a.p.ignoreCase && (s = s.ignoreCase())
                                    }
                                    try {
                                        (i = d.rules.length && d.groupOp.toString().toUpperCase() === "OR") && s.orBegin();
                                        for (g = 0; g < d.rules.length; g++) {
                                            T =
                                                d.rules[g];
                                            j = d.groupOp.toString().toUpperCase();
                                            if (o[T.op] && T.field) {
                                                e > 0 && j && j === "OR" && (s = s.or());
                                                s = o[T.op](s, j)(T.field, T.data, f[T.field])
                                            }
                                            e++
                                        }
                                        i && s.orEnd()
                                    } catch (na) {
                                        alert(na)
                                    }
                                }
                            }

                            var d, e = false, f = {}, g = [], h = [], i, j, k;
                            if (b.isArray(a.p.data)) {
                                var l = a.p.grouping ? a.p.groupingView : false, m, q;
                                b.each(a.p.colModel, function () {
                                    j = this.sorttype || "text";
                                    if (j == "date" || j == "datetime") {
                                        if (this.formatter && typeof this.formatter === "string" && this.formatter == "date") {
                                            i = this.formatoptions && this.formatoptions.srcformat ? this.formatoptions.srcformat :
                                                b.jgrid.formatter.date.srcformat;
                                            k = this.formatoptions && this.formatoptions.newformat ? this.formatoptions.newformat : b.jgrid.formatter.date.newformat
                                        } else i = k = this.datefmt || "Y-m-d";
                                        f[this.name] = {stype: j, srcfmt: i, newfmt: k}
                                    } else f[this.name] = {stype: j, srcfmt: "", newfmt: ""};
                                    if (a.p.grouping) {
                                        q = 0;
                                        for (m = l.groupField.length; q < m; q++)if (this.name == l.groupField[q]) {
                                            var c = this.name;
                                            if (typeof this.index != "undefined")c = this.index;
                                            g[q] = f[c];
                                            h[q] = c
                                        }
                                    }
                                    if (!e && (this.index == a.p.sortname || this.name == a.p.sortname)) {
                                        d = this.name;
                                        e = true
                                    }
                                });
                                if (a.p.treeGrid)b(a).jqGrid("SortTree", d, a.p.sortorder, f[d].stype, f[d].srcfmt); else {
                                    var o = {eq: function (a) {
                                        return a.equals
                                    }, ne: function (a) {
                                        return a.notEquals
                                    }, lt: function (a) {
                                        return a.less
                                    }, le: function (a) {
                                        return a.lessOrEquals
                                    }, gt: function (a) {
                                        return a.greater
                                    }, ge: function (a) {
                                        return a.greaterOrEquals
                                    }, cn: function (a) {
                                        return a.contains
                                    }, nc: function (a, b) {
                                        return b === "OR" ? a.orNot().contains : a.andNot().contains
                                    }, bw: function (a) {
                                        return a.startsWith
                                    }, bn: function (a, b) {
                                        return b === "OR" ? a.orNot().startsWith :
                                            a.andNot().startsWith
                                    }, en: function (a, b) {
                                        return b === "OR" ? a.orNot().endsWith : a.andNot().endsWith
                                    }, ew: function (a) {
                                        return a.endsWith
                                    }, ni: function (a, b) {
                                        return b === "OR" ? a.orNot().equals : a.andNot().equals
                                    }, "in": function (a) {
                                        return a.equals
                                    }, nu: function (a) {
                                        return a.isNull
                                    }, nn: function (a, b) {
                                        return b === "OR" ? a.orNot().isNull : a.andNot().isNull
                                    }}, s = b.jgrid.from(a.p.data);
                                    a.p.ignoreCase && (s = s.ignoreCase());
                                    if (a.p.search === true) {
                                        var n = a.p.postData.filters;
                                        if (n) {
                                            typeof n == "string" && (n = b.jgrid.parse(n));
                                            c(n)
                                        } else try {
                                            s =
                                                o[a.p.postData.searchOper](s)(a.p.postData.searchField, a.p.postData.searchString, f[a.p.postData.searchField])
                                        } catch (p) {
                                        }
                                    }
                                    if (a.p.grouping)for (q = 0; q < m; q++)s.orderBy(h[q], l.groupOrder[q], g[q].stype, g[q].srcfmt);
                                    d && a.p.sortorder && e && (a.p.sortorder.toUpperCase() == "DESC" ? s.orderBy(a.p.sortname, "d", f[d].stype, f[d].srcfmt) : s.orderBy(a.p.sortname, "a", f[d].stype, f[d].srcfmt));
                                    var n = s.select(), u = parseInt(a.p.rowNum, 10), t = n.length, v = parseInt(a.p.page, 10), x = Math.ceil(t / u), r = {}, n = n.slice((v - 1) * u, v * u), f = s = null;
                                    r[a.p.localReader.total] = x;
                                    r[a.p.localReader.page] = v;
                                    r[a.p.localReader.records] = t;
                                    r[a.p.localReader.root] = n;
                                    r[a.p.localReader.userdata] = a.p.userData;
                                    n = null;
                                    return r
                                }
                            }
                        }, ca = function () {
                            a.grid.hDiv.loading = true;
                            if (!a.p.hiddengrid)switch (a.p.loadui) {
                                case "enable":
                                    b("#load_" + b.jgrid.jqID(a.p.id)).show();
                                    break;
                                case "block":
                                    b("#lui_" + b.jgrid.jqID(a.p.id)).show();
                                    b("#load_" + b.jgrid.jqID(a.p.id)).show()
                            }
                        }, O = function () {
                            a.grid.hDiv.loading = false;
                            switch (a.p.loadui) {
                                case "enable":
                                    b("#load_" + b.jgrid.jqID(a.p.id)).hide();
                                    break;
                                case "block":
                                    b("#lui_" + b.jgrid.jqID(a.p.id)).hide();
                                    b("#load_" + b.jgrid.jqID(a.p.id)).hide()
                            }
                        }, I = function (c) {
                            if (!a.grid.hDiv.loading) {
                                var d = a.p.scroll && c === false, e = {}, f, g = a.p.prmNames;
                                if (a.p.page <= 0)a.p.page = 1;
                                if (g.search !== null)e[g.search] = a.p.search;
                                g.nd !== null && (e[g.nd] = (new Date).getTime());
                                if (g.rows !== null)e[g.rows] = a.p.rowNum;
                                if (g.page !== null)e[g.page] = a.p.page;
                                if (g.sort !== null)e[g.sort] = a.p.sortname;
                                if (g.order !== null)e[g.order] = a.p.sortorder;
                                if (a.p.rowTotal !== null && g.totalrows !== null)e[g.totalrows] =
                                    a.p.rowTotal;
                                var h = b.isFunction(a.p.loadComplete), i = h ? a.p.loadComplete : null, j = 0, c = c || 1;
                                if (c > 1)if (g.npage !== null) {
                                    e[g.npage] = c;
                                    j = c - 1;
                                    c = 1
                                } else i = function (b) {
                                    a.p.page++;
                                    a.grid.hDiv.loading = false;
                                    h && a.p.loadComplete.call(a, b);
                                    I(c - 1)
                                }; else g.npage !== null && delete a.p.postData[g.npage];
                                if (a.p.grouping) {
                                    b(a).jqGrid("groupingSetup");
                                    var k = a.p.groupingView, l, m = "";
                                    for (l = 0; l < k.groupField.length; l++)m = m + (k.groupField[l] + " " + k.groupOrder[l] + ", ");
                                    e[g.sort] = m + e[g.sort]
                                }
                                b.extend(a.p.postData, e);
                                var q = !a.p.scroll ?
                                    1 : a.rows.length - 1, e = b(a).triggerHandler("jqGridBeforeRequest");
                                if (!(e === false || e === "stop"))if (b.isFunction(a.p.datatype))a.p.datatype.call(a, a.p.postData, "load_" + a.p.id); else {
                                    if (b.isFunction(a.p.beforeRequest)) {
                                        e = a.p.beforeRequest.call(a);
                                        e === void 0 && (e = true);
                                        if (e === false)return
                                    }
                                    f = a.p.datatype.toLowerCase();
                                    switch (f) {
                                        case "json":
                                        case "jsonp":
                                        case "xml":
                                        case "script":
                                            b.ajax(b.extend({url: a.p.url, type: a.p.mtype, dataType: f, data: b.isFunction(a.p.serializeGridData) ? a.p.serializeGridData.call(a, a.p.postData) :
                                                a.p.postData, success: function (e, g, h) {
                                                if (b.isFunction(a.p.beforeProcessing) && a.p.beforeProcessing.call(a, e, g, h) === false)O(); else {
                                                    f === "xml" ? $(e, a.grid.bDiv, q, c > 1, j) : aa(e, a.grid.bDiv, q, c > 1, j);
                                                    b(a).triggerHandler("jqGridLoadComplete", [e]);
                                                    i && i.call(a, e);
                                                    b(a).triggerHandler("jqGridAfterLoadComplete", [e]);
                                                    d && a.grid.populateVisible();
                                                    if (a.p.loadonce || a.p.treeGrid)a.p.datatype = "local";
                                                    c === 1 && O()
                                                }
                                            }, error: function (d, e, f) {
                                                b.isFunction(a.p.loadError) && a.p.loadError.call(a, d, e, f);
                                                c === 1 && O()
                                            }, beforeSend: function (c, d) {
                                                var e = true;
                                                b.isFunction(a.p.loadBeforeSend) && (e = a.p.loadBeforeSend.call(a, c, d));
                                                e === void 0 && (e = true);
                                                if (e === false)return false;
                                                ca()
                                            }}, b.jgrid.ajaxOptions, a.p.ajaxGridOptions));
                                            break;
                                        case "xmlstring":
                                            ca();
                                            e = b.jgrid.stringToDoc(a.p.datastr);
                                            $(e, a.grid.bDiv);
                                            b(a).triggerHandler("jqGridLoadComplete", [e]);
                                            h && a.p.loadComplete.call(a, e);
                                            b(a).triggerHandler("jqGridAfterLoadComplete", [e]);
                                            a.p.datatype = "local";
                                            a.p.datastr = null;
                                            O();
                                            break;
                                        case "jsonstring":
                                            ca();
                                            e = typeof a.p.datastr == "string" ? b.jgrid.parse(a.p.datastr) :
                                                a.p.datastr;
                                            aa(e, a.grid.bDiv);
                                            b(a).triggerHandler("jqGridLoadComplete", [e]);
                                            h && a.p.loadComplete.call(a, e);
                                            b(a).triggerHandler("jqGridAfterLoadComplete", [e]);
                                            a.p.datatype = "local";
                                            a.p.datastr = null;
                                            O();
                                            break;
                                        case "local":
                                        case "clientside":
                                            ca();
                                            a.p.datatype = "local";
                                            e = ma();
                                            aa(e, a.grid.bDiv, q, c > 1, j);
                                            b(a).triggerHandler("jqGridLoadComplete", [e]);
                                            i && i.call(a, e);
                                            b(a).triggerHandler("jqGridAfterLoadComplete", [e]);
                                            d && a.grid.populateVisible();
                                            O()
                                    }
                                }
                            }
                        }, da = function (c) {
                            b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv)[a.p.useProp ?
                                "prop" : "attr"]("checked", c);
                            if (a.p.frozenColumns && a.p.id + "_frozen")b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.fhDiv)[a.p.useProp ? "prop" : "attr"]("checked", c)
                        };
                        l = function (c, e) {
                            var d = "", f = "<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>", g = "", h, j, k, l, m = function (c) {
                                var e;
                                b.isFunction(a.p.onPaging) && (e = a.p.onPaging.call(a, c));
                                a.p.selrow = null;
                                if (a.p.multiselect) {
                                    a.p.selarrrow = [];
                                    da(false)
                                }
                                a.p.savedRow = [];
                                return e == "stop" ? false : true
                            }, c = c.substr(1), e =
                                e + ("_" + c);
                            h = "pg_" + c;
                            j = c + "_left";
                            k = c + "_center";
                            l = c + "_right";
                            b("#" + b.jgrid.jqID(c)).append("<div id='" + h + "' 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='" + j + "' align='left'></td><td id='" + k + "' align='center' style='white-space:pre;'></td><td id='" + l + "' align='right'></td></tr></tbody></table></div>").attr("dir", "ltr");
                            if (a.p.rowList.length > 0) {
                                g = "<td dir='" +
                                    i + "'>";
                                g = g + "<select class='ui-pg-selbox' role='listbox'>";
                                for (j = 0; j < a.p.rowList.length; j++)g = g + ('<option role="option" value="' + a.p.rowList[j] + '"' + (a.p.rowNum == a.p.rowList[j] ? ' selected="selected"' : "") + ">" + a.p.rowList[j] + "</option>");
                                g = g + "</select></td>"
                            }
                            i == "rtl" && (f = f + g);
                            a.p.pginput === true && (d = "<td dir='" + i + "'>" + b.jgrid.format(a.p.pgtext || "", "<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>", "<span id='sp_1_" + b.jgrid.jqID(c) + "'></span>") + "</td>");
                            if (a.p.pgbuttons ===
                                true) {
                                j = ["first" + e, "prev" + e, "next" + e, "last" + e];
                                i == "rtl" && j.reverse();
                                f = f + ("<td id='" + j[0] + "' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>");
                                f = f + ("<td id='" + j[1] + "' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>");
                                f = f + (d !== "" ? "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>" + d + "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>" :
                                    "") + ("<td id='" + j[2] + "' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>");
                                f = f + ("<td id='" + j[3] + "' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>")
                            } else d !== "" && (f = f + d);
                            i == "ltr" && (f = f + g);
                            f = f + "</tr></tbody></table>";
                            a.p.viewrecords === true && b("td#" + c + "_" + a.p.recordpos, "#" + h).append("<div dir='" + i + "' style='text-align:" + a.p.recordpos + "' class='ui-paging-info'></div>");
                            b("td#" + c + "_" + a.p.pagerpos, "#" + h).append(f);
                            g = b(".ui-jqgrid").css("font-size") ||
                                "11px";
                            b(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:" + g + ";visibility:hidden;' ></div>");
                            f = b(f).clone().appendTo("#testpg").width();
                            b("#testpg").remove();
                            if (f > 0) {
                                d !== "" && (f = f + 50);
                                b("td#" + c + "_" + a.p.pagerpos, "#" + h).width(f)
                            }
                            a.p._nvtd = [];
                            a.p._nvtd[0] = f ? Math.floor((a.p.width - f) / 2) : Math.floor(a.p.width / 3);
                            a.p._nvtd[1] = 0;
                            f = null;
                            b(".ui-pg-selbox", "#" + h).bind("change", function () {
                                a.p.page = Math.round(a.p.rowNum * (a.p.page - 1) / this.value - 0.5) + 1;
                                a.p.rowNum =
                                    this.value;
                                a.p.pager && b(".ui-pg-selbox", a.p.pager).val(this.value);
                                a.p.toppager && b(".ui-pg-selbox", a.p.toppager).val(this.value);
                                if (!m("records"))return false;
                                I();
                                return false
                            });
                            if (a.p.pgbuttons === true) {
                                b(".ui-pg-button", "#" + h).hover(function () {
                                    if (b(this).hasClass("ui-state-disabled"))this.style.cursor = "default"; else {
                                        b(this).addClass("ui-state-hover");
                                        this.style.cursor = "pointer"
                                    }
                                }, function () {
                                    if (!b(this).hasClass("ui-state-disabled")) {
                                        b(this).removeClass("ui-state-hover");
                                        this.style.cursor = "default"
                                    }
                                });
                                b("#first" + b.jgrid.jqID(e) + ", #prev" + b.jgrid.jqID(e) + ", #next" + b.jgrid.jqID(e) + ", #last" + b.jgrid.jqID(e)).click(function () {
                                    var b = o(a.p.page, 1), c = o(a.p.lastpage, 1), d = false, f = true, g = true, h = true, i = true;
                                    if (c === 0 || c === 1)i = h = g = f = false; else if (c > 1 && b >= 1)if (b === 1)g = f = false; else {
                                        if (b === c)i = h = false
                                    } else if (c > 1 && b === 0) {
                                        i = h = false;
                                        b = c - 1
                                    }
                                    if (this.id === "first" + e && f) {
                                        a.p.page = 1;
                                        d = true
                                    }
                                    if (this.id === "prev" + e && g) {
                                        a.p.page = b - 1;
                                        d = true
                                    }
                                    if (this.id === "next" + e && h) {
                                        a.p.page = b + 1;
                                        d = true
                                    }
                                    if (this.id === "last" + e && i) {
                                        a.p.page = c;
                                        d =
                                            true
                                    }
                                    if (d) {
                                        if (!m(this.id))return false;
                                        I()
                                    }
                                    return false
                                })
                            }
                            a.p.pginput === true && b("input.ui-pg-input", "#" + h).keypress(function (c) {
                                if ((c.charCode ? c.charCode : c.keyCode ? c.keyCode : 0) == 13) {
                                    a.p.page = b(this).val() > 0 ? b(this).val() : a.p.page;
                                    if (!m("user"))return false;
                                    I();
                                    return false
                                }
                                return this
                            })
                        };
                        var ja = function (c, e, d, f) {
                            if (a.p.colModel[e].sortable && !(a.p.savedRow.length > 0)) {
                                if (!d) {
                                    if (a.p.lastsort == e)if (a.p.sortorder == "asc")a.p.sortorder = "desc"; else {
                                        if (a.p.sortorder == "desc")a.p.sortorder = "asc"
                                    } else a.p.sortorder =
                                        a.p.colModel[e].firstsortorder || "asc";
                                    a.p.page = 1
                                }
                                if (f) {
                                    if (a.p.lastsort == e && a.p.sortorder == f && !d)return;
                                    a.p.sortorder = f
                                }
                                d = a.grid.headers[a.p.lastsort].el;
                                f = a.grid.headers[e].el;
                                b("span.ui-grid-ico-sort", d).addClass("ui-state-disabled");
                                b(d).attr("aria-selected", "false");
                                b("span.ui-icon-" + a.p.sortorder, f).removeClass("ui-state-disabled");
                                b(f).attr("aria-selected", "true");
                                if (!a.p.viewsortcols[0] && a.p.lastsort != e) {
                                    b("span.s-ico", d).hide();
                                    b("span.s-ico", f).show()
                                }
                                c = c.substring(5 + a.p.id.length + 1);
                                a.p.sortname =
                                    a.p.colModel[e].index || c;
                                d = a.p.sortorder;
                                if (b(a).triggerHandler("jqGridSortCol", [c, e, d]) === "stop")a.p.lastsort = e; else if (b.isFunction(a.p.onSortCol) && a.p.onSortCol.call(a, c, e, d) == "stop")a.p.lastsort = e; else {
                                    if (a.p.datatype == "local")a.p.deselectAfterSort && b(a).jqGrid("resetSelection"); else {
                                        a.p.selrow = null;
                                        a.p.multiselect && da(false);
                                        a.p.selarrrow = [];
                                        a.p.savedRow = []
                                    }
                                    if (a.p.scroll) {
                                        d = a.grid.bDiv.scrollLeft;
                                        N.call(a, true, false);
                                        a.grid.hDiv.scrollLeft = d
                                    }
                                    a.p.subGrid && a.p.datatype == "local" && b("td.sgexpanded",
                                        "#" + b.jgrid.jqID(a.p.id)).each(function () {
                                            b(this).trigger("click")
                                        });
                                    I();
                                    a.p.lastsort = e;
                                    if (a.p.sortname != c && e)a.p.lastsort = e
                                }
                            }
                        }, oa = function (c) {
                            var e, d = {}, f = b.jgrid.cellWidth() ? 0 : a.p.cellLayout;
                            for (e = d[0] = d[1] = d[2] = 0; e <= c; e++)a.p.colModel[e].hidden === false && (d[0] = d[0] + (a.p.colModel[e].width + f));
                            a.p.direction == "rtl" && (d[0] = a.p.width - d[0]);
                            d[0] = d[0] - a.grid.bDiv.scrollLeft;
                            b(a.grid.cDiv).is(":visible") && (d[1] = d[1] + (b(a.grid.cDiv).height() + parseInt(b(a.grid.cDiv).css("padding-top"), 10) + parseInt(b(a.grid.cDiv).css("padding-bottom"),
                                10)));
                            if (a.p.toolbar[0] === true && (a.p.toolbar[1] == "top" || a.p.toolbar[1] == "both"))d[1] = d[1] + (b(a.grid.uDiv).height() + parseInt(b(a.grid.uDiv).css("border-top-width"), 10) + parseInt(b(a.grid.uDiv).css("border-bottom-width"), 10));
                            a.p.toppager && (d[1] = d[1] + (b(a.grid.topDiv).height() + parseInt(b(a.grid.topDiv).css("border-bottom-width"), 10)));
                            d[2] = d[2] + (b(a.grid.bDiv).height() + b(a.grid.hDiv).height());
                            return d
                        }, ka = function (c) {
                            var d, e = a.grid.headers, f = b.jgrid.getCellIndex(c);
                            for (d = 0; d < e.length; d++)if (c === e[d].el) {
                                f =
                                    d;
                                break
                            }
                            return f
                        };
                        this.p.id = this.id;
                        -1 == b.inArray(a.p.multikey, ["shiftKey", "altKey", "ctrlKey"]) && (a.p.multikey = !1);
                        a.p.keyIndex = !1;
                        for (e = 0; e < a.p.colModel.length; e++)a.p.colModel[e] = b.extend(!0, {}, a.p.cmTemplate, a.p.colModel[e].template || {}, a.p.colModel[e]), !1 === a.p.keyIndex && !0 === a.p.colModel[e].key && (a.p.keyIndex = e);
                        a.p.sortorder = a.p.sortorder.toLowerCase();
                        !0 === a.p.grouping && (a.p.scroll = !1, a.p.rownumbers = !1, a.p.treeGrid = !1, a.p.gridview = !0);
                        if (!0 === this.p.treeGrid) {
                            try {
                                b(this).jqGrid("setTreeGrid")
                            } catch (qa) {
                            }
                            "local" !=
                                a.p.datatype && (a.p.localReader = {id: "_id_"})
                        }
                        if (this.p.subGrid)try {
                            b(a).jqGrid("setSubGrid")
                        } catch (ra) {
                        }
                        this.p.multiselect && (this.p.colNames.unshift("<input role='checkbox' id='cb_" + this.p.id + "' class='cbox' type='checkbox'/>"), this.p.colModel.unshift({name: "cb", width: b.jgrid.cellWidth() ? a.p.multiselectWidth + a.p.cellLayout : a.p.multiselectWidth, sortable: !1, resizable: !1, hidedlg: !0, search: !1, align: "center", fixed: !0}));
                        this.p.rownumbers && (this.p.colNames.unshift(""), this.p.colModel.unshift({name: "rn",
                            width: a.p.rownumWidth, sortable: !1, resizable: !1, hidedlg: !0, search: !1, align: "center", fixed: !0}));
                        a.p.xmlReader = b.extend(!0, {root: "rows", row: "row", page: "rows>page", total: "rows>total", records: "rows>records", repeatitems: !0, cell: "cell", id: "[id]", userdata: "userdata", subgrid: {root: "rows", row: "row", repeatitems: !0, cell: "cell"}}, a.p.xmlReader);
                        a.p.jsonReader = b.extend(!0, {root: "rows", page: "page", total: "total", records: "records", repeatitems: !0, cell: "cell", id: "id", userdata: "userdata", subgrid: {root: "rows", repeatitems: !0,
                            cell: "cell"}}, a.p.jsonReader);
                        a.p.localReader = b.extend(!0, {root: "rows", page: "page", total: "total", records: "records", repeatitems: !1, cell: "cell", id: "id", userdata: "userdata", subgrid: {root: "rows", repeatitems: !0, cell: "cell"}}, a.p.localReader);
                        a.p.scroll && (a.p.pgbuttons = !1, a.p.pginput = !1, a.p.rowList = []);
                        a.p.data.length && S();
                        var x = "<thead><tr class='ui-jqgrid-labels' role='rowheader'>", la, L, ea, ba, fa, A, n, W;
                        L = W = "";
                        if (!0 === a.p.shrinkToFit && !0 === a.p.forceFit)for (e = a.p.colModel.length - 1; 0 <= e; e--)if (!a.p.colModel[e].hidden) {
                            a.p.colModel[e].resizable = !1;
                            break
                        }
                        "horizontal" == a.p.viewsortcols[1] && (W = " ui-i-asc", L = " ui-i-desc");
                        la = k ? "class='ui-th-div-ie'" : "";
                        W = "<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc" + W + " ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-" + i + "'></span>" + ("<span sort='desc' class='ui-grid-ico-sort ui-icon-desc" + L + " ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-" + i + "'></span></span>");
                        for (e = 0; e < this.p.colNames.length; e++)L = a.p.headertitles ? ' title="' + b.jgrid.stripHtml(a.p.colNames[e]) +
                            '"' : "", x += "<th id='" + a.p.id + "_" + a.p.colModel[e].name + "' role='columnheader' class='ui-state-default ui-th-column ui-th-" + i + "'" + L + ">", L = a.p.colModel[e].index || a.p.colModel[e].name, x += "<div id='jqgh_" + a.p.id + "_" + a.p.colModel[e].name + "' " + la + ">" + a.p.colNames[e], a.p.colModel[e].width = a.p.colModel[e].width ? parseInt(a.p.colModel[e].width, 10) : 150, "boolean" !== typeof a.p.colModel[e].title && (a.p.colModel[e].title = !0), L == a.p.sortname && (a.p.lastsort = e), x += W + "</div></th>";
                        W = null;
                        b(this).append(x + "</tr></thead>");
                        b("thead tr:first th", this).hover(function () {
                            b(this).addClass("ui-state-hover")
                        }, function () {
                            b(this).removeClass("ui-state-hover")
                        });
                        if (this.p.multiselect) {
                            var ga = [], X;
                            b("#cb_" + b.jgrid.jqID(a.p.id), this).bind("click", function () {
                                a.p.selarrrow = [];
                                var c = a.p.frozenColumns === true ? a.p.id + "_frozen" : "";
                                if (this.checked) {
                                    b(a.rows).each(function (d) {
                                        if (d > 0 && !b(this).hasClass("ui-subgrid") && !b(this).hasClass("jqgroup") && !b(this).hasClass("ui-state-disabled")) {
                                            b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" + b.jgrid.jqID(this.id))[a.p.useProp ?
                                                "prop" : "attr"]("checked", true);
                                            b(this).addClass("ui-state-highlight").attr("aria-selected", "true");
                                            a.p.selarrrow.push(this.id);
                                            a.p.selrow = this.id;
                                            if (c) {
                                                b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" + b.jgrid.jqID(this.id), a.grid.fbDiv)[a.p.useProp ? "prop" : "attr"]("checked", true);
                                                b("#" + b.jgrid.jqID(this.id), a.grid.fbDiv).addClass("ui-state-highlight")
                                            }
                                        }
                                    });
                                    X = true;
                                    ga = []
                                } else {
                                    b(a.rows).each(function (d) {
                                        if (d > 0 && !b(this).hasClass("ui-subgrid") && !b(this).hasClass("ui-state-disabled")) {
                                            b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" +
                                                b.jgrid.jqID(this.id))[a.p.useProp ? "prop" : "attr"]("checked", false);
                                            b(this).removeClass("ui-state-highlight").attr("aria-selected", "false");
                                            ga.push(this.id);
                                            if (c) {
                                                b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" + b.jgrid.jqID(this.id), a.grid.fbDiv)[a.p.useProp ? "prop" : "attr"]("checked", false);
                                                b("#" + b.jgrid.jqID(this.id), a.grid.fbDiv).removeClass("ui-state-highlight")
                                            }
                                        }
                                    });
                                    a.p.selrow = null;
                                    X = false
                                }
                                b(a).triggerHandler("jqGridSelectAll", [X ? a.p.selarrrow : ga, X]);
                                b.isFunction(a.p.onSelectAll) && a.p.onSelectAll.call(a, X ? a.p.selarrrow :
                                    ga, X)
                            })
                        }
                        !0 === a.p.autowidth && (x = b(m).innerWidth(), a.p.width = 0 < x ? x : "nw");
                        (function () {
                            var d = 0, e = b.jgrid.cellWidth() ? 0 : o(a.p.cellLayout, 0), f = 0, g, i = o(a.p.scrollOffset, 0), j, k = false, l, m = 0, n = 0, p;
                            b.each(a.p.colModel, function () {
                                if (typeof this.hidden === "undefined")this.hidden = false;
                                this.widthOrg = j = o(this.width, 0);
                                if (this.hidden === false) {
                                    d = d + (j + e);
                                    this.fixed ? m = m + (j + e) : f++;
                                    n++
                                }
                            });
                            if (isNaN(a.p.width))a.p.width = d + (a.p.shrinkToFit === false && !isNaN(a.p.height) ? i : 0);
                            c.width = a.p.width;
                            a.p.tblwidth = d;
                            if (a.p.shrinkToFit ===
                                false && a.p.forceFit === true)a.p.forceFit = false;
                            if (a.p.shrinkToFit === true && f > 0) {
                                l = c.width - e * f - m;
                                if (!isNaN(a.p.height)) {
                                    l = l - i;
                                    k = true
                                }
                                d = 0;
                                b.each(a.p.colModel, function (b) {
                                    if (this.hidden === false && !this.fixed) {
                                        this.width = j = Math.round(l * this.width / (a.p.tblwidth - e * f - m));
                                        d = d + j;
                                        g = b
                                    }
                                });
                                p = 0;
                                k ? c.width - m - (d + e * f) !== i && (p = c.width - m - (d + e * f) - i) : !k && Math.abs(c.width - m - (d + e * f)) !== 1 && (p = c.width - m - (d + e * f));
                                a.p.colModel[g].width = a.p.colModel[g].width + p;
                                a.p.tblwidth = d + p + e * f + m;
                                if (a.p.tblwidth > a.p.width) {
                                    a.p.colModel[g].width =
                                        a.p.colModel[g].width - (a.p.tblwidth - parseInt(a.p.width, 10));
                                    a.p.tblwidth = a.p.width
                                }
                            }
                        })();
                        b(m).css("width", c.width + "px").append("<div class='ui-jqgrid-resize-mark' id='rs_m" + a.p.id + "'>&#160;</div>");
                        b(j).css("width", c.width + "px");
                        var x = b("thead:first", a).get(0), R = "";
                        a.p.footerrow && (R += "<table role='grid' style='width:" + a.p.tblwidth + "px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-" + i + "'>");
                        var j = b("tr:first", x),
                            Y = "<tr class='jqgfirstrow' role='row' style='height:auto'>";
                        a.p.disableClick = !1;
                        b("th", j).each(function (d) {
                            ea = a.p.colModel[d].width;
                            if (typeof a.p.colModel[d].resizable === "undefined")a.p.colModel[d].resizable = true;
                            if (a.p.colModel[d].resizable) {
                                ba = document.createElement("span");
                                b(ba).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-" + i);
                                b.browser.opera || b(ba).css("cursor", "col-resize");
                                b(this).addClass(a.p.resizeclass)
                            } else ba = "";
                            b(this).css("width", ea + "px").prepend(ba);
                            var e = "";
                            if (a.p.colModel[d].hidden) {
                                b(this).css("display",
                                    "none");
                                e = "display:none;"
                            }
                            Y = Y + ("<td role='gridcell' style='height:0px;width:" + ea + "px;" + e + "'></td>");
                            c.headers[d] = {width: ea, el: this};
                            fa = a.p.colModel[d].sortable;
                            if (typeof fa !== "boolean")fa = a.p.colModel[d].sortable = true;
                            e = a.p.colModel[d].name;
                            e == "cb" || e == "subgrid" || e == "rn" || a.p.viewsortcols[2] && b(">div", this).addClass("ui-jqgrid-sortable");
                            if (fa)if (a.p.viewsortcols[0]) {
                                b("div span.s-ico", this).show();
                                d == a.p.lastsort && b("div span.ui-icon-" + a.p.sortorder, this).removeClass("ui-state-disabled")
                            } else if (d ==
                                a.p.lastsort) {
                                b("div span.s-ico", this).show();
                                b("div span.ui-icon-" + a.p.sortorder, this).removeClass("ui-state-disabled")
                            }
                            a.p.footerrow && (R = R + ("<td role='gridcell' " + p(d, 0, "", null, "", false) + ">&#160;</td>"))
                        }).mousedown(function (d) {
                                if (b(d.target).closest("th>span.ui-jqgrid-resize").length == 1) {
                                    var e = ka(this);
                                    if (a.p.forceFit === true) {
                                        var f = a.p, g = e, i;
                                        for (i = e + 1; i < a.p.colModel.length; i++)if (a.p.colModel[i].hidden !== true) {
                                            g = i;
                                            break
                                        }
                                        f.nv = g - e
                                    }
                                    c.dragStart(e, d, oa(e));
                                    return false
                                }
                            }).click(function (c) {
                                if (a.p.disableClick)return a.p.disableClick =
                                    false;
                                var d = "th>div.ui-jqgrid-sortable", e, f;
                                a.p.viewsortcols[2] || (d = "th>div>span>span.ui-grid-ico-sort");
                                c = b(c.target).closest(d);
                                if (c.length == 1) {
                                    d = ka(this);
                                    if (!a.p.viewsortcols[2]) {
                                        e = true;
                                        f = c.attr("sort")
                                    }
                                    ja(b("div", this)[0].id, d, e, f);
                                    return false
                                }
                            });
                        if (a.p.sortable && b.fn.sortable)try {
                            b(a).jqGrid("sortableColumns", j)
                        } catch (sa) {
                        }
                        a.p.footerrow && (R += "</tr></tbody></table>");
                        Y += "</tr>";
                        this.appendChild(document.createElement("tbody"));
                        b(this).addClass("ui-jqgrid-btable").append(Y);
                        var Y = null, j = b("<table class='ui-jqgrid-htable' style='width:" +
                            a.p.tblwidth + "px' role='grid' aria-labelledby='gbox_" + this.id + "' cellspacing='0' cellpadding='0' border='0'></table>").append(x), D = a.p.caption && !0 === a.p.hiddengrid ? !0 : !1;
                        e = b("<div class='ui-jqgrid-hbox" + ("rtl" == i ? "-rtl" : "") + "'></div>");
                        x = null;
                        c.hDiv = document.createElement("div");
                        b(c.hDiv).css({width: c.width + "px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(e);
                        b(e).append(j);
                        j = null;
                        D && b(c.hDiv).hide();
                        a.p.pager && ("string" == typeof a.p.pager ? "#" != a.p.pager.substr(0, 1) && (a.p.pager = "#" + a.p.pager) :
                            a.p.pager = "#" + b(a.p.pager).attr("id"), b(a.p.pager).css({width: c.width + "px"}).appendTo(m).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom"), D && b(a.p.pager).hide(), l(a.p.pager, ""));
                        !1 === a.p.cellEdit && !0 === a.p.hoverrows && b(a).bind("mouseover",function (a) {
                            n = b(a.target).closest("tr.jqgrow");
                            b(n).attr("class") !== "ui-subgrid" && b(n).addClass("ui-state-hover")
                        }).bind("mouseout", function (a) {
                                n = b(a.target).closest("tr.jqgrow");
                                b(n).removeClass("ui-state-hover")
                            });
                        var t, E, ha;
                        b(a).before(c.hDiv).click(function (c) {
                            A =
                                c.target;
                            n = b(A, a.rows).closest("tr.jqgrow");
                            if (b(n).length === 0 || n[0].className.indexOf("ui-state-disabled") > -1 || (b(A, a).closest("table.ui-jqgrid-btable").attr("id") || "").replace("_frozen", "") !== a.id)return this;
                            var d = b(A).hasClass("cbox"), e = b(a).triggerHandler("jqGridBeforeSelectRow", [n[0].id, c]);
                            (e = e === false || e === "stop" ? false : true) && b.isFunction(a.p.beforeSelectRow) && (e = a.p.beforeSelectRow.call(a, n[0].id, c));
                            if (!(A.tagName == "A" || (A.tagName == "INPUT" || A.tagName == "TEXTAREA" || A.tagName == "OPTION" || A.tagName ==
                                "SELECT") && !d) && e === true) {
                                t = n[0].id;
                                E = b.jgrid.getCellIndex(A);
                                ha = b(A).closest("td,th").html();
                                b(a).triggerHandler("jqGridCellSelect", [t, E, ha, c]);
                                b.isFunction(a.p.onCellSelect) && a.p.onCellSelect.call(a, t, E, ha, c);
                                if (a.p.cellEdit === true)if (a.p.multiselect && d)b(a).jqGrid("setSelection", t, true, c); else {
                                    t = n[0].rowIndex;
                                    try {
                                        b(a).jqGrid("editCell", t, E, true)
                                    } catch (f) {
                                    }
                                } else if (a.p.multikey)if (c[a.p.multikey])b(a).jqGrid("setSelection", t, true, c); else {
                                    if (a.p.multiselect && d) {
                                        d = b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" +
                                            t).is(":checked");
                                        b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" + t)[a.p.useProp ? "prop" : "attr"]("checked", d)
                                    }
                                } else {
                                    if (a.p.multiselect && a.p.multiboxonly && !d) {
                                        var g = a.p.frozenColumns ? a.p.id + "_frozen" : "";
                                        b(a.p.selarrrow).each(function (c, d) {
                                            var e = a.rows.namedItem(d);
                                            b(e).removeClass("ui-state-highlight");
                                            b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" + b.jgrid.jqID(d))[a.p.useProp ? "prop" : "attr"]("checked", false);
                                            if (g) {
                                                b("#" + b.jgrid.jqID(d), "#" + b.jgrid.jqID(g)).removeClass("ui-state-highlight");
                                                b("#jqg_" + b.jgrid.jqID(a.p.id) + "_" +
                                                    b.jgrid.jqID(d), "#" + b.jgrid.jqID(g))[a.p.useProp ? "prop" : "attr"]("checked", false)
                                            }
                                        });
                                        a.p.selarrrow = []
                                    }
                                    b(a).jqGrid("setSelection", t, true, c)
                                }
                            }
                        }).bind("reloadGrid",function (c, d) {
                                if (a.p.treeGrid === true)a.p.datatype = a.p.treedatatype;
                                d && d.current && a.grid.selectionPreserver(a);
                                if (a.p.datatype == "local") {
                                    b(a).jqGrid("resetSelection");
                                    a.p.data.length && S()
                                } else if (!a.p.treeGrid) {
                                    a.p.selrow = null;
                                    if (a.p.multiselect) {
                                        a.p.selarrrow = [];
                                        da(false)
                                    }
                                    a.p.savedRow = []
                                }
                                a.p.scroll && N.call(a, true, false);
                                if (d && d.page) {
                                    var e =
                                        d.page;
                                    if (e > a.p.lastpage)e = a.p.lastpage;
                                    e < 1 && (e = 1);
                                    a.p.page = e;
                                    a.grid.bDiv.scrollTop = a.grid.prevRowHeight ? (e - 1) * a.grid.prevRowHeight * a.p.rowNum : 0
                                }
                                if (a.grid.prevRowHeight && a.p.scroll) {
                                    delete a.p.lastpage;
                                    a.grid.populateVisible()
                                } else a.grid.populate();
                                a.p._inlinenav === true && b(a).jqGrid("showAddEditButtons");
                                return false
                            }).dblclick(function (c) {
                                A = c.target;
                                n = b(A, a.rows).closest("tr.jqgrow");
                                if (b(n).length !== 0) {
                                    t = n[0].rowIndex;
                                    E = b.jgrid.getCellIndex(A);
                                    b(a).triggerHandler("jqGridDblClickRow", [b(n).attr("id"),
                                        t, E, c]);
                                    b.isFunction(this.p.ondblClickRow) && a.p.ondblClickRow.call(a, b(n).attr("id"), t, E, c)
                                }
                            }).bind("contextmenu", function (c) {
                                A = c.target;
                                n = b(A, a.rows).closest("tr.jqgrow");
                                if (b(n).length !== 0) {
                                    a.p.multiselect || b(a).jqGrid("setSelection", n[0].id, true, c);
                                    t = n[0].rowIndex;
                                    E = b.jgrid.getCellIndex(A);
                                    b(a).triggerHandler("jqGridRightClickRow", [b(n).attr("id"), t, E, c]);
                                    b.isFunction(this.p.onRightClickRow) && a.p.onRightClickRow.call(a, b(n).attr("id"), t, E, c)
                                }
                            });
                        c.bDiv = document.createElement("div");
                        k && "auto" ===
                            ("" + a.p.height).toLowerCase() && (a.p.height = "100%");
                        b(c.bDiv).append(b('<div style="position:relative;' + (k && 8 > b.browser.version ? "height:0.01%;" : "") + '"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height: a.p.height + (isNaN(a.p.height) ? "" : "px"), width: c.width + "px"}).scroll(c.scrollGrid);
                        b("table:first", c.bDiv).css({width: a.p.tblwidth + "px"});
                        k ? (2 == b("tbody", this).size() && b("tbody:gt(0)", this).remove(), a.p.multikey && b(c.bDiv).bind("selectstart", function () {
                            return false
                        })) :
                            a.p.multikey && b(c.bDiv).bind("mousedown", function () {
                                return false
                            });
                        D && b(c.bDiv).hide();
                        c.cDiv = document.createElement("div");
                        var ia = !0 === a.p.hidegrid ? b("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function () {
                            ia.addClass("ui-state-hover")
                        },function () {
                            ia.removeClass("ui-state-hover")
                        }).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css("rtl" == i ? "left" : "right", "0px") : "";
                        b(c.cDiv).append(ia).append("<span class='ui-jqgrid-title" +
                            ("rtl" == i ? "-rtl" : "") + "'>" + a.p.caption + "</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");
                        b(c.cDiv).insertBefore(c.hDiv);
                        a.p.toolbar[0] && (c.uDiv = document.createElement("div"), "top" == a.p.toolbar[1] ? b(c.uDiv).insertBefore(c.hDiv) : "bottom" == a.p.toolbar[1] && b(c.uDiv).insertAfter(c.hDiv), "both" == a.p.toolbar[1] ? (c.ubDiv = document.createElement("div"), b(c.uDiv).insertBefore(c.hDiv).addClass("ui-userdata ui-state-default").attr("id", "t_" + this.id), b(c.ubDiv).insertAfter(c.hDiv).addClass("ui-userdata ui-state-default").attr("id",
                            "tb_" + this.id), D && b(c.ubDiv).hide()) : b(c.uDiv).width(c.width).addClass("ui-userdata ui-state-default").attr("id", "t_" + this.id), D && b(c.uDiv).hide());
                        a.p.toppager && (a.p.toppager = b.jgrid.jqID(a.p.id) + "_toppager", c.topDiv = b("<div id='" + a.p.toppager + "'></div>")[0], a.p.toppager = "#" + a.p.toppager, b(c.topDiv).insertBefore(c.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(c.width), l(a.p.toppager, "_t"));
                        a.p.footerrow && (c.sDiv = b("<div class='ui-jqgrid-sdiv'></div>")[0], e = b("<div class='ui-jqgrid-hbox" +
                            ("rtl" == i ? "-rtl" : "") + "'></div>"), b(c.sDiv).append(e).insertAfter(c.hDiv).width(c.width), b(e).append(R), c.footers = b(".ui-jqgrid-ftable", c.sDiv)[0].rows[0].cells, a.p.rownumbers && (c.footers[0].className = "ui-state-default jqgrid-rownum"), D && b(c.sDiv).hide());
                        e = null;
                        if (a.p.caption) {
                            var pa = a.p.datatype;
                            !0 === a.p.hidegrid && (b(".ui-jqgrid-titlebar-close", c.cDiv).click(function (d) {
                                var e = b.isFunction(a.p.onHeaderClick), f = ".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv", g, i = this;
                                if (a.p.toolbar[0] ===
                                    true) {
                                    a.p.toolbar[1] == "both" && (f = f + (", #" + b(c.ubDiv).attr("id")));
                                    f = f + (", #" + b(c.uDiv).attr("id"))
                                }
                                g = b(f, "#gview_" + b.jgrid.jqID(a.p.id)).length;
                                a.p.gridstate == "visible" ? b(f, "#gbox_" + b.jgrid.jqID(a.p.id)).slideUp("fast", function () {
                                    g--;
                                    if (g === 0) {
                                        b("span", i).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");
                                        a.p.gridstate = "hidden";
                                        b("#gbox_" + b.jgrid.jqID(a.p.id)).hasClass("ui-resizable") && b(".ui-resizable-handle", "#gbox_" + b.jgrid.jqID(a.p.id)).hide();
                                        b(a).triggerHandler("jqGridHeaderClick",
                                            [a.p.gridstate, d]);
                                        e && (D || a.p.onHeaderClick.call(a, a.p.gridstate, d))
                                    }
                                }) : a.p.gridstate == "hidden" && b(f, "#gbox_" + b.jgrid.jqID(a.p.id)).slideDown("fast", function () {
                                    g--;
                                    if (g === 0) {
                                        b("span", i).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");
                                        if (D) {
                                            a.p.datatype = pa;
                                            I();
                                            D = false
                                        }
                                        a.p.gridstate = "visible";
                                        b("#gbox_" + b.jgrid.jqID(a.p.id)).hasClass("ui-resizable") && b(".ui-resizable-handle", "#gbox_" + b.jgrid.jqID(a.p.id)).show();
                                        b(a).triggerHandler("jqGridHeaderClick", [a.p.gridstate, d]);
                                        e && (D || a.p.onHeaderClick.call(a, a.p.gridstate, d))
                                    }
                                });
                                return false
                            }), D && (a.p.datatype = "local", b(".ui-jqgrid-titlebar-close", c.cDiv).trigger("click")))
                        } else b(c.cDiv).hide();
                        b(c.hDiv).after(c.bDiv).mousemove(function (a) {
                            if (c.resizing) {
                                c.dragMove(a);
                                return false
                            }
                        });
                        b(".ui-jqgrid-labels", c.hDiv).bind("selectstart", function () {
                            return false
                        });
                        b(document).mouseup(function () {
                            if (c.resizing) {
                                c.dragEnd();
                                return false
                            }
                            return true
                        });
                        a.formatCol = p;
                        a.sortData = ja;
                        a.updatepager = function (c, d) {
                            var e, f, g, h, i, j, k, l = "",
                                m = a.p.pager ? "_" + b.jgrid.jqID(a.p.pager.substr(1)) : "", n = a.p.toppager ? "_" + a.p.toppager.substr(1) : "";
                            g = parseInt(a.p.page, 10) - 1;
                            g < 0 && (g = 0);
                            g = g * parseInt(a.p.rowNum, 10);
                            i = g + a.p.reccount;
                            if (a.p.scroll) {
                                e = b("tbody:first > tr:gt(0)", a.grid.bDiv);
                                g = i - e.length;
                                a.p.reccount = e.length;
                                if (f = e.outerHeight() || a.grid.prevRowHeight) {
                                    e = g * f;
                                    f = parseInt(a.p.records, 10) * f;
                                    b(">div:first", a.grid.bDiv).css({height: f}).children("div:first").css({height: e, display: e ? "" : "none"})
                                }
                                a.grid.bDiv.scrollLeft = a.grid.hDiv.scrollLeft
                            }
                            l =
                                a.p.pager ? a.p.pager : "";
                            if (l = l + (a.p.toppager ? l ? "," + a.p.toppager : a.p.toppager : "")) {
                                k = b.jgrid.formatter.integer || {};
                                e = o(a.p.page);
                                f = o(a.p.lastpage);
                                b(".selbox", l)[this.p.useProp ? "prop" : "attr"]("disabled", false);
                                if (a.p.pginput === true) {
                                    b(".ui-pg-input", l).val(a.p.page);
                                    h = a.p.toppager ? "#sp_1" + m + ",#sp_1" + n : "#sp_1" + m;
                                    b(h).html(b.fmatter ? b.fmatter.util.NumberFormat(a.p.lastpage, k) : a.p.lastpage)
                                }
                                if (a.p.viewrecords)if (a.p.reccount === 0)b(".ui-paging-info", l).html(a.p.emptyrecords); else {
                                    h = g + 1;
                                    j = a.p.records;
                                    if (b.fmatter) {
                                        h =
                                            b.fmatter.util.NumberFormat(h, k);
                                        i = b.fmatter.util.NumberFormat(i, k);
                                        j = b.fmatter.util.NumberFormat(j, k)
                                    }
                                    b(".ui-paging-info", l).html(b.jgrid.format(a.p.recordtext, h, i, j))
                                }
                                if (a.p.pgbuttons === true) {
                                    e <= 0 && (e = f = 0);
                                    if (e == 1 || e === 0) {
                                        b("#first" + m + ", #prev" + m).addClass("ui-state-disabled").removeClass("ui-state-hover");
                                        a.p.toppager && b("#first_t" + n + ", #prev_t" + n).addClass("ui-state-disabled").removeClass("ui-state-hover")
                                    } else {
                                        b("#first" + m + ", #prev" + m).removeClass("ui-state-disabled");
                                        a.p.toppager && b("#first_t" +
                                            n + ", #prev_t" + n).removeClass("ui-state-disabled")
                                    }
                                    if (e == f || e === 0) {
                                        b("#next" + m + ", #last" + m).addClass("ui-state-disabled").removeClass("ui-state-hover");
                                        a.p.toppager && b("#next_t" + n + ", #last_t" + n).addClass("ui-state-disabled").removeClass("ui-state-hover")
                                    } else {
                                        b("#next" + m + ", #last" + m).removeClass("ui-state-disabled");
                                        a.p.toppager && b("#next_t" + n + ", #last_t" + n).removeClass("ui-state-disabled")
                                    }
                                }
                            }
                            c === true && a.p.rownumbers === true && b("td.jqgrid-rownum", a.rows).each(function (a) {
                                b(this).html(g + 1 + a)
                            });
                            d && a.p.jqgdnd &&
                            b(a).jqGrid("gridDnD", "updateDnD");
                            b(a).triggerHandler("jqGridGridComplete");
                            b.isFunction(a.p.gridComplete) && a.p.gridComplete.call(a);
                            b(a).triggerHandler("jqGridAfterGridComplete")
                        };
                        a.refreshIndex = S;
                        a.setHeadCheckBox = da;
                        a.constructTr = J;
                        a.formatter = function (a, b, c, d, e) {
                            return u(a, b, c, d, e)
                        };
                        b.extend(c, {populate: I, emptyRows: N});
                        this.grid = c;
                        a.addXmlData = function (b) {
                            $(b, a.grid.bDiv)
                        };
                        a.addJSONData = function (b) {
                            aa(b, a.grid.bDiv)
                        };
                        this.grid.cols = this.rows[0].cells;
                        I();
                        a.p.hiddengrid = !1;
                        b(window).unload(function () {
                            a =
                                null
                        })
                    }
                }
            }
        })
    };
    b.jgrid.extend({getGridParam: function (b) {
        var e = this[0];
        return!e || !e.grid ? void 0 : b ? "undefined" != typeof e.p[b] ? e.p[b] : null : e.p
    }, setGridParam: function (f) {
        return this.each(function () {
            this.grid && "object" === typeof f && b.extend(!0, this.p, f)
        })
    }, getDataIDs: function () {
        var f = [], e = 0, c, d = 0;
        this.each(function () {
            if ((c = this.rows.length) && 0 < c)for (; e < c;)b(this.rows[e]).hasClass("jqgrow") && (f[d] = this.rows[e].id, d++), e++
        });
        return f
    }, setSelection: function (f, e, c) {
        return this.each(function () {
            var d, a, h, g, i, j;
            if (void 0 !== f && (e = !1 === e ? !1 : !0, (a = this.rows.namedItem(f + "")) && a.className && !(-1 < a.className.indexOf("ui-state-disabled"))))(!0 === this.p.scrollrows && (h = this.rows.namedItem(f).rowIndex, 0 <= h && (d = b(this.grid.bDiv)[0].clientHeight, g = b(this.grid.bDiv)[0].scrollTop, i = this.rows[h].offsetTop, h = this.rows[h].clientHeight, i + h >= d + g ? b(this.grid.bDiv)[0].scrollTop = i - (d + g) + h + g : i < d + g && i < g && (b(this.grid.bDiv)[0].scrollTop = i))), !0 === this.p.frozenColumns && (j = this.p.id + "_frozen"), this.p.multiselect) ? (this.setHeadCheckBox(!1),
                this.p.selrow = a.id, g = b.inArray(this.p.selrow, this.p.selarrrow), -1 === g ? ("ui-subgrid" !== a.className && b(a).addClass("ui-state-highlight").attr("aria-selected", "true"), d = !0, this.p.selarrrow.push(this.p.selrow)) : ("ui-subgrid" !== a.className && b(a).removeClass("ui-state-highlight").attr("aria-selected", "false"), d = !1, this.p.selarrrow.splice(g, 1), i = this.p.selarrrow[0], this.p.selrow = void 0 === i ? null : i), b("#jqg_" + b.jgrid.jqID(this.p.id) + "_" + b.jgrid.jqID(a.id))[this.p.useProp ? "prop" : "attr"]("checked", d), j && (-1 ===
                g ? b("#" + b.jgrid.jqID(f), "#" + b.jgrid.jqID(j)).addClass("ui-state-highlight") : b("#" + b.jgrid.jqID(f), "#" + b.jgrid.jqID(j)).removeClass("ui-state-highlight"), b("#jqg_" + b.jgrid.jqID(this.p.id) + "_" + b.jgrid.jqID(f), "#" + b.jgrid.jqID(j))[this.p.useProp ? "prop" : "attr"]("checked", d)), b(this).triggerHandler("jqGridSelectRow", [a.id, d, c]), this.p.onSelectRow && e && this.p.onSelectRow.call(this, a.id, d, c)) : "ui-subgrid" !== a.className && (this.p.selrow != a.id ? (b(this.rows.namedItem(this.p.selrow)).removeClass("ui-state-highlight").attr({"aria-selected": "false",
                tabindex: "-1"}), b(a).addClass("ui-state-highlight").attr({"aria-selected": "true", tabindex: "0"}), j && (b("#" + b.jgrid.jqID(this.p.selrow), "#" + b.jgrid.jqID(j)).removeClass("ui-state-highlight"), b("#" + b.jgrid.jqID(f), "#" + b.jgrid.jqID(j)).addClass("ui-state-highlight")), d = !0) : d = !1, this.p.selrow = a.id, b(this).triggerHandler("jqGridSelectRow", [a.id, d, c]), this.p.onSelectRow && e && this.p.onSelectRow.call(this, a.id, d, c))
        })
    }, resetSelection: function (f) {
        return this.each(function () {
            var e = this, c, d, a;
            !0 === e.p.frozenColumns &&
            (a = e.p.id + "_frozen");
            if ("undefined" !== typeof f) {
                d = f === e.p.selrow ? e.p.selrow : f;
                b("#" + b.jgrid.jqID(e.p.id) + " tbody:first tr#" + b.jgrid.jqID(d)).removeClass("ui-state-highlight").attr("aria-selected", "false");
                a && b("#" + b.jgrid.jqID(d), "#" + b.jgrid.jqID(a)).removeClass("ui-state-highlight");
                if (e.p.multiselect) {
                    b("#jqg_" + b.jgrid.jqID(e.p.id) + "_" + b.jgrid.jqID(d), "#" + b.jgrid.jqID(e.p.id))[e.p.useProp ? "prop" : "attr"]("checked", !1);
                    if (a)b("#jqg_" + b.jgrid.jqID(e.p.id) + "_" + b.jgrid.jqID(d), "#" + b.jgrid.jqID(a))[e.p.useProp ?
                        "prop" : "attr"]("checked", !1);
                    e.setHeadCheckBox(!1)
                }
                d = null
            } else e.p.multiselect ? (b(e.p.selarrrow).each(function (d, f) {
                c = e.rows.namedItem(f);
                b(c).removeClass("ui-state-highlight").attr("aria-selected", "false");
                b("#jqg_" + b.jgrid.jqID(e.p.id) + "_" + b.jgrid.jqID(f))[e.p.useProp ? "prop" : "attr"]("checked", !1);
                a && (b("#" + b.jgrid.jqID(f), "#" + b.jgrid.jqID(a)).removeClass("ui-state-highlight"), b("#jqg_" + b.jgrid.jqID(e.p.id) + "_" + b.jgrid.jqID(f), "#" + b.jgrid.jqID(a))[e.p.useProp ? "prop" : "attr"]("checked", !1))
            }), e.setHeadCheckBox(!1),
                e.p.selarrrow = []) : e.p.selrow && (b("#" + b.jgrid.jqID(e.p.id) + " tbody:first tr#" + b.jgrid.jqID(e.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected", "false"), a && b("#" + b.jgrid.jqID(e.p.selrow), "#" + b.jgrid.jqID(a)).removeClass("ui-state-highlight"), e.p.selrow = null);
            !0 === e.p.cellEdit && 0 <= parseInt(e.p.iCol, 10) && 0 <= parseInt(e.p.iRow, 10) && (b("td:eq(" + e.p.iCol + ")", e.rows[e.p.iRow]).removeClass("edit-cell ui-state-highlight"), b(e.rows[e.p.iRow]).removeClass("selected-row ui-state-hover"));
            e.p.savedRow =
                []
        })
    }, getRowData: function (f) {
        var e = {}, c, d = !1, a, h = 0;
        this.each(function () {
            var g = this, i, j;
            if ("undefined" == typeof f)d = !0, c = [], a = g.rows.length; else {
                j = g.rows.namedItem(f);
                if (!j)return e;
                a = 2
            }
            for (; h < a;)d && (j = g.rows[h]), b(j).hasClass("jqgrow") && (b('td[role="gridcell"]', j).each(function (a) {
                i = g.p.colModel[a].name;
                if ("cb" !== i && "subgrid" !== i && "rn" !== i)if (!0 === g.p.treeGrid && i == g.p.ExpandColumn)e[i] = b.jgrid.htmlDecode(b("span:first", this).html()); else try {
                    e[i] = b.unformat.call(g, this, {rowId: j.id, colModel: g.p.colModel[a]},
                        a)
                } catch (c) {
                    e[i] = b.jgrid.htmlDecode(b(this).html())
                }
            }), d && (c.push(e), e = {})), h++
        });
        return c ? c : e
    }, delRowData: function (f) {
        var e = !1, c, d;
        this.each(function () {
            if (c = this.rows.namedItem(f)) {
                if (b(c).remove(), this.p.records--, this.p.reccount--, this.updatepager(!0, !1), e = !0, this.p.multiselect && (d = b.inArray(f, this.p.selarrrow), -1 != d && this.p.selarrrow.splice(d, 1)), f == this.p.selrow)this.p.selrow = null
            } else return!1;
            if ("local" == this.p.datatype) {
                var a = this.p._index[b.jgrid.stripPref(this.p.idPrefix, f)];
                "undefined" != typeof a && (this.p.data.splice(a, 1), this.refreshIndex())
            }
            if (!0 === this.p.altRows && e) {
                var h = this.p.altclass;
                b(this.rows).each(function (a) {
                    1 == a % 2 ? b(this).addClass(h) : b(this).removeClass(h)
                })
            }
        });
        return e
    }, setRowData: function (f, e, c) {
        var d, a = !0, h;
        this.each(function () {
            if (!this.grid)return!1;
            var g = this, i, j, l = typeof c, k = {};
            j = g.rows.namedItem(f);
            if (!j)return!1;
            if (e)try {
                if (b(this.p.colModel).each(function (a) {
                    d = this.name;
                    void 0 !== e[d] && (k[d] = this.formatter && "string" === typeof this.formatter && "date" == this.formatter ?
                        b.unformat.date.call(g, e[d], this) : e[d], i = g.formatter(f, e[d], a, e, "edit"), h = this.title ? {title: b.jgrid.stripHtml(i)} : {}, !0 === g.p.treeGrid && d == g.p.ExpandColumn ? b("td:eq(" + a + ") > span:first", j).html(i).attr(h) : b("td:eq(" + a + ")", j).html(i).attr(h))
                }), "local" == g.p.datatype) {
                    var m = b.jgrid.stripPref(g.p.idPrefix, f), o = g.p._index[m];
                    if (g.p.treeGrid)for (var p in g.p.treeReader)k.hasOwnProperty(g.p.treeReader[p]) && delete k[g.p.treeReader[p]];
                    "undefined" != typeof o && (g.p.data[o] = b.extend(!0, g.p.data[o], k));
                    k = null
                }
            } catch (v) {
                a = !1
            }
            a && ("string" === l ? b(j).addClass(c) : "object" === l && b(j).css(c), b(g).triggerHandler("jqGridAfterGridComplete"))
        });
        return a
    }, addRowData: function (f, e, c, d) {
        c || (c = "last");
        var a = !1, h, g, i, j, l, k, m, o, p = "", v, u, M, F, Z, U;
        e && (b.isArray(e) ? (v = !0, c = "last", u = f) : (e = [e], v = !1), this.each(function () {
            var V = e.length;
            l = this.p.rownumbers === true ? 1 : 0;
            i = this.p.multiselect === true ? 1 : 0;
            j = this.p.subGrid === true ? 1 : 0;
            if (!v)if (typeof f != "undefined")f = f + ""; else {
                f = b.jgrid.randId();
                if (this.p.keyIndex !== false) {
                    u = this.p.colModel[this.p.keyIndex +
                        i + j + l].name;
                    typeof e[0][u] != "undefined" && (f = e[0][u])
                }
            }
            M = this.p.altclass;
            for (var N = 0, S = "", J = {}, $ = b.isFunction(this.p.afterInsertRow) ? true : false; N < V;) {
                F = e[N];
                g = [];
                if (v) {
                    try {
                        f = F[u]
                    } catch (aa) {
                        f = b.jgrid.randId()
                    }
                    S = this.p.altRows === true ? (this.rows.length - 1) % 2 === 0 ? M : "" : ""
                }
                U = f;
                f = this.p.idPrefix + f;
                if (l) {
                    p = this.formatCol(0, 1, "", null, f, true);
                    g[g.length] = '<td role="gridcell" class="ui-state-default jqgrid-rownum" ' + p + ">0</td>"
                }
                if (i) {
                    o = '<input role="checkbox" type="checkbox" id="jqg_' + this.p.id + "_" + f + '" class="cbox"/>';
                    p = this.formatCol(l, 1, "", null, f, true);
                    g[g.length] = '<td role="gridcell" ' + p + ">" + o + "</td>"
                }
                j && (g[g.length] = b(this).jqGrid("addSubGridCell", i + l, 1));
                for (m = i + j + l; m < this.p.colModel.length; m++) {
                    Z = this.p.colModel[m];
                    h = Z.name;
                    J[h] = F[h];
                    o = this.formatter(f, b.jgrid.getAccessor(F, h), m, F);
                    p = this.formatCol(m, 1, o, F, f, true);
                    g[g.length] = '<td role="gridcell" ' + p + ">" + o + "</td>"
                }
                g.unshift(this.constructTr(f, false, S, J, J));
                g[g.length] = "</tr>";
                if (this.rows.length === 0)b("table:first", this.grid.bDiv).append(g.join("")); else switch (c) {
                    case "last":
                        b(this.rows[this.rows.length -
                            1]).after(g.join(""));
                        k = this.rows.length - 1;
                        break;
                    case "first":
                        b(this.rows[0]).after(g.join(""));
                        k = 1;
                        break;
                    case "after":
                        (k = this.rows.namedItem(d)) && (b(this.rows[k.rowIndex + 1]).hasClass("ui-subgrid") ? b(this.rows[k.rowIndex + 1]).after(g) : b(k).after(g.join("")));
                        k++;
                        break;
                    case "before":
                        if (k = this.rows.namedItem(d)) {
                            b(k).before(g.join(""));
                            k = k.rowIndex
                        }
                        k--
                }
                this.p.subGrid === true && b(this).jqGrid("addSubGrid", i + l, k);
                this.p.records++;
                this.p.reccount++;
                b(this).triggerHandler("jqGridAfterInsertRow", [f, F, F]);
                $ &&
                this.p.afterInsertRow.call(this, f, F, F);
                N++;
                if (this.p.datatype == "local") {
                    J[this.p.localReader.id] = U;
                    this.p._index[U] = this.p.data.length;
                    this.p.data.push(J);
                    J = {}
                }
            }
            this.p.altRows === true && !v && (c == "last" ? (this.rows.length - 1) % 2 == 1 && b(this.rows[this.rows.length - 1]).addClass(M) : b(this.rows).each(function (a) {
                a % 2 == 1 ? b(this).addClass(M) : b(this).removeClass(M)
            }));
            this.updatepager(true, true);
            a = true
        }));
        return a
    }, footerData: function (f, e, c) {
        function d(a) {
            for (var b in a)if (a.hasOwnProperty(b))return!1;
            return!0
        }

        var a,
            h = !1, g = {}, i;
        "undefined" == typeof f && (f = "get");
        "boolean" != typeof c && (c = !0);
        f = f.toLowerCase();
        this.each(function () {
            var j = this, l;
            if (!j.grid || !j.p.footerrow || "set" == f && d(e))return!1;
            h = !0;
            b(this.p.colModel).each(function (d) {
                a = this.name;
                "set" == f ? void 0 !== e[a] && (l = c ? j.formatter("", e[a], d, e, "edit") : e[a], i = this.title ? {title: b.jgrid.stripHtml(l)} : {}, b("tr.footrow td:eq(" + d + ")", j.grid.sDiv).html(l).attr(i), h = !0) : "get" == f && (g[a] = b("tr.footrow td:eq(" + d + ")", j.grid.sDiv).html())
            })
        });
        return"get" == f ? g : h
    }, showHideCol: function (f, e) {
        return this.each(function () {
            var c = this, d = !1, a = b.jgrid.cellWidth() ? 0 : c.p.cellLayout, h;
            if (c.grid) {
                "string" === typeof f && (f = [f]);
                e = "none" != e ? "" : "none";
                var g = "" === e ? !0 : !1, i = c.p.groupHeader && ("object" === typeof c.p.groupHeader || b.isFunction(c.p.groupHeader));
                i && b(c).jqGrid("destroyGroupHeader", !1);
                b(this.p.colModel).each(function (i) {
                    if (-1 !== b.inArray(this.name, f) && this.hidden === g) {
                        if (!0 === c.p.frozenColumns && !0 === this.frozen)return!0;
                        b("tr", c.grid.hDiv).each(function () {
                            b(this.cells[i]).css("display", e)
                        });
                        b(c.rows).each(function () {
                            b(this).hasClass("jqgroup") || b(this.cells[i]).css("display", e)
                        });
                        c.p.footerrow && b("tr.footrow td:eq(" + i + ")", c.grid.sDiv).css("display", e);
                        h = parseInt(this.width, 10);
                        c.p.tblwidth = "none" === e ? c.p.tblwidth - (h + a) : c.p.tblwidth + (h + a);
                        this.hidden = !g;
                        d = !0;
                        b(c).triggerHandler("jqGridShowHideCol", [g, this.name, i])
                    }
                });
                !0 === d && (!0 === c.p.shrinkToFit && !isNaN(c.p.height) && (c.p.tblwidth += parseInt(c.p.scrollOffset, 10)), b(c).jqGrid("setGridWidth", !0 === c.p.shrinkToFit ? c.p.tblwidth : c.p.width));
                i && b(c).jqGrid("setGroupHeaders", c.p.groupHeader)
            }
        })
    }, hideCol: function (f) {
        return this.each(function () {
            b(this).jqGrid("showHideCol", f, "none")
        })
    }, showCol: function (f) {
        return this.each(function () {
            b(this).jqGrid("showHideCol", f, "")
        })
    }, remapColumns: function (f, e, c) {
        function d(a) {
            var c;
            c = a.length ? b.makeArray(a) : b.extend({}, a);
            b.each(f, function (b) {
                a[b] = c[this]
            })
        }

        function a(a, c) {
            b(">tr" + (c || ""), a).each(function () {
                var a = this, c = b.makeArray(a.cells);
                b.each(f, function () {
                    var b = c[this];
                    b && a.appendChild(b)
                })
            })
        }

        var h =
            this.get(0);
        d(h.p.colModel);
        d(h.p.colNames);
        d(h.grid.headers);
        a(b("thead:first", h.grid.hDiv), c && ":not(.ui-jqgrid-labels)");
        e && a(b("#" + b.jgrid.jqID(h.p.id) + " tbody:first"), ".jqgfirstrow, tr.jqgrow, tr.jqfoot");
        h.p.footerrow && a(b("tbody:first", h.grid.sDiv));
        h.p.remapColumns && (h.p.remapColumns.length ? d(h.p.remapColumns) : h.p.remapColumns = b.makeArray(f));
        h.p.lastsort = b.inArray(h.p.lastsort, f);
        h.p.treeGrid && (h.p.expColInd = b.inArray(h.p.expColInd, f));
        b(h).triggerHandler("jqGridRemapColumns", [f, e, c])
    }, setGridWidth: function (f, e) {
        return this.each(function () {
            if (this.grid) {
                var c = this, d, a = 0, h = b.jgrid.cellWidth() ? 0 : c.p.cellLayout, g, i = 0, j = !1, l = c.p.scrollOffset, k, m = 0, o = 0, p;
                "boolean" != typeof e && (e = c.p.shrinkToFit);
                if (!isNaN(f)) {
                    f = parseInt(f, 10);
                    c.grid.width = c.p.width = f;
                    b("#gbox_" + b.jgrid.jqID(c.p.id)).css("width", f + "px");
                    b("#gview_" + b.jgrid.jqID(c.p.id)).css("width", f + "px");
                    b(c.grid.bDiv).css("width", f + "px");
                    b(c.grid.hDiv).css("width", f + "px");
                    c.p.pager && b(c.p.pager).css("width", f + "px");
                    c.p.toppager && b(c.p.toppager).css("width",
                        f + "px");
                    !0 === c.p.toolbar[0] && (b(c.grid.uDiv).css("width", f + "px"), "both" == c.p.toolbar[1] && b(c.grid.ubDiv).css("width", f + "px"));
                    c.p.footerrow && b(c.grid.sDiv).css("width", f + "px");
                    !1 === e && !0 === c.p.forceFit && (c.p.forceFit = !1);
                    if (!0 === e) {
                        b.each(c.p.colModel, function () {
                            if (this.hidden === false) {
                                d = this.widthOrg;
                                a = a + (d + h);
                                this.fixed ? m = m + (d + h) : i++;
                                o++
                            }
                        });
                        if (0 === i)return;
                        c.p.tblwidth = a;
                        k = f - h * i - m;
                        if (!isNaN(c.p.height) && (b(c.grid.bDiv)[0].clientHeight < b(c.grid.bDiv)[0].scrollHeight || 1 === c.rows.length))j = !0, k -= l;
                        var a = 0, v = 0 < c.grid.cols.length;
                        b.each(c.p.colModel, function (b) {
                            if (this.hidden === false && !this.fixed) {
                                d = this.widthOrg;
                                d = Math.round(k * d / (c.p.tblwidth - h * i - m));
                                if (!(d < 0)) {
                                    this.width = d;
                                    a = a + d;
                                    c.grid.headers[b].width = d;
                                    c.grid.headers[b].el.style.width = d + "px";
                                    if (c.p.footerrow)c.grid.footers[b].style.width = d + "px";
                                    if (v)c.grid.cols[b].style.width = d + "px";
                                    g = b
                                }
                            }
                        });
                        if (!g)return;
                        p = 0;
                        j ? f - m - (a + h * i) !== l && (p = f - m - (a + h * i) - l) : 1 !== Math.abs(f - m - (a + h * i)) && (p = f - m - (a + h * i));
                        c.p.colModel[g].width += p;
                        c.p.tblwidth = a + p + h * i + m;
                        c.p.tblwidth >
                            f ? (j = c.p.tblwidth - parseInt(f, 10), c.p.tblwidth = f, d = c.p.colModel[g].width -= j) : d = c.p.colModel[g].width;
                        c.grid.headers[g].width = d;
                        c.grid.headers[g].el.style.width = d + "px";
                        v && (c.grid.cols[g].style.width = d + "px");
                        c.p.footerrow && (c.grid.footers[g].style.width = d + "px")
                    }
                    c.p.tblwidth && (b("table:first", c.grid.bDiv).css("width", c.p.tblwidth + "px"), b("table:first", c.grid.hDiv).css("width", c.p.tblwidth + "px"), c.grid.hDiv.scrollLeft = c.grid.bDiv.scrollLeft, c.p.footerrow && b("table:first", c.grid.sDiv).css("width", c.p.tblwidth +
                        "px"))
                }
            }
        })
    }, setGridHeight: function (f) {
        return this.each(function () {
            if (this.grid) {
                var e = b(this.grid.bDiv);
                e.css({height: f + (isNaN(f) ? "" : "px")});
                !0 === this.p.frozenColumns && b("#" + b.jgrid.jqID(this.p.id) + "_frozen").parent().height(e.height() - 16);
                this.p.height = f;
                this.p.scroll && this.grid.populateVisible()
            }
        })
    }, setCaption: function (f) {
        return this.each(function () {
            this.p.caption = f;
            b("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl", this.grid.cDiv).html(f);
            b(this.grid.cDiv).show()
        })
    }, setLabel: function (f, e, c, d) {
        return this.each(function () {
            var a =
                -1;
            if (this.grid && "undefined" != typeof f && (b(this.p.colModel).each(function (b) {
                if (this.name == f)return a = b, !1
            }), 0 <= a)) {
                var h = b("tr.ui-jqgrid-labels th:eq(" + a + ")", this.grid.hDiv);
                if (e) {
                    var g = b(".s-ico", h);
                    b("[id^=jqgh_]", h).empty().html(e).append(g);
                    this.p.colNames[a] = e
                }
                c && ("string" === typeof c ? b(h).addClass(c) : b(h).css(c));
                "object" === typeof d && b(h).attr(d)
            }
        })
    }, setCell: function (f, e, c, d, a, h) {
        return this.each(function () {
            var g = -1, i, j;
            if (this.grid && (isNaN(e) ? b(this.p.colModel).each(function (a) {
                if (this.name ==
                    e)return g = a, !1
            }) : g = parseInt(e, 10), 0 <= g && (i = this.rows.namedItem(f)))) {
                var l = b("td:eq(" + g + ")", i);
                if ("" !== c || !0 === h)i = this.formatter(f, c, g, i, "edit"), j = this.p.colModel[g].title ? {title: b.jgrid.stripHtml(i)} : {}, this.p.treeGrid && 0 < b(".tree-wrap", b(l)).length ? b("span", b(l)).html(i).attr(j) : b(l).html(i).attr(j), "local" == this.p.datatype && (i = this.p.colModel[g], c = i.formatter && "string" === typeof i.formatter && "date" == i.formatter ? b.unformat.date.call(this, c, i) : c, j = this.p._index[f], "undefined" != typeof j && (this.p.data[j][i.name] =
                    c));
                "string" === typeof d ? b(l).addClass(d) : d && b(l).css(d);
                "object" === typeof a && b(l).attr(a)
            }
        })
    }, getCell: function (f, e) {
        var c = !1;
        this.each(function () {
            var d = -1;
            if (this.grid && (isNaN(e) ? b(this.p.colModel).each(function (a) {
                if (this.name === e)return d = a, !1
            }) : d = parseInt(e, 10), 0 <= d)) {
                var a = this.rows.namedItem(f);
                if (a)try {
                    c = b.unformat.call(this, b("td:eq(" + d + ")", a), {rowId: a.id, colModel: this.p.colModel[d]}, d)
                } catch (h) {
                    c = b.jgrid.htmlDecode(b("td:eq(" + d + ")", a).html())
                }
            }
        });
        return c
    }, getCol: function (f, e, c) {
        var d = [],
            a, h = 0, g, i, j, e = "boolean" != typeof e ? !1 : e;
        "undefined" == typeof c && (c = !1);
        this.each(function () {
            var l = -1;
            if (this.grid && (isNaN(f) ? b(this.p.colModel).each(function (a) {
                if (this.name === f)return l = a, !1
            }) : l = parseInt(f, 10), 0 <= l)) {
                var k = this.rows.length, m = 0;
                if (k && 0 < k) {
                    for (; m < k;) {
                        if (b(this.rows[m]).hasClass("jqgrow")) {
                            try {
                                a = b.unformat.call(this, b(this.rows[m].cells[l]), {rowId: this.rows[m].id, colModel: this.p.colModel[l]}, l)
                            } catch (o) {
                                a = b.jgrid.htmlDecode(this.rows[m].cells[l].innerHTML)
                            }
                            c ? (j = parseFloat(a), h += j, 0 ===
                                m ? i = g = j : (g = Math.min(g, j), i = Math.max(i, j))) : e ? d.push({id: this.rows[m].id, value: a}) : d.push(a)
                        }
                        m++
                    }
                    if (c)switch (c.toLowerCase()) {
                        case "sum":
                            d = h;
                            break;
                        case "avg":
                            d = h / k;
                            break;
                        case "count":
                            d = k;
                            break;
                        case "min":
                            d = g;
                            break;
                        case "max":
                            d = i
                    }
                }
            }
        });
        return d
    }, clearGridData: function (f) {
        return this.each(function () {
            if (this.grid) {
                "boolean" != typeof f && (f = !1);
                if (this.p.deepempty)b("#" + b.jgrid.jqID(this.p.id) + " tbody:first tr:gt(0)").remove(); else {
                    var e = b("#" + b.jgrid.jqID(this.p.id) + " tbody:first tr:first")[0];
                    b("#" + b.jgrid.jqID(this.p.id) +
                        " tbody:first").empty().append(e)
                }
                this.p.footerrow && f && b(".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(!0, !1)
            }
        })
    }, getInd: function (b, e) {
        var c = !1, d;
        this.each(function () {
            (d = this.rows.namedItem(b)) && (c = !0 === e ? d : d.rowIndex)
        });
        return c
    }, bindKeys: function (f) {
        var e = b.extend({onEnter: null, onSpace: null, onLeftKey: null, onRightKey: null,
            scrollingRows: !0}, f || {});
        return this.each(function () {
            var c = this;
            b("body").is("[role]") || b("body").attr("role", "application");
            c.p.scrollrows = e.scrollingRows;
            b(c).keydown(function (d) {
                var a = b(c).find("tr[tabindex=0]")[0], f, g, i, j = c.p.treeReader.expanded_field;
                if (a)if (i = c.p._index[a.id], 37 === d.keyCode || 38 === d.keyCode || 39 === d.keyCode || 40 === d.keyCode) {
                    if (38 === d.keyCode) {
                        g = a.previousSibling;
                        f = "";
                        if (g)if (b(g).is(":hidden"))for (; g;) {
                            if (g = g.previousSibling, !b(g).is(":hidden") && b(g).hasClass("jqgrow")) {
                                f = g.id;
                                break
                            }
                        } else f = g.id;
                        b(c).jqGrid("setSelection", f, !0, d)
                    }
                    if (40 === d.keyCode) {
                        g = a.nextSibling;
                        f = "";
                        if (g)if (b(g).is(":hidden"))for (; g;) {
                            if (g = g.nextSibling, !b(g).is(":hidden") && b(g).hasClass("jqgrow")) {
                                f = g.id;
                                break
                            }
                        } else f = g.id;
                        b(c).jqGrid("setSelection", f, !0, d)
                    }
                    37 === d.keyCode && (c.p.treeGrid && c.p.data[i][j] && b(a).find("div.treeclick").trigger("click"), b(c).triggerHandler("jqGridKeyLeft", [c.p.selrow]), b.isFunction(e.onLeftKey) && e.onLeftKey.call(c, c.p.selrow));
                    39 === d.keyCode && (c.p.treeGrid && !c.p.data[i][j] &&
                        b(a).find("div.treeclick").trigger("click"), b(c).triggerHandler("jqGridKeyRight", [c.p.selrow]), b.isFunction(e.onRightKey) && e.onRightKey.call(c, c.p.selrow))
                } else 13 === d.keyCode ? (b(c).triggerHandler("jqGridKeyEnter", [c.p.selrow]), b.isFunction(e.onEnter) && e.onEnter.call(c, c.p.selrow)) : 32 === d.keyCode && (b(c).triggerHandler("jqGridKeySpace", [c.p.selrow]), b.isFunction(e.onSpace) && e.onSpace.call(c, c.p.selrow))
            })
        })
    }, unbindKeys: function () {
        return this.each(function () {
            b(this).unbind("keydown")
        })
    }, getLocalRow: function (b) {
        var e =
            !1, c;
        this.each(function () {
            "undefined" !== typeof b && (c = this.p._index[b], 0 <= c && (e = this.p.data[c]))
        });
        return e
    }})
})(jQuery);
(function (a) {
    a.extend(a.jgrid, {showModal: function (a) {
        a.w.show()
    }, closeModal: function (a) {
        a.w.hide().attr("aria-hidden", "true");
        a.o && a.o.remove()
    }, hideModal: function (d, b) {
        b = a.extend({jqm: !0, gb: ""}, b || {});
        if (b.onClose) {
            var c = b.onClose(d);
            if ("boolean" == typeof c && !c)return
        }
        if (a.fn.jqm && !0 === b.jqm)a(d).attr("aria-hidden", "true").jqmHide(); else {
            if ("" !== b.gb)try {
                a(".jqgrid-overlay:first", b.gb).hide()
            } catch (f) {
            }
            a(d).hide().attr("aria-hidden", "true")
        }
    }, findPos: function (a) {
        var b = 0, c = 0;
        if (a.offsetParent) {
            do b +=
                a.offsetLeft, c += a.offsetTop; while (a = a.offsetParent)
        }
        return[b, c]
    }, createModal: function (d, b, c, f, g, h, i) {
        var e = document.createElement("div"), l, j = this, i = a.extend({}, i || {});
        l = "rtl" == a(c.gbox).attr("dir") ? !0 : !1;
        e.className = "ui-widget ui-widget-content ui-corner-all ui-jqdialog";
        e.id = d.themodal;
        var k = document.createElement("div");
        k.className = "ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";
        k.id = d.modalhead;
        a(k).append("<span class='ui-jqdialog-title'>" + c.caption + "</span>");
        var n = a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function () {
                n.addClass("ui-state-hover")
            },
            function () {
                n.removeClass("ui-state-hover")
            }).append("<span class='ui-icon ui-icon-closethick'></span>");
        a(k).append(n);
        l ? (e.dir = "rtl", a(".ui-jqdialog-title", k).css("float", "right"), a(".ui-jqdialog-titlebar-close", k).css("left", "0.3em")) : (e.dir = "ltr", a(".ui-jqdialog-title", k).css("float", "left"), a(".ui-jqdialog-titlebar-close", k).css("right", "0.3em"));
        var m = document.createElement("div");
        a(m).addClass("ui-jqdialog-content ui-widget-content").attr("id", d.modalcontent);
        a(m).append(b);
        e.appendChild(m);
        a(e).prepend(k);
        !0 === h ? a("body").append(e) : "string" == typeof h ? a(h).append(e) : a(e).insertBefore(f);
        a(e).css(i);
        "undefined" === typeof c.jqModal && (c.jqModal = !0);
        b = {};
        if (a.fn.jqm && !0 === c.jqModal)0 === c.left && (0 === c.top && c.overlay) && (i = [], i = a.jgrid.findPos(g), c.left = i[0] + 4, c.top = i[1] + 4), b.top = c.top + "px", b.left = c.left; else if (0 !== c.left || 0 !== c.top)b.left = c.left, b.top = c.top + "px";
        a("a.ui-jqdialog-titlebar-close", k).click(function () {
            var b = a("#" + a.jgrid.jqID(d.themodal)).data("onClose") || c.onClose, e = a("#" + a.jgrid.jqID(d.themodal)).data("gbox") ||
                c.gbox;
            j.hideModal("#" + a.jgrid.jqID(d.themodal), {gb: e, jqm: c.jqModal, onClose: b});
            return false
        });
        if (0 === c.width || !c.width)c.width = 300;
        if (0 === c.height || !c.height)c.height = 200;
        c.zIndex || (f = a(f).parents("*[role=dialog]").filter(":first").css("z-index"), c.zIndex = f ? parseInt(f, 10) + 2 : 950);
        f = 0;
        l && (b.left && !h) && (f = a(c.gbox).width() - (!isNaN(c.width) ? parseInt(c.width, 10) : 0) - 8, b.left = parseInt(b.left, 10) + parseInt(f, 10));
        b.left && (b.left += "px");
        a(e).css(a.extend({width: isNaN(c.width) ? "auto" : c.width + "px", height: isNaN(c.height) ?
            "auto" : c.height + "px", zIndex: c.zIndex, overflow: "hidden"}, b)).attr({tabIndex: "-1", role: "dialog", "aria-labelledby": d.modalhead, "aria-hidden": "true"});
        "undefined" == typeof c.drag && (c.drag = !0);
        "undefined" == typeof c.resize && (c.resize = !0);
        if (c.drag)if (a(k).css("cursor", "move"), a.fn.jqDrag)a(e).jqDrag(k); else try {
            a(e).draggable({handle: a("#" + a.jgrid.jqID(k.id))})
        } catch (o) {
        }
        if (c.resize)if (a.fn.jqResize)a(e).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>"),
            a("#" + a.jgrid.jqID(d.themodal)).jqResize(".jqResize", d.scrollelm ? "#" + a.jgrid.jqID(d.scrollelm) : !1); else try {
            a(e).resizable({handles: "se, sw", alsoResize: d.scrollelm ? "#" + a.jgrid.jqID(d.scrollelm) : !1})
        } catch (p) {
        }
        !0 === c.closeOnEscape && a(e).keydown(function (b) {
            if (b.which == 27) {
                b = a("#" + a.jgrid.jqID(d.themodal)).data("onClose") || c.onClose;
                j.hideModal(this, {gb: c.gbox, jqm: c.jqModal, onClose: b})
            }
        })
    }, viewModal: function (d, b) {
        b = a.extend({toTop: !0, overlay: 10, modal: !1, overlayClass: "ui-widget-overlay", onShow: a.jgrid.showModal,
            onHide: a.jgrid.closeModal, gbox: "", jqm: !0, jqM: !0}, b || {});
        if (a.fn.jqm && !0 === b.jqm)b.jqM ? a(d).attr("aria-hidden", "false").jqm(b).jqmShow() : a(d).attr("aria-hidden", "false").jqmShow(); else {
            "" !== b.gbox && (a(".jqgrid-overlay:first", b.gbox).show(), a(d).data("gbox", b.gbox));
            a(d).show().attr("aria-hidden", "false");
            try {
                a(":input:visible", d)[0].focus()
            } catch (c) {
            }
        }
    }, info_dialog: function (d, b, c, f) {
        var g = {width: 290, height: "auto", dataheight: "auto", drag: !0, resize: !1, caption: "<b>" + d + "</b>", left: 250, top: 170, zIndex: 1E3,
            jqModal: !0, modal: !1, closeOnEscape: !0, align: "center", buttonalign: "center", buttons: []};
        a.extend(g, f || {});
        var h = g.jqModal, i = this;
        a.fn.jqm && !h && (h = !1);
        d = "";
        if (0 < g.buttons.length)for (f = 0; f < g.buttons.length; f++)"undefined" == typeof g.buttons[f].id && (g.buttons[f].id = "info_button_" + f), d += "<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";
        b = "<div id='info_id'>" + ("<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:" +
            f + ";" + ("text-align:" + g.align + ";") + "'>" + b + "</div>");
        b += 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>" + d + "</div>" : "" !== d ? "<div class='ui-widget-content ui-helper-clearfix' style='text-align:" + g.buttonalign + ";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>" +
            d + "</div>" : "";
        b += "</div>";
        try {
            "false" == a("#info_dialog").attr("aria-hidden") && a.jgrid.hideModal("#info_dialog", {jqm: h}), a("#info_dialog").remove()
        } catch (e) {
        }
        a.jgrid.createModal({themodal: "info_dialog", modalhead: "info_head", modalcontent: "info_content", scrollelm: "infocnt"}, b, g, "", "", !0);
        d && a.each(g.buttons, function (b) {
            a("#" + a.jgrid.jqID(this.id), "#info_id").bind("click", function () {
                g.buttons[b].onClick.call(a("#info_dialog"));
                return!1
            })
        });
        a("#closedialog", "#info_id").click(function () {
            i.hideModal("#info_dialog",
                {jqm: h});
            return!1
        });
        a(".fm-button", "#info_dialog").hover(function () {
            a(this).addClass("ui-state-hover")
        }, function () {
            a(this).removeClass("ui-state-hover")
        });
        a.isFunction(g.beforeOpen) && g.beforeOpen();
        a.jgrid.viewModal("#info_dialog", {onHide: function (a) {
            a.w.hide().remove();
            a.o && a.o.remove()
        }, modal: g.modal, jqm: h});
        a.isFunction(g.afterOpen) && g.afterOpen();
        try {
            a("#info_dialog").focus()
        } catch (l) {
        }
    }, createEl: function (d, b, c, f, g) {
        function h(b, d) {
            a.isFunction(d.dataInit) && d.dataInit.call(l, b);
            d.dataEvents &&
            a.each(d.dataEvents, function () {
                void 0 !== this.data ? a(b).bind(this.type, this.data, this.fn) : a(b).bind(this.type, this.fn)
            });
            return d
        }

        function i(b, d, c) {
            var e = "dataInit dataEvents dataUrl buildSelect sopt searchhidden defaultValue attr".split(" ");
            "undefined" != typeof c && a.isArray(c) && a.merge(e, c);
            a.each(d, function (d, c) {
                -1 === a.inArray(d, e) && a(b).attr(d, c)
            });
            d.hasOwnProperty("id") || a(b).attr("id", a.jgrid.randId())
        }

        var e = "", l = this;
        switch (d) {
            case "textarea":
                e = document.createElement("textarea");
                f ? b.cols || a(e).css({width: "98%"}) :
                    b.cols || (b.cols = 20);
                b.rows || (b.rows = 2);
                if ("&nbsp;" == c || "&#160;" == c || 1 == c.length && 160 == c.charCodeAt(0))c = "";
                e.value = c;
                i(e, b);
                b = h(e, b);
                a(e).attr({role: "textbox", multiline: "true"});
                break;
            case "checkbox":
                e = document.createElement("input");
                e.type = "checkbox";
                b.value ? (d = b.value.split(":"), c === d[0] && (e.checked = !0, e.defaultChecked = !0), e.value = d[0], a(e).attr("offval", d[1])) : (d = c.toLowerCase(), 0 > d.search(/(false|0|no|off|undefined)/i) && "" !== d ? (e.checked = !0, e.defaultChecked = !0, e.value = c) : e.value = "on", a(e).attr("offval",
                    "off"));
                i(e, b, ["value"]);
                b = h(e, b);
                a(e).attr("role", "checkbox");
                break;
            case "select":
                e = document.createElement("select");
                e.setAttribute("role", "select");
                f = [];
                !0 === b.multiple ? (d = !0, e.multiple = "multiple", a(e).attr("aria-multiselectable", "true")) : d = !1;
                if ("undefined" != typeof b.dataUrl)a.ajax(a.extend({url: b.dataUrl, type: "GET", dataType: "html", context: {elem: e, options: b, vl: c}, success: function (d) {
                    var b = [], c = this.elem, e = this.vl, f = a.extend({}, this.options), g = f.multiple === true;
                    a.isFunction(f.buildSelect) && (d = f.buildSelect.call(l,
                        d));
                    if (d = a(d).html()) {
                        a(c).append(d);
                        i(c, f);
                        f = h(c, f);
                        if (typeof f.size === "undefined")f.size = g ? 3 : 1;
                        if (g) {
                            b = e.split(",");
                            b = a.map(b, function (b) {
                                return a.trim(b)
                            })
                        } else b[0] = a.trim(e);
                        setTimeout(function () {
                            a("option", c).each(function (d) {
                                if (d === 0 && c.multiple)this.selected = false;
                                a(this).attr("role", "option");
                                if (a.inArray(a.trim(a(this).text()), b) > -1 || a.inArray(a.trim(a(this).val()), b) > -1)this.selected = "selected"
                            })
                        }, 0)
                    }
                }}, g || {})); else if (b.value) {
                    var j;
                    "undefined" === typeof b.size && (b.size = d ? 3 : 1);
                    d && (f = c.split(","),
                        f = a.map(f, function (b) {
                            return a.trim(b)
                        }));
                    "function" === typeof b.value && (b.value = b.value());
                    var k, n, m = void 0 === b.separator ? ":" : b.separator, g = void 0 === b.delimiter ? ";" : b.delimiter;
                    if ("string" === typeof b.value) {
                        k = b.value.split(g);
                        for (j = 0; j < k.length; j++) {
                            n = k[j].split(m);
                            2 < n.length && (n[1] = a.map(n,function (a, b) {
                                if (b > 0)return a
                            }).join(m));
                            g = document.createElement("option");
                            g.setAttribute("role", "option");
                            g.value = n[0];
                            g.innerHTML = n[1];
                            e.appendChild(g);
                            if (!d && (a.trim(n[0]) == a.trim(c) || a.trim(n[1]) == a.trim(c)))g.selected =
                                "selected";
                            if (d && (-1 < a.inArray(a.trim(n[1]), f) || -1 < a.inArray(a.trim(n[0]), f)))g.selected = "selected"
                        }
                    } else if ("object" === typeof b.value)for (j in m = b.value, m)if (m.hasOwnProperty(j)) {
                        g = document.createElement("option");
                        g.setAttribute("role", "option");
                        g.value = j;
                        g.innerHTML = m[j];
                        e.appendChild(g);
                        if (!d && (a.trim(j) == a.trim(c) || a.trim(m[j]) == a.trim(c)))g.selected = "selected";
                        if (d && (-1 < a.inArray(a.trim(m[j]), f) || -1 < a.inArray(a.trim(j), f)))g.selected = "selected"
                    }
                    i(e, b, ["value"]);
                    b = h(e, b)
                }
                break;
            case "text":
            case "password":
            case "button":
                j =
                    "button" == d ? "button" : "textbox";
                e = document.createElement("input");
                e.type = d;
                e.value = c;
                i(e, b);
                b = h(e, b);
                "button" != d && (f ? b.size || a(e).css({width: "98%"}) : b.size || (b.size = 20));
                a(e).attr("role", j);
                break;
            case "image":
            case "file":
                e = document.createElement("input");
                e.type = d;
                i(e, b);
                b = h(e, b);
                break;
            case "custom":
                e = document.createElement("span");
                try {
                    if (a.isFunction(b.custom_element))if (m = b.custom_element.call(l, c, b))m = a(m).addClass("customelement").attr({id: b.id, name: b.name}), a(e).empty().append(m); else throw"e2";
                    else throw"e1";
                } catch (o) {
                    "e1" == o && a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_element' " + a.jgrid.edit.msg.nodefined, a.jgrid.edit.bClose), "e2" == o ? a.jgrid.info_dialog(a.jgrid.errors.errcap, "function 'custom_element' " + a.jgrid.edit.msg.novalue, a.jgrid.edit.bClose) : a.jgrid.info_dialog(a.jgrid.errors.errcap, "string" === typeof o ? o : o.message, a.jgrid.edit.bClose)
                }
        }
        return e
    }, checkDate: function (a, b) {
        var c = {}, f, a = a.toLowerCase();
        f = -1 != a.indexOf("/") ? "/" : -1 != a.indexOf("-") ? "-" : -1 != a.indexOf(".") ?
            "." : "/";
        a = a.split(f);
        b = b.split(f);
        if (3 != b.length)return!1;
        f = -1;
        for (var g, h = -1, i = -1, e = 0; e < a.length; e++)g = isNaN(b[e]) ? 0 : parseInt(b[e], 10), c[a[e]] = g, g = a[e], -1 != g.indexOf("y") && (f = e), -1 != g.indexOf("m") && (i = e), -1 != g.indexOf("d") && (h = e);
        g = "y" == a[f] || "yyyy" == a[f] ? 4 : "yy" == a[f] ? 2 : -1;
        var e = function (a) {
            for (var b = 1; b <= a; b++) {
                this[b] = 31;
                if (4 == b || 6 == b || 9 == b || 11 == b)this[b] = 30;
                2 == b && (this[b] = 29)
            }
            return this
        }(12), l;
        if (-1 === f)return!1;
        l = c[a[f]].toString();
        2 == g && 1 == l.length && (g = 1);
        if (l.length != g || 0 === c[a[f]] && "00" !=
            b[f] || -1 === i)return!1;
        l = c[a[i]].toString();
        if (1 > l.length || (1 > c[a[i]] || 12 < c[a[i]]) || -1 === h)return!1;
        l = c[a[h]].toString();
        return 1 > l.length || 1 > c[a[h]] || 31 < c[a[h]] || 2 == c[a[i]] && c[a[h]] > (0 === c[a[f]] % 4 && (0 !== c[a[f]] % 100 || 0 === c[a[f]] % 400) ? 29 : 28) || c[a[h]] > e[c[a[i]]] ? !1 : !0
    }, isEmpty: function (a) {
        return a.match(/^\s+$/) || "" === a ? !0 : !1
    }, checkTime: function (d) {
        var b = /^(\d{1,2}):(\d{2})([ap]m)?$/;
        if (!a.jgrid.isEmpty(d))if (d = d.match(b)) {
            if (d[3]) {
                if (1 > d[1] || 12 < d[1])return!1
            } else if (23 < d[1])return!1;
            if (59 < d[2])return!1
        } else return!1;
        return!0
    }, checkValues: function (d, b, c, f, g) {
        var h, i;
        if ("undefined" === typeof f)if ("string" == typeof b) {
            f = 0;
            for (g = c.p.colModel.length; f < g; f++)if (c.p.colModel[f].name == b) {
                h = c.p.colModel[f].editrules;
                b = f;
                try {
                    i = c.p.colModel[f].formoptions.label
                } catch (e) {
                }
                break
            }
        } else 0 <= b && (h = c.p.colModel[b].editrules); else h = f, i = void 0 === g ? "_" : g;
        if (h) {
            i || (i = c.p.colNames[b]);
            if (!0 === h.required && a.jgrid.isEmpty(d))return[!1, i + ": " + a.jgrid.edit.msg.required, ""];
            f = !1 === h.required ? !1 : !0;
            if (!0 === h.number && !(!1 === f && a.jgrid.isEmpty(d)) &&
                isNaN(d))return[!1, i + ": " + a.jgrid.edit.msg.number, ""];
            if ("undefined" != typeof h.minValue && !isNaN(h.minValue) && parseFloat(d) < parseFloat(h.minValue))return[!1, i + ": " + a.jgrid.edit.msg.minValue + " " + h.minValue, ""];
            if ("undefined" != typeof h.maxValue && !isNaN(h.maxValue) && parseFloat(d) > parseFloat(h.maxValue))return[!1, i + ": " + a.jgrid.edit.msg.maxValue + " " + h.maxValue, ""];
            if (!0 === h.email && !(!1 === f && a.jgrid.isEmpty(d)) && (g = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
                !g.test(d)))return[!1, i + ": " + a.jgrid.edit.msg.email, ""];
            if (!0 === h.integer && !(!1 === f && a.jgrid.isEmpty(d)) && (isNaN(d) || 0 !== d % 1 || -1 != d.indexOf(".")))return[!1, i + ": " + a.jgrid.edit.msg.integer, ""];
            if (!0 === h.date && !(!1 === f && a.jgrid.isEmpty(d)) && (b = c.p.colModel[b].formatoptions && c.p.colModel[b].formatoptions.newformat ? c.p.colModel[b].formatoptions.newformat : c.p.colModel[b].datefmt || "Y-m-d", !a.jgrid.checkDate(b, d)))return[!1, i + ": " + a.jgrid.edit.msg.date + " - " + b, ""];
            if (!0 === h.time && !(!1 === f && a.jgrid.isEmpty(d)) && !a.jgrid.checkTime(d))return[!1, i + ": " + a.jgrid.edit.msg.date + " - hh:mm (am/pm)", ""];
            if (!0 === h.url && !(!1 === f && a.jgrid.isEmpty(d)) && (g = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i, !g.test(d)))return[!1, i + ": " + a.jgrid.edit.msg.url, ""];
            if (!0 === h.custom && !(!1 === f && a.jgrid.isEmpty(d)))return a.isFunction(h.custom_func) ? (d = h.custom_func.call(c, d, i), a.isArray(d) ? d : [!1, a.jgrid.edit.msg.customarray, ""]) : [!1, a.jgrid.edit.msg.customfcheck,
                ""]
        }
        return[!0, "", ""]
    }})
})(jQuery);
(function (a) {
    var c = {};
    a.jgrid.extend({searchGrid: function (c) {
        c = a.extend({recreateFilter: !1, drag: !0, sField: "searchField", sValue: "searchString", sOper: "searchOper", sFilter: "filters", loadDefaults: !0, beforeShowSearch: null, afterShowSearch: null, onInitializeSearch: null, afterRedraw: null, afterChange: null, closeAfterSearch: !1, closeAfterReset: !1, closeOnEscape: !1, searchOnEnter: !1, multipleSearch: !1, multipleGroup: !1, top: 0, left: 0, jqModal: !0, modal: !1, resize: !0, width: 450, height: "auto", dataheight: "auto", showQuery: !1,
            errorcheck: !0, sopt: null, stringResult: void 0, onClose: null, onSearch: null, onReset: null, toTop: !0, overlay: 30, columns: [], tmplNames: null, tmplFilters: null, tmplLabel: " Template: ", showOnLoad: !1, layer: null}, a.jgrid.search, c || {});
        return this.each(function () {
            function d(b) {
                r = a(e).triggerHandler("jqGridFilterBeforeShow", [b]);
                "undefined" === typeof r && (r = !0);
                r && a.isFunction(c.beforeShowSearch) && (r = c.beforeShowSearch.call(e, b));
                r && (a.jgrid.viewModal("#" + a.jgrid.jqID(t.themodal), {gbox: "#gbox_" + a.jgrid.jqID(l), jqm: c.jqModal,
                    modal: c.modal, overlay: c.overlay, toTop: c.toTop}), a(e).triggerHandler("jqGridFilterAfterShow", [b]), a.isFunction(c.afterShowSearch) && c.afterShowSearch.call(e, b))
            }

            var e = this;
            if (e.grid) {
                var l = "fbox_" + e.p.id, r = !0, t = {themodal: "searchmod" + l, modalhead: "searchhd" + l, modalcontent: "searchcnt" + l, scrollelm: l}, s = e.p.postData[c.sFilter];
                "string" === typeof s && (s = a.jgrid.parse(s));
                !0 === c.recreateFilter && a("#" + a.jgrid.jqID(t.themodal)).remove();
                if (null !== a("#" + a.jgrid.jqID(t.themodal)).html())d(a("#fbox_" + a.jgrid.jqID(+e.p.id)));
                else {
                    var p = a("<div><div id='" + l + "' class='searchFilter' style='overflow:auto'></div></div>").insertBefore("#gview_" + a.jgrid.jqID(e.p.id)), g = "left", f = "";
                    "rtl" == e.p.direction && (g = "right", f = " style='text-align:left'", p.attr("dir", "rtl"));
                    var n = a.extend([], e.p.colModel), w = "<a href='javascript:void(0)' id='" + l + "_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>" + c.Find + "</a>", b = "<a href='javascript:void(0)' id='" + l + "_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>" +
                        c.Reset + "</a>", m = "", h = "", k, j = !1, o = -1;
                    c.showQuery && (m = "<a href='javascript:void(0)' id='" + l + "_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>");
                    c.columns.length ? n = c.columns : a.each(n, function (a, b) {
                        if (!b.label)b.label = e.p.colNames[a];
                        if (!j) {
                            var c = typeof b.search === "undefined" ? true : b.search, d = b.hidden === true;
                            if (b.searchoptions && b.searchoptions.searchhidden === true && c || c && !d) {
                                j = true;
                                k = b.index || b.name;
                                o = a
                            }
                        }
                    });
                    if (!s && k || !1 ===
                        c.multipleSearch) {
                        var y = "eq";
                        0 <= o && n[o].searchoptions && n[o].searchoptions.sopt ? y = n[o].searchoptions.sopt[0] : c.sopt && c.sopt.length && (y = c.sopt[0]);
                        s = {groupOp: "AND", rules: [
                            {field: k, op: y, data: ""}
                        ]}
                    }
                    j = !1;
                    c.tmplNames && c.tmplNames.length && (j = !0, h = c.tmplLabel, h += "<select class='ui-template'>", h += "<option value='default'>Default</option>", a.each(c.tmplNames, function (a, b) {
                        h = h + ("<option value='" + a + "'>" + b + "</option>")
                    }), h += "</select>");
                    g = "<table class='EditTable' style='border:0px none;margin-top:5px' id='" +
                        l + "_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:" + g + "'>" + b + h + "</td><td class='EditButton' " + f + ">" + m + w + "</td></tr></tbody></table>";
                    l = a.jgrid.jqID(l);
                    a("#" + l).jqFilter({columns: n, filter: c.loadDefaults ? s : null, showQuery: c.showQuery, errorcheck: c.errorcheck, sopt: c.sopt, groupButton: c.multipleGroup, ruleButtons: c.multipleSearch, afterRedraw: c.afterRedraw, _gridsopt: a.jgrid.search.odata, ajaxSelectOptions: e.p.ajaxSelectOptions,
                        groupOps: c.groupOps, onChange: function () {
                            this.p.showQuery && a(".query", this).html(this.toUserFriendlyString());
                            a.isFunction(c.afterChange) && c.afterChange.call(e, a("#" + l), c)
                        }, direction: e.p.direction});
                    p.append(g);
                    j && (c.tmplFilters && c.tmplFilters.length) && a(".ui-template", p).bind("change", function () {
                        var b = a(this).val();
                        b == "default" ? a("#" + l).jqFilter("addFilter", s) : a("#" + l).jqFilter("addFilter", c.tmplFilters[parseInt(b, 10)]);
                        return false
                    });
                    !0 === c.multipleGroup && (c.multipleSearch = !0);
                    a(e).triggerHandler("jqGridFilterInitialize",
                        [a("#" + l)]);
                    a.isFunction(c.onInitializeSearch) && c.onInitializeSearch.call(e, a("#" + l));
                    c.gbox = "#gbox_" + l;
                    c.layer ? a.jgrid.createModal(t, p, c, "#gview_" + a.jgrid.jqID(e.p.id), a("#gbox_" + a.jgrid.jqID(e.p.id))[0], "#" + a.jgrid.jqID(c.layer), {position: "relative"}) : a.jgrid.createModal(t, p, c, "#gview_" + a.jgrid.jqID(e.p.id), a("#gbox_" + a.jgrid.jqID(e.p.id))[0]);
                    (c.searchOnEnter || c.closeOnEscape) && a("#" + a.jgrid.jqID(t.themodal)).keydown(function (b) {
                        var d = a(b.target);
                        if (c.searchOnEnter && b.which === 13 && !d.hasClass("add-group") && !d.hasClass("add-rule") && !d.hasClass("delete-group") && !d.hasClass("delete-rule") && (!d.hasClass("fm-button") || !d.is("[id$=_query]"))) {
                            a("#" + l + "_search").focus().click();
                            return false
                        }
                        if (c.closeOnEscape && b.which === 27) {
                            a("#" + a.jgrid.jqID(t.modalhead)).find(".ui-jqdialog-titlebar-close").focus().click();
                            return false
                        }
                    });
                    m && a("#" + l + "_query").bind("click", function () {
                        a(".queryresult", p).toggle();
                        return false
                    });
                    void 0 === c.stringResult && (c.stringResult = c.multipleSearch);
                    a("#" + l + "_search").bind("click", function () {
                        var b =
                            a("#" + l), d = {}, h, q = b.jqFilter("filterData");
                        if (c.errorcheck) {
                            b[0].hideError();
                            c.showQuery || b.jqFilter("toSQLString");
                            if (b[0].p.error) {
                                b[0].showError();
                                return false
                            }
                        }
                        if (c.stringResult) {
                            try {
                                h = xmlJsonClass.toJson(q, "", "", false)
                            } catch (f) {
                                try {
                                    h = JSON.stringify(q)
                                } catch (g) {
                                }
                            }
                            if (typeof h === "string") {
                                d[c.sFilter] = h;
                                a.each([c.sField, c.sValue, c.sOper], function () {
                                    d[this] = ""
                                })
                            }
                        } else if (c.multipleSearch) {
                            d[c.sFilter] = q;
                            a.each([c.sField, c.sValue, c.sOper], function () {
                                d[this] = ""
                            })
                        } else {
                            d[c.sField] = q.rules[0].field;
                            d[c.sValue] = q.rules[0].data;
                            d[c.sOper] = q.rules[0].op;
                            d[c.sFilter] = ""
                        }
                        e.p.search = true;
                        a.extend(e.p.postData, d);
                        a(e).triggerHandler("jqGridFilterSearch");
                        a.isFunction(c.onSearch) && c.onSearch.call(e);
                        a(e).trigger("reloadGrid", [
                            {page: 1}
                        ]);
                        c.closeAfterSearch && a.jgrid.hideModal("#" + a.jgrid.jqID(t.themodal), {gb: "#gbox_" + a.jgrid.jqID(e.p.id), jqm: c.jqModal, onClose: c.onClose});
                        return false
                    });
                    a("#" + l + "_reset").bind("click", function () {
                        var b = {}, d = a("#" + l);
                        e.p.search = false;
                        c.multipleSearch === false ? b[c.sField] =
                            b[c.sValue] = b[c.sOper] = "" : b[c.sFilter] = "";
                        d[0].resetFilter();
                        j && a(".ui-template", p).val("default");
                        a.extend(e.p.postData, b);
                        a(e).triggerHandler("jqGridFilterReset");
                        a.isFunction(c.onReset) && c.onReset.call(e);
                        a(e).trigger("reloadGrid", [
                            {page: 1}
                        ]);
                        return false
                    });
                    d(a("#" + l));
                    a(".fm-button:not(.ui-state-disabled)", p).hover(function () {
                        a(this).addClass("ui-state-hover")
                    }, function () {
                        a(this).removeClass("ui-state-hover")
                    })
                }
            }
        })
    }, editGridRow: function (u, d) {
        d = a.extend({top: 0, left: 0, width: 300, height: "auto", dataheight: "auto",
            modal: !1, overlay: 30, drag: !0, resize: !0, url: null, mtype: "POST", clearAfterAdd: !0, closeAfterEdit: !1, reloadAfterSubmit: !0, onInitializeForm: null, beforeInitData: null, beforeShowForm: null, afterShowForm: null, beforeSubmit: null, afterSubmit: null, onclickSubmit: null, afterComplete: null, onclickPgButtons: null, afterclickPgButtons: null, editData: {}, recreateForm: !1, jqModal: !0, closeOnEscape: !1, addedrow: "first", topinfo: "", bottominfo: "", saveicon: [], closeicon: [], savekey: [!1, 13], navkeys: [!1, 38, 40], checkOnSubmit: !1, checkOnUpdate: !1,
            _savedData: {}, processing: !1, onClose: null, ajaxEditOptions: {}, serializeEditData: null, viewPagerButtons: !0}, a.jgrid.edit, d || {});
        c[a(this)[0].p.id] = d;
        return this.each(function () {
            function e() {
                a(j + " > tbody > tr > td > .FormElement").each(function () {
                    var d = a(".customelement", this);
                    if (d.length) {
                        var c = a(d[0]).attr("name");
                        a.each(b.p.colModel, function () {
                            if (this.name === c && this.editoptions && a.isFunction(this.editoptions.custom_value)) {
                                try {
                                    if (i[c] = this.editoptions.custom_value.call(b, a("#" + a.jgrid.jqID(c), j), "get"),
                                        void 0 === i[c])throw"e1";
                                } catch (d) {
                                    "e1" === d ? 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, d.message, jQuery.jgrid.edit.bClose)
                                }
                                return!0
                            }
                        })
                    } else {
                        switch (a(this).get(0).type) {
                            case "checkbox":
                                a(this).is(":checked") ? i[this.name] = a(this).val() : (d = a(this).attr("offval"), i[this.name] = d);
                                break;
                            case "select-one":
                                i[this.name] = a("option:selected", this).val();
                                B[this.name] = a("option:selected",
                                    this).text();
                                break;
                            case "select-multiple":
                                i[this.name] = a(this).val();
                                i[this.name] = i[this.name] ? i[this.name].join(",") : "";
                                var e = [];
                                a("option:selected", this).each(function (b, d) {
                                    e[b] = a(d).text()
                                });
                                B[this.name] = e.join(",");
                                break;
                            case "password":
                            case "text":
                            case "textarea":
                            case "button":
                                i[this.name] = a(this).val()
                        }
                        b.p.autoencode && (i[this.name] = a.jgrid.htmlEncode(i[this.name]))
                    }
                });
                return!0
            }

            function l(d, e, h, q) {
                var i, f, g, k = 0, j, o, l, p = [], n = !1, u = "", m;
                for (m = 1; m <= q; m++)u += "<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>";
                "_empty" != d && (n = a(e).jqGrid("getInd", d));
                a(e.p.colModel).each(function (m) {
                    i = this.name;
                    o = (f = this.editrules && !0 === this.editrules.edithidden ? !1 : !0 === this.hidden ? !0 : !1) ? "style='display:none'" : "";
                    if ("cb" !== i && "subgrid" !== i && !0 === this.editable && "rn" !== i) {
                        if (!1 === n)j = ""; else if (i == e.p.ExpandColumn && !0 === e.p.treeGrid)j = a("td:eq(" + m + ")", e.rows[n]).text(); else {
                            try {
                                j = a.unformat.call(e, a("td:eq(" + m + ")", e.rows[n]), {rowId: d, colModel: this}, m)
                            } catch (r) {
                                j = this.edittype && "textarea" == this.edittype ? a("td:eq(" + m + ")",
                                    e.rows[n]).text() : a("td:eq(" + m + ")", e.rows[n]).html()
                            }
                            if (!j || "&nbsp;" == j || "&#160;" == j || 1 == j.length && 160 == j.charCodeAt(0))j = ""
                        }
                        var v = a.extend({}, this.editoptions || {}, {id: i, name: i}), s = a.extend({}, {elmprefix: "", elmsuffix: "", rowabove: !1, rowcontent: ""}, this.formoptions || {}), t = parseInt(s.rowpos, 10) || k + 1, y = parseInt(2 * (parseInt(s.colpos, 10) || 1), 10);
                        "_empty" == d && v.defaultValue && (j = a.isFunction(v.defaultValue) ? v.defaultValue.call(b) : v.defaultValue);
                        this.edittype || (this.edittype = "text");
                        b.p.autoencode && (j = a.jgrid.htmlDecode(j));
                        l = a.jgrid.createEl.call(b, this.edittype, v, j, !1, a.extend({}, a.jgrid.ajaxOptions, e.p.ajaxSelectOptions || {}));
                        "" === j && "checkbox" == this.edittype && (j = a(l).attr("offval"));
                        "" === j && "select" == this.edittype && (j = a("option:eq(0)", l).text());
                        if (c[b.p.id].checkOnSubmit || c[b.p.id].checkOnUpdate)c[b.p.id]._savedData[i] = j;
                        a(l).addClass("FormElement");
                        ("text" == this.edittype || "textarea" == this.edittype) && a(l).addClass("ui-widget-content ui-corner-all");
                        g = a(h).find("tr[rowpos=" + t + "]");
                        s.rowabove && (v = a("<tr><td class='contentinfo' colspan='" +
                            2 * q + "'>" + s.rowcontent + "</td></tr>"), a(h).append(v), v[0].rp = t);
                        0 === g.length && (g = a("<tr " + o + " rowpos='" + t + "'></tr>").addClass("FormData").attr("id", "tr_" + i), a(g).append(u), a(h).append(g), g[0].rp = t);
                        a("td:eq(" + (y - 2) + ")", g[0]).html("undefined" === typeof s.label ? e.p.colNames[m] : s.label);
                        a("td:eq(" + (y - 1) + ")", g[0]).append(s.elmprefix).append(l).append(s.elmsuffix);
                        p[k] = m;
                        k++
                    }
                });
                if (0 < k && (m = a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='" + (2 * q - 1) + "' class='DataTD'><input class='FormElement' id='id_g' type='text' name='" +
                    e.p.id + "_id' value='" + d + "'/></td></tr>"), m[0].rp = k + 999, a(h).append(m), c[b.p.id].checkOnSubmit || c[b.p.id].checkOnUpdate))c[b.p.id]._savedData[e.p.id + "_id"] = d;
                return p
            }

            function r(d, e, h) {
                var i, q = 0, g, f, k, o, l;
                if (c[b.p.id].checkOnSubmit || c[b.p.id].checkOnUpdate)c[b.p.id]._savedData = {}, c[b.p.id]._savedData[e.p.id + "_id"] = d;
                var m = e.p.colModel;
                if ("_empty" == d)a(m).each(function () {
                    i = this.name;
                    k = a.extend({}, this.editoptions || {});
                    if ((f = a("#" + a.jgrid.jqID(i), "#" + h)) && f.length && null !== f[0])if (o = "", k.defaultValue ?
                        (o = a.isFunction(k.defaultValue) ? k.defaultValue.call(b) : k.defaultValue, "checkbox" == f[0].type ? (l = o.toLowerCase(), 0 > l.search(/(false|0|no|off|undefined)/i) && "" !== l ? (f[0].checked = !0, f[0].defaultChecked = !0, f[0].value = o) : (f[0].checked = !1, f[0].defaultChecked = !1)) : f.val(o)) : "checkbox" == f[0].type ? (f[0].checked = !1, f[0].defaultChecked = !1, o = a(f).attr("offval")) : f[0].type && "select" == f[0].type.substr(0, 6) ? f[0].selectedIndex = 0 : f.val(o), !0 === c[b.p.id].checkOnSubmit || c[b.p.id].checkOnUpdate)c[b.p.id]._savedData[i] =
                        o
                }), a("#id_g", "#" + h).val(d); else {
                    var n = a(e).jqGrid("getInd", d, !0);
                    n && (a('td[role="gridcell"]', n).each(function (f) {
                        i = m[f].name;
                        if ("cb" !== i && "subgrid" !== i && "rn" !== i && !0 === m[f].editable) {
                            if (i == e.p.ExpandColumn && !0 === e.p.treeGrid)g = a(this).text(); else try {
                                g = a.unformat.call(e, a(this), {rowId: d, colModel: m[f]}, f)
                            } catch (j) {
                                g = "textarea" == m[f].edittype ? a(this).text() : a(this).html()
                            }
                            b.p.autoencode && (g = a.jgrid.htmlDecode(g));
                            if (!0 === c[b.p.id].checkOnSubmit || c[b.p.id].checkOnUpdate)c[b.p.id]._savedData[i] = g;
                            i =
                                a.jgrid.jqID(i);
                            switch (m[f].edittype) {
                                case "password":
                                case "text":
                                case "button":
                                case "image":
                                case "textarea":
                                    if ("&nbsp;" == g || "&#160;" == g || 1 == g.length && 160 == g.charCodeAt(0))g = "";
                                    a("#" + i, "#" + h).val(g);
                                    break;
                                case "select":
                                    var k = g.split(","), k = a.map(k, function (b) {
                                        return a.trim(b)
                                    });
                                    a("#" + i + " option", "#" + h).each(function () {
                                        this.selected = !m[f].editoptions.multiple && (a.trim(g) == a.trim(a(this).text()) || k[0] == a.trim(a(this).text()) || k[0] == a.trim(a(this).val())) ? !0 : m[f].editoptions.multiple ? -1 < a.inArray(a.trim(a(this).text()),
                                            k) || -1 < a.inArray(a.trim(a(this).val()), k) ? !0 : !1 : !1
                                    });
                                    break;
                                case "checkbox":
                                    g += "";
                                    m[f].editoptions && m[f].editoptions.value ? m[f].editoptions.value.split(":")[0] == g ? (a("#" + i, "#" + h)[b.p.useProp ? "prop" : "attr"]("checked", !0), a("#" + i, "#" + h)[b.p.useProp ? "prop" : "attr"]("defaultChecked", !0)) : (a("#" + i, "#" + h)[b.p.useProp ? "prop" : "attr"]("checked", !1), a("#" + i, "#" + h)[b.p.useProp ? "prop" : "attr"]("defaultChecked", !1)) : (g = g.toLowerCase(), 0 > g.search(/(false|0|no|off|undefined)/i) && "" !== g ? (a("#" + i, "#" + h)[b.p.useProp ?
                                        "prop" : "attr"]("checked", !0), a("#" + i, "#" + h)[b.p.useProp ? "prop" : "attr"]("defaultChecked", !0)) : (a("#" + i, "#" + h)[b.p.useProp ? "prop" : "attr"]("checked", !1), a("#" + i, "#" + h)[b.p.useProp ? "prop" : "attr"]("defaultChecked", !1)));
                                    break;
                                case "custom":
                                    try {
                                        if (m[f].editoptions && a.isFunction(m[f].editoptions.custom_value))m[f].editoptions.custom_value.call(b, a("#" + i, "#" + h), "set", g); else throw"e1";
                                    } catch (o) {
                                        "e1" == o ? 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, o.message, jQuery.jgrid.edit.bClose)
                                    }
                            }
                            q++
                        }
                    }), 0 < q && a("#id_g", j).val(d))
                }
            }

            function t() {
                a.each(b.p.colModel, function (a, b) {
                    b.editoptions && !0 === b.editoptions.NullIfEmpty && i.hasOwnProperty(b.name) && "" === i[b.name] && (i[b.name] = "null")
                })
            }

            function s() {
                var e, f = [!0, "", ""], g = {}, q = b.p.prmNames, k, l, n, p, v, u = a(b).triggerHandler("jqGridAddEditBeforeCheckValues", [a("#" + h), z]);
                u && "object" === typeof u && (i = u);
                a.isFunction(c[b.p.id].beforeCheckValues) && (u = c[b.p.id].beforeCheckValues.call(b,
                    i, a("#" + h), "_empty" == i[b.p.id + "_id"] ? q.addoper : q.editoper)) && "object" === typeof u && (i = u);
                for (n in i)if (i.hasOwnProperty(n) && (f = a.jgrid.checkValues.call(b, i[n], n, b), !1 === f[0]))break;
                t();
                f[0] && (g = a(b).triggerHandler("jqGridAddEditClickSubmit", [c[b.p.id], i, z]), void 0 === g && a.isFunction(c[b.p.id].onclickSubmit) && (g = c[b.p.id].onclickSubmit.call(b, c[b.p.id], i) || {}), f = a(b).triggerHandler("jqGridAddEditBeforeSubmit", [i, a("#" + h), z]), void 0 === f && (f = [!0, "", ""]), f[0] && a.isFunction(c[b.p.id].beforeSubmit) && (f = c[b.p.id].beforeSubmit.call(b,
                    i, a("#" + h))));
                if (f[0] && !c[b.p.id].processing) {
                    c[b.p.id].processing = !0;
                    a("#sData", j + "_2").addClass("ui-state-active");
                    l = q.oper;
                    k = q.id;
                    i[l] = "_empty" == a.trim(i[b.p.id + "_id"]) ? q.addoper : q.editoper;
                    i[l] != q.addoper ? i[k] = i[b.p.id + "_id"] : void 0 === i[k] && (i[k] = i[b.p.id + "_id"]);
                    delete i[b.p.id + "_id"];
                    i = a.extend(i, c[b.p.id].editData, g);
                    if (!0 === b.p.treeGrid)for (v in i[l] == q.addoper && (p = a(b).jqGrid("getGridParam", "selrow"), i["adjacency" == b.p.treeGridModel ? b.p.treeReader.parent_id_field : "parent_id"] = p), b.p.treeReader)b.p.treeReader.hasOwnProperty(v) &&
                    (g = b.p.treeReader[v], i.hasOwnProperty(g) && !(i[l] == q.addoper && "parent_id_field" === v) && delete i[g]);
                    i[k] = a.jgrid.stripPref(b.p.idPrefix, i[k]);
                    v = a.extend({url: c[b.p.id].url ? c[b.p.id].url : a(b).jqGrid("getGridParam", "editurl"), type: c[b.p.id].mtype, data: a.isFunction(c[b.p.id].serializeEditData) ? c[b.p.id].serializeEditData.call(b, i) : i, complete: function (g, n) {
                        i[k] = b.p.idPrefix + i[k];
                        if (n != "success") {
                            f[0] = false;
                            f[1] = a(b).triggerHandler("jqGridAddEditErrorTextFormat", [g, z]);
                            f[1] = a.isFunction(c[b.p.id].errorTextFormat) ?
                                c[b.p.id].errorTextFormat.call(b, g) : n + " Status: '" + g.statusText + "'. Error code: " + g.status
                        } else {
                            f = a(b).triggerHandler("jqGridAddEditAfterSubmit", [g, i, z]);
                            f === void 0 && (f = [true, "", ""]);
                            f[0] && a.isFunction(c[b.p.id].afterSubmit) && (f = c[b.p.id].afterSubmit.call(b, g, i))
                        }
                        if (f[0] === false) {
                            a("#FormError>td", j).html(f[1]);
                            a("#FormError", j).show()
                        } else {
                            a.each(b.p.colModel, function () {
                                if (B[this.name] && this.formatter && this.formatter == "select")try {
                                    delete B[this.name]
                                } catch (a) {
                                }
                            });
                            i = a.extend(i, B);
                            b.p.autoencode &&
                            a.each(i, function (b, d) {
                                i[b] = a.jgrid.htmlDecode(d)
                            });
                            if (i[l] == q.addoper) {
                                f[2] || (f[2] = a.jgrid.randId());
                                i[k] = f[2];
                                if (c[b.p.id].closeAfterAdd) {
                                    if (c[b.p.id].reloadAfterSubmit)a(b).trigger("reloadGrid"); else if (b.p.treeGrid === true)a(b).jqGrid("addChildNode", f[2], p, i); else {
                                        a(b).jqGrid("addRowData", f[2], i, d.addedrow);
                                        a(b).jqGrid("setSelection", f[2])
                                    }
                                    a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose})
                                } else if (c[b.p.id].clearAfterAdd) {
                                    c[b.p.id].reloadAfterSubmit ?
                                        a(b).trigger("reloadGrid") : b.p.treeGrid === true ? a(b).jqGrid("addChildNode", f[2], p, i) : a(b).jqGrid("addRowData", f[2], i, d.addedrow);
                                    r("_empty", b, h)
                                } else c[b.p.id].reloadAfterSubmit ? a(b).trigger("reloadGrid") : b.p.treeGrid === true ? a(b).jqGrid("addChildNode", f[2], p, i) : a(b).jqGrid("addRowData", f[2], i, d.addedrow)
                            } else {
                                if (c[b.p.id].reloadAfterSubmit) {
                                    a(b).trigger("reloadGrid");
                                    c[b.p.id].closeAfterEdit || setTimeout(function () {
                                        a(b).jqGrid("setSelection", i[k])
                                    }, 1E3)
                                } else b.p.treeGrid === true ? a(b).jqGrid("setTreeRow",
                                    i[k], i) : a(b).jqGrid("setRowData", i[k], i);
                                c[b.p.id].closeAfterEdit && a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose})
                            }
                            if (a.isFunction(c[b.p.id].afterComplete)) {
                                e = g;
                                setTimeout(function () {
                                    a(b).triggerHandler("jqGridAddEditAfterComplete", [e, i, a("#" + h), z]);
                                    c[b.p.id].afterComplete.call(b, e, i, a("#" + h));
                                    e = null
                                }, 500)
                            }
                            if (c[b.p.id].checkOnSubmit || c[b.p.id].checkOnUpdate) {
                                a("#" + h).data("disabled", false);
                                if (c[b.p.id]._savedData[b.p.id + "_id"] !=
                                    "_empty")for (var v in c[b.p.id]._savedData)i[v] && (c[b.p.id]._savedData[v] = i[v])
                            }
                        }
                        c[b.p.id].processing = false;
                        a("#sData", j + "_2").removeClass("ui-state-active");
                        try {
                            a(":input:visible", "#" + h)[0].focus()
                        } catch (u) {
                        }
                    }}, a.jgrid.ajaxOptions, c[b.p.id].ajaxEditOptions);
                    !v.url && !c[b.p.id].useDataProxy && (a.isFunction(b.p.dataProxy) ? c[b.p.id].useDataProxy = !0 : (f[0] = !1, f[1] += " " + a.jgrid.errors.nourl));
                    f[0] && (c[b.p.id].useDataProxy ? (g = b.p.dataProxy.call(b, v, "set_" + b.p.id), "undefined" == typeof g && (g = [!0, ""]), !1 === g[0] ?
                        (f[0] = !1, f[1] = g[1] || "Error deleting the selected row!") : (v.data.oper == q.addoper && c[b.p.id].closeAfterAdd && a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose}), v.data.oper == q.editoper && c[b.p.id].closeAfterEdit && a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose}))) : a.ajax(v))
                }
                !1 === f[0] && (a("#FormError>td", j).html(f[1]), a("#FormError", j).show())
            }

            function p(a, b) {
                var d = !1,
                    c;
                for (c in a)if (a[c] != b[c]) {
                    d = !0;
                    break
                }
                return d
            }

            function g() {
                var d = !0;
                a("#FormError", j).hide();
                if (c[b.p.id].checkOnUpdate && (i = {}, B = {}, e(), F = a.extend({}, i, B), M = p(F, c[b.p.id]._savedData)))a("#" + h).data("disabled", !0), a(".confirm", "#" + o.themodal).show(), d = !1;
                return d
            }

            function f() {
                if ("_empty" !== u && "undefined" !== typeof b.p.savedRow && 0 < b.p.savedRow.length && a.isFunction(a.fn.jqGrid.restoreRow))for (var d = 0; d < b.p.savedRow.length; d++)if (b.p.savedRow[d].id == u) {
                    a(b).jqGrid("restoreRow", u);
                    break
                }
            }

            function n(b, d) {
                0 === b ? a("#pData", j + "_2").addClass("ui-state-disabled") : a("#pData", j + "_2").removeClass("ui-state-disabled");
                b == d ? a("#nData", j + "_2").addClass("ui-state-disabled") : a("#nData", j + "_2").removeClass("ui-state-disabled")
            }

            function w() {
                var d = a(b).jqGrid("getDataIDs"), c = a("#id_g", j).val();
                return[a.inArray(c, d), d]
            }

            var b = this;
            if (b.grid && u) {
                var m = b.p.id, h = "FrmGrid_" + m, k = "TblGrid_" + m, j = "#" + a.jgrid.jqID(k), o = {themodal: "editmod" + m, modalhead: "edithd" + m, modalcontent: "editcnt" + m, scrollelm: h}, y = a.isFunction(c[b.p.id].beforeShowForm) ?
                    c[b.p.id].beforeShowForm : !1, A = a.isFunction(c[b.p.id].afterShowForm) ? c[b.p.id].afterShowForm : !1, x = a.isFunction(c[b.p.id].beforeInitData) ? c[b.p.id].beforeInitData : !1, E = a.isFunction(c[b.p.id].onInitializeForm) ? c[b.p.id].onInitializeForm : !1, q = !0, v = 1, H = 0, i, B, F, M, z, h = a.jgrid.jqID(h);
                "new" === u ? (u = "_empty", z = "add", d.caption = c[b.p.id].addCaption) : (d.caption = c[b.p.id].editCaption, z = "edit");
                !0 === d.recreateForm && null !== a("#" + a.jgrid.jqID(o.themodal)).html() && a("#" + a.jgrid.jqID(o.themodal)).remove();
                var I = !0;
                d.checkOnUpdate && (d.jqModal && !d.modal) && (I = !1);
                if (null !== a("#" + a.jgrid.jqID(o.themodal)).html()) {
                    q = a(b).triggerHandler("jqGridAddEditBeforeInitData", [a("#" + a.jgrid.jqID(h))]);
                    "undefined" == typeof q && (q = !0);
                    q && x && (q = x.call(b, a("#" + h)));
                    if (!1 === q)return;
                    f();
                    a(".ui-jqdialog-title", "#" + a.jgrid.jqID(o.modalhead)).html(d.caption);
                    a("#FormError", j).hide();
                    c[b.p.id].topinfo ? (a(".topinfo", j).html(c[b.p.id].topinfo), a(".tinfo", j).show()) : a(".tinfo", j).hide();
                    c[b.p.id].bottominfo ? (a(".bottominfo", j + "_2").html(c[b.p.id].bottominfo),
                        a(".binfo", j + "_2").show()) : a(".binfo", j + "_2").hide();
                    r(u, b, h);
                    "_empty" == u || !c[b.p.id].viewPagerButtons ? a("#pData, #nData", j + "_2").hide() : a("#pData, #nData", j + "_2").show();
                    !0 === c[b.p.id].processing && (c[b.p.id].processing = !1, a("#sData", j + "_2").removeClass("ui-state-active"));
                    !0 === a("#" + h).data("disabled") && (a(".confirm", "#" + a.jgrid.jqID(o.themodal)).hide(), a("#" + h).data("disabled", !1));
                    a(b).triggerHandler("jqGridAddEditBeforeShowForm", [a("#" + h), z]);
                    y && y.call(b, a("#" + h));
                    a("#" + a.jgrid.jqID(o.themodal)).data("onClose",
                        c[b.p.id].onClose);
                    a.jgrid.viewModal("#" + a.jgrid.jqID(o.themodal), {gbox: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, jqM: !1, overlay: d.overlay, modal: d.modal});
                    I || a(".jqmOverlay").click(function () {
                        if (!g())return false;
                        a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose});
                        return false
                    });
                    a(b).triggerHandler("jqGridAddEditAfterShowForm", [a("#" + h), z]);
                    A && A.call(b, a("#" + h))
                } else {
                    var G = isNaN(d.dataheight) ? d.dataheight : d.dataheight + "px", G = a("<form name='FormPost' id='" +
                        h + "' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:" + G + ";'></form>").data("disabled", !1), C = a("<table id='" + k + "' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"), q = a(b).triggerHandler("jqGridAddEditBeforeInitData", [a("#" + h), z]);
                    "undefined" == typeof q && (q = !0);
                    q && x && (q = x.call(b, a("#" + h)));
                    if (!1 === q)return;
                    f();
                    a(b.p.colModel).each(function () {
                        var a = this.formoptions;
                        v = Math.max(v, a ? a.colpos || 0 : 0);
                        H = Math.max(H, a ? a.rowpos ||
                            0 : 0)
                    });
                    a(G).append(C);
                    x = a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='" + 2 * v + "'></td></tr>");
                    x[0].rp = 0;
                    a(C).append(x);
                    x = a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='" + 2 * v + "'>" + c[b.p.id].topinfo + "</td></tr>");
                    x[0].rp = 0;
                    a(C).append(x);
                    var q = (x = "rtl" == b.p.direction ? !0 : !1) ? "nData" : "pData", D = x ? "pData" : "nData";
                    l(u, b, C, v);
                    var q = "<a href='javascript:void(0)' id='" + q + "' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
                        D = "<a href='javascript:void(0)' id='" + D + "' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>", J = "<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>" + d.bSubmit + "</a>", K = "<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>" + d.bCancel + "</a>", k = "<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='" + k + "_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>" +
                            (x ? D + q : q + D) + "</td><td class='EditButton'>" + J + K + "</td></tr>" + ("<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>" + c[b.p.id].bottominfo + "</td></tr>"), k = k + "</tbody></table>";
                    if (0 < H) {
                        var L = [];
                        a.each(a(C)[0].rows, function (a, b) {
                            L[a] = b
                        });
                        L.sort(function (a, b) {
                            return a.rp > b.rp ? 1 : a.rp < b.rp ? -1 : 0
                        });
                        a.each(L, function (b, d) {
                            a("tbody", C).append(d)
                        })
                    }
                    d.gbox = "#gbox_" + a.jgrid.jqID(m);
                    var N = !1;
                    !0 === d.closeOnEscape && (d.closeOnEscape = !1, N = !0);
                    k = a("<span></span>").append(G).append(k);
                    a.jgrid.createModal(o,
                        k, d, "#gview_" + a.jgrid.jqID(b.p.id), a("#gbox_" + a.jgrid.jqID(b.p.id))[0]);
                    x && (a("#pData, #nData", j + "_2").css("float", "right"), a(".EditButton", j + "_2").css("text-align", "left"));
                    c[b.p.id].topinfo && a(".tinfo", j).show();
                    c[b.p.id].bottominfo && a(".binfo", j + "_2").show();
                    k = k = null;
                    a("#" + a.jgrid.jqID(o.themodal)).keydown(function (e) {
                        var f = e.target;
                        if (a("#" + h).data("disabled") === true)return false;
                        if (c[b.p.id].savekey[0] === true && e.which == c[b.p.id].savekey[1] && f.tagName != "TEXTAREA") {
                            a("#sData", j + "_2").trigger("click");
                            return false
                        }
                        if (e.which === 27) {
                            if (!g())return false;
                            N && a.jgrid.hideModal(this, {gb: d.gbox, jqm: d.jqModal, onClose: c[b.p.id].onClose});
                            return false
                        }
                        if (c[b.p.id].navkeys[0] === true) {
                            if (a("#id_g", j).val() == "_empty")return true;
                            if (e.which == c[b.p.id].navkeys[1]) {
                                a("#pData", j + "_2").trigger("click");
                                return false
                            }
                            if (e.which == c[b.p.id].navkeys[2]) {
                                a("#nData", j + "_2").trigger("click");
                                return false
                            }
                        }
                    });
                    d.checkOnUpdate && (a("a.ui-jqdialog-titlebar-close span", "#" + a.jgrid.jqID(o.themodal)).removeClass("jqmClose"), a("a.ui-jqdialog-titlebar-close",
                        "#" + a.jgrid.jqID(o.themodal)).unbind("click").click(function () {
                            if (!g())return false;
                            a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose});
                            return false
                        }));
                    d.saveicon = a.extend([!0, "left", "ui-icon-disk"], d.saveicon);
                    d.closeicon = a.extend([!0, "left", "ui-icon-close"], d.closeicon);
                    !0 === d.saveicon[0] && a("#sData", j + "_2").addClass("right" == d.saveicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append("<span class='ui-icon " + d.saveicon[2] +
                        "'></span>");
                    !0 === d.closeicon[0] && a("#cData", j + "_2").addClass("right" == d.closeicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append("<span class='ui-icon " + d.closeicon[2] + "'></span>");
                    if (c[b.p.id].checkOnSubmit || c[b.p.id].checkOnUpdate)J = "<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>" + d.bYes + "</a>", D = "<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>" + d.bNo + "</a>", K = "<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>" +
                        d.bExit + "</a>", k = d.zIndex || 999, k++, a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:" + k + ";display:none;'>&#160;" + (a.browser.msie && 6 == a.browser.version ? '<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>' : "") + "</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:" + (k + 1) + "'>" + d.saveData + "<br/><br/>" + J + D + K + "</div>").insertAfter("#" + h), a("#sNew", "#" + a.jgrid.jqID(o.themodal)).click(function () {
                        s();
                        a("#" + h).data("disabled", false);
                        a(".confirm", "#" + a.jgrid.jqID(o.themodal)).hide();
                        return false
                    }), a("#nNew", "#" + a.jgrid.jqID(o.themodal)).click(function () {
                        a(".confirm", "#" + a.jgrid.jqID(o.themodal)).hide();
                        a("#" + h).data("disabled", false);
                        setTimeout(function () {
                            a(":input", "#" + h)[0].focus()
                        }, 0);
                        return false
                    }), a("#cNew", "#" + a.jgrid.jqID(o.themodal)).click(function () {
                        a(".confirm", "#" + a.jgrid.jqID(o.themodal)).hide();
                        a("#" + h).data("disabled", false);
                        a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" +
                            a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose});
                        return false
                    });
                    a(b).triggerHandler("jqGridAddEditInitializeForm", [a("#" + h), z]);
                    E && E.call(b, a("#" + h));
                    "_empty" == u || !c[b.p.id].viewPagerButtons ? a("#pData,#nData", j + "_2").hide() : a("#pData,#nData", j + "_2").show();
                    a(b).triggerHandler("jqGridAddEditBeforeShowForm", [a("#" + h), z]);
                    y && y.call(b, a("#" + h));
                    a("#" + a.jgrid.jqID(o.themodal)).data("onClose", c[b.p.id].onClose);
                    a.jgrid.viewModal("#" + a.jgrid.jqID(o.themodal), {gbox: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal,
                        overlay: d.overlay, modal: d.modal});
                    I || a(".jqmOverlay").click(function () {
                        if (!g())return false;
                        a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose});
                        return false
                    });
                    a(b).triggerHandler("jqGridAddEditAfterShowForm", [a("#" + h), z]);
                    A && A.call(b, a("#" + h));
                    a(".fm-button", "#" + a.jgrid.jqID(o.themodal)).hover(function () {
                        a(this).addClass("ui-state-hover")
                    }, function () {
                        a(this).removeClass("ui-state-hover")
                    });
                    a("#sData", j + "_2").click(function () {
                        i = {};
                        B =
                        {};
                        a("#FormError", j).hide();
                        e();
                        if (i[b.p.id + "_id"] == "_empty")s(); else if (d.checkOnSubmit === true) {
                            F = a.extend({}, i, B);
                            if (M = p(F, c[b.p.id]._savedData)) {
                                a("#" + h).data("disabled", true);
                                a(".confirm", "#" + a.jgrid.jqID(o.themodal)).show()
                            } else s()
                        } else s();
                        return false
                    });
                    a("#cData", j + "_2").click(function () {
                        if (!g())return false;
                        a.jgrid.hideModal("#" + a.jgrid.jqID(o.themodal), {gb: "#gbox_" + a.jgrid.jqID(m), jqm: d.jqModal, onClose: c[b.p.id].onClose});
                        return false
                    });
                    a("#nData", j + "_2").click(function () {
                        if (!g())return false;
                        a("#FormError", j).hide();
                        var c = w();
                        c[0] = parseInt(c[0], 10);
                        if (c[0] != -1 && c[1][c[0] + 1]) {
                            a(b).triggerHandler("jqGridAddEditClickPgButtons", ["next", a("#" + h), c[1][c[0]]]);
                            a.isFunction(d.onclickPgButtons) && d.onclickPgButtons.call(b, "next", a("#" + h), c[1][c[0]]);
                            r(c[1][c[0] + 1], b, h);
                            a(b).jqGrid("setSelection", c[1][c[0] + 1]);
                            a(b).triggerHandler("jqGridAddEditAfterClickPgButtons", ["next", a("#" + h), c[1][c[0]]]);
                            a.isFunction(d.afterclickPgButtons) && d.afterclickPgButtons.call(b, "next", a("#" + h), c[1][c[0] + 1]);
                            n(c[0] +
                                1, c[1].length - 1)
                        }
                        return false
                    });
                    a("#pData", j + "_2").click(function () {
                        if (!g())return false;
                        a("#FormError", j).hide();
                        var c = w();
                        if (c[0] != -1 && c[1][c[0] - 1]) {
                            a(b).triggerHandler("jqGridAddEditClickPgButtons", ["prev", a("#" + h), c[1][c[0]]]);
                            a.isFunction(d.onclickPgButtons) && d.onclickPgButtons.call(b, "prev", a("#" + h), c[1][c[0]]);
                            r(c[1][c[0] - 1], b, h);
                            a(b).jqGrid("setSelection", c[1][c[0] - 1]);
                            a(b).triggerHandler("jqGridAddEditAfterClickPgButtons", ["prev", a("#" + h), c[1][c[0]]]);
                            a.isFunction(d.afterclickPgButtons) &&
                            d.afterclickPgButtons.call(b, "prev", a("#" + h), c[1][c[0] - 1]);
                            n(c[0] - 1, c[1].length - 1)
                        }
                        return false
                    })
                }
                y = w();
                n(y[0], y[1].length - 1)
            }
        })
    }, viewGridRow: function (c, d) {
        d = a.extend({top: 0, left: 0, width: 0, height: "auto", dataheight: "auto", modal: !1, overlay: 30, drag: !0, resize: !0, jqModal: !0, closeOnEscape: !1, labelswidth: "30%", closeicon: [], navkeys: [!1, 38, 40], onClose: null, beforeShowForm: null, beforeInitData: null, viewPagerButtons: !0}, a.jgrid.view, d || {});
        return this.each(function () {
            function e() {
                (!0 === d.closeOnEscape || !0 === d.navkeys[0]) &&
                setTimeout(function () {
                    a(".ui-jqdialog-titlebar-close", "#" + a.jgrid.jqID(m.modalhead)).focus()
                }, 0)
            }

            function l(b, c, e, f) {
                for (var g, h, k, j = 0, o, m, l = [], n = !1, p = "<td class='CaptionTD form-view-label ui-widget-content' width='" + d.labelswidth + "'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>", u = "", s = ["integer", "number", "currency"], r = 0, t = 0, y, x, w, A = 1; A <= f; A++)u += 1 == A ? p : "<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";
                a(c.p.colModel).each(function () {
                    h = this.editrules && !0 === this.editrules.edithidden ? !1 : !0 === this.hidden ? !0 : !1;
                    !h && "right" === this.align && (this.formatter && -1 !== a.inArray(this.formatter, s) ? r = Math.max(r, parseInt(this.width, 10)) : t = Math.max(t, parseInt(this.width, 10)))
                });
                y = 0 !== r ? r : 0 !== t ? t : 0;
                n = a(c).jqGrid("getInd", b);
                a(c.p.colModel).each(function (b) {
                    g = this.name;
                    x = !1;
                    m = (h = this.editrules && !0 === this.editrules.edithidden ? !1 : !0 === this.hidden ? !0 : !1) ? "style='display:none'" : "";
                    w = "boolean" != typeof this.viewable ? !0 : this.viewable;
                    if ("cb" !== g && "subgrid" !== g && "rn" !== g && w) {
                        o = !1 === n ? "" : g == c.p.ExpandColumn && !0 === c.p.treeGrid ? a("td:eq(" + b + ")", c.rows[n]).text() : a("td:eq(" + b + ")", c.rows[n]).html();
                        x = "right" === this.align && 0 !== y ? !0 : !1;
                        a.extend({}, this.editoptions || {}, {id: g, name: g});
                        var d = a.extend({}, {rowabove: !1, rowcontent: ""}, this.formoptions || {}), q = parseInt(d.rowpos, 10) || j + 1, p = parseInt(2 * (parseInt(d.colpos, 10) || 1), 10);
                        if (d.rowabove) {
                            var r = a("<tr><td class='contentinfo' colspan='" + 2 * f + "'>" + d.rowcontent + "</td></tr>");
                            a(e).append(r);
                            r[0].rp = q
                        }
                        k = a(e).find("tr[rowpos=" + q + "]");
                        0 === k.length && (k = a("<tr " + m + " rowpos='" + q + "'></tr>").addClass("FormData").attr("id", "trv_" + g), a(k).append(u), a(e).append(k), k[0].rp = q);
                        a("td:eq(" + (p - 2) + ")", k[0]).html("<b>" + ("undefined" === typeof d.label ? c.p.colNames[b] : d.label) + "</b>");
                        a("td:eq(" + (p - 1) + ")", k[0]).append("<span>" + o + "</span>").attr("id", "v_" + g);
                        x && a("td:eq(" + (p - 1) + ") span", k[0]).css({"text-align": "right", width: y + "px"});
                        l[j] = b;
                        j++
                    }
                });
                0 < j && (b = a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='" +
                    (2 * f - 1) + "' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='" + b + "'/></td></tr>"), b[0].rp = j + 99, a(e).append(b));
                return l
            }

            function r(b, c) {
                var d, e, f = 0, g, h;
                if (h = a(c).jqGrid("getInd", b, !0))a("td", h).each(function (b) {
                    d = c.p.colModel[b].name;
                    e = c.p.colModel[b].editrules && !0 === c.p.colModel[b].editrules.edithidden ? !1 : !0 === c.p.colModel[b].hidden ? !0 : !1;
                    "cb" !== d && ("subgrid" !== d && "rn" !== d) && (g = d == c.p.ExpandColumn && !0 === c.p.treeGrid ? a(this).text() : a(this).html(), a.extend({}, c.p.colModel[b].editoptions ||
                    {}), d = a.jgrid.jqID("v_" + d), a("#" + d + " span", "#" + n).html(g), e && a("#" + d, "#" + n).parents("tr:first").hide(), f++)
                }), 0 < f && a("#id_g", "#" + n).val(b)
            }

            function t(b, c) {
                0 === b ? a("#pData", "#" + n + "_2").addClass("ui-state-disabled") : a("#pData", "#" + n + "_2").removeClass("ui-state-disabled");
                b == c ? a("#nData", "#" + n + "_2").addClass("ui-state-disabled") : a("#nData", "#" + n + "_2").removeClass("ui-state-disabled")
            }

            function s() {
                var b = a(p).jqGrid("getDataIDs"), c = a("#id_g", "#" + n).val();
                return[a.inArray(c, b), b]
            }

            var p = this;
            if (p.grid &&
                c) {
                var g = p.p.id, f = "ViewGrid_" + a.jgrid.jqID(g), n = "ViewTbl_" + a.jgrid.jqID(g), w = "ViewGrid_" + g, b = "ViewTbl_" + g, m = {themodal: "viewmod" + g, modalhead: "viewhd" + g, modalcontent: "viewcnt" + g, scrollelm: f}, h = a.isFunction(d.beforeInitData) ? d.beforeInitData : !1, k = !0, j = 1, o = 0;
                if (null !== a("#" + a.jgrid.jqID(m.themodal)).html()) {
                    h && (k = h.call(p, a("#" + f)), "undefined" == typeof k && (k = !0));
                    if (!1 === k)return;
                    a(".ui-jqdialog-title", "#" + a.jgrid.jqID(m.modalhead)).html(d.caption);
                    a("#FormError", "#" + n).hide();
                    r(c, p);
                    a.isFunction(d.beforeShowForm) &&
                    d.beforeShowForm.call(p, a("#" + f));
                    a.jgrid.viewModal("#" + a.jgrid.jqID(m.themodal), {gbox: "#gbox_" + a.jgrid.jqID(g), jqm: d.jqModal, jqM: !1, overlay: d.overlay, modal: d.modal});
                    e()
                } else {
                    var y = isNaN(d.dataheight) ? d.dataheight : d.dataheight + "px", w = a("<form name='FormPost' id='" + w + "' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:" + y + ";'></form>"), A = a("<table id='" + b + "' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
                    h &&
                    (k = h.call(p, a("#" + f)), "undefined" == typeof k && (k = !0));
                    if (!1 === k)return;
                    a(p.p.colModel).each(function () {
                        var a = this.formoptions;
                        j = Math.max(j, a ? a.colpos || 0 : 0);
                        o = Math.max(o, a ? a.rowpos || 0 : 0)
                    });
                    a(w).append(A);
                    l(c, p, A, j);
                    b = "rtl" == p.p.direction ? !0 : !1;
                    h = "<a href='javascript:void(0)' id='" + (b ? "nData" : "pData") + "' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>";
                    k = "<a href='javascript:void(0)' id='" + (b ? "pData" : "nData") + "' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>";
                    y = "<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>" + d.bClose + "</a>";
                    if (0 < o) {
                        var x = [];
                        a.each(a(A)[0].rows, function (a, b) {
                            x[a] = b
                        });
                        x.sort(function (a, b) {
                            return a.rp > b.rp ? 1 : a.rp < b.rp ? -1 : 0
                        });
                        a.each(x, function (b, c) {
                            a("tbody", A).append(c)
                        })
                    }
                    d.gbox = "#gbox_" + a.jgrid.jqID(g);
                    var E = !1;
                    !0 === d.closeOnEscape && (d.closeOnEscape = !1, E = !0);
                    w = a("<span></span>").append(w).append("<table border='0' class='EditTable' id='" + n + "_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='" +
                        d.labelswidth + "'>" + (b ? k + h : h + k) + "</td><td class='EditButton'>" + y + "</td></tr></tbody></table>");
                    a.jgrid.createModal(m, w, d, "#gview_" + a.jgrid.jqID(p.p.id), a("#gview_" + a.jgrid.jqID(p.p.id))[0]);
                    b && (a("#pData, #nData", "#" + n + "_2").css("float", "right"), a(".EditButton", "#" + n + "_2").css("text-align", "left"));
                    d.viewPagerButtons || a("#pData, #nData", "#" + n + "_2").hide();
                    w = null;
                    a("#" + m.themodal).keydown(function (b) {
                        if (b.which === 27) {
                            E && a.jgrid.hideModal(this, {gb: d.gbox, jqm: d.jqModal, onClose: d.onClose});
                            return false
                        }
                        if (d.navkeys[0] ===
                            true) {
                            if (b.which === d.navkeys[1]) {
                                a("#pData", "#" + n + "_2").trigger("click");
                                return false
                            }
                            if (b.which === d.navkeys[2]) {
                                a("#nData", "#" + n + "_2").trigger("click");
                                return false
                            }
                        }
                    });
                    d.closeicon = a.extend([!0, "left", "ui-icon-close"], d.closeicon);
                    !0 === d.closeicon[0] && a("#cData", "#" + n + "_2").addClass("right" == d.closeicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append("<span class='ui-icon " + d.closeicon[2] + "'></span>");
                    a.isFunction(d.beforeShowForm) && d.beforeShowForm.call(p, a("#" + f));
                    a.jgrid.viewModal("#" +
                        a.jgrid.jqID(m.themodal), {gbox: "#gbox_" + a.jgrid.jqID(g), jqm: d.jqModal, modal: d.modal});
                    a(".fm-button:not(.ui-state-disabled)", "#" + n + "_2").hover(function () {
                        a(this).addClass("ui-state-hover")
                    }, function () {
                        a(this).removeClass("ui-state-hover")
                    });
                    e();
                    a("#cData", "#" + n + "_2").click(function () {
                        a.jgrid.hideModal("#" + a.jgrid.jqID(m.themodal), {gb: "#gbox_" + a.jgrid.jqID(g), jqm: d.jqModal, onClose: d.onClose});
                        return false
                    });
                    a("#nData", "#" + n + "_2").click(function () {
                        a("#FormError", "#" + n).hide();
                        var b = s();
                        b[0] = parseInt(b[0],
                            10);
                        if (b[0] != -1 && b[1][b[0] + 1]) {
                            a.isFunction(d.onclickPgButtons) && d.onclickPgButtons.call(p, "next", a("#" + f), b[1][b[0]]);
                            r(b[1][b[0] + 1], p);
                            a(p).jqGrid("setSelection", b[1][b[0] + 1]);
                            a.isFunction(d.afterclickPgButtons) && d.afterclickPgButtons.call(p, "next", a("#" + f), b[1][b[0] + 1]);
                            t(b[0] + 1, b[1].length - 1)
                        }
                        e();
                        return false
                    });
                    a("#pData", "#" + n + "_2").click(function () {
                        a("#FormError", "#" + n).hide();
                        var b = s();
                        if (b[0] != -1 && b[1][b[0] - 1]) {
                            a.isFunction(d.onclickPgButtons) && d.onclickPgButtons.call(p, "prev", a("#" + f), b[1][b[0]]);
                            r(b[1][b[0] - 1], p);
                            a(p).jqGrid("setSelection", b[1][b[0] - 1]);
                            a.isFunction(d.afterclickPgButtons) && d.afterclickPgButtons.call(p, "prev", a("#" + f), b[1][b[0] - 1]);
                            t(b[0] - 1, b[1].length - 1)
                        }
                        e();
                        return false
                    })
                }
                w = s();
                t(w[0], w[1].length - 1)
            }
        })
    }, delGridRow: function (u, d) {
        d = a.extend({top: 0, left: 0, width: 240, height: "auto", dataheight: "auto", modal: !1, overlay: 30, drag: !0, resize: !0, url: "", mtype: "POST", reloadAfterSubmit: !0, beforeShowForm: null, beforeInitData: null, afterShowForm: null, beforeSubmit: null, onclickSubmit: null, afterSubmit: null,
            jqModal: !0, closeOnEscape: !1, delData: {}, delicon: [], cancelicon: [], onClose: null, ajaxDelOptions: {}, processing: !1, serializeDelData: null, useDataProxy: !1}, a.jgrid.del, d || {});
        c[a(this)[0].p.id] = d;
        return this.each(function () {
            var e = this;
            if (e.grid && u) {
                var l = a.isFunction(c[e.p.id].beforeShowForm), r = a.isFunction(c[e.p.id].afterShowForm), t = a.isFunction(c[e.p.id].beforeInitData) ? c[e.p.id].beforeInitData : !1, s = e.p.id, p = {}, g = !0, f = "DelTbl_" + a.jgrid.jqID(s), n, w, b, m, h = "DelTbl_" + s, k = {themodal: "delmod" + s, modalhead: "delhd" +
                    s, modalcontent: "delcnt" + s, scrollelm: f};
                jQuery.isArray(u) && (u = u.join());
                if (null !== a("#" + a.jgrid.jqID(k.themodal)).html()) {
                    t && (g = t.call(e, a("#" + f)), "undefined" == typeof g && (g = !0));
                    if (!1 === g)return;
                    a("#DelData>td", "#" + f).text(u);
                    a("#DelError", "#" + f).hide();
                    !0 === c[e.p.id].processing && (c[e.p.id].processing = !1, a("#dData", "#" + f).removeClass("ui-state-active"));
                    l && c[e.p.id].beforeShowForm.call(e, a("#" + f));
                    a.jgrid.viewModal("#" + a.jgrid.jqID(k.themodal), {gbox: "#gbox_" + a.jgrid.jqID(s), jqm: c[e.p.id].jqModal, jqM: !1,
                        overlay: c[e.p.id].overlay, modal: c[e.p.id].modal})
                } else {
                    var j = isNaN(c[e.p.id].dataheight) ? c[e.p.id].dataheight : c[e.p.id].dataheight + "px", h = "<div id='" + h + "' class='formdata' style='width:100%;overflow:auto;position:relative;height:" + j + ";'><table class='DelTable'><tbody><tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>" + ("<tr id='DelData' style='display:none'><td >" + u + "</td></tr>"), h = h + ('<tr><td class="delmsg" style="white-space:pre;">' + c[e.p.id].msg + "</td></tr><tr><td >&#160;</td></tr>"),
                        h = h + "</tbody></table></div>" + ("<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='" + f + "_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='DelButton EditButton'>" + ("<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>" + d.bSubmit + "</a>") + "&#160;" + ("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>" + d.bCancel + "</a>") + "</td></tr></tbody></table>");
                    d.gbox = "#gbox_" +
                        a.jgrid.jqID(s);
                    a.jgrid.createModal(k, h, d, "#gview_" + a.jgrid.jqID(e.p.id), a("#gview_" + a.jgrid.jqID(e.p.id))[0]);
                    t && (g = t.call(e, a("#" + f)), "undefined" == typeof g && (g = !0));
                    if (!1 === g)return;
                    a(".fm-button", "#" + f + "_2").hover(function () {
                        a(this).addClass("ui-state-hover")
                    }, function () {
                        a(this).removeClass("ui-state-hover")
                    });
                    d.delicon = a.extend([!0, "left", "ui-icon-scissors"], c[e.p.id].delicon);
                    d.cancelicon = a.extend([!0, "left", "ui-icon-cancel"], c[e.p.id].cancelicon);
                    !0 === d.delicon[0] && a("#dData", "#" + f + "_2").addClass("right" ==
                        d.delicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append("<span class='ui-icon " + d.delicon[2] + "'></span>");
                    !0 === d.cancelicon[0] && a("#eData", "#" + f + "_2").addClass("right" == d.cancelicon[1] ? "fm-button-icon-right" : "fm-button-icon-left").append("<span class='ui-icon " + d.cancelicon[2] + "'></span>");
                    a("#dData", "#" + f + "_2").click(function () {
                        var g = [true, ""];
                        p = {};
                        var h = a("#DelData>td", "#" + f).text();
                        a.isFunction(c[e.p.id].onclickSubmit) && (p = c[e.p.id].onclickSubmit.call(e, c[e.p.id], h) || {});
                        a.isFunction(c[e.p.id].beforeSubmit) &&
                        (g = c[e.p.id].beforeSubmit.call(e, h));
                        if (g[0] && !c[e.p.id].processing) {
                            c[e.p.id].processing = true;
                            b = e.p.prmNames;
                            n = a.extend({}, c[e.p.id].delData, p);
                            m = b.oper;
                            n[m] = b.deloper;
                            w = b.id;
                            h = ("" + h).split(",");
                            if (!h.length)return false;
                            for (var j in h)h.hasOwnProperty(j) && (h[j] = a.jgrid.stripPref(e.p.idPrefix, h[j]));
                            n[w] = h.join();
                            a(this).addClass("ui-state-active");
                            j = a.extend({url: c[e.p.id].url ? c[e.p.id].url : a(e).jqGrid("getGridParam", "editurl"), type: c[e.p.id].mtype, data: a.isFunction(c[e.p.id].serializeDelData) ?
                                c[e.p.id].serializeDelData.call(e, n) : n, complete: function (b, j) {
                                if (j != "success") {
                                    g[0] = false;
                                    g[1] = a.isFunction(c[e.p.id].errorTextFormat) ? c[e.p.id].errorTextFormat.call(e, b) : j + " Status: '" + b.statusText + "'. Error code: " + b.status
                                } else a.isFunction(c[e.p.id].afterSubmit) && (g = c[e.p.id].afterSubmit.call(e, b, n));
                                if (g[0] === false) {
                                    a("#DelError>td", "#" + f).html(g[1]);
                                    a("#DelError", "#" + f).show()
                                } else {
                                    if (c[e.p.id].reloadAfterSubmit && e.p.datatype != "local")a(e).trigger("reloadGrid"); else {
                                        if (e.p.treeGrid === true)try {
                                            a(e).jqGrid("delTreeNode",
                                                e.p.idPrefix + h[0])
                                        } catch (m) {
                                        } else for (var l = 0; l < h.length; l++)a(e).jqGrid("delRowData", e.p.idPrefix + h[l]);
                                        e.p.selrow = null;
                                        e.p.selarrrow = []
                                    }
                                    a.isFunction(c[e.p.id].afterComplete) && setTimeout(function () {
                                        c[e.p.id].afterComplete.call(e, b, h)
                                    }, 500)
                                }
                                c[e.p.id].processing = false;
                                a("#dData", "#" + f + "_2").removeClass("ui-state-active");
                                g[0] && a.jgrid.hideModal("#" + a.jgrid.jqID(k.themodal), {gb: "#gbox_" + a.jgrid.jqID(s), jqm: d.jqModal, onClose: c[e.p.id].onClose})
                            }}, a.jgrid.ajaxOptions, c[e.p.id].ajaxDelOptions);
                            if (!j.url && !c[e.p.id].useDataProxy)if (a.isFunction(e.p.dataProxy))c[e.p.id].useDataProxy = true; else {
                                g[0] = false;
                                g[1] = g[1] + (" " + a.jgrid.errors.nourl)
                            }
                            if (g[0])if (c[e.p.id].useDataProxy) {
                                j = e.p.dataProxy.call(e, j, "del_" + e.p.id);
                                typeof j == "undefined" && (j = [true, ""]);
                                if (j[0] === false) {
                                    g[0] = false;
                                    g[1] = j[1] || "Error deleting the selected row!"
                                } else a.jgrid.hideModal("#" + a.jgrid.jqID(k.themodal), {gb: "#gbox_" + a.jgrid.jqID(s), jqm: d.jqModal, onClose: c[e.p.id].onClose})
                            } else a.ajax(j)
                        }
                        if (g[0] === false) {
                            a("#DelError>td", "#" + f).html(g[1]);
                            a("#DelError", "#" + f).show()
                        }
                        return false
                    });
                    a("#eData", "#" + f + "_2").click(function () {
                        a.jgrid.hideModal("#" + a.jgrid.jqID(k.themodal), {gb: "#gbox_" + a.jgrid.jqID(s), jqm: c[e.p.id].jqModal, onClose: c[e.p.id].onClose});
                        return false
                    });
                    l && c[e.p.id].beforeShowForm.call(e, a("#" + f));
                    a.jgrid.viewModal("#" + a.jgrid.jqID(k.themodal), {gbox: "#gbox_" + a.jgrid.jqID(s), jqm: c[e.p.id].jqModal, overlay: c[e.p.id].overlay, modal: c[e.p.id].modal})
                }
                r && c[e.p.id].afterShowForm.call(e, a("#" + f));
                !0 === c[e.p.id].closeOnEscape && setTimeout(function () {
                    a(".ui-jqdialog-titlebar-close",
                        "#" + a.jgrid.jqID(k.modalhead)).focus()
                }, 0)
            }
        })
    }, navGrid: function (c, d, e, l, r, t, s) {
        d = a.extend({edit: !0, editicon: "ui-icon-pencil", add: !0, addicon: "ui-icon-plus", del: !0, delicon: "ui-icon-trash", search: !0, searchicon: "ui-icon-search", refresh: !0, refreshicon: "ui-icon-refresh", refreshstate: "firstpage", view: !1, viewicon: "ui-icon-document", position: "left", closeOnEscape: !0, beforeRefresh: null, afterRefresh: null, cloneToTop: !1, alertwidth: 200, alertheight: "auto", alerttop: null, alertleft: null, alertzIndex: null}, a.jgrid.nav,
            d || {});
        return this.each(function () {
            if (!this.nav) {
                var p = {themodal: "alertmod", modalhead: "alerthd", modalcontent: "alertcnt"}, g = this, f;
                if (g.grid && "string" == typeof c) {
                    null === a("#" + p.themodal).html() && (!d.alerttop && !d.alertleft && ("undefined" != typeof window.innerWidth ? (d.alertleft = window.innerWidth, d.alerttop = window.innerHeight) : "undefined" != typeof document.documentElement && "undefined" != typeof document.documentElement.clientWidth && 0 !== document.documentElement.clientWidth ? (d.alertleft = document.documentElement.clientWidth,
                        d.alerttop = document.documentElement.clientHeight) : (d.alertleft = 1024, d.alerttop = 768), d.alertleft = d.alertleft / 2 - parseInt(d.alertwidth, 10) / 2, d.alerttop = d.alerttop / 2 - 25), a.jgrid.createModal(p, "<div>" + d.alerttext + "</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>", {gbox: "#gbox_" + a.jgrid.jqID(g.p.id), jqModal: !0, drag: !0, resize: !0, caption: d.alertcap, top: d.alerttop, left: d.alertleft, width: d.alertwidth, height: d.alertheight, closeOnEscape: d.closeOnEscape, zIndex: d.alertzIndex}, "", "", !0));
                    var n = 1;
                    d.cloneToTop && g.p.toppager && (n = 2);
                    for (var w = 0; w < n; w++) {
                        var b = a("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"), m, h;
                        0 === w ? (m = c, h = g.p.id, m == g.p.toppager && (h += "_top", n = 1)) : (m = g.p.toppager, h = g.p.id + "_top");
                        "rtl" == g.p.direction && a(b).attr("dir", "rtl").css("float", "right");
                        d.add && (l = l || {}, f = a("<td class='ui-pg-button ui-corner-all'></td>"), a(f).append("<div class='ui-pg-div'><span class='ui-icon " +
                            d.addicon + "'></span>" + d.addtext + "</div>"), a("tr", b).append(f), a(f, b).attr({title: d.addtitle || "", id: l.id || "add_" + h}).click(function () {
                            a(this).hasClass("ui-state-disabled") || (a.isFunction(d.addfunc) ? d.addfunc.call(g) : a(g).jqGrid("editGridRow", "new", l));
                            return false
                        }).hover(function () {
                                a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")
                            }, function () {
                                a(this).removeClass("ui-state-hover")
                            }), f = null);
                        d.edit && (f = a("<td class='ui-pg-button ui-corner-all'></td>"), e = e || {}, a(f).append("<div class='ui-pg-div'><span class='ui-icon " +
                            d.editicon + "'></span>" + d.edittext + "</div>"), a("tr", b).append(f), a(f, b).attr({title: d.edittitle || "", id: e.id || "edit_" + h}).click(function () {
                            if (!a(this).hasClass("ui-state-disabled")) {
                                var b = g.p.selrow;
                                if (b)a.isFunction(d.editfunc) ? d.editfunc.call(g, b) : a(g).jqGrid("editGridRow", b, e); else {
                                    a.jgrid.viewModal("#" + p.themodal, {gbox: "#gbox_" + a.jgrid.jqID(g.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")
                            }),
                            f = null);
                        d.view && (f = a("<td class='ui-pg-button ui-corner-all'></td>"), s = s || {}, a(f).append("<div class='ui-pg-div'><span class='ui-icon " + d.viewicon + "'></span>" + d.viewtext + "</div>"), a("tr", b).append(f), a(f, b).attr({title: d.viewtitle || "", id: s.id || "view_" + h}).click(function () {
                            if (!a(this).hasClass("ui-state-disabled")) {
                                var b = g.p.selrow;
                                if (b)a.isFunction(d.viewfunc) ? d.viewfunc.call(g, b) : a(g).jqGrid("viewGridRow", b, s); else {
                                    a.jgrid.viewModal("#" + p.themodal, {gbox: "#gbox_" + a.jgrid.jqID(g.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")
                            }), f = null);
                        d.del && (f = a("<td class='ui-pg-button ui-corner-all'></td>"), r = r || {}, a(f).append("<div class='ui-pg-div'><span class='ui-icon " + d.delicon + "'></span>" + d.deltext + "</div>"), a("tr", b).append(f), a(f, b).attr({title: d.deltitle || "", id: r.id || "del_" + h}).click(function () {
                            if (!a(this).hasClass("ui-state-disabled")) {
                                var b;
                                if (g.p.multiselect) {
                                    b = g.p.selarrrow;
                                    b.length === 0 && (b = null)
                                } else b = g.p.selrow;
                                if (b)a.isFunction(d.delfunc) ?
                                    d.delfunc.call(g, b) : a(g).jqGrid("delGridRow", b, r); else {
                                    a.jgrid.viewModal("#" + p.themodal, {gbox: "#gbox_" + a.jgrid.jqID(g.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")
                            }), f = null);
                        (d.add || d.edit || d.del || d.view) && a("tr", b).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");
                        d.search && (f = a("<td class='ui-pg-button ui-corner-all'></td>"),
                            t = t || {}, a(f).append("<div class='ui-pg-div'><span class='ui-icon " + d.searchicon + "'></span>" + d.searchtext + "</div>"), a("tr", b).append(f), a(f, b).attr({title: d.searchtitle || "", id: t.id || "search_" + h}).click(function () {
                            a(this).hasClass("ui-state-disabled") || (a.isFunction(d.searchfunc) ? d.searchfunc.call(g, t) : a(g).jqGrid("searchGrid", t));
                            return false
                        }).hover(function () {
                                a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")
                            }, function () {
                                a(this).removeClass("ui-state-hover")
                            }), t.showOnLoad &&
                            !0 === t.showOnLoad && a(f, b).click(), f = null);
                        d.refresh && (f = a("<td class='ui-pg-button ui-corner-all'></td>"), a(f).append("<div class='ui-pg-div'><span class='ui-icon " + d.refreshicon + "'></span>" + d.refreshtext + "</div>"), a("tr", b).append(f), a(f, b).attr({title: d.refreshtitle || "", id: "refresh_" + h}).click(function () {
                            if (!a(this).hasClass("ui-state-disabled")) {
                                a.isFunction(d.beforeRefresh) && d.beforeRefresh.call(g);
                                g.p.search = false;
                                try {
                                    var b = g.p.id;
                                    g.p.postData.filters = "";
                                    a("#fbox_" + a.jgrid.jqID(b)).jqFilter("resetFilter");
                                    a.isFunction(g.clearToolbar) && g.clearToolbar.call(g, false)
                                } catch (c) {
                                }
                                switch (d.refreshstate) {
                                    case "firstpage":
                                        a(g).trigger("reloadGrid", [
                                            {page: 1}
                                        ]);
                                        break;
                                    case "current":
                                        a(g).trigger("reloadGrid", [
                                            {current: true}
                                        ])
                                }
                                a.isFunction(d.afterRefresh) && d.afterRefresh.call(g)
                            }
                            return false
                        }).hover(function () {
                                a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")
                            }, function () {
                                a(this).removeClass("ui-state-hover")
                            }), f = null);
                        f = a(".ui-jqgrid").css("font-size") || "11px";
                        a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:" +
                            f + ";visibility:hidden;' ></div>");
                        f = a(b).clone().appendTo("#testpg2").width();
                        a("#testpg2").remove();
                        a(m + "_" + d.position, m).append(b);
                        g.p._nvtd && (f > g.p._nvtd[0] && (a(m + "_" + d.position, m).width(f), g.p._nvtd[0] = f), g.p._nvtd[1] = f);
                        b = f = f = null;
                        this.nav = !0
                    }
                }
            }
        })
    }, navButtonAdd: function (c, d) {
        d = a.extend({caption: "newButton", title: "", buttonicon: "ui-icon-newwin", onClickButton: null, position: "last", cursor: "pointer"}, d || {});
        return this.each(function () {
            if (this.grid) {
                "string" === typeof c && 0 !== c.indexOf("#") && (c = "#" + a.jgrid.jqID(c));
                var e = a(".navtable", c)[0], l = this;
                if (e && !(d.id && null !== a("#" + a.jgrid.jqID(d.id), e).html())) {
                    var r = a("<td></td>");
                    "NONE" == d.buttonicon.toString().toUpperCase() ? a(r).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>" + d.caption + "</div>") : a(r).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon " + d.buttonicon + "'></span>" + d.caption + "</div>");
                    d.id && a(r).attr("id", d.id);
                    "first" == d.position ? 0 === e.rows[0].cells.length ? a("tr", e).append(r) : a("tr td:eq(0)",
                        e).before(r) : a("tr", e).append(r);
                    a(r, e).attr("title", d.title || "").click(function (c) {
                        a(this).hasClass("ui-state-disabled") || a.isFunction(d.onClickButton) && d.onClickButton.call(l, c);
                        return!1
                    }).hover(function () {
                            a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")
                        }, function () {
                            a(this).removeClass("ui-state-hover")
                        })
                }
            }
        })
    }, navSeparatorAdd: function (c, d) {
        d = a.extend({sepclass: "ui-separator", sepcontent: ""}, d || {});
        return this.each(function () {
            if (this.grid) {
                "string" === typeof c && 0 !== c.indexOf("#") &&
                (c = "#" + a.jgrid.jqID(c));
                var e = a(".navtable", c)[0];
                if (e) {
                    var l = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='" + d.sepclass + "'></span>" + d.sepcontent + "</td>";
                    a("tr", e).append(l)
                }
            }
        })
    }, GridToForm: function (c, d) {
        return this.each(function () {
            var e = this;
            if (e.grid) {
                var l = a(e).jqGrid("getRowData", c);
                if (l)for (var r in l)a("[name=" + a.jgrid.jqID(r) + "]", d).is("input:radio") || a("[name=" + a.jgrid.jqID(r) + "]", d).is("input:checkbox") ? a("[name=" + a.jgrid.jqID(r) + "]", d).each(function () {
                    if (a(this).val() ==
                        l[r])a(this)[e.p.useProp ? "prop" : "attr"]("checked", !0); else a(this)[e.p.useProp ? "prop" : "attr"]("checked", !1)
                }) : a("[name=" + a.jgrid.jqID(r) + "]", d).val(l[r])
            }
        })
    }, FormToGrid: function (c, d, e, l) {
        return this.each(function () {
            if (this.grid) {
                e || (e = "set");
                l || (l = "first");
                var r = a(d).serializeArray(), t = {};
                a.each(r, function (a, c) {
                    t[c.name] = c.value
                });
                "add" == e ? a(this).jqGrid("addRowData", c, t, l) : "set" == e && a(this).jqGrid("setRowData", c, t)
            }
        })
    }})
})(jQuery);
(function (a) {
    a.fn.jqFilter = function (d) {
        if ("string" === typeof d) {
            var n = a.fn.jqFilter[d];
            if (!n)throw"jqFilter - No such method: " + d;
            var u = a.makeArray(arguments).slice(1);
            return n.apply(this, u)
        }
        var o = a.extend(!0, {filter: null, columns: [], onChange: null, afterRedraw: null, checkValues: null, error: !1, errmsg: "", errorcheck: !0, showQuery: !0, 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",
                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",
                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".split(" "), stropts: "eq ne bw bn ew en cn nc nu nn in ni".split(" "), _gridsopt: [], groupOps: [
            {op: "AND", text: "AND"},
            {op: "OR", text: "OR"}
        ], groupButton: !0, ruleButtons: !0, direction: "ltr"}, a.jgrid.filter, d || {});
        return this.each(function () {
            if (!this.filter) {
                this.p = o;
                if (null === this.p.filter || void 0 === this.p.filter)this.p.filter =
                {groupOp: this.p.groupOps[0].op, rules: [], groups: []};
                var d, n = this.p.columns.length, f, t = /msie/i.test(navigator.userAgent) && !window.opera;
                if (this.p._gridsopt.length)for (d = 0; d < this.p._gridsopt.length; d++)this.p.ops[d].description = this.p._gridsopt[d];
                this.p.initFilter = a.extend(!0, {}, this.p.filter);
                if (n) {
                    for (d = 0; d < n; d++)if (f = this.p.columns[d], f.stype ? f.inputtype = f.stype : f.inputtype || (f.inputtype = "text"), f.sorttype ? f.searchtype = f.sorttype : f.searchtype || (f.searchtype = "string"), void 0 === f.hidden && (f.hidden = !1), f.label || (f.label = f.name), f.index && (f.name = f.index), f.hasOwnProperty("searchoptions") || (f.searchoptions = {}), !f.hasOwnProperty("searchrules"))f.searchrules = {};
                    this.p.showQuery && a(this).append("<table class='queryresult ui-widget ui-widget-content' style='display:block;max-width:440px;border:0px none;' dir='" + this.p.direction + "'><tbody><tr><td class='query'></td></tr></tbody></table>");
                    var r = function (g, k) {
                        var b = [!0, ""];
                        if (a.isFunction(k.searchrules))b = k.searchrules(g, k); else if (a.jgrid && a.jgrid.checkValues)try {
                            b =
                                a.jgrid.checkValues(g, -1, null, k.searchrules, k.label)
                        } catch (c) {
                        }
                        b && (b.length && !1 === b[0]) && (o.error = !b[0], o.errmsg = b[1])
                    };
                    this.onchange = function () {
                        this.p.error = !1;
                        this.p.errmsg = "";
                        return a.isFunction(this.p.onChange) ? this.p.onChange.call(this, this.p) : !1
                    };
                    this.reDraw = function () {
                        a("table.group:first", this).remove();
                        var g = this.createTableForGroup(o.filter, null);
                        a(this).append(g);
                        a.isFunction(this.p.afterRedraw) && this.p.afterRedraw.call(this, this.p)
                    };
                    this.createTableForGroup = function (g, k) {
                        var b = this, c,
                            e = a("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody></tbody></table>"), d = "left";
                        "rtl" == this.p.direction && (d = "right", e.attr("dir", "rtl"));
                        null === k && e.append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='" + d + "'></th></tr>");
                        var h = a("<tr></tr>");
                        e.append(h);
                        d = a("<th colspan='5' align='" + d + "'></th>");
                        h.append(d);
                        if (!0 === this.p.ruleButtons) {
                            var i = a("<select class='opsel'></select>");
                            d.append(i);
                            var h = "", f;
                            for (c = 0; c < o.groupOps.length; c++)f =
                                g.groupOp === b.p.groupOps[c].op ? " selected='selected'" : "", h += "<option value='" + b.p.groupOps[c].op + "'" + f + ">" + b.p.groupOps[c].text + "</option>";
                            i.append(h).bind("change", function () {
                                g.groupOp = a(i).val();
                                b.onchange()
                            })
                        }
                        h = "<span></span>";
                        this.p.groupButton && (h = a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>"), h.bind("click", function () {
                            if (g.groups === void 0)g.groups = [];
                            g.groups.push({groupOp: o.groupOps[0].op, rules: [], groups: []});
                            b.reDraw();
                            b.onchange();
                            return false
                        }));
                        d.append(h);
                        if (!0 === this.p.ruleButtons) {
                            var h = a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"), l;
                            h.bind("click", function () {
                                if (g.rules === void 0)g.rules = [];
                                for (c = 0; c < b.p.columns.length; c++) {
                                    var a = typeof b.p.columns[c].search === "undefined" ? true : b.p.columns[c].search, e = b.p.columns[c].hidden === true;
                                    if (b.p.columns[c].searchoptions.searchhidden === true && a || a && !e) {
                                        l = b.p.columns[c];
                                        break
                                    }
                                }
                                g.rules.push({field: l.name, op: (l.searchoptions.sopt ? l.searchoptions.sopt : b.p.sopt ? b.p.sopt : l.searchtype ===
                                    "string" ? b.p.stropts : b.p.numopts)[0], data: ""});
                                b.reDraw();
                                return false
                            });
                            d.append(h)
                        }
                        null !== k && (h = a("<input type='button' value='-' title='Delete group' class='delete-group'/>"), d.append(h), h.bind("click", function () {
                            for (c = 0; c < k.groups.length; c++)if (k.groups[c] === g) {
                                k.groups.splice(c, 1);
                                break
                            }
                            b.reDraw();
                            b.onchange();
                            return false
                        }));
                        if (void 0 !== g.groups)for (c = 0; c < g.groups.length; c++)d = a("<tr></tr>"), e.append(d), h = a("<td class='first'></td>"), d.append(h), h = a("<td colspan='4'></td>"), h.append(this.createTableForGroup(g.groups[c],
                            g)), d.append(h);
                        void 0 === g.groupOp && (g.groupOp = b.p.groupOps[0].op);
                        if (void 0 !== g.rules)for (c = 0; c < g.rules.length; c++)e.append(this.createTableRowForRule(g.rules[c], g));
                        return e
                    };
                    this.createTableRowForRule = function (g, d) {
                        var b = this, c = a("<tr></tr>"), e, f, h, i, j = "", l;
                        c.append("<td class='first'></td>");
                        var m = a("<td class='columns'></td>");
                        c.append(m);
                        var n = a("<select></select>"), p, q = [];
                        m.append(n);
                        n.bind("change", function () {
                            g.field = a(n).val();
                            h = a(this).parents("tr:first");
                            for (e = 0; e < b.p.columns.length; e++)if (b.p.columns[e].name ===
                                g.field) {
                                i = b.p.columns[e];
                                break
                            }
                            if (i) {
                                i.searchoptions.id = a.jgrid.randId();
                                t && "text" === i.inputtype && !i.searchoptions.size && (i.searchoptions.size = 10);
                                var c = a.jgrid.createEl(i.inputtype, i.searchoptions, "", !0, b.p.ajaxSelectOptions, !0);
                                a(c).addClass("input-elm");
                                f = i.searchoptions.sopt ? i.searchoptions.sopt : b.p.sopt ? b.p.sopt : "string" === i.searchtype ? b.p.stropts : b.p.numopts;
                                var d = "", k = 0;
                                q = [];
                                a.each(b.p.ops, function () {
                                    q.push(this.name)
                                });
                                for (e = 0; e < f.length; e++)p = a.inArray(f[e], q), -1 !== p && (0 === k && (g.op = b.p.ops[p].name),
                                    d += "<option value='" + b.p.ops[p].name + "'>" + b.p.ops[p].description + "</option>", k++);
                                a(".selectopts", h).empty().append(d);
                                a(".selectopts", h)[0].selectedIndex = 0;
                                a.browser.msie && 9 > a.browser.version && (d = parseInt(a("select.selectopts", h)[0].offsetWidth) + 1, a(".selectopts", h).width(d), a(".selectopts", h).css("width", "auto"));
                                a(".data", h).empty().append(c);
                                a(".input-elm", h).bind("change", function (c) {
                                    var d = a(this).hasClass("ui-autocomplete-input") ? 200 : 0;
                                    setTimeout(function () {
                                        var d = c.target;
                                        g.data = d.nodeName.toUpperCase() ===
                                            "SPAN" && i.searchoptions && a.isFunction(i.searchoptions.custom_value) ? i.searchoptions.custom_value(a(d).children(".customelement:first"), "get") : d.value;
                                        b.onchange()
                                    }, d)
                                });
                                setTimeout(function () {
                                    g.data = a(c).val();
                                    b.onchange()
                                }, 0)
                            }
                        });
                        for (e = m = 0; e < b.p.columns.length; e++) {
                            l = "undefined" === typeof b.p.columns[e].search ? !0 : b.p.columns[e].search;
                            var r = !0 === b.p.columns[e].hidden;
                            if (!0 === b.p.columns[e].searchoptions.searchhidden && l || l && !r)l = "", g.field === b.p.columns[e].name && (l = " selected='selected'", m = e), j += "<option value='" +
                                b.p.columns[e].name + "'" + l + ">" + b.p.columns[e].label + "</option>"
                        }
                        n.append(j);
                        j = a("<td class='operators'></td>");
                        c.append(j);
                        i = o.columns[m];
                        i.searchoptions.id = a.jgrid.randId();
                        t && "text" === i.inputtype && !i.searchoptions.size && (i.searchoptions.size = 10);
                        var m = a.jgrid.createEl(i.inputtype, i.searchoptions, g.data, !0, b.p.ajaxSelectOptions, !0), s = a("<select class='selectopts'></select>");
                        j.append(s);
                        s.bind("change", function () {
                            g.op = a(s).val();
                            h = a(this).parents("tr:first");
                            var c = a(".input-elm", h)[0];
                            if (g.op === "nu" ||
                                g.op === "nn") {
                                g.data = "";
                                c.value = "";
                                c.setAttribute("readonly", "true");
                                c.setAttribute("disabled", "true")
                            } else {
                                c.removeAttribute("readonly");
                                c.removeAttribute("disabled")
                            }
                            b.onchange()
                        });
                        f = i.searchoptions.sopt ? i.searchoptions.sopt : b.p.sopt ? b.p.sopt : "string" === i.searchtype ? o.stropts : b.p.numopts;
                        j = "";
                        a.each(b.p.ops, function () {
                            q.push(this.name)
                        });
                        for (e = 0; e < f.length; e++)p = a.inArray(f[e], q), -1 !== p && (l = g.op === b.p.ops[p].name ? " selected='selected'" : "", j += "<option value='" + b.p.ops[p].name + "'" + l + ">" + b.p.ops[p].description +
                            "</option>");
                        s.append(j);
                        j = a("<td class='data'></td>");
                        c.append(j);
                        j.append(m);
                        a(m).addClass("input-elm").bind("change", function () {
                            g.data = i.inputtype === "custom" ? i.searchoptions.custom_value(a(this).children(".customelement:first"), "get") : a(this).val();
                            b.onchange()
                        });
                        j = a("<td></td>");
                        c.append(j);
                        !0 === this.p.ruleButtons && (m = a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>"), j.append(m), m.bind("click", function () {
                            for (e = 0; e < d.rules.length; e++)if (d.rules[e] === g) {
                                d.rules.splice(e,
                                    1);
                                break
                            }
                            b.reDraw();
                            b.onchange();
                            return false
                        }));
                        return c
                    };
                    this.getStringForGroup = function (a) {
                        var d = "(", b;
                        if (void 0 !== a.groups)for (b = 0; b < a.groups.length; b++) {
                            1 < d.length && (d += " " + a.groupOp + " ");
                            try {
                                d += this.getStringForGroup(a.groups[b])
                            } catch (c) {
                                alert(c)
                            }
                        }
                        if (void 0 !== a.rules)try {
                            for (b = 0; b < a.rules.length; b++)1 < d.length && (d += " " + a.groupOp + " "), d += this.getStringForRule(a.rules[b])
                        } catch (e) {
                            alert(e)
                        }
                        d += ")";
                        return"()" === d ? "" : d
                    };
                    this.getStringForRule = function (d) {
                        var f = "", b = "", c, e;
                        for (c = 0; c < this.p.ops.length; c++)if (this.p.ops[c].name ===
                            d.op) {
                            f = this.p.ops[c].operator;
                            b = this.p.ops[c].name;
                            break
                        }
                        for (c = 0; c < this.p.columns.length; c++)if (this.p.columns[c].name === d.field) {
                            e = this.p.columns[c];
                            break
                        }
                        c = d.data;
                        if ("bw" === b || "bn" === b)c += "%";
                        if ("ew" === b || "en" === b)c = "%" + c;
                        if ("cn" === b || "nc" === b)c = "%" + c + "%";
                        if ("in" === b || "ni" === b)c = " (" + c + ")";
                        o.errorcheck && r(d.data, e);
                        return-1 !== a.inArray(e.searchtype, ["int", "integer", "float", "number", "currency"]) || "nn" === b || "nu" === b ? d.field + " " + f + " " + c : d.field + " " + f + ' "' + c + '"'
                    };
                    this.resetFilter = function () {
                        this.p.filter =
                            a.extend(!0, {}, 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);
                        a("tr.error", this).show()
                    };
                    this.toUserFriendlyString = function () {
                        return this.getStringForGroup(o.filter)
                    };
                    this.toString = function () {
                        function a(b) {
                            var c = "(", e;
                            if (void 0 !== b.groups)for (e = 0; e < b.groups.length; e++)1 < c.length && (c = "OR" === b.groupOp ? c + " || " : c + " && "), c += a(b.groups[e]);
                            if (void 0 !== b.rules)for (e = 0; e < b.rules.length; e++) {
                                1 < c.length && (c = "OR" === b.groupOp ? c + " || " : c + " && ");
                                var f = b.rules[e];
                                if (d.p.errorcheck) {
                                    for (var h = void 0, i = void 0, h = 0; h < d.p.columns.length; h++)if (d.p.columns[h].name === f.field) {
                                        i = d.p.columns[h];
                                        break
                                    }
                                    i && r(f.data, i)
                                }
                                c += f.op + "(item." + f.field + ",'" + f.data + "')"
                            }
                            c += ")";
                            return"()" === c ? "" : c
                        }

                        var d = this;
                        return a(this.p.filter)
                    };
                    this.reDraw();
                    if (this.p.showQuery)this.onchange();
                    this.filter = !0
                }
            }
        })
    };
    a.extend(a.fn.jqFilter, {toSQLString: function () {
        var a = "";
        this.each(function () {
            a =
                this.toUserFriendlyString()
        });
        return a
    }, filterData: function () {
        var a;
        this.each(function () {
            a = this.p.filter
        });
        return a
    }, getParameter: function (a) {
        return void 0 !== a && this.p.hasOwnProperty(a) ? this.p[a] : this.p
    }, resetFilter: function () {
        return this.each(function () {
            this.resetFilter()
        })
    }, addFilter: function (a) {
        "string" === typeof a && (a = jQuery.jgrid.parse(a));
        this.each(function () {
            this.p.filter = a;
            this.reDraw();
            this.onchange()
        })
    }})
})(jQuery);
(function (b) {
    b.browser.msie && 8 == b.browser.version && (b.expr[":"].hidden = function (b) {
        return 0 === b.offsetWidth || 0 === b.offsetHeight || "none" == b.style.display
    });
    b.jgrid._multiselect = !1;
    if (b.ui && b.ui.multiselect) {
        if (b.ui.multiselect.prototype._setSelected) {
            var m = b.ui.multiselect.prototype._setSelected;
            b.ui.multiselect.prototype._setSelected = function (a, e) {
                var c = m.call(this, a, e);
                if (e && this.selectedList) {
                    var d = this.element;
                    this.selectedList.find("li").each(function () {
                        b(this).data("optionLink") && b(this).data("optionLink").remove().appendTo(d)
                    })
                }
                return c
            }
        }
        b.ui.multiselect.prototype.destroy &&
        (b.ui.multiselect.prototype.destroy = function () {
            this.element.show();
            this.container.remove();
            b.Widget === void 0 ? b.widget.prototype.destroy.apply(this, arguments) : b.Widget.prototype.destroy.apply(this, arguments)
        });
        b.jgrid._multiselect = !0
    }
    b.jgrid.extend({sortableColumns: function (a) {
        return this.each(function () {
            function e() {
                c.p.disableClick = true
            }

            var c = this, d = b.jgrid.jqID(c.p.id), d = {tolerance: "pointer", axis: "x", scrollSensitivity: "1", items: ">th:not(:has(#jqgh_" + d + "_cb,#jqgh_" + d + "_rn,#jqgh_" + d + "_subgrid),:hidden)",
                placeholder: {element: function (a) {
                    return b(document.createElement(a[0].nodeName)).addClass(a[0].className + " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]
                }, update: function (b, a) {
                    a.height(b.currentItem.innerHeight() - parseInt(b.currentItem.css("paddingTop") || 0, 10) - parseInt(b.currentItem.css("paddingBottom") || 0, 10));
                    a.width(b.currentItem.innerWidth() - parseInt(b.currentItem.css("paddingLeft") || 0, 10) - parseInt(b.currentItem.css("paddingRight") || 0, 10))
                }}, update: function (a, g) {
                    var d = b(g.item).parent(), d = b(">th", d), e = {}, i = c.p.id + "_";
                    b.each(c.p.colModel, function (b) {
                        e[this.name] = b
                    });
                    var h = [];
                    d.each(function () {
                        var a = b(">div", this).get(0).id.replace(/^jqgh_/, "").replace(i, "");
                        a in e && h.push(e[a])
                    });
                    b(c).jqGrid("remapColumns", h, true, true);
                    b.isFunction(c.p.sortable.update) && c.p.sortable.update(h);
                    setTimeout(function () {
                        c.p.disableClick = false
                    }, 50)
                }};
            if (c.p.sortable.options)b.extend(d, c.p.sortable.options); else if (b.isFunction(c.p.sortable))c.p.sortable = {update: c.p.sortable};
            if (d.start) {
                var g = d.start;
                d.start = function (b, a) {
                    e();
                    g.call(this, b, a)
                }
            } else d.start = e;
            if (c.p.sortable.exclude)d.items = d.items + (":not(" + c.p.sortable.exclude + ")");
            a.sortable(d).data("sortable").floating = true
        })
    }, columnChooser: function (a) {
        function e(a, c) {
            a && (typeof a == "string" ? b.fn[a] && b.fn[a].apply(c, b.makeArray(arguments).slice(2)) : b.isFunction(a) && a.apply(c, b.makeArray(arguments).slice(2)))
        }

        var c = this;
        if (!b("#colchooser_" + b.jgrid.jqID(c[0].p.id)).length) {
            var d = b('<div id="colchooser_' + c[0].p.id + '" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),
                g = b("select", d), a = b.extend({width: 420, height: 240, classname: null, done: function (b) {
                    b && c.jqGrid("remapColumns", b, true)
                }, msel: "multiselect", dlog: "dialog", dialog_opts: {minWidth: 470}, dlog_opts: function (a) {
                    var c = {};
                    c[a.bSubmit] = function () {
                        a.apply_perm();
                        a.cleanup(false)
                    };
                    c[a.bCancel] = function () {
                        a.cleanup(true)
                    };
                    return b.extend(true, {buttons: c, close: function () {
                        a.cleanup(true)
                    }, modal: a.modal ? a.modal : false, resizable: a.resizable ? a.resizable : true, width: a.width + 20}, a.dialog_opts || {})
                }, apply_perm: function () {
                    b("option",
                        g).each(function () {
                            this.selected ? c.jqGrid("showCol", k[this.value].name) : c.jqGrid("hideCol", k[this.value].name)
                        });
                    var d = [];
                    b("option:selected", g).each(function () {
                        d.push(parseInt(this.value, 10))
                    });
                    b.each(d, function () {
                        delete f[k[parseInt(this, 10)].name]
                    });
                    b.each(f, function () {
                        var b = parseInt(this, 10);
                        var a = d, c = b;
                        if (c >= 0) {
                            var g = a.slice(), e = g.splice(c, Math.max(a.length - c, c));
                            if (c > a.length)c = a.length;
                            g[c] = b;
                            d = g.concat(e)
                        } else d = void 0
                    });
                    a.done && a.done.call(c, d)
                }, cleanup: function (b) {
                    e(a.dlog, d, "destroy");
                    e(a.msel, g, "destroy");
                    d.remove();
                    b && a.done && a.done.call(c)
                }, msel_opts: {}}, b.jgrid.col, a || {});
            if (b.ui && b.ui.multiselect && a.msel == "multiselect") {
                if (!b.jgrid._multiselect) {
                    alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");
                    return
                }
                a.msel_opts = b.extend(b.ui.multiselect.defaults, a.msel_opts)
            }
            a.caption && d.attr("title", a.caption);
            if (a.classname) {
                d.addClass(a.classname);
                g.addClass(a.classname)
            }
            if (a.width) {
                b(">div", d).css({width: a.width, margin: "0 auto"});
                g.css("width",
                    a.width)
            }
            if (a.height) {
                b(">div", d).css("height", a.height);
                g.css("height", a.height - 10)
            }
            var k = c.jqGrid("getGridParam", "colModel"), p = c.jqGrid("getGridParam", "colNames"), f = {}, j = [];
            g.empty();
            b.each(k, function (b) {
                f[this.name] = b;
                this.hidedlg ? this.hidden || j.push(b) : g.append("<option value='" + b + "' " + (this.hidden ? "" : "selected='selected'") + ">" + jQuery.jgrid.stripHtml(p[b]) + "</option>")
            });
            var i = b.isFunction(a.dlog_opts) ? a.dlog_opts.call(c, a) : a.dlog_opts;
            e(a.dlog, d, i);
            i = b.isFunction(a.msel_opts) ? a.msel_opts.call(c,
                a) : a.msel_opts;
            e(a.msel, g, i)
        }
    }, sortableRows: function (a) {
        return this.each(function () {
            var e = this;
            if (e.grid && !e.p.treeGrid && b.fn.sortable) {
                a = b.extend({cursor: "move", axis: "y", items: ".jqgrow"}, a || {});
                if (a.start && b.isFunction(a.start)) {
                    a._start_ = a.start;
                    delete a.start
                } else a._start_ = false;
                if (a.update && b.isFunction(a.update)) {
                    a._update_ = a.update;
                    delete a.update
                } else a._update_ = false;
                a.start = function (c, d) {
                    b(d.item).css("border-width", "0px");
                    b("td", d.item).each(function (b) {
                        this.style.width = e.grid.cols[b].style.width
                    });
                    if (e.p.subGrid) {
                        var g = b(d.item).attr("id");
                        try {
                            b(e).jqGrid("collapseSubGridRow", g)
                        } catch (k) {
                        }
                    }
                    a._start_ && a._start_.apply(this, [c, d])
                };
                a.update = function (c, d) {
                    b(d.item).css("border-width", "");
                    e.p.rownumbers === true && b("td.jqgrid-rownum", e.rows).each(function (a) {
                        b(this).html(a + 1 + (parseInt(e.p.page, 10) - 1) * parseInt(e.p.rowNum, 10))
                    });
                    a._update_ && a._update_.apply(this, [c, d])
                };
                b("tbody:first", e).sortable(a);
                b("tbody:first", e).disableSelection()
            }
        })
    }, gridDnD: function (a) {
        return this.each(function () {
            function e() {
                var a =
                    b.data(c, "dnd");
                b("tr.jqgrow:not(.ui-draggable)", c).draggable(b.isFunction(a.drag) ? a.drag.call(b(c), a) : a.drag)
            }

            var c = this;
            if (c.grid && !c.p.treeGrid && b.fn.draggable && b.fn.droppable) {
                b("#jqgrid_dnd").html() === null && b("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");
                if (typeof a == "string" && a == "updateDnD" && c.p.jqgdnd === true)e(); else {
                    a = b.extend({drag: function (a) {
                        return b.extend({start: function (d, e) {
                            if (c.p.subGrid) {
                                var f = b(e.helper).attr("id");
                                try {
                                    b(c).jqGrid("collapseSubGridRow", f)
                                } catch (j) {
                                }
                            }
                            for (f =
                                     0; f < b.data(c, "dnd").connectWith.length; f++)b(b.data(c, "dnd").connectWith[f]).jqGrid("getGridParam", "reccount") == "0" && b(b.data(c, "dnd").connectWith[f]).jqGrid("addRowData", "jqg_empty_row", {});
                            e.helper.addClass("ui-state-highlight");
                            b("td", e.helper).each(function (b) {
                                this.style.width = c.grid.headers[b].width + "px"
                            });
                            a.onstart && b.isFunction(a.onstart) && a.onstart.call(b(c), d, e)
                        }, stop: function (d, e) {
                            if (e.helper.dropped && !a.dragcopy) {
                                var f = b(e.helper).attr("id");
                                f === void 0 && (f = b(this).attr("id"));
                                b(c).jqGrid("delRowData",
                                    f)
                            }
                            for (f = 0; f < b.data(c, "dnd").connectWith.length; f++)b(b.data(c, "dnd").connectWith[f]).jqGrid("delRowData", "jqg_empty_row");
                            a.onstop && b.isFunction(a.onstop) && a.onstop.call(b(c), d, e)
                        }}, a.drag_opts || {})
                    }, drop: function (a) {
                        return b.extend({accept: function (a) {
                            if (!b(a).hasClass("jqgrow"))return a;
                            a = b(a).closest("table.ui-jqgrid-btable");
                            if (a.length > 0 && b.data(a[0], "dnd") !== void 0) {
                                a = b.data(a[0], "dnd").connectWith;
                                return b.inArray("#" + b.jgrid.jqID(this.id), a) != -1 ? true : false
                            }
                            return false
                        }, drop: function (d, e) {
                            if (b(e.draggable).hasClass("jqgrow")) {
                                var f =
                                    b(e.draggable).attr("id"), f = e.draggable.parent().parent().jqGrid("getRowData", f);
                                if (!a.dropbyname) {
                                    var j = 0, i = {}, h, n = b("#" + b.jgrid.jqID(this.id)).jqGrid("getGridParam", "colModel");
                                    try {
                                        for (var o in f) {
                                            h = n[j].name;
                                            h == "cb" || (h == "rn" || h == "subgrid") || f.hasOwnProperty(o) && n[j] && (i[h] = f[o]);
                                            j++
                                        }
                                        f = i
                                    } catch (m) {
                                    }
                                }
                                e.helper.dropped = true;
                                if (a.beforedrop && b.isFunction(a.beforedrop)) {
                                    h = a.beforedrop.call(this, d, e, f, b("#" + b.jgrid.jqID(c.p.id)), b(this));
                                    typeof h != "undefined" && (h !== null && typeof h == "object") && (f = h)
                                }
                                if (e.helper.dropped) {
                                    var l;
                                    if (a.autoid)if (b.isFunction(a.autoid))l = a.autoid.call(this, f); else {
                                        l = Math.ceil(Math.random() * 1E3);
                                        l = a.autoidprefix + l
                                    }
                                    b("#" + b.jgrid.jqID(this.id)).jqGrid("addRowData", l, f, a.droppos)
                                }
                                a.ondrop && b.isFunction(a.ondrop) && a.ondrop.call(this, d, e, f)
                            }
                        }}, a.drop_opts || {})
                    }, onstart: null, onstop: null, beforedrop: null, ondrop: null, drop_opts: {activeClass: "ui-state-active", hoverClass: "ui-state-hover"}, drag_opts: {revert: "invalid", helper: "clone", cursor: "move", appendTo: "#jqgrid_dnd", zIndex: 5E3}, dragcopy: false, dropbyname: false,
                        droppos: "first", autoid: true, autoidprefix: "dnd_"}, a || {});
                    if (a.connectWith) {
                        a.connectWith = a.connectWith.split(",");
                        a.connectWith = b.map(a.connectWith, function (a) {
                            return b.trim(a)
                        });
                        b.data(c, "dnd", a);
                        c.p.reccount != "0" && !c.p.jqgdnd && e();
                        c.p.jqgdnd = true;
                        for (var d = 0; d < a.connectWith.length; d++)b(a.connectWith[d]).droppable(b.isFunction(a.drop) ? a.drop.call(b(c), a) : a.drop)
                    }
                }
            }
        })
    }, gridResize: function (a) {
        return this.each(function () {
            var e = this, c = b.jgrid.jqID(e.p.id);
            if (e.grid && b.fn.resizable) {
                a = b.extend({}, a ||
                {});
                if (a.alsoResize) {
                    a._alsoResize_ = a.alsoResize;
                    delete a.alsoResize
                } else a._alsoResize_ = false;
                if (a.stop && b.isFunction(a.stop)) {
                    a._stop_ = a.stop;
                    delete a.stop
                } else a._stop_ = false;
                a.stop = function (d, g) {
                    b(e).jqGrid("setGridParam", {height: b("#gview_" + c + " .ui-jqgrid-bdiv").height()});
                    b(e).jqGrid("setGridWidth", g.size.width, a.shrinkToFit);
                    a._stop_ && a._stop_.call(e, d, g)
                };
                a.alsoResize = a._alsoResize_ ? eval("(" + ("{'#gview_" + c + " .ui-jqgrid-bdiv':true,'" + a._alsoResize_ + "':true}") + ")") : b(".ui-jqgrid-bdiv", "#gview_" +
                    c);
                delete a._alsoResize_;
                b("#gbox_" + c).resizable(a)
            }
        })
    }})
})(jQuery);