// JavaScript Document

//TECLAS DE ACCESO RAPIDO
document.onkeydown = function () {//para el explorer
	if(window.event){
		
		var codigo = event.keyCode
		//alert("c1-"+codigo);
		
		
		try{
			if(!(codigo==18)){//NO ES LA TECLA ALT
				var tecla = String.fromCharCode(codigo)
				//alert(tecla);
				//alert(event.altKey);
				for (var x = 0; x < listaURLs.length && event.altKey; x++) {//el seg significa que alt esta pulsada cuando se produjo el emvento
					var t=listaURLs[x].tecla;
					//alert ("comparando-"+t+"*");
					//alert ("con-"+tecla+"*");
					if ( (tecla == t) ){
						//alert ("La tecla ALT estaba pulsada(explorer).-"+tecla);
						location.href = listaURLs[x].direccion
					}
				}
			}
		}catch(e){ alert(e)}
	}
}



//si 1 soporta el objeto Event
var Navegador = (window.Event) ? 1 : 0

//comprueba la tecla pulsada
function CompruebaTecla(evento) {//oara el mozilla
	

	//alert("compr");
	var codigo = Navegador ? evento.which : event.keyCode
	var tecla = String.fromCharCode(codigo)
	//alert("tecla--"+tecla)
	//alert(evento.altKey);
	for (var x = 0; x < listaURLs.length && evento.altKey; x++) {//el seg significa que alt esta pulsada cuando se produjo el emvento
		
		if ( (tecla == listaURLs[x].tecla) ){
			//alert ("La tecla ALT estaba pulsada.-"+tecla);
			location.href = listaURLs[x].direccion
		}
	}
}

//crea elemento de la lista de URLs
function objetoURL(tecla, direccion) {
	this.tecla = tecla
	this.direccion = direccion
}

//crea la lista de URLs
var listaURLs = new Array()
//especificar aqui las URLs o rutas y nombres de fichero de las paginas a mostrar
listaURLs[0] = new objetoURL("h", "/eptron/web/eptron1/home")
listaURLs[1] = new objetoURL("H", "/eptron/web/eptron1/home")
listaURLs[2] = new objetoURL("e", "/eptron/web/eptron1/empresa")
listaURLs[3] = new objetoURL("E", "/eptron/web/eptron1/empresa")

listaURLs[4] = new objetoURL("a", "/eptron/web/eptron1/areasdenegocio")
listaURLs[5] = new objetoURL("A", "/eptron/web/eptron1/areasdenegocio")
listaURLs[6] = new objetoURL("c", "/eptron/web/eptron1/casosdeexito")
listaURLs[7] = new objetoURL("C", "/eptron/web/eptron1/casosdeexito")
listaURLs[8] = new objetoURL("n", "/eptron/web/eptron1/noticiasyeventos")
listaURLs[9] = new objetoURL("N", "/eptron/web/eptron1/noticiasyeventos")
listaURLs[10] = new objetoURL("p", "/eptron/web/eptron1/proyectos")
listaURLs[11] = new objetoURL("P", "/eptron/web/eptron1/proyectos")
listaURLs[12] = new objetoURL("m", "/eptron/web/eptron1/mapa-web")
listaURLs[13] = new objetoURL("M", "/eptron/web/eptron1/mapa-web")

listaURLs[14] = new objetoURL("l", "/eptron/web/eptron1/aviso-legal")
listaURLs[15] = new objetoURL("L", "/eptron/web/eptron1/aviso-legal")
listaURLs[16] = new objetoURL("b", "/eptron/web/eptron1/boletin")
listaURLs[17] = new objetoURL("B", "/eptron/web/eptron1/boletin")
listaURLs[18] = new objetoURL("s", "/eptron/web/eptron1/accesibilidad")
listaURLs[19] = new objetoURL("S", "/eptron/web/eptron1/accesibilidad")
//activa la captura de eventos
try{
	//alert("toy aki-");
	if (Navegador) {	
			
				document.captureEvents(Event.KEYPRESS)
				document.onkeypress = CompruebaTecla
			
	}
	//alert("toy aki2-"+Navegador);
	

}catch(e){alert(e);}

