1 |
|
---|
2 | //functions and arrays needed for showing and hiding the menu on the db websites
|
---|
3 | ids = new Array( "all", "info", "info2", "stat", "fail", "cal", "star", "ranges", "limits", "showquery");
|
---|
4 | statarr = new Array( 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
---|
5 |
|
---|
6 | function setdisplays ()
|
---|
7 | {
|
---|
8 | var blub="";
|
---|
9 | for (var i = 0 ; i < ids.length ; i++)
|
---|
10 | {
|
---|
11 | var d = document.getElementById(ids[i]);
|
---|
12 | if (d)
|
---|
13 | d.style.display == 'none' ? statarr[i]=0 : statarr[i]=1;
|
---|
14 | if (i==0)
|
---|
15 | statarr[i]=0;
|
---|
16 | blub=blub+statarr[i];
|
---|
17 | }
|
---|
18 | return blub;
|
---|
19 | }
|
---|
20 |
|
---|
21 | function hide(el,img)
|
---|
22 | {
|
---|
23 | el.style.display="none";
|
---|
24 | if (img)
|
---|
25 | img.src='../plus.png';
|
---|
26 | }
|
---|
27 |
|
---|
28 | function show(el,img)
|
---|
29 | {
|
---|
30 | el.style.display="block";
|
---|
31 | if (img)
|
---|
32 | img.src='../minus.png';
|
---|
33 | }
|
---|
34 |
|
---|
35 | function showhide (id)
|
---|
36 | {
|
---|
37 | var el = document.getElementById(id);
|
---|
38 | var img = document.getElementById(id+"button");
|
---|
39 | if (el.style.display == 'block')
|
---|
40 | hide(el,img);
|
---|
41 | else
|
---|
42 | {
|
---|
43 | show(el,img);
|
---|
44 | if (id!="showquery")
|
---|
45 | {
|
---|
46 | var el2 = document.getElementById("all");
|
---|
47 | var img2 = document.getElementById("allbutton");
|
---|
48 | show(el2,img2);
|
---|
49 | }
|
---|
50 | }
|
---|
51 |
|
---|
52 | var soso = document.getElementById("sh");
|
---|
53 | soso.value = setdisplays();
|
---|
54 | }
|
---|
55 |
|
---|
56 | function getdisplay()
|
---|
57 | {
|
---|
58 | var stat = document.getElementById("sh");
|
---|
59 | statvalue=stat.value;
|
---|
60 | for (var i = 0 ; i < ids.length ; i++)
|
---|
61 | {
|
---|
62 | var status = statvalue.slice(i,i+1);
|
---|
63 | var el = document.getElementById(ids[i]);
|
---|
64 | var img = document.getElementById(ids[i]+"button");
|
---|
65 | if (!el)
|
---|
66 | continue;
|
---|
67 | status==0 ? hide(el,img) : show(el,img);
|
---|
68 | }
|
---|
69 | }
|
---|
70 |
|
---|
71 | //functions and arrays needed for the function for plotdb.php
|
---|
72 | primaries = new Array( "fSequenceFirst", "fRunNumber", "fDataSetNumber");
|
---|
73 |
|
---|
74 | function showpulldown (id2)
|
---|
75 | {
|
---|
76 | var el = document.getElementById(id2);
|
---|
77 | el.style.display="inline";
|
---|
78 | for (var i = 0 ; i < primaries.length ; i++)
|
---|
79 | {
|
---|
80 | if (primaries[i]==id2)
|
---|
81 | continue;
|
---|
82 | var el2 = document.getElementById(primaries[i]);
|
---|
83 | el2.style.display="none";
|
---|
84 | var el3 = document.getElementById(primaries[i]+"2");
|
---|
85 | if (el3.style.display=='inline')
|
---|
86 | var add=id2;
|
---|
87 | el3.style.display="none";
|
---|
88 | }
|
---|
89 | if (add)
|
---|
90 | {
|
---|
91 | var el4 = document.getElementById(id2+"2");
|
---|
92 | el4.style.display="inline";
|
---|
93 | }
|
---|
94 | }
|
---|
95 |
|
---|
96 | function showpulldown2 ()
|
---|
97 | {
|
---|
98 | count=0;
|
---|
99 | for (var i = 0 ; i < primaries.length ; i++)
|
---|
100 | {
|
---|
101 | var el = document.getElementById(primaries[i]);
|
---|
102 | if (el.style.display=='inline')
|
---|
103 | {
|
---|
104 | var el2 = document.getElementById(primaries[i]+"2");
|
---|
105 | el2.style.display="inline";
|
---|
106 | }
|
---|
107 | else
|
---|
108 | count++;
|
---|
109 | }
|
---|
110 | if (count==3)
|
---|
111 | for (var i = 0 ; i < primaries.length ; i++)
|
---|
112 | {
|
---|
113 | var el2 = document.getElementById(primaries[i]+"2");
|
---|
114 | el2.style.display="inline";
|
---|
115 | }
|
---|
116 | }
|
---|
117 |
|
---|
118 | function hidepulldown2 ()
|
---|
119 | {
|
---|
120 | for (var i = 0 ; i < primaries.length ; i++)
|
---|
121 | {
|
---|
122 | var el2 = document.getElementById(primaries[i]+"2");
|
---|
123 | el2.style.display="none";
|
---|
124 | }
|
---|
125 | }
|
---|
126 |
|
---|