/****************************************************************************/
/*                         FONCTION CCOWHATTHETIME                          */
/****************************************************************************/


if (window.attachEvent){
	window.attachEvent("onload", CallFunction);
}
if (window.addEventListener){
	window.addEventListener("load", CallFunction, false);
}
 
function CallFunction(){
 whatTheTime();
}


function ccoWhatTheTime(){
	var Now = new Date();
	var Jour = Now.getDay();
	var JJ = Now.getDate();
	var MM = Now.getMonth()+1;
	var AAAA = Now.getFullYear();

	if(MM == 1){
		LeMois = 'JAN';
	}else if(MM == 2){
		LeMois = 'FEV';
	}else if(MM == 3){
		LeMois = 'MAR';
	}else if(MM == 4){
		LeMois = 'AVR';
	}else if(MM == 5){
		LeMois = 'MAI';
	}else if(MM == 6){
		LeMois = 'JUN';
	}else if(MM == 7){
		LeMois = 'JUI';
	}else if(MM == 8){
		LeMois = 'AOU';
	}else if(MM == 9){
		LeMois = 'SEP';
	}else if(MM == 10){
		LeMois = 'OCT';
	}else if(MM == 11){
		LeMois = 'NOV';
	}else{
		LeMois = 'DEC';
	}

	var LaDateComplete = '<div class="dateOfDay"><p class="theDay">'+JJ+'</p><p class="theMonth">'+LeMois+'</p></div>';
	return(LaDateComplete);
}


function whatTheTime(){
	var Counter1;
	var Counter2;
	var Object = document.getElementById("bandeau_logo");
	var FirstElem = 0;
	
	for(Counter1=0; Counter1<Object.childNodes.length; Counter1++) {
		if(Object.childNodes[Counter1].tagName=="UL"){
			Obt = Object.childNodes[Counter1];
			for(Counter2=0; Counter2<Obt.childNodes.length; Counter2++) {
				if(Obt.childNodes[Counter2].tagName=="LI"){
					FirstElem++;
					if(FirstElem==1){
						Obt.childNodes[Counter2].innerHTML = ccoWhatTheTime();
					}
				}
			}
		}
	}
}