
function t(champ) {
	n=champ.value;
	f=champ.name;
	min=1;
	max=2020;

	if(f=="jour"){
		max=31;
	}else if(f=="mois"){
		max=12;
	}else if(f=="annee"){
		min=1929;
	}

	if(n!=""){
		if(n<min||n>max){
			alert("Ce champ doit être compris entre "+min+" et "+max+" !");
			document.forms['ajouter'].elements[f].value="";
			document.forms['ajouter'].elements[f].focus();
		}
	}

}

/*
// Détection du navigateur utilisé
*/
nav=navigator.appName;
ver=navigator.appVersion;

if(nav=="Microsoft Internet Explorer"){var IE=true}
if(nav=="Netscape"){var NS=true}





//Affichage photo dans une fenêtre indépendante
//
function PopupImage(img) {
	titre="Popup Image - Cliquez sur l'image pour fermer la fenêtre.";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=yes,resizable=yes');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>");
	w.document.write("function checksize()  { ");
	w.document.write("if (document.images[0].complete) {");
	w.document.write("	window.resizeTo(document.images[0].width+24,document.images[0].height+30);");
	w.document.write("	window.focus();");
	w.document.write("} else { ");
	w.document.write("	setTimeout('check()',250)");
	w.document.write("} ");
	w.document.write("}</"+"SCRIPT>");
	w.document.write("<BODY style='cursor:hand;' onclick='self.close();' onload='checksize();' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	w.document.write("<IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}



//
// Effet bouton
//

var oLastBtn=0;
function RaiseButton(){
window.event.cancelBubble=true;
oBtn = window.event.srcElement;
var bChosen = false;
if(oLastBtn && oLastBtn != oBtn){
HideButton();
}
if(oBtn.buttonType){
oBtn.className = oBtn.buttonType + "Up";
oLastBtn=oBtn;
}
else {
oLastBtn = 0;
}
}
function DepressButton(){
window.event.cancelBubble=true;
oBtn = window.event.srcElement;
if(oBtn.buttonType){
oBtn.className = oBtn.buttonType + "Down"; 
if (oBtn.className == "LNChosenDown") {
oBtn.className = "LNDown";
}
}
}
function HideButton(){
if ((oLastBtn.buttonType == "LNChosen") || (oLastBtn.buttonType == "LNSubChosen")) {
oLastBtn.className = oLastBtn.buttonType;
}
else {
oLastBtn.className = oLastBtn.buttonType + "Off";
}
}
// Fin Effet bouton






function maj() {
//
// Affichage de la date de modification.
//

var Upd = ""
Upd = document.lastModified
Upd=Upd.substring(3,5)+"."+Upd.substring(0,2)+"."+Upd.substring(6,10);

document.write("<FONT SIZE='1' FACE='Arial, Helvetica'>");
document.write("Mise à jour : " + Upd );
//document.write("</font>");
}



function madate() {
// Array of day names
var dayNames = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
// Array of month Names
var monthNames = new Array("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");
var now = new Date();
document.write("<div id=madate>"+dayNames[now.getDay()] + " - " + now.getDate() + " " + monthNames[now.getMonth()] + " " + now.getFullYear()+"</div>");
return true;
}

