1 | function toggleBranch(divId, imageId) { |
---|
2 | |
---|
3 | $(divId).toggle(); |
---|
4 | |
---|
5 | if( $(divId).visible() ) { |
---|
6 | $(imageId).src= '../images/skin/bullet_tree_minus.png'; |
---|
7 | } |
---|
8 | else { |
---|
9 | $(imageId).src= '../images/skin/bullet_tree_plus.png'; |
---|
10 | } |
---|
11 | |
---|
12 | // return false; |
---|
13 | } |
---|
14 | |
---|
15 | function showElement(id) { |
---|
16 | try { |
---|
17 | if (typeof Effect != "undefined" && typeof Effect.Appear != "undefined") { |
---|
18 | if ($(id) && Element.visible(id) == false) |
---|
19 | Effect.Appear(id,{duration:0.5,queue:'end'}); |
---|
20 | } else { |
---|
21 | var el = document.getElementById(id) |
---|
22 | if (el && el.style.display == 'none') { |
---|
23 | el.style.display = 'block'; |
---|
24 | } |
---|
25 | } |
---|
26 | } catch (err) {alert(err)} |
---|
27 | return false; |
---|
28 | } |
---|
29 | |
---|
30 | function hideElement(id) { |
---|
31 | if (typeof Effect != "undefined" && typeof Effect.Fade != "undefined") { |
---|
32 | if ($(id) && Element.visible(id)) |
---|
33 | Effect.Fade(id,{duration:0.5,queue:'end'}); |
---|
34 | } else { |
---|
35 | var el = document.getElementById(id) |
---|
36 | if (el && el.style.display != 'none') { |
---|
37 | el.style.display = 'none'; |
---|
38 | } |
---|
39 | } |
---|
40 | return false; |
---|
41 | } |
---|
42 | |
---|
43 | function clearFilterPane(id) { |
---|
44 | var form = document.getElementById(id) |
---|
45 | |
---|
46 | for (var i = 0; i < form.elements.length; i++) { |
---|
47 | var el = form.elements[i] |
---|
48 | if (el.type == 'select-one') { |
---|
49 | el.selectedIndex = 0 |
---|
50 | } else if (el.type == 'text' || el.type == 'textarea') { |
---|
51 | form.elements[i].value = '' |
---|
52 | } |
---|
53 | } |
---|
54 | } |
---|
55 | |
---|
56 | function filterOpChange(id, controlId) { |
---|
57 | // id should be of the form op.propertyName |
---|
58 | if (id.slice(0, 10) == 'filter.op.') { |
---|
59 | var prop = id.substring(10) |
---|
60 | var el = document.getElementById(id) |
---|
61 | var selection = el.options[el.selectedIndex] |
---|
62 | if (el) { |
---|
63 | if (el.type == 'select-one') { |
---|
64 | if (selection.value == 'Between') { |
---|
65 | showElement('between-span-'+prop) |
---|
66 | } else { |
---|
67 | hideElement('between-span-'+prop) |
---|
68 | } |
---|
69 | } |
---|
70 | |
---|
71 | var containerName = prop+'-container' |
---|
72 | if (selection.value == 'IsNull' || selection.value == 'IsNotNull') { |
---|
73 | hideElement(controlId); |
---|
74 | // Take care of date picker fields we created. |
---|
75 | if (document.getElementById(containerName)) hideElement(containerName) |
---|
76 | } else { |
---|
77 | showElement(controlId); |
---|
78 | // Take care of date picker fields. |
---|
79 | if (document.getElementById(containerName)) showElement(containerName) |
---|
80 | } |
---|
81 | } |
---|
82 | } |
---|
83 | } |
---|
84 | |
---|
85 | function selectDefaultOperator(id) { |
---|
86 | var dropdown = document.getElementById(id) |
---|
87 | if (dropdown && dropdown.selectedIndex <= 0) { |
---|
88 | dropdown.selectedIndex = 1 |
---|
89 | } |
---|
90 | } |
---|