// JavaScript Document
<SCRIPT LANGUAGE="JavaScript">
// D'autres scripts et des tutoriaux sur http://www.toutjavascript.com
	
function PopupImage(img,titre) {
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
	}
	
function PopupCentrer(page,largeur,hauteur,options) {
	  var top=(screen.height-hauteur)/2;
	  var left=(screen.width-largeur)/2;
	  window.open("References/"+page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
	}
	
function OuvrePopup() {
		// Vérifie que le cookie "index" n'est pas présent
		//if (GetCookie("index")==null) { 
			
			// Paramétrez ici le mode d'affichage du popup
			window.open("pop1f3.html","index","width=600, height=400, toolbars=no, scrollbars=no");
	
			// Enregistre le cookie pour une durée de 24 heures
			var pathname=location.pathname;
			var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
			var date_exp = new Date();
			date_exp.setTime(date_exp.getTime()+(24*3600*1000)); // 24 heures
			SetCookie("index","ok",date_exp,myDomain);
		//}
	}

// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours)
	{
	  var expire = "";
	  if(hours != null)
	  {
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = "; expires=" + expire.toGMTString();
	  }
	  document.cookie = name + "=" + escape(value) + expire;
	}

// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
	{
	  var cookieValue = "";
	  var search = name + "=";
	  if(document.cookie.length > 0)
	  { 
		offset = document.cookie.indexOf(search);
		if (offset != -1)
		{ 
		  offset += search.length;
		  end = document.cookie.indexOf(";", offset);
		  if (end == -1) end = document.cookie.length;
		  cookieValue = unescape(document.cookie.substring(offset, end))
		}
	  }
	  return cookieValue;
	}

function disp(txt) {document.write(txt);}

function printPage() { print(document); }

function don_date_maj()
	{var date_maj=new Date(document.lastModified);
	date_maj=don_date_format(date_maj);
	return date_maj;
	}
function don_date_jour()
	{var date_jour=new Date();
	date_jour=don_date_format(date_jour);
	return date_jour;
	}
function don_date_format(d1) {
	var m=new Array(13);
	m[1]="Janvier"; m[2]="Février";	m[3]="Mars"; m[4]="Avril"; m[5]="Mai"; m[6]="Juin";
 	m[7]="Juillet";	m[8]="Aout"; m[9]="Septembre"; m[10]="Octobre";	m[11]="Novembre"; m[12]="Décembre";
	var d=new Array(8);
	d[1]="Dimanche"; d[2]="Lundi"; d[3]="Mardi"; d[4]="Mercredi"; d[5]="Jeudi"; d[6]="Vendredi"; d[7]="Samedi";
	var mois=m[d1.getMonth()+1];
	var jour=d[d1.getDay()+1];
	var date=d1.getDate();
	var an=d1.getYear();
	if (an<200) an=1900+an;
	date=jour+" "+date+" "+mois+" "+an;
	return date;
	}




// Example:
// onMouseOver="toolTip('tool tip text here')";
// onMouseOut="toolTip()";
// -or-
// onMouseOver="toolTip('more good stuff', '#FFFF00', 'orange')";
// onMouseOut="toolTip()"; 
/*
MOVE this to the <body>:
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="JavaScript"><!--
initToolTips(); //--></script>
*/
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var toolTipSTYLE="";
function initToolTips()
	{
	  if(ns4||ns6||ie4)
	  {
		if(ns4) toolTipSTYLE = document.toolTipLayer;
		else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
		else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
		if(ns4) document.captureEvents(Event.MOUSEMOVE);
		else
		{
		  toolTipSTYLE.visibility = "visible";
		  toolTipSTYLE.display = "none";
		}
		document.onmousemove = moveToMouseLoc;
	  }
	}



function toolTip(msg, fg, bg)
	{
	  if(toolTip.arguments.length < 1) // hide
	  {
		if(ns4) toolTipSTYLE.visibility = "hidden";
		else toolTipSTYLE.display = "none";
	  }
	  else // show
	  {
		if(!fg) fg = "#777777";
		if(!bg) bg = "#FFFFFF";
		var content =
		'<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +
		'<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg + 
		'"><td align="center"><font face="sans-serif" color="' + fg +
		'" size="-2">&nbsp\;' + msg +
		'&nbsp\;</font></td></table></td></table>';
		if(ns4)
		{
		  toolTipSTYLE.document.write(content);
		  toolTipSTYLE.document.close();
		  toolTipSTYLE.visibility = "visible";
		}
		if(ns6)
		{
		  document.getElementById("toolTipLayer").innerHTML = content;
		  toolTipSTYLE.display='block'
		}
		if(ie4)
		{
		  document.all("toolTipLayer").innerHTML=content;
		  toolTipSTYLE.display='block'
		}
	  }
	}
	
function moveToMouseLoc(e)
	{
	  if(ns4||ns6)
	  {
		x = e.pageX;
		y = e.pageY;
	  }
	  else
	  {
		x = event.x + document.body.scrollLeft;
		y = event.y + document.body.scrollTop;
	  }
	  toolTipSTYLE.left = x + offsetX;
	  toolTipSTYLE.top = y + offsetY;
	  return true;
	}
	
function randomNumber(limit){
  return Math.floor(Math.random()*limit);
	}

//-->
</SCRIPT>
