
var date_statement="";//récupération de la date, du jour, de l'heure
var time_statement="";
var today=new Date();
var month="";
var day="";
function todays_date() {
var month=today.getMonth();
var day_of_week=today.getDay();
date_statement=""
document.month=""
month++;
if(month==1) {//définition des mois: 1=janvier, 2=février, ...
january(today.getDate());
document.month="janvier";
}
if(month==2) {
february(today.getDate());
document.month="f&eacute;vrier";
}
if(month==3) {
march(today.getDate());
document.month="mars";
}
if(month==4) {
april(today.getDate());
document.month="avril";
}
if(month==5) {
may(today.getDate());
document.month="mai";
}
if(month==6) {
june(today.getDate());
document.month="juin";
}
if(month==7) {
july(today.getDate());
document.month="juillet";
}
if(month==8) {
august(today.getDate());
document.month="ao&ucirc;t";
}
if(month==9) {
september(today.getDate());
document.month="septembre";
}
if(month==10) {
october(today.getDate());
document.month="octobre";
}
if(month==11) {
november(today.getDate());
document.month="novembre";
}
if(month==12) {
december(today.getDate());
document.month="d&eacute;cembre";
}
document.day=""//définition des jours: 1=lundi etc...
if(day_of_week==0)
document.day="dimanche";
if(day_of_week==1)
document.day="lundi";
if(day_of_week==2)
document.day="mardi";
if(day_of_week==3)
document.day="mercredi";
if(day_of_week==4)
document.day="jeudi";
if(day_of_week==5)
document.day="vendredi";
if(day_of_week==6)
document.day="samedi";
}
function january(date) {
if(date==1)//si le jour =1 (cad: 1 janvier)
date_statement="Bonne Ann&eacute;e !";//commentaire à ajouter entre les deux guillemets
}
function february(date) {
}
function march(date) {
}
function march(date) {
if(date==21)
date_statement="C'est le printemps !";
}
function april(date) {
if(date==1)
date_statement="poisson d'avril !";
}
function may(date) {
if(date==23)
date_statement="C'est mon anniversaire!!!";
}
function june(date) {
if(date==21)
date_statement="Vive l'&eacute;t&eacute; !";
}
function july(date) {
}
function august(date) {
}
function september(date) {
if(date==21)
date_statement="C'est l'automne !";
}
function october(date) {
if(date==31)
date_statement="Joyeux Halloween !";
}
function november(date) {
}
function december(date) {
if(date==21)
date_statement+="C'est l'hiver !";
if(date==25)
date_statement="Joyeux No&euml;l !";
if(date==31)
date_statement="C'est fou ce que les ann&eacute;es passent vites !";
}

function time_of_day() {
var time=today.getHours();//récupère l'heure
time_statement=""
if(time>=4 && time<8)
time_statement="D&eacute;j&agrave; sur le Net?"//ce texte est personalisable
if(time>=8 && time<12)
time_statement="Bonne matin&eacute;e,"
if(time>=12 && time<13)
time_statement="Bon app&eacute;tit,"
if(time>=13 && time<18)
time_statement="Bon apr&egrave;s-midi,"
if(time>=18 && time<19)
time_statement="Bonne fin d'apr&egrave;s-midi,"
if(time>=19 && time<20)
time_statement="Bonsoir et bon app&eacute;tit,"
if(time>=20 && time<22)
time_statement="Bonsoir,"
if(time>=22 || time<4)
time_statement="Bonne nuit,"
}

            
      time_of_day();
todays_date();
document.writeln("<DT><B>"+time_statement+" nous sommes le "+document.day+" "+today.getDate()+" "+document.month+". "+date_statement+"</B><DT>")
//assemblage de tout ça, heure+nous sommes le(personnalisable)+jour+texte pour un jour spécial
      
