var nodosSecu;
var lasubnavegacion;
var estilo;

function cerrar(){
  document.getElementById("caja").style.display="none";
}

function init(){
  var headerMinimo = document.getElementById("si-hay-nav");
  if( headerMinimo ) {
    initNavElements();
  }
}


function subir(que){
	estilo=document.getElementById(que).style.zIndex+10;
	document.getElementById(que).style.zIndex=estilo;
}

function bajar(que){
	estilo=document.getElementById(que).style.zIndex-10;
	document.getElementById(que).style.zIndex=estilo;
}

function isMinimalHeader() {
    return ( null == document.getElementById( "si-hay-nav" ) );
}



function initNavElements() {
    //alert("hola");
    var navSecu = document.getElementById("pu2009-secuNav");
    if( navSecu ) {
      nodosSecu = navSecu.getElementsByTagName("LI");
      //alert(nodosSecu.length);
      for (var i=0; i<nodosSecu.length; i++) {
        nodoSecu = nodosSecu[i];
        nodoSecu.style.display = "block";
      }
    }
    
    var navElement = document.getElementById("pu2009-mainNav");
    if( navElement ) {
      var nodos = navElement.getElementsByTagName("LI");
      var i;
	  for (i=0; i<nodos.length; i++) {
		
        nodo = nodos[i];
        if (nodo.nodeName=="LI") {
          nodos[i].onmouseover = function() {
			  
              	  var verElemento = document.getElementById("pu2009-zIndexDesapNav");
				  verElemento.style.display = "block";
				  
				  //lasubnavegacion = "subSecuNav" + i;
                  var visible =	document.getElementById("subSecuNav"+this.id);
				  var nodoss = visible.getElementsByTagName("UL");
				  visible.style.display = "block";
				  //estilo=document.getElementById(que).style.zIndex+10;
				  visible.style.zIndex="140";
				  
				  var visibleLeft =	document.getElementById("pu2009-secuNav");
				  var offsetLeft = this.offsetLeft.toString();
				  visibleLeft.style.left = eval('"' + offsetLeft + 'px"');
				  var imprimir=0;
				  for(j=1; j<=nodos.length; j++)
				  {
					  if(eval(j != this.id))
					  {
						  var visible2 = document.getElementById(eval('"subSecuNav' + j + '"'));
				  		  visible2.style.display = "none";
						  //alert(this.style.zIndex);
						  //alert("la j :"+j);
						  //imprimir = eval(imprimir+j);
						  
					  }
				  }
				  
				  
				 // if (!isIE7 && !isSaf) {

                  //visibleLeft.style.left = "-200px";
                  //nodoSecu = nodosSecu[1];
                  //alert(nodoSecu.innerHTML);
                  //nodoSecu.style.display = "inline";
                  //this.className+="navHover";
             
           
                  //nodoSecu = nodosSecu[i];
                  //nodoSecu.style.display = "inline";
                  //if (uls[0] != null){
                    //uls[0].style.left = 0;
                    //uls[0].style.top = 16;
                  //}
             
          }//end function on mouseover
          nodos[i].onmouseout=function() {
              
				  var visible =	document.getElementById("subSecuNav"+this.id);
				  var nodoss = visible.getElementsByTagName("UL");
				  //nodoss[0].style.display = "none";
                //navSecu.style.display = "none";
                //this.className=this.className.replace("navHover", "");
                //alert(this.className);
              
                //navSecu.style.display = "none";
                //var uls = this.getElementsByTagName("UL");
                //if (uls[0] != null) uls[0].style.left = "-999em";
              
            
          }//end function on mouseout
        }//endif
		
			  /*
			  var visible3 = document.getElementById(eval('"subSecuNav' + (i+1) + '"' ));
			  visible3.onmouseout=function() {
				  alert(this.id);
				 visible3.style.display = "none"; 
			  }
			  */
		
      }
    }
	//getElementByClass(pu2009-page);
	/*
	var elementoHeader = document.getElementById("pu2009-header");
	elementoHeader.onmouseout = function() 
	{
		for(j=1; j<=nodos.length; j++)
		{
			  var visible4 = document.getElementById(eval('"subSecuNav' + j + '"'));
			  visible4.style.display = "none";
		}
	}
	*/
	arrPresenta = new Array();
	/*arrPresenta.push("pu2009-pie");
	arrPresenta.push("pu2009-inicio");
	arrPresenta.push("pu2009-presentacion-1");
	arrPresenta.push("pu2009-presentacion-2");
	arrPresenta.push("pu2009-presentacion-3");
	arrPresenta.push("pu2009-presentacion-4");
	arrPresenta.push("pu2009-presentacion-5");
	arrPresenta.push("pu2009-presentacion-6");
	arrPresenta.push("pu2009-presentacion-7");
	arrPresenta.push("pu2009-presentacion-8");
	arrPresenta.push("pu2009-presentacion-9");
	arrPresenta.push("pu2009-presentacion-10");*/
	arrPresenta.push("pu2009-zIndexDesapNav");
	
	
	
	for(m=0; m<arrPresenta.length; m++)
	{
		nombrePresenta = arrPresenta[m];
		//alert(arrPresenta);
		if(document.getElementById(nombrePresenta) != null)
		{
			var elementoContenido = document.getElementById(nombrePresenta);
			//alert(elementoContenido);
			//var elementoContenido = document.getElementById("quitarSubNav");
			elementoContenido.onmouseover = function() 
			{
				for(j=1; j<=nodos.length; j++)
				{
					  var visible5 = document.getElementById(eval('"subSecuNav' + j + '"'));
					  visible5.style.display = "none";
				}
				var verElemento2 = document.getElementById("pu2009-zIndexDesapNav");
				verElemento2.style.display = "none";
			}
			//var elementoFooter = document.getElementById("pu2009-pie");
		}
	}
}

	/*
    //getElementByClass
    var allHTMLTags = new Array();

    function getElementByClass(theClass) 
	{
		//Create Array of All HTML Tags
		var allHTMLTags=document.getElementsByTagName("*");
	
		//Loop through all tags using a for loop
		for (i=0; i<allHTMLTags.length; i++) 
		{
			//Get all tags with the specified class name.
			if (allHTMLTags[i].className==theClass) 
			{
				allHTMLTags[i].onmouseover = function() 
				{
					alert("hola");
				}
			}
		}
    }
	*/


function openPopup( url, width, height, name, features ) {
  function addFeature( features, name, value ) {
    if( value == null || value == "" ) {
      return features;
    }
    if( features != "" ) {
      features += ",";
    }
    return features + name + "=" + value;
  }
  if( name == null || name == "" ) {
    name = "popupWindow";
  }
  if( features == null || features == "") {
    features = "";
    features = addFeature( features, "scrollbars", "yes" );
    features = addFeature( features, "resizable", "yes" );
    if( name == "popupWindow" ) {
      features = addFeature( features, "location", "yes" );
      features = addFeature( features, "menubar", "yes" );
      features = addFeature( features, "toolbar", "yes" );
      features = addFeature( features, "status", "yes" );
    }
  }
  if( name == "viewlarger" ) {
    if( width == null || width == "" ) {
        width = 800;
    }
    if( height == null || height == "" ) {
      height = 600;
    }
  }
  if( name == "popupWindow" ) {
    if( width == null || width == "" ) {
      width = 800;
    }
    if( height == null || height == "" ) {
      height = 600;
    }
  }
  features = addFeature( features, "width", width );
  features = addFeature( features, "height", height );
  var popupWindow = window.open( url, name, features );
  popupWindow.focus();
  return false;
}






var isIE7 = (navigator.userAgent.toLowerCase().indexOf("msie 7.0") != -1);
var isSaf = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);
var isMac = (navigator.appVersion.indexOf('Mac') != -1);


			

