//fonction de detection version de flash
var flashVersion = 0;
var flashVersion_DONTKNOW = -1;
	function getFlashVersion() {
		var agent = navigator.userAgent.toLowerCase(); 
	   // NS3 needs flashVersion to be a local variable
	   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
	      flashVersion = 0;
	   }
		// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
		if (navigator.plugins != null && navigator.plugins.length > 0) {
			var flashPlugin = navigator.plugins['Shockwave Flash'];
			if (typeof flashPlugin == 'object') { 
				if (flashPlugin.description.indexOf('7.') != -1) flashVersion = 7;
				else if (flashPlugin.description.indexOf('6.') != -1) flashVersion = 6;
				else if (flashPlugin.description.indexOf('5.') != -1) flashVersion = 5;
				else if (flashPlugin.description.indexOf('4.') != -1) flashVersion = 4;
				else if (flashPlugin.description.indexOf('3.') != -1) flashVersion = 3;
			}
		}
		
		// IE4+ Win32:  attempt to create an ActiveX object using VBScript
		else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		   document.write('<scr' + 'ipt language="VBScript"\> \n');
			document.write('on error resume next \n');
			document.write('dim obFlash \n');
			document.write('set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") \n');
			document.write('if IsObject(obFlash) then \n');
			document.write('flashVersion = 7 \n');
			document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") end if \n');
			document.write('if flashVersion < 7 and IsObject(obFlash) then \n');
			document.write('flashVersion = 6 \n');
			document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") end if \n');
			document.write('if flashVersion < 6 and IsObject(obFlash) then \n');
			document.write('flashVersion = 5 \n');
			document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") end if \n');
			document.write('if flashVersion < 5 and IsObject(obFlash) then \n');
			document.write('flashVersion = 4 \n');
			document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") end if \n');
			document.write('if flashVersion < 4 and IsObject(obFlash) then \n');
			document.write('flashVersion = 3 \n');
			document.write('end if');
			document.write('</scr' + 'ipt\> \n');
	  }
		// WebTV 2.5 supports flash 3
		else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;
		// older WebTV supports flash 2
		else if (agent.indexOf("webtv") != -1) flashVersion = 2;
		// Can't detect in all other cases
		else {
			flashVersion = flashVersion_DONTKNOW;
		}
		return flashVersion;
	}

//debut des fonctions de prechargement des images et de l'afficahge	des divmenus

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

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&&id.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];}
}
/*
fonction d'afficage de calque de Dreamweaver !! 
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; }
}
*/

// passe le id en chaine de caractère du calque à afficher.
//la fonction cache tous les calques puis affiche celui à affichers
function affiche_Calque(calque) { //v6.0
	cache_Calque();
 	document.getElementById(calque).style.visibility='visible';
}

//cache tout les calques
//Appelé lors du passage sur un des calques d'arrière plan ou lors de l'affichage d'un calque
//voir affiche_calque();
function cache_Calque() { //v6.0
	document.getElementById("menuoffres").style.visibility='hidden';
 	document.getElementById("menunews").style.visibility='hidden';
	document.getElementById("menumetiers").style.visibility='hidden';
	document.getElementById("menusyndicat").style.visibility='hidden';
	document.getElementById("menudeveloppement").style.visibility='hidden';
	document.getElementById("menueau").style.visibility='hidden';
	document.getElementById("menupratique").style.visibility='hidden';
	document.getElementById("menuassainissement").style.visibility='hidden';
}
// fin des fonctions de prechargement des images et de l'afficahge	des divmenus

// une variable utiliser pour fermer la fenetre depuis la page qui l'a ouverte
	var newfenetre;
	
//fonction pour ouvrir un pop_up avec le proprietes de fenetre definis
//voir exemple d'utilisation info_anc.php4 ligne 82 et onfocus= dans le body pour fermer la fenetre automatiquement.
	function ouvrir_fenetre(chemin, h, w) {
		// window.open ('chemin de la page a ouvrir', 'nom de la fenetre', 'liste de propriete1, propriete2, ...')
		newfenetre = window.open(chemin, 'newwin', 'height='+h+',width='+w+',location=no,toolbars=no,scrollbars');
	}

//fonction pour ouvrir popup H²O une seule fois

	
/*
SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
http://www.editeurjavascript.com

function ScanCookie(variable)
	{
	cook = document.cookie;
	variable += "=";
	place = cook.indexOf(variable,0);
	if (place <= -1)
		return("0");
	else
		{
		end = cook.indexOf(";",place)
		if (end <= -1)
			return(unescape(cook.substring(place+variable.length,cook.length)));
		else
			return(unescape(cook.substring(place+variable.length,end)));
		}
	}

function CreationCookie(nom,valeur,permanent)
	{
	if(permanent)
		{
		dateExp = new Date(2020,11,11);
		dateExp = dateExp.toGMTString();
		ifpermanent = '; expires=' + dateExp + ';';
		}
	else
		ifpermanent = '';
	document.cookie = nom + '=' + escape(valeur) + ifpermanent;
	}

if(ScanCookie("dejapopup")==0)
	{
	window.open('popup_H2O.html','_blank','toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,menuBar=0,width=444,height=600');
	CreationCookie("dejapopup","oui",false)
	}
*/

	
	
