var seccionpag;
var bot;
var contador=0;
var imag=new Array();
var imagen;

// Declaro el ID del DIV que actuará como contenedor de los datos recibidos

onload=function () {
	imagenf=document.getElementById("imagenflecha");
	csub=document.getElementById("submenu");
	bot0=document.getElementById("boton0");
	bot1=document.getElementById("boton1");
	bot2=document.getElementById("boton2");	
	bot3=document.getElementById("boton3");	
	bot4=document.getElementById("boton4");
	bot5=document.getElementById("boton5");		
	bot6=document.getElementById("boton6");	
	bot7=document.getElementById("boton7");	
	bot8=document.getElementById("boton8");	
	bot9=document.getElementById("boton9");	
	bot10=document.getElementById("boton10");	
	bot11=document.getElementById("boton11");
	bot12=document.getElementById("boton12");		
	bot13=document.getElementById("boton13");	
	bot14=document.getElementById("boton14");	
	bot15=document.getElementById("boton15");	
	bot16=document.getElementById("boton16");	
	bot17=document.getElementById("boton17");	
	bot18=document.getElementById("boton18");
	bot19=document.getElementById("boton19");
	bot20=document.getElementById("boton20");
	bot11.value="";
	mostrar1=document.getElementById("boto1");	
	cuadro=document.getElementById("cc");	
	csub.style.display="none";	
	imagen="imagen/f1.png";
	imagenf.src=imagen;
	bot0.style.display="block";		
	bot1.style.display="none";	
	bot2.style.display="none";
	bot3.style.display="none";
	bot4.style.display="none";	
	bot5.style.display="none";
	bot6.style.display="none";
	bot7.style.display="none";
	bot8.style.display="none";
	bot9.style.display="none";	
	bot10.style.display="none";	
	bot11.style.display="none";	
	bot12.style.display="none";	
	bot13.style.display="none";
	bot14.style.display="none";
	bot15.style.display="none";
	bot16.style.display="none";
	bot17.style.display="none";	
	bot18.style.display="none";	
	bot19.style.display="none";	
	bot20.style.display="none";
	//botones(0);
	//cuadro=document.getElementById("cc");		
	cuadro.style.display="block";
	
}
function nuevoAjax(){ 
	var xmlhttp=false; 
	try 
	{ 
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			// Creacion del objet AJAX para IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 

	return xmlhttp; 
}
function botones(bot){
	cboton=bot;
	//alert(cboton);
	if (cboton == ""){	
		contador=0;
		cuadro.style.display="block";  
		bot0.style.display="block";		
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";	
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="none";
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}	
	if (cboton == "1"){		
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="block";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";
		if (contador=="0"){
			csub.style.display="block";
			var imagen="imagen/f2.png";
			imagenf.src=imagen;	
			contador=1;
		}else{
			csub.style.display="none";
			var imagen="imagen/f1.png";
			imagenf.src=imagen;
			contador=0;
		}
		cuadro.style.display="block";
	}
	if (cboton == "2"){	
		contador=0;
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="block";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="none";
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}
	if (cboton == "3"){
		contador=0;
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="block";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";
		csub.style.display="none";		
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}
	if (cboton == "4"){	
		contador=0;
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="block";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="none";
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}
	if (cboton == "5"){	
		contador=0;
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="block";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";
		csub.style.display="none";
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}
	if (cboton == "6"){	
		contador=0;
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="block";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="none";
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}
	if (cboton == "7"){	
		contador=0;
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="block";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="none";		
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}
	if (cboton == "8"){	
		contador=0;
		//alert("8");
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="block";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="none";
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}
	if (cboton == "9"){	
		contador=0;	
		var cadena = "formulario.php";	
		abrir(cadena,0,0,0,0,0,0,0,600,450,150,300,1);

	}
	/*if (cboton == "10"){	
		contador=0;
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="block";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="none";
		cuadro.style.display="block";
		var imagen="imagen/f1.png";
		imagenf.src=imagen;
	}*/
	if (cboton == "11"){			
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="block";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";		
	}
	if (cboton == "12"){			
		cuadro.style.display="block";  
		bot13.style.display="block";
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="block";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";		
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";		
	}
	if (cboton == "13"){			
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="block";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";
		bot10.style.display="block";
	}
	if (cboton == "14"){	
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="block";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";		
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";
		bot10.style.display="block";
	}
	if (cboton == "15"){			
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="block";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";		
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";
		bot10.style.display="block";
	}
	if (cboton == "16"){
		//alert("entro14");
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="block";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";
		bot10.style.display="block";
	}
	if (cboton == "17"){	
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="block";	
		bot19.style.display="none";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";
		bot10.style.display="block";
	}
	if (cboton == "18"){	
		//alert("entro14");
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="block";
		bot20.style.display="none";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";
		bot10.style.display="block";
	}
	if (cboton == "19"){	
		//alert("entro19");
		cuadro.style.display="block";  
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="none";	
		bot12.style.display="none";	
		bot13.style.display="none";
		bot14.style.display="none";
		bot15.style.display="none";
		bot16.style.display="none";
		bot17.style.display="none";	
		bot18.style.display="none";	
		bot19.style.display="none";
		bot20.style.display="block";
		bot11.value="";
		mostrar1.style.display="none";	
		csub.style.display="block";
		bot10.style.display="block";
	}
	if (cboton == "100"){
		window.location.href="index.php";
	}
	
}

function ampli(secno,id){
	cuadro.style.display="none";  
	bot11.value="";
	mostrar1.style.display="block";		
	ajax=nuevoAjax(); 
	
	ajax.open("GET", "mostrar.php?id="+id+"&secno="+secno+"&ms="+new Date().getTime(),  true);
	//ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	//ajax.setRequestHeader("Content-Type", "text/html; charset=utf-8");	
	ajax.onreadystatechange=function() {
	if (ajax.readyState==4) {
		txt=encodeURI(ajax.responseText);
		//alert(txt);
		txt2=txt.replace(/\+/gi," ");
		//alert(txt2)
		mostrar1.innerHTML = ajax.responseText;
	}
	}
	ajax.send(null)	
}

function ampli2(secno,id){	
	cuadro.style.display="none";
	mostrar1.style.display="block";	 	
	ajax=nuevoAjax(); 
	ajax.open("GET", "mostrar.php?id="+id+"&secno="+secno+"&ms="+new Date().getTime(),  true);
	//ajax.setRequestHeader("Content-Type", "text/html; charset=utf-8");	
	ajax.onreadystatechange=function() {
	if (ajax.readyState==4) {
		txt=escape(ajax.responseText);
		
		txt2=txt.replace(/\+/gi," ");
		mostrar1.innerHTML = ajax.responseText;
	}
	}
	ajax.send(null)	
}

function ampli3(){	
	cuadro.style.display="none";
	mostrar1.style.display="block";	 	
	ajax=nuevoAjax(); 
	ajax.open("GET", "repor.php"+"&ms="+new Date().getTime(),  true);
	ajax.setRequestHeader("Content-Type", "text/html; charset=utf-8");	
	ajax.onreadystatechange=function() {
	if (ajax.readyState==4) {
		txt=escape(ajax.responseText);
		txt2=txt.replace(/\+/gi," ");
		mostrar1.innerHTML = ajax.responseText;
	}
	}
	ajax.send(null)	
}


function refre(){
	window.location.href="index.php";
}


function buscar(){
		var bus=document.getElementById("busqueda").value;
		bot0.style.display="none";	
		bot1.style.display="none";	
		bot2.style.display="none";
		bot3.style.display="none";
		bot4.style.display="none";	
		bot5.style.display="none";
		bot6.style.display="none";
		bot7.style.display="none";
		bot8.style.display="none";
		bot9.style.display="none";	
		bot10.style.display="none";	
		bot11.style.display="block";	
		cuadro.style.display="none";
		ajax81=nuevoAjax();  	
		mostrar1.style.display="none";	
		cuadro.style.display="none";	
		ajax81.open("GET", "notibus.php?busq="+bus+"&ms="+new Date().getTime(),  true);
		
		var cadena = "bus="+bus+"&ms="+new Date().getTime();		
		ajax81.onreadystatechange=function() {
		if (ajax81.readyState==4) {		
			bot11.innerHTML= ajax81.responseText;		
		}
	}
	ajax81.send(null)		
}



function objetoAjax(){ 
	var xmlhttp=false; 
	try 
	{ 
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			// Creacion del objet AJAX para IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 

	return xmlhttp; 
}

function borrar(){
	document.forms[0].reset();
}


function pag(pagi){
	ajaxnl=objetoAjax();
	ajaxnl.open("POST","notiloc.php");
	var cadena = "pag="+pagi+"&ms="+new Date().getTime();	
	ajaxnl.onreadystatechange=function() {
		if (ajaxnl.readyState==4) {
			document.getElementById("boton1").innerHTML = ajaxnl.responseText
		}
	}
	ajaxnl.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	ajaxnl.send(cadena);	
}

function pag2(pagi){
	ajaxno=objetoAjax();
	ajaxno.open("POST","notiopi.php");
	var cadena = "pag2="+pagi+"&ms="+new Date().getTime();	
	ajaxno.onreadystatechange=function() {
		if (ajaxno.readyState==4) {
			document.getElementById("boton4").innerHTML = ajaxno.responseText
		}
	}
	ajaxno.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	ajaxno.send(cadena);	
}

function pag3(pagi){
	ajaxns=objetoAjax();
	ajaxns.open("POST","notisoc.php");
	var cadena = "pag3="+pagi+"&ms="+new Date().getTime();	
	ajaxns.onreadystatechange=function() {
		if (ajaxns.readyState==4) {
			document.getElementById("boton2").innerHTML = ajaxns.responseText
		}
	}
	ajaxns.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	ajaxns.send(cadena);	
}

function pag4(pagi){
	ajaxnd=objetoAjax();
	ajaxnd.open("POST","notidep.php");
	var cadena = "pag4="+pagi+"&ms="+new Date().getTime();	
	ajaxnd.onreadystatechange=function() {
		if (ajaxnd.readyState==4) {
			document.getElementById("boton3").innerHTML = ajaxnd.responseText
		}
	}
	ajaxnd.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	ajaxnd.send(cadena);	
}

function pag5(pagi){
	ajaxni=objetoAjax();
	ajaxni.open("POST","notiinf.php");
	var cadena = "pag5="+pagi+"&ms="+new Date().getTime();	
	ajaxni.onreadystatechange=function() {
		if (ajaxni.readyState==4) {
			document.getElementById("boton5").innerHTML = ajaxni.responseText
		}
	}
	ajaxni.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	ajaxni.send(cadena);	
}




function audio(audio){	
	var cadena = "mp3.php?audio="+audio;	
	abrir(cadena,0,0,0,0,0,0,0,360,260,100,100,1);
}
function video(video){	
	var cadena = "flv.php?video="+video;	
	abrir(cadena,0,0,0,0,0,0,0,360,380,100,100,1);
}

function abrir(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir){ 
    var opciones = "fullscreen=" + pantallacompleta + 
                 ",toolbar=" + herramientas + 
                 ",location=" + direcciones + 
                 ",status=" + estado + 
                 ",menubar=" + barramenu + 
                 ",scrollbars=" + barrascroll + 
                 ",resizable=" + cambiatamano + 
                 ",width=" + ancho + 
                 ",height=" + alto + 
                 ",left=" + izquierda + 
                 ",top=" + arriba; 
    var ventana = window.open(direccion,"venta",opciones,sustituir); 

}      
function formulario(){	
	var cadena = "formulario.php";	
	abrir(cadena,0,0,0,0,0,0,0,360,260,100,100,1);
}

function cimagen(nombre, id, archivo, secc){
	//alert(id);
	//alert(archivo);	
	var ids=id;
	var seccion=secc;
	var archivo=archivo;
	//alert(id)
	//alert(archivo)

	/*if(img.height>img.width){
		document.getElementById(destino).height=tamano;
		document.getElementById(destino).width=((tamano*img.width)/img.height);
	}else{
		document.getElementById(destino).width=tamano;
		document.getElementById(destino).height=((tamano*img.height)/img.width);
	}*/
	
	ajaxcima=objetoAjax();	
	ajaxcima.open("POST","titulos.php");	                   			
	var cadena = "id="+ids+"&archivo="+archivo+"&ms="+new Date().getTime();	
	ajaxcima.onreadystatechange=function() {	
			if(ajaxcima.readyState==1){
				if (seccion==1){
					document.getElementById("cargando").style.display="block";					 
					document.getElementById("cargando");innerHTML = "cargando..";			
				}				
            }else if(ajaxcima.readyState==4){
			if (seccion==0){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulosm").innerHTML = ajaxcima.responseText
				document.getElementById("imagenes2").src=nombre;			
			}
			if (seccion==1){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos1").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesnoti").src=nombre;			
			}
			if (seccion==2){
				document.getElementById("cargando").style.display="none";   
				document.getElementById("titulos2").innerHTML = ajaxcima.responseText
				document.getElementById("imageneseventos").src=nombre;			
			}
			if (seccion==3){
				document.getElementById("cargando").style.display="none"; 
				document.getElementById("titulos3").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesest").src=nombre;			
			}
			if (seccion==4){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos4").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesact").src=nombre;			
			}
			if (seccion==5){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos5").innerHTML = ajaxcima.responseText
				document.getElementById("imagenescol").src=nombre;			
			}
			if (seccion==6){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos6").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesco").src=nombre;			
			}
			if (seccion==7){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos7").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesre").src=nombre;			
			}
			if (seccion==8){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos8").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesp").src=nombre;			
			}
			if (seccion==9){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos9").innerHTML = ajaxcima.responseText
				document.getElementById("imagenestav").src=nombre;			
			}
			if (seccion==10){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos10").innerHTML = ajaxcima.responseText
				document.getElementById("imagenestte").src=nombre;			
			}
			if (seccion==11){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos11").innerHTML = ajaxcima.responseText
				document.getElementById("imagenestter").src=nombre;			
			}
			if (seccion==12){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos12").innerHTML = ajaxcima.responseText
				document.getElementById("imagenestrel").src=nombre;			
			}
			if (seccion==13){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos13").innerHTML = ajaxcima.responseText
				document.getElementById("imagenestterm").src=nombre;			
			}
			if (seccion==14){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos14").innerHTML = ajaxcima.responseText
				document.getElementById("imagenestsalud").src=nombre;			
			}
			if (seccion==15){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos15").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesmedico").src=nombre;			
			}
			if (seccion==16){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos16").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesgay").src=nombre;			
			}
			if (seccion==17){
				document.getElementById("cargando").style.display="none";
				document.getElementById("titulos17").innerHTML = ajaxcima.responseText
				document.getElementById("imagenesrural").src=nombre;			
			}
		
		}
	}
	ajaxcima.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	ajaxcima.send(cadena);	
}

function cimagen2(nombre, destino, tamano_string){
	document.getElementById(destino).src=nombre;
	img = new Image();	
	img.src = nombre;
	tamano=parseInt(tamano_string);
	/*if(img.height>img.width){
		document.getElementById(destino).height=tamano;
		document.getElementById(destino).width=((tamano*img.width)/img.height);
	}else{
		document.getElementById(destino).width=tamano;
		document.getElementById(destino).height=((tamano*img.height)/img.width);
	}*/
}


