/*
    Manejo de capas
*/
function showDiv(id)
{
    document.getElementById(id).style.visibility = 'visible';
    //document.getElementById(id).focus();
}
function hideDiv(id)
{
    document.getElementById(id).style.visibility = 'hidden';
}
function alternateDiv(id)
{
    if (document.getElementById(id).style.visibility == 'hidden')
        showDiv(id);
    else
        hideDiv(id);
}
/*
    Menu principal
*/
function menu(id)
{
    hideDiv('inicio');
    hideDiv('servicios');
    hideDiv('ensenanzas');
    hideDiv('profesorado');
    if (id) showDiv(id);
    top.document.getElementById("datos").focus();
}
/*
    Menu el mapa del sitio
*/
function mapa(id)
{
    hideDiv('mapa');
    hideDiv('profesorado');
    hideDiv('noticias');
    hideDiv('secretaria');
    hideDiv('servicios');
    hideDiv('ensenanzas');
    hideDiv('inicio');
    if (id) showDiv(id);
    top.document.getElementById("datos").focus();
}
/*
	Correo del IES
*/
function correo()
{
    document.write("<a href=\"mai");
    document.write("lto:ies.laarb");
    document.write("oleda.alcorco");
    document.write("n@educa.madri");
    document.write("d.org\">ies.l");
    document.write("aarboleda.alc");
    document.write("orcon@educa.m");
    document.write("adrid.org</a>");
}
/*
    Cambiar el título según la página cargada (título o primer h1)
*/
window.onload = function()
{
    txtNombre = "IES La Arboleda"
    txtLugar  = " - Alcorcón - Madrid"
    top.document.title = txtNombre + txtLugar
    window.status = top.document.title + txtLugar
    if (txt = top.datos.document.title)
    {
        top.document.title = txt + " :: " + txtNombre
        window.status = top.document.title + txtLugar
        return
    }
    last = top.datos.document.getElementsByTagName("H1").item(0).childNodes.length - 1
    pos = (last>1) ? 1 : 0;
    if (txt = top.datos.document.getElementsByTagName("H1").item(0).childNodes.item(last).data.substr(pos))
    {
        top.document.title = txt + " :: " + txtNombre
        window.status = top.document.title + txtLugar
        return
    }
    return
}

