function sendCoordForm(nform){
 prenom = nform.prenom.value;
 nom = nform.nom.value;
 organisation = nform.organisation.value;
 commentaire = nform.commentaire.value;
 telephone = nform.telephone.value;
 courriel = nform.courriel.value;
 nform.sent.value = 1;
 
 if ((nom == "") ||(nom == "Nom *") || (prenom == "") || (prenom == "Prénom *")||(organisation == "") ||(organisation == "Organisation *") || (commentaire == "")|| (commentaire == "Inscrivez votre question, votre besoin ou votre commentaire ici... *") ||(telephone == "") ||(telephone == "Téléphone *") || (courriel == "") || (courriel == "Courriel *")|| (courriel == "@") ){
  window.alert("Les champs marqués d'un * sont obligatoires !");
  return false;
  
 }else if (checkEmail(courriel) != true){
		return false;
		
 }else {
 // window.open("confirmation.php","popup",400,180,"scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no, location=no");
  nform.submit();
 }
}

function validNewsletter(nform) {
	var nom = nform.nom.value;
	var courriel = nform.courriel.value;
	nform.sent.value = 1;
	
	if ((nom == "") || (courriel == "")){
		window.alert("Les champs Nom et Courriel sont obligatoires!");
		return false;
	
	}else if (checkEmail(courriel) != true){
		return false;
	}else {
		//wait.php est pas une vrai page c'est pour empecher d'envoyer 2 fois les infos a confirmation.php qui est déla envoyé par le formulaire
		centerwindow("../interface/include/wait.php","popup",400,180,"scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no, location=no");
	}
	nform.target="popup";
	nform.submit();
}
  
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 questionForm(nform) {
	var nom = nform.nom.value;
	var email = nform.courriel.value;
	var mess = nform.mess.value;
	
	if ((nom == "") || (email == "") || (mess == "")){
		window.alert("Les champs Nom, Courriel et Message sont obligatoire!");
		return false;
	
	}else if (checkEmail(email) != true){
		return false;
	}else {
		nform.submit();

	}

}

function validPaiement(nform) {
	var compagnie = nform.compagnie.value;
	var amount = nform.amount.value;
	
	if ((compagnie == "") || (amount == "")){
		window.alert("Les champs Compagnie 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();}

}
function opendiv(open,close){
	if(open!=''){ document.getElementById(open).style.display='block';	}
	if(close!=''){ document.getElementById(close).style.display='none';	}
}