var linksTimeout;
var moveInterval;

function showLinks(timeout) {
  var menu = document.getElementById('quickLinks');
  menu.style.display = 'block';
  clearLinks();
  linksTimeout = window.setTimeout('hideLinks()', timeout * 1000);
}

function hideLinks() {
  clearLinks();
  var menu = document.getElementById('quickLinks');
  menu.style.display = 'none';
}

function clearLinks() {
  window.clearTimeout(linksTimeout);
}

function moveTop() {
  var top = document.getElementById('top');

  if(window.scrollY) {
    top.style.top = window.scrollY + 'px';
  }
  else if(document.body.scrollTop) {
    top.style.top = document.body.scrollTop + 'px';
  }
  else {
    top.style.top = '0px';
  }

}

function startMe() {
  moveInterval = window.setInterval('moveTop()', 500);
}

