2 function init_toggle_elem(id_str,show_user_str,hide_user_str) {
3 toggle_toggle_elem(id_str,show_user_str,hide_user_str,'hide');
6 function toggle_toggle_elem(id_str,show_user_str,hide_user_str,mode) {
7 var other_mode = ( mode == "hide" ) ? "show" : "hide";
8 var user_str = ( mode == "hide" ) ? show_user_str : hide_user_str;
9 var link = document.createElement("a");
10 link.setAttribute("href","javascript:toggle_toggle_elem(\""+id_str+"\",\""+show_user_str+"\",\""+hide_user_str+"\",\""+other_mode+"\")");
11 var txt = document.createTextNode("["+user_str+"]");
12 link.appendChild(txt);
13 if (document.getElementById("js_"+id_str).childNodes.length > 0) {
14 document.getElementById("js_"+id_str).replaceChild(link,document.getElementById("js_"+id_str).firstChild);
16 document.getElementById("js_"+id_str).appendChild(link);
18 toggleDisplay(document.getElementById("html_"+id_str));
21 function toggleDisplay(obj) {
22 if (obj.style.display == "none")
23 obj.style.display = "";
25 obj.style.display = "none";
28 function hide_tab(id) {
29 var tab = document.getElementById(id);
31 tab.style.display = "none";
33 var item = document.getElementById(id+"link");
35 item.style.fontWeight = "normal";
39 function show_tab(id) {
40 var tab = document.getElementById(id);
42 tab.style.display = "";
44 var item = document.getElementById(id+"link");
46 item.style.fontWeight = "bold";
48 var item = document.getElementById("palllink");
50 item.style.fontWeight = "normal";
54 function init_tab_list(id) {
56 hide_tab("pdownload");
58 show_tab("pbinaries");
60 var tablist = document.getElementById(id);
62 var list = document.createElement("ul");
63 if (document.getElementById("pdesctab")) {
64 var item = document.createElement("li");
65 item.setAttribute("id","pdesctablink");
66 var link = document.createElement("a");
67 link.setAttribute("href","javascript:go_to_tab(\"pdesctab\")");
68 var txt = document.createTextNode("[ Description ]");
69 link.appendChild(txt);
70 item.appendChild(link);
71 list.appendChild(item);
73 if (document.getElementById("pbinaries")) {
74 var item = document.createElement("li");
75 item.setAttribute("id","pbinarieslink");
76 var link = document.createElement("a");
77 link.setAttribute("href","javascript:go_to_tab(\"pbinaries\")");
78 var txt = document.createTextNode("[ Description ]");
79 link.appendChild(txt);
80 item.appendChild(link);
81 list.appendChild(item);
83 if (document.getElementById("pdeps")) {
84 var item = document.createElement("li");
85 item.setAttribute("id","pdepslink");
86 var link = document.createElement("a");
87 link.setAttribute("href","javascript:go_to_tab(\"pdeps\")");
88 var txt = document.createTextNode("[ Dependencies ]");
89 link.appendChild(txt);
90 item.appendChild(link);
91 list.appendChild(item);
93 if (document.getElementById("pdownload")) {
94 var item = document.createElement("li");
95 item.setAttribute("id","pdownloadlink");
96 var link = document.createElement("a");
97 link.setAttribute("href","javascript:go_to_tab(\"pdownload\")");
98 var txt = document.createTextNode("[ Download ]");
99 link.appendChild(txt);
100 item.appendChild(link);
101 list.appendChild(item);
103 if (list.childNodes.length > 0) {
104 var item = document.createElement("li");
105 item.setAttribute("id","palllink");
106 var link = document.createElement("a");
107 link.setAttribute("href","javascript:show_all_tabs()");
108 var txt = document.createTextNode("[ All ]");
109 link.appendChild(txt);
110 item.appendChild(link);
111 list.appendChild(item);
114 tablist.appendChild(list);
116 show_tab("pdesctab");
117 show_tab("pbinaries");
120 function go_to_tab(id) {
122 hide_tab("pdesctab");
123 hide_tab("pbinaries");
124 hide_tab("pdownload");
127 if (id == "pdesctab" || id == "pbinaries") {
129 hide_tab("pdownload");
130 show_tab("pdesctab");
131 show_tab("pbinaries");
133 if (id == "pdownload") {
134 hide_tab("pdesctab");
135 hide_tab("pbinaries");
137 show_tab("pdownload");
141 function show_all_tabs() {
142 show_tab("pdesctab");
143 show_tab("pbinaries");
145 show_tab("pdownload");
146 var item = document.getElementById("palllink");
148 item.style.fontWeight = "bold";