function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
/*----------------------------------------Folder ----------------------------------------------------------------------------*/
lastFolderSelected = ""
lastOpenFolder =""

//Selectionne le menu courant
function selectFolder(id_f)
{
	if (id_f != "")
	{
		findObj(id_f).className = findObj(id_f).className + "_selected"
	}
}

function openCloseFolder(id_f,obj_f)
{
	//if id_f exist...

	if (id_f != "")
	{
		//obj_f = object who call function : ex : <a></a>
		if (findObj("tag_content_"+id_f).className.indexOf("hide") != -1)
		{
			openFolder(id_f,obj_f)
			//Test s'il il y a déjà un tag ouvert
			if (lastOpenFolder != "" && lastOpenFolder!=id_f)
			{
				//closeFolder(lastOpenFolder)
			}
			lastOpenFolder = id_f
		}
		else
		{
			closeFolder(id_f,obj_f)
		}
	}

}
	
function openFolder(id_f,obj_f)
{
		//change the sign btn on the folder left
		classNameCurrent = findObj(id_f).className
		classNameNew = classNameCurrent.replace("close","open")
		findObj(id_f).className = classNameNew

		//findObj(id_f).className = "menu_level1_close"

		//change the img of the folder closed to the folder opened
		classNameCurrent = findObj("tag_content_"+id_f).className
		classNameNew = classNameCurrent.replace("hide","show")
		findObj("tag_content_"+id_f).className = classNameNew
}
function closeFolder(id_f,obj_f)
{
		//change the sign btn on the folder left
		classNameCurrent = findObj(id_f).className
		classNameNew = classNameCurrent.replace("open","close")
		findObj(id_f).className = classNameNew
		
		//findObj(id_f).className = "menu_level1_open"

		//change the img of the folder closed to the folder opened
		classNameCurrent = findObj("tag_content_"+id_f).className
		classNameNew = classNameCurrent.replace("show","hide")
		findObj("tag_content_"+id_f).className = classNameNew
}

/*----------------------------------------Pop-up----------------------------------------------------------------------------*/
popUp_i = 0
function popUp(url,width,height) {
  popUp_i ++
  if (!width)  {width="780"}
  if (!height) {height="580"}
  properties = "width="+width+",height="+height
  properties+= ",menubar=0,resizable=1,directories=0,scrollbars=1,status=0,titlebar=0,toolbar=0,location=0"
open(url,"popUp",properties);
//  newWindow.focus();
}

//function OpenTitlePdf()  {  OpenNewWindow("Titres_"+currentLng+".pdf", 550, 550)  }

/*---------------------------browser detection------------------------------------------------------------------------------*/
var ie4 = document.all;
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all; 

/*---------------------------"document.all" ==> "findObj" for Netscape compatibility----------------------------------------*/
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

/*---------------------------hide or show an object (netscape compliant-----------------------------------------------------*/
function hideDiv(obj_f)	{	findObj(obj_f).style.display = "none"	}
function showDiv(obj_f)	{	alert("obj_f : "+obj_f) ; findObj(obj_f).style.display = ""	}
