<!--
//********************************************************
// Pomdapy-online
// Print date and time
// alizesonline.com - Gilles Gomez - 2002~2009
// 
// Use: userTime("name_of_the_div_container")
//********************************************************

//****************************************************************************************
// Do not change anything below
//****************************************************************************************

$dom=(document.getElementById)?true:false;							// The browser is $dom compatible
var $layerTimeObject=false;

//****************************************************************************************
// Main function
//****************************************************************************************
function userTime($layerName){
	if(!$layerTimeObject) $layerTimeObject=createLayerTimeObject($layerName);		// First time -> create the layer object
	else writeTime($layerTimeObject);							// Other times -> update the time and date to the page
	timeTimer=window.setTimeout("userTime()",1000);						// Do again in 1000 milliseconds
}

//****************************************************************************************
// Create the object from the name of the layer
//****************************************************************************************
function createLayerTimeObject($layerName){
	if($dom)$layerObject=document.getElementById($layerName);
	else $layerObject=false;
	return $layerObject;
}


//****************************************************************************************
// Create date and time and write it to the page
//****************************************************************************************
function writeTime($divTimeObject){

	$tableDay=new Array("Dimanche ","Lundi ","Mardi ","Mercredi ","Jeudi ","Vendredi ","Samedi ");
	$tableMonth=new Array(" Janvier "," F&eacute;vrier "," Mars "," Avril "," Mai "," Juin "," Juillet "," Ao&ucirc;t "," Septembre "," Octobre "," Novembre "," D&eacute;cembre ");
	
	$now=new Date();
	$nameOfDay=$tableDay[$now.getDay()];
	$today=$now.getDate();
	$month=$tableMonth[$now.getMonth()];
	$year=$now.getFullYear();
	
	$hours=$now.getHours();
	if($hours<10) $hours="0"+ $hours;
	$minutes=$now.getMinutes();
	if($minutes<10) $minutes="0"+ $minutes;
	$seconds=$now.getSeconds();
	if($seconds<10) $seconds="0"+ $seconds;
	
	$htmlCode = "Nous sommes le " + $today + " " + $month + " " + $year + "<br>Il est " + $hours + "h" + $minutes;
	$divTimeObject.innerHTML=$htmlCode;							// Write de code to the right place of the page
}
//-->
