	function expandThread(id){

		var divStyle = document.getElementById("div_" + id).style;
		var imgPlusMinus = document.getElementById("img_" + id);
		
		if ("none"==divStyle.display){
			divStyle.display = "block";
			imgPlusMinus.src = "img/minus.gif";
		} else {
			divStyle.display = "none";
			imgPlusMinus.src = "img/plus.gif";
		}
	}
	
	function newThread(){
		
		reset();
		theForm = document.forms[0];
		document.getElementById("div_Forum").style.display = "none";
		document.getElementById("div_Input").style.display = "block";
		
		theForm.previo.value = "0";
		theForm.comentario.focus();
	}

	function reply(id){
	
		reset();
		theForm = document.forms[0];
		title = document.getElementById("span_" + id).innerText;
		theForm.tema.value = (("re:" != title.substring(0, 3))?"re: ":"") + title;
		theForm.previo.value = id;

		document.getElementById("div_Forum").style.display = "none";
		document.getElementById("div_Input").style.display = "block";

		theForm.comentario.focus();
	}
	
	function cancel(){
		reset();
		document.getElementById("div_Input").style.display = "none";
		document.getElementById("div_Forum").style.display = "block";
	}
	
	
	function reset(){

		theForm = document.forms[0];
		theForm.previo.value = "";
		theForm.autor.value = "Anonimo";
		theForm.tema.value = "";
		theForm.comentario.value = "";

	}

	function submit(){
		
		theForm = document.forms[0];
		theForm.submit();
	}

	function deleteMsg(id){
		theForm = document.forms[0];
		if (confirm("Are you sure you want to delete this message and all the replies to it?")){
		
			theForm.hiddenDelete.value = id;

		}
	}
