function showMenu(id){
	var menu=document.getElementById('menu_'+id);
	var smenu=document.getElementById('smenu_'+id);
	menu.style.backgroundColor= "#ffb400";
	smenu.style.display = "block";
}
function hideMenu(id){
	var menu=document.getElementById('menu_'+id);
	var smenu=document.getElementById('smenu_'+id);
	menu.style.backgroundColor= "";
	smenu.style.display = "none";
}
function chclasse(id,classe){
	var ob = document.getElementById(id);
	ob.className= classe;
} 
function chBG(id,couleur){
	var ob = document.getElementById(id);
	ob.style.backgroundColor= couleur;
} 

		
var currentMenu = null;
	var currentiMenu = null;
	
	function displayMenu(id,defaut){
		container = document.getElementById(id);
		imenu = document.getElementById('m_'+id);
	
		if ( currentMenu == null) {
			currentMenu = document.getElementById(defaut);
			currentiMenu = document.getElementById('m_'+defaut);
			
			
		}
		currentMenu.style.display = "none";
		currentiMenu.className = "";
	
		if (container.style.display == "none"){
			container.style.display = "block";
			imenu.className = "active";
		}else{
			container.style.display = "none";
			imenu.className = "";
		}
		currentMenu = container;
		currentiMenu = imenu;
	}

function confirmSubmit(){
    choix = confirm("Souaitez vous vraiment supprimer cette entree ?");
    if (choix == true)
      {
      document.formulaire.submit();
      }
    else
      {
      return false;
      }
}

/**************AJAX*********************************************************/


function r_search(mots){
	
	if(mots.length>2){
		if(texte = file('search.php?mots='+mots)){
			writediv(texte,'contenu');	
		}
	}
}

function writediv(texte,id){
	document.getElementById(id).innerHTML = texte;
}

function file(fichier){
if(window.XMLHttpRequest) // FIREFOX
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else
return(false);
xhr_object.open("GET", fichier, false);
xhr_object.send(null);
if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}

/**************fin AJAX*********************************************************/







// JavaScript Document
// Correctly handle PNG transparency in Win IE 5.5 or higher.
// Optimization : Browser Detection by Sol@web - Updated on 06 September 2005
function correctPNG(){
   for(var i=0; i<document.images.length; i++){
     var img = document.images[i]
     var imgName = img.src.toUpperCase()
     if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
       var imgID = (img.id) ? "id='" + img.id + "' " : ""
       var imgClass = (img.className) ? "class='" + img.className + "' " : ""
       var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
       var imgStyle = "display:inline-block;" + img.style.cssText
       if (img.align == "left") imgStyle = "float:left;" + imgStyle
       if (img.align == "right") imgStyle = "float:right;" + imgStyle
       if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle      
       var strNewHTML = "<span " + imgID + imgClass + imgTitle
       + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
       + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
       img.outerHTML = strNewHTML
       i = i-1
     }
   }
   /////  This part handles background png's (Koen Betsens)
   for(i=0;i<document.all.length;i++){
      bg=document.all[i].currentStyle.backgroundImage;
      if(bg.toUpperCase().substr(bg.length-5,3)=='PNG'){
         if(bg.search('%20')>0){bg=bg.replace('%20',' ')}
         document.all[i].style.backgroundImage='none';
         document.all[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='"+bg.substr(5,bg.length-7)+"')"
      }
   }
}
/* 
if (navigator.appName == "Microsoft Internet Explorer") {
	window.attachEvent("onload", correctPNG); 
}
*/
