function CambiarGaleria(valor){
    if(valor.value != ''){
        if(valor.value == 'autor'){
            location.href = "buscarusuario.php";
        }
        else if(valor.value == 'votadas'){
            location.href = "las10masc.php";
        }
        else if(valor.value == 'videos'){
            location.href = "videos.php";
        }
        else{
            
            location.href = "galeria.php?id="+valor.value;
        }
    }
}
function mostrar(){ 
    document.getElementById('comentarfoto').style.display="block";
}
function mostrarcom(){       
    document.getElementById('comentarfotorich').style.position="relative";
    document.getElementById('comentarfotorich').style.top="0px";
    document.getElementById('comentarfotorich').style.left="0px";
    document.getElementById('comentarfoto3').style.display="none";
}
function ocultarcom(){ 
    document.getElementById('comentarfotorich').style.position="absolute";
    document.getElementById('comentarfotorich').style.top="-1000px";
    document.getElementById('comentarfotorich').style.left="-1000px";
}
function ocultar(){ 
    document.getElementById('comentarfoto').style.display="none";
}
function mostrar2(){ 
    document.getElementById('comentarfoto2').style.display="block";
}
function ocultar2(){ 
    document.getElementById('comentarfoto2').style.display="none";
}
function mostrar3(){ 
    document.getElementById('comentarfoto3').style.display="block";
    document.getElementById('comentarfotorich').style.position="absolute";
    document.getElementById('comentarfotorich').style.top="-1000px";
    document.getElementById('comentarfotorich').style.left="-1000px";
}
function ocultar3(){ 
    document.getElementById('comentarfoto3').style.display="none";
}
function mostrar4(){ 
    document.getElementById('comentarfoto4').style.display="block";
}
function ocultar4(){ 
    document.getElementById('comentarfoto4').style.display="none";
}
function mostrar5(){ 
    document.getElementById('comentarfoto5').style.display="block";
}
function ocultar5(){ 
    document.getElementById('comentarfoto5').style.display="none";
}
function MostrarBanner(){
    if(document.getElementById('ocultarbanner').style.display == "block"){
        document.getElementById('ocultarbanner').style.display = "none";
    }
    else{
        document.getElementById('ocultarbanner').style.display = "block";
    } 
}
function MostrarBanner2(){
    if(document.getElementById('ocultarbanner2').style.display == "block"){
        document.getElementById('ocultarbanner2').style.display = "none";
    }
    else{
        document.getElementById('ocultarbanner2').style.display = "block";
    } 
}
function ActualizarImagen(img){
    document.getElementById('muestra').src = img.value;
}
function mostrar44(id,usu){
    document.getElementById('fotoid2').value = id;
    document.getElementById('men_iddestinatario2').value = usu;
    document.getElementById('comentarfoto4').style.display="block"; 
    
}
function mostrar55(id,usu){
    document.getElementById('fotoid').value = id;
    document.getElementById('com_idcomentario').value = usu;
    document.getElementById('comentarfoto5').style.display="block"; 
    
}
function mostrar55video(id,usu){
    document.getElementById('videoid').value = id;
    document.getElementById('cov_idcomentario').value = usu;
    document.getElementById('comentarfoto5').style.display="block"; 
    
}
function CambiarBoton(valor1){
    valor2 = document.getElementById('tip_id');
    if(valor1.value == valor2.value){
        document.getElementById('botonrenovar').style.display = "block";
        document.getElementById('botonampliar').style.display = "none";    
    }
    else{
        document.getElementById('botonrenovar').style.display = "none";
        document.getElementById('botonampliar').style.display = "block";
    }
}


PositionX = 10;
PositionY = 10;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function AbreImagen(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Cargando ...</title><style>body{margin:0px;}</style>');
writeln('<sc'+'ript>');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=10-(document.documentElement.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images["imagenes"].width;');
writeln('window.innerHeight=document.images["imagenes"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');
writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="imagenes" src='+imageURL+' style="display:block"></body></html>');
close();    
}}


function ComprobarInscri(){
    bool = false; 
    if(document.getElementById('nombre').value == "") {
        bool = false;
        alert("Nombre y apellidos obligatorios");
        document.getElementById('nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('email').value == "") {
            bool = false;
            alert("Email obligatorio");
            document.getElementById('email').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('provincia').value == "") {
            bool = false;
            alert("Provincia obligatoria");
            document.getElementById('provincia').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('pais').value == "") {
            bool = false;
            alert("País obligatorio");
            document.getElementById('pais').focus();
        }
        else{
            bool = true;
        }
    }         
    if(bool){
        document.getElementById('frmdatosincri').submit();
    }
}
function EnviarPrivado(){
    bool = false; 
    if(document.getElementById('paranombre').value == "") {
        bool = false;
        alert("El 'para' es obligatorio");
        document.getElementById('paranombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('men_cuerpo').value == "") {
            bool = false;
            alert("Mensaje obligatorio");
            document.getElementById('men_cuerpo').focus();
        }
        else{
            bool = true;
        }
    }         
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}
function comprobarregistro(){
    bool = false; 
    if(document.getElementById('usu_nombre').value == "") {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('checkacepto').checked=0;
        document.getElementById('usu_nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('usu_emailusu').value == "") {
            bool = false;
            alert("Email obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('usu_emailusu').focus();
        }
        else{
            bool = true;
        }
    }  
    if(bool){ 
        if(document.getElementById('usu_foro').value == "") {
            bool = false;
            alert("Nombre del foro obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('usu_foro').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('usu_contrasenausu').value == "") {
            bool = false;
            alert("Contraseña obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('usu_contrasenausu').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('usu_contrasenausu').value != document.getElementById('usu_contrasena2').value) {
            bool = false;
            alert("Las contraseñas no coinciden");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('usu_contrasena2').focus();
        }
        else{
            bool = true;
        }
    }        
    if(bool){
        document.getElementById('checkacepto').checked = 1;
        document.getElementById('botonregistro').style.display="block";
    }
}
function comprobarregistro2(){
    bool = false; 
    if(document.getElementById('usu_nombre').value == "") {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('checkacepto').checked=0;
        document.getElementById('botonregistro').style.display="none";
        document.getElementById('usu_nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('usu_emailusu').value == "") {
            bool = false;
            alert("Email obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('usu_emailusu').focus();
        }
        else{
            bool = true;
        }
    }  
    if(bool){ 
        if(document.getElementById('usu_foro').value == "") {
            bool = false;
            alert("Nombre del foro obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('usu_foro').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('usu_contrasenausu').value == "") {
            bool = false;
            alert("Contraseña obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('usu_contrasenausu').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('usu_contrasenausu').value != document.getElementById('usu_contrasena2').value) {
            bool = false;
            alert("Las contraseñas no coinciden");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('usu_contrasena2').focus();
        }
        else{
            bool = true;
        }
    }        
    if(bool){
        document.getElementById('checkacepto').checked = 1;
        document.getElementById('botonregistro').style.display="block";
        document.getElementById('frmdatosregistro').submit();
    }
}
function EnviarMensaje(){
    bool = false;  
    if(document.getElementById('men_cuerpo').value == "") {
        bool = false;
        alert("Mensaje obligatorio");
        document.getElementById('men_cuerpo').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatosmensajeria').submit();
    }
}
function EnviarMensaje2(){
    bool = false;  
    if(document.getElementById('men_cuerpo2').value == "") {
        bool = false;
        alert("Mensaje obligatorio");
        document.getElementById('men_cuerpo2').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatos3').submit();
    }
}
function EnviarMensaje3(){
    bool = false; 
    if(document.getElementById('nombre').value == "") {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('emailusu').value == "") {
            bool = false;
            alert("Email de contacto obligatorio");
            document.getElementById('emailusu').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){  
        if(document.getElementById('men_cuerpo2').value == "") {
            bool = false;
            alert("Mensaje obligatorio");
            document.getElementById('men_cuerpo2').focus();
        }
        else{
            bool = true;
        }
    }       
    if(bool){
        document.getElementById('frmdatos3').submit();
    }
}
function EnviarComentario(){
    save_in_textarea_all();
    document.getElementById('frmdatos2').submit();
}
function Las10mas(){
    document.getElementById('frmlas10mas').submit();
}
function EnviarComentario2(){
    bool = false;  
    if(document.getElementById('com_comentario2').value == "") {
        bool = false;
        alert("Comentario obligatorio");
        document.getElementById('com_comentario2').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatos4').submit();
    }
}
function EnviarComentario2Video(){
    bool = false;  
    if(document.getElementById('cov_comentario2').value == "") {
        bool = false;
        alert("Comentario obligatorio");
        document.getElementById('cov_comentario2').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatos4').submit();
    }
}
function SubirFoto(){
    bool = false; 
    if(document.getElementById('fot_nombre').value == "") {
        bool = false;
        alert("No se pueden subir imágenes sin título");
        document.getElementById('fot_nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('fot_imagen').value == "") {
            bool = false;
            alert("Selecciona una imagen");
            document.getElementById('fot_imagen').focus();
        }
        else{
            bool = true;
        }
    }        
    if(bool){
        document.getElementById('frmdatos').submit();
    }    
}

function SubirFoto2(){
    bool = false; 
    if(document.getElementById('fot_nombre').value == "") {
        bool = false;
        alert("No se pueden subir imágenes sin título");
        document.getElementById('fot_nombre').focus();
    }
    else{
        bool = true;
    }       
    if(bool){
        document.getElementById('frmdatos').submit();
    }    
}

function ComprobarRevista(){
    bool = false; 
    if(document.getElementById('comr_comentario').value == "") {
        bool = false;
        alert("El comentario es obligatorio");
        document.getElementById('comr_comentario').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatosrevista').submit();
    }
}
function ComprobarUsu(){
    bool = false; 
    if(document.getElementById('usu_nombre').value == "") {
        bool = false;
        alert("Nombre y apellidos obligatorios");
        document.getElementById('usu_nonbre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('usu_email').value == "") {
            bool = false;
            alert("Email obligatorio");
            document.getElementById('usu_email').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('usu_contrasena').value == "") {
            bool = false;
            alert("Contraseña obligatoria");
            document.getElementById('usu_contrasena').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('usu_provincia').value == "") {
            bool = false;
            alert("Provincia obligatoria");
            document.getElementById('usu_provincia').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('usu_pais').value == "") {
            bool = false;
            alert("País obligatorio");
            document.getElementById('usu_pais').focus();
        }
        else{
            bool = true;
        }
    }         
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}
function EnviarConsulta(){
    bool = false; 
    if(document.getElementById('txtNombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('txtNombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('txtEmail').value == "") {
            bool = false;
            alert("El email es obligatorio");
            document.getElementById('txtEmail').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('txtComentario').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('txtComentario').focus();
        }
        else{
            bool = true;
        }
    }        
    if(bool){
        document.getElementById('frmconsulta').submit();
    }
}
function ComprobarEmail(){
    bool = false; 
    if(document.getElementById('asunto').value == "") {
        bool = false;
        alert("El asunto es obligatorio");
        document.getElementById('asunto').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('comentario').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('comentario').focus();
        }
        else{
            bool = true;
        }
    }        
    if(bool){
        document.getElementById('frmdatosadministrador').submit();
    }
}
function ComprobarEmail2(){
    bool = false; 
    /*if(document.getElementById('fot_nota').value == "") {
        bool = false;
        alert("La nota es obligatoria");
        document.getElementById('fot_nota').focus();
    }
    else{
        bool = true;
    }      
    if(bool){*/
        document.getElementById('frmdatosadministrador').submit();
    //}
}
function comprobarenvioanuncio(){
    bool = false; 
    if(document.getElementById('anu_titulo').value == "") {
        bool = false;
        alert("El título es obligatorio");
        document.getElementById('anu_titulo').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('anu_tipo').value == "0") {
            bool = false;
            alert("La categoría es obligatoria");
            document.getElementById('anu_tipo').focus();
        }
        else{
            bool = true;
        }
    }         
    if(bool){
        document.getElementById('frmdatosanuncioenvio').submit();
    }
}
function PagoTarjeta(){
    //alert("Desactivada temporalmente por cambios en TPV Virtual");
    document.getElementById('frmdatosregistro').submit();
}
function PagoTranferencia(){
    document.getElementById('frmdatosregistro2').submit();
}
function AmpliarRegistro(){
    document.getElementById('frmdatosampliar').submit();
}
function Enviarcodigo(){
    document.getElementById('frmdatossrenovar').submit(); 
}
function EnviarModerador(){
    document.getElementById('frmlista2').submit();
}
function contrasena(){
    document.getElementById('frmdatosregistro').submit();
}
function minisite(){
    bool = false; 
    if(document.getElementById('min_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('min_nombre').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}
function ModificarMinisite(){
    bool = false; 
    if(document.getElementById('min_nnoticias').value == "") {
        bool = false;
        alert("El nombre de la sección libre es obligatorio");
        document.getElementById('min_nnoticias').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('min_ngaleria').value == "") {
            bool = false;
            alert("El nombre de la sección galerías es obligatorio");
            document.getElementById('min_ngaleria').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('min_nenlaces').value == "") {
            bool = false;
            alert("El nombre de la sección enlaces es obligatorio");
            document.getElementById('min_nenlaces').focus();
        }
        else{
            bool = true;
        }
    } 
    if(bool){ 
        if(document.getElementById('min_nlibro').value == "") {
            bool = false;
            alert("El nombre de la sección libro de visitas es obligatorio");
            document.getElementById('min_nlibro').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('min_ncontacto').value == "") {
            bool = false;
            alert("El nombre de la sección contacto es obligatorio");
            document.getElementById('min_ncontacto').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('min_nbiografia').value == "") {
            bool = false;
            alert("El nombre de la sección contacto es obligatorio");
            document.getElementById('min_nbiografia').focus();
        }
        else{
            bool = true;
        }
    }       
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}
function SubirNoticiaMini(){
    bool = false; 
    if(document.getElementById('not_titular').value == "") {
        bool = false;
        alert("El titular de la noticia es obligatorio");
        document.getElementById('not_titular').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('not_fecha').value == "") {
            bool = false;
            alert("La fecha es obligatoria");
            document.getElementById('not_fecha').focus();
        }
        else{
            bool = true;
        }
    }       
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}
function SubirEnlaceMini(){
    bool = false; 
    if(document.getElementById('enlu_texto').value == "") {
        bool = false;
        alert("El título del enlace es obligatorio");
        document.getElementById('enlu_texto').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('enlu_enlace').value == "") {
            bool = false;
            alert("La URL es obligatoria");
            document.getElementById('enlu_enlace').focus();
        }
        else{
            bool = true;
        }
    }       
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}
function comprobarcontrato(){
    bool = false; 
    if(document.getElementById('Nombre').value == "") {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('checkacepto').checked=0;
        document.getElementById('Nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('DNI').value == "") {
            bool = false;
            alert("DNI obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('DNI').focus();
        }
        else{
            bool = true;
        }
    }  
    if(bool){ 
        if(document.getElementById('Direccion').value == "") {
            bool = false;
            alert("Dirección obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('Direccion').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Provincia').value == "") {
            bool = false;
            alert("Provincia obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('Provincia').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Telefono').value == "") {
            bool = false;
            alert("Teléfono obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('Telefono').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('CP').value == "") {
            bool = false;
            alert("CP obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('CP').focus();
        }
        else{
            bool = true;
        }
    }    
    if(bool){ 
        if(document.getElementById('Poblacion').value == "") {
            bool = false;
            alert("Población obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('Poblacion').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Email').value == "") {
            bool = false;
            alert("Email obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('Email').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Dominio').value == "") {
            bool = false;
            alert("Dominio obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('Dominio').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        document.getElementById('checkacepto').checked = 1;
        document.getElementById('botonregistro').style.display="block";
    }
}

function comprobarcontrato2(){
    bool = false; 
    if(document.getElementById('Nombre').value == "") {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('checkacepto').checked=0;
        document.getElementById('botonregistro').style.display="none";
        document.getElementById('Nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('DNI').value == "") {
            bool = false;
            alert("DNI obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('DNI').focus();
        }
        else{
            bool = true;
        }
    }  
    if(bool){ 
        if(document.getElementById('Direccion').value == "") {
            bool = false;
            alert("Dirección obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('Direccion').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Provincia').value == "") {
            bool = false;
            alert("Provincia obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('Provincia').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Telefono').value == "") {
            bool = false;
            alert("Teléfono obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('Telefono').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('CP').value == "") {
            bool = false;
            alert("CP obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('CP').focus();
        }
        else{
            bool = true;
        }
    }    
    if(bool){ 
        if(document.getElementById('Poblacion').value == "") {
            bool = false;
            alert("Población obligatoria");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('Poblacion').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Email').value == "") {
            bool = false;
            alert("Email obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('Email').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Dominio').value == "") {
            bool = false;
            alert("Dominio obligatorio");
            document.getElementById('checkacepto').checked=0;
            document.getElementById('botonregistro').style.display="none";
            document.getElementById('Dominio').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        document.getElementById('checkacepto').checked = 1;
        document.getElementById('botonregistro').style.display="block";
        document.getElementById('formcontrato').submit();
    }
}
function comprobarbases(){
    bool = false;        
    if(document.getElementById('checkacepto').checked == 1){
        document.getElementById('botonregistro').style.display="block";
    }
    else{
        document.getElementById('botonregistro').style.display="none";
    }
}
function SubirConcurso(){
    document.getElementById('frmdatosconcurso').submit();    
}

function AnadirOpinion(){
    if(document.getElementById('materialdetalle4').style.display=="block"){
        document.getElementById('materialdetalle4').style.display="none";
    }
    else{
        document.getElementById('materialdetalle4').style.display="block";
    }    
}

function MostrarAlDetalle(){
    if(document.getElementById('opiniones').style.display=="block"){
        document.getElementById('opiniones').style.display="none";
    }
    else{
        document.getElementById('opiniones').style.display="block";
        document.getElementById('opiniones2').style.display="none";
        document.getElementById('opiniones3').style.display="none";
        document.getElementById('opiniones4').style.display="none";
    }    
}
function MostrarCarac(){
    if(document.getElementById('opiniones2').style.display=="block"){
        document.getElementById('opiniones2').style.display="none";
    }
    else{
        document.getElementById('opiniones2').style.display="block";
        document.getElementById('opiniones').style.display="none";
        document.getElementById('opiniones3').style.display="none";
        document.getElementById('opiniones4').style.display="none";
    }    
}
function MostrarOpci(){
    if(document.getElementById('opiniones3').style.display=="block"){
        document.getElementById('opiniones3').style.display="none";
    }
    else{
        document.getElementById('opiniones3').style.display="block";
        document.getElementById('opiniones').style.display="none";
        document.getElementById('opiniones2').style.display="none";
        document.getElementById('opiniones4').style.display="none";
    }    
}
function MostrarDescriMate(){
    if(document.getElementById('opiniones4').style.display=="block"){
        document.getElementById('opiniones4').style.display="none";
    }
    else{
        document.getElementById('opiniones4').style.display="block";
        document.getElementById('opiniones2').style.display="none";
        document.getElementById('opiniones3').style.display="none";
        document.getElementById('opiniones').style.display="none";
    }    
}
function AnadirOpinionMaterial(){
        document.getElementById('frmdatoscomentarmaterial').submit();
}
//DATOS EXIF
function MostrarManual(){
    document.getElementById('manual').style.display="block";
    document.getElementById('auto').style.display="none";
}
function MostrarAuto(){
    document.getElementById('manual').style.display="none";
    document.getElementById('auto').style.display="block";
}
function MostrarSeleccion(){
    document.getElementById('seleccion').style.display="block";
}
function OcultarSeleccion(){
    document.getElementById('seleccion').style.display="none";
}
function OcultarTodosExif(){
    document.getElementById('manual').style.display="none";
    document.getElementById('auto').style.display="none";
}
function AgregarTags(){ 
    if(document.getElementById('tag_nombre').value != "") {
        document.getElementById('frmdatos').submit();
    }    
}
function mostrarTags(){ 
    document.getElementById('tagsfotos').style.display="block";
}
function AgregaTagsMod(){ 
    if(document.getElementById('tag_nombre').value != "") {
        document.getElementById('frmdatostags').submit();
    }    
}
function OcultarTagsMod(){ 
    document.getElementById('tagsfotos').style.display="none";
}
function AnadirMakingOf(){
    //save_in_textarea_all();
    bool = false; 
    if(document.getElementById('mak_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('mak_nombre').focus();
    }
    else{
        bool = true;
    }
    /*if(bool){ 
        
        if(document.getElementById('mak_texto').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('mak_texto').focus();
        }
        else{
            bool = true;
        }
    } */      
    if(bool){
        //alert('Entro');
        save_in_textarea_all();
        document.getElementById('frmmimakingof').submit();
    }
}
function AnadirMakingOfFase(){
    bool = false; 
    if(document.getElementById('maf_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('maf_nombre').focus();
    }
    else{
        bool = true;
    }
    /*if(bool){ 
        if(document.getElementById('maf_texto').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('maf_texto').focus();
        }
        else{
            bool = true;
        }
    }*/       
    if(bool){
        save_in_textarea_all();
        document.getElementById('frmdatosmakingoffase').submit();
    }
}
function AnadirMakingOfComentario(){
    bool = false; 
    if(document.getElementById('mac_comentario').value == "") {
        bool = false;
        alert("El comentario es obligatorio");
        document.getElementById('mac_comentario').focus();
    }
    else{
        bool = true;
    }      
    if(bool){
        document.getElementById('frmdatosmakingofcomentarios').submit();
    }
}
function Anadirretoque(){
    bool = false; 
    if(document.getElementById('ret_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('ret_nombre').focus();
    }
    else{
        bool = true;
    }
    /*if(bool){ 
        if(document.getElementById('ret_texto').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('ret_texto').focus();
        }
        else{
            bool = true;
        }
    }*/       
    if(bool){
        save_in_textarea_all();
        document.getElementById('frmdatosretoque').submit();
    }
}
function AnadirretoqueFase(){
    bool = false; 
    if(document.getElementById('ref_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('ref_nombre').focus();
    }
    else{
        bool = true;
    }
    /*if(bool){ 
        if(document.getElementById('ref_texto').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('ref_texto').focus();
        }
        else{
            bool = true;
        }
    } */      
    if(bool){
        save_in_textarea_all();
        document.getElementById('frmdatosretoquefase').submit();
    }
}
function AnadirretoqueComentario(){
    bool = false; 
    if(document.getElementById('rec_comentario').value == "") {
        bool = false;
        alert("El comentario es obligatorio");
        document.getElementById('rec_comentario').focus();
    }
    else{
        bool = true;
    }      
    if(bool){
        document.getElementById('frmdatosretoquecomentarios').submit();
    }
}
function AnadirVideo(){
    bool = false; 
    if(document.getElementById('vid_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('vid_nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('vid_imagen').value == "") {
            bool = false;
            alert("La imagen es obligatoria");
            document.getElementById('vid_imagen').focus();
        }
        else{
            bool = true;
        }
    }
    /*if(bool){ 
        if(document.getElementById('vid_texto').value == "") {
            bool = false;
            alert("La descripción es obligatoria");
            document.getElementById('vid_texto').focus();
        }
        else{
            bool = true;
        }
    }*/
    if(bool){ 
        if(document.getElementById('vid_codigo').value == "") {
            bool = false;
            alert("El código es obligatorio");
            document.getElementById('vid_codigo').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        save_in_textarea_all();
        document.getElementById('frmdatosmakingof').submit();
    }
}
function AnadirVideo2(){
    bool = false; 
    if(document.getElementById('vid_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('vid_nombre').focus();
    }
    else{
        bool = true;
    }
    /*if(bool){ 
        if(document.getElementById('vid_texto').value == "") {
            bool = false;
            alert("La descripción es obligatoria");
            document.getElementById('vid_texto').focus();
        }
        else{
            bool = true;
        }
    }*/
    if(bool){ 
        if(document.getElementById('vid_codigo').value == "") {
            bool = false;
            alert("El código es obligatorio");
            document.getElementById('vid_codigo').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        save_in_textarea_all();
        document.getElementById('frmdatosmakingof').submit();
    }
}
function Anadirtratamiento(){
    bool = false; 
    if(document.getElementById('tra_nombre').value == "") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('tra_nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('tra_imagen').value == "") {
            bool = false;
            alert("La imagen es obligatoria");
            document.getElementById('tra_imagen').focus();
        }
        else{
            bool = true;
        }
    }
    /*if(bool){ 
        if(document.getElementById('tra_texto').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('tra_texto').focus();
        }
        else{
            bool = true;
        }
    }*/       
    if(bool){
        save_in_textarea_all();
        document.getElementById('frmdatostratamiento').submit();
    }
}
function AnadirtratamientoComentario(){
    bool = false; 
    if(document.getElementById('trf_imagen').value == "") {
        bool = false;
        alert("La imagen es obligatoria");
        document.getElementById('trf_imagen').focus();
    }
    else{
        bool = true;
    }
    /*if(bool){ 
        if(document.getElementById('trf_texto').value == "") {
            bool = false;
            alert("El comentario es obligatorio");
            document.getElementById('trf_texto').focus();
        }
        else{
            bool = true;
        }
    } */      
    if(bool){
        save_in_textarea_all();
        document.getElementById('frmdatostratamientosuge').submit();
    }
}
function BuscadorBiblio(){
    document.getElementById('frmdatosbiblio').submit();
}
function AnadirBibliog(){
    bool = false; 
    if(document.getElementById('bib_comun').value == "") {
        bool = false;
        alert("El nombre común es obligatorio");
        document.getElementById('bib_comun').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('bib_articulo').value == "") {
            bool = false;
            alert("El nombre del artículo es obligatorio");
            document.getElementById('bib_articulo').focus();
        }
        else{
            bool = true;
        }
    }       
    if(bool){
        document.getElementById('frmdatosbiblio').submit();
    }
}