	function init () {
		 var coll = document.getElementById("forum").getElementsByTagName("DIV");
		 for (i=0; i < coll.length; i++) {
			var ch = coll[i].childNodes;
			coll[i].className = "close";

			for (j=0; j < ch.length; j++) {
				if (ch[j].tagName == "H3") {
					ch[j].onclick = collapse;
				}
				//if (ch[j].className == "reply") {
				//	ch[j].href="javascript:void(0)";
				//	ch[j].onclick = cite;
				//}
			}
		}
	}

	function collapse () {
		var p = this.parentNode;
		if (p.className == "open") { 
			smartNextSibling(this).style.display ="none";
			p.className = "close"
			this.id = "close";
		}
		else if (p.className == "close") {
			smartNextSibling(this).style.display = "block";
			p.className = "open";
			this.id = "open";
		}
	}

    var obj = new Object();
    function add_message (forum_nick, parent_id, theme) {
        var sFeatures = "height=335,width=500,status=yes,toolbar=no,menubar=no,location=no; scrollbars=no";
        obj.forum = forum_nick;
        obj.parent = parent_id;
        obj.theme = theme;
//        window.showModalDialog("/forum/message.shtml?"+forum_nick, obj, sFeatures);
        var win = openWin ('/forum/message.shtml?'+forum_nick);

     }

	function cite () {
		//params.text = smartPreviousSibling(this).innerHTML;
		var win = openWin ('/forum/message.shtml?'+forum_nick+'&parent_id='+parent_id);
		

	}

	function openWin (url) {
		var features = "height=335,width=500,status=yes,toolbar=no,menubar=no,location=no; scrollbars=no";
		win = window.open (url, 'forum_add_message', features);
		win.focus();
        return win;
	}

	var params = new Object;
