/****************************/
/* POP UP */
/****************************/
function openWin(file, w, h) {
	var nom=0;
	nom = window.open(file, "fenetre", "toolbar=no, width=" + w + ", height=" + h + ", directories=no, status=no, scrollbars=yes, resize=no, resizable=no, menubar=no");
}
/****************************/

/****************************/
/* CHANGE LES IMAGES */
/****************************/
function change_image(img) {
	image = new Image;
	image.src = img;
	if(clientIs.ns) {
		document.destination.src = image.src;
	} else {
		destination.src = image.src;
	}
	return this;
}
/****************************/

/****************************/
/* RESTORE LES IMAGES */
/****************************/
function restore_image(img) {
	image = new Image;
	image.src = img;
	if(clientIs.ns) {
		document.destination.src = image.src;
	} else {
		destination.src = image.src;
	}
	return this;
}
/****************************/


function selectAll(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName]){
		return;
	}
	for (var j=0;j<FieldName.lenght;j++){
		var objCheckBoxes = document.forms[FormName].elements[FieldName[j]];
		if(!objCheckBoxes){
			return;
		}
		var countCheckBoxes = objCheckBoxes.length;
		if(!countCheckBoxes){
			objCheckBoxes.checked = CheckValue;
		}else{
			// set the check value for all check boxes
			for(var i = 0; i < countCheckBoxes; i++){
				objCheckBoxes[i].checked = CheckValue;
			}
		}
	}
}

/**********************************************/
// RECHERCHE DU NAVIGATEUR
/**********************************************/

/*function sniffer() 
{

    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);

    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major == 4));
//    this.ns6 = (this.ns && (this.major >= 5));
//	this.ns7 = (this.ns6 && document.clientHeight);

	this.safari = (navigator.product == 'Gecko' && agent.indexOf('Safari')!=-1) ? true:false;
	this.ns6 =(navigator.product == 'Gecko' && !window.find && !this.safari)?true:false;
	this.ns7 =(navigator.product == 'Gecko' && window.find && !this.safari)?true:false;


    this.ie   = (agent.indexOf('msie') != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie5  = (this.ie && (this.major >= 4) && (document.getElementById) ) ? true : false ;
    this.ie6  = (this.ie5 && (agent.indexOf('msie 6')!=-1) ) ? true : false ;
    this.ie4  = (this.ie && (this.major >= 4) && !(this.ie5));
    this.op3 = (agent.indexOf("opera") != -1);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);
    this.dom = (this.ns6|| this.ns7 || this.ie5 || this.safari );

}
clientIs = new sniffer();*/

/**********************************************/
// FONCTIONS MACROMEDIA
/**********************************************/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_showHideLayers_basket(ob, etat) { //v6.0
	if (etat == 0) {
		MM_showHideLayers(ob, '', 'show');
		return(1);
	} else {
		MM_showHideLayers(ob, '', 'hide');
		return(0);
	}
}


function menu_visible(calque){
	tout_effacer();
	MM_showHideLayers(calque,'','show');
	return true;
}

function tout_effacer(){
	for (i=0; i<60; i++){
		MM_showHideLayers('bulle'+i,'','hidden');
		MM_showHideLayers('bulle2_'+i,'','hidden');
	}
	// LA GROSSE BULLE
	MM_showHideLayers('bullebig0','','hidden');
	MM_showHideLayers('bulle2_big0','','hidden');
	return true ;
}

// JAVASCRIPT D'AFFICHAGE/MASKAGE DES SOUS MENUS DANS CONTENT LEFT 2007
function clicMenu(num,nbTotalMenu) {
	
//   nbTotalMenu = 2;	
  // Booléen reconnaissant le navigateur (vu en partie 2)
  
  isIE = (document.all)
  isNN6 = (!isIE) && (document.getElementById)
  if (isNN6) isIE = false;

  // Compatibilité : l'objet menu est détecté selon le navigateur
  if (isIE) menu = document.all['menu' + num];
  if (isNN6) menu = document.getElementById('menu' + num);
  
    // On ferme tout les menus déjà ouvert
  for (i=0;i<nbTotalMenu;i++) {
   if (i != num) {
    if (isIE) menuDiff = document.all['menu'+i];
    if (isNN6) menuDiff = document.getElementById('menu'+i);
    if (menuDiff.style.display != "none") {
     menuDiff.style.display = "none"
    }
   }
  }

  // On ouvre ou ferme
  if (menu.style.display == "none"){
    // Cas ou le tableau est caché
    menu.style.display = ""
  } else {
    // On le cache
    menu.style.display = "none"
   }
}

function ouvrirLien(url,ouverture,cible) {
  // Cette fonction permet d'ouvrir trois type de lien
  // 1 : Dans la fenêtre courante
  // 2 : Dans une nouvelle fenêtre
  // 3 : Dans une frame dont la cible doit être précisé

  switch (ouverture) {
    case "1" :
      // Ouverture dans la fenêtre courante
      document.location.href = url;
      break;
  }
}
// FIN JAVASCRIPT D'AFFICHAGE/MASKAGE DES SOUS MENUS DANS CONTENT LEFT 2007
