
function email() {
    u = window.location;
    m = "Page à visiter sur www.point-afrique.com";
    window.location = "mailto:?subject="+m+"&body="+document.title+"%0A"+u;
}

function ow(v) {
	window.open('http://86.64.59.26/v2/reserv/det_vols.php?vol='+v,'pa_vols','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=500');
}

function legende() {
	window.open('legende.php','pa_legende','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=450,height=410');
}

function majuscule(form) {
    form.value = form.value.toUpperCase();
    form.value = form.value.replace(/'/g, " ");
    form.value = form.value.replace(/"/g, "");
}

function minuscule(form) {
    form.value = form.value.toLowerCase();
    form.value = form.value.replace(/'/g, " ");
    form.value = form.value.replace(/"/g, "");
}

function capitalise(form) {
    chaine = new String(); 
    chaine = form.value;
    pos1 = chaine.search('-');
    pos2 = chaine.search(' ');
    if ((pos1=='-1') && (pos2=='-1')) {
        form.value = chaine.substr(0,1).toUpperCase()+chaine.substr(1,chaine.length).toLowerCase();
    } else {
        if(pos1!='-1') form.value = chaine.substr(0,1).toUpperCase()+chaine.substr(1,pos1-1).toLowerCase()+'-'+chaine.substr(pos1 + 1,1).toUpperCase()+chaine.substr(pos1+2,chaine.length).toLowerCase();
        if(pos2!='-1') form.value = chaine.substr(0,1).toUpperCase()+chaine.substr(1,pos2-1).toLowerCase()+'-'+chaine.substr(pos2 + 1,1).toUpperCase()+chaine.substr(pos2+2,chaine.length).toLowerCase();
    }
    form.value = form.value.replace(/'/g, " ");
    form.value = form.value.replace(/"/g, "");
}

function num() {
    if(event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;
    if(event.which < 45 || event.which > 57) return false;
}

function verif() {
    nom = document.form.nom.value;
    prenom = document.form.prenom.value;
    adresse = document.form.adresse1.value;
    cp = document.form.cp.value;
    ville = document.form.cville.value;
    tel = document.form.telephone.value;
    mail = document.form.email.value;
    place = mail.indexOf("@",1);
    point = mail.indexOf(".",place+1);
    
    msg = '';
    
    if ((nom == "")||(nom == " "))       { msg += 'Le nom est obligatoire.\n' }
    if ((prenom == "")||(prenom == " ")) { msg += 'Le prénom est obligatoire.\n' }
    if (adresse.length<=0) { msg += 'L\'adresse postale est obligatoire.\n' }
    if ((cp == "")||(cp == " ")) { msg += 'Le code postal est obligatoire.\n' }
    if ((ville == "")||(ville == " ")) { msg += 'La ville est obligatoire.\n' }
    if ((mail == "")||(mail == " "))     { msg += 'L\'adresse Email est obligatoire.\n' } else { if ((place > -1)&&(mail.length >2)&&(point > 1)) { } else { msg += 'L\'adresse Email n\'est pas valide.\n' } }
    if (tel == "") { msg += 'Le téléphone est obligatoire.\n' }

    if (msg == '') { return true; } else { alert(msg);return false; }
}

function verif_broch() {
	type = document.form.Brochure.value;
	connu = document.form.ConnuPA2.value;
    nom = document.form.nom.value;
    prenom = document.form.prenom.value;
    adresse = document.form.adresse1.value;
    cp = document.form.cp.value;
    ville = document.form.cville.value;
    tel = document.form.telephone.value;
    mail = document.form.email.value;
    place = mail.indexOf("@",1);
    point = mail.indexOf(".",place+1);
    
    msg = '';
	
	if((type=="") || (type.selectedIndex==0)) { msg += 'Quelle brochure souhaitez-vous recevoir ?\n\n' }
	if((connu=="") || (connu.selectedIndex==0)) { msg += 'Comment nous avez-vous connu ?\n\n' }
	
    if ((nom == "")||(nom == " "))       { msg += 'Le nom est obligatoire.\n' }
    if ((prenom == "")||(prenom == " ")) { msg += 'Le prénom est obligatoire.\n' }
    if (adresse.length<=0) { msg += 'L\'adresse postale est obligatoire.\n' }
    if ((cp == "")||(cp == " ")) { msg += 'Le code postal est obligatoire.\n' }
    if ((ville == "")||(ville == " ")) { msg += 'La ville est obligatoire.\n' }
    if ((mail == "")||(mail == " "))     { msg += 'L\'adresse Email est obligatoire.\n' } else { if ((place > -1)&&(mail.length >2)&&(point > 1)) { } else { msg += 'L\'adresse Email n\'est pas valide.\n' } }
    if (tel == "") { msg += 'Le téléphone est obligatoire.\n' }

    if (msg == '') { return true; } else { alert(msg);return false; }
}

function verif_mail() {
    mail = document.news.Email.value;
    place = mail.indexOf("@",1);
    point = mail.indexOf(".",place+1);
    
    msg = '';
    
    if ((mail == "")||(mail == " "))     { msg += 'Aucune adresse Email n\'a été saisie !\n' } else { if ((place > -1)&&(mail.length >2)&&(point > 1)) { } else { msg += 'L\'adresse Email n\'est pas valide.\n' } }

    if (msg == '') { return true; } else { alert(msg);return false; }
}