dh_ackergaul
vor 3 Tagen 5bbf43c1b146439ab882815c12ed6292f1d7b4df
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
var isIE = /MSIE (\d+\.\d+);/.test(navigator.userAgent);
 
/**
 * @type {DhMcControl} DhMcControlObj
 */
var DhMcControlObj;
var AppObj;
var LocalEventLink;
var DhOwi;
var DevStatus = "";
var PrintpropertyValue = "";
var TableIdPoTablePlacer = 444;
 
 
apptree = dh_app_tree();
 
document.addEventListener("onreadystatechange", function () {
    if (document.readyState === "complete") {
        window.addEventListener("load", function () {
            topWindow.TextPool.build(document.body);
        });
    }
});
 
String.prototype.hexEncode = function () {
    var hex, i;
 
    var result = "";
    for (i = 0; i < this.length; i++) {
        hex = this.charCodeAt(i).toString(16);
        result += ("000" + hex).slice(-4);
    }
 
    return result
};
String.prototype.hexDecode = function () {
    var j;
    var hexes = this.match(/.{1,4}/g) || [];
    var back  = "";
    for (j = 0; j < hexes.length; j++) {
        back += String.fromCharCode(parseInt(hexes[j], 16));
    }
 
    return back;
};
 
$(document).ready(function () {
    (function checkRecursiv(node) {
        for (var i = 0; i < node.childNodes.length; i++) {
            if (node.childNodes[i].name) {
                var elements = document.getElementsByName(node.childNodes[i].name);
                if (!window[node.childNodes[i].name]) {
                    if (elements.length === 1) {
                        window[node.childNodes[i].name] = elements[0];
                    } else {
                        window[node.childNodes[i].name] = elements;
                    }
                }
                // if (window[node.childNodes[i].name] &&
                //     Array.isArray(window[node.childNodes[i].name]) &&
                //     window[node.childNodes[i].name].indexOf(node.childNodes[i]) === -1) {
                //     window[node.childNodes[i].name].push(node.childNodes[i]);
                // }
            }
            checkRecursiv(node.childNodes[i]);
        }
    })(document)
});
 
function getDhMcControl(parent) {
    try {
        if (!parent.DhMcControl && !parent.DhMcControlObj) {
            if (parent.parent.DhMcControl || parent.parent.DhMcControlObj) {
                return parent.parent.DhMcControl || parent.parent.DhMcControlObj;
            } else {
                return getDhMcControl(parent.parent);
            }
        } else {
            return parent.DhMcControl || parent.DhMcControlObj;
        }
    } catch (e) {
        return {};
    }
}
 
 
var DhMcControl = DhMcControlObj = getDhMcControl(window);
 
function getGlobalSettings(parent) {
    try {
        if (!parent.GlobalSettings) {
            return getGlobalSettings(parent.parent);
        } else {
            return parent.GlobalSettings;
        }
    } catch (e) {
        console.error("Settings Not Found");
        return {};
    }
}
 
window.Settings  = getGlobalSettings(window);
window.topWindow = topWindow(window);
 
if (Object.keys(window.Settings).length === 0) {
    (function getQuery() {
        var params       = window.location.search.substr(1, window.location.search.length);
        var keyValueList = params.split("&");
        for (var i = 0; i < keyValueList.length; i++) {
            var keyValue = keyValueList[i].split("=");
            if (keyValue.length === 2) {
                window.Settings[keyValue[0]] = keyValue[1];
            }
        }
    })();
}
 
var DhmcHelper = {
    hash: function (str, decode) {
        if (!str) return "";
        var hex = decode ? str : str.hexEncode();
        var ret = "";
        for (var c = 0; c < hex.length; c += 2) {
            var one = hex[c];
            var two = hex[c + 1];
            ret += two;
            ret += one;
        }
        return decode ? ret.hexDecode() : ret;
    }
};
 
function FileExists(filePath) {
    try {
        var response = $.ajax({
            url  : filePath,
            async: false
        });
 
        // 200 => 2, 404 => 4, 500 => 5 etc.
        var httpResponseCodeRange = response.status.toString().charAt(0);
 
        if (httpResponseCodeRange === "4" || httpResponseCodeRange === "5") {
            return false;
        }
        else {
            return true;
        }
    }
    catch (e) {
        return false;
    }
};
 
 
function checkSameOrigin(win) {
    // liefert true in Safari, wenn same-origin; undefined sonst
    try {
        return !!win.parent.document;
    } catch (e) {
        return false;
    }
}
 
function initAppAndControl() {
    if (typeof topWindow !== "undefined" && topWindow.ObersteWebInstanz) {
        DhOwi = topWindow;
    }
    else {
        // JM [2025|06|10] Faster Way of eval and apptree
        AppObj = DhOwi = window;
        if (document.title === "Application") {
            AppObj = window;
        }
 
        while (!DhOwi.ObersteWebInstanz && DhOwi.parent && DhOwi.parent !== DhOwi && checkSameOrigin(DhOwi.parent)) {
            DhOwi = DhOwi.parent;
        }
    }
    AppObj = DhOwi.app;
    if (AppObj) {
        DhMcControlObj = AppObj.DhMcControl;
        LocalEventLink = new AppObj.LocalEventEmitterLink(AppObj.GlobalEventEmitter, window);
    }
}
 
initAppAndControl();
 
var originEncodeUri = encodeURI;
var originEncodeUriComponent = encodeURIComponent;
 
function percentialize(x) {
    return '%' + x.charCodeAt(0).toString(16).toUpperCase();
}
 
encodeURI = (function () {
    return function encodeURI(s, percentEncode) {
        var encodeStr = originEncodeUri.apply(this, arguments).replace(/\[\]/g, percentialize);
        if (percentEncode) {
            return encodeStr.replace(/[%]/g, percentialize);
        }
        return encodeStr;
    }
})();
 
encodeURIComponent = (function () {
    return function encodeURIComponent(s, percentEncode) {
        var encodeStr = originEncodeUriComponent.apply(this, arguments).replace(/[!'()*~.]/g, percentialize);
        if (percentEncode) {
            return encodeStr.replace(/[%]/g, percentialize);
        }
        return encodeStr;
    }
})();
 
 
//-----------------------------------------------------------------------------
if (!Object.keys) {
    Object.keys = (function () {
        'use strict';
        var hasOwnProperty = Object.prototype.hasOwnProperty,
            hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),
            dontEnums = [
                'toString',
                'toLocaleString',
                'valueOf',
                'hasOwnProperty',
                'isPrototypeOf',
                'propertyIsEnumerable',
                'constructor'
            ],
            dontEnumsLength = dontEnums.length;
 
        return function (obj) {
            if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
                throw new TypeError('Object.keys called on non-object');
            }
 
            var result = [], prop, i;
 
            for (prop in obj) {
                if (hasOwnProperty.call(obj, prop)) {
                    result.push(prop);
                }
            }
 
            if (hasDontEnumBug) {
                for (i = 0; i < dontEnumsLength; i++) {
                    if (hasOwnProperty.call(obj, dontEnums[i])) {
                        result.push(dontEnums[i]);
                    }
                }
            }
            return result;
        };
    }());
}
 
//GS: Polyfil "getElementsByClassName"
if (!document.getElementsByClassName) {
    document.getElementsByClassName = function (search) {
        var d = document, elements, pattern, i, results = [];
        if (d.querySelectorAll) { // IE8
            return d.querySelectorAll("." + search);
        }
        if (d.evaluate) { // IE6, IE7
            pattern = ".//*[contains(concat(' ', @class, ' '), ' " + search + " ')]";
            elements = d.evaluate(pattern, d, null, 0, null);
            while ((i = elements.iterateNext())) {
                results.push(i);
            }
        } else {
            elements = d.getElementsByTagName("*");
            pattern = new RegExp("(^|\\s)" + search + "(\\s|$)");
            for (i = 0; i < elements.length; i++) {
                if (pattern.test(elements[i].className)) {
                    results.push(elements[i]);
                }
            }
        }
        return results;
    }
}
 
// JM [2019|November|20]
// Seiten ohne <!DOCTYPE html> als DocumentMode 5 laufen und Elemente mit <!DOCTYPE html> als DocumentMode 7 laufen, gibt es unterschiede bei den CSS Regeln.
// Um auf diese CSS Unterschiede einzugehen,
if (document.documentMode && document.documentElement) {
    addClass(document.documentElement, "doctype" + document.documentMode);
}
//-----------------------------------------------------------------------------
 
 
function dh_forEach(obj, func) {
    var arr = Object.keys(obj);
    for (var i = 0; i < arr.length; i++) {
        var key = arr[i];
        var value = obj[key];
        try {
            func(key, value);
        }
        catch (e) {
            debugger;
        }
    }
};
 
//MW2017
function dh_UseFurnportTransfer() {
    return (dh_ApplicationBehaviourGetValue("Furnport_SendViaFurnport") === "1");
    //return (dh_developerStatusGet() == 1);
}
 
//RH2015 Lesen und Setzen von Features aus dem CDhMc::GetFeatureManagementTempBuffer()
function dh_TempSetFeatureData(jsonData) {
    if (jsonData === undefined || jsonData === null) return;
    var x = JSON.stringify(jsonData);
    DhMcControlObj.DT_SetValue("JSON_TEMP", "", x, "", "", "", "", "", "", "", "", "", "", "");
}
 
//Es wird ein JSON Objekt mit den Werten zurückgeliefert.
function dh_TempGetFeatureData(regExStringFilter) {
    var result = DhMcControlObj.DT_GetValue("JSON_TEMP", "", regExStringFilter, "", "", "", "", "", "", "", "", "", "");
    return result;
}
 
//RH2015 Lesen und Setzen von Features aus dem CDhMc::GetFeatureManagementTempBuffer()
function dh_TempSetJSONData(key, jsonData) {
    if (jsonData === undefined || jsonData === null) return;
    var x = "";
 
    if (typeof jsonData === "object") {
        x = JSON.stringify(jsonData);
    }
    else {
        x = jsonData;
    }
    DhMcControlObj.DT_SetValue("JSON_DATA", key, x, "", "", "", "", "", "", "", "", "", "", "");
}
 
//Es wird ein JSON Objekt mit den Werten zurückgeliefert.
function dh_TempGetJSONData(key, default_) {
    var result = DhMcControlObj.DT_GetValue("JSON_DATA", key, default_, "", "", "", "", "", "", "", "", "", "");
    return result;
}
 
function dh_developerStatusGet() {
    if (DevStatus == "") {
        DevStatus = dh_reginfo_get('HKLM', '', 'DeveloperStat');//wd20130722 DeveloperStatus nach DeveloperStat --> GS 110619 Scheinbar wird aber trotzdem der REGKey "developerStatus" abgefragt, zumindest zeigt nur verändert von "developerStatus" eine Veränderung
    }
    return DevStatus;
}
 
function dh_dimdigits_get() {
    var digits = DhMcControlObj.StringValueDest(-115, 2).value;
    var rc = parseFloat(digits);
    return rc;
}
 
function dh_dimscale_get() {
    var sds = DhMcControlObj.StringValueDest(-110, 0).value;
    var rc = parseFloat(sds);
    return rc;
}
 
function dh_dimscale_get_dimension_unit() {
    var dsc = dh_dimscale_get();
    if (dsc == 1) {
        return "mm";
    }
    else if (dsc == 0.1) {
        return "cm"
    }
 
    return "m";
}
 
function dh_company_get() {
    return AppObj.COMPANY_SELECT.value;
}
 
function dh_language_get() {
    var language = "de";
    language = AppObj.KataGetLG();
    //    alert(language);
    if (language.length == 0) {
        language = "de"
    }
    return language;
 
}
 
function dh_artikel_info(artikel, zusatztext1, zusatztext2) {
    apptree = dh_app_tree();
    //DhMcControlObj.StringValueDest(32,1000000).value = dh_programmname_get_current();//hersteller
    DhMcControlObj.StringValueDest(32, 1000000).value = dh_programmname_get_current();
    DhMcControlObj.StringValueDest(32, 1000001).value = artikel;
    DhMcControlObj.StringValueDest(32, 1000002).value = '';
 
 
    //alert(artikel);
    if (typeof zusatztext1 == "string") {
        if (zusatztext1.length > 0) {
            DhMcControlObj.StringValueDest(32, 1000002).value = zusatztext1;
        }
        else {
            DhMcControlObj.StringValueDest(32, 1000002).value = '';
        }
    }
    else {
        DhMcControlObj.StringValueDest(32, 1000002).value = '';
    }
 
    if (typeof zusatztext2 == "string") {
        if (zusatztext2.length > 0) {
            DhMcControlObj.StringValueDest(32, 1000003).value = zusatztext2;
        }
        else {
            DhMcControlObj.StringValueDest(32, 1000003).value = '';
        }
    }
    else {
        DhMcControlObj.StringValueDest(32, 1000003).value = '';
    }
    var overlibtext = "";
    overlibtext = DhMcControlObj.StringValueDest(-1, 0).value;
    //overlib(overlibtext,FULLHTML); //transparent!!!!!
    overlib(overlibtext);
}
 
/**
 * @brief Liefert die preferierte Spracheinstellung nach folgender Prioritaet:
 * 1. ApplicationBehaviour_DEF::USERINTERFACE_PREFERRED_LANGUAGE
 * 2. Interface Spracheinstellung aus furnplan Einstellungen
 * 3. Aktuelle Spracheinstellung des Herstellers
 *
 * @author JM [2021|January|18]
 * @return {string}
 */
function dh_get_preferred_interface_language() {
    return DhMcControlObj.StringValueDest(-5, 0).value;
}
 
function dh_text_global(TextId, GlobalTableName, mode, isArticle) {
    function dtg_instance(TextId, GlobalTableName, mode, isArticle) {
        this.TextId          = TextId;
        this.GlobalTableName = GlobalTableName;
        this.Modus           = mode && !isNaN(+mode) ? +mode : null;
        this.Manufactuer     = mode && isNaN(+mode) && mode.length > 1 ? mode : "";
        this.uuid            = guid();
 
        if (this.Modus === 1) {
            var language = dh_language_get();
            this.GlobalTableName += language;
        }
        this.options = {
            "TID"           : "" + this.TextId || "",
            "GTN"           : this.GlobalTableName || "",
            "Manu"          : this.Manufactuer || "",
            "hasToUTF"      : this.Modus !== null,
            "noBlockRequest": !window.EnableBlockRequest, //Temporary fix for text loading.
            "isArticle": isArticle
        };
        this.text    = topWindow.TextPool.getText(this.options);
 
        if (this.text) {
            return this.text;
        }
 
        topWindow.TextPool.loadText(this.uuid, this.options, document);
        return this.uuid;
    }
 
    return dtg_instance.apply(dtg_instance, arguments);
}
 
function guid() {
    function s4() {
        return Math.floor((1 + Math.random()) * 0x10000)
            .toString(16)
            .substring(1);
    }
 
    return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
}
 
 
function dh_text_common(TextId, GlobalTableName, Manufacturer) {
    return dh_text_global(TextId, GlobalTableName, Manufacturer);
}
 
function dh_text_info_write(TextId, GlobalTableName) {
    document.write(dh_text_common(TextId, GlobalTableName));
}
 
function dh_text_info(TextId, GlobalTableName, Manufacturer) {
    return dh_text_common(TextId, GlobalTableName, Manufacturer);
}
 
//FS SpeedUp Requests (4 -> 1)
function dh_artikeltext_get(ArtikelNummer_, Programm_, Manufacturer_) {
    return dh_text_global([ArtikelNummer_, Programm_, Manufacturer_].join("_"), "", null,true)
 
    // var dataJson = {
    //     "artNo": ArtikelNummer_,
    //     "prog" : "",
    //     "manu" : ""
    // };
    //
    // if (typeof Programm_ == "string") {
    //     dataJson.prog = Programm_;
    // }
    // else {
    //     dataJson.prog = dh_programmname_get_current();
    // }
    //
    // if (typeof Manufacturer_ == "string") {
    //     dataJson.manu = Manufacturer_;
    // }
    // var text = DoSyncFPSAction("GetArticleText", [dataJson]);
    // if (text && Array.isArray(text) && text.length === 1) {
    //     text = text[0];
    // }
    // text = text.replace(/~/g, "</br>");
    // return text;
}
 
 
 
function mm2cm(value, precision) {
    if (precision === undefined) {
        precision = 1;
    }
 
    value = checkFloat(value);
    var val = parseFloat(value);
    val = val * 0.1;
    return val.toFixed(precision);
}
 
function decimalplace(value, count) //SS 2008-08-22
{
    value = checkFloat(value);
    var val = parseFloat(value);
    return val.toFixed(count);
}
 
function cm2mm(value, precision) {
    if (precision === undefined) {
        precision = 0;
    }
 
    value = checkFloat(value);
    var val = parseFloat(value);
    val = val * 10.0;
    return val.toFixed(precision);
}
 
 
function checkFloat(value) {
    if (typeof value == "number") {
        value = value.toString();
    }
    var newvalue = value.replace(/,/, ".");
    return newvalue;
}
 
function radioWert(rObj) {
    //wd20070601 Ergaenzung wegen furncat Problematik bei leeren values in Radio's
    for (var i = 0; i < rObj.length; i++) {
        if (rObj[i].checked) {
            var rc = rObj[i].value;
            if (rc == "#") {
                rc = "";
            }
            return rc;
        }
    }
    return false;
}
 
//Oberste Web Instanz suchen (index.html)
function dh_owi() {
    var n = 0;
    var value = "window.";
    var found = false;  // mhayk 201010280
    while (n < 100 && !found) // mhayk 201010280
    {
        v2 = value + "ObersteWebInstanz"
        if (eval(v2) == true) {
            found = true; // mhayk 201010280
        }
        else {
            n++;
        }
        if (!found) {
            value += "parent.";
        }
    }
    return value;      // mhayk 201010280
}
 
 
// mhayk 20101028
function dh_app_tree() {
    if (topWindow.ObersteWebInstanz) {
    return "topWindow.";
}
return "";
 
    
}
 
 
 
function dhround(value) {
    nval = Math.round(value * 100) / 100;
    neutext = new String(nval);
 
    x = neutext.length;
    if (neutext.charAt(x - 2) == ".") {
        neutext = neutext + "0"
    }
 
    return neutext;
}
 
var BlockRequest = (function () {
    var blockCommand = {};
    return function (command, parameters, uuid) {
        return new Promise(function (resolve, reject) {
            if (!blockCommand[command]) {
                blockCommand[command] = {};
            }
            if (!blockCommand[command].blocks) {
                blockCommand[command].blocks = [];
            }
            if (blockCommand[command].timeout) {
                clearTimeout(blockCommand[command].timeout);
                blockCommand[command].timeout = null;
            }
            blockCommand[command].blocks.push({parameters: parameters, uuid: uuid});
 
            blockCommand[command].timeout = setTimeout(function () {
                var data              = blockCommand[command];
                blockCommand[command] = undefined;
                DoAsyncFPSAction("BlockRequest", [{command: command, params: data.blocks}], uuid)
                    .then(function (result) {
                        resolve(result);
                    });
            }, 50);
        });
    }
})();
 
function DoAsyncFPSAction(command, parameters, uuid) {
    return DoFPSAction(command, parameters, uuid)
        .then(function (result) {
            return {
                data: result,
                uuid: uuid
            };
        })
        .catch(function (error) {
            console.log(error);
 
            return {
                data: {},
                uuid: "error-no-uuid"
            };
        });
}
 
function DoSyncFPSAction(command, parameters, asBeacon) {
    const bodyParams = {
        "C"      : command,
        "P"      : Array.isArray(parameters) ? {ADATA: parameters} : parameters,
        // "G": uuid,
        sessionId: Settings.sessionId
    };
    if ( asBeacon && typeof asBeacon === "boolean" && asBeacon === true ) {
        var blob = new Blob([JSON.stringify(bodyParams)], { type: "application/json" });
        navigator.sendBeacon(Settings.nodeUrl + "/dhmc-control", blob);
        return {};
    }
    var result = $
        .ajax({
            contentType: "application/json",
            type    : "POST",
            url     : Settings.nodeUrl + "/dhmc-control",
            async   : false,
            timeout : 3000,
            data    : JSON.stringify(bodyParams)
        })
        .responseText;
 
    try {
        let parsedJSON = JSON.parse(result);
        return parsedJSON.P && parsedJSON.P.ADATA ? parsedJSON.P.ADATA[0] : parsedJSON.P;
    }
    catch (e) {
        return {};
    }
}
 
function DoFPSAction(command, parameters, uuid) {
 
    if (!uuid) {
        uuid = "1234";
    }
 
    /*
     var o = {
     "C": a,
     "G": "66456456-464564-5645-64-56-456456"
     };
     var x = JSON.stringify(o);
 
     */
 
    //DhMcControlObj.DoActionString(-66, 0, x);
    //console.log(x);
 
    /*
     var params = dh_TempGetJSONData("FPS_RESPONSE", "");
     params = JSON.parse(params);
     return params.P[0];
     */
    if (arguments.length > 1) {
        console.log(`DoAsyncFPSAction(${arguments[0]}, ` +
            `${arguments[1][0]}, ` +
            (arguments[1].length > 1 && arguments[1][1].params ?
                `${Array.prototype.join.call(arguments[1][1].params, ", ")}, ` +
                `[manu: ${arguments[1][1].manu}], ` +
                `[kataManu: ${arguments[1][1].kataManu}])` :
                `${Array.prototype.join.call(arguments[1], ", ")}`)
        );
    }
    else {
        console.log(`DoAsyncFPSAction(${Array.prototype.join.call(arguments, ", ")})`);
    }
 
    var response = new Promise(function (resolve, reject) {
 
        DhMcControl.DhmcFurnviewCommunicationMessageDispatcher.on(uuid, function (parameters) {
            resolve(parameters);
        }, false);
    });
 
    DhMcControl.sendToFurnview("furnplan.communication", [command, parameters, uuid]);
 
    return response;
}
 
window.dh_FPSCommand = DoSyncFPSAction;
 
 
 
window.dh_todo = function (v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) {
    if (arguments[0] === "5")//config Dialog aus dem (neue html Struktur) html Verteichnis des entprechenden Manufacturers aufrufen
    {
        ManufacturerToControl();
        if (typeof arguments[1] === "string") {
            if (arguments[1].length > 0) {
                if (typeof arguments[2] === "string" && arguments[2] === '1') // aus dem Verzeichnis "manufacturer\_global\_global\html\h" lesen
                {
                    var PathManufac = "";
                    if (typeof DhMcControlObj === 'object') {
                        PathManufac = dh_getpath_manufacturer();//wd20090319 ... auf absoluten Pfad umgestellt
                    }
                    else if (typeof DhMcControlObj === 'object') {
                        PathManufac = dh_getpath_manufacturer();//wd20090319 ... auf absoluten Pfad umgestellt
                    }
                    var path = PathManufac + "/_global/_global/html/h/" + arguments[1];
                    DhOwi.OpenConfigMenu(path);
                }
                else {
                    DhOwi.OpenConfigMenuManufac(arguments[1])
                }
            }
        }
    }
    else {
        apptree = dh_app_tree();
        var UserinterfaceManufacturer = "";
        var ManufacKata = "";
        UserinterfaceManufacturer = dh_manufacturer_get();
        ManufacKata = dh_company_get();
 
        var command = arguments[0];
 
        var params = [];
        for (var a = 1; a < arguments.length; a++) {
            if (arguments[a] === undefined || arguments[a] === null) {
                params.push("");
            }
            else {
                params.push("" + arguments[a]);
            }
        }
        var data = "";
        if (arguments[0] == "3") {
            data = DoSyncFPSAction('DHTodo', ["" + command, {
                params: params,
                manu: UserinterfaceManufacturer,
                kataManu: ManufacKata
            }]);
        } else {
            data = DoAsyncFPSAction('DHTodo', ["" + command, {
                params: params,
                manu: UserinterfaceManufacturer,
                kataManu: ManufacKata
            }]);
        }
        if (data && data.retVal !== undefined) {
            return data.retVal;
        }
    }
}
 
//JL EDIT
function _TrafficLightColor() {
    if (typeof DhMcControlObj !== null) {
        if ((typeof DhMcControlObj == 'object') && (divTrafficLight != null)) {
            var divTrafficLight = document.getElementById("trafficLight1")
            if (DhMcControlObj.SysLong(101).value) {
                divTrafficLight.src = imgpath + "trafficlightr.gif";
            }
            else if (DhMcControlObj.SysLong(102).value) {
                divTrafficLight.src = imgpath + "trafficlightr.gif";
            }
            else if (DhMcControlObj.SysLong(100).value) {
                divTrafficLight.src = imgpath + "trafficlighty.gif";
            }
            else {
                divTrafficLight.src = imgpath + "trafficlightg.gif";
            }
        }
    }
}
 
function dh_manufacturer_get() {
    return AppObj.KataGetMF();
}
 
function dh_manufacturer_to_app(name) {
    AppObj.manufacturer = name;
    ManufacturerToControl();
}
 
 
function dh_programmname_to_app(name) {
    name = name.toUpperCase();
 
    AppObj.programmname = name;
    var manufac = dh_manufacturer_get();
    DhMcControlObj.StringValueDest(32, 4321).value = manufac;
    DhMcControlObj.StringValueDest(32, 4322).value = name;
    DhMcControlObj.StringValueDest(32, 1000000).value = name;
    DhMcControlObj.DoActionSimpleCL(2500);
}
 
function dh_programmname_get_current() {
    return AppObj.programmname;
}
 
function dh_reginfo_get(HKEY, Path, Key, NoCache) {
 
    var CacheKey = HKEY + " " + Path + " " + Key;
    var MWRegCache = DhOwi.DHRegCache;
    var CacheNutzen = true;
    if (NoCache) {
        CacheNutzen = false;
    }
    if (Key == "BuyingGroups") {
        CacheNutzen = false;
    }
 
    if (CacheNutzen) {
        if (MWRegCache[CacheKey] != null && typeof (MWRegCache[CacheKey]) != 'undefined') {
            return (MWRegCache[CacheKey]);
        }
    }
 
    DhMcControlObj.StringValueDest(32, 10000).value = HKEY;
    DhMcControlObj.StringValueDest(32, 10001).value = Path;
    DhMcControlObj.StringValueDest(32, 10002).value = Key;
 
    var rc = "";
    rc = DhMcControlObj.StringValueDest(-10, 0).value;
 
    MWRegCache[CacheKey] = rc;
 
    return rc;
}
 
 
function dh_reginfo_set(HKEY, Path, Key, Wert) {
 
    var CacheKey = HKEY + " " + Path + " " + Key;
    var MWRegCache = DhOwi.DHRegCache;
    MWRegCache[CacheKey] = Wert;
 
    DhMcControlObj.StringValueDest(32, 10000).value = HKEY;
    DhMcControlObj.StringValueDest(32, 10001).value = Path;
    DhMcControlObj.StringValueDest(32, 10002).value = Key;
    DhMcControlObj.StringValueDest(32, 10003).value = Wert;
 
 
    var rc = "";
 
    rc = DhMcControlObj.StringValueDest(-11, 0).value;
 
 
    return rc;
 
}
 
/**
 * @author JM [2023|November|20] Code vom JS ins C++ verlagert.
 * Mit dieser Funktion kann der Front-Sichtbarkeits-Status gesetzt werden.
 * @param {number} modus 0: Front ausblenden | 1: Front einblenden | 2: Front umschalten & speichern | 3: Front auf gespeicherten Wert zuruecksetzen.
 * Modus 0 und 1 Speichern also nicht!
 */
function dh_front_display(modus) {
    DoAsyncFPSAction("SetFrontDisplay", { mode: modus });
 
    DoAsyncFPSAction("ChangeFrontState", [modus]);
}
 
function dh_animation(modus)//Animation Ein- und Ausschalten 0=auf 1=zu
{
    if (modus == 2) {
        DhMcControlObj.DoActionSimple(100027);
        return;
    }
 
    if (modus == 0)
        DhMcControlObj.DoActionSimple(100002);
    else
        DhMcControlObj.DoActionSimple(100003);
}
 
function ManufacturerToControl() {
    DhMcControlObj.StringValue(35005).value = dh_manufacturer_get();
    DhMcControlObj.StringValue(35004).value = dh_company_get();
 
    DhMcControlObj.DoActionSimpleCL(2510);//wd20060518
}
 
function DhLanguageToControl() {
    var language = "de";
    language = dh_language_get()
    if (language.length == 0) {
        language = "de"
    }
 
    DhMcControlObj.StringValue(35001).value = language;
    DhMcControlObj.DoActionSimpleCL(17970);
 
    AppObj.AppLanguageChange(language);
}
 
// DesignCenter Plazierungsvorschlaege oeffnen
function DhDcOpenPv(manufac, prog) {
    DhMcControlObj.StringValueDest(32, 17000).value = manufac;
    DhMcControlObj.StringValueDest(32, 17001).value = prog;
    DhMcControlObj.DoActionSimpleCL(17000);
}
 
 
//wd 20051223 //wd20060119 Ergaenzung um das Originalprogramm, auf das wahlweise umgeschaltet werden kann
// mhayk 20101028 Abfrage ob apptree ueberhaupt oberste Webinstanz gefunden
function dh_programmname_alternativ_set(ProgAlternativ, Prog) {
    if (AppObj) {
        AppObj.programmname_altermantiv = ProgAlternativ;
        if (ProgAlternativ.length > 0) {
            dh_programmname_to_app(ProgAlternativ);
        }
 
        if (typeof Prog == "string") {
            if (Prog.length > 0) {
                dh_programmname_to_app(Prog);
            }
        }
    }
}
 
 
function dh_ci_set() {
    
}
 
function dh_ci_getpath(strukturtiefe) {
    //CI
    try {
        apptree = dh_app_tree();
        var imgpath = DhMcControlObj.StringValueDest(-301, 0).value;
        if (strukturtiefe == 0) {
            imgpath = imgpath + "/";
        }
 
        if (strukturtiefe == 1) {
            imgpath = "../" + imgpath + "/";
        }
        return imgpath;
    }
    catch (e) {
    }
 
}
 
// JM [2025|06|10] __dh_manufacturer_path cachen, duerfte sich ja nie aendern...
// damit nicht immer wieder angefragt wird...
// gerade in furnview addiert dies immer wieder latenzen...
var __dh_manufacturer_path;
function dh_getpath_manufacturer() {
    if (!__dh_manufacturer_path) {
        __dh_manufacturer_path = DhMcControlObj.StringValueDest(-31, 0).value;
    }
    return __dh_manufacturer_path;
}
 
function dh_darkUI() {
    var dh_darkUI = dh_reginfo_get('HKCU', '', 'darkUI') == 1;
    return dh_darkUI;
}
 
window.dh_getpath_html = window.dh_getpath_html || function (relativ) {
    var path = window.location.href;
    path = "/furnplan/";
    
 
    path += "_global/_global/html/h";
    return path;
 
}
 
//Ausgabe ueber debugconsole
function dh_html_debug(seite, txt, channel) {
    var apptree = dh_app_tree();
    var gesamttext = txt;
    if (seite.name == "app") {
        apptree = "";
    }
    //alert(gesamttext);
    var chan = 3400;
    if (typeof channel == 'number') {
        chan = channel;
    }
 
    DhMcControlObj.StringValueDest(32, 9184385).value = gesamttext;
    DhMcControlObj.LongValueDest(32, 9184386).value = chan;
    DhMcControlObj.DoActionSimpleCL(17200);
}
 
 
function dh_GetCurrentWeek() {
    var zeit = new Date();
    var jahr = new Date(zeit.getFullYear(), 0, 1);
    var woche = Math.ceil((zeit.getTime() - jahr) / (7 * 24 * 60 * 60 * 1000));
    return woche;
}
 
function DhEnviomentInfoSwitchManufacturerInternalGet() {
    var temp = dh_reginfo_get('HKLM', '', 'ManufacturerInternal');
    if (temp.length > 0) {
        return parseInt(temp);
    }
    return 0;
}
 
function overlib_dh_text(wert) {
    overlib(dh_text_info(wert));
}
 
function dh_ApplicationBehaviourGetValue(key_, default_) {
    var apptree = dh_app_tree();
    var rc = "";
    var def = "";
    if (default_) {
        def = default_;
    }
 
    DhMcControlObj.StringValueDest(32, 410).value = key_;
    DhMcControlObj.StringValueDest(32, 411).value = def;
    rc = DhMcControlObj.StringValueDest(-410, 0).value;
    return rc;
}
 
 
function DhDivUmschalten(obj, imgpath) {
    var OptionDiv = document.getElementById(obj);
    var OptionImg = document.getElementById(obj + "Img");
    if (typeof OptionImg == 'object' && typeof OptionDiv == 'object') {
        //if(OptionImg.value == "0")
        if (OptionDiv.style.display == 'none') {
            OptionImg.value = "1";
            OptionImg.src = imgpath + "minus.gif";
            OptionDiv.style.display = 'inline';
        }
        else {
            OptionImg.value = "0";
            OptionImg.src = imgpath + "plus.gif";
            OptionDiv.style.display = 'none';
        }
        //alert(OptionImg.value);
    }
}
 
function DhDivErweitern(obj, imgpath) {
    var OptionDiv = document.getElementById(obj);
    var OptionImg = document.getElementById(obj + "Img");
    if (typeof OptionImg == 'object' && typeof OptionDiv == 'object') {
        OptionImg.value = "1";
        OptionImg.src = imgpath + "minus.gif";
        OptionDiv.style.display = 'inline';
    }
}
 
function DhDivMinimieren(obj, imgpath) {
    var OptionDiv = document.getElementById(obj);
    var OptionImg = document.getElementById(obj + "Img");
    if (typeof OptionImg == 'object' && typeof OptionDiv == 'object') {
        OptionImg.value = "0";
        OptionImg.src = imgpath + "plus.gif";
        OptionDiv.style.display = 'none';
    }
}
 
 
function DhOpusDealerInfoGetFilialId() {
    var FilialId = DhMcControlObj.StringValueDest(-421, 0).value;
    return FilialId;
}
 
function DhOpusDealerInfoExistVirtuellerVerband(VirtuellerVerband) {
    DhMcControlObj.StringValueDest(32, -215).value = VirtuellerVerband;
    var Exist = DhMcControlObj.StringValueDest(-215, 0).value;
    //alert("Exist="+Exist);
    return Exist;
}
 
 
function DhOpusDealerInfoGetValues(DhMcControl_, WertCol0_, Spalte_) {
    var rc = "";
    var temp = DhMcControl_.StringValueDest(-420, 0).value;
    var TableID = -420;
    var AnzZeilen = DhMcControl_.TableValueDestRowCount(32, TableID);
    //alert("AnzZeilen="+AnzZeilen);
    for (var i = 0; i < AnzZeilen; i++) {
        var TabCol0 = DhMcControl_.TableValueDest(32, TableID, 0, i).value;
        if (TabCol0 == WertCol0_) {
            rc = DhMcControl_.TableValueDest(32, TableID, Spalte_, i).value;
            return rc;
        }
 
    }
    return rc;
}
 
function DhOpusDealerInfoGetVarfieldValue(DhMcControl_, Manufacturer_, VarfieldKey_) {
    var rc = "";
    var temp = DhMcControl_.StringValueDest(-420, 0).value;
    var TableID = -420;
    var AnzZeilen = DhMcControl_.TableValueDestRowCount(32, TableID);
 
    for (var i = 0; i < AnzZeilen; i++) {
        var TabCol0 = DhMcControl_.TableValueDest(32, TableID, 0, i).value;
        var TabCol2 = DhMcControl_.TableValueDest(32, TableID, 2, i).value;
        var TabCol3 = DhMcControl_.TableValueDest(32, TableID, 3, i).value;
        if (TabCol0 == "VARFIELD" && TabCol2 == Manufacturer_ && TabCol3 == VarfieldKey_) {
            rc = DhMcControl_.TableValueDest(32, TableID, 4, i).value;
        }
    }
    return rc;
}
 
function DhGetSelectionState()//return  = long
{
    var temp = DhMcControlObj.StringValueDest(-430, 0).value;
    return parseInt(temp);
}
 
function DhSetSelectionState(wert)//wert = long
{
    //alert(typeof DhMcControlObj);
    var temp = DhMcControlObj.StringValueDest(-431, wert).value;
}
 
 
function DhActionTypeSetNormalmodus() {
    AppObj._ac(4);
}
 
function DhProgInfoGetInfoValue(manufacturer_, programm_, key_, default_) {
    DhMcControlObj.StringValueDest(32, 239744).value = manufacturer_;
    DhMcControlObj.StringValueDest(32, 239745).value = programm_;
    DhMcControlObj.StringValueDest(32, 239746).value = key_;
    DhMcControlObj.StringValueDest(32, 239747).value = default_;
    var rc = DhMcControlObj.StringValueDest(-432, 0).value;
    //alert(typeof rc);
    return rc;
}
 
 
function DhKatatreeBereichUeberschrift(Ueberschrift) {
    
}
 
//wd20111205
function DhKatatreeBereichNameGet() {
    return AppObj.KataBereichId;
}
 
 
function Dh_ObjectDisplayNone(object_)//wd20100521
{
    if (typeof object_ == 'object') {
        object_.style.display = "none";
    }
}
 
function Dh_ObjectDisplayInline(object_)// WD [2015|10|5]
{
    if (typeof object_ == 'object') {
        object_.style.display = "inline";
    }
}
 
 
function Dh_EUV()//wd20100520
{
    var euv = DhMcControlObj.StringValueDest(-470, 0).value;
    if (euv == "1") {
        return true;
    }
    else {
        return false;
    }
}
 
 
//UTF  FUNKTIONEN START
//UTF  FUNKTIONEN START
//UTF  FUNKTIONEN START
function DH_TryParseInt(str, defaultValue) {
    var retValue = defaultValue;
    if (str != null) {
        if (str.length > 0) {
            if (!isNaN(str)) {
                retValue = parseInt(str);
            }
        }
    }
    return retValue;
}
 
function DH_UTF_FROM(input) {
    if (input == null || input.length == 0)
        return "";
 
    var result = "";
    input = DH_UTF_REPLACE_RETURN(input);
    if (input.indexOf("&#") == -1)
        result = result + input;
    else {
        var tmpValue = input;
        var intValue = "";
        var intTmpValue = 0;
        var pos = -1;
        var charValue = 0;
        pos = tmpValue.indexOf("&#");
        if (pos > 0)
            result = result + tmpValue.substring(0, pos);
        while (pos != -1) {
            tmpValue = tmpValue.substring(pos + 2);
            pos = tmpValue.indexOf(";");
            if (pos != -1) {
                intValue = tmpValue.substring(0, pos);
                tmpValue = tmpValue.substring(pos + 1);
                intTmpValue = DH_TryParseInt(intValue, 0);
                if (intTmpValue == 0)
                    result = result + intValue;
                else
                    result = result + String.fromCharCode(intTmpValue);
                pos = tmpValue.indexOf("&#");
                if (pos != -1)
                    result = result + tmpValue.substring(0, pos);
            }
        }
        result = result + tmpValue;
    }
 
    return result;
}
 
function DH_UTF_REPLACE_RETURN(input) {
    return input.replace("&#10;", "</br>");
}
 
function DH_UTF_TO(input) {
    if (input == null || input.length == 0)
        return "";
 
    var result = "";
 
    for (pos = 0; pos < input.length; pos++) {
        if (input.charCodeAt(pos) > 127)
            result = result + "&#" + input.charCodeAt(pos) + ";";
        else
            result = result + input.charAt(pos);
    }
 
    result = result.replace("\r\n", "&#10;");
 
    return result;
}
 
//UTF  FUNKTIONEN END
//UTF  FUNKTIONEN END
//UTF  FUNKTIONEN END
 
 
function ShowPdf(manufacturer, TitleTextId, TextTableDatName, path, filename, AddLanguage) {
    DhMcControlObj.StringValueDest(32, 1000).value = manufacturer;//Beispiel "_global"
    DhMcControlObj.StringValueDest(32, 1001).value = TitleTextId;//aus dem Herstellertexten
    DhMcControlObj.StringValueDest(32, 1002).value = filename;//Beispiel "_furnplan_Handbuch"
    DhMcControlObj.StringValueDest(32, 1003).value = AddLanguage;//1=Sprachk?rzel vorne anh?ngen  2=Sprachk?rzel hinten anh?ngen
    DhMcControlObj.StringValueDest(32, 1004).value = TextTableDatName;//app
    
    DhMcControlObj.StringValueDest(32, 1005).value = path.replace(/\\/g, "/");//Beispiel "_global/help"
 
    return DhMcControlObj.StringValueDest(-240, 0).value
}
 
function OpenURLInInternalBrowser(sURL, sTitle, iWidth, iHeight) {
    if (!iWidth) {
        iWidth = 0;
    }
    if (!iHeight) {
        iHeight = 0;
    }
    if (!sTitle) {
        sTitle = "";
    }
    DhMcControlObj.StringValueDest(32, 917033001).value = sURL;
    DhMcControlObj.LongValueDest(32, 917033002).value = iWidth; // Width
    DhMcControlObj.LongValueDest(32, 917033003).value = iHeight; // Height
    DhMcControlObj.StringValueDest(32, 917033004).value = sTitle; // Height
    DhMcControlObj.DoActionSimpleCL(17033);
}
 
function LoadPoWithFile(manufacturer, prog, file, extParam) {
    //  alert(manufacturer + "  " + prog + "  "  + file + " " + extParam);
    DoAsyncFPSAction("LoadPOFromFile", [{
        "Manu": "" + manufacturer,
        "Prog": "" + prog,
        "ArtNr": "" + file,
        "ExtParam": extParam || "",
        "PlacerMode": +(AppObj.placer_status || 0)
    }]);
} //function LoadPoWithFile(manufacturer, prog, file)
 
//wd20100907
//Katalog Schalter aus OpusDealerInfo lesen
function dh_checkCatKey(key_, value_) {
    DhMcControlObj.StringValueDest(32, 31774266).value = key_;
    DhMcControlObj.StringValueDest(32, 31774267).value = value_;
    var erg = DhMcControlObj.StringValueDest(-344, 0).value;
    //alert("dddddd")
    if (erg == "1") {
        return true;
    }
    else {
        return false;
    }
}
 
// TODO: Nur Kallisto (huelsta)
function dh_getcustnr()//wd20100907
{
    return DhMcControlObj.StringValueDest(-345, 0).value;
}
 
function dh_getcountry()//wd20100907
{
    return DhMcControlObj.StringValueDest(-346, 0).value;
}
 
 
function dh_SessionDataWriteString(key_, value_)// WD [2015|7|17] schreibt Werte zum Speichern innerhalb einer Session
{
    DhMcControlObj.StringValueDest(32, 31774341).value = key_;
    DhMcControlObj.StringValueDest(32, 31774342).value = value_;
    return DhMcControlObj.StringValueDest(-341, 0).value;
}
 
function dh_SessionDataReadString(key_, default_)// WD [2015|7|17] liest gespeicherte Werte innerhalb einer Session
{
    if (typeof default_ == "undefined") {
        default_ = "";
    }
 
    DhMcControlObj.StringValueDest(32, 31774341).value = key_;
    DhMcControlObj.StringValueDest(32, 31774342).value = default_;
    return DhMcControlObj.StringValueDest(-342, 0).value;
}
 
function dh_readCataData(key_)//wd20100908 liest gespeicherte Katalogeinstellungen / je Hersteller
{
    DhMcControlObj.StringValueDest(32, 31774268).value = key_;
    return DhMcControlObj.StringValueDest(-347, 0).value;
}
 
function dh_readCataDataGlobal(key_)//ME20120925 liest global gespeicherte Katalogeinstellungen (herstellerneutral)
{
    DhMcControlObj.StringValueDest(32, 31774271).value = "global";
    DhMcControlObj.StringValueDest(32, 31774268).value = key_;
    return DhMcControlObj.StringValueDest(-347, 0).value;
}
 
// TODO: Nur Kallisto (huelsta)
// ME20170118 gibt den alternativen Programmnamen zurück,
// wird im Kallisto Umfeld auch dazu genutzt, ob ein Programm angezeigt werden soll oder nicht (#hide#)
function dh_ProgAlias(Manufacturer_, prog_) {
    DhMcControlObj.StringValueDest(32, 37518).value = Manufacturer_;
    DhMcControlObj.StringValueDest(32, 37519).value = prog_;
    return DhMcControlObj.StringValueDest(-211, 0).value;
}
 
 
function dh_writeCataData(key_, value_)//wd20100908 schreibt zu speichernde Katalogeinstellungen / je Hersteller
{
    DhMcControlObj.StringValueDest(32, 31774269).value = key_;
    DhMcControlObj.StringValueDest(32, 31774270).value = value_;
    return DhMcControlObj.StringValueDest(-348, 0).value;
}
 
function dh_writeCataDataGlobal(key_, value_)//ME20120925 schreibt global gespeicherte Katalogeinstellungen (herstellerneutral)
{
    DhMcControlObj.StringValueDest(32, 31774271).value = "global";
    DhMcControlObj.StringValueDest(32, 31774269).value = key_;
    DhMcControlObj.StringValueDest(32, 31774270).value = value_;
    return DhMcControlObj.StringValueDest(-348, 0).value;
}
 
 
//wd 20120523 liest aus einer Tabelle des aktuellen Herstellers (oder Programms)... sucht in der Tabelle in Spalte 0 nach dem Key und gibt dann die Spalte 1 zurueck
//wd 20130313 gibt nun die Spaltge SpalteZurueck_ zurueck, wenn da ein Wert ?bergeben wurde, ansonsten die Spalte 1
//WD ME 20131112 man kann nun einen Hersteller angeben, von dem die Daten gelesen werden
//NH 20160524 Man kann nun einen Default-Rückgabewert definieren, welche4r zurückgegebwen wird, wenn kein Datensatz gefunden wird
function dh_SearchInTableFromManufacturer(TabName_, Key_, SpalteZurueck_, Manufacturer_, DefaultNoRow_) {
    var dataJson = {
        "tName": TabName_,
        "key": Key_,
        "column": "1",
        "manu": "",
        "default": ""
    };
 
    if (typeof SpalteZurueck_ == "number") {
        dataJson.column = "" + SpalteZurueck_;
    }
 
    if (typeof Manufacturer_ == "string") {
        dataJson.manu = Manufacturer_;
    }
 
    if (typeof DefaultNoRow_ == "string") {
        dataJson["default"] = DefaultNoRow_;
    }
 
    var rc = DoSyncFPSAction("SearchInTableFromManufacturer", [dataJson]);
    if (rc) {
        return rc;
    }
    return "";
}
 
function dh_OpusDealerInfoGetPriceListInternalName()// WD [2011|8|8 12:39] interner Preislistenname zur?ck geben
{
    return DhMcControlObj.StringValueDest(-352, 0).value;
}
 
 
var DhColorForYellowDropdownBackground = "#ffffcc";
 
 
function CheckTextboxValueRange(id_textbox_obj_, value_min_, value_max_, value_precision_) {
    if (typeof id_textbox_obj_ != "object") {
        return;
    }
 
    var TextboxAlertColor = "yellow";
 
    var Value = id_textbox_obj_.value.replace(/,/, ".");
    Value = parseFloat(Value);
    var ValueMin = parseFloat(value_min_);
    var ValueMax = parseFloat(value_max_);
    if (isNaN(Value) || isNaN(ValueMin) || isNaN(ValueMax)) {
        alert(Value + " or " + ValueMin + " or " + ValueMax + " is no Number!");
        return;
 
    } // if(isNaN(Value) ||
 
    var ValuePrecision = parseInt(value_precision_);
    if (isNaN(ValuePrecision)) {
        ValuePrecision = 1;
    }
 
    //alert("Value=" + Value + ", ValueMin=" + ValueMin + ", ValueMax=" + ValueMax + ", ValuePrecision=" + ValuePrecision);
 
    if (Value < ValueMin) {
        //alert("Value=" + Value + ", ValueMin=" + ValueMin);
        id_textbox_obj_.value = ValueMin;
        id_textbox_obj_.style.backgroundColor = TextboxAlertColor;
 
    } // if(Value < ValueMin)
    else if (Value > ValueMax) {
        //alert("Value=" + Value + ", ValueMax=" + ValueMax);
        id_textbox_obj_.value = ValueMax;
        id_textbox_obj_.style.backgroundColor = TextboxAlertColor;
 
    } // if(Value > ValueMax)
    else {
        //alert("Value=" + Value);
        var Factor = Math.pow(10, ValuePrecision);
        Value = Math.round(Value * Factor) / Factor;
        //alert(Value);
        id_textbox_obj_.value = Value;
        id_textbox_obj_.style.backgroundColor = "white";
    }
 
} // function CheckTextboxValueRange(
 
function dh_VideoShow(Manufacturer_, VideoId_) {
    topWindow.app.sendToFurnview("furnplan.showYTVideo", [Manufacturer_, VideoId_]);
}//function dh_youtube(Channel_,Video_)
 
 
 
function dh_CheckDeliveryTimeAvailable() {
    return DhMcControlObj.StringValueDest(-75, 0).value;
}
 
function OpenDeliveryTime() {
    DhMcControlObj.DoActionSimpleCL(5205);
}
 
function dh_cnc(modus_) {
    DhMcControlObj.LongValueDest(32, 17930).value = modus_;
    DhMcControlObj.DoActionSimpleCL(17930);
    dh_todo('2', '30529', '30529', '', '', '7', '', '1000', 'L', '1');
}
 
 
//PM_Enable = 515
//- aktiviert den Reiter Projektmanager
//PM_Disable = 516,
//- deaktiviert den Reiter Projektmanager
//PM_MakeVisible= 516,
//- blendet den Reiter Projektmanager ein
//PM_MakeInvisible = 517
//- blendet den Reiter Projektmanager komplett aus
function dh_SendCommandToProjectmanager(PmAufruf)//wd20120919
{
    DhMcControlObj.LongValueDest(32, 17950).value = PmAufruf;
    DhMcControlObj.DoActionSimpleCL(17950);
}
 
function dh_VarGlobalTableContainerReset(id)//wd201330 ID hinzu gefuegt
{
    if (typeof id == "number") {
        //alert("number " + id);
        DhMcControlObj.LongValueDest(32, 17980).value = id;
        DhMcControlObj.DoActionSimpleCL(17980);
    }
    // 20180124 MW Das Löschen aller Tabellen wird nicht mehr benutzt, und würde auch zu
    // Problemen führen, deshalb habe ich es auskommentiert
    //else {
    //     DhMcControlObj.LongValueDest(32, 17980).value = -99999999;
    //}
    //DhMcControlObj.DoActionSimpleCL(17980);
}
 
function dh_GetCurrentManufacturerLongName() {
    var CurManufac = DhMcControlObj.StringValueDest(-530, 0).value;
    return CurManufac;
}
 
function dh_GetCurrentProgrammLongName() {
    var CurProg = DhMcControlObj.StringValueDest(-531, 0).value;
    return CurProg;
}
 
function dh_PathManufacturerGet() {
    //wd20120717 wenn in der index.html das DhMcControlObj noch nicht zugewiesen werden konnte...
    if (!DhMcControlObj) {
        DhMcControlObj = eval(dh_app_tree() + "DhMcControl");
    }
    var ergebnis = DhMcControlObj.StringValueDest(-357, 0).value;
    return ergebnis;
}
 
function dh_GuidGet()//wd20120816
{
    var ergebnis = DhMcControlObj.StringValueDest(-490, 0).value;
    return ergebnis;
}
 
 
function dh_SetMasterActionMode(MasterActionMode_)//wd20120924 Pickpoly oder Flaeckenpicken
{
    if (MasterActionMode_ == 0)//Pickpolygone picken
    {
        DhMcControlObj.DoActionSimpleCL(17982);
    }
    if (MasterActionMode_ == 1)//Flaechen picken
    {
        DhMcControlObj.DoActionSimpleCL(17983);
    }
}
 
function dh_LoadDefaultPlanfile(VorherSpeichernFragen_) {
    if (VorherSpeichernFragen_) {
        DhMcControlObj.DoActionSimpleCL(3998);
    }
    else {
        DhMcControlObj.DoActionSimpleCL(3997);
    }
}
 
 
function HexToR(h) {
    return parseInt((cutHex(h)).substring(0, 2), 16)
}
 
function HexToG(h) {
    return parseInt((cutHex(h)).substring(2, 4), 16)
}
 
function HexToB(h) {
    return parseInt((cutHex(h)).substring(4, 6), 16)
}
 
function cutHex(h) {
    return (h.charAt(0) == "#") ? h.substring(1, 7) : h
}
 
function RGBtoHex(R, G, B) {
    return toHex(R) + toHex(G) + toHex(B)
}
 
function toHex(N) {
    if (N == null) return "00";
    N = parseInt(N);
    if (N == 0 || isNaN(N)) return "00";
    N = Math.max(0, N);
    N = Math.min(N, 255);
    N = Math.round(N);
    return "0123456789ABCDEF".charAt((N - N % 16) / 16)
        + "0123456789ABCDEF".charAt(N % 16);
}
 
function dh_SearchArtNr(Manufacturer_, Prog_, ClassID_, Anschlag_, Typgruppe_, DXMax_, DYMax_, DZMax_, Var1_, Var2_, Var3_, Var4_, Var5_) {
    //ClassId        Wenn 0     = Neutral, wird nicht in die Suche einbezogen
    //Anschlag_        Wenn ""    = Neutral, wird nicht in der Suche einbezogen
    //TypGruppe_    Wenn -1    = Neutral, wird nicht in der Suche einbezogen
    //Dx_            Wenn < 0.0 = Neutral, wird nicht in die Suche einbezogen
    //Dy_            Wenn < 0.0 = Neutral, wird nicht in die Suche einbezogen
    //Dz_            Wenn < 0.0 = Neutral, wird nicht in die Suche einbezogen
    //Var1_            Wenn ""    = Neutral, wird nicht in der Suche einbezogen
    //Var2_            Wenn ""    = Neutral, wird nicht in der Suche einbezogen
    //Var3_            Wenn ""    = Neutral, wird nicht in der Suche einbezogen
    //Var4_            Wenn ""    = Neutral, wird nicht in der Suche einbezogen
    //Var5_            Wenn ""    = Neutral, wird nicht in der Suche einbezogen
 
    DhMcControlObj.LongValueDest(32, 31774271).value = 1;
    DhMcControlObj.StringValueDest(32, 31774272).value = "";
    if (typeof Manufacturer_ == "string") {
        DhMcControlObj.StringValueDest(32, 31774272).value = Manufacturer_;
    }
    if (typeof Prog_ == "string" && Prog_.length > 0) {
        DhMcControlObj.StringValueDest(32, 6894413).value = Prog_;
    }
    else {
        DhMcControlObj.StringValueDest(32, 6894413).value = dh_programmname_get_current();
    }
    if (typeof ClassID_ == "number" || (typeof ClassID_ == "string" && ClassID_.length > 0)) {
        DhMcControlObj.LongValueDest(32, 31800002).value = dh_CheckVarType(ClassID_, 'L');
    }
    if (typeof Anschlag_ == "string") {
        DhMcControlObj.StringValueDest(32, 31800003).value = Anschlag_;
    }
    if (typeof Typgruppe_ == "number" || (typeof Typgruppe_ == "string" && Typgruppe_.length > 0)) {
        DhMcControlObj.LongValueDest(32, 31800004).value = dh_CheckVarType(Typgruppe_, 'L');
    }
    if (typeof DXMax_ == "number" || (typeof DXMax_ == "string" && DXMax_.length > 0)) {
        DhMcControlObj.DoubleValueDest(32, 31800009).value = dh_CheckVarType(DXMax_, 'D');
    }
    if (typeof DYMax_ == "number" || (typeof DYMax_ == "string" && DYMax_.length > 0)) {
        DhMcControlObj.DoubleValueDest(32, 31800010).value = dh_CheckVarType(DYMax_, 'D');
    }
    if (typeof DZMax_ == "number" || (typeof DZMax_ == "string" && DZMax_.length > 0)) {
        DhMcControlObj.DoubleValueDest(32, 31800011).value = dh_CheckVarType(DZMax_, 'D');
    }
    if (typeof Var1_ == "string") {
        DhMcControlObj.StringValueDest(32, 31800023).value = Var1_;
    }
    if (typeof Var2_ == "string") {
        DhMcControlObj.StringValueDest(32, 31800024).value = Var2_;
    }
    if (typeof Var3_ == "string") {
        DhMcControlObj.StringValueDest(32, 31800025).value = Var3_;
    }
    if (typeof Var4_ == "string") {
        DhMcControlObj.StringValueDest(32, 31800026).value = Var4_;
    }
    if (typeof Var5_ == "string") {
        DhMcControlObj.StringValueDest(32, 31800027).value = Var5_;
    }
    var rc = DhMcControlObj.StringValueDest(-486, 0).value; // Neuer Funktionsaufruf/Modus [2014/08/14 NH]
 
    return rc;
 
} //dh_SearchArtNr()
 
function dh_CheckVarType(value, type) {
    var rc;
 
    if (typeof value == "number") {
        rc = value;
    }
    else if (typeof value == "string") {
        switch (type) {
            case "D": {
                if (IsNumeric(value)) {
                    rc = parseFloat(value);
                }
                else {
                    rc = 0.0;
                }
                break;
            }
            case "L": {
                if (IsNumeric(value)) {
                    rc = parseInt(value);
                }
                else {
                    rc = 0;
                }
                break;
            }
        }
    }
    return rc;
}
 
// WD [2014|11|10]
function DH_removeOptions(selectbox) {
    var i;
    for (i = selectbox.options.length - 1; i >= 0; i--) {
        selectbox.remove(i);
    }
}
 
 
// WD [2015|8|25]
function DH_KataSaveLastLevel(manufacturer, Level1, Level2) {
    //alert("DH_KataSaveLastLevel  <"+manufacturer+"><"+Level1+"><"+Level2+">");
    //var DateiOeffnenGeradeAktiv = dh_todo("3","-1","1",OpenFileCheckId.toString(),"L");
    //alert("DateiOeffnenGeradeAktiv="+DateiOeffnenGeradeAktiv);
    //if(DateiOeffnenGeradeAktiv == 1)
    //{
    //alert("DH_KataSaveLastLevel  DateiOeffnenGeradeAktiv=1");
    //    return;
    //}
 
    if (manufacturer.length == 0) {
        // JM [2016|7|13] #18271
        // dh_manufacturer_get(); -> dh_company_get(); da sonst z.b. bei musterring nicht der gewählte hersteller gezogen wird, sondern der Aktive Hersteller
        // (Musterring verweist auf Programme anderer Hersteller, wodurch hier z.b. bei Programm Nevada Hersteller Carre ermittelt wird. der KataDropLevel muss aber von Musterring gezogen werden.)
        manufacturer = dh_company_get();
    }
    //alert("2797  manufacturer=["+manufacturer+"]");
    dh_todo("3", "-1", "0", "12022", "S", manufacturer);
    dh_todo("3", "32", "0", "12022", "S", manufacturer);// WD [2021|12|3] damit huelsta auch geht #53729
 
    //alert("Level1="+Level1+"  Level2="+Level2+ " manufacturer="+manufacturer );
    if (Level1.length > 0) {
        dh_reginfo_set("HKCU", manufacturer, "KataDropLevel1", Level1);
        dh_todo("3", "-1", "0", "12020", "S", Level1);
    }
    if (Level2.length > 0) {
        dh_reginfo_set("HKCU", manufacturer, "KataDropLevel2", Level2);
        dh_todo("3", "-1", "0", "12021", "S", Level2);
    }
}
 
function DH_KataSaveLastLevel_ForKataOpen(Level1, Level2, KataID, KataSeite) {
    //var DateiOeffnenGeradeAktiv = dh_todo("3","-1","1",OpenFileCheckId.toString(),"L");
 
    var manufacturer = dh_company_get();
    dh_todo("3", "32", "0", "12022", "S", manufacturer);
    //alert("2818 DH_KataSaveLastLevel  <"+manufacturer+"><"+Level1+"><"+Level2+">");
 
 
    //alert("Level1="+Level1+"  Level2="+Level2);
    if (Level1.length > 0) {
        dh_todo("3", "32", "0", "12020", "S", Level1);
        dh_todo("3", "32", "0", "12021", "S", "");// WD [2020|9|2] wenn es ggf. keinen Level2 gibt, dann hier initial setzen
    }
    if (Level2.length > 0) {
        dh_todo("3", "32", "0", "12021", "S", Level2);
    }
 
    if (typeof KataID == "string") {
        //alert("KataID="+KataID)
        if (KataID.length > 0) {
            dh_todo("3", "32", "0", "12023", "S", KataID);
        }
    }
 
    if (typeof KataSeite == "string") {
        //alert("KataSeite="+KataSeite)
        if (KataSeite.length > 0) {
            dh_todo("3", "32", "0", "12027", "S", KataSeite);
        }
    }
}
 
 
// WD [2015|9|3]
function DH_KataGetLastDropLevelId(Level) {
    // JM [2016|7|13] #18271
    // dh_manufacturer_get(); -> dh_company_get(); da sonst z.b. bei musterring nicht der gewählte hersteller gezogen wird, sondern der Aktive Hersteller
    // (Musterring verweist auf Programme anderer Hersteller, wodurch hier z.b. bei Programm Nevada Hersteller Carre ermittelt wird. der KataDropLevel muss aber von Musterring gezogen werden.)
    var CurrentManufacturer = dh_company_get();
    var KataDropLevel = "KataDropLevel" + Level.toString();
    var rc = dh_reginfo_get("HKCU", CurrentManufacturer, KataDropLevel);
 
    // WD [2015|9|3] ggf. aus Datei holen, wenn diese gerade geoeffnet wurde
    var OpenFileCheckId = 12023 + Level;
    var DateiOeffnenGeradeAktiv = dh_todo("3", "-1", "1", OpenFileCheckId.toString(), "L");
    //alert("DateiOeffnenGeradeAktiv="+DateiOeffnenGeradeAktiv);
    if (DateiOeffnenGeradeAktiv == 1) {
        var ValueId = 12019 + Level;
        var temp = dh_todo("3", "-1", "1", ValueId.toString(), "S")
        //alert("ValueId="+ValueId+"  temp="+temp);
        if (temp.length > 0) {
            rc = temp;
        }
        //dh_todo("3", "-1", "0", OpenFileCheckId.toString(), "L", "0");// WD [2020|5|7] Variable wieder initial setzen .. ich denke das gibt keine Probleme   // WD [2020|5|13]  hat Probleme gegeben.. daher deaktiviert
    }
 
    //alert("DH_KataGetLastDropLevelId  KataDropLevel="+KataDropLevel+"  CurrentManufacturer="+CurrentManufacturer+"  Level="+Level+"  rc="+rc);
    return rc;
}
 
// [2014/12/03 NH]
function RoundFloat(Value, n) {
    var Factor = Math.pow(10, n);
    return (Math.round(Value * Factor) / Factor);
}
 
// [2014/12/03 NH]
function SelectComboIndex(cObj, cValue, cDefaultIndex) {
    if (typeof cDefaultIndex == 'undefined') {
        cDefaultIndex = -1;//ohne Treffer auch nichts selektieren
    }
 
    var cIndex = cDefaultIndex;
 
    if (typeof (cObj) == 'object') {
        var options = cObj.options;
        for (var i = 0, n = options.length; i < n; i++) {
            if (options[i].value == cValue) {
                cIndex = i;
                break;
            }
        }
        if (cIndex >= 0)// Index 0 ist der erste Eintrag!!!
        {
            try {
                cObj.selectedIndex = cIndex;
            }
            catch (e) {
                //alert("catch..." + e);
            }
        }
    }
    return;
}
 
// WD [2021|8|17]
function SelectItemInSelect(arrSelect, sItem) {
    for (k = 0; k < arrSelect.options.length; k++) {
        if (arrSelect.options[k].value == sItem) {
            //alert("gefunden und setzen " + k + "   " +arrSelect.options[k].value);
            arrSelect.options[k].selected = true;
            //alert("gesetzt..");
        }
    }
}
 
 
// Standard Funktion Array.indexOf definieren wenn nicht vorhanden (Beispiel in IE 6,7,8)
if (!Array.prototype.indexOf) {
    Array.prototype.indexOf = function (searchElement) {
        "use strict";
 
        if (this === void 0 || this === null)
            throw new TypeError();
 
        var t = Object(this);
        var len = t.length >>> 0;
        if (len === 0)
            return -1;
 
        var n = 0;
        if (arguments.length > 0) {
            n = Number(arguments[1]);
            if (n !== n)
                n = 0;
            else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0))
                n = (n > 0 || -1) * Math.floor(Math.abs(n));
        }
 
        if (n >= len)
            return -1;
 
        var k = n >= 0
            ? n
            : Math.max(len - Math.abs(n), 0);
 
        for (; k < len; k++) {
            if (k in t && t[k] === searchElement)
                return k;
        }
        return -1;
    }
}
 
 
function dh_GetCurrentVersionNumber() {
    var Version = DhMcControlObj.StringValueDest(-340, 0).value;//alle Daten holen!!!
    var TableIdVersion1 = 92715;
    var InstVersion = DhMcControlObj.TableValueDest(32, TableIdVersion1, 1, 0).value
    return InstVersion;
}
 
function dh_GetCurrentCustomerNumber() {
    var Version = DhMcControlObj.StringValueDest(-340, 0).value;//alle Daten holen!!!
    var TableIdLizenznehmer = 92719;
    var Kundennummer = DhMcControlObj.TableValueDest(32, TableIdLizenznehmer, 0, 0).value
    return Kundennummer;
}
 
function dh_alert(text) {
    alert(this.location + "\n\n" + text);
}
 
// Standard Funktion JSON.parse && JSON.stringify definieren wenn nicht vorhanden (Beispiel in IE 6,7)
"object" != typeof JSON && (JSON = {}), function () {
    "use strict";
 
    function f(t) {
        return 10 > t ? "0" + t : t
    }
 
    function this_value() {
        return this.valueOf()
    }
 
    function quote(t) {
        return rx_escapable.lastIndex = 0, rx_escapable.test(t) ? '"' + t.replace(rx_escapable, function (t) {
            var e = meta[t];
            return "string" == typeof e ? e : "\\u" + ("0000" + t.charCodeAt(0).toString(16)).slice(-4)
        }) + '"' : '"' + t + '"'
    }
 
    function str(t, e) {
        var r, n, o, u, f, a = gap, i = e[t];
        switch (i && "object" == typeof i && "function" == typeof i.toJSON && (i = i.toJSON(t)), "function" == typeof rep && (i = rep.call(e, t, i)), typeof i) {
            case "string":
                return quote(i);
            case "number":
                return isFinite(i) ? String(i) : "null";
            case "boolean":
            case "null":
                return String(i);
            case "object":
                if (!i) return "null";
                if (gap += indent, f = [], "[object Array]" === Object.prototype.toString.apply(i)) {
                    for (u = i.length, r = 0; u > r; r += 1) f[r] = str(r, i) || "null";
                    return o = 0 === f.length ? "[]" : gap ? "[\n" + gap + f.join(",\n" + gap) + "\n" + a + "]" : "[" + f.join(",") + "]", gap = a, o
                }
                if (rep && "object" == typeof rep) for (u = rep.length, r = 0; u > r; r += 1) "string" == typeof rep[r] && (n = rep[r], o = str(n, i), o && f.push(quote(n) + (gap ? ": " : ":") + o)); else for (n in i) Object.prototype.hasOwnProperty.call(i, n) && (o = str(n, i), o && f.push(quote(n) + (gap ? ": " : ":") + o));
                return o = 0 === f.length ? "{}" : gap ? "{\n" + gap + f.join(",\n" + gap) + "\n" + a + "}" : "{" + f.join(",") + "}", gap = a, o
        }
    }
 
    var rx_one = /^[\],:{}\s]*$/, rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
        rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
        rx_four = /(?:^|:|,)(?:\s*\[)+/g,
        rx_escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
    "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function () {
        return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
    }, Boolean.prototype.toJSON = this_value, Number.prototype.toJSON = this_value, String.prototype.toJSON = this_value);
    var gap, indent, meta, rep;
    "function" != typeof JSON.stringify && (meta = {
        "\b": "\\b",
        "    ": "\\t",
        "\n": "\\n",
        "\f": "\\f",
        "\r": "\\r",
        '"': '\\"',
        "\\": "\\\\"
    }, JSON.stringify = function (t, e, r) {
        var n;
        if (gap = "", indent = "", "number" == typeof r) for (n = 0; r > n; n += 1) indent += " "; else "string" == typeof r && (indent = r);
        if (rep = e, e && "function" != typeof e && ("object" != typeof e || "number" != typeof e.length)) throw new Error("JSON.stringify");
        return str("", { "": t })
    }), "function" != typeof JSON.parse && (JSON.parse = function (text, reviver) {
        function walk(t, e) {
            var r, n, o = t[e];
            if (o && "object" == typeof o) for (r in o) Object.prototype.hasOwnProperty.call(o, r) && (n = walk(o, r), void 0 !== n ? o[r] = n : delete o[r]);
            return reviver.call(t, e, o)
        }
 
        var j;
        if (text = String(text), rx_dangerous.lastIndex = 0, rx_dangerous.test(text) && (text = text.replace(rx_dangerous, function (t) {
            return "\\u" + ("0000" + t.charCodeAt(0).toString(16)).slice(-4)
        })), rx_one.test(text.replace(rx_two, "@").replace(rx_three, "]").replace(rx_four, ""))) return j = eval("(" + text + ")"), "function" == typeof reviver ? walk({ "": j }, "") : j;
        throw new SyntaxError("JSON.parse")
    })
}();
 
// Standart Funktion indexOf für Arrays (normalerweise nur Support ab IE 9)
if (!Array.prototype.indexOf) {
    Array.prototype.indexOf = function (elt /*, from*/) {
        var len = this.length >>> 0;
 
        var from = Number(arguments[1]) || 0;
        from = (from < 0)
            ? Math.ceil(from)
            : Math.floor(from);
        if (from < 0)
            from += len;
 
        for (; from < len; from++) {
            if (from in this &&
                this[from] === elt)
                return from;
        }
        return -1;
    };
}
 
// Internet Explorers attachEvent Funktion ruft die angegebenen Funktionen in falscher oder manchmal auch willkürlicher reihenfolge auf.
// Um dies zu korrigieren und eine Standard reihenfolge zu bekommen wird die Standard Funktion überschrieben um die Event-Liste selbst zu definieren.
// (Heißt: das Event welches als erstes hinzugefügt wird, wird auch als erstes aufgerufen)
if (document.attachEvent && !document.attachEventOld) {
    // die alte attachEvent Funktion unter attachEventOld sicher. (soll ja immer noch verwendbar sein!)
    document.attachEventOld = document.attachEvent;
 
    // Einmaliges altes Event ausführen, um dann die Liste der Event-Funktionen wiederzugeben.
    var returnValueAttachEvent = document.attachEventOld("onreadystatechange", function () {
        // Prüfen ob die EventListe initialisiert wurde... (attachEvent muss mindestens 1x ausgeführt werden.)
        if (window.documentReadyEventList instanceof Array) {
            // Die Liste der Event-Funktionen nach Logischer reihenfolge aufrufen. (Das Event welches als erstes hinzugefügt wird, wird auch als erstes aufgerufen)
            for (var iCallback = 0; iCallback < window.documentReadyEventList.length; iCallback++) {
                var callback = window.documentReadyEventList[iCallback];
                if (typeof callback === "function") {
                    callback();
                }
            }
        }
    });
 
    // die attachEvent Funktion überschreiben. (gilt nur für Events vom document Element)
    document.attachEvent = function (event, callback) {
        // zur Zeit erstmal nur das "onreadystatechange" event überschreiben.
        if (event === "onreadystatechange") {
            // beim ersten Aufrufe eine Liste Initialisieren
            if (window.documentReadyEventList instanceof Array == false) {
                window.documentReadyEventList = [];
            }
 
            // die hinterlegte Funktion in der Liste speichern
            window.documentReadyEventList.push(callback);
 
            // um die return value (Boolean) zu unterstützen
            return returnValueAttachEvent;
        }
        // Bei anderen Event, die alte Funktion entscheiden lassen.
        else {
            return document.attachEventOld(event, callback);
        }
    }
}
 
 
 
 
// Fügt einem HTMLElement eine Css Klasse hinzu, da im IE7 die Funktion Element.classList.add(...) nicht funktioniert!
function addClass(element, className) {
    if (element instanceof Array) {
        for (var iElement = 0; iElement < element.length; iElement++) {
            if (!element[iElement] || typeof element[iElement] != "object" || element[iElement].nodeType != 1) {
                continue;
            }
            addClass(element[iElement], className);
        }
        return;
    }
 
    if (!element || typeof element != "object" || element.nodeType != 1 /* != HTMLElement */) {
        return;
    }
 
    if (!element.className || element.className.length == 0) {
        element.className = className;
        return;
    }
 
    var classList = element.className.split(" ");
    for (var iClass = 0; iClass < classList.length; iClass++) {
        if (classList[iClass] == className) {
            return;
        }
    }
 
    element.className += " " + className;
}
 
// Entfernt eine Css Klasse von einem HTMLElement, da im IE7 die Funktion Element.classList.remove(...) nicht funktioniert!
function removeClass(element, className) {
    if (element instanceof Array) {
        for (var iElement = 0; iElement < element.length; iElement++) {
            if (!element[iElement] || typeof element[iElement] != "object" || element[iElement].nodeType != 1) {
                continue;
            }
            removeClass(element[iElement], className);
        }
        return;
    }
 
    if (!element || typeof element != "object" || element.nodeType != 1 /* != HTMLElement */) {
        return;
    }
 
    var classList = element.className.split(" ");
    for (var iClass = 0; iClass < classList.length; iClass++) {
        if (classList[iClass] != className)
            continue;
        classList.splice(iClass, 1);
        element.className = "";
        for (var iClass = 0; iClass < classList.length; iClass++) {
            if (element.className.length > 0) {
                element.className += " ";
            }
            element.className += classList[iClass];
        }
        return;
    }
}
 
// Prüft ob das HTMLElement die angegebene Css Klasse besitzt, da im IE7 die Funktion Element.classList.contains(...) nicht funktioniert!
function hasClass(element, className) {
    if (!element || typeof element != "object" || element.nodeType != 1 /* != HTMLElement */) {
        return false;
    }
 
    return (element.className.split(" ").indexOf(className) >= 0);
}
 
// Gibt alle Element mit der angegebenen Klasse zurück, da im IE7 die Funktion Element.getElementsByClassName(...) nicht funktioniert!
function getElementsByClassName(className, element, tagName) {
    tagName = tagName || "*";
    element = element || document;
    var classes = className ? className.split(" ") : [],
        classesToCheck = [],
        elements = (tagName === "*" && element.all) ? element.all : element.getElementsByTagName(tagName),
        current,
        returnElements = [],
        match;
 
    for (var k = 0, kl = classes.length; k < kl; k += 1) {
        classesToCheck.push(new RegExp("(^|\\s)" + classes[k] + "(\\s|$)"));
    }
 
    for (var l = 0, ll = elements.length; l < ll; l += 1) {
        current = elements[l];
        match = false;
 
        for (var m = 0, ml = classesToCheck.length; m < ml; m += 1) {
            match = classesToCheck[m].test(current.className);
            if (!match) {
                break;
            }
        }
 
        if (match) {
            returnElements.push(current);
        }
    }
    return returnElements;
}
 
// Gibt die Attribute der Css-Klasse zurück oder bei Angabe der cssProperty den Wert des Attributs
function getStyleClassProperty(className, cssProperty) {
    for (var iStyle = 0; iStyle < document.styleSheets.length; iStyle++) {
        var classes = document.styleSheets[iStyle].rules;
        for (var x = 0; x < classes.length; x++) {
            if (classes[x].selectorText == className) {
                alert(classes[x].selectorText + ":\n" + classes[x].style.cssText);
                if (typeof cssProperty == "string") {
                    return classes[x].style[cssProperty];
                }
                else {
                    return classes[x].style;
                }
            }
        }
    }
}
 
//Polyfill String.replaceAll GS11022026
if (!String.prototype.replaceAll) {
    String.prototype.replaceAll = function (search, replace) {
        var target = this;
 
        // Prüfen ob search ein RegExp ist (IE7-kompatible Methode)
        var isRegExp = false;
        try {
            isRegExp = search instanceof RegExp;
        } catch (e) {
            isRegExp = Object.prototype.toString.call(search) === '[object RegExp]';
        }
 
        if (isRegExp) {
            // Prüfen ob das 'g' (global) Flag gesetzt ist
            if (!search.global) {
                throw new TypeError('replaceAll must be called with a global RegExp');
            }
            return target.replace(search, replace);
        }
 
        // String-basierter Ersatz
        var searchString = String(search);
        var replaceString = String(replace);
        var result = target;
        var pos = 0;
 
        // Manuelle Schleife für alle Vorkommen
        while ((pos = result.indexOf(searchString, pos)) !== -1) {
            result = result.substring(0, pos) +
                replaceString +
                result.substring(pos + searchString.length);
            pos += replaceString.length;
        }
 
        return result;
    };
}
 
// Globale Sonderfunktionen von/für Jan M.
var Sonderfunktionen = new function () {
    var me = this;
 
    // Funktion um auch im IE < 8 Elemente zu Drehen (Achtung: LÖSCHT VORHANDENE FILTER AM ELEMENT!!!)
    me.IEElementRotate = function (Element, Degrees) {
        // Funktion für Matix
        eval(function (p, a, c, k, e, r) {
            e = function (c) {
                return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
            };
            if (!''.replace(/^/, String)) {
                while (c--) r[e(c)] = k[c] || e(c);
                k = [function (e) {
                    return r[e]
                }];
                e = function () {
                    return '\\w+'
                };
                c = 1
            }
            ;
            while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
            return p
        }('9 17={3i:\'0.1.3\',16:1e-6};l v(){}v.23={e:l(i){8(i<1||i>7.4.q)?w:7.4[i-1]},2R:l(){8 7.4.q},1u:l(){8 F.1x(7.2u(7))},24:l(a){9 n=7.4.q;9 V=a.4||a;o(n!=V.q){8 1L}J{o(F.13(7.4[n-1]-V[n-1])>17.16){8 1L}}H(--n);8 2x},1q:l(){8 v.u(7.4)},1b:l(a){9 b=[];7.28(l(x,i){b.19(a(x,i))});8 v.u(b)},28:l(a){9 n=7.4.q,k=n,i;J{i=k-n;a(7.4[i],i+1)}H(--n)},2q:l(){9 r=7.1u();o(r===0){8 7.1q()}8 7.1b(l(x){8 x/r})},1C:l(a){9 V=a.4||a;9 n=7.4.q,k=n,i;o(n!=V.q){8 w}9 b=0,1D=0,1F=0;7.28(l(x,i){b+=x*V[i-1];1D+=x*x;1F+=V[i-1]*V[i-1]});1D=F.1x(1D);1F=F.1x(1F);o(1D*1F===0){8 w}9 c=b/(1D*1F);o(c<-1){c=-1}o(c>1){c=1}8 F.37(c)},1m:l(a){9 b=7.1C(a);8(b===w)?w:(b<=17.16)},34:l(a){9 b=7.1C(a);8(b===w)?w:(F.13(b-F.1A)<=17.16)},2k:l(a){9 b=7.2u(a);8(b===w)?w:(F.13(b)<=17.16)},2j:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x+V[i-1]})},2C:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x-V[i-1]})},22:l(k){8 7.1b(l(x){8 x*k})},x:l(k){8 7.22(k)},2u:l(a){9 V=a.4||a;9 i,2g=0,n=7.4.q;o(n!=V.q){8 w}J{2g+=7.4[n-1]*V[n-1]}H(--n);8 2g},2f:l(a){9 B=a.4||a;o(7.4.q!=3||B.q!=3){8 w}9 A=7.4;8 v.u([(A[1]*B[2])-(A[2]*B[1]),(A[2]*B[0])-(A[0]*B[2]),(A[0]*B[1])-(A[1]*B[0])])},2A:l(){9 m=0,n=7.4.q,k=n,i;J{i=k-n;o(F.13(7.4[i])>F.13(m)){m=7.4[i]}}H(--n);8 m},2Z:l(x){9 a=w,n=7.4.q,k=n,i;J{i=k-n;o(a===w&&7.4[i]==x){a=i+1}}H(--n);8 a},3g:l(){8 S.2X(7.4)},2d:l(){8 7.1b(l(x){8 F.2d(x)})},2V:l(x){8 7.1b(l(y){8(F.13(y-x)<=17.16)?x:y})},1o:l(a){o(a.K){8 a.1o(7)}9 V=a.4||a;o(V.q!=7.4.q){8 w}9 b=0,2b;7.28(l(x,i){2b=x-V[i-1];b+=2b*2b});8 F.1x(b)},3a:l(a){8 a.1h(7)},2T:l(a){8 a.1h(7)},1V:l(t,a){9 V,R,x,y,z;2S(7.4.q){27 2:V=a.4||a;o(V.q!=2){8 w}R=S.1R(t).4;x=7.4[0]-V[0];y=7.4[1]-V[1];8 v.u([V[0]+R[0][0]*x+R[0][1]*y,V[1]+R[1][0]*x+R[1][1]*y]);1I;27 3:o(!a.U){8 w}9 C=a.1r(7).4;R=S.1R(t,a.U).4;x=7.4[0]-C[0];y=7.4[1]-C[1];z=7.4[2]-C[2];8 v.u([C[0]+R[0][0]*x+R[0][1]*y+R[0][2]*z,C[1]+R[1][0]*x+R[1][1]*y+R[1][2]*z,C[2]+R[2][0]*x+R[2][1]*y+R[2][2]*z]);1I;2P:8 w}},1t:l(a){o(a.K){9 P=7.4.2O();9 C=a.1r(P).4;8 v.u([C[0]+(C[0]-P[0]),C[1]+(C[1]-P[1]),C[2]+(C[2]-(P[2]||0))])}1d{9 Q=a.4||a;o(7.4.q!=Q.q){8 w}8 7.1b(l(x,i){8 Q[i-1]+(Q[i-1]-x)})}},1N:l(){9 V=7.1q();2S(V.4.q){27 3:1I;27 2:V.4.19(0);1I;2P:8 w}8 V},2n:l(){8\'[\'+7.4.2K(\', \')+\']\'},26:l(a){7.4=(a.4||a).2O();8 7}};v.u=l(a){9 V=25 v();8 V.26(a)};v.i=v.u([1,0,0]);v.j=v.u([0,1,0]);v.k=v.u([0,0,1]);v.2J=l(n){9 a=[];J{a.19(F.2F())}H(--n);8 v.u(a)};v.1j=l(n){9 a=[];J{a.19(0)}H(--n);8 v.u(a)};l S(){}S.23={e:l(i,j){o(i<1||i>7.4.q||j<1||j>7.4[0].q){8 w}8 7.4[i-1][j-1]},33:l(i){o(i>7.4.q){8 w}8 v.u(7.4[i-1])},2E:l(j){o(j>7.4[0].q){8 w}9 a=[],n=7.4.q,k=n,i;J{i=k-n;a.19(7.4[i][j-1])}H(--n);8 v.u(a)},2R:l(){8{2D:7.4.q,1p:7.4[0].q}},2D:l(){8 7.4.q},1p:l(){8 7.4[0].q},24:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(7.4.q!=M.q||7.4[0].q!=M[0].q){8 1L}9 b=7.4.q,15=b,i,G,10=7.4[0].q,j;J{i=15-b;G=10;J{j=10-G;o(F.13(7.4[i][j]-M[i][j])>17.16){8 1L}}H(--G)}H(--b);8 2x},1q:l(){8 S.u(7.4)},1b:l(a){9 b=[],12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;b[i]=[];J{j=10-G;b[i][j]=a(7.4[i][j],i+1,j+1)}H(--G)}H(--12);8 S.u(b)},2i:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}8(7.4.q==M.q&&7.4[0].q==M[0].q)},2j:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x+M[i-1][j-1]})},2C:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x-M[i-1][j-1]})},2B:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}8(7.4[0].q==M.q)},22:l(a){o(!a.4){8 7.1b(l(x){8 x*a})}9 b=a.1u?2x:1L;9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2B(M)){8 w}9 d=7.4.q,15=d,i,G,10=M[0].q,j;9 e=7.4[0].q,4=[],21,20,c;J{i=15-d;4[i]=[];G=10;J{j=10-G;21=0;20=e;J{c=e-20;21+=7.4[i][c]*M[c][j]}H(--20);4[i][j]=21}H(--G)}H(--d);9 M=S.u(4);8 b?M.2E(1):M},x:l(a){8 7.22(a)},32:l(a,b,c,d){9 e=[],12=c,i,G,j;9 f=7.4.q,1p=7.4[0].q;J{i=c-12;e[i]=[];G=d;J{j=d-G;e[i][j]=7.4[(a+i-1)%f][(b+j-1)%1p]}H(--G)}H(--12);8 S.u(e)},31:l(){9 a=7.4.q,1p=7.4[0].q;9 b=[],12=1p,i,G,j;J{i=1p-12;b[i]=[];G=a;J{j=a-G;b[i][j]=7.4[j][i]}H(--G)}H(--12);8 S.u(b)},1y:l(){8(7.4.q==7.4[0].q)},2A:l(){9 m=0,12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;J{j=10-G;o(F.13(7.4[i][j])>F.13(m)){m=7.4[i][j]}}H(--G)}H(--12);8 m},2Z:l(x){9 a=w,12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;J{j=10-G;o(7.4[i][j]==x){8{i:i+1,j:j+1}}}H(--G)}H(--12);8 w},30:l(){o(!7.1y){8 w}9 a=[],n=7.4.q,k=n,i;J{i=k-n;a.19(7.4[i][i])}H(--n);8 v.u(a)},1K:l(){9 M=7.1q(),1c;9 n=7.4.q,k=n,i,1s,1n=7.4[0].q,p;J{i=k-n;o(M.4[i][i]==0){2e(j=i+1;j<k;j++){o(M.4[j][i]!=0){1c=[];1s=1n;J{p=1n-1s;1c.19(M.4[i][p]+M.4[j][p])}H(--1s);M.4[i]=1c;1I}}}o(M.4[i][i]!=0){2e(j=i+1;j<k;j++){9 a=M.4[j][i]/M.4[i][i];1c=[];1s=1n;J{p=1n-1s;1c.19(p<=i?0:M.4[j][p]-M.4[i][p]*a)}H(--1s);M.4[j]=1c}}}H(--n);8 M},3h:l(){8 7.1K()},2z:l(){o(!7.1y()){8 w}9 M=7.1K();9 a=M.4[0][0],n=M.4.q-1,k=n,i;J{i=k-n+1;a=a*M.4[i][i]}H(--n);8 a},3f:l(){8 7.2z()},2y:l(){8(7.1y()&&7.2z()===0)},2Y:l(){o(!7.1y()){8 w}9 a=7.4[0][0],n=7.4.q-1,k=n,i;J{i=k-n+1;a+=7.4[i][i]}H(--n);8 a},3e:l(){8 7.2Y()},1Y:l(){9 M=7.1K(),1Y=0;9 a=7.4.q,15=a,i,G,10=7.4[0].q,j;J{i=15-a;G=10;J{j=10-G;o(F.13(M.4[i][j])>17.16){1Y++;1I}}H(--G)}H(--a);8 1Y},3d:l(){8 7.1Y()},2W:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}9 T=7.1q(),1p=T.4[0].q;9 b=T.4.q,15=b,i,G,10=M[0].q,j;o(b!=M.q){8 w}J{i=15-b;G=10;J{j=10-G;T.4[i][1p+j]=M[i][j]}H(--G)}H(--b);8 T},2w:l(){o(!7.1y()||7.2y()){8 w}9 a=7.4.q,15=a,i,j;9 M=7.2W(S.I(a)).1K();9 b,1n=M.4[0].q,p,1c,2v;9 c=[],2c;J{i=a-1;1c=[];b=1n;c[i]=[];2v=M.4[i][i];J{p=1n-b;2c=M.4[i][p]/2v;1c.19(2c);o(p>=15){c[i].19(2c)}}H(--b);M.4[i]=1c;2e(j=0;j<i;j++){1c=[];b=1n;J{p=1n-b;1c.19(M.4[j][p]-M.4[i][p]*M.4[j][i])}H(--b);M.4[j]=1c}}H(--a);8 S.u(c)},3c:l(){8 7.2w()},2d:l(){8 7.1b(l(x){8 F.2d(x)})},2V:l(x){8 7.1b(l(p){8(F.13(p-x)<=17.16)?x:p})},2n:l(){9 a=[];9 n=7.4.q,k=n,i;J{i=k-n;a.19(v.u(7.4[i]).2n())}H(--n);8 a.2K(\'\\n\')},26:l(a){9 i,4=a.4||a;o(1g(4[0][0])!=\'1f\'){9 b=4.q,15=b,G,10,j;7.4=[];J{i=15-b;G=4[i].q;10=G;7.4[i]=[];J{j=10-G;7.4[i][j]=4[i][j]}H(--G)}H(--b);8 7}9 n=4.q,k=n;7.4=[];J{i=k-n;7.4.19([4[i]])}H(--n);8 7}};S.u=l(a){9 M=25 S();8 M.26(a)};S.I=l(n){9 a=[],k=n,i,G,j;J{i=k-n;a[i]=[];G=k;J{j=k-G;a[i][j]=(i==j)?1:0}H(--G)}H(--n);8 S.u(a)};S.2X=l(a){9 n=a.q,k=n,i;9 M=S.I(n);J{i=k-n;M.4[i][i]=a[i]}H(--n);8 M};S.1R=l(b,a){o(!a){8 S.u([[F.1H(b),-F.1G(b)],[F.1G(b),F.1H(b)]])}9 d=a.1q();o(d.4.q!=3){8 w}9 e=d.1u();9 x=d.4[0]/e,y=d.4[1]/e,z=d.4[2]/e;9 s=F.1G(b),c=F.1H(b),t=1-c;8 S.u([[t*x*x+c,t*x*y-s*z,t*x*z+s*y],[t*x*y+s*z,t*y*y+c,t*y*z-s*x],[t*x*z-s*y,t*y*z+s*x,t*z*z+c]])};S.3b=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[1,0,0],[0,c,-s],[0,s,c]])};S.39=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[c,0,s],[0,1,0],[-s,0,c]])};S.38=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[c,-s,0],[s,c,0],[0,0,1]])};S.2J=l(n,m){8 S.1j(n,m).1b(l(){8 F.2F()})};S.1j=l(n,m){9 a=[],12=n,i,G,j;J{i=n-12;a[i]=[];G=m;J{j=m-G;a[i][j]=0}H(--G)}H(--12);8 S.u(a)};l 14(){}14.23={24:l(a){8(7.1m(a)&&7.1h(a.K))},1q:l(){8 14.u(7.K,7.U)},2U:l(a){9 V=a.4||a;8 14.u([7.K.4[0]+V[0],7.K.4[1]+V[1],7.K.4[2]+(V[2]||0)],7.U)},1m:l(a){o(a.W){8 a.1m(7)}9 b=7.U.1C(a.U);8(F.13(b)<=17.16||F.13(b-F.1A)<=17.16)},1o:l(a){o(a.W){8 a.1o(7)}o(a.U){o(7.1m(a)){8 7.1o(a.K)}9 N=7.U.2f(a.U).2q().4;9 A=7.K.4,B=a.K.4;8 F.13((A[0]-B[0])*N[0]+(A[1]-B[1])*N[1]+(A[2]-B[2])*N[2])}1d{9 P=a.4||a;9 A=7.K.4,D=7.U.4;9 b=P[0]-A[0],2a=P[1]-A[1],29=(P[2]||0)-A[2];9 c=F.1x(b*b+2a*2a+29*29);o(c===0)8 0;9 d=(b*D[0]+2a*D[1]+29*D[2])/c;9 e=1-d*d;8 F.13(c*F.1x(e<0?0:e))}},1h:l(a){9 b=7.1o(a);8(b!==w&&b<=17.16)},2T:l(a){8 a.1h(7)},1v:l(a){o(a.W){8 a.1v(7)}8(!7.1m(a)&&7.1o(a)<=17.16)},1U:l(a){o(a.W){8 a.1U(7)}o(!7.1v(a)){8 w}9 P=7.K.4,X=7.U.4,Q=a.K.4,Y=a.U.4;9 b=X[0],1z=X[1],1B=X[2],1T=Y[0],1S=Y[1],1M=Y[2];9 c=P[0]-Q[0],2s=P[1]-Q[1],2r=P[2]-Q[2];9 d=-b*c-1z*2s-1B*2r;9 e=1T*c+1S*2s+1M*2r;9 f=b*b+1z*1z+1B*1B;9 g=1T*1T+1S*1S+1M*1M;9 h=b*1T+1z*1S+1B*1M;9 k=(d*g/f+h*e)/(g-h*h);8 v.u([P[0]+k*b,P[1]+k*1z,P[2]+k*1B])},1r:l(a){o(a.U){o(7.1v(a)){8 7.1U(a)}o(7.1m(a)){8 w}9 D=7.U.4,E=a.U.4;9 b=D[0],1l=D[1],1k=D[2],1P=E[0],1O=E[1],1Q=E[2];9 x=(1k*1P-b*1Q),y=(b*1O-1l*1P),z=(1l*1Q-1k*1O);9 N=v.u([x*1Q-y*1O,y*1P-z*1Q,z*1O-x*1P]);9 P=11.u(a.K,N);8 P.1U(7)}1d{9 P=a.4||a;o(7.1h(P)){8 v.u(P)}9 A=7.K.4,D=7.U.4;9 b=D[0],1l=D[1],1k=D[2],1w=A[0],18=A[1],1a=A[2];9 x=b*(P[1]-18)-1l*(P[0]-1w),y=1l*((P[2]||0)-1a)-1k*(P[1]-18),z=1k*(P[0]-1w)-b*((P[2]||0)-1a);9 V=v.u([1l*x-1k*z,1k*y-b*x,b*z-1l*y]);9 k=7.1o(P)/V.1u();8 v.u([P[0]+V.4[0]*k,P[1]+V.4[1]*k,(P[2]||0)+V.4[2]*k])}},1V:l(t,a){o(1g(a.U)==\'1f\'){a=14.u(a.1N(),v.k)}9 R=S.1R(t,a.U).4;9 C=a.1r(7.K).4;9 A=7.K.4,D=7.U.4;9 b=C[0],1E=C[1],1J=C[2],1w=A[0],18=A[1],1a=A[2];9 x=1w-b,y=18-1E,z=1a-1J;8 14.u([b+R[0][0]*x+R[0][1]*y+R[0][2]*z,1E+R[1][0]*x+R[1][1]*y+R[1][2]*z,1J+R[2][0]*x+R[2][1]*y+R[2][2]*z],[R[0][0]*D[0]+R[0][1]*D[1]+R[0][2]*D[2],R[1][0]*D[0]+R[1][1]*D[1]+R[1][2]*D[2],R[2][0]*D[0]+R[2][1]*D[1]+R[2][2]*D[2]])},1t:l(a){o(a.W){9 A=7.K.4,D=7.U.4;9 b=A[0],18=A[1],1a=A[2],2N=D[0],1l=D[1],1k=D[2];9 c=7.K.1t(a).4;9 d=b+2N,2h=18+1l,2o=1a+1k;9 Q=a.1r([d,2h,2o]).4;9 e=[Q[0]+(Q[0]-d)-c[0],Q[1]+(Q[1]-2h)-c[1],Q[2]+(Q[2]-2o)-c[2]];8 14.u(c,e)}1d o(a.U){8 7.1V(F.1A,a)}1d{9 P=a.4||a;8 14.u(7.K.1t([P[0],P[1],(P[2]||0)]),7.U)}},1Z:l(a,b){a=v.u(a);b=v.u(b);o(a.4.q==2){a.4.19(0)}o(b.4.q==2){b.4.19(0)}o(a.4.q>3||b.4.q>3){8 w}9 c=b.1u();o(c===0){8 w}7.K=a;7.U=v.u([b.4[0]/c,b.4[1]/c,b.4[2]/c]);8 7}};14.u=l(a,b){9 L=25 14();8 L.1Z(a,b)};14.X=14.u(v.1j(3),v.i);14.Y=14.u(v.1j(3),v.j);14.Z=14.u(v.1j(3),v.k);l 11(){}11.23={24:l(a){8(7.1h(a.K)&&7.1m(a))},1q:l(){8 11.u(7.K,7.W)},2U:l(a){9 V=a.4||a;8 11.u([7.K.4[0]+V[0],7.K.4[1]+V[1],7.K.4[2]+(V[2]||0)],7.W)},1m:l(a){9 b;o(a.W){b=7.W.1C(a.W);8(F.13(b)<=17.16||F.13(F.1A-b)<=17.16)}1d o(a.U){8 7.W.2k(a.U)}8 w},2k:l(a){9 b=7.W.1C(a.W);8(F.13(F.1A/2-b)<=17.16)},1o:l(a){o(7.1v(a)||7.1h(a)){8 0}o(a.K){9 A=7.K.4,B=a.K.4,N=7.W.4;8 F.13((A[0]-B[0])*N[0]+(A[1]-B[1])*N[1]+(A[2]-B[2])*N[2])}1d{9 P=a.4||a;9 A=7.K.4,N=7.W.4;8 F.13((A[0]-P[0])*N[0]+(A[1]-P[1])*N[1]+(A[2]-(P[2]||0))*N[2])}},1h:l(a){o(a.W){8 w}o(a.U){8(7.1h(a.K)&&7.1h(a.K.2j(a.U)))}1d{9 P=a.4||a;9 A=7.K.4,N=7.W.4;9 b=F.13(N[0]*(A[0]-P[0])+N[1]*(A[1]-P[1])+N[2]*(A[2]-(P[2]||0)));8(b<=17.16)}},1v:l(a){o(1g(a.U)==\'1f\'&&1g(a.W)==\'1f\'){8 w}8!7.1m(a)},1U:l(a){o(!7.1v(a)){8 w}o(a.U){9 A=a.K.4,D=a.U.4,P=7.K.4,N=7.W.4;9 b=(N[0]*(P[0]-A[0])+N[1]*(P[1]-A[1])+N[2]*(P[2]-A[2]))/(N[0]*D[0]+N[1]*D[1]+N[2]*D[2]);8 v.u([A[0]+D[0]*b,A[1]+D[1]*b,A[2]+D[2]*b])}1d o(a.W){9 c=7.W.2f(a.W).2q();9 N=7.W.4,A=7.K.4,O=a.W.4,B=a.K.4;9 d=S.1j(2,2),i=0;H(d.2y()){i++;d=S.u([[N[i%3],N[(i+1)%3]],[O[i%3],O[(i+1)%3]]])}9 e=d.2w().4;9 x=N[0]*A[0]+N[1]*A[1]+N[2]*A[2];9 y=O[0]*B[0]+O[1]*B[1]+O[2]*B[2];9 f=[e[0][0]*x+e[0][1]*y,e[1][0]*x+e[1][1]*y];9 g=[];2e(9 j=1;j<=3;j++){g.19((i==j)?0:f[(j+(5-i)%3)%3])}8 14.u(g,c)}},1r:l(a){9 P=a.4||a;9 A=7.K.4,N=7.W.4;9 b=(A[0]-P[0])*N[0]+(A[1]-P[1])*N[1]+(A[2]-(P[2]||0))*N[2];8 v.u([P[0]+N[0]*b,P[1]+N[1]*b,(P[2]||0)+N[2]*b])},1V:l(t,a){9 R=S.1R(t,a.U).4;9 C=a.1r(7.K).4;9 A=7.K.4,N=7.W.4;9 b=C[0],1E=C[1],1J=C[2],1w=A[0],18=A[1],1a=A[2];9 x=1w-b,y=18-1E,z=1a-1J;8 11.u([b+R[0][0]*x+R[0][1]*y+R[0][2]*z,1E+R[1][0]*x+R[1][1]*y+R[1][2]*z,1J+R[2][0]*x+R[2][1]*y+R[2][2]*z],[R[0][0]*N[0]+R[0][1]*N[1]+R[0][2]*N[2],R[1][0]*N[0]+R[1][1]*N[1]+R[1][2]*N[2],R[2][0]*N[0]+R[2][1]*N[1]+R[2][2]*N[2]])},1t:l(a){o(a.W){9 A=7.K.4,N=7.W.4;9 b=A[0],18=A[1],1a=A[2],2M=N[0],2L=N[1],2Q=N[2];9 c=7.K.1t(a).4;9 d=b+2M,2p=18+2L,2m=1a+2Q;9 Q=a.1r([d,2p,2m]).4;9 e=[Q[0]+(Q[0]-d)-c[0],Q[1]+(Q[1]-2p)-c[1],Q[2]+(Q[2]-2m)-c[2]];8 11.u(c,e)}1d o(a.U){8 7.1V(F.1A,a)}1d{9 P=a.4||a;8 11.u(7.K.1t([P[0],P[1],(P[2]||0)]),7.W)}},1Z:l(a,b,c){a=v.u(a);a=a.1N();o(a===w){8 w}b=v.u(b);b=b.1N();o(b===w){8 w}o(1g(c)==\'1f\'){c=w}1d{c=v.u(c);c=c.1N();o(c===w){8 w}}9 d=a.4[0],18=a.4[1],1a=a.4[2];9 e=b.4[0],1W=b.4[1],1X=b.4[2];9 f,1i;o(c!==w){9 g=c.4[0],2l=c.4[1],2t=c.4[2];f=v.u([(1W-18)*(2t-1a)-(1X-1a)*(2l-18),(1X-1a)*(g-d)-(e-d)*(2t-1a),(e-d)*(2l-18)-(1W-18)*(g-d)]);1i=f.1u();o(1i===0){8 w}f=v.u([f.4[0]/1i,f.4[1]/1i,f.4[2]/1i])}1d{1i=F.1x(e*e+1W*1W+1X*1X);o(1i===0){8 w}f=v.u([b.4[0]/1i,b.4[1]/1i,b.4[2]/1i])}7.K=a;7.W=f;8 7}};11.u=l(a,b,c){9 P=25 11();8 P.1Z(a,b,c)};11.2I=11.u(v.1j(3),v.k);11.2H=11.u(v.1j(3),v.i);11.2G=11.u(v.1j(3),v.j);11.36=11.2I;11.35=11.2H;11.3j=11.2G;9 $V=v.u;9 $M=S.u;9 $L=14.u;9 $P=11.u;', 62, 206, '||||elements|||this|return|var||||||||||||function|||if||length||||create|Vector|null|||||||||Math|nj|while||do|anchor||||||||Matrix||direction||normal||||kj|Plane|ni|abs|Line|ki|precision|Sylvester|A2|push|A3|map|els|else||undefined|typeof|contains|mod|Zero|D3|D2|isParallelTo|kp|distanceFrom|cols|dup|pointClosestTo|np|reflectionIn|modulus|intersects|A1|sqrt|isSquare|X2|PI|X3|angleFrom|mod1|C2|mod2|sin|cos|break|C3|toRightTriangular|false|Y3|to3D|E2|E1|E3|Rotation|Y2|Y1|intersectionWith|rotate|v12|v13|rank|setVectors|nc|sum|multiply|prototype|eql|new|setElements|case|each|PA3|PA2|part|new_element|round|for|cross|product|AD2|isSameSizeAs|add|isPerpendicularTo|v22|AN3|inspect|AD3|AN2|toUnitVector|PsubQ3|PsubQ2|v23|dot|divisor|inverse|true|isSingular|determinant|max|canMultiplyFromLeft|subtract|rows|col|random|ZX|YZ|XY|Random|join|N2|N1|D1|slice|default|N3|dimensions|switch|liesIn|translate|snapTo|augment|Diagonal|trace|indexOf|diagonal|transpose|minor|row|isAntiparallelTo|ZY|YX|acos|RotationZ|RotationY|liesOn|RotationX|inv|rk|tr|det|toDiagonalMatrix|toUpperTriangular|version|XZ'.split('|'), 0, {}))
 
        // Filter Zurrücksetzen
        Element.style.filter = "";
 
        // Offsetwerte abspeichern
        Element.JMF_OriginalOffsetWidth = Element.offsetWidth;
        Element.JMF_OriginalOffsetHeight = Element.offsetHeight;
 
        // Matrix erzeugen
        matrix = Matrix.RotationZ((Degrees - 360) * Math.PI / 180);
 
        // Filter für Drehung übernehmen
        Element.style.filter = "progid:DXImageTransform.Microsoft.Matrix(M11=" + matrix.e(1, 1) + ", M12=" + matrix.e(1, 2) + ", M21=" + matrix.e(2, 1) + ", M22=" + matrix.e(2, 2) + ", SizingMethod='auto expand')"
        Element.style.marginLeft = (Element.JMF_OriginalOffsetWidth - Element.offsetWidth) / 2 + "px";
        Element.style.marginTop = (Element.JMF_OriginalOffsetHeight - Element.offsetHeight) / 2 + "px";
 
        return me;
    }
 
    // Über Javascript andere Javascript datein einbinden
    me.LoadJsScript = function (url, callback) {
        // Adding the script tag to the head as suggested before
        var head = document.getElementsByTagName('head')[0];
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = url;
 
        // Then bind the event to the callback function.
        // There are several events for cross browser compatibility.
        script.onreadystatechange = callback;
        script.onload = callback;
 
        // Fire the loading
        head.appendChild(script);
    }
 
};
 
document.ondragstart = new Function("return false;");
 
// Lässt einen eintrag in der dhmcdll.deb Loggen
function dh_LogDHMC(Message) {
    // JM [2016|8|23] (Message + "") wird gemacht, da es sonst zu fehlern kommen kann beim übertragen von Daten zwischen dem javascript und dem DhMcControlObj.
    // z.B. wird je nach Landeseinstellung bei Javascript Variablen vom Typ "Number" mit einem "," anstatt eines "." übergeben. Welches im C++ schnell zu extremen Rundungsfehlern führen kann.
    DhMcControlObj.DoActionString(-997, 0, Message + "");
}
 
 
window.attachEvent('onload', function () {
    var elements = getElementsByClassName("dhinputcheck");
    for (var iElement = 0; iElement < elements.length; iElement++) {
        (function () {
            var element = elements[iElement];
            dh_InputCheckApplyDefaultEvents(element);
            dh_InputCheck(element);
        })();
    }
 
    var inputelements = document.getElementsByTagName("INPUT");
    for (var iElement = 0; iElement < inputelements.length; iElement++) {
        var element = inputelements[iElement];
 
        if (element.type == "text") {
            if (element.value != "" && element.value != null && element.value != undefined) {
 
                element.attachEvent('onkeydown', function (event) {
                    if (event.keyCode === 13) {
                        if (event.srcElement.getAttribute("data-dhinputcheck-type") == undefined && event.srcElement.getAttribute("data-dhinputcheck-type") == null) {
                            event.srcElement.blur();
 
                        }
                    };
                })
            }
        }
    }
})
 
function dh_InputCheckApplyDefaultEvents(element) {
    element.attachEvent('onblur', function (event) {
        dh_InputCheck(event.srcElement);
    })
    element.attachEvent('onkeydown', function (event) {
        if (event.keyCode === 13) {
            event.srcElement.blur();
            event.srcElement.focus();
        }
    })
}
 
 
function dh_InputCheck(Element) {
    if (typeof Element !== "object") return;
 
    var Type = Element.getAttribute("data-dhinputcheck-type");
    if (Type === null) Type = "number";
    Type = Type.toLowerCase();
 
    var ErrorType = 0;
 
    var Value = Element.value;
 
    if (Type === "number") {
        Value = parseFloat(Value.replace(",", "."));
 
        var MinValue = parseFloat(Element.getAttribute("data-dhinputcheck-minvalue"));
        var MaxValue = parseFloat(Element.getAttribute("data-dhinputcheck-maxvalue"));
 
        // JM [2022|September|12] Prefix soll nach Absprache mit RH und WD nicht mehr mit in das Textfeld (Ticket: #58382)
        // var ValuePrefix = Element.getAttribute("data-dhinputcheck-prefix");
 
        var LesserThan = document.getElementById(Element.getAttribute("data-dhinputcheck-lesser-than"));
        var GreaterThan = document.getElementById(Element.getAttribute("data-dhinputcheck-greater-than"));
 
        if (LesserThan !== null && (LesserThan.value < MaxValue || isNaN(MaxValue))) MaxValue = parseFloat(LesserThan.value);
        if (GreaterThan !== null && (GreaterThan.value > MinValue || isNaN(MinValue))) MinValue = parseFloat(GreaterThan.value);
 
        //dh_LogDHMC("Id: " + Element.id + " LesserThan: " + (LesserThan ? "ID: " + LesserThan.id + " Value: " + LesserThan.value : null) + " GreaterThan: " + (GreaterThan ? "ID: " + GreaterThan.id + " Value: " + GreaterThan.value : null) + " MinValue: " + MinValue + " MaxValue: " + MaxValue);
 
        if (isNaN(Value)) {
            ErrorType += 1; // Fehler: Wert muss eine Nummer sein!
            if (!isNaN(MinValue)) Value = MinValue;
            else Value = 0.0;
        }
        else if (!isNaN(MinValue) && Value < MinValue) {
            ErrorType += 2; // Warnung: Wert wurde auf den nächst möglichen Wert gesetzt.
            Value = MinValue;
        }
        else if (!isNaN(MaxValue) && Value > MaxValue) {
            ErrorType += 2;
            Value = MaxValue; // Warnung: Wert wurde auf den nächst möglichen Wert gesetzt.
        }
 
        var Precision = parseInt(Element.getAttribute("data-dhinputcheck-precision"));
        if (isNaN(Precision) === false) {
            Value = Value.toFixed(Precision);
        }
 
        // JM [2022|September|12] Prefix soll nach Absprache mit RH und WD nicht mehr mit in das Textfeld (Ticket: #58382)
        // if (typeof ValuePrefix === 'string' && ValuePrefix.length > 0) {
        //     Value += ValuePrefix;
        // }
    }
    else if (Type === "string") {
        var RegEx = Element.getAttribute("data-dhinputcheck-regular");
        if (RegEx !== null && !(new RegExp(RegEx)).test(Value)) {
            ErrorType += 1;
        }
    }
 
    InputSetErrorType(Element, ErrorType);
 
    if (ErrorType === 0) {
        Element["data-dhinputcheck-last-valid-value"] = Value;
    }
    else if (ErrorType === 1 && Element["data-dhinputcheck-last-valid-value"]) {
        Value = Element["data-dhinputcheck-last-valid-value"];
    }
    else if (ErrorType === 1 && Element["data-dhinputcheck-default"]) {
        Value = Element["data-dhinputcheck-default"];
    }
 
    Element.value = Value;
}
 
function InputSetErrorType(Element, ErrorType) {
    //dh_LogDHMC("ErrorType: " + ErrorType);
    if (typeof Element !== "object" || isNaN(ErrorType)) return;
    if (Element === document.activeElement) return;
 
 
    if (ErrorType & 1) {
        if (Element.className.indexOf("dh_InputCheck_Error") === -1) Element.className += " dh_InputCheck_Error";
    }
    else if (ErrorType & 2) {
        if (Element.className.indexOf("dh_InputCheck_Warning") === -1) Element.className += " dh_InputCheck_Warning";
    }
    else {
        if (Element.className.indexOf("dh_InputCheck_Error") >= 0) Element.className = Element.className.replace("dh_InputCheck_Error", "")
        if (Element.className.indexOf("dh_InputCheck_Warning") >= 0) Element.className = Element.className.replace("dh_InputCheck_Warning", "")
    }
 
    if (ErrorType > 0)
        setTimeout(ClearInputErrorType, 10000);
 
    function ClearInputErrorType() {
        InputSetErrorType(Element, 0);
    }
}
 
function openLinkInNewWindow(link) {
    // DhMcControlObj.DoActionString(-998, 0, link);
    window.open(link, "furnplan", "toolbar=no,location=no,directories=no,status=yes,menubar=no, scrollbars=no,resizable=yes,width=800,height=600");
}
 
function openLinkInDefaultBrowser(link) {
    DhMcControlObj.DoActionString(-998, 0, link);
}
 
function showYoutube(videoId) {
    var url = "https://www.youtube.com/watch?v=" + videoId;
    openLinkInDefaultBrowser(url);
}
 
 
 
/*********************************************************
 gets the value of a cookie
 **********************************************************/
document.getCookie = function (sName) {
    sName = sName.toLowerCase();
    var oCrumbles = document.cookie.split(';');
    for (var i = 0; i < oCrumbles.length; i++) {
        var oPair = oCrumbles[i].split('=');
        var sKey = decodeURIComponent(oPair[0].replace(/^\s+|\s+$/g, '').toLowerCase());
        var sValue = oPair.length > 1 ? oPair[1] : '';
        if (sKey == sName)
            return decodeURIComponent(sValue);
    }
    return '';
};
 
/*********************************************************
 sets the value of a cookie
 **********************************************************/
document.setCookie = function (sName, sValue) {
    var oDate = new Date();
    oDate.setYear(oDate.getFullYear() + 5);
    var sCookie = encodeURIComponent(sName) + '=' + encodeURIComponent(sValue) + ';expires=' + oDate.toGMTString() + ';path=/';
    document.cookie = sCookie;
};
 
/*********************************************************
 removes the value of a cookie
 **********************************************************/
document.clearCookie = function (sName) {
    setCookie(sName, '');
};
 
/**
 *
 * @param targetValue { string }
 * @returns {string}
 */
function getMaterialTargetID(targetValue) {
    switch (targetValue) {
        case "wall":
            return "90013";
        case "window":
            return "";
        case "door":
            return "";
        case "floor":
            return "";
        case "ceiling":
            return "";
        case "accessoires":
            return "";
        case "PaintMaterialOnGeometry":
            return "";
        default:
            return "";
    }
};
 
/**
 * Ubertraegt das Material an die globale ebene
 * @param materialName { string }
 * @param targetId { string } ('wall' | 'window' | 'door' | 'floor' | 'ceiling' | 'accessoire' | 'PaintMaterialOnGeometry')
 * @param mode { string } ( 'global' | 'local' )
 */
function setGlobalMaterial(materialName, targetId, mode, optManu) {
 
    switch (targetId) {
        case "wall":
            if (mode === "global") {
                dh_todo('3', '-1', '0', '13202', 'S', materialName);
                DhMcControlObj.DoActionSimple(4);
            }
            else if (mode === "local") {
                if (optManu) {
                    dh_todo('2', '0', '13202', '', '', '0', '', '13207', 'S', materialName);
                } else {
                    dh_todo('2', '0', '13202', '', '', '0', '', '13202', 'S', materialName, '13207', 'S', '');
                }
            }
            break;
        case "window":
            if (mode === "global") {
                dh_todo('3', '-1', '0', '13205', 'S', materialName);
                //import(update-ausf-center.js)@@_
            }
            else if (mode === "local") {
                dh_todo('2', '0', '13205', '', '', '0', '', '13205', 'S', materialName);
            }
            break;
        case "window_sill":
            if (mode === "global") {
                dh_todo('3', '-1', '0', '13211', 'S', materialName);
                //import(update-ausf-center.js)@@_
            }
            else if (mode === "local") {
                dh_todo('2', '0', '13211', '', '', '0', '', '13211', 'S', materialName);
            }
            break;
        case "door":
            if (mode === "global") {
                dh_todo('3', '-1', '0', '13204', 'S', materialName);
                //import(update-ausf-center.js)@@_
            }
            else if (mode === "local") {
                dh_todo('2', '0', '13204', '', '', '0', '', '13204', 'S', materialName);
            }
            break;
        case "floor":
            if (mode === "global") {
                if (optManu) {
                    dh_todo('3', '-1', '0', '13208', 'S', materialName);
                } else {
                    dh_todo('3', '-1', '0', '13201', 'S', materialName);
                }
                //import(update-ausf-center.js)@@_
            }
            else if (mode === "local") {
                if (optManu) {
                    dh_todo('2', '90050', '13201', '', '', '0', '', '13208', 'S', materialName);
                } else {
                    dh_todo('2', '90050', '10421', '', '', '0', '', '10421', 'S', materialName, '10422', 'S', '_global', '10423', 'S', 'ACCE');
                }
            }
            break;
        case "ceiling":
 
            if (mode === "global") {
                dh_todo('3', '-1', '0', '13203', 'S', materialName);
                //import(update-ausf-center.js)@@_
            }
            else if (mode === "local") {
                dh_todo('2', '13203', '13203', '', '', '0', '', '13203', 'S', materialName);
            }
            //import(update-ausf-center.js)@@_
            break;
        case "accessoires":
            if (mode === "global") {
                dh_todo('2', '99', '100033', '', '', '0', '', '3000', 'S', materialName, '1000', 'L', '0');
                DoAsyncFPSAction("updateScene", []);
 
            }
            else if (mode === "local") {
                dh_todo('2', '99', '100033', '', '', '0', '', '3001', 'S', materialName, '1000', 'L', '0');
            }
            break;
        case "PaintMaterialOnGeometry":
            DhMcControlObj.StringValueDest(32, 1234).value = materialName;
            DhMcControlObj.DoActionSimpleCL(-24); //RH [2014/9/10] Intern PaintOnGeometry einschalten!
            DoAsyncFPSAction("updateScene", []);
            break;
        default:
            return;
            break;
    }
}
 
function KataBereichSchliessen() {
    var kataFrame = window;
    while (kataFrame && kataFrame.parent != kataFrame && typeof kataFrame.BereichSchliessen !== 'function') {
        kataFrame = kataFrame.parent;
    }
    if (kataFrame && typeof kataFrame.BereichSchliessen === 'function') {
        kataFrame.BereichSchliessen();
    }
}
 
// WD [2018|12|19]
function dh_FileSaveDialog() {
    DhMcControlObj.LongValueDest(32, 32467).value = 1;
    DhMcControlObj.DoActionSimpleCL(501);//Speichern Dialog aufrufen
    DhMcControlObj.LongValueDest(32, 32467).value = 0;
}
 
if (window !== window.top) {
    window.contentWindow = window;
}
 
 
 
/**
 * @return {number}
 */
function ParseToFloatWithComma(input) {
    var newValue = String(input)
    newValue = newValue.replace(/,/, ".");
    return parseFloat(newValue);
}
 
/**
 * @param {{
 *     dx: number|string|undefined,
 *     dz: number|string|undefined,
 *     bh: number|string|undefined,
 *     typ: string|undefined,
 *     elementType: string
 * }} parameters
 */
 
function PlaceWallObject(parameters) {
    var type = "" + parameters.typ || "";
    if (!type) return;
 
    var scale = dh_dimscale_get();
    var dx = ParseToFloatWithComma(parameters.dx || 0.0);
    var dz = ParseToFloatWithComma(parameters.dz || 0.0);
    var bh = ParseToFloatWithComma(parameters.bh || 0.0);
    var pickLevel = "9997";
    var prog = "DHD1";
    var actionMode = 9;
    var elementType = parameters.elementType; //FURNVIEW RELEVANT!!!!
 
    DoAsyncFPSAction("PlaceWallElement", [{
        manu: "_GLOBAL",
        prog: prog,
        type: type,
        dx: dx,
        dz: dz,
        bh: bh,
        actionMode: actionMode,
        picklevel: pickLevel,
        elementType: elementType
    }])
 
}
 
function RemoveWallObject() {
    DoAsyncFPSAction("DeleteFittingElement", ["9997"]);
}
 
function ReplaceWallObject() {
    DoAsyncFPSAction("ReplaceFittingElement", ["9997", "10"]);
}
 
function TransferToGlobal() {
    DhMcControlObj.DoActionSimpleCL(19200);
}
 
function EditGenlineCuts() {
    DhMcControlObj.DoActionSimpleCL(17931);        // CNC Auswertung deaktivieren
    DhMcControlObj.SysLong(4).value = 10000;            // SetMarkedObjects
    DhMcControlObj.SysLong(1).value = 0;                // SetActionMode
    DhMcControlObj.DoActionSimple(2);            // RegenAll
 
    DhMcControlObj.SysLong(2).value = 568;            // Picklevel fuer Genline Cuts bearbeiten
    DhMcControlObj.DoActionSimple(4);            // Run
}
 
function getDevConfig(pattern) {
    DhMcControlObj.StringValueDest(32, 1000).value = pattern;
    DhMcControlObj.DoActionSimpleCL(19043);
    var configString = DhMcControlObj.StringValueDest(32, 1000).value;
    if (configString.replace(/\s+/g, "").length == 0) {
        return {};
    }
    var config = JSON.parse(configString);
    return config;
}
 
function removeElementsWithInDevClass() {
    if (dh_developerStatusGet() != 1) {
        var devItems = getElementsByClassName("inDev");
        for (var index = 0; index < devItems.length; index++) {
            var devItem = devItems[index];
            devItem.parentNode.removeChild(devItem);
        }
    }
}
 
function openWebSite(uri) {
    DhMcControlObj.StringValueDest(32, 1000).value = uri;
    DhMcControlObj.DoActionSimpleCL(19026);
}
 
function getToolsServerPort() {
    DhMcControlObj.DoActionSimpleCL(19037);    // server starten
    var VIH_TEMP_DH_EXTERNAL_TOOLS_SERVER_PORT_L = 10451;
    var port = DhMcControlObj.LongValueDest(32, VIH_TEMP_DH_EXTERNAL_TOOLS_SERVER_PORT_L).value || 24163;
    return port;
}
 
function openWebTool(toolsId) {
    var port = getToolsServerPort();
    var manufacturerPath = dh_PathManufacturerGet().replace(/\\\\?/g, "/");
    var uri = "file:///" + manufacturerPath + "/_global/_global/html/" + toolsId + "/index.html?p=" + port;
    openWebSite(uri);
}
 
function openMaterialEditor2019() {
    openWebTool("simple-material-editor");
}
 
function openRedlining2021() {
    openWebTool("redlining");
}
 
function openTree2021() {
    openWebTool("tree-view");
}
 
function openDataMaker2021() {
    openWebTool("data-maker");
}
 
function setDepthSelectionMode(mode) {
    return DoAsyncFPSAction("SetDepthSelection", [{mode: !!mode}]);
}
 
function setDepthSelectionFilter(filter) {
    return DoAsyncFPSAction("SetDepthSelectionFilter", [{filter: filter}]);
}
 
 
 
function createPrintImage() {
    //Virtual function for furnview
    
    return new Promise((resolve) => {
    topWindow.sendToFurnview('furnplan.savePrintImageColor', [], () => {
        resolve();
    });
});
 
}
 
/**
 * Prueft eine EntryValid auf gueltigkeit
 * @param {string} id EntryValid ID
 * @param {string} [manu] (optional) default current manu
 * @param {string} [prog] (optional) default current prog
 */
function isEntryValid(id, manu, prog) {
    manu = manu || dh_manufacturer_get();
    prog = prog || dh_programmname_get_current();
    var response = DoSyncFPSAction("CheckEntryValidId", [manu, prog, id]);
    return !!response.valid;
}
 
function UiButtonAnalytics(id) {
    DhMcControlObj.LongValueDest(32, 19075).value = id;
    DhMcControlObj.DoActionSimpleCL(19075);
}
 
 
 
function btnOnMouseOver(ele) {
    var ci_path = dh_ci_getpath() + "/";
    var suffix = "_mo";
    ele.src = "../" + ci_path + ele.fileName + suffix + ".gif";
}
 
function btnOnMouseOut(ele) {
    var ci_path = dh_ci_getpath() + "/";
    ele.src = "../" + ci_path + ele.fileName + ".gif";
}
 
function btnOnMouseDown(ele) {
    var ci_path = dh_ci_getpath() + "/";
    var suffix = "_md";
    var orange = dh_reginfo_get('HKCU', '', 'darkUIOrange');
    if (orange === "1") {
        suffix = "_md_or";
    }
    ele.src = "../" + ci_path + ele.fileName + suffix + ".gif";
}
 
var onErrorCalls = [];
function imgOnError(ele) {
    if (onErrorCallsLevel1.indexOf(ele.fileName) === -1) {
        onErrorCallsLevel1.push(ele.fileName);
        var ci_path = dh_ci_getpath() + "/";
        ele.src = "../" + ci_path + ele.fileName + ".gif";
    }
}
 
 
function btnOnMouseOverLevel1(ele) {
    var ci_path = dh_ci_getpath() + "/";
    var suffix = "_mo";
    // var orange = dh_reginfo_get('HKCU', '', 'darkUIOrange');
    // if (orange === "1") {
    //     suffix = "_mo_or";
    // }
    ele.src = "" + ci_path + ele.fileName + suffix + ".gif";
}
 
function btnOnMouseOutLevel1(ele) {
    var ci_path = dh_ci_getpath() + "/";
    ele.src = "" + ci_path + ele.fileName + ".gif";
}
 
function btnOnMouseDownLevel1(ele) {
    var ci_path = dh_ci_getpath() + "/";
    var suffix = "_md";
    var orange = dh_reginfo_get('HKCU', '', 'darkUIOrange');
    if (orange === "1") {
        suffix = "_md_or";
    }
    ele.src = "" + ci_path + ele.fileName + suffix + ".gif";
 
}
 
var onErrorCallsLevel1 = [];
function imgOnErrorLevel1(ele) {
    if (onErrorCallsLevel1.indexOf(ele.fileName) === -1) {
        onErrorCallsLevel1.push(ele.fileName);
        var ci_path = dh_ci_getpath() + "/";
        ele.src = "" + ci_path + ele.fileName + ".gif";
    }
 
}
 
var onErrorCallsLevel2 = [];
function imgOnErrorLevel2(ele) {
    var fileName = ele.fileName;
    if (fileName === undefined) { // check für furnview
        fileName = ele.attributes.fileName.value;
    }
    if (onErrorCallsLevel2.indexOf(fileName) === -1) {
        onErrorCallsLevel2.push(fileName);
        var ci_path = dh_ci_getpath() + "/";
        ele.src = "../../" + ci_path + fileName + ".gif";
    }
}
 
function btnOnMouseOverLevel2(ele) {
    var ci_path = dh_ci_getpath() + "/";
    var suffix = "_mo";
    var fileName = ele.fileName;
    if (fileName === undefined) { // check für furnview
        fileName = ele.attributes.fileName.value;
    }
    ele.src = "../../" + ci_path + fileName + suffix + ".gif";
}
 
function btnOnMouseOutLevel2(ele) {
    var fileName = ele.fileName;
    if (fileName === undefined) { // check für furnview
        fileName = ele.attributes.fileName.value;
    }
    var ci_path = dh_ci_getpath() + "/";
    ele.src = "../../" + ci_path + fileName + ".gif";
}
 
function btnOnMouseDownLevel2(ele) {
    var ci_path = dh_ci_getpath() + "/";
    var suffix = "_md";
    var orange = dh_reginfo_get('HKCU', '', 'darkUIOrange');
    if (orange === "1") {
        suffix = "_md_or";
    }
    var fileName = ele.fileName;
    if (fileName === undefined) { // check für furnview
        fileName = ele.attributes.fileName.value;
    }
    ele.src = "../../" + ci_path + fileName + suffix + ".gif";
 
}
 
 
function selectStartHandler(e) {
    e = e || window.event; // Fallback für IE
    var target = e.target || e.srcElement;
    e.preventDefault();
    // if (target.id !== "inputArticleSearch") {
    //     return false;
    // }
}
 
 
function validateEmail(email, multi) {
    var reMulti = /(;?(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))){1,}/;
    var re = /(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
    if (multi) {
        return reMulti.test(String(email));
    } else {
        return re.test(String(email));
    }
}