//1 - POPUP : journalier et fin/début d'année à chaque ouverture de la page accueil
// avec dans <body onLoad="PeriodeFestive();">

<!-- Script popup //-->
var nouv_anWindow=null;
function nouv_an(mypage,myname,w,h,pos,infocus) {
if (nouv_anWindow!=null && nouv_anWindow.open) nouv_anWindow.close();
if(pos=='random') {
LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
}
if(pos=='center') {
LeftPosition=50;TopPosition=50;
//LeftPosition=(screen.width)?(screen.width-w)/2:100;
//TopPosition=(screen.height)?(screen.height-h)/2:100;
}
else if((pos!='center' && pos!='random') || pos==null) {
LeftPosition=50;TopPosition=50;
}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no';
nouv_anWindow=window.open('',myname,settings);
if(infocus=='front') {
nouv_anWindow.focus();nouv_anWindow.location=mypage;
}
}
<!-- Déclaration et affichage popup suivant la date //-->
today=new Date();
var jour=today.getDate();
var mois=today.getMonth()+1;
function PeriodeFestive(){
//courant décembre
if ((jour>=1) && (mois==12)) nouv_an('divers/an_fin.html','bonne_fete','250','330','center','front');
//courant janvier
if ((jour<=31) && (mois==1)) nouv_an('divers/an_nouv.html','nouvel_an','250','330','center','front');
// tous les jours
if ((mois>1) && (mois<12)) nouv_an('divers/touslesjours.html','journalier','250','330','random','front');
}
<!-- Fermeture auto du popup //-->
var StayAlive = 15; // secondes, ici 10'"
function KillMe() {
setTimeout('self.close()',StayAlive * 1000);
}
<!-- Affichage de l'année de la fête dans la popup de ex. plus haut : décembre et janvier //-->
function quel_an() {
today=new Date();
an=today.getFullYear();
nouvel_an=an;
document.write(nouvel_an);
}


var tavert=null;
function tpopup(urlpage,monom,w,h,pos,infocus,tload,tdisplay){
if (tavert!=null && tavert.open) tavert.close();

	if(pos=='random'){
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}

	if(pos=='center'){
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}

	else if((pos!='center' && pos!='random') || pos==null){
		LeftPosition=250;
		TopPosition=250;
	}

parametre='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no';
tavert=window.open('',monom,parametre);

	if(infocus=='front'){
		tavert.focus();tavert.location=urlpage;
	}

autoclose=(tload+tdisplay)*1000; <!-- total time (") = donwload time (") + display time (") -->
tavert.setTimeout("window.close()",autoclose);
}
// in the popup put <body onBlur="self.close()" onClick="self.close()">
