function cgu() {
    window.open('http://clients.deuterium.fr/commun/doc/cgu.htm','cgu','top=0,left=0,width=550,height=600,scrollbars=yes');
}

function smiley() {
    window.open('smiley.php','smiley','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=160,height=160,top='+(screen.height-160)/2+',left='+(screen.width-160)/2);
}

function verif() {
    msg='';
    nom = document.form.nom.value;
    prenom = document.form.prenom.value;
    ville = document.form.ville.value;
    cond = document.form.CGU.checked;
    mail = document.form.email.value;
    place = mail.indexOf("@",1);
    point = mail.indexOf(".",place+1);
    sign = document.form.signature.value.length;
    if ((nom == "")||(nom == " "))   { msg += 'Le nom est obligatoire.\n' }
    if ((prenom == "")||(prenom == " "))   { msg += 'Le prénom 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 ((ville == "")||(ville == " "))   { msg += 'La ville est obligatoire.\n' }
    if ((sign <= 0))                  { msg += 'Vous n\'avez pas tapé votre signature.\n' }
    if (!cond) { msg += 'Vous devez accepter les conditions d\'utilisation.' }
    if (msg == '') { return true; } else { alert(msg);return false; }
}

function majuscule(form) {
    form.value = form.value.toUpperCase();
}

function minuscule(form) {
    form.value = form.value.toLowerCase();
}

function capitalise(form) {
    chaine = new String(); 
    chaine = form.value;
    pos = chaine.search('-');
    if (pos == '-1') {
        form.value = chaine.substr(0,1).toUpperCase()+chaine.substr(1,chaine.length).toLowerCase();
    } else {
        form.value = chaine.substr(0,1).toUpperCase()+chaine.substr(1,pos-1).toLowerCase()+'-'+chaine.substr(pos + 1,1).toUpperCase()+chaine.substr(pos+2,chaine.length).toLowerCase();
    }
}