// DMTR.ORG 2005

	function getValue(){
		document.posta.parametro.value = document.paint.getValue();
		//posta.submit();
	}
	
	function update() {
		//imagem = "file://"+document.post.posta.filename.value;
		imagem = "file://"+document.posta.filename.value;
		document.images['pic'].src = imagem;
		alert (imagem);
	}	
	
	function excluir (n) {
		if (confirm('erase?'))
		location.href='excluir.php?id='+n
	}

	function excluir_comment (id,id_msg) {
		if (confirm('erase?'))
		location.href='excluir_comment.php?id='+id+'&id_msg='+id_msg;
	}	

	function editar (n) {
		//if (confirm('erase?'))
		location.href='editar.php?id='+n
	}
	
	function mudapagina(n) {
		document.pagina.pagina.value = n;
		document.pagina.submit();
	}

	function add() {
		display('post', b++%2);
		document.getElementById('botao').value='Insert';
		var f = document.getElementById("posta");
		f.titulo.value = '';
		f.autor.value = '';
		f.mensagem.value = '';
		f.keywords.value = '';
		f.id_edit.value = '';
	}

	function edit(id, titulo, autor, texto, palavraschave) {
		//var f = document.posta;
		f = document.getElementById("posta");
		f.titulo.value = titulo;
		f.autor.value = autor;
		f.mensagem.value = texto;
		f.keywords.value = palavraschave;
		f.id_edit.value = id;
		
		/*
		document.posta.titulo.value = titulo;
		document.posta.autor.value = autor;
		document.posta.mensagem.value = texto;
		document.posta.keywords.value = palavraschave;
		document.posta.id_edit.value = id;
		*/
	//	document.posta.botao.value = edit;
		document.getElementById("botao").value="Edit";
		display('post', 1);
		window.scrollTo(0,0);
	}
		
		
	function excluir (mensagem, row, id) {
		if (confirm(mensagem))
			location.href='/delete.php?id='+id+'&row='+row;
	}

		

function display(id, on_off) { 
	var el = document.all ? document.all[id] : document.getElementById(id);  if(el) el.style.display = on_off ? '' : 'none'; 
}
		
		
	var ycsdone;
	function visita(acao) {
		var z;
		if (ycsdone)
		return;
		z="&r="+escape(document.referrer);
		z=z+"&b="+escape(navigator.appName+" "+navigator.appVersion);
		var w=parseFloat(navigator.appVersion);
		if (w > 2.0) {
			z=z+"&s="+screen.width+"x"+screen.height;
			z=z+"&o="+navigator.platform;
			var v="1.2";
		if (navigator.appName != "Netscape") {
			z=z+"&c="+screen.colorDepth;
		} else {
			z=z+"&c="+screen.pixelDepth
		}
		z=z+"&j="+navigator.javaEnabled();
	} else {
		v=1.0;
	}
	z=z+"&v="+v;
	
	if (acao!=undefined) {
		z=z+"&acao="+acao;
		document.writeln("<img src=\"visita.php?"+z+"\" width=0 height=0>");
		ycsdone=1;
		}
	}	
	
	
	
	


function varr() {
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.appName+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.appVersion+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.platform+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.width+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.height+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.colorDepth+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+screen.pixelDepth+'">');
	document.writeln('<input type=hidden name="varr[]" value="'+navigator.javaEnabled()+'">');
	//document.writeln('<input type=hidden name="plataforma" value="'+navigator.platform+'">');
	//document.writeln('<input type=hidden name="appname" value="'+navigator.appName+'">');
}
	