var secs
var timerID = null
var timerRunning = false
var delay = 360

var currentID = null;

function showFlyout(FlyoutId) {
  if(ID('Flyout_Location')) {
    ID('Flyout_Location').style.display = 'none';
  }
  if(ID('Flyout_Destinations')) {
    ID('Flyout_Destinations').style.display = 'none';
  }
  ID('Flyout_'+FlyoutId).style.display = 'block';
  StopTheClock();
}
function hideFlyout(FlyoutId) {
  ID('Flyout_'+FlyoutId).style.display = 'none';
}
function startHide(FlyoutId) {
    secs = 2
    StopTheClock()
    timedHide(FlyoutId)  
}
function timedHide(FlyoutId) {
  if(FlyoutId) {
  currentID = FlyoutId;
  }
  if (secs==0)
    {
        StopTheClock(); 
        hideFlyout(currentID);
    }
    else
    { 
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("timedHide()", delay)
    }
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}
function OverFlyout() {
  StopTheClock();
}

