
function enviarTopico() {
	if(document.getElementById("tituloTopico").value.length < 3) {
		alert("Por favor, entre com um título válido.");
		return false;
	}
	if(document.getElementById("corpoTopico").value.length < 5) {
		alert("Por favor, entre com uma mensagem válida.");
		return false;
	}


	arrParam = new Array();
	arrParam[0] = new Array("id_topico",document.getElementById("id_topico").value);
	arrParam[1] = new Array("tituloTopico",document.getElementById("tituloTopico").value);
	arrParam[2] = new Array("corpoTopico",document.getElementById("corpoTopico").value);
	arrParam[3] = new Array("acao","E");

	param = montaParam(arrParam);
	loadLink("forum","menu2",param);
}

function enviarPost() {
	if(document.getElementById("corpoPost").value.length < 3) {
		alert("Por favor, entre com uma resposta válida.");
		return false;
	}

	arrParam = new Array();
	arrParam[0] = new Array("id_topico",document.getElementById("id_postTopico").value);
	arrParam[1] = new Array("corpo",document.getElementById("corpoPost").value);
	arrParam[2] = new Array("acao","E");

	param = montaParam(arrParam);
	loadLink("forum_int","menu2",param);
}

function verRespostas(id_topico) {
	arrParam = new Array();
	arrParam[0] = new Array("id_topico",id_topico);

	param = montaParam(arrParam);
	loadLink("forum_int","menu2",param);
}

function postar(id_pergunta,resposta) {
	document.getElementById("id_pergunta").value = id_pergunta;
	document.getElementById("resposta").value = resposta.replace(/\[br\]/g,"\n");
	mostraBoxResposta();
	document.getElementById("resposta").focus();
}

function mostraBoxTopico() {
	div = document.getElementById("boxTopico");
	div.style.display = "block";
	if(IE)
		div.style.top = tempY - 325 +"px";
	else
		div.style.top = tempY - 570 +"px";
}

function incluirTopico() {
	document.getElementById("id_topico").value = "";
	document.getElementById("tituloTopico").value = "";
	document.getElementById("corpoTopico").value = "";

	mostraBoxTopico();
}

function alterarTopico(id_topico) {
	xajax_alterarTopico(id_topico);
}

function responderTopico(id_topico) {
	document.getElementById("id_postTopico").value = id_topico;
	document.getElementById("boxPost").style.display = "block";
}

