// JavaScript Documentfunction ocultarDivs(exempt)
function FijarEnlaces()
{
  if (!document.getElementsByTagName) return null;
  var server = document.location.hostname;
  var anchors = document.getElementsByTagName("a");
  for(var i=0; i < anchors.length; i++)
  {
    var a = anchors[i];
    var href = a.href;
    var id = a.id;
    var title = a.title;
    if (href.indexOf("#header") != -1) { // back to top
      a.className = "alt";
    } else if ((href.indexOf("#") != -1) && (href.indexOf("header") == -1)) { // jump ref
      var index = href.indexOf("#") + 1;
      href = "javascript:Mostrar('" + href.substring(index) + "');";
      a.setAttribute("href",href);
    }
  }
}

function OcultarDivs(exempt)
{
  if (!document.getElementsByTagName) return null;
  if (!exempt) exempt = "";
  var divs = document.getElementsByTagName("div");
  for(var i=0; i < divs.length; i++)
  {
    var div = divs[i];
    var id = div.id;
    if (((id == "portada") || (id == "infancia") || (id == "juventud") || (id == "mayores") || (id == "mujeres") || (id == "profesionales") || (id == "discapacidad")) && (id != exempt))
    {
      div.className = "no_visible";
    }
  }
}

function Mostrar(Zein)
{
  if (!document.getElementById) return null;
  showZein = document.getElementById(Zein);
  showZein.className = "";
  //alert(toString(Zein.id));
  OcultarDivs(Zein);
}

function EnviarFoco(Zein)
{
  var obj = document.getElementById(Zein);
  obj.focus();
}

window.onload = function()
{	
	startList();
	FijarEnlaces();
	//OcultarDivs("portada");
	//EnviarFoco("solapas");
}

startList = function() {
	if (document.all&&document.getElementById) {
		
		navRoot = document.getElementById("lista_menus");				
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			//alert(node.nodeName);
			//menu = document.getElementById("lista_enlaces_directos");
			//document.write("menu.z") + document.write("\-index=") + document.write("0");
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					//alert("-"+this.className);
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
