/*function buscar(){
var cadena=document.getElementById("q").value;
if(cadena.length<3){
alert("Error en b\u00FAsqueda, ingresa un texto correcto");
}else{	
     
window.location.href='buscador.php?q='+cadena
    }
}
*/

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/*function votar(cod){

if(cod==1){
//alert("validar opcion");
document.formencuesta.submit();
}
if(cod==2){
//alert("Ver Resultados");
document.getElementById('form_encuesta').style.display='none';
document.getElementById('resultados_encuesta').style.display='block';
}
if(cod==3){
//alert("Volver a formulario para votar");
document.getElementById('resultados_encuesta').style.display='none';
document.getElementById('form_encuesta').style.display='block';
}

}


function votarp(cod){

if(cod==1){
//alert("validar opcion");
document.pagina_formencuesta.submit();
}
if(cod==2){
//alert("Ver Resultados");
document.getElementById('pagina_form_encuesta').style.display='none';
document.getElementById('pagina_resultados_encuesta').style.display='block';
}
if(cod==3){
//alert("Volver a formulario para votar");
document.getElementById('pagina_resultados_encuesta').style.display='none';
document.getElementById('pagina_form_encuesta').style.display='block';
}

}
*/

// BUSCAR
function buscar(){
//var quehacer=document.getElementById("dondebuscar");
var cadena=document.getElementById("criterio").value;
dondebuscar1=document.getElementsByName("dondebuscar1");
//alert(dondebuscar.length)
var seleccionado=8;
for(var i=0; i<dondebuscar1.length; i++){
if(dondebuscar1[i].checked){
seleccionado=i;
}
}

//alert(seleccionado);
//alert(cadena);
if(cadena.length==0){
alert("Ingresa lo que vas a buscar");
}else{	
     if(seleccionado==1){
	           //alert("es cero");
                   window.location.href='http://www.google.com/search?q='+cadena;
                     //document.buscador.q.value='';
      }else{
	          if(seleccionado==0){
		                //alert("es uno");
                              document.buscador.submit();		
                }else{
	                   alert("Escoge donde quieres buscar")
                     }
           }
    }

}
// FIN BUSCAR




function doOutline(targetId1,targetId2,targetId3) {
  var targetElement1;
  var targetElement2;
  var targetElement3;
  targetElement1 = document.getElementById(targetId1);
  targetElement2 = document.getElementById(targetId2);
  targetElement3 = document.getElementById(targetId3);
     
	 if (targetElement1.style.display == "none") {
        targetElement1.style.display = "block";				
     } else {
        targetElement1.style.display = "none";				
	}
	
	if (targetElement2.style.display == "block") {
        targetElement2.style.display = "none";				
     } else {
        targetElement2.style.display = "block";				
	}

	if (targetElement3.style.display == "none") {
        targetElement3.style.display = "block";				
     } else {
        targetElement3.style.display = "none";				
	}
	
}


function sobrefoto(targetId4) {
  var targetElement4;
  targetElement4 = document.getElementById(targetId4);
     
	 if (targetElement4.style.display == "none") {
        targetElement4.style.display = "block";				
     } else {
        targetElement4.style.display = "none";				
	}	
}

function sobreIconofoto(targetId5) {
  var targetElement5;
  targetElement5 = document.getElementById(targetId5);
     
	 if (targetElement5.style.display == "none") {
        targetElement5.style.display = "block";				
     } else {
        targetElement5.style.display = "none";				
	}	
}




function registroboletin(){
	var clavemail=0;
var xmail=document.formularioboletin.mailboletin.value;
//xmail=document.getElementsByName("mailboletin");	
//xaccion=document.getElementsByName("accion");	

if(xmail.length==0){
clavemail=1;
 alert("Escribe un e-mail v\u00E1lido.");
}	

if(clavemail==0){
var filter=/^[A-Za-z_.][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
if (filter.test(xmail)){
claveZ=0;
}else{
alert("Escriba una direcci\u00F3n de correo v\u00E1lida.");
    clavemail=1;
}
}

if(clavemail==0){
cargaXML('controles/controlBoletin.php?accion=ok&mail='+xmail); 	
}

}
