// JavaScript Document

/*  
Script made by Martial Boissonneault © 2001-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) 
{ 
	 if (document.getElementById) 
	 { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return false");


<!--
var intCount = 0;

//-Fonction d'ajout d'entrées principales-------------------------
function DynamicMenu_addParent(strName) 
{
	var strID = 'ID' + intCount++; 
	
	var strTemp = '<DIV ID="' + strID + '" class="parent"';
	strTemp += ' onClick="expandCollapse(this);">';
	strTemp += '<IMG SRC="../gif/puce.gif">';
	strTemp += '&nbsp;' + strName ;
	strTemp += '<DIV STYLE="display: none" class="child"></DIV>';
	strTemp += '</DIV>';
	
	this.div.innerHTML += strTemp;
	this.currentChild = document.getElementById(strID);
}

//-Fonction d'ajout de liens dans le menu-------------------------
function DynamicMenu_addChild(strName,strURL) 
{
	var strTemp = '<A HREF="' + strURL + '"'
	+ ' onClick="cancelBubble(arguments[0]);">' 
	+ strName + '</A><BR>';
	
	if (document.all) 
	{
		this.currentChild.children[1].innerHTML += strTemp;
	}
	else 
	{
		this.currentChild.childNodes[2].innerHTML += strTemp;
	}
}

//-inhibe la cascade d'évènements au DIV conteneur----------------
function cancelBubble(netEvent) 
{
	if (document.all) 
	{
		window.event.cancelBubble = true;
	}
	else 
	{
		netEvent.cancelBubble = true;
	}
}

//-Contracte ou expanse le menu-----------------------------------
function expandCollapse(objElement) 
{
	if (document.all) 
	{
		var imgIcon = objElement.children[0];
		objElement = objElement.children[1];
	}
	else 
	{
		var imgIcon = objElement.childNodes[0];
		objElement = objElement.childNodes[2];
	}    

	if (objElement.style.display == "none") 
	{
		objElement.style.display = "block" ;
		imgIcon.src = "../gif/puce_bas.gif" ;
	}
	else 
	{
		objElement.style.display = "none" ;
		imgIcon.src = "../gif/puce.gif" ;
	}
}

//-Fonction de création de menu dynamique------------------------- 
function DynamicMenu() 
{
	var id = "Menu" + intCount++;
	document.write('<DIV Id="' + id + '"></DIV>');

	this.div = document.getElementById(id);
	this.currentChild = null;
	this.addParent = DynamicMenu_addParent;
	this.addChild = DynamicMenu_addChild;
}
// -->

