function validNewsletter(nform) {
	var nom = nform.nom.value;
	var sujet = nform.sujet.value;
	var email = nform.courriel.value;
	
	if ((nom == "") || (email == "")){
		window.alert("Les champs Nom et Courriel sont obligatoire!");
		return false;
	
	}else if (checkEmail(email) != true){
		return false;
	}else {
		centerwindow("../interface/include/confirmation.php","popup",400,180,"scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no, location=no");
	}
}
  
function validSoumission(nform) {
	var nom = nform.nom.value;
	var sujet = nform.sujet.value;
	var email = nform.courriel.value;
	var pays = nform.pays.value;
	
	if ((nom == "") || (email == "") || (pays == "")){
		window.alert("Les champs Nom, Courriel et Pays sont obligatoire!");
		return false;
	
	}else if (checkEmail(email) != true){
		return false;
	}else {
		centerwindow("../interface/include/confirmation.php","popup",400,180,"scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no, location=no");

	}

}

function validPaiement(nform) {
	var compagnie = nform.compagnie.value;
	var facture = nform.facture.value;
	var amount = nform.amount.value;
	
	if ((compagnie == "") || (facture == "") || (amount == "")){
		window.alert("Les champs Compagnie, No de facture et Total sont obligatoire!");
		return false;
	
	}else {
		nform.item_name.value = compagnie + " - Facture #"+facture;
		centerwindow("","popup",790,550,"scrollbars=yes,menubar=no,resizable=yes,status=no,toolbar=no, location=no");

	}

}

function checkEmail(emailAddr) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailAddr)){
	return (true)
	}
	alert("Veillez entrer un courriel valide s.v.p.!")
	return (false)
}


function centerwindow(theurl,wname,width,height,options) {
    x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
        if (screen.availWidth > 1800) { 
        x = ((screen.availWidth/2) - width)/2; 
    } 

	theurl = theurl + location.search ;

	if (options != ""){
		options = "," + options ;
	}
	openWin = window.open(theurl, wname, 'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x + options); 
	if(openWin.window.focus){openWin.window.focus();}

}
