// JavaScript Document
function despliega(id){
	if(document.getElementById(id).style.display=='none'){
		document.getElementById(id).style.display='block';
	}
	else{
		document.getElementById(id).style.display='none';
	}
}
var xml1Http;

function ajaxboletin_select(){ 
	xml1Http=GetXmlHttpObject();
	if (xml1Http==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var id=document.getElementById("listado_boletin").value;
	
	var url="boletin_in.php";
	url=url+"?id="+id;
	
	xml1Http.onreadystatechange=stateBoletin;
	xml1Http.open("GET",url,true);
	xml1Http.send(null); 
	//var el = document.getElementById("btnadd");
	//el.setAttribute("onclick","openlist('noticias')");
	//var el_icon = document.getElementById("btnadd_icon");
	//el_icon.setAttribute("onclick","openlist()");	

}

function ajaxboletin(id){ 
	xml1Http=GetXmlHttpObject();
	if (xml1Http==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	var url="boletin_in.php";
	url=url+"?id="+id;
	
	xml1Http.onreadystatechange=stateBoletin;
	xml1Http.open("GET",url,true);
	xml1Http.send(null); 
	//var el = document.getElementById("btnadd");
	//el.setAttribute("onclick","openlist('noticias')");
	//var el_icon = document.getElementById("btnadd_icon");
	//el_icon.setAttribute("onclick","openlist()");	

}

function stateBoletin() { 
	if (xml1Http.readyState==4 || xml1Http.readyState=="complete"){ 	
		document.getElementById("texto_ppatrominial").innerHTML=xml1Http.responseText;
	}	
}

function ajaxnoticias(id,tipo){ 
	xml1Http=GetXmlHttpObject();
	if (xml1Http==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	var url="noticias_in.php";
	url=url+"?id="+id+"&tipo="+tipo;
	xml1Http.onreadystatechange=stateNoticias;
	xml1Http.open("GET",url,true);
	xml1Http.send(null); 
	//var el = document.getElementById("btnadd");
	//el.setAttribute("onclick","openlist('noticias')");
	//var el_icon = document.getElementById("btnadd_icon");
	//el_icon.setAttribute("onclick","openlist()");	

}

function stateNoticias() { 
	if (xml1Http.readyState==4 || xml1Http.readyState=="complete"){ 	
		document.getElementById("detalle_noticia").innerHTML=xml1Http.responseText;
	}	
}

function GetXmlHttpObject(){ 
	var objXMLHttp=null;
	if (window.XMLHttpRequest){
		objXMLHttp=new XMLHttpRequest();
	}
		else if (window.ActiveXObject){
		
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp
}
