	function valida(form,letra){
		var msg = "";
		for(i=0; i<form.length; i++){
			var obg = form[i].name.charAt(0);
			if(obg == letra){
				if(form[i].value == "")
					msg += "- "+form[i].name.substring(1,(form[i].name.length)).toUpperCase()+"\n";
			}
		}
		if(msg != ""){
			alert("Os seguintes campos devem ser preenchidos:\n"+msg);
			return false;
		}
	}
	
	function posiciona_bloqueio(div_destino,largura,altura,forum){
		if ( window.innerHeight && window.scrollMaxY ){ // Firefox
			document.body.style.overflowX = "hidden";
			pageWidth = window.screen.width;
			pageHeight = window.innerHeight + window.scrollMaxY;
		}
		else if( document.body.scrollHeight > document.body.offsetHeight ){ // all but Explorer Mac
			pageWidth = window.screen.width;
			pageHeight = document.body.scrollHeight;
		}
		else{ // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			pageWidth = window.screen.width;
			pageHeight = document.body.offsetHeight + document.body.offsetTop;
		}

		var camada = document.getElementById("bloqueio");
		camada.style.top = document.body.scrollTop;
		camada.style.display = 'block';
		camada.style.height = pageHeight + 'px';
		camada.style.width = pageWidth + 'px';
		
		var moldura = document.getElementById(div_destino);
		moldura.style.width = largura + 'px';
		moldura.style.left = Math.floor((pageWidth-largura)/2)-20 + 'px';
		moldura.style.display = 'block';
		if( typeof( window.innerWidth ) == 'number' )
			//Non-IE
			myHeight = window.innerHeight;
		else
		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
			//IE 6+ in 'standards compliant mode'
			myHeight = document.documentElement.clientHeight;
		else
		if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
			//IE 4 compatible
			myHeight = document.body.clientHeight;
	
		molduraTop = (document.body.scrollTop)?document.body.scrollTop:document.documentElement.scrollTop;
		molduraTop += Math.floor((myHeight-altura)/2);
		moldura.style.top = molduraTop + 'px';
		
		document.getElementById(div_destino).style.display = "block";
		document.getElementById("forum").value = forum;
	}
	
	function desabilita(){
		document.getElementById("msg-forum").style.display = "none";
		document.getElementById("bloqueio").style.display = "none";
	}
	
	function desabilita2(){
		document.getElementById("aviso").style.display = "none";
		document.getElementById("bloqueio").style.display = "none";
	}
	
	function deletar(cod){
		var resposta = confirm("Deseja realmente excluir esse registro?");
		if(resposta == true)
			location.href = location.href + "?c=2&p=" +cod;
		else
			return false;
	}
