<!--
function popup(adr,nompop,larg,haut,res){window.open(adr,nompop,'width='+larg+',height='+haut+',scrollbars=1,toolbar=0,location=0,status=0,menubar=0,resizable='+res);}
function imgPopup(nomPop,img,fond,txt,css){
   imgPop = window.open("",nomPop,"scrollbars=yes,width=700,height=550");
   imgPop.document.write("<html>\n\n");
   imgPop.document.write("<head><title>Apercu d'image</title></head>\n\n");
   imgPop.document.write("<body bgcolor=\""+fond+"\">\n");
   imgPop.document.write("  <table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\">\n");
   imgPop.document.write("    <tr><td align=\"center\"><img src=\"ressources/"+img+"\"></td></tr>\n");
   imgPop.document.write("    <tr><td align=\"center\">\n");
   imgPop.document.write("      <table border=\"0\" cellpadding=\"0\" cellspacing=\"2\">\n");
   imgPop.document.write("        <tr><td><span style=\""+css+"\">"+txt+"</span></td></tr>\n");
   imgPop.document.write("      </table>\n");
   imgPop.document.write("    </td></tr>\n");
   imgPop.document.write("  </table>\n");
   imgPop.document.write("</body>\n\n");
   imgPop.document.write("</html>");
}
function Makepop(url,my_l,my_h,my_s,my_status,my_resize,my_name){
	/* Version 1.0 */
	/* Creation Marc alias DMC */
	addPop=window.open(url,my_name,"width="+my_l+",height="+my_h+",scrollbars="+my_s+",toolbar=0,location=0,status="+my_status+",menubar=no,resizable="+my_resize);addPop.focus();
}

/* ////////////////////////////////////////////// */
/*	Test un ensemble de caract res                */
/*	@return true ou false                         */
/* ////////////////////////////////////////////// */
function defendu(string) {
if (!string){return false;}

   var iChars = "abcdefghijklmnopqrstuvwxyz@-_.~0123456789";
   for (var i = 0; i < string.length; i++) {
		if (iChars.indexOf(string.charAt(i).toLowerCase()) == -1){
			return false;
		}
   }
   return true;
} 
/* ////////////////////////////////////////////// */
/*	Test l'email                                  */
/*	@return false ou String                       */
/* ////////////////////////////////////////////// */
function is_Email(emails){
	if (emails.indexOf("@") != -1 && emails.indexOf("..")==-1 && defendu(emails)==true){
			var longueur = emails.split("@");
			if((longueur.length==2) && (longueur[0]!="" && longueur[1]!="")){
				var taille=longueur[1].lastIndexOf(".");
				if(taille!=-1){
					if((longueur[1].length-1-taille)==2 || (longueur[1].length-1-taille)==3 ){
						return true;
					}
					return false;
				}
				return false;
			}
			return false;
	}
	return false;		
}

/******************/
/* NEWS FLASH 2.0 */
/******************/

function afficheNewsFlashv2(largeur, hauteur, anim) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largeur+'" height="'+hauteur+'" id="" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="./flash/'+anim+'?newsxml=news.xml&prefix=./flash" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="./flash/'+anim+'?newsxml=news.xml&prefix=./flash" quality="high" wmode="transparent" width="'+largeur+'" height="'+hauteur+'" name="" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

/***************/
/* MODULE ZOOM */
/***************/

function afficheZoom(config, id) {
	var so = new SWFObject(config, id, "466", "430", "8", "#FFFFFF");
	so.write("moduleGalerie"+id);
}

/**************/
/* FLASH HOME */
/**************/

function setFlashHome() {
	var so = new SWFObject("./ressources/flashHome.swf", "flash", "358", "181", "8", "000000");
	so.addParam("wmode", "transparent");
	so.write("flash");	
}

Dmc_declars =new Array();

function afficheMenus(chemin) {
	menu("menu1", "menu_7", "","",chemin);
	menu("menu2", "menu_19", "last", "selected",chemin);
	menu("menu3", "menu_30", "","",chemin);
}
function afficheMenusExtra(id) {
	menuExtra("menu1", "menu_"+id, "");
}
function menuExtra(inId, startAt, cssLast, cssCurrent) {	
	var niveau1 = getArbo(startAt);
	var ul_1 = document.createElement("ul");
	ul_1.id = inId;
	//alert(niveau1.length)
	for(var i=1;i<niveau1.length;i++) {
		//alert(niveau1[i]);
		var li_1 = document.createElement("li");
		var titre_1 = niveau1[i][0];
		var url_1 = niveau1[i][1];
		var className = "";
		
		li_1.innerHTML = "<a href=\"" + url_1 + "\" title=\"\" "+className+">" + titre_1 + "</a>\n";
		var tmpNumPageParent = url_1.substring(url_1.lastIndexOf("-")+1, url_1.lastIndexOf("."));
		if(numero_menu == "menu_"+tmpNumPageParent) {
			li_1.firstChild.style.fontWeight = "bold";
		}
		var niveau2 = getArbo(niveau1[i][2]);
		var ul_2 = document.createElement("ul");
		//alert(niveau2.length)
		for(var j=1;j<niveau2.length;j++) {
			var li_2 = document.createElement("li");
			var titre_2 = niveau2[j][0];
			var url_2 = niveau2[j][1];
			var tmpNumPage = url_2.substring(url_2.lastIndexOf("-")+1, url_2.lastIndexOf("."));
			if(tmpNumPage==numPage) li_2.className = "selected";
			li_2.innerHTML = "<a href=\"" + url_2 + "\" title=\"\">" + titre_2 + "</a>\n";
			ul_2.appendChild(li_2);
		}
		
		if(ul_2.childNodes.length>0) {
			
			if(numero_menu != niveau1[i][2]) {
				li_1.firstChild.style.fontWeight = "";
				ul_2.style.display = "none";
			}
			li_1.appendChild(ul_2);
		}
		if((i+1)==niveau1.length && cssLast != "") {
			li_1.className = cssLast;
		}
		ul_1.appendChild(li_1);
	}
	document.getElementById("menugauche").appendChild(ul_1);
}
function menu(inId, startAt, cssLast, cssCurrent, chemin) {	
	var niveau1 = getArbo(startAt);
	var ul_1 = document.createElement("ul");
	ul_1.id = inId;
	for(var i=1;i<niveau1.length;i++) {
		//alert(niveau1[i]);
		var li_1 = document.createElement("li");
		var titre_1 = niveau1[i][0];
		var url_1 = niveau1[i][1];
		//li_1.appendChild(document.createTextNode(titre_1));
		var className = "";
			if(cssCurrent != "") {
				if(i==1 && numero_menu == "menu_20") className = "class=\"diagnostic\"";
				else if(i==2 && numero_menu == "menu_21") className = "class=\"strategie\"";
				else if(i==3 && numero_menu == "menu_22") className = "class=\"preconisations\"";
			}
		li_1.innerHTML = "<a href=\"" + chemin+url_1 + "\" title=\"\" "+className+">" + titre_1 + "</a>\n";
		var tmpNumPageParent = url_1.substring(url_1.lastIndexOf("-")+1, url_1.lastIndexOf("."));
		if(numero_menu == "menu_"+tmpNumPageParent) {
			li_1.firstChild.style.fontWeight = "bold";
		}	
	//	li_1.firstChild.style.fontWeight = "bold";
		var niveau2 = getArbo(niveau1[i][2]);
		var ul_2 = document.createElement("ul");
		for(var j=1;j<niveau2.length;j++) {
			var li_2 = document.createElement("li");
			var titre_2 = niveau2[j][0];
			var url_2 = niveau2[j][1];
			var tmpNumPage = url_2.substring(url_2.lastIndexOf("-")+1, url_2.lastIndexOf("."));
			if(tmpNumPage==numPage) li_2.className = "selected";
			//li_2.appendChild(document.createTextNode(titre_2));
			li_2.innerHTML = "<a href=\"" +chemin+ url_2 + "\" title=\"\">" + titre_2 + "</a>\n";
			ul_2.appendChild(li_2);
		}
		if(ul_2.childNodes.length>0) {
			if(numero_menu != niveau1[i][2]) {
				li_1.firstChild.style.fontWeight = "";
				ul_2.style.display = "none";
			}
			li_1.appendChild(ul_2);
		}
		//if(inId == "menu2") alert(i+1 + " " + niveau1.length + " " + cssLast);
		if((i+1)==niveau1.length && cssLast != "") {
			li_1.className = cssLast;
		}
		ul_1.appendChild(li_1);
	}
	//document.write(ul_1.outerHTML);
	document.getElementById("menugauche").appendChild(ul_1);
}

/***************************/
/* SCROLLING DOCUMENTATION */
/***************************/
var GLOBALE_x = 0;
var GLOBALE_direction;
var GLOBALE_div;
var GLOBALE_objet_index;
var GLOBALE_divS = new Array();
var GLOBALE_interval;

function class_divLiens(div, valeur) {
		this._DIV = div;
		this._X = valeur;
		this.sayX = function() {
			alert(this._X);
		}
		this.sayDIV = function() {
			alert(this._DIV);	
		}
}

function scrollDocumentation(caller, direction) {
		clearInterval(GLOBALE_interval);
		var callerParent = caller.parentNode;
		var divLiens
		if(direction == "bas") divLiens = callerParent.previousSibling;
		else if(direction == "haut") divLiens = callerParent.nextSibling;

		while(divLiens.nodeName != "DIV") {
			if(direction == "bas") divLiens =	divLiens.previousSibling;
			else if(direction == "haut") divLiens =	divLiens.nextSibling;
		}
		
		divLiens = divLiens.firstChild;
		while(divLiens.nodeName != "DIV") {
			divLiens = divLiens.nextSibling;
		}
		
		var trouve = false;
		for(var i=0;i<GLOBALE_divS.length;i++) {
			var tmpObjet = GLOBALE_divS[i];
			var tmpDiv = tmpObjet._DIV;
			if(tmpDiv == divLiens) {
				GLOBALE_div = tmpDiv;
				GLOBALE_x = tmpObjet._X;
				trouve = true;
				GLOBALE_objet_index = i;
			}
		}
		
		if(!trouve) {
			var tmpObjet = new class_divLiens(divLiens, 0);
			GLOBALE_x = 0;
			GLOBALE_div = divLiens;
			GLOBALE_divS[GLOBALE_divS.length] = tmpObjet;
			GLOBALE_objet_index = GLOBALE_divS.length-1;
		}
				
		GLOBALE_direction = direction;
		GLOBALE_interval = setInterval("move()", 50);
}

function scrollStop() {
	clearInterval(GLOBALE_interval);
	var tmpObject = GLOBALE_divS[GLOBALE_objet_index];
	tmpObject._X = GLOBALE_x;
	GLOBALE_divS[GLOBALE_objet_index] = tmpObject;
}

function move() {
	if(GLOBALE_direction == "bas" && GLOBALE_x < 0) {
		GLOBALE_x += 5;
	}
	if(GLOBALE_direction == "haut" && (GLOBALE_x-20>-GLOBALE_div.offsetHeight)) {
		GLOBALE_x -= 5;
	}
	GLOBALE_div.style.top  = GLOBALE_x + "px";
}

function valideRecherche() {
	if(document.formrechercher.query.value != "") document.formrechercher.submit();
	else alert("Veuillez remplir le champ de recherche");
}
//-->
