//---------------------------------------------------------------------//			
function objetoAjax(){
 var xmlhttp=false;
 try { 
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
 catch (e){
	try {
	  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} 
	  catch (E) {
		xmlhttp = false;}
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}
//---------------------------------------------------------------------//			
function objetoAjax_ping(){
 var xmlhttp_ping=false;
 try { 
   xmlhttp_ping = new ActiveXObject("Msxml2.XMLHTTP"); }
 catch (e){
	try {
	  xmlhttp_ping = new ActiveXObject("Microsoft.XMLHTTP");} 
	  catch (E) {
		xmlhttp_ping = false;}
  }
  if (!xmlhttp_ping && typeof XMLHttpRequest!='undefined') {
	xmlhttp_ping = new XMLHttpRequest();
  }
  return xmlhttp_ping;
}
//---------------------------------------------------------------------//			
function objetoAjax2(){
 var xmlhttp2=false;
 try { 
   xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP"); }
 catch (e){
	try {
	  xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");} 
	  catch (E) {
		xmlhttp2 = false;}
  }
  if (!xmlhttp2 && typeof XMLHttpRequest!='undefined') {
	xmlhttp2 = new XMLHttpRequest();
  }
  return xmlhttp2;
}
//--------------------------------------------------------------------------------------
function ping(valores){
	//valores = "ping=1";
	//var divResultado = document.getElementById(resultado);
	ajax_ping=objetoAjax_ping();
	ajax_ping.open("POST", "noticias_ajax.php",true);
	ajax_ping.onreadystatechange=function() {
	if (ajax_ping.readyState==4) {
			
			//divResultado.innerHTML=ajax.responseText;
			//alert(ajax.responseText);
			if (ajax_ping.responseText == "actualiza")
				setTimeout("actualizar();",500);
			//alert(ajax.responseText);
			}
		}
   ajax_ping.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
   ajax_ping.send(valores);
   //alert(valores);
} 
function actualizar_area(resultado,valores){
	//alert(valores);
	var divResultado = document.getElementById(resultado);
	ajax=objetoAjax();
	ajax.open("POST", "noticias_ajax.php",true);
	ajax.onreadystatechange=function() {
	if (ajax.readyState==4) {
			divResultado.innerHTML=ajax.responseText;
			//alert("hola");
			//setTimeout("focusnombre()",500);
			//alert(ajax.responseText);
			}
		}
   ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
   ajax.send(valores);
   //alert(valores);
} 
function actualizar_area2(resultado,valores){
	
	var divResultado2 = document.getElementById(resultado);
	ajax2=objetoAjax2();
	ajax2.open("POST", "noticias_ajax.php",true);
	ajax2.onreadystatechange=function() {
	if (ajax2.readyState==4) {
			divResultado2.innerHTML=ajax2.responseText;
			//alert("hola");
			//setTimeout("focusnombre()",500);
			//alert(ajax.responseText);
			}
		}
   ajax2.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
   ajax2.send(valores);
   //alert(valores);
} 
// JavaScript Document