function init()
{
    var d=document.getElementById('dir');
    eval("var tx=String.fromCharCode("+d.innerHTML+");");
    d.innerHTML="<a href='mailto:"+tx+"'>"+tx+"</a>";
    d.style.display='inline';
}
function checkForm()
{
    if(document.f1.nombre.value=='')
    {
        alert('Por favor, rellene todos los campos marcados con *');
        document.f1.nombre.focus();
        return;
    }
    if(document.f1.apellidos.value=='')
    {
        alert('Por favor, rellene todos los campos marcados con *');
        document.f1.apellidos.focus();
        return;
    }
    if(document.f1.email.value=='')
    {
        alert('Por favor, rellene todos los campos marcados con *');
        document.f1.email.focus();
        return;
    }
    if(document.f1.consulta.value=='')
    {
        alert('Por favor, rellene todos los campos marcados con *');
        document.f1.consulta.focus();
        return;
    }
    if(document.f1.acepta.checked!=true)
    {
        alert('Para enviar el formulario debe aceptar las condiciones de confidencialidad de datos');
        return;
    }
    document.f1.submit();
}
var n1=0;
var n2=0;
var n3=0;
function c1(id)
{
    n1=id;
    n2=0;
    n3=0;
    document.getElementById('cb11').style.display='none';
    document.getElementById('cb12').style.display='none';
    document.getElementById('cb13').style.display='none';
    if(id)
    {
        document.getElementById('cb1'+id).style.display='inline';
        window['c1'+id](1);
    }
}
function c11(id)
{
    n2=id;
    if(n2>0 && n2<4)
    {
        document.getElementById('cb111').style.display='inline';
        document.getElementById('cb114').style.display='none';
    }
    if(n2==4)
    {
        document.getElementById('cb111').style.display='none';
        document.getElementById('cb114').style.display='inline';
    }
}
function c12()
{
    n2=1;
    document.getElementById('cb12').style.display='inline';
}
function c13(id)
{
    n2=id;
    if(n2>0 && n2<6)
    {
        document.getElementById('cb131').style.display='inline';
        document.getElementById('cb136').style.display='none';
    }
    if(n2==6)
    {
        document.getElementById('cb131').style.display='none';
        document.getElementById('cb136').style.display='inline';
    }
}
function busca()
{
    var data='';
    if(n1==1 && n2!=4)
        data=document.getElementById('data111').value;
    if(n1==1 && n2==4)
    {
        window.location.href='actividad.php?id_actividad='+document.getElementById('data114').value;
        return;
    }
    if(n1==2)
        data=document.getElementById('data12').value;
     if(n1==3 && n2!=6)
        data=document.getElementById('data131').value;
    if(n1==3 && n2==6)
        data=document.getElementById('data136').value;
    window.location.href='buscar.php?n1='+n1+'&n2='+n2+'&data='+data;
}
function co(id,opacity)
{
	opacity = (opacity == 100)?99.999:opacity;
        var e=document.getElementById('actR'+id);
        var e=e.getElementsByTagName('td');
        for(var x=0;x<e.length;++x)
        {
            e[x].style.KhtmlOpacity = opacity/100;
            e[x].style.filter = "alpha(opacity:"+opacity+")";
            e[x].style.MozOpacity = opacity/100;
            e[x].style.opacity = opacity/100;
        }
}