var imgOpened = new Image();
imgOpened.src = '/images/moins.gif';
var imgClosed = new Image();
imgClosed.src = '/images/plus.gif';

// on regarde si le client est DOM-compliant
var isDOM = (typeof(document.getElementsByTagName) != 'undefined') ? 1 : 0;

//Konqueror (support DOM partiel) : on rejette
if(isDOM && typeof(navigator.userAgent) != 'undefined') {
		var browserName = ' ' + navigator.userAgent.toLowerCase();
		if(browserName.indexOf('konqueror') > 0) {
				isDOM = 0;
		}
}

function hover(obj) {
	if(document.all) {
		UL = obj.getElementsByTagName('ul');
		if(UL.length > 0) {UL[0].style.display = 'block';}
	}
}

function hout(obj) {
	if(document.all) {
		UL = obj.getElementsByTagName('ul');
		if(UL.length > 0) {UL[0].style.display = 'none';}
	}
}
function setHover(){
	if (document.getElementById('nav1')) {
		LI = document.getElementById('nav1').getElementsByTagName('li');
		nLI = LI.length;
		for(i=0; i < nLI; i++){
			LI[i].onmouseover = function(){hover(this);}
			LI[i].onmouseout = function(){hout(this);}
		}
	}
}
// Activation des onglets
function activation(onglet) {
	var chaine;
	var listes=document.getElementsByTagName("LI");
	for (i=0;i<listes.length;i++) {
		chaine = listes[i].id;
		if ( chaine.indexOf("onglet_") == 0 ) {
			if ( chaine == "onglet_"+onglet ) {
				if ( document.getElementById("div_"+chaine).style.display  == 'none' ) {
					document.getElementById("div_"+chaine).style.display  = 'block';
					document.getElementById(chaine).className = 'onglet_active';
				}
			} else {
				if ( document.getElementById("div_"+chaine).style.display  == 'block' ) {
					document.getElementById("div_"+chaine).style.display  = 'none';
					document.getElementById(chaine).className = 'onglet_inactive';
				}
			}
		}
	}
}
function OuvrirFenetre(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
	}

function Deplie(el, unexpand) {
	if (!isDOM) return;

	var whichEl = document.getElementById('fils_' + el);
	var whichIm = document.getElementById('Img_' + el);
	if (whichEl.style.display == 'none' && whichIm) {
		whichEl.style.display  = 'block';
		whichIm.src            = imgOpened.src;
	}
	else if (unexpand) {
		whichEl.style.display  = 'none';
		whichIm.src            = imgClosed.src;
	}
}
