2 function init_toggle_elem(id_str,user_str) {
3 toggle_toggle_elem(id_str,user_str,'hide');
6 function toggle_toggle_elem(id_str,user_str,mode) {
7 var other_mode = ( mode == "hide" ) ? "show" : "hide";
8 var link = document.createElement("a");
9 link.setAttribute("href","javascript:toggle_toggle_elem(\""+id_str+"\",\""+user_str+"\",\""+other_mode+"\")");
10 var txt = document.createTextNode("["+other_mode+" "+user_str+"]");
11 link.appendChild(txt);
12 if (document.getElementById("js_"+id_str).childNodes.length > 0) {
13 document.getElementById("js_"+id_str).replaceChild(link,document.getElementById("js_"+id_str).firstChild);
15 document.getElementById("js_"+id_str).appendChild(link);
17 toggleDisplay(document.getElementById("html_"+id_str));
20 function toggleDisplay(obj) {
21 if (obj.style.display == "none")
22 obj.style.display = "";
24 obj.style.display = "none";
27 function hide_tab(id) {
28 var tab = document.getElementById(id);
30 tab.style.display = "none";
32 var item = document.getElementById(id+"link");
34 item.style.fontWeight = "normal";
38 function show_tab(id) {
39 var tab = document.getElementById(id);
41 tab.style.display = "";
43 var item = document.getElementById(id+"link");
45 item.style.fontWeight = "bold";
47 var item = document.getElementById("palllink");
49 item.style.fontWeight = "normal";
53 function init_tab_list(id) {
55 hide_tab("pdownload");
57 show_tab("pbinaries");
59 var tablist = document.getElementById(id);
61 var list = document.createElement("ul");
62 if (document.getElementById("pdesctab")) {
63 var item = document.createElement("li");
64 item.setAttribute("id","pdesctablink");
65 var link = document.createElement("a");
66 link.setAttribute("href","javascript:go_to_tab(\"pdesctab\")");
67 var txt = document.createTextNode("[ Description ]");
68 link.appendChild(txt);
69 item.appendChild(link);
70 list.appendChild(item);
72 if (document.getElementById("pbinaries")) {
73 var item = document.createElement("li");
74 item.setAttribute("id","pbinarieslink");
75 var link = document.createElement("a");
76 link.setAttribute("href","javascript:go_to_tab(\"pbinaries\")");
77 var txt = document.createTextNode("[ Description ]");
78 link.appendChild(txt);
79 item.appendChild(link);
80 list.appendChild(item);
82 if (document.getElementById("pdeps")) {
83 var item = document.createElement("li");
84 item.setAttribute("id","pdepslink");
85 var link = document.createElement("a");
86 link.setAttribute("href","javascript:go_to_tab(\"pdeps\")");
87 var txt = document.createTextNode("[ Dependencies ]");
88 link.appendChild(txt);
89 item.appendChild(link);
90 list.appendChild(item);
92 if (document.getElementById("pdownload")) {
93 var item = document.createElement("li");
94 item.setAttribute("id","pdownloadlink");
95 var link = document.createElement("a");
96 link.setAttribute("href","javascript:go_to_tab(\"pdownload\")");
97 var txt = document.createTextNode("[ Download ]");
98 link.appendChild(txt);
99 item.appendChild(link);
100 list.appendChild(item);
102 if (list.childNodes.length > 0) {
103 var item = document.createElement("li");
104 item.setAttribute("id","palllink");
105 var link = document.createElement("a");
106 link.setAttribute("href","javascript:show_all_tabs()");
107 var txt = document.createTextNode("[ All ]");
108 link.appendChild(txt);
109 item.appendChild(link);
110 list.appendChild(item);
113 tablist.appendChild(list);
115 show_tab("pdesctab");
116 show_tab("pbinaries");
119 function go_to_tab(id) {
121 hide_tab("pdesctab");
122 hide_tab("pbinaries");
123 hide_tab("pdownload");
126 if (id == "pdesctab" || id == "pbinaries") {
128 hide_tab("pdownload");
129 show_tab("pdesctab");
130 show_tab("pbinaries");
132 if (id == "pdownload") {
133 hide_tab("pdesctab");
134 hide_tab("pbinaries");
136 show_tab("pdownload");
140 function show_all_tabs() {
141 show_tab("pdesctab");
142 show_tab("pbinaries");
144 show_tab("pdownload");
145 var item = document.getElementById("palllink");
147 item.style.fontWeight = "bold";