function objetoAjax(){
	var xmlhttp=false; 
	try 
	{ 
		// No IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			// IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); } 
	return xmlhttp; 
}

function ocultarFila(codnoticia,estado) {
  if (estado==true){
  	  document.getElementById("visualizar" + codnoticia).style["display"] = "none";
	  document.getElementById("ocultar" + codnoticia).style["display"] = "";
  	  document.getElementById("resultadonoticia" + codnoticia).style["display"] = "";
  }else{
  	  document.getElementById("visualizar" + codnoticia).style["display"] = "";
	  document.getElementById("ocultar" + codnoticia).style["display"] = "none";
  	  document.getElementById("resultadonoticia" + codnoticia).style["display"] = "none";
  }  
}

function MostrarNoticia(codnoticia){
	
	divResultado = document.getElementById('resultadonoticia' + codnoticia);
	divResultado.innerHTML="<br><div align=center><img src=imagenes/web/btn_cargandomini.gif width=56 height=21 /></div>"
	ocultarFila(codnoticia,true);

	var ajax=objetoAjax();
	ajax.open("POST", "obtenernoticia.php", true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	ajax.send("codnoticia="+codnoticia)

	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			divResultado.innerHTML = ajax.responseText
		}
	}	

}
