function MostrarAcces(){
	document.getElementById('f_ad_email').style.visibility = "visible";
}
function OcultarAcces(){
	document.getElementById('f_ad_email').style.visibility = "hidden";
}

function mail(texto){

    var mailres = true;            
    var cadena = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890@._-";
    
    var arroba = texto.indexOf("@",0);
    if ((texto.lastIndexOf("@")) != arroba){ arroba = -1;}
    
    var punto = texto.lastIndexOf(".");
                
     for (var contador = 0 ; contador < texto.length ; contador++){
        if (cadena.indexOf(texto.substr(contador, 1),0) == -1){
            mailres = false;
            break;
        }
    }

    <!--if ((arroba > 1) && (arroba + 1 < punto) && (punto + 1 < (texto.length)) && (mailres == true) && (texto.indexOf("..",0) == -1)){-->
   if((arroba != -1) && (punto != -1)){
       mailres = true;
	}else{
       mailres = false;
	}
                
    return mailres;
} 

function Accept(){
	if(document.getElementById('id_email').value == ''){
		alert("Debe indicarnos su correo electr\u00f3nico.");
	}else{
		if(!mail(document.getElementById('id_email').value)){
			alert("Direcci\u00f3n de correo electr\u00f3nico erronea.");
		}else{
			document.getElementById('usr_email').method ="post";
			document.getElementById('usr_email').action ="caracteristicas_programa.php?v=1"	
			document.getElementById('usr_email').submit();	
		}
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}
function validar(){
	if(document.forms[0].acceptar.checked){
		document.location.href= './php/down.php';
	}else{
		window.alert("Para descargar el programa debe leer las Condiciones generales y \nmarcar la casilla 'Acepto las condiciones generales'.");
	}
}
/* Funcions enquesta */

function DadesEnquesta(){
		document.getElementById('fenquesta').method = 'post';
		document.getElementById('fenquesta').action = 'php/proces_enquesta.php';
		document.getElementById('fenquesta').submit();
}

/* Funcions tancar div propaganda */

function cerrarPopup(div){
	
	document.getElementById('popup').style.visibility = 'hidden';
	document.getElementById('fons_popup').style.visibility = 'hidden';
	
}