// JavaScript Document
//utilisation : onLoad="initializeTimer();"
//
var secs;
var timerIDs = null;
var timerRunning = false;
var delay = 1000;
function initializeTimer()
{
// Set the length of the timer, in seconds
secs = 900; 
// secs = 30; //pour les tests
stopTheClock();
startTheTimer();
}
function stopTheClock()
{
if(timerRunning)
clearTimeout(timerIDs);
timerRunning = false;
}
function startTheTimer()
{
if (secs==0)
{
stopTheClock();
// Here's where you put something useful that's
// supposed to happen after the allotted time.
// For example, you could display a message:
//FDE 126 - ERA - suppression du popup d alerte
//window.alert("VOUS AVEZ ETE DECONNECTE\n\nVous êtes resté inactif trop longtemps sur le site 3suisses.fr.\nVeuillez nous excuser pour ce désagrément.");
//redirection vers la page d'accueil
//SDI window.location.replace("/FrontOfficePortailBP/BlanchePorte.portal");
window.location.replace("http://www.blancheporte.fr/");
}
else
{
//self.status = secs;
secs = secs - 1;
timerRunning = true;
timerIDs = self.setTimeout("startTheTimer()", delay);
}
}

