function getCurrentPage(id,className){
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	var myId = $(id);
	var myLinks = myId.getElementsByTagName('li');
	var nbr = myLinks.length;
	if(sPage == "mentions-legales.php"){
		$('mentions').className = 'active';
		$('mentions').href = "javascript:void(0)";
		$('mentions').onclick = function(){ return false; }
	}
	
	for(i=0;i<nbr;i++){
		var url = myLinks[i].firstChild.href;
		var path = url.substring(url.lastIndexOf('/') + 1);
		if(sPage == ""){
			myLinks[0].className = className;
			myLinks[0].className += " m"+(1);
			if(id == 'menu'){
				myLinks[0].firstChild.style.display = 'none';
			}else{
				myLinks[0].firstChild.className = 'active';
				myLinks[0].firstChild.href = "javascript:void(0)";
				myLinks[0].firstChild.onclick = function(){ return false; }
			}
		}
		if(path == sPage){
			myLinks[i].className = className;
			myLinks[i].className += " m"+(i+1);
			if(id == 'menu'){
				myLinks[i].firstChild.style.display = 'none';
			}else{
				myLinks[i].firstChild.className = 'active';
				myLinks[i].firstChild.href = "javascript:void(0)";
				myLinks[i].firstChild.onclick = function(){ return false; }
			}
		}else{
			
			myLinks[i].firstChild.className = "m"+(i+1);
		}
	}			
}
getCurrentPage('menu','active');
getCurrentPage('footer_menu','active');

