﻿
//members
var expirationTime = 10;
var expirationTimeout = 20;
var timerId = null;


//methods

//update timer after load or (ajax) load. call this method after every postback or (ajax postback)
function UpdateWatcher(expTimeOut, expTime)
{
  //clear old timer (this action is actual if ajax postback occured)
  if(timerId)
  {
    window.clearTimeout(timerId);
  }
   
  //set new timer
  expirationTimeout = (expTimeOut * 60 * 1000) - (expTime * 1000);
  timerId = window.setTimeout(CallExpirationMessage, expirationTimeout);
}

//get to login page when session is expired
function CallExpirationMessage()
{
   window.location = window.location.pathname + "?sessionExpired=true";

  //clear old timer (this action is actual if ajax postback occured)
  if(timerId)
  {
    window.clearTimeout(timerId);
  }
      
}



//events

//function hrefEmptyFamilyAlertCloser_onclick() {
   // confirm("Er du sikker?");
//}

function hrefEmptyFamilyAlertCloser_onclick() {
    confirm("Er du sikker?")
     
}


