<!--
// 21/02/2007
// Fonction d'authentification

var log = ['president', 'conseiller'];
var pass = ['zsfglyb', 'izddheo'];
var destination = ['/heading/heading379.html', '/heading/heading383.html'];

function testLogin(login, password) {
    var inputLogin = document.getElementById(login);
    var inputPassword = document.getElementById(password);
    var indiceLog = -1;
    var indicePass = -1;
    
    //alert (inputLogin.value + ' ' + inputPassword.value);
    
    if (inputLogin != null && inputPassword != null)
    {
        for (i = 0; i < log.length; i ++)
	    {
            //alert (log[i]);
            if (log[i] == inputLogin.value)
            {
                indiceLog = i;
                //alert (indiceLog);
                break;
            }
        }
        if (indiceLog < 0)
        {
            alert('Identifiant incorrect.');
            login.focus();
            return false;
        }
        else
        {
            if (pass[indiceLog] == inputPassword.value)
            {
                document.location.href = 'http://www.cc-parisis.fr' + destination[indiceLog];
                return true;
            }
            else
            {
                alert('Mot de passe inccorect.');
                password.focus();
                return false;
            }
        }
    }
    else
    {
        alert('Impossible de vérifier ces champs !');
        return false;
    }
}
//-->
