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";