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

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