changed git call from https to git readonly
[atutor.git] / mods / merlot / merlot.js
1
2 function popup(url, name, attributes) {
3     if (url.indexOf('?') != -1) {
4         url += '&_popup=true';
5     } else {
6         url += '?_popup=true';
7     }
8     p=window.open(url, name , attributes);
9     if (p.opener == null) {
10         p.opener = window;
11     }
12     if (window.focus) {
13         p.focus();
14     }
15 }
16
17 function popup_resizeTo( idOfDiv ) {
18         var oH = getRefToDivMod( idOfDiv ); if( !oH ) { return false; }
19         var x = window; x.resizeTo( screen.availWidth, screen.availWidth );
20         var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
21         var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
22         x.resizeTo( oW + 200, oH + 200 );
23         var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
24         if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
25         else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
26         else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
27         if( window.opera && !document.childNodes ) { myW += 16; }
28         //second sample, as the table may have resized
29         var oH2 = getRefToDivMod( idOfDiv );
30         var oW2 = oH2.clip ? oH2.clip.width : oH2.offsetWidth;
31         var oH2 = oH2.clip ? oH2.clip.height : oH2.offsetHeight;
32         x.resizeTo( oW2 + ( ( oW + 200 ) - myW ), oH2 + ( (oH + 200 ) - myH ) );
33 }
34
35
36
37 function popup_close(refreshOpener) {
38     if (window.opener) {
39        if (refreshOpener) {
40           setTimeout("window.opener.location.reload()", 900);
41        }
42        setTimeout("window.close()",1100);
43     }
44 }
45
46
47 function getRefToDivMod( divID, oDoc ) {
48         if( !oDoc ) { oDoc = document; }
49         if( document.layers ) {
50                 if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
51                         for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
52                                 y = getRefToDivNest(divID,oDoc.layers[x].document); }
53                         return y; } }
54         if( document.getElementById ) { return oDoc.getElementById(divID); }
55         if( document.all ) { return oDoc.all[divID]; }
56         return oDoc[divID];
57 }
58 function testURL(form, inputURL)
59         {
60                 var test=document.forms[form].elements[inputURL].value;
61                 
62                 errorMsg = "The '{0}' field is empty";
63                 errorMsg = errorMsg.split("'")
64                 errorMsg = errorMsg[0] + inputURL + errorMsg[2];
65
66                 if (test=="") alert (errorMsg);
67                 else
68                 {
69                         if (test.indexOf("://") < 0)
70                         {
71                            test= "http://" + test;
72                document.forms[form].elements[inputURL].value = test;
73                         }
74                         newwin = window.open(test, 'newwin', '');
75                 }
76     }
77
78 function testImage(img, form, inputURL)
79         {
80                 var test=document.forms[form].elements[inputURL].value;
81                 
82                 errorMsg = "The " + inputURL + " field is empty";
83
84                 if (test=="") alert (errorMsg);
85                 else
86                 {
87                         if (test.indexOf("://") < 0)
88                         {
89                            test= "http://" + test;
90                document.forms[form].elements[inputURL].value = test;
91                         }
92                         img.src = test;
93                 }
94     }
95
96 function confirmDelete(obj) {
97     var msg = "Are you sure you want to delete this " + obj + "?";
98     ans = confirm(msg);
99     if (ans) {
100         return true;
101     } else {
102         return false;
103     }
104 }
105
106 function deleteItem(formName, itemName, item) {
107     var deleteItemName = "_delete" + itemName;
108     if (confirmDelete(itemName)) {
109         MyForm = document.forms[formName];
110         MyForm.elements[deleteItemName].value = item;
111         MyForm.submit();
112     }
113 }
114
115 function editItem(formName, itemName, item) {
116     var editItemName = "_edit" + itemName;
117     MyForm = document.forms[formName];
118     MyForm.elements[editItemName].value = item;
119     MyForm.submit();
120 }
121
122 function printDate(d){
123         document.writeln(d.substring(7,17));
124 }
125
126 /* This function is used to get cookies */
127 function getCookie(name) {
128     var prefix = name + "="
129     var start = document.cookie.indexOf(prefix)
130
131     if (start==-1) {
132         return null;
133     }
134    
135     var end = document.cookie.indexOf(";", start+prefix.length)
136     if (end==-1) {
137         end=document.cookie.length;
138     }
139
140     var value=document.cookie.substring(start+prefix.length, end)
141     return unescape(value);
142 }
143
144 /* This function is used to delete cookies */
145 function deleteCookie(name,path,domain) {
146   if (getCookie(name)) {
147     document.cookie = name + "=" +
148       ((path) ? "; path=" + path : "") +
149       ((domain) ? "; domain=" + domain : "") +
150       "; expires=Thu, 01-Jan-70 00:00:01 GMT";
151   }
152 }
153
154 function checkLimit(limitField, limitNum) {
155         if (limitField.value.length > limitNum){
156                 alert("You have exceeded the number of characters for this field");
157                 limitField.value = limitField.value.substring(0, limitNum-1);
158         } 
159                 
160 }
161
162 function limitCopy(limitField, limitNum) {
163         if (limitField.value.length > limitNum) limitField.value = limitField.value.substring(0, limitNum);
164 }
165
166 function confirmPost() {
167     if (confirm("Posting this composite review makes it appear on the material detail page and available to the public.  Are you sure you want to continue?")) {
168         return true;
169     } else {
170         return false;
171     }
172 }
173
174 function confirmUnpost() {
175     if (confirm("Unposting this review will put this material back into the workflow process.  Are you sure you want to continue?")) {
176         return true;
177     } else {
178         return false;
179     }
180 }
181
182     function showOther(mySelect, targetId) {
183         var selected = mySelect.options[mySelect.selectedIndex].text;
184         if (selected == 'Other') {
185             if (document.getElementById) {
186                 target = document.getElementById(targetId);
187                 if (target.style.display == "none"){
188                     target.style.display = "";
189                 }
190             }
191         } else {
192             if (document.getElementById) {
193                 target = document.getElementById(targetId);
194                 if (target.style.display != "none"){
195                     target.style.display = "none";
196                 }
197             }
198         }
199     }
200
201 function cat(id, parentId, name) {
202    this.id = id;
203    this.parentId = parentId;
204    this.name = name;
205 }
206
207 var cats = new Array(
208 new cat('','-1','All'),
209
210
211 new cat('2175','','Arts'),
212
213 new cat('2176','2175','Art History'),
214
215 new cat('2177','2175','Cinema'),
216
217 new cat('2178','2175','Dance'),
218
219 new cat('2179','2175','Fine Arts'),
220
221 new cat('2180','2175','General'),
222
223 new cat('2181','2175','Music'),
224
225 new cat('2182','2181','Aural Skill and Ear Training'),
226
227 new cat('2183','2181','Composition'),
228
229 new cat('2184','2181','Music Appreciation'),
230
231 new cat('2185','2181','Music Education'),
232
233 new cat('2186','2181','Music History'),
234
235 new cat('2187','2181','Music Technology'),
236
237 new cat('2188','2181','Performance'),
238
239 new cat('2189','2181','Theory and Analysis'),
240
241 new cat('2190','2181','World Music'),
242
243 new cat('2191','2175','Photography'),
244
245 new cat('2192','2175','Theatre'),
246
247 new cat('2193','2192','Critical Strategies'),
248
249 new cat('2194','2192','Design and Technology'),
250
251 new cat('2195','2192','Management'),
252
253 new cat('2196','2192','Music Theatre and Dance'),
254
255 new cat('2197','2192','Performing'),
256
257 new cat('2198','2192','Playwriting'),
258
259 new cat('2199','2192','Theatre Artists and Companies'),
260
261 new cat('2200','2192','Theatre History'),
262
263 new cat('2201','2192','Theatre for Specific Audiences'),
264
265 new cat('2202','','Business'),
266
267 new cat('2203','2202','Accounting'),
268
269 new cat('2204','2203','Accounting Education'),
270
271 new cat('2213','2203','Tax'),
272
273 new cat('2205','2203','Accounting Information Systems'),
274
275 new cat('2206','2203','Auditing'),
276
277 new cat('2207','2203','Ethics'),
278
279 new cat('2208','2203','Financial'),
280
281 new cat('2209','2203','International'),
282
283 new cat('2210','2203','Introductory'),
284
285 new cat('2211','2203','Managerial'),
286
287 new cat('2212','2203','Not for Profit'),
288
289 new cat('2259','2202','Marketing'),
290
291 new cat('2260','2259','Advertising'),
292
293 new cat('2261','2259','Business Marketing'),
294
295 new cat('2262','2259','Consumer Behavior'),
296
297 new cat('2263','2259','General'),
298
299 new cat('2264','2259','International'),
300
301 new cat('2265','2259','Market Research'),
302
303 new cat('2266','2259','Sales'),
304
305 new cat('2214','2202','Business Law'),
306
307 new cat('2215','2202','E-Commerce'),
308
309 new cat('2216','2202','Economics'),
310
311 new cat('2217','2216','Agricultural and Natural Resources'),
312
313 new cat('2226','2216','Industrial Organization'),
314
315 new cat('2227','2216','International'),
316
317 new cat('2228','2216','Labor and Demographics'),
318
319 new cat('2229','2216','Law and Economics'),
320
321 new cat('2230','2216','Macro'),
322
323 new cat('2231','2216','Mathematical and Quant.'),
324
325 new cat('2232','2216','Micro'),
326
327 new cat('2233','2216','Public'),
328
329 new cat('2234','2216','Urban, Rural and Regional'),
330
331 new cat('2218','2216','Bus Adm and Bus Mktg'),
332
333 new cat('2219','2216','Econometrics'),
334
335 new cat('2220','2216','Economic Development'),
336
337 new cat('2221','2216','Economic Systems'),
338
339 new cat('2222','2216','Financial'),
340
341 new cat('2223','2216','General'),
342
343 new cat('2224','2216','Health, Ed and Welfare'),
344
345 new cat('2225','2216','History of Ec. Thought'),
346
347 new cat('2235','2202','Finance'),
348
349 new cat('2236','2235','Corporate'),
350
351 new cat('2245','2235','Real Estate'),
352
353 new cat('2237','2235','Derivatives'),
354
355 new cat('2238','2235','Financial Institutions'),
356
357 new cat('2239','2235','Financial Markets'),
358
359 new cat('2240','2235','Insurance'),
360
361 new cat('2241','2235','International'),
362
363 new cat('2242','2235','Investments'),
364
365 new cat('2243','2235','Money and Banking'),
366
367 new cat('2244','2235','Personal Finance'),
368
369 new cat('2246','2202','General'),
370
371 new cat('2247','2202','International Business'),
372
373 new cat('227461','2247','Country Information and Geography'),
374
375 new cat('227462','2247','Cross Cultural Management/OB'),
376
377 new cat('227463','2247','Export and International Trade'),
378
379 new cat('227464','2247','Globalization'),
380
381 new cat('227465','2247','Human Resources in a Global Environment'),
382
383 new cat('227466','2247','International Case Studies'),
384
385 new cat('227467','2247','International Finance'),
386
387 new cat('227468','2247','International Marketing'),
388
389 new cat('227469','2247','International Project Management'),
390
391 new cat('227470','2247','Multicultural Issues Diversity'),
392
393 new cat('2248','2202','Management'),
394
395 new cat('2250','2248','Conflict Resolution'),
396
397 new cat('2251','2248','Entrepreneurship'),
398
399 new cat('2252','2248','Ethics'),
400
401 new cat('2253','2248','Human Resources'),
402
403 new cat('2254','2248','International'),
404
405 new cat('2255','2248','Org Behavior and Development'),
406
407 new cat('2256','2248','Production and Oper Mgnt'),
408
409 new cat('2257','2248','Project Management'),
410
411 new cat('2258','2248','Strategy'),
412
413 new cat('2249','2202','Management Information Systems'),
414
415 new cat('2267','','Education'),
416
417 new cat('2268','2267','General'),
418
419 new cat('2269','2267','Library and Information Services'),
420
421 new cat('2270','2269','General'),
422
423 new cat('2271','2269','Information Literacy'),
424
425 new cat('2272','2269','Information Retrieval'),
426
427 new cat('2273','2269','Information Technology'),
428
429 new cat('2274','2269','Issues in Librarianship'),
430
431 new cat('2275','2269','Library Specialties'),
432
433 new cat('2276','2267','TeacherEd'),
434
435 new cat('2277','2276','Classroom Management'),
436
437 new cat('2278','2276','Diversity and Multicultural Ed'),
438
439 new cat('2279','2276','Educational Foundations'),
440
441 new cat('2280','2276','Educational Psychology'),
442
443 new cat('2281','2276','Educational Research'),
444
445 new cat('2282','2276','Instructional Technology'),
446
447 new cat('2283','2276','Special Education'),
448
449 new cat('2284','2276','Student Assessment'),
450
451 new cat('2285','2276','Teaching Methods'),
452
453 new cat('2286','2285','Arts'),
454
455 new cat('2287','2285','English'),
456
457 new cat('2288','2285','Foreign Language'),
458
459 new cat('2289','2285','Mathematics'),
460
461 new cat('2290','2285','Physical Education'),
462
463 new cat('2291','2285','Reading and Language Arts'),
464
465 new cat('2292','2285','Science'),
466
467 new cat('2293','2285','Social Science'),
468
469 new cat('2294','2285','Vocational Education'),
470
471 new cat('2295','2267','Teaching and Technology'),
472
473 new cat('2296','2295','Accessibility'),
474
475 new cat('2298','2295','Assessment and Evaluation'),
476
477 new cat('2299','2295','Best Teaching Practices'),
478
479 new cat('2300','2299','Case Studies'),
480
481 new cat('2301','2299','Cooperative Learning'),
482
483 new cat('2302','2299','Lecture and Presentation'),
484
485 new cat('2303','2299','Multicultural and Diversity'),
486
487 new cat('2304','2299','Online Communications'),
488
489 new cat('2305','2299','Other'),
490
491 new cat('2306','2299','Problem Based Learning'),
492
493 new cat('2307','2299','Service Learning'),
494
495 new cat('2308','2295','Instructional Design'),
496
497 new cat('2309','2295','Policies'),
498
499 new cat('2310','2309','Intellectual Property'),
500
501 new cat('2311','2309','Other'),
502
503 new cat('2312','2295','Scholarship of Teaching and Learning'),
504
505 new cat('2313','2295','Selecting and Using Tools'),
506
507 new cat('2314','2313','Communication Tools'),
508
509 new cat('2315','2313','Course Management Tools'),
510
511 new cat('2316','2315','Angel'),
512
513 new cat('2317','2315','Blackboard'),
514
515 new cat('2318','2315','Desire2Learn'),
516
517 new cat('2319','2315','Other'),
518
519 new cat('2320','2315','WebCT'),
520
521 new cat('2321','2313','Hardware and Networks'),
522
523 new cat('2322','2313','Multimedia Tools'),
524
525 new cat('2323','2313','Other'),
526
527 new cat('2324','2313','Using MERLOT'),
528
529 new cat('2325','2313','Web Page Editors'),
530
531 new cat('2326','2295','Support and Training'),
532
533 new cat('2327','','Humanities'),
534
535 new cat('2328','2327','General'),
536
537 new cat('2329','2327','History'),
538
539 new cat('2330','2329','Area Studies'),
540
541 new cat('2331','2330','Africa'),
542
543 new cat('2332','2331','Central Africa'),
544
545 new cat('2333','2331','East Africa'),
546
547 new cat('2334','2331','North Africa'),
548
549 new cat('2335','2331','Southern Africa'),
550
551 new cat('2336','2331','West Africa'),
552
553 new cat('2337','2330','Americas'),
554
555 new cat('2338','2337','Brazil'),
556
557 new cat('2339','2337','Canada'),
558
559 new cat('2340','2337','Caribbean'),
560
561 new cat('2341','2337','Central America'),
562
563 new cat('2342','2337','Mexico'),
564
565 new cat('2343','2337','South America'),
566
567 new cat('2344','2337','United States'),
568
569 new cat('2345','2344','1789-1865'),
570
571 new cat('2346','2344','1865-1900'),
572
573 new cat('2347','2344','20th Century'),
574
575 new cat('2348','2344','American Revolution'),
576
577 new cat('2349','2344','Civil War'),
578
579 new cat('2350','2344','Colonial'),
580
581 new cat('2351','2344','Pre-Columbian'),
582
583 new cat('2352','2330','Asia'),
584
585 new cat('2353','2352','Central Asia'),
586
587 new cat('2354','2352','China'),
588
589 new cat('2355','2352','Eastern'),
590
591 new cat('2356','2352','Japan'),
592
593 new cat('2357','2352','Korea'),
594
595 new cat('2358','2352','Middle East'),
596
597 new cat('2359','2352','South Asia'),
598
599 new cat('2360','2352','Southeast Asia'),
600
601 new cat('2361','2330','Europe'),
602
603 new cat('2362','2361','Balkans'),
604
605 new cat('2371','2361','Italy'),
606
607 new cat('2372','2361','Northern'),
608
609 new cat('2373','2361','Scandinavia'),
610
611 new cat('2374','2361','Southern'),
612
613 new cat('2375','2361','Western'),
614
615 new cat('2363','2361','Benelux'),
616
617 new cat('2364','2361','Eastern'),
618
619 new cat('2365','2361','European Union'),
620
621 new cat('2366','2361','France'),
622
623 new cat('2367','2361','Germany and Central Europe'),
624
625 new cat('2368','2361','Great Britain and Ireland'),
626
627 new cat('2369','2361','Greece'),
628
629 new cat('2370','2361','Iberia'),
630
631 new cat('2376','2330','Oceania'),
632
633 new cat('2377','2376','Australia'),
634
635 new cat('2378','2376','New Zealand'),
636
637 new cat('2379','2376','Pacific Islands'),
638
639 new cat('2380','2330','World Systems'),
640
641 new cat('2381','2329','Resources'),
642
643 new cat('2382','2381','Document Archives'),
644
645 new cat('2383','2381','Image and Photographic Archives'),
646
647 new cat('2384','2381','Map Archives'),
648
649 new cat('2385','2329','Theory and Method'),
650
651 new cat('2386','2385','Epistemology of History'),
652
653 new cat('2387','2385','Historiography'),
654
655 new cat('2388','2385','History Education'),
656
657 new cat('2389','2385','Methods'),
658
659 new cat('2390','2385','Philosophy of History'),
660
661 new cat('2391','2329','Topical'),
662
663 new cat('2392','2391','African-American'),
664
665 new cat('2401','2391','Genealogy'),
666
667 new cat('2402','2391','Hispanic and Latino American'),
668
669 new cat('2403','2391','Intellectual'),
670
671 new cat('2404','2403','Diplomatic'),
672
673 new cat('2405','2403','Economic'),
674
675 new cat('2406','2391','Labour'),
676
677 new cat('2407','2391','Legal and Constitutional'),
678
679 new cat('2408','2391','Local and Regional'),
680
681 new cat('2409','2391','Military'),
682
683 new cat('2410','2391','Native American'),
684
685 new cat('2411','2391','Political'),
686
687 new cat('2412','2391','Popular Culture'),
688
689 new cat('2393','2391','Archaeology'),
690
691 new cat('2413','2391','Popular Culture'),
692
693 new cat('2414','2391','Public History'),
694
695 new cat('2415','2391','Race and Ethnicity'),
696
697 new cat('2416','2391','Religion'),
698
699 new cat('2417','2391','Rural'),
700
701 new cat('2418','2391','Science, Medicine, and Technology'),
702
703 new cat('2419','2391','Sexuality'),
704
705 new cat('2420','2391','Slavery'),
706
707 new cat('2421','2391','Social'),
708
709 new cat('2422','2391','Subaltern'),
710
711 new cat('2394','2391','Art History'),
712
713 new cat('2423','2391','Wars'),
714
715 new cat('2424','2391','Women'),
716
717 new cat('2425','2391','World and Global'),
718
719 new cat('2395','2391','Biography'),
720
721 new cat('2396','2391','Business and Economics'),
722
723 new cat('2397','2391','Class'),
724
725 new cat('2398','2391','Education'),
726
727 new cat('2399','2391','Environmental History'),
728
729 new cat('2400','2391','Gender'),
730
731 new cat('2426','2327','Language and Literature'),
732
733 new cat('2427','2426','Communications'),
734
735 new cat('2436','2426','Rhetoric'),
736
737 new cat('2437','2426','Speech'),
738
739 new cat('2428','2426','Composition'),
740
741 new cat('2429','2426','Criticism'),
742
743 new cat('2430','2426','Drama and Theatre'),
744
745 new cat('2431','2426','History'),
746
747 new cat('2432','2426','Journalism'),
748
749 new cat('2433','2426','Linguistics'),
750
751 new cat('2434','2426','Literature'),
752
753 new cat('2435','2426','Poetry'),
754
755 new cat('2438','2327','Philosophy'),
756
757 new cat('2439','2327','Religion'),
758
759 new cat('2440','2327','World Languages'),
760
761 new cat('2441','2440','Arabic'),
762
763 new cat('2442','2441','Culture'),
764
765 new cat('2443','2441','Language'),
766
767 new cat('2444','2441','Teacher Resources'),
768
769 new cat('2445','2441','culture'),
770
771 new cat('2486','2440','Korean'),
772
773 new cat('2487','2486','Culture'),
774
775 new cat('2488','2486','Language'),
776
777 new cat('2489','2486','Teacher Resources'),
778
779 new cat('2490','2486','culture'),
780
781 new cat('2491','2440','Latin'),
782
783 new cat('2492','2491','Culture'),
784
785 new cat('2493','2491','Language'),
786
787 new cat('2494','2491','Teacher Resources'),
788
789 new cat('2495','2491','culture'),
790
791 new cat('2496','2440','Less Commonly Taught Languages'),
792
793 new cat('2497','2440','Multilingual Resources'),
794
795 new cat('2498','2440','Portuguese'),
796
797 new cat('2499','2498','Culture'),
798
799 new cat('2500','2498','Language'),
800
801 new cat('2501','2498','Teacher Resources'),
802
803 new cat('2502','2498','culture'),
804
805 new cat('2503','2440','Russian'),
806
807 new cat('2504','2503','Culture'),
808
809 new cat('2505','2503','Language'),
810
811 new cat('2506','2503','Teacher Resources'),
812
813 new cat('2507','2503','culture'),
814
815 new cat('2508','2440','Spanish'),
816
817 new cat('2509','2508','Culture'),
818
819 new cat('2510','2508','Language'),
820
821 new cat('2511','2508','Teacher Resources'),
822
823 new cat('2512','2508','culture'),
824
825 new cat('2446','2440','Chinese'),
826
827 new cat('2447','2446','Culture'),
828
829 new cat('2448','2446','Language'),
830
831 new cat('2449','2446','Teacher Resources'),
832
833 new cat('2450','2446','culture'),
834
835 new cat('2451','2440','ESL'),
836
837 new cat('2452','2451','Culture'),
838
839 new cat('2453','2451','Language'),
840
841 new cat('2454','2451','Teacher Resources'),
842
843 new cat('2455','2451','culture'),
844
845 new cat('2456','2440','French'),
846
847 new cat('2457','2456','Culture'),
848
849 new cat('2458','2456','Language'),
850
851 new cat('2459','2456','Teacher Resources'),
852
853 new cat('2460','2456','culture'),
854
855 new cat('2461','2440','German'),
856
857 new cat('2462','2461','Culture'),
858
859 new cat('2463','2461','Language'),
860
861 new cat('2464','2461','Teacher Resources'),
862
863 new cat('2465','2461','culture'),
864
865 new cat('2466','2440','Greek'),
866
867 new cat('2467','2466','Culture'),
868
869 new cat('2468','2466','Language'),
870
871 new cat('2469','2466','Teacher Resources'),
872
873 new cat('2470','2466','culture'),
874
875 new cat('2471','2440','Hebrew'),
876
877 new cat('2472','2471','Culture'),
878
879 new cat('2473','2471','Language'),
880
881 new cat('2474','2471','Teacher Resources'),
882
883 new cat('2475','2471','culture'),
884
885 new cat('2476','2440','Italian'),
886
887 new cat('2477','2476','Culture'),
888
889 new cat('2478','2476','Language'),
890
891 new cat('2479','2476','Teacher Resources'),
892
893 new cat('2480','2476','culture'),
894
895 new cat('2481','2440','Japanese'),
896
897 new cat('2482','2481','Culture'),
898
899 new cat('2483','2481','Language'),
900
901 new cat('2484','2481','Teacher Resources'),
902
903 new cat('2485','2481','culture'),
904
905 new cat('2513','','Mathematics and Statistics'),
906
907 new cat('2514','2513','Mathematics'),
908
909 new cat('2515','2514','Algebra and Number Theory'),
910
911 new cat('2516','2515','Abstract Algebra'),
912
913 new cat('2517','2515','Cryptography'),
914
915 new cat('2518','2515','Linear Algebra'),
916
917 new cat('2519','2515','Number Theory'),
918
919 new cat('2560','2514','General and Liberal Arts Math'),
920
921 new cat('2561','2560','Consumer Mathematics'),
922
923 new cat('2562','2560','History of Mathematics'),
924
925 new cat('2563','2560','Mathematical Modeling'),
926
927 new cat('2564','2560','Mathematics in Art and Music'),
928
929 new cat('2565','2560','Recreational Mathematics'),
930
931 new cat('2566','2514','Geometry and Topology'),
932
933 new cat('2567','2566','Computational Geometry'),
934
935 new cat('2568','2566','Differential Geometry'),
936
937 new cat('2569','2566','Euclidean Geometry'),
938
939 new cat('2570','2566','Knot Theory'),
940
941 new cat('2571','2566','Non-Euclidean Geometry'),
942
943 new cat('2572','2566','Topology'),
944
945 new cat('2573','2566','Transformational Geometry'),
946
947 new cat('2574','2514','Mathematical Modeling'),
948
949 new cat('2575','2574','Continuous'),
950
951 new cat('2576','2574','Discrete'),
952
953 new cat('2577','2574','Mathematical Biology'),
954
955 new cat('2578','2514','Mathematics Publishing Tools'),
956
957 new cat('2579','2578','Computer Algebra Systems'),
958
959 new cat('2580','2578','HTML and MathML'),
960
961 new cat('2581','2578','Java'),
962
963 new cat('2582','2578','Non-Java Programming'),
964
965 new cat('2583','2578','Scientific Word Processors'),
966
967 new cat('2584','2578','Tex'),
968
969 new cat('2585','2578','Text Editors'),
970
971 new cat('2586','2514','Numerical Analysis'),
972
973 new cat('2587','2586','Numerical Differential Equations'),
974
975 new cat('2588','2586','Numerical Linear Algebra'),
976
977 new cat('2589','2586','Numerical Partial Differential Equations'),
978
979 new cat('2590','2586','Numerical Solution of Equations'),
980
981 new cat('2591','2514','Pre-Calculus Mathematics'),
982
983 new cat('2592','2591','Algebra'),
984
985 new cat('2593','2591','Analytic Geometry'),
986
987 new cat('2594','2591','Trigonometry'),
988
989 new cat('2520','2514','Analysis'),
990
991 new cat('2521','2520','Complex Analysis'),
992
993 new cat('2522','2520','Fourier Analysis'),
994
995 new cat('2523','2520','Functional Analysis'),
996
997 new cat('2524','2520','Real Analysis'),
998
999 new cat('2525','2520','Wavelets'),
1000
1001 new cat('2526','2514','Applied Mathematics'),
1002
1003 new cat('2527','2514','Calculus'),
1004
1005 new cat('2528','2527','Differential, One Variable'),
1006
1007 new cat('2529','2527','Integral, One Variable'),
1008
1009 new cat('2530','2527','Multivariable'),
1010
1011 new cat('2531','2527','Sequences and Series'),
1012
1013 new cat('2532','2514','Developmental Mathematics'),
1014
1015 new cat('2533','2532','Arithmetic'),
1016
1017 new cat('2534','2532','Geometry'),
1018
1019 new cat('2535','2532','Pre-Algebra'),
1020
1021 new cat('2536','2514','Differential Equations'),
1022
1023 new cat('2537','2536','Advanced'),
1024
1025 new cat('2538','2536','Diffusion'),
1026
1027 new cat('2539','2536','Elementary'),
1028
1029 new cat('2540','2536','Fluid Dynamics'),
1030
1031 new cat('2541','2536','PDE?s'),
1032
1033 new cat('2542','2536','Wave Phenomena'),
1034
1035 new cat('2543','2514','Discrete Mathematics'),
1036
1037 new cat('2544','2543','Cellular Automata'),
1038
1039 new cat('2545','2543','Combinatorics'),
1040
1041 new cat('2546','2543','Game Theory'),
1042
1043 new cat('2547','2543','Genetic Algorithms'),
1044
1045 new cat('2548','2543','Graph Theory'),
1046
1047 new cat('2549','2543','Linear Programming'),
1048
1049 new cat('2550','2543','Theory of Computation'),
1050
1051 new cat('2551','2514','Dynamical Systems'),
1052
1053 new cat('2552','2551','Complex Dynamics'),
1054
1055 new cat('2553','2551','Difference Equations'),
1056
1057 new cat('2554','2551','Fractal Geometry'),
1058
1059 new cat('2555','2551','Real Variable Dynamics'),
1060
1061 new cat('2556','2551','Symbolic Dynamics and Coding Theory'),
1062
1063 new cat('2557','2514','Foundations of Mathematics'),
1064
1065 new cat('2558','2557','Logic'),
1066
1067 new cat('2559','2557','Set Theory'),
1068
1069 new cat('2595','2513','Statistics and Probability'),
1070
1071 new cat('2596','2595','Bayesian Analysis'),
1072
1073 new cat('2597','2595','Brownian Motion'),
1074
1075 new cat('2598','2595','Data Analysis'),
1076
1077 new cat('2599','2595','Linear Regression'),
1078
1079 new cat('2600','2595','Markov Chains'),
1080
1081 new cat('2601','2595','Nonlinear Regression'),
1082
1083 new cat('2602','2595','Probability'),
1084
1085 new cat('2603','2595','Queueing Theory'),
1086
1087 new cat('2604','2595','Statistics'),
1088
1089 new cat('2605','','Science and Technology'),
1090
1091 new cat('2606','2605','Agriculture'),
1092
1093 new cat('2683','2605','Health Sciences'),
1094
1095 new cat('2684','2683','Cardiology'),
1096
1097 new cat('2693','2683','Geriatrics'),
1098
1099 new cat('2694','2683','Hematology'),
1100
1101 new cat('2695','2683','Internal Medicine'),
1102
1103 new cat('2696','2683','Medical Laboratory Technology'),
1104
1105 new cat('2697','2683','Nephrology'),
1106
1107 new cat('2698','2683','Neurology'),
1108
1109 new cat('2699','2683','Nursing'),
1110
1111 new cat('2700','2683','Nutrition'),
1112
1113 new cat('2701','2683','OB and Gyn'),
1114
1115 new cat('2702','2683','Oncology'),
1116
1117 new cat('2685','2683','Dentistry'),
1118
1119 new cat('2703','2683','Ophthalmology'),
1120
1121 new cat('2704','2683','Orthopedics'),
1122
1123 new cat('2705','2683','Other'),
1124
1125 new cat('2706','2683','Pathology'),
1126
1127 new cat('2707','2683','Pediatrics'),
1128
1129 new cat('2708','2683','Pharmacy'),
1130
1131 new cat('2709','2683','Psychiatry and Mental Health'),
1132
1133 new cat('2710','2683','Public Health'),
1134
1135 new cat('2711','2683','Pulmonary Medicine'),
1136
1137 new cat('2712','2683','Radiology'),
1138
1139 new cat('2686','2683','Dermatology'),
1140
1141 new cat('2713','2683','Rheumatology'),
1142
1143 new cat('2714','2683','Sports Medicine'),
1144
1145 new cat('2715','2683','Surgery'),
1146
1147 new cat('2716','2683','Therapeutics'),
1148
1149 new cat('2687','2683','Ear, Nose, and Throat'),
1150
1151 new cat('2688','2683','Endocrinology'),
1152
1153 new cat('2689','2683','Epidemiology'),
1154
1155 new cat('2690','2683','Gastroenterology'),
1156
1157 new cat('2691','2683','General'),
1158
1159 new cat('2692','2683','Genetics and Infectious Disease'),
1160
1161 new cat('2717','2605','Information Technology'),
1162
1163 new cat('2718','2717','Applications'),
1164
1165 new cat('2727','2717','Security'),
1166
1167 new cat('2728','2717','Software Engineering'),
1168
1169 new cat('2729','2717','Systems Analysis'),
1170
1171 new cat('2730','2717','Web'),
1172
1173 new cat('2719','2717','Computer Information Systems'),
1174
1175 new cat('2720','2717','Database'),
1176
1177 new cat('2721','2717','E-commerce'),
1178
1179 new cat('2722','2717','Hardware'),
1180
1181 new cat('2723','2717','Information Literacy'),
1182
1183 new cat('2724','2717','Networking'),
1184
1185 new cat('2725','2717','Operating Systems'),
1186
1187 new cat('2726','2717','Programming'),
1188
1189 new cat('2731','2605','Nanotechnology'),
1190
1191 new cat('2732','2731','Computation and Software'),
1192
1193 new cat('2733','2731','Nano-bio Device and Systems'),
1194
1195 new cat('2734','2731','Nano-electromechanical Systems (NEMS)'),
1196
1197 new cat('2735','2731','Nano-electronics'),
1198
1199 new cat('2736','2605','Physics'),
1200
1201 new cat('2737','2736','Classical Mechanics'),
1202
1203 new cat('2738','2737','1D Kinematics'),
1204
1205 new cat('2747','2737','Reference Frames'),
1206
1207 new cat('2748','2737','Statics'),
1208
1209 new cat('2739','2737','2D Kinematics'),
1210
1211 new cat('2740','2737','Angular Motion and Torques'),
1212
1213 new cat('2741','2737','Energy and Momentum'),
1214
1215 new cat('2742','2737','Forces and Dynamics'),
1216
1217 new cat('2743','2737','Gravity'),
1218
1219 new cat('2744','2737','Linear Motion, Forces, and Equilibrium'),
1220
1221 new cat('2745','2737','Projectile Motion'),
1222
1223 new cat('2746','2737','Pulleys and Atwood Machines'),
1224
1225 new cat('2749','2736','Electricity and Magnetism'),
1226
1227 new cat('2750','2749','Capacitance'),
1228
1229 new cat('2751','2749','Charges in Fields'),
1230
1231 new cat('2752','2749','Circuits'),
1232
1233 new cat('2753','2749','Electric Fields'),
1234
1235 new cat('2754','2749','Electric Potentials'),
1236
1237 new cat('2755','2749','Faradays Law and Induction'),
1238
1239 new cat('2756','2749','Gauss and Coulombs Law'),
1240
1241 new cat('2757','2749','Magnetic Fields'),
1242
1243 new cat('2758','2736','General'),
1244
1245 new cat('2759','2758','Collections'),
1246
1247 new cat('2760','2758','Curriculum'),
1248
1249 new cat('2761','2758','History'),
1250
1251 new cat('2762','2758','Mathematics'),
1252
1253 new cat('2763','2758','Measurement and Units'),
1254
1255 new cat('2764','2758','Physics Education Research'),
1256
1257 new cat('2765','2758','Reference'),
1258
1259 new cat('2766','2758','Vector Algebra'),
1260
1261 new cat('2767','2736','Modern Physics'),
1262
1263 new cat('2768','2767','Atomic and Molecular'),
1264
1265 new cat('2769','2767','Condensed Matter'),
1266
1267 new cat('2770','2767','General'),
1268
1269 new cat('2771','2767','Laser Physics'),
1270
1271 new cat('2772','2767','Nuclear and Particle'),
1272
1273 new cat('2773','2767','Relativity'),
1274
1275 new cat('2774','2736','Optics'),
1276
1277 new cat('2775','2774','Geometric Optics'),
1278
1279 new cat('2776','2774','Physical Optics'),
1280
1281 new cat('2777','2774','Radiation'),
1282
1283 new cat('2778','2736','Oscillations and Waves'),
1284
1285 new cat('2779','2778','Oscillators'),
1286
1287 new cat('2780','2778','Pendulum Motion'),
1288
1289 new cat('2781','2778','Waves'),
1290
1291 new cat('2782','2736','Quantum Mechanics'),
1292
1293 new cat('2783','2736','Thermodynamics and Statistical Mechanics'),
1294
1295 new cat('2784','2783','Fluids'),
1296
1297 new cat('2785','2783','Statistical Mechanics'),
1298
1299 new cat('2786','2783','Thermodynamics'),
1300
1301 new cat('2607','2605','Astronomy'),
1302
1303 new cat('2608','2605','Biology'),
1304
1305 new cat('2609','2608','Botany'),
1306
1307 new cat('2618','2608','Microbiology'),
1308
1309 new cat('2619','2608','Molecular Biology'),
1310
1311 new cat('2620','2608','Natural History'),
1312
1313 new cat('2621','2608','Physiology'),
1314
1315 new cat('2622','2608','Zoology'),
1316
1317 new cat('2610','2608','Cytology'),
1318
1319 new cat('2611','2608','Development'),
1320
1321 new cat('2612','2608','Ecology'),
1322
1323 new cat('2613','2608','Evolution'),
1324
1325 new cat('2614','2608','General'),
1326
1327 new cat('2615','2608','Genetics'),
1328
1329 new cat('2616','2608','Human Anatomy'),
1330
1331 new cat('2617','2608','Life'),
1332
1333 new cat('2623','2605','Chemistry'),
1334
1335 new cat('2624','2623','Analytical'),
1336
1337 new cat('2633','2623','Physical'),
1338
1339 new cat('2634','2623','Polymer and Macromolecular'),
1340
1341 new cat('2625','2623','Biochemistry'),
1342
1343 new cat('2626','2623','Chemical Education'),
1344
1345 new cat('2627','2623','Environmental'),
1346
1347 new cat('2628','2623','Inorganic'),
1348
1349 new cat('2629','2623','Introductory and General'),
1350
1351 new cat('2630','2623','Materials'),
1352
1353 new cat('2631','2623','Nuclear'),
1354
1355 new cat('2632','2623','Organic'),
1356
1357 new cat('2635','2605','Computer Science'),
1358
1359 new cat('2636','2635','Artificial Intelligence'),
1360
1361 new cat('2645','2635','Programming'),
1362
1363 new cat('2646','2635','Programming Languages'),
1364
1365 new cat('2647','2635','Robotics'),
1366
1367 new cat('2648','2635','Study and Teaching'),
1368
1369 new cat('2649','2635','Theory'),
1370
1371 new cat('2650','2635','User Interfaces'),
1372
1373 new cat('2637','2635','Computer Simulation'),
1374
1375 new cat('2638','2635','Computer Software'),
1376
1377 new cat('2639','2635','Databases'),
1378
1379 new cat('2640','2635','Documentation'),
1380
1381 new cat('2641','2635','General'),
1382
1383 new cat('2642','2635','Human-Computer Interaction'),
1384
1385 new cat('2643','2635','Internet'),
1386
1387 new cat('2644','2635','Multimedia'),
1388
1389 new cat('2651','2605','Engineering'),
1390
1391 new cat('2652','2651','Aerospace and Aeronautical Engineering'),
1392
1393 new cat('2661','2651','General'),
1394
1395 new cat('2662','2651','Geological Engineering'),
1396
1397 new cat('2663','2651','Industrial and Systems'),
1398
1399 new cat('2664','2651','Manufacturing Engineering'),
1400
1401 new cat('2665','2651','Materials Science and Engineering'),
1402
1403 new cat('2666','2651','Mechanical Engineering'),
1404
1405 new cat('2667','2651','Mining Engineering'),
1406
1407 new cat('2668','2651','Nuclear Engineering'),
1408
1409 new cat('2669','2651','Ocean Engineering'),
1410
1411 new cat('2670','2651','Petroleum Engineering'),
1412
1413 new cat('2653','2651','Agricultural and Biological Engineering'),
1414
1415 new cat('2654','2651','Biomedical Engineering'),
1416
1417 new cat('2655','2651','Chemical Engineering'),
1418
1419 new cat('2656','2651','Civil Engineering'),
1420
1421 new cat('2657','2651','Computer Engineering'),
1422
1423 new cat('2658','2651','Electrical Engineering'),
1424
1425 new cat('2659','2651','Engineering Science'),
1426
1427 new cat('2660','2651','Environmental Engineering'),
1428
1429 new cat('2671','2605','Fire Safety'),
1430
1431 new cat('2672','2671','Building Construction for Fire Protection'),
1432
1433 new cat('2673','2671','Disaster Planning'),
1434
1435 new cat('2674','2671','Fire Administration'),
1436
1437 new cat('2675','2671','Fire Behavior and Combustion'),
1438
1439 new cat('2676','2671','Fire Investigation'),
1440
1441 new cat('2677','2671','Fire Prevention'),
1442
1443 new cat('2678','2671','Fire Protection Systems'),
1444
1445 new cat('2679','2671','Foundations of Emergency Services'),
1446
1447 new cat('2680','2671','Hazardous Materials'),
1448
1449 new cat('2681','2605','General Science'),
1450
1451 new cat('2682','2605','Geology'),
1452
1453 new cat('2787','','Social Sciences'),
1454
1455 new cat('2788','2787','Anthropology'),
1456
1457 new cat('2827','2787','Statistics'),
1458
1459 new cat('2828','2787','Womens Studies'),
1460
1461 new cat('2789','2787','Criminal Justice'),
1462
1463 new cat('2790','2789','Corrections'),
1464
1465 new cat('2800','2789','Law Enforcement'),
1466
1467 new cat('2799','2789','Law \&amp; Society'),
1468
1469 new cat('2801','2789','Victims'),
1470
1471 new cat('2791','2789','Courts'),
1472
1473 new cat('2792','2789','Crime'),
1474
1475 new cat('2793','2789','Crime and Communites'),
1476
1477 new cat('2794','2789','Drugs'),
1478
1479 new cat('2795','2789','Forensics'),
1480
1481 new cat('2796','2789','Intelligence'),
1482
1483 new cat('2797','2789','Justice System'),
1484
1485 new cat('2798','2789','Juvenile Justice'),
1486
1487 new cat('2802','2787','General'),
1488
1489 new cat('2803','2787','Geography'),
1490
1491 new cat('2804','2787','Law'),
1492
1493 new cat('2805','2787','Political Science'),
1494
1495 new cat('2806','2787','Psychology'),
1496
1497 new cat('2807','2806','Biological'),
1498
1499 new cat('2819','2806','Industrial and Organizational'),
1500
1501 new cat('2820','2806','Learning and Memory'),
1502
1503 new cat('2821','2806','Personality'),
1504
1505 new cat('2822','2806','Sensation and Perception'),
1506
1507 new cat('2823','2806','Social'),
1508
1509 new cat('2824','2806','Statistics and Research Methods'),
1510
1511 new cat('2808','2806','Clinical and Counseling'),
1512
1513 new cat('2809','2808','Abnormal and Psychopathology'),
1514
1515 new cat('2810','2808','Assessment'),
1516
1517 new cat('2811','2808','Therapy and Treatment'),
1518
1519 new cat('2812','2806','Cognitive'),
1520
1521 new cat('2813','2806','Community and Health'),
1522
1523 new cat('2814','2806','Developmental and Life-Span'),
1524
1525 new cat('2815','2806','Diversity'),
1526
1527 new cat('2816','2806','Ethics'),
1528
1529 new cat('2817','2806','General'),
1530
1531 new cat('2818','2806','History and Systems'),
1532
1533 new cat('2825','2787','Sociology'),
1534
1535 new cat('2826','2787','Sports and Games')
1536
1537 );
1538
1539 function subcat(value,field) {
1540  subcatID(value, field, 0);
1541 }
1542
1543 function subcatID(value,field,show_id) {
1544  var selectedValue;
1545  var pathList="<B>Selected:</B> ";
1546  var el = document.getElementById('catPath');
1547  
1548  var j=1;
1549  var tempId;
1550  var selectedCat;
1551  var childrenNameStack= new Array();
1552  var childrenIdStack = new Array();
1553  var pathNameStack = new Array();
1554  var pathIdStack = new Array();
1555
1556  if (value == "-1") selectedValue = document.merlotForm.elements[field].options[document.merlotForm.elements[field].selectedIndex].value;
1557  else selectedValue = value;
1558    
1559  for (i=0; i<=cats.length-1; i++) if(cats[i].id == selectedValue) selectedCat = cats[i];
1560  tempId = selectedCat.parentId;
1561
1562  for (i=cats.length-1;i>=0 ;i--) {
1563     if (cats[i].id == tempId) {
1564            pathNameStack.push(cats[i].name);
1565            pathIdStack.push(cats[i].id);
1566            tempId = cats[i].parentId;
1567         }
1568         if (cats[i].parentId == selectedValue) {
1569            childrenNameStack.push(cats[i].name);
1570            childrenIdStack.push(cats[i].id);
1571            tempId = cats[i].parentId;
1572         }
1573  }
1574
1575  document.merlotForm.elements[field].options.length = 0;
1576  if (selectedCat.id > 0){
1577     if (childrenNameStack.length > 0) document.merlotForm.elements[field].options[0]= new Option('See sub-categories in ' + selectedCat.name +"...", selectedCat.id);
1578         else document.merlotForm.elements[field].options[0]= new Option(selectedCat.name, selectedCat.id);
1579  }
1580  else document.merlotForm.elements[field].options[0]= new Option(selectedCat.name, selectedCat.id);
1581  if (selectedValue !="")
1582  {
1583            document.merlotForm.elements[field].options[1]= new Option('--UP--', selectedCat.parentId);
1584            j++;
1585  }
1586  for (i=childrenNameStack.length-1; i>=0; i--){
1587     document.merlotForm.elements[field].options[j]= new Option(childrenNameStack[i], childrenIdStack[i]);
1588     j++
1589  }
1590  if (selectedValue == "" && cats[0].name != "All");
1591  else pathList = pathList + "<a href=\"javascript:subcat('', '" + field + "')\">All</a>";
1592  for (i=pathNameStack.length-2; i>=0; i--) pathList = pathList + " &gt; <a href=\"javascript:subcat('" + pathIdStack[i] + "', '" + field + "')\">" + pathNameStack[i] +"</a>";
1593     if (selectedCat.id != pathIdStack[0]) pathList = pathList + " &gt; <a href=\"javascript:subcat('" + selectedCat.id + "', '" + field + "')\">" + selectedCat.name +"</a>";
1594     if (show_id == 1) pathList = pathList + "&nbsp; (" + selectedCat.id + ")";
1595      el.innerHTML = pathList;
1596 }
1597
1598 function defaultCat(id, field) {
1599 subcat(id, field);
1600 }
1601
1602 function defaultCatWithId(id, field) {
1603 subcatID(id, field, 1);
1604 }
1605
1606 var Today = new Date();
1607
1608 var MonthDays = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
1609 var MonthNames = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
1610 var curYear = Today.getFullYear();
1611 var curMonth = Today.getMonth() + 1;
1612 var curDay = Today.getDate();
1613 var monthFlag = "false";
1614 var dayFlag = "false";
1615 var yearFlag = "false";
1616 var time = Today.getTime();
1617 var yearsBack = 60;
1618 var yearsAhead = 5;
1619
1620 function setCurrent(field, form, el)
1621 {
1622     monthFieldName = "month"+ field;
1623     dayFieldName = "day"+ field;
1624     yearFieldName = "year"+ field;
1625
1626         if(el.checked==true){
1627         if (document.forms[form].elements[monthFieldName]) document.forms[form].elements[monthFieldName].disabled=true;
1628     if (document.forms[form].elements[dayFieldName]) document.forms[form].elements[dayFieldName].disabled=true;
1629         if (document.forms[form].elements[yearFieldName]) document.forms[form].elements[yearFieldName].disabled=true;
1630         document.forms[form].elements[field].value="";
1631         }
1632         else{
1633     if (document.forms[form].elements[monthFieldName]) document.forms[form].elements[monthFieldName].disabled=false;
1634     if (document.forms[form].elements[dayFieldName]) document.forms[form].elements[dayFieldName].disabled=false;
1635         if (document.forms[form].elements[yearFieldName]) document.forms[form].elements[yearFieldName].disabled=false;
1636         
1637         hiddenDate = "";
1638     if (document.forms[form].elements[yearFieldName]) hiddenDate = hiddenDate + document.forms[formName].elements[yearFieldName].options[document.forms[formName].elements[yearFieldName].selectedIndex].value;
1639     else hiddenDate = hiddenDate + "9999";
1640
1641         hiddenDate = hiddenDate + "-";
1642
1643         if (document.forms[form].elements[monthFieldName]){
1644         monthIndex= document.forms[formName].elements[monthFieldName].selectedIndex + 1;
1645         hiddenDate = hiddenDate + monthIndex;
1646         }
1647         else hiddenDate = hiddenDate + "01";
1648         
1649         hiddenDate = hiddenDate + "-";
1650
1651     if (document.forms[form].elements[dayFieldName]) hiddenDate = hiddenDate + document.forms[formName].elements[dayFieldName].options[document.forms[formName].elements[dayFieldName].selectedIndex].value;
1652     else hiddenDate = hiddenDate + "01";
1653
1654         document.forms[form].elements[field].value= hiddenDate;
1655         }
1656 }
1657
1658 function setupDatePulldowns(field, form, inputDate, format, currentFlag, id)
1659 {
1660
1661 formName = form;
1662 dateFieldFormat = format;
1663
1664 monthFieldName = "month"+ field;
1665 dayFieldName = "day"+ field;
1666 yearFieldName = "year"+ field;
1667 currentFieldName = "current"+ field;
1668
1669
1670 if (format.indexOf('{M}') >= 0) monthFlag = "true";
1671 if (format.indexOf('{D}') >= 0) dayFlag = "true";
1672 if (format.indexOf('{Y}') >= 0) yearFlag = "true";
1673
1674 if (inputDate=="")
1675 {
1676
1677    if (monthFlag == "true") selectedMonth = curMonth;
1678    if (dayFlag == "true") selectedDay = curDay;
1679    if (yearFlag == "true") selectedYear = curYear;  
1680 }
1681 else
1682 {
1683 selectedMonth = inputDate.substring(5,7);
1684 selectedDay = inputDate.substring(8,10);
1685 selectedYear = inputDate.substring(0,4);
1686 }
1687
1688 monthField = "<select name='" + monthFieldName + "' onChange=\"update('" + field + "');\"></select>";
1689 dayField = "<select name='" + dayFieldName + "' onChange=\"update('" + field + "');\"></select>";
1690 yearField = "<select name='" + yearFieldName + "' onChange=\"update('" + field + "');\"></select>";
1691 currentField = " <INPUT TYPE='checkbox' NAME='" + currentFieldName + "' onClick=\"setCurrent('" + field + "','" + formName + "',this)\">Current";
1692
1693 if (monthFlag == "true") dateFieldFormat = dateFieldFormat.replace("{M}",monthField);
1694 if (dayFlag == "true") dateFieldFormat = dateFieldFormat.replace("{D}",dayField);
1695 if (yearFlag == "true") dateFieldFormat = dateFieldFormat.replace("{Y}",yearField);
1696 if (currentFlag == "true") dateFieldFormat = dateFieldFormat + currentField;
1697
1698 document.writeln(dateFieldFormat + "<INPUT TYPE='hidden' NAME='" + field + "'>");
1699
1700 if (monthFlag == "true")
1701 {
1702   for (i=0;i<=11;i++) document.forms[formName].elements[monthFieldName].options[i] = new Option(MonthNames[i],i+1);
1703   
1704   if (selectedMonth>0) document.forms[formName].elements[monthFieldName].selectedIndex = selectedMonth-1;
1705   else document.forms[formName].elements[monthFieldName].selectedIndex = 0;
1706 }
1707
1708 if (dayFlag == "true")
1709 {
1710    if (selectedMonth==2)
1711    {
1712       if(selectedYear%4 == 0) pdEndDate = 29;
1713       else pdEndDate = 28;
1714    }
1715    else pdEndDate = MonthDays[document.forms[formName].elements[monthFieldName].selectedIndex];
1716
1717    for (i=0; i<= pdEndDate-1; i++)document.forms[formName].elements[dayFieldName].options[i] = new Option(i+1,i+1);
1718    document.forms[formName].elements[dayFieldName].selectedIndex = selectedDay-1;
1719 }
1720
1721 if (yearFlag == "true")
1722 {
1723    for (i=0;i<=(yearsBack+yearsAhead);i++)document.forms[formName].elements[yearFieldName].options[i] = new Option(curYear-i+yearsAhead,curYear-i+yearsAhead);
1724    document.forms[formName].elements[yearFieldName].selectedIndex = curYear-selectedYear+yearsAhead;
1725 }
1726
1727 hiddenDate = "";
1728
1729 if (yearFlag == "true") hiddenDate = hiddenDate + document.forms[formName].elements[yearFieldName].options[document.forms[formName].elements[yearFieldName].selectedIndex].value;
1730 else hiddenDate = hiddenDate + "1999";
1731 hiddenDate = hiddenDate + "-";
1732
1733 if (monthFlag == "true")
1734         {
1735         monthIndex= document.forms[formName].elements[monthFieldName].selectedIndex + 1;
1736         hiddenDate = hiddenDate + monthIndex;
1737         }
1738 else hiddenDate = hiddenDate + "01";
1739 hiddenDate = hiddenDate + "-";
1740
1741 if (dayFlag == "true") hiddenDate = hiddenDate + document.forms[formName].elements[dayFieldName].options[document.forms[formName].elements[dayFieldName].selectedIndex].value;
1742 else hiddenDate = hiddenDate + "01";
1743
1744 document.forms[formName].elements[field].value= hiddenDate;
1745
1746 if (currentFlag=="true" && inputDate=="" && id !="")
1747 {
1748     document.forms[formName].elements[currentFieldName].checked=true;
1749         setCurrent(field, formName, document.forms[formName].elements[currentFieldName]);
1750 }
1751
1752 }
1753
1754 function update(fieldName)
1755 {
1756 monthFieldName = "month"+ fieldName;
1757 dayFieldName = "day"+ fieldName;
1758 yearFieldName = "year"+ fieldName;
1759
1760    if (monthFlag == "true") selectedMonth = document.forms[formName].elements[monthFieldName].selectedIndex + 1;
1761    else selectedMonth = 1;
1762    if (yearFlag == "true") selectedYear = document.forms[formName].elements[yearFieldName].options[document.forms[formName].elements[yearFieldName].selectedIndex].value; 
1763    else selectedYear = 1900;
1764      
1765 if (dayFlag == "true")
1766 {   
1767    selectedDay = document.forms[formName].elements[dayFieldName].selectedIndex;
1768    
1769    for (i=0;i<= document.forms[formName].elements[dayFieldName].length;i++) document.forms[formName].elements[dayFieldName].options[i] = null;
1770    
1771    if (selectedMonth==2)
1772    {
1773       if(selectedYear%4 == 0) pdEndDate = 29;
1774       else pdEndDate = 28;
1775    }
1776    else pdEndDate = MonthDays[document.forms[formName].elements[monthFieldName].selectedIndex];
1777    
1778    if (selectedDay > MonthDays[document.forms[formName].elements[monthFieldName].selectedIndex]) selectedDay = MonthDays[document.forms[formName].elements[monthFieldName].selectedIndex];
1779
1780    for (i=0; i<= pdEndDate-1; i++) document.forms[formName].elements[dayFieldName].options[i] = new Option(i+1,i+1);
1781    if (selectedDay > document.forms[formName].elements[dayFieldName].length -1) selectedDay = document.forms[formName].elements[dayFieldName].length -1;
1782    document.forms[formName].elements[dayFieldName].selectedIndex = selectedDay;
1783 }
1784 hiddenDate = "";
1785
1786 if (yearFlag == "true") hiddenDate = hiddenDate + document.forms[formName].elements[yearFieldName].options[document.forms[formName].elements[yearFieldName].selectedIndex].value;
1787 else hiddenDate = hiddenDate + "1999";
1788 hiddenDate = hiddenDate + "-";
1789
1790 if (monthFlag == "true")
1791         {
1792         monthIndex= document.forms[formName].elements[monthFieldName].selectedIndex + 1;
1793         hiddenDate = hiddenDate + monthIndex;
1794         }
1795 else hiddenDate = hiddenDate + "01";
1796 hiddenDate = hiddenDate + "-";
1797
1798 if (dayFlag == "true") hiddenDate = hiddenDate + document.forms[formName].elements[dayFieldName].options[document.forms[formName].elements[dayFieldName].selectedIndex].value;
1799 else hiddenDate = hiddenDate + "01";
1800
1801 document.forms[formName].elements[fieldName].value= hiddenDate;
1802 }
1803
1804
1805