function autoDiapositivas(manual,direccion) {

var actual=document.getElementById("diapActual");
nactual=Number(actual.value);

	if(nactual==1) {
	
		document.getElementById("capaDiapositiva").innerHTML="<table width=100% border=0 cellspacing=0 cellpadding=7><tr><td width=80% style='border-bottom:1px #CFDDFF solid;border-right:1px #CFDDFF solid;'><a href=leer.php?id="+entradas[nactual][3]+" style=font-size:11.5pt;><b>"+entradas[nactual][0]+"</b></a></td><td width=20% align=right style='font-size:8pt;color:#929292;border-top:1px #CFDDFF solid;border-right:1px #CFDDFF solid;' valign=top><i>"+entradas[nactual][1]+"</i></td></tr><tr><td width=100% colspan=2 style='border-right:1px #CFDDFF solid;border-left:1px #CFDDFF solid;border-bottom:1px #CFDDFF solid;'>"+entradas[nactual][2]+"</td></tr><tr><td width=100% colspan=2><a href=leer.php?id="+entradas[nactual][3]+"#comens>"+entradas[nactual][4]+" comentarios</a> | "+entradas[nactual][5]+" lecturas</table>";

		setTimeout("document.getElementById('diapsActual').value='1'",10);
		for(transp=0,tiempo=30,suma=45; transp<=100; transp+=5,tiempo+=suma) {
			setTimeout("document.getElementById('capaDiapositiva').style.MozOpacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.opacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.KHTML='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.filter='alpha(opacity="+transp+")'",tiempo);
		}
			if(!manual){
			actual.value=nactual+1;
			}
	} else if(manual=="on") {/*
		for(transp=100,tiempo=30,suma=45; transp>=0; transp-=5,tiempo+=suma) {
			setTimeout("document.getElementById('capaDiapositiva').style.MozOpacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.opacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.KHTML='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.filter='alpha(opacity="+transp+")'",tiempo);
		}
*/
		var asieiomakoki="<table width=100% border=0 cellspacing=0 cellpadding=7><tr><td width=80% style='border-bottom:1px #CFDDFF solid;border-right:1px #CFDDFF solid;'><a href=leer.php?id="+entradas[nactual][3]+" style=font-size:11.5pt;><b>"+entradas[nactual][0]+"</b></a></td><td width=20% align=right style='font-size:8pt;color:#929292;border-top:1px #CFDDFF solid;border-right:1px #CFDDFF solid;' valign=top><i>"+entradas[nactual][1]+"</i></td></tr><tr><td width=100% colspan=2 style='border-right:1px #CFDDFF solid;border-left:1px #CFDDFF solid;border-bottom:1px #CFDDFF solid;'>"+entradas[nactual][2]+"</td></tr><tr><td width=100% colspan=2><a href=leer.php?id="+entradas[nactual][3]+"#comens>"+entradas[nactual][4]+" comentarios</a> | "+entradas[nactual][5]+" lecturas</table>";

		document.getElementById('capaDiapositiva').innerHTML=asieiomakoki;
/*
		for(transp=0,suma=45; transp<=100; transp+=5,tiempo+=suma) {
			setTimeout("document.getElementById('capaDiapositiva').style.MozOpacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.opacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.KHTML='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.filter='alpha(opacity="+transp+")'",tiempo);
		}*/
	} else {
		for(transp=100,tiempo=30,suma=45; transp>=0; transp-=5,tiempo+=suma) {
			setTimeout("document.getElementById('capaDiapositiva').style.MozOpacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.opacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.KHTML='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.filter='alpha(opacity="+transp+")'",tiempo);
		}

		var asieiomakoki="<table width=100% border=0 cellspacing=0 cellpadding=7><tr><td width=80% style='border-bottom:1px #CFDDFF solid;border-right:1px #CFDDFF solid;'><a href=leer.php?id="+entradas[nactual][3]+" style=font-size:11.5pt;><b>"+entradas[nactual][0]+"</b></a></td><td width=20% align=right style='font-size:8pt;color:#929292;border-top:1px #CFDDFF solid;border-right:1px #CFDDFF solid;' valign=top><i>"+entradas[nactual][1]+"</i></td></tr><tr><td width=100% colspan=2 style='border-right:1px #CFDDFF solid;border-left:1px #CFDDFF solid;border-bottom:1px #CFDDFF solid;'>"+entradas[nactual][2]+"</td></tr><tr><td width=100% colspan=2><a href=leer.php?id="+entradas[nactual][3]+"#comens>"+entradas[nactual][4]+" comentarios</a> | "+entradas[nactual][5]+" lecturas</table>";

		setTimeout("document.getElementById('capaDiapositiva').innerHTML=\""+asieiomakoki+"\"",tiempo);
		if(!manual) { setTimeout("document.getElementById('diapsActual').value='"+nactual+"'",tiempo); }

		for(transp=0,suma=45; transp<=100; transp+=5,tiempo+=suma) {
			setTimeout("document.getElementById('capaDiapositiva').style.MozOpacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.opacity='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.KHTML='"+transp/100+"'",tiempo);
			setTimeout("document.getElementById('capaDiapositiva').style.filter='alpha(opacity="+transp+")'",tiempo);
		}
		if(!manual) {
			if(nactual==10) {
			actual.value=1;
			} else {
			actual.value=nactual+1;
			} 
		}
	}

	if(!manual) {
		setTimeout("autoDiapositivas()",5000);
	}

}

function diapositiva(sk) {

	var act=document.getElementById("diapActual");
	actu=Number(act.value);
	
	if(actu==10 && sk==1) {
		act.value=1;document.getElementById("diaspActual").value=1;
	}
	else if(actu==1 && sk==-1) {
		act.value=10;document.getElementById("diaspActual").value=10;
	} else {
		act.value=actu+sk;document.getElementById("diapsActual").value=actu+sk;
	}

autoDiapositivas("on",sk);
	
}


function compruebaNumeros(result) {

    setTimeout("compruebaNumeros2("+result+")",100);

}

function enlazaDestacados() {

	for(alto=0,tiempo=25,suma=25;alto<=160; alto+=10,tiempo+=suma) {
		setTimeout("document.getElementById('capaPonlo').style.height='"+alto+"'",tiempo);
	}
}

function compruebaNumeros2(result) {

     var resultado=document.getElementById("numeros").value;
     resultado=Number(resultado);
     result=Number(result);
     if(result==resultado) {

	document.getElementById("comprobante").src="img/ejercicio-hecho.png";
	document.getElementById("comprobante").style.width="12px";
	document.getElementById("comprobante").style.height="12px";
	document.getElementById("numeros").style.color="green";
	document.getElementById("botoncito").removeAttribute('disabled');

     } else {
	document.getElementById("comprobante").src="img/ejercicio-no-hecho.png";
	document.getElementById("comprobante").style.width="12px";
	document.getElementById("comprobante").style.height="12px";
	document.getElementById("numeros").style.color="red";
	document.getElementById("botoncito").disabled="disabled";
     } 

}


function muestraSoloFecha(fecha) {

	var rangoactivado=document.getElementById("rangoactivado");
	if(rangoactivado.value=="si") {
		fechaRango(fecha);
	} else {
		document.location.href='indef.php?fecha='+fecha;
	}

}

function fechaRango(fecha) {

	var fecha1=document.getElementById("rangoFecha1");
	var fecha2=document.getElementById("rangoFecha2");
	
	if(!fecha1.value) {
		fecha1.value=fecha;
	} else {
		fecha2.value=fecha;
		document.location.href='inder.php?fecha1='+fecha1.value+'&fecha2='+fecha2.value;
	}
}

function abrirCerrar(que) {

var abierto=document.getElementById("menuAbierto"+que);
var capa=document.getElementById("capaMenu"+que);
var icono=document.getElementById("mas"+que);

if(que=="Cursos") {
	if(document.getElementById("menuAbiertoEjercicios").value=="si") {
		abrirCerrar('Ejercicios');
	}
	if(document.getElementById("menuAbiertoPublicacion").value=="si") {
		abrirCerrar('Publicacion');
	}
} else if(que=="Ejercicios"){
	if(document.getElementById("menuAbiertoCursos").value=="si") {
		abrirCerrar('Cursos');
	}
	if(document.getElementById("menuAbiertoPublicacion").value=="si") {
		abrirCerrar('Publicacion');
	}
} else {
	if(document.getElementById("menuAbiertoCursos").value=="si") {
		abrirCerrar('Cursos');
	}
	if(document.getElementById("menuAbiertoEjercicios").value=="si") {
		abrirCerrar('Ejercicios');
	}
}
	if(abierto.value=="si") {
		capa.style.display="none";
		abierto.value="no";
		icono.src="img/icono-mas18x18.png";
	} else {
		capa.style.display="block";
		abierto.value="si";
		icono.src="img/icono-menos18x18.png";
	}

}

function flechas(id,modo) {

	if(modo==0) {
		document.getElementById("flecha"+id).src="img/flecha-derecha.png";
	} else {
		document.getElementById("flecha"+id).src="img/flecha-derecha-n.png";
	}

}

function entrarCategoria(id,donde) {

	var capaDonde=document.getElementById("capaMenu"+donde);
	var tiempo=50;

	for(i=0;i<7;i++) {

		setTimeout("document.getElementById('capaMenu"+donde+"').className='opacidad"+i+"'",tiempo);
		tiempo=tiempo+50;

	}
	for(i=6;i>=0;i--) {

		setTimeout("document.getElementById('capaMenu"+donde+"').className='opacidad"+i+"'",tiempo);
		tiempo=tiempo+50;

	}

	setTimeout("entraCat("+id+",'"+donde+"')",350);
}

function entraCat(id,donde) {

	var capaDonde=document.getElementById("capaMenu"+donde);
	var quemeter="<table width=100% border=0 cellspacing=0 cellpadding=0>";
		for(j=0;j<categorias[id]['cuantos'];j++) {

			quemeter+="<tr><td width=15% align=right><img src=img/icono-trans18x18.png border=0></td><td width=85%><table style=cursor:pointer; width=100% border=0 cellspacing=0 cellpadding=0 onmouseover=\"javascript:flechas(55"+j+",1);\" onmouseout=\"javascript:flechas(55"+j+",0);\" onclick=\"javascript:entrarEnCursos("+categorias[id][j]['id']+",'"+donde+"');\"><TR onmouseover=\"this.style.backgroundColor='#FFC987';\" onmouseout=\"this.style.backgroundColor='';\"><td width=80% style=font-size:9pt;>&nbsp;"+categorias[id][j]['nombre']+"</td><td width=20%><img src=img/flecha-derecha.png border=0 style=cursor:pointer; id='flecha55"+j+"'></td></TR></table></td></tr>";
		}

	quemeter+="<tr><td width=15% align=right><img src=img/icono-trans-ultimo18x18.png border=0></td><td width=85%><table style=cursor:pointer; width=100% border=0 cellspacing=0 cellpadding=0 onclick=\"javascript:reiniciarMenu('"+donde+"');\"><TR onmouseover=\"this.style.backgroundColor='#FFC987';\" onmouseout=\"this.style.backgroundColor='';\"><td width=80% style=font-size:9pt;>&nbsp;Volver</td><td width=20%><img src=img/flecha-izquierda.png border=0 style=cursor:pointer;></td></TR></table></td></tr></table>";

	document.getElementById('capaMenu'+donde).innerHTML=quemeter;
}

function reiniciarMenu(donde) {

	var capaDonde=document.getElementById("capaMenu"+donde);
	var tiempo=50;

	for(i=0;i<7;i++) {

		setTimeout("document.getElementById('capaMenu"+donde+"').className='opacidad"+i+"'",tiempo);
		tiempo=tiempo+50;

	}
	for(i=6;i>=0;i--) {

		setTimeout("document.getElementById('capaMenu"+donde+"').className='opacidad"+i+"'",tiempo);
		tiempo=tiempo+50;

	}

	setTimeout("entraCat2('"+donde+"')",350);
}

function entraCat2(donde) {

	document.getElementById("capaMenu"+donde).innerHTML=todos[donde];

}

function entrarEnCursos(id,donde) {
var ventana=document.getElementById("ventanaAAbrir");
var publicando=document.getElementById("publicando"+ventana.value);
	if(publicando.value=="si") {
		if(confirm('Tienes abierta una publicacion en la ventana '+ventana.value+'. Si continuas, perderas el trabajo no guardado. Deseas continuar?')) {
			document.getElementById("iframeGeneral"+ventana.value).src="cursos.php?lenguaje="+id+"&mostrar="+donde;
			publicando.value="no";
		}
	} else {
		if(donde=="Publicacion") { publicando.value="si"; }
		document.getElementById("iframeGeneral"+ventana.value).src="cursos.php?lenguaje="+id+"&mostrar="+donde;
	} 

}

function dividir() {

	document.getElementById("Frames1").style.width="50%";
	document.getElementById("Frames2").style.width="50%";
	document.getElementById("iframeGeneral1").style.width="100%";
	document.getElementById("iframeGeneral2").className="iframeGeneral";
	document.getElementById("iframeGeneral2").style.width="100%";
	document.getElementById("iframeGeneral2").style.height="100%";
	document.getElementById("capaTitulosFrames1").innerHTML="";
	document.getElementById("capaTitulosFrames2").innerHTML="<table width=100% border=0><TR><TD width=50% align=right><img src=img/cerrarv.png></TD><TD width=50% align=left><a href=javascript:; onclick=javascript:cerrarFrame2();><b>Cerrar</b></a></TD></TR></table>";

}
function cerrarFrame2() {

	document.getElementById("Frames1").style.width="99%";
	document.getElementById("Frames2").style.width="1%";
	document.getElementById("iframeGeneral1").style.width="100%";
	document.getElementById("iframeGeneral2").className="";
	document.getElementById("iframeGeneral2").style.width="0%";
	document.getElementById("iframeGeneral2").style.height="0%";
	document.getElementById("capaTitulosFrames1").innerHTML="<table width=100% border=0><TR><TD width=50% align=right><img src=img/dividirv.png></TD><TD width=50% align=left><a href=javascript:; onclick=javascript:dividir();><b>Dividir</b></a></TD></TR></table>";
	document.getElementById("capaTitulosFrames2").innerHTML="";

}

function setVentana(ventana) {

	var cventana=document.getElementById("ventanaAAbrir");
	
	cventana.value=ventana;
	
	if(ventana==1) { document.getElementById("abrVn1").className="ventanaAbrirOn";document.getElementById("abrVn2").className="ventanaAbrirOff"; }
	else {  document.getElementById("abrVn2").className="ventanaAbrirOn";document.getElementById("abrVn1").className="ventanaAbrirOff";  }
}

function paneldecontrol() {

	var ventana=document.getElementById("ventanaAAbrir");
	var publicando=document.getElementById("publicando"+ventana.value);

	if(publicando.value=="si") {
		if(confirm('Tienes abierta una publicacion en la ventana '+ventana.value+'. Si continuas, perderas el trabajo no guardado. Deseas continuar?')) {
			document.getElementById("iframeGeneral"+ventana.value).src="panel.php";
			publicando.value="no";
		}
	} else {
		document.getElementById("iframeGeneral"+ventana.value).src="panel.php";
	}

}


function ocultaMenu() {

	document.getElementById("menuCapa").style.display="none";
	document.getElementById("celdaDondeEstanLosFrames").style.width="1%";
	document.getElementById("celdaDondeEstanLosFrames2").style.width="99%";
	document.getElementById("ponerOcultarOmostrar").innerHTML="<table width=100% border=0><TR><TD width=50% align=right><img src=img/mostrar-menu.png></TD><TD width=50% align=left><a href=javascript:; onclick=javascript:mostrarMenu();><b>Mostrar men&uacute;</b></a></TD></TR></table>";
}


function mostrarMenu() {

	document.getElementById("menuCapa").style.display="block";
	document.getElementById("celdaDondeEstanLosFrames").style.width="22%";
	document.getElementById("celdaDondeEstanLosFrames2").style.width="78%";
	document.getElementById("ponerOcultarOmostrar").innerHTML="<table width=100% border=0><TR><TD width=50% align=right><img src=img/ocultar-menu.png></TD><TD width=50% align=left><a href=javascript:; onclick=javascript:ocultaMenu();><b>Ocultar men&uacute;</b></a></TD></TR></table>";
}


function abreInfoTuto(id) {

	var abierto=document.getElementById("abicerr"+id);

		if(abierto.value=="cerrado") {
			document.getElementById("icMas"+id).src="img/icono-menos10x10.png";
			document.getElementById("lineaRecta"+id).src="img/icono-transp-recto18x18.png";
			document.getElementById("asun"+id).style.fontWeight="bold";
			document.getElementById("infoAmpli"+id).style.display="block";
			document.getElementById("subscscs"+id).style.display="block";
			abierto.value="abierto";
		} else {
			document.getElementById("icMas"+id).src="img/icono-mas10x10.png";
			document.getElementById("lineaRecta"+id).src="img/icono-transp-recto-peq18x18.png";
			document.getElementById("asun"+id).style.fontWeight="normal";
			document.getElementById("infoAmpli"+id).style.display="none";
			document.getElementById("subscscs"+id).style.display="none";
			abierto.value="cerrado";
		}

}

function aumentaTamanoLetra() {

	var tamanoActual=document.getElementById("tamanoLetra");
	tam=Number(tamanoActual.value);
	if(tam<=16) {
		tamanoActual.value=tam+1;
		document.getElementById("textototdo").style.fontSize=tam+1+"pt";
	}

}
function reduceTamanoLetra() {

	var tamanoActual=document.getElementById("tamanoLetra");
	tam=Number(tamanoActual.value);
	if(tam>=7) {
		tamanoActual.value=tam-1;
		document.getElementById("textototdo").style.fontSize=tam-1+"pt";
	}

}

function tipografiamonoespaciada() {

		document.getElementById("textototdo").style.fontFamily="Courier New";

}
function tipografianormal() {

		document.getElementById("textototdo").style.fontFamily="Trebuchet MS";

}

function apareceFuentes() {

var tiempo=25;
	for(i=0;i<7;i++) {

		setTimeout("document.getElementById('estastipos').className='trnsprnc"+i+"'",tiempo);

		tiempo=tiempo+25;
	}
}
function desapareceFuentes() {

var tiempo=25;
	for(i=6;i>=0;i--) {

		setTimeout("document.getElementById('estastipos').className='trnsprnc"+i+"'",tiempo);

		tiempo=tiempo+25;
	}
}

function votar(id,donde,user) {

document.getElementById("inv").src="votar.php?donde="+donde+"&user="+user+"&id="+id;
}

function iniciaReloj() {

	var campo=document.getElementById("reloj");
	var iniciado=document.getElementById("relojiniciado");
	var proxima=document.getElementById("proximaActualizacion");
	var segundosAlActualizar=document.getElementById("actualizaVistaPrevia");

if(iniciado.value=="no"){
	iniciado.value="si";
	if(campo.value<Number(segundosAlActualizar.value)) {
		proxima.value=Number(segundosAlActualizar.value)-Number(campo.value);
		campo.value=Number(campo.value)+1;
	} else if(campo.value==Number(segundosAlActualizar.value)) {
		campo.value=0;
		proxima.value=0;
		vistaPreviaManual();
	}
	setTimeout("iniciaReloj2()",1000);
}

}

function iniciaReloj2() {
	var campo=document.getElementById("reloj");
	var segundosAlActualizar=document.getElementById("actualizaVistaPrevia");
	var proxima=document.getElementById("proximaActualizacion");

	if(campo.value<Number(segundosAlActualizar.value)) {
		proxima.value=Number(segundosAlActualizar.value)-Number(campo.value);
		campo.value=Number(campo.value)+1;
	} else if(campo.value==Number(segundosAlActualizar.value)) {
		campo.value=0;
		proxima.value=0;
		vistaPreviaManual();
	}

	setTimeout("iniciaReloj2()",1000);
}
function vistaPreviaManual() {

	document.formMensaje.action="vista-previa.php";
	document.formMensaje.target="inv";
	document.formMensaje.submit();
	document.formMensaje.texto.focus();

}

function nuevoManual() {

	asunto=document.formMensaje.asunto.value;

	texto=document.formMensaje.texto.value;

if(asunto && texto) {
	document.formMensaje.action="nuevo.php";
	document.formMensaje.target="_self";
	document.formMensaje.submit();
} else { alert('No puedes continuar sin un asunto y un texto'); }
}

function editaresEntrada() {

	document.formMensaje.action="editarentradaya.php";
	document.formMensaje.submit();

}

function editaresAcercademi() {

	document.formMensaje.action="editaracercademiya.php";
	document.formMensaje.submit();
}

function editaresBlogsrecomendados() {

	document.formMensaje.action="editarblogsrecomendadosya.php";
	document.formMensaje.submit();
}

function activaDesactivaRango() {

var siesta=document.getElementById("rangoactivado");
var boton=document.getElementById("botonazo");

	if(siesta.value=="no") {
		siesta.value="si";
		boton.style.backgroundColor="#036700";
		boton.value="Rango activado";
	} else {
		siesta.value="no";
		boton.style.backgroundColor="#8B0000";
		boton.value="Rango desactivado";
	}

}

function activarBuscador() {
	document.getElementById('capaBusqueda').style.display="block";
	document.getElementById('oscurecer').style.display="block";
	document.getElementById('capaBusqueda3').style.display="block";
	document.getElementById('capaBusqueda3').innerHTML="";
	
	for(alto=5,tiempo=25; alto<=160; alto+=5,tiempo+=25) {
		setTimeout("document.getElementById('capaBusqueda').style.height='"+alto+"px'",tiempo);
	}
	
	setTimeout("document.getElementById('capaBusqueda2').style.display='block'",tiempo);
	tiempo+=100;
	setTimeout("document.getElementById('cadenaBusqueda').focus()",tiempo);

	for(opacidad=0,tiempo2=30; opacidad<=75; opacidad+=4,tiempo2+=30) {
		setTimeout("document.getElementById('oscurecer').style.MozOpacity='"+opacidad/100+"'",tiempo2);
		setTimeout("document.getElementById('oscurecer').style.opacity='"+opacidad/100+"'",tiempo2);
		setTimeout("document.getElementById('oscurecer').style.KHTML='"+opacidad/100+"'",tiempo2);
		setTimeout("document.getElementById('oscurecer').style.filter='alpha(opacity="+opacidad+")'",tiempo2);
	}


} 

function desactivarBusqueda() {

	document.getElementById("activadoAvanzado").value="no";
	document.getElementById("capaAvanzada").style.display="none";
	document.getElementById('capaBusqueda2').style.display="none";

	document.getElementById('capaBusqueda3').style.display="none";

	for(alto=160,tiempo=25; alto>=0; alto-=5,tiempo+=25) {
		setTimeout("document.getElementById('capaBusqueda').style.height='"+alto+"px'",tiempo);
	}

	setTimeout("document.getElementById('capaBusqueda').style.display='none'",tiempo);

	for(opacidad=70,tiempo2=25; opacidad>=0; opacidad-=2,tiempo2+=25) {
		setTimeout("document.getElementById('oscurecer').style.MozOpacity='"+opacidad/100+"'",tiempo2);
		setTimeout("document.getElementById('oscurecer').style.opacity='"+opacidad/100+"'",tiempo2);
		setTimeout("document.getElementById('oscurecer').style.KHTML='"+opacidad/100+"'",tiempo2);
		setTimeout("document.getElementById('oscurecer').style.filter='alpha(opacity="+opacidad+")'",tiempo2);
	}

	
	setTimeout("document.getElementById('oscurecer').style.display='none'",tiempo2);
	setTimeout("document.getElementById('capaBusqueda').style.width='360px'",tiempo2);
	setTimeout("document.getElementById('capaBusqueda').style.marginLeft='-180px'",tiempo2);
}

function buscarYa()  {

	ampliarBusquedaParaResultados();
	var activado=document.getElementById("activadoAvanzado").value;

	if(activado=="si") { etiqueta="&etiqueta="+document.getElementById("buscarPorEtiqueta").value; }
	else { etiqueta=""; }
 
	document.buscador.action="buscar.php?avanzado="+activado+""+etiqueta;

	setTimeout("document.buscador.submit()",500);
}

function ampliarBusquedaParaResultados() {
	
	for(alto=120,tiempo=25; alto<=620; alto+=20,tiempo+=25) {
		setTimeout("document.getElementById('capaBusqueda').style.height='"+alto+"px'",tiempo);
	}

	for(ancho=360,tiempo=100; ancho<=740; ancho+=20,tiempo+=25) {
		setTimeout("document.getElementById('capaBusqueda').style.width='"+ancho+"px'",tiempo);
		setTimeout("document.getElementById('capaBusqueda').style.marginLeft='-"+ancho/2+"px'",tiempo);
	}

}
function buscadorAvanzado() {

	document.getElementById("activadoAvanzado").value="si";
	document.getElementById("capaAvanzada").style.display="block";

}
