//change couleur d'une case d'un tableau lors d'un survol souris
function td_hover(objRef, state)
{
	objRef.style.backgroundColor = (1 == state) ? '#EEEEEE' : '#FFFFFF';

	return;
}


//enleve les caracteres speciaux
function format_chaine(machaine)
{
	var LaChaine = machaine
	LaChaine = LaChaine.replace("'", "/'")
	return LaChaine;
}

// DATE
navvers = navigator.appVersion.substring(0,1);
if (navvers > 3)
    navok = true;
else
    navok = false;

today = new Date;
jour = today.getDay();
numero = today.getDate();
if (numero<10)
    numero = "0"+numero;
mois = today.getMonth();
if (navok)
    annee = today.getFullYear();
else
    annee = today.getYear();
TabJour = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
TabMois = new Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","dé&eacute;embre");
Datenow = TabJour[jour] + " " + numero + " " + TabMois[mois] + " " + annee;
// FIN DATE


//change une image dans un div
function change_image(nb_img,nom_image,taille_image)
{
	if (nb_img==1) // ici le nom_image doit etre complet : monimage.gif
	{div_image.innerHTML="<img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"' "+taille_image+" border='1'>";}
	if (nb_img==9)
	{
		code_html=""	
		+"<table border='0' cellspacing='0' cellpadding='0'>"
		+"<tr><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_1.gif' "+taille_image+" border='0'></td><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_2.gif' "+taille_image+" border='0'></td><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_3.gif' "+taille_image+" border='0'></td></tr>"												
		+"<tr><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_4.gif' "+taille_image+" border='0'></td><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_5.gif' "+taille_image+" border='0'></td><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_6.gif' "+taille_image+" border='0'></td></tr>"												
		+"<tr><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_7.gif' "+taille_image+" border='0'></td><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_8.gif' "+taille_image+" border='0'></td><td><img alt='ville de saint dizier : centre hospitalier, maison de retraite, concours ecole infirmiere' src='"+nom_image+"_9.gif' "+taille_image+" border='0'></td></tr>"												
		+"</table>";
		
		div_image.innerHTML=code_html;
	}
}



function NewWindow(url,hauteur,largeur) {
	var winl = (screen.width - largeur) / 2;
	var wint = (screen.height - hauteur) / 2;
	date_t = new Date;
	time = date_t.getTime();
	winprops = 'height='+hauteur+',width='+largeur+',top='+wint+',left='+winl+',scrollbars=1,resizable'
	win = window.open(url, time, winprops)
	}


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_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_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);

//orga

/*
	* Montre / Cache un div
	*/
	function DivStatus( nom, numero )
		{
			var divID = nom + numero;
			if ( document.getElementById && document.getElementById( divID ) ) // Pour les navigateurs récents
				{
					Pdiv = document.getElementById( divID );
					PcH = true;
		 		}
			else if ( document.all && document.all[ divID ] ) // Pour les veilles versions
				{
					Pdiv = document.all[ divID ];
					PcH = true;
				}
			else if ( document.layers && document.layers[ divID ] ) // Pour les très veilles versions
				{
					Pdiv = document.layers[ divID ];
					PcH = true;
				}
			else
				{
					
					PcH = false;
				}
			if ( PcH )
				{
					Pdiv.className = ( Pdiv.className == 'cachediv' ) ? '' : 'cachediv';
				}
		}
		
	/*
	* Cache tous les divs ayant le même préfixe
	*/
	function CacheTout( nom )
		{	
			var NumDiv = 1;
			if ( document.getElementById ) // Pour les navigateurs récents
				{
					while ( document.getElementById( nom + NumDiv) )
						{
							SetDiv = document.getElementById( nom + NumDiv );
							if ( SetDiv && SetDiv.className != 'cachediv' )
								{
									DivStatus( nom, NumDiv );
								}
							NumDiv++;
						}
				}
			else if ( document.all ) // Pour les veilles versions
				{
					while ( document.all[ nom + NumDiv ] )
						{
							SetDiv = document.all[ nom + NumDiv ];
							if ( SetDiv && SetDiv.className != 'cachediv' )
								{
									DivStatus( nom, NumDiv );
								}
							NumDiv++;
						}
				}
			else if ( document.layers ) // Pour les très veilles versions
				{
					while ( document.layers[ nom + NumDiv ] )
						{
							SetDiv = document.layers[ nom + NumDiv ];
							if ( SetDiv && SetDiv.className != 'cachediv' )
								{
									DivStatus( nom, NumDiv );
								}
							NumDiv++;
						}
				}
		}
	
	/*
	* Montre tous les divs ayant le même préfixe
	*/
	function MontreTout( nom )
		{	
			var NumDiv = 1;
			if ( document.getElementById ) // Pour les navigateurs récents
				{
					while ( document.getElementById( nom + NumDiv) )
						{
							SetDiv = document.getElementById( nom + NumDiv );
							if ( SetDiv && SetDiv.className != '' )
								{
									DivStatus( nom, NumDiv );
								}
							NumDiv++;
						}
				}
			else if ( document.all ) // Pour les veilles versions
				{
					while ( document.all[ nom + NumDiv ] )
						{
							SetDiv = document.all[ nom + NumDiv ];
							if ( SetDiv && SetDiv.className != '' )
								{
									DivStatus( nom, NumDiv );
								}
							NumDiv++;
						}
				}
			else if ( document.layers ) // Pour les très veilles versions
				{
					while ( document.layers[ nom + NumDiv ] )
						{
							SetDiv = document.layers[ nom + NumDiv ];
							if ( SetDiv && SetDiv.className != '' )
								{
									DivStatus( nom, NumDiv );
								}
							NumDiv++;
						}
				}
		}
		
	/*
	* Inverse les divs: Cache les divs visible et montre le divs cachés :)
	*/
	function InverseTout( nom )
		{	
			var NumDiv = 1;
			if ( document.getElementById ) // Pour les navigateurs récents
				{
					while ( document.getElementById( nom + NumDiv ) )
						{
							SetDiv = document.getElementById( nom + NumDiv );
							DivStatus( nom, NumDiv );
							NumDiv++;
						}
				}
			else if ( document.all ) // Pour les veilles versions
				{
					while ( document.all[ nom + NumDiv ] )
						{
							SetDiv = document.all[ nom + NumDiv ];
							DivStatus( nom, NumDiv );
							NumDiv++;
						}
				}
			else if ( document.layers ) // Pour les très veilles versions
				{
					while ( document.layers[ nom + NumDiv ] )
						{
							SetDiv = document.layers[ nom + NumDiv ];
							DivStatus( nom, NumDiv );
							NumDiv++;
						}
				}
		}

