{

url = window.location.search;
posMsg = url.indexOf("msg");
msg="";
if (posMsg>0) {
   msg = url.substring(posMsg+4);
}
if (msg=="INVALIDUSER") {   
   alert("Votre courriel ou votre mot de passe est invalide.\n\rPour devenir membre inscrivez-vous gratuitement. "); 
}





  String.prototype.trim = function() {
	    return this.replace(/^\s+|\s+$/g,"");
    }

    function ValidateEmail(email) {
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
        return (true)
    }
    alert("Le courriel est invalide!")
    return (false)
    }

    function viewLegal() {
        myRef = window.open('http://www.systeme-analyse-boursier.com/termecondition.html','termcondition',
                'left=200,top=50,width=900,height=500,scrollbars=1,toolbar=1,resizable=1');

    }

    function ExecInscription(form) {
        if (form.firstname.value.trim()=="") {
            alert("Le champ du Prenom est invalide!");
            form.firstname.focus();
            return (false)
        }

        if (form.lastname.value.trim()=="") {
            alert("Le champ du Nom est invalide!");
            form.lastname.focus();
            return (false)
        }

        if (form.email.value.trim()=="") {
            alert("Le champ du Courriel est invalide!");
            form.email.focus();
            return (false)
        }

        
        if (ValidateEmail(form.email.value)) {

            if (form.country.selectedIndex<1) {
                alert("Le champ du Pays est invalide!");
                form.country.focus();
                return (false)
            }

            if (form.city.value.trim()=="") {
                alert("Le champ de la Ville est invalide!");
                form.city.focus();
                return (false)
            }

            if (form.password.value.trim()=="") {
                alert("Le champ du Mot de passe est invalide!");
                form.password.focus();
                return (false)
            }
            if (form.password.value!=form.confirmpassword.value) {
                alert("La confirmation de votre mot de passe n'est pas identique a votre mot de passe!");
                form.password.focus();
                return (false)
            }
            form.submit();
        } else {
            form.email.focus();
        }
        
    }


}
