function setvar (varrecibida){
	var variable=varrecibida;
}
function resetear (){
	document.getElementById('lista1_1').src == '/ES/img/menu_principal/presentacion01.gif';
	document.getElementById('lista1_2').src == '/ES/img/menu_principal/filosofia01.gif';
	document.getElementById('lista1_3').src == '/ES/img/menu_principal/servicio01.gif';
}

function comprobar(varmenu){
	var carpeta = document.location.href.lastIndexOf('.asp');
	var firstpos = carpeta-2;
	directorio=document.location.href.substring(firstpos,carpeta);	
	
	//alert(varmenu);
	//alert(directorio);

			if (directorio==varmenu){
				final="imagen"+directorio;
				rutafinal= document.getElementById(final).src.replace('02','01');
				rutaimg='/ES/img/menu_principal/menu'+varmenu+'_2.gif';
				document.getElementById(final).src=rutaimg;
			} else 
				{
				final="imagen"+varmenu;
				rutaimg='/ES/img/menu_principal/menu'+varmenu+'_1.gif';
				document.getElementById(final).src=rutaimg;
			}

	
}
	
function rollout (varrecibida,ruta){

	if (variable=!varrecibida){
			this.src=ruta;
		};
}

function subocultartodas() {
	if (document.getElementById('subproductos2').style.display == 'block'){
		document.getElementById('subproductos2').style.display = 'none';
	}
}

function menu(capa) {

	document.getElementById(capa).style.display = 'none';
	//grupo = document.getElementById('navegador').getElementsByTagName('DIV');
	for (i=1; i<5; i++) {
			document.getElementById('lista'+i).style.display = 'none';

	}
	vista = (document.getElementById(capa).style.display == 'none') ? 'block' : 'none';
	document.getElementById(capa).style.display = vista; 
}


function submenu(capa) {

	document.getElementById(capa).style.display = 'block';
	
}
	


function mostrar(capa) {
	
	document.getElementById(capa).style.display = 'block';
	
}

function ocultar(capa) {
	document.getElementById(capa).style.display = 'none';
	
}


function abrirPopUp(page,ancho,alto){window.open(page,null,"height="+alto+","+"width="+ancho, scrollbars="yes");}	



function nacional(table) 

   {
	
   var grupo = 50;
	document.getElementById(table).style.display = 'block';
	for (b=1; b < grupo +1; b++) 
		{
			document.getElementById('distribuidores'+b).style.display = 'none';
		}
	vista = (document.getElementById(table).style.display == 'none') ? 'block' : 'none';
	document.getElementById(table).style.display = vista;
			
   }



function nav () {
	for (i=1; i < 5; i++) {
	
	document.getElementById('lista'+i).style.display= 'none';
}
	var carpeta = document.location.href.lastIndexOf('/');
	var firstpos = carpeta-5;
	directorio=document.location.href.substring(firstpos,carpeta);
	//alert(directorio);	

	switch (directorio){
		case 'acion':
		document.getElementById('lista1').style.display = 'block';
		break;
		case 'ollos':
		document.getElementById('lista2').style.display = 'block';
		break;
		case 'stion':
		document.getElementById('lista2').style.display = 'block';
		break;
		case 's/ERM':
		document.getElementById('lista2').style.display = 'block';
		break;
		case 'tadas':
		document.getElementById('lista3').style.display = 'block';
		break;
		case 'icios':
		document.getElementById('lista4').style.display = 'block';
		break;
		case 'icias':
		document.getElementById('lista5').style.display = 'block';
		break;
		case 'dades':
		document.getElementById('lista5').style.display = 'block';
		break;		
}
	
}


										   function selecionada(capa, enlaceActivo){

																		  var enlaces = document.getElementById("nivel3").getElementsByTagName('A');

																		  for(var i=0; i<    enlaces.length; i++){

																						  if(enlaces[i].nodeName == 'A'){

																										  enlaces[i].className = "";

																						  }

																		  }



																		  addClass(enlaceActivo, "selecionada");

																		  

																		  var grupo = document.getElementById('interior2').getElementsByTagName('DIV');

																						  for (i=0; i<grupo.length; i++) {

																										  if (grupo[i].nodeType == 1)

																										  {

																														 grupo[i].style.display = 'none';

																										  }

																						  }

																						  vista = (document.getElementById(capa).style.display == 'none') ? 'block' : 'none';

																						  document.getElementById(capa).style.display = vista;

																						  

																		  }
