function visibilidade(id){
	objeto = document.getElementById(id);
	if(objeto.style.display == 'block'){
		objeto.style.display = 'none';
	}else{
		objeto.style.display = 'block';
	}
}
function visivel(id){ document.getElementById(id).style.display = 'block'; }
function invisivel(id){ document.getElementById(id).style.display = 'none'; }
function alertar(bloco, titulo, id, tema){
	visivel(bloco);
	objetoAlerta = document.getElementById(bloco);
	conteudo = '<div class="link">'+ tema +' ';
	conteudo += '<a href="ler.php?doc='+id+'">';
	conteudo += titulo;
	conteudo += '</a></div><div class="fechar"><a href="javascript:;" onclick="fechaAlerta(' + id + ');"><img src="imagens/fechar_alerta.gif" id="fecharAlerta" align="right" /></a></div>';
	objetoAlerta.innerHTML = conteudo;
	// document.getElementById('paginaCorpo').style.background = 'url(bg_alerta.gif) repeat-y top left';
}
function fechaAlerta(id){
	Cookies.create('alerta_' + id, "parar", 1);
	invisivel('paginaAviso');
	goToFrame();
}
function responder(id){
	objeto = document.getElementById(id);
	if(objeto.style.display == 'block'){
		objeto.style.display = 'none';
		objeto.innerHTML = '';
	}else{
		objeto.style.display = 'block';
		objeto.innerHTML = document.getElementById('frameComentar_0').innerHTML;
		elemento = objeto.getElementsByTagName('FORM')[0];
		eID = id.replace(/frameComentar_/, '');

		elemento.name='comentar_'+eID;
		elemento.id='comentar_'+eID;
		elemento.formularioDIV.value='frameComentar_'+eID;
		elemento.processoDIV.value='processarComentario_'+eID;
		elemento.getElementsByTagName('A')[0].rel = 'comentar_'+eID;
		elemento.nome.value = '';
		elemento.contagem.value = '500';
		elemento.comentario.value = '';
		elemento.resposta.value = eID;
		elemento.nome.focus();
	}
}
function imagemZoom(imagem){
	ewd_getcontent('ver_imagem.php?imagem='+imagem, 'paginaConteudoFoto');
}
function characterCount(form, field, count, maxchars) {
	if (field.value.length > maxchars) {
		field.value = field.value.substring(0, maxchars);
		alert("LIMITE EXCEDIDO:\n\n- Vocę excedeu o limite de "+maxchars+" caracteres.");
	} else {
		form.contagem.value = maxchars - field.value.length;
	}
}
function autenticar(formulario){
	var biscoito = Cookies.read('usuario');
	if(biscoito == null){
		autenticacaowindow=dhtmlmodal.open('autenticacaoBox', 'iframe', 'autenticar.php?idForm='+formulario, 'Autenticar Usuário', 'width=350px,height=350px,center=1,resize=0,scrolling=0');
	}else{
		document.getElementById(formulario).nome.value = biscoito;
		document.getElementById(formulario).comentario.focus();
	}
}
function enviarMateria(codigo){
	autenticacaowindow=dhtmlmodal.open('enviarMat', 'iframe', 'enviar.php?id='+codigo, 'Enviar Matéria', 'width=615px,height=320px,center=1,resize=0,scrolling=0');
}
function getFlashMovieObject(movieName){
	if (window.document[movieName]){ return window.document[movieName]; }
	if (navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName]){ return document.embeds[movieName]; }
	}else{ return document.getElementById(movieName);
	}
}
function goToFrame(){
	var flashMovie=getFlashMovieObject("logoRadar64");
	flashMovie.GotoFrame(1);
}
function votarEnquete(nome){
	var enquete = nome;
	var votou = Cookies.read(enquete);
	if(votou == null){
		this.votou=true;
		Cookies.create(enquete, "votou", 5);
		var cooked = Cookies.read(enquete);
		if(cooked == null){
			alert("Seu navegador nao esta aceitando cookies.\n\nDesculpe-nos, mas voce nao pode votar nesta enquete!");
		}
	}else{
		alert("Voce ja votou nesta enquete!");
	}
}