//Function startList pour les rollover CSS UL/LI
//<span id="thescript" style="display: block; border: 1px solid #FF0000; padding: 10px; background: #FFFFCC;"></span>
//debug = document.getElementById("thescript");

startList = function() {
	navRoot = document.getElementById("nav");
	
	for (i=0; i<navRoot.childNodes.length; i++) {
		li = navRoot.childNodes[i];
		
		if (li.nodeName=="LI") {
			li.onmouseover=function() {
				this.className+=" sfhover";
				if(document.all) this.style.zIndex=100;
				//isItOutside(this);
  			}
			
			li.onmouseout=function() {
				this.className=this.className.replace("sfhover", "");
				if(document.all) this.style.zIndex=1;
   			}
   		}
  	}
}
window.onload=startList;

function isItOutside(el){
	var menuItems = el.parentNode.getElements('li.father');
	var ul = (el.childNodes[1].tagName=="UL") ? el.childNodes[1] : el.childNodes[2];
	
	if(el == menuItems[menuItems.length-1]){
		ul.style.right = '0px';
	};
}
