//**Start Encode**
var ajax;
window.onload = function(){
	ChecaMsg();
                window.setInterval('ChecaMsg()', 300000);
				
}
function suportAjax() {
	ajax = null;
	try {
		ajax = new XMLHttpRequest();
	} catch (e) {
		try {
			ajax = new ActiveXObject("Msxml.XMLHTTP");
		} catch (e) {
			try {
				ajax = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Seu navegador não suporta AJAX!");
				return false;
			}
		}
	}
}


function ChecaMsg(){
	suportAjax();
	ajax.onreadystatechange = function() {
		if(ajax.readyState == 1) {
			loading(true);
		}
		if(ajax.readyState == 4 || ajax.readyState == "complete") {
			if(ajax.status == 200) {
				loading(false);
				$('titulo_noticias').innerHTML = ajax.responseText;
			}
		}
	}
// requisicaoHTTP("GET","mostrarnot.php",true);
  
  	var url = "mostrarnot.php";
//	url = url +"&sid="+		Math.random();
	ajax.open("GET",url,true);
	ajax.send(null);
}

function ExibirMsg(msg1){

   // document.filtro.categorias.value + '&id=' + this.value,true,trataModelo);
 //        var nova1 = document.getElementById("titulo_noticias");
//		  nova1.innerHTML = msg1;  
     
}
//exibe as novas mensagens
function trataDados(){
                var info = ajax.responseText;
                if(info)
                        ExibirMsg(info);
}
function loading(acao) {
	if(acao == true) {
		$('titulo_noticias').innerHTML = '<img src="images/loading.gif">';
	} else {
		$('titulo_noticias').innerHTML = '';
	}
}

