function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function comprobar() {
    if (document.contacta.texto.value=='' || document.contacta.correo.value=='') {
      alert('Es imprescindible introducir el texto de la consulta y una dirección de correo electrónico para enviar la respuesta');				
      return false;
    }
    else 
    if (!document.contacta.acepto.checked) {
        alert('Debes aceptar la política de protección de datos para poder continuar');
        return false					
    }
    return true;
}

function comprobarConsultaJovenes() {
    if (document.contacta.texto.value=='' || document.contacta.correo.value=='' || document.contacta.nombre.value=='' || document.contacta.edad.value=='') {
      alert('Es imprescindible introducir todos los campos marcados con un asterisco (*)');				
      return false;
    }
    else 
    if (!document.contacta.acepto.checked) {
        alert('Debes aceptar la política de protección de datos para poder realizar la consulta');
        return false					
    }
    return true;
}        

function comprobarJornadasAsturias() {
    if (document.contacta.telefono.value=='' || document.contacta.correo.value=='' || document.contacta.nombre.value=='' || document.contacta.empresa.value=='' || document.contacta.localidad.value=='') {
      alert('Es imprescindible introducir todos los datos solicitados');				
      return false;
    }
    else 
    if (!document.forms[1].acepto.checked) {
        alert('Debes aceptar la política de protección de datos para poder suscribirte');
        return false					
    }
    return true;
}

function comprobarJornadasMujer()
{
  if(document.contacta.nombre.value=='' || document.contacta.apellidos.value=='' || document.contacta.nif.value=='' ||
     document.contacta.cargo.value=='' || document.contacta.telefono.value=='' ||
     document.contacta.correo.value=='' || document.contacta.direccion.value=='' ||
     document.contacta.localidad.value=='' || document.contacta.codPostal.value=='' )
  {
      alert('Es imprescindible introducir todos los datos solicitados');				
      return false;
  }
  else
  {
    if(!document.contacta.acepto.checked)
    {
      alert('Debes aceptar la política de protección de datos para poder suscribirte');
      return false;
    }
  }
    
  return true;
}

function comprobarConsultaFiteqa()
{
  if(document.contacta.nombre.value=='' || document.contacta.apellidos.value=='' || document.contacta.correo.value=='' || document.contacta.comunidad.value=='' || document.contacta.texto.value == ''
      || (document.contacta.desempleado.value == "NO" && document.contacta.sector.value == ''))
  {
      alert('Es imprescindible introducir todos los datos solicitados');				
      return false;
  }
  else
  {
    if(!document.contacta.acepto.checked)
    {
      alert('Debes aceptar la política de protección de datos para poder continuar');
      return false;
    }
  }
  return true;
}    

function ocultarEmpresa()
{
    if(document.contacta.desempleado.value == "SI")
    {
        document.getElementById("trEmpresa").style.display="none";
        document.getElementById("trSector").style.display="none";
        document.getElementById("tdComunidad").innerHTML = "Comunidad Autónoma dónde se encuentra ubicado el domicilio:";
        document.contacta.sector.value = "";
    }
    else
    {   
        document.getElementById("tdComunidad").innerHTML = "Comunidad Autónoma dónde está ubicada la empresa donde trabaja:";
        document.getElementById("trEmpresa").style.display="block";
        document.getElementById("trSector").style.display="block";
    }
}

function comprobarAccionFormativa() {
    if (document.contacta.nombre.value==''
        || document.contacta.curso1.value=='' || document.contacta.direccion.value=='' 
        || document.contacta.cp.value==''
        || document.contacta.correo.value==''
        || (document.contacta.telefono.value=='' && document.contacta.movil.value=='') 
        || document.contacta.fechaNacimiento.value=='' || document.contacta.nif.value==''
        || (!document.contacta.sexo[0].checked && !document.contacta.sexo[1].checked)
        || document.contacta.numsegsocial.value==''
        || document.contacta.categoria.options[document.contacta.categoria.selectedIndex].value==''
        || document.contacta.estudios.options[document.contacta.estudios.selectedIndex].value==''
        || document.contacta.areaFuncional.options[document.contacta.areaFuncional.selectedIndex].value==''
        || (document.contacta.paro[1].checked && 
                (document.contacta.empresaNombre.value=='' || document.contacta.empresaDomicilio.value=='' 
                  || document.contacta.empresaLocalidad.value=='' || document.contacta.empresaTelefono.value==''
                  || document.contacta.empresaCIF.value=='' 
                  || document.contacta.convenio.options[document.contacta.convenio.selectedIndex].value==''
                  || document.contacta.contrato.options[document.contacta.contrato.selectedIndex].value==''
                  )
            )
        )   
    {
      alert('Es imprescindible rellenar todos los datos marcados con un asterisco');				
      return false;
    }
    else 
    if (!document.contacta.acepto.checked) {
        alert('Debes aceptar la política de protección de datos para poder suscribirte');
        return false					
    }
    return true;
}

function comprobarPreinscripcionFormacionSindical() {
    if (document.contacta.nombre.value==''
        || document.contacta.curso1.value=='' || document.contacta.direccion.value=='' 
        || document.contacta.cp.value==''
        || document.contacta.correo.value==''
        || (document.contacta.telefono.value=='' && document.contacta.movil.value=='') 
        || document.contacta.fechaNacimiento.value=='' || document.contacta.nif.value==''
        || (!document.contacta.sexo[0].checked && !document.contacta.sexo[1].checked)
        || document.contacta.numsegsocial.value==''
        || document.contacta.categoria.options[document.contacta.categoria.selectedIndex].value==''
        || document.contacta.estudios.options[document.contacta.estudios.selectedIndex].value==''
        || document.contacta.areaFuncional.options[document.contacta.areaFuncional.selectedIndex].value==''
        || document.contacta.empresaNombre.value=='' || document.contacta.empresaDomicilio.value=='' 
        || document.contacta.empresaLocalidad.value=='' || document.contacta.empresaTelefono.value==''
        || document.contacta.empresaCIF.value=='' 
        || document.contacta.convenio.options[document.contacta.convenio.selectedIndex].value==''
        || document.contacta.contrato.options[document.contacta.contrato.selectedIndex].value==''
        )   
    {
      alert('Es imprescindible rellenar todos los datos marcados con un asterisco');				
      return false;
    }
    else 
    if (!document.contacta.acepto.checked) {
        alert('Debes aceptar la política de protección de datos para poder suscribirte');
        return false					
    }
    return true;
}  

function comprobarConsultasSeguridadSocial() {    
    if (document.contacta.nombre.value=='' || document.contacta.correo.value=='' || document.contacta.telefono.value=='' ||
     document.contacta.localidad.value=='' || document.contacta.provincia.value=='' || document.contacta.nif.value=='' ||
     document.contacta.sector.value=='' || document.contacta.texto.value=='')     
    {
        alert('Es imprescindible introducir todos los datos marcados con un asterisco (*)');				
        return false;
    }
    else
    {
      if(!document.contacta.acepto.checked)
      {
        alert('Debes aceptar la política de protección de datos para poder continuar');
        return false;
      }
    }
    
    return true;
}


function mostrarMensaje(mensaje,ancho,alto,capa) {					 
     mensaje+="<div class='divClear'></div><p align='center'><input type='button' value='Aceptar' style='font-family: verdana; font-size: 9px' onclick='javascript:TINY.box.hide()'></p>";
     TINY.box.show(mensaje,0,ancho,alto,1);
}					

