//chargement de lien automatique pour menu déroulant
function loadPage(list) {
if (list.options[list.selectedIndex].value != "") {
partner = window.open('','partner','menubar=yes,location=yes,status=yes,toolbar=yes,resizable=yes');
partner.location.href = list.options[list.selectedIndex].value;
}
}

//fonction d'impression
function printit(){
var NS = (navigator.appName == "Netscape");
if (NS) {
    window.print() ;
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";
}
}

//ouverture window center
function windowCenter(url,w,h,lift) {
var tailleecranX=parseInt(screen.width);
var tailleecranY=parseInt(screen.height);
positionX=tailleecranX-w;
positionX=Math.round(positionX/2);
positionY=tailleecranY-h;
positionY=Math.round(positionY/2);
chaine = 'width='+w+',height='+h+',resizable=yes,scrollbars='+lift+',top='+positionY+',left=' + positionX;
var laFenetre = window.open(url,'adminPopup',chaine);
laFenetre.focus();
}

function testBulletin(formSource) {
	var founderrors;
	founderrors = false
	var erreurs = ''
	if (document.bulletin.nom.value.length == 0) {
		founderrors = true;
		erreurs = "Nom" + "\n"
	}
	if (document.bulletin.prenom.value.length == 0) {
		founderrors = true;
		erreurs = erreurs + "Prenom" + "\n"
	}
	if (document.bulletin.daten.value.length == 0) {
		founderrors = true;
		erreurs = erreurs + "Date de naissance" + "\n"
	}
	if (document.bulletin.adresse.value.length == 0) {
		founderrors = true;
		erreurs = erreurs + "Adresse postale" + "\n"
	}
	if (document.bulletin.codepostal.value.length == 0) {
		founderrors = true;
		erreurs = erreurs + "Code postal" + "\n"
	}
	if (document.bulletin.ville.value.length == 0) {
		founderrors = true;
		erreurs = erreurs + "Ville" + "\n"
	}
	if (document.bulletin.situationfamille.value.length == 0) {
		founderrors = true;
		erreurs = erreurs + "Situation de famille" + "\n"
	}
	if (document.bulletin.annees.value.length == 0) {
		founderrors = true;
		erreurs = erreurs + "Année de fin d'activité " + "\n"
	}

	if (founderrors == true) {
		window.alert("Les champs suivants ne sont pas renseignés : "+"\n" + erreurs);
	} else {
		document.bulletin.submit();
		return true;
	}
}
