function trimNodes(elt) {
	for(i=0; i<elt.childNodes.length; i++) {
		if(elt.childNodes[i].nodeType == 3) {
			// remover le node
			elt.removeChild(elt.childNodes[i]);
		}
	}
}

/****************************************************/
/*					CUSTOM MENU PRINCIPAL			*/
/****************************************************/
function customMenuPrincipal() {
	// cette fonction sert juste � supprimer la bordure du dernier �l�ment de la liste du menu
	if(document.getElementById('menu_menuprincipal')) {
		trimNodes(document.getElementById('menu_menuprincipal'));
		trimNodes(document.getElementById('menu_menuprincipal').lastChild);
		trimNodes(document.getElementById('menu_menuprincipal').lastChild.lastChild);
		var tabMenu = document.getElementById('menu_menuprincipal').lastChild.lastChild;
		tabMenu.firstChild.firstChild.style.borderRight = 'none';
	}
}


/****************************************************/
/*				FIX MENU DEROULANT IE				*/
/****************************************************/
sfHover = function() {
	var sfEls = document.getElementById("menu_menuprincipal").lastChild.getElementsByTagName("LI");
	var allMenus = document.getElementById("menu_menuprincipal").lastChild.childNodes;
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
function showActiveMenu(elt) {
	elt.style.display = 'block';
}
function hideAllMenus(elt) {
	for(jLU=0; jLU<elt.length; jLU++) {
		elt[jLU].style.display = 'none';
	}
}


/****************************************************/
/*						DOM NEWS					*/
/****************************************************/
/* Variables, go nuts changing those! */
	// initial position 
	var dn_startpos=120; 			
	// end position
	var dn_endpos=-70; 			
	// Speed of scroller higher number = slower scroller 
	var dn_speed=70;				
	// ID of the news box
	var dn_newsID='actu_ticker';			
	// class to add when JS is available
	var dn_classAdd='hasJS';		
	// Message to stop scroller
	var dn_stopMessage='';	
	// ID of the generated paragraph
	var dn_paraID='DOMnewsstopper';

/****************************************************/
/*				INITIALISATION DE LA PAGE			*/
/****************************************************/
function addLoadListenerPage(func) {
	if (window.addEventListener) {
		window.addEventListener("load", func, false);
	} else if (document.addEventListener) {
		document.addEventListener("load", func, false);
	} else if (window.attachEvent) {
		window.attachEvent("onload", func);
	}
}

if (document.getElementById && document.createTextNode) {
	addLoadListenerPage(function() {
		customMenuPrincipal();
		if (window.attachEvent) sfHover();
		// prepareHelpLinks();
		// prepareZoom();
		if (document.getElementById('actu_ticker'))
			initDOMnews();
	});
}
