function catnew(){
	document.getElementById("cat_new").style.display = 'block';
	document.getElementById("cat_exist").style.display = 'none';
	document.getElementById("tipo").value = 'new';

}

function catexist(){
	
	document.getElementById("cat_exist").style.display = 'block';
	document.getElementById("cat_new").style.display = 'none';
	document.getElementById("tipo").value = 'exist';

}

function mostraAss(){
	 document.getElementById("inserirAss").style.display="block"; 
	 
	 document.getElementById('novoAss').innerHTML = "<a href=\"javascript:escondAss();\" class=\"textoAzulForum_11\" >Esconder novo assunto </a>";

}

function escondAss(){

 document.getElementById("inserirAss").style.display="none"; 
 document.getElementById('novoAss').innerHTML = "<a href=\"javascript:mostraAss();\" class=\"textoAzulForum_11\" >Cirar novo assunto </a>";

}

function mostraCat(){
	 document.getElementById("inserirCat").style.display="block"; 
	 
	 document.getElementById('novaCat').innerHTML = "<a href=\"javascript:escondCat();\" class=\"textoAzulForum_11\" >Esconder nova categoria </a>";

}

function escondCat(){

 document.getElementById("inserirCat").style.display="none"; 
 document.getElementById('novaCat').innerHTML = "<a href=\"javascript:mostraCat();\" class=\"textoAzulForum_11\" >Cirar nova categoria </a>";

}

function rsp(valor){

if(valor == 0){
	valor = document.getElementById("idmsg").value;
	ver = "assunto";
}else{
	ver = "mensagem";
}
	



	function createRequestObject() 
	{ //funcao que permite criar um objecto do tipo XMLREQUEST
           var ro;
           var browser = navigator.appName;
           if(browser == "Microsoft Internet Explorer")
		   {
               ro = new ActiveXObject("Microsoft.XMLHTTP"); // ie
           }else{
               ro = new XMLHttpRequest(); // firefox/safari
           }
               return ro;
     }
	 
   var http = createRequestObject(); //inicia o objecto do tipo XMLRequest
   

   
	http.open('post', 'modules/ref_forum.php', 'true' ); // constroi o pedido ajax
   http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   http.onreadystatechange = handleResponse; // fica a espera do pedido
   http.send("valor="+valor+"&ver="+ver ); // envia o pedigo */
 
   function handleResponse() 
	  {
                        
          if(http.readyState == 4)
          {
              var response = http.responseText;
              var update = new Array();
    
			  if(response.lenght!=0 )
			  {
                
                     
					   var oEditor = FCKeditorAPI.GetInstance('postr') ;
					 oEditor.SetHTML(response) ;
                
                    
              }
                     
          }
       }





}

function limparMsg(){
var oEditor = FCKeditorAPI.GetInstance('postr') ;
oEditor.SetHTML( "" ) ;

}



