// JavaScript Document// JavaScript Document
function hacerActual(id){ 
var i,x,d,hr,ha,ef,a,ag;
	if(document.getElementById){
		d=document.getElementById(id);
		if(d){
			hr=window.location.href;
			ha=d.getElementsByTagName("A");
			if(ha&&ha.length){
				for(i=0;i<ha.length;i++){
					if(ha[i].href){
						if(hr.indexOf(ha[i].href)>-1){	
							ha[i].className="actual";
							ha[i].removeAttribute('href');
							//ha[i].style.color = '#000';
						}
					}
				}
			}
		}
	}
	
}

function hacerActualPag(elDiv){ 
var i,x,d,hr,ha,ef,a,ag,hr1
	if(document.getElementById){
		d=document.getElementById(elDiv);
		if(d){// si existe el div navLista ...
			hr=window.location.href;// me guardo la url de la pagina actual
			hl=hr.lastIndexOf('/');//cojo desde la ultima barra
			hr=hr.substring(hl+1);// Solo dejo el nombre de la pagina y las variables pasadas con ?
			ha=d.getElementsByTagName("A");// cojo todas las tag A dentro del div (en este caso navLista)
			if(ha&&ha.length){// si hay A dentro del menu ...
				for(i=0;i<ha.length;i++){// recorro todas las A
					hr1=ha[i].href;// me guardo cada href de cada A
					h11=hr1.lastIndexOf('/');//cojo desde la ultima barra
					hr1=hr1.substring(h11+1);//Solo dejo el nombre de la pagina y las variables pasadas con ?
					if(hr1==hr){// si el A que acabo de leer es como el de la pagina  ....
							ha[i].removeAttribute('href');//borro href
							ha[i].className="actualPag";//cambio estilo
							
					}
				}
			}
		}
	}
}

function hacerActualMenu(id,cod){ 
var i,x,d,hr,ha,ef,a,ag;
	if(document.getElementById){
		d=document.getElementById(id);
		if(d){
			//hr=window.location.href;
			hr=cod;
			ha=d.getElementsByTagName("A");
			if(ha&&ha.length){
				for(i=0;i<ha.length;i++){
					if(ha[i].href){
						if(ha[i].href.indexOf(hr)>-1){
							ha[i].removeAttribute('href');
							ha[i].className="actual";
							ha[i].style.color = '#3366CC';
						}
					}
				}
			}
		}
	}
	
}
