
function forall(elem, func) {
  if (elem.childNodes) {
    var cs = elem.childNodes;
    for (var i = 0; i < cs.length; i++) {
      forall(cs[i], func);
    }
  }
  func(elem);
}

function show_gfx() {
	document.getElementById('loading_gfx').style.display = 'block';
}

function hide_gfx() {
	document.getElementById('loading_gfx').style.display = 'none';
}

forall(document, function(elem) {
  if ((elem.tagName) && (elem.tagName == 'A')) {
    var clicktimer = -1;
	
    elem.onmouseover = function() {
      clearTimeout(clicktimer);
      clicktimer = setTimeout(function() {
        document.location = elem.href;
      }, 3000);
	  show_gfx();
	  
    };
    elem.onmouseout = function() {
      clearTimeout(clicktimer);
	  hide_gfx();
    };
  }
});

