	/*
		pureDOM navigator
		written by Christian Heilmann http://www.onlinetools.org/
		Version 1.0
		05.11.2003
		Updated by Jacques PYRAT http://www.pyrat.net/
		14 jan 2004
	*/
	// Presets, should they not be defined
	var blankpic='/squelette/images/0.gif';
	var onpic='/squelette/images/plus.gif';
	var offpic='/squelette/images/minus.gif';
	var picalt='Cliquer pour déplier ou replier';
	var pictitle='Cliquer pour déplier ou replier';
	var parentID='menu';
	// Checking for DOM compatibility	
	if (document.getElementById && document.createTextNode && document.createElement){canDOM=true}

	function expinit(){
		if (canDOM){
			if(parentID && document.getElementById(parentID)){
				alluls=document.getElementById(parentID).getElementsByTagName('UL');
				alllis=document.getElementById(parentID).getElementsByTagName('LI');
			}else{
				alluls=document.getElementsByTagName('UL');
				alllis=document.getElementsByTagName('LI');
			}
			for(i=0;i<alllis.length;i++){
				islink=alllis[i].getElementsByTagName('A')[0];
				if(islink){
					addimg = document.createElement('img');
					addimg.src=blankpic;
					addimg.className='node';
					addimg.alt='';
					cola = document.createElement('a');
					cola.setAttribute('href','#');
					cola.className='node';
					cola.onclick=function() {ex(this);return false;};
					cola.onkeypress=function() {ex(this);return false;};
					cola.appendChild(addimg);
					alllis[i].insertBefore(cola,alllis[i].firstChild);
				}
			}

			for(i=0;i<alluls.length;i++){
				subul=alluls[i];
				if(subul.parentNode.tagName=='LI'){
					// Do not collapse when there is a strong element in the list.
					highlight=subul.parentNode.getElementsByTagName('strong').length==0?true:false;
					disp=highlight?'none':'block';
					pic=highlight?onpic:offpic;
					// End  highlight change
					childs=subul.getElementsByTagName('LI').length
					mom=subul.parentNode.getElementsByTagName('A')[0]
					if(mom){
						momimg=mom.childNodes[0];
						momimg.setAttribute('alt',picalt);
						momimg.setAttribute('title',pictitle);
						momimg.src=pic;
						subul.style.display=disp;
					}
				}
			}

			// Suppresion des images qui ne sont pas des plus ou moins
			for(i=0;i<alllis.length;i++){
				mom=alllis[i].getElementsByTagName('A')[0];
				if(mom){
					momimg=mom.childNodes[0];
					if (momimg.src.indexOf(blankpic)!=-1) {
						// remove link and image
						mom.parentNode.removeChild(mom);
					}					
				}
			}
		}
	}

	// Collapse and Expand node.
    function ex(n){
		if(canDOM){
			u=n.parentNode.getElementsByTagName("ul")[0];
			if(u){
				u.style.display=u.style.display=='none'||u.style.display==''?'block':'none';
				img=n.getElementsByTagName('img')[0];
				img.src=img.src.indexOf(offpic)!=-1?onpic:offpic;					
			}
		}			
	}
	window.onload=expinit;
