/*DETECTION DU TYPE DE NAVIGATEUR*/
function isRealBrowser() {
	// Mozilla, netscape, etc...
	if (document.implementation && document.implementation.createDocument){
		return true;
	}
	// IE....
	else {
		return false;
	}
}
/*FIN DETECTION DU TYPE DE NAVIGATEUR*/

function setHover(){
	if(!isRealBrowser()){
		var menu = document.getElementById('menu');
		if ( menu != null ) {
			var LI = menu.getElementsByTagName('li');
			var nLI = LI.length;
			for(var i=0; i < nLI; i++){
				LI[i].onmouseover = function(){
					hover(this, 1);
				}
				LI[i].onmouseout = function(){
					hover(this, 0);
				}
			}
		}
	}
}

function hover(obj, iHover){
	if(!isRealBrowser()){
		var CSSclass = obj.className;
		if ( CSSclass.indexOf('separateur') == '-1' ) {
			if ( iHover == 1 ) {
				obj.className+=' hover';
			}
			else {
				obj.className=obj.className.replace(/ hover/, '');
			}
			if ( CSSclass.indexOf('last-child') != '-1' ) {
				obj.className += ' last-child';
			}
			if ( CSSclass.indexOf('first-sub-child') != '-1' ) {
				obj.className += ' first-sub-child';
			}
			UL = obj.getElementsByTagName('ul');
			if(UL.length > 0){
				sousMenu = UL[0].style;
				if(sousMenu .display == 'none' || sousMenu.display == ''){
					sousMenu.display = 'block';
				}
				else {
					sousMenu.display = 'none';
				}
			}
		}
	}
}

function hover2(obj, iOver) {
	if ( iOver == 1 ) {obj.style.backgroundColor='#EFEFEF';}
	else {obj.style.backgroundColor='#FFFFFF';}
}

function showDiv(divId) {
	var DIV_DISPLAY = document.getElementById(divId).style.display;
	/*alert(DIV_DISPLAY);*/
	if ( DIV_DISPLAY == 'none' || DIV_DISPLAY == '' ) {
		/*setTimeout("document.getElementById('"+divId+"').style.display='block';",50);*/
		document.getElementById(divId).style.display='block';
	}
	else {
		document.getElementById(divId).style.display='none';
	}
}

function setHover2() {
	var DIV = document.getElementById('liste').getElementsByTagName('div');
	for ( var i = 0 ; i < DIV.length ; i++ ) {
		if ( DIV[i].className.indexOf('label') == '-1' && DIV[i].className.indexOf('off') == '-1' && DIV[i].className.indexOf('assoc') == '-1' && DIV[i].className != 'left' && DIV[i].className != 'right' && DIV[i].className != 'statut' && DIV[i].className != '' ) {
			var A = DIV[i].getElementsByTagName('a');
			A[0].onmouseover=function(){hover2(this.parentNode,1);};
			A[0].onmouseout=function(){hover2(this.parentNode,0);};
		}
	}
}

/*Envoi des mises à jour*/
function sendMaj(iType) {
	/*var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    if ( iType == 0 ) {
    	ro.open('get', 'passerelle.php');
    }
    else {
    	ro.open('get', 'passerelle_p.php');
    }
    ro.send(null);
    ro = null;*/
}

