﻿function OnIdentificationStart() {ShowSplash("Identification en cours.<br/>Merci de patienter...");}
function OpenConnectionHelp() {
    var w=radopen("/shared/pages/loginRecovery.aspx","DefaultWindow");    
    w.SetSize (565, 440);
    w.SetTitle ("Récupération des identifiants de connexion");
}
function OnUserDisconnect() {
    EnableKnwownClientLoginForm(false);
    Page.Refresh();
}
function RedirectToClientSpace() {
    self.location.href="/clients/default.aspx";
}
function OnIdentificationEnd(success,message) {
    if(success) {
        Splash.Show("Identification réussie. Vous allez être redirigé vers votre espace client.");
        setTimeout(function() {self.location.href="/clients/default.aspx";},3000);
       
    }
    else {
        Splash.Hide();
        radalert(message,300,200,"Résultats d'identification");
    }
}
function OnIdentificationStart() {
    Splash.Show("Identification en cours");
}
function EnableKnwownClientLoginForm(b) {
    var uF=$("UnknownClientLoginForm_Content");
    var kF=$("KnownClientLoginForm_Content");
    if(b) {
        uF.style.display="none";
        kF.style.display="block";
    }
    else {
        uF.style.display="block";
        kF.style.display="none";
    }
}
function CheckForAuthentication() {
    if(IsAuthenticated()) EnableKnwownClientLoginForm(true);                
    else EnableKnwownClientLoginForm(false);
}
addListener(window,"load",CheckForAuthentication);
