source: trunk/MagicSoft/Mars/datacenter/db/menu.js@ 8331

Last change on this file since 8331 was 8241, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
File size: 3.1 KB
Line 
1
2//functions and arrays needed for showing and hiding the menu on the db websites
3ids = new Array( "all", "info", "info2", "stat", "fail", "cal", "star", "limits", "ranges", "showquery");
4statarr = new Array( 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
5
6function 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
21function hide(el,img)
22{
23 el.style.display="none";
24 if (img)
25 {
26 img.src='../plus.png';
27 img.alt='+';
28 }
29}
30
31function show(el,img)
32{
33 el.style.display="block";
34 if (img)
35 {
36 img.src='../minus.png';
37 img.alt='-';
38 }
39}
40
41function showhide (id)
42{
43 var el = document.getElementById(id);
44 var img = document.getElementById(id+"button");
45 if (el.style.display == 'block')
46 hide(el,img);
47 else
48 {
49 show(el,img);
50 if (id!="showquery")
51 {
52 var el2 = document.getElementById("all");
53 var img2 = document.getElementById("allbutton");
54 show(el2,img2);
55 }
56 }
57
58 var soso = document.getElementById("sh");
59 soso.value = setdisplays();
60}
61
62function getdisplay()
63{
64 var stat = document.getElementById("sh");
65 statvalue=stat.value;
66 for (var i = 0 ; i < ids.length ; i++)
67 {
68 var status = statvalue.slice(i,i+1);
69 var el = document.getElementById(ids[i]);
70 var img = document.getElementById(ids[i]+"button");
71 if (!el)
72 continue;
73 status==0 ? hide(el,img) : show(el,img);
74 }
75}
76
77//functions and arrays needed for the function for plotdb.php
78primaries = new Array( "fSequenceFirst", "fRunNumber", "fDataSetNumber");
79
80function showpulldown (id2)
81{
82 var el = document.getElementById(id2);
83 el.style.display="inline";
84 for (var i = 0 ; i < primaries.length ; i++)
85 {
86 if (primaries[i]==id2)
87 continue;
88 var el2 = document.getElementById(primaries[i]);
89 el2.style.display="none";
90 var el3 = document.getElementById(primaries[i]+"2");
91 if (el3.style.display=='inline')
92 var add=id2;
93 el3.style.display="none";
94 }
95 if (add)
96 {
97 var el4 = document.getElementById(id2+"2");
98 el4.style.display="inline";
99 }
100}
101
102function showpulldown2 ()
103{
104 count=0;
105 for (var i = 0 ; i < primaries.length ; i++)
106 {
107 var el = document.getElementById(primaries[i]);
108 if (el.style.display=='inline')
109 {
110 var el2 = document.getElementById(primaries[i]+"2");
111 el2.style.display="inline";
112 }
113 else
114 count++;
115 }
116 if (count==3)
117 for (var i = 0 ; i < primaries.length ; i++)
118 {
119 var el2 = document.getElementById(primaries[i]+"2");
120 el2.style.display="inline";
121 }
122}
123
124function hidepulldown2 ()
125{
126 for (var i = 0 ; i < primaries.length ; i++)
127 {
128 var el2 = document.getElementById(primaries[i]+"2");
129 el2.style.display="none";
130 }
131}
132
Note: See TracBrowser for help on using the repository browser.