/* IE doesn't observe such a simple rule as 
.maplocations :link:hover .extrainfo
for changing display: none into display block :/
(Why?? It should!), so also use stupid javascript for this.
*/

var wait;
var el;

var isIE;
isIE = false;
if (navigator.appVersion.indexOf("MSIE ") != -1) { // Yes, yes, I suck. But sometimes you just need to go for the easy hack, and there's no _harm_ in getting the IE code if you're spoofing (and really, the benefit as it is right now only matters in Safari).
  isIE = true;
}

function showextrainfo(idref) {
  if (wait && document.getElementById("extrainfo_"+idref) != el) {
    clearTimeOut(wait);
  }
  el = document.getElementById("extrainfo_"+idref);
  if (el) {
    if (el.style.display != "block") {
      if (!isIE) { // Naturally, IE is incapable of handling this right.
        wait = setTimeOut('el.style.display = "block"', 10); // We don't want annoying flicker effects if for some reason things overlap.
      }
      else {
        el.style.display = "block";
      }
    }
  }
}

function hideextrainfo(idref) {
  if (wait && document.getElementById("extrainfo_"+idref) != el) {
    clearTimeOut(wait);
  }
  el = document.getElementById("extrainfo_"+idref);
  if (el) {
    if (el.style.display != "none") {
      if (!isIE) { // Naturally, IE is incapable of handling this right.
        wait = setTimeOut('el.style.display = "none"', 10); // We don't want annoying flicker effects if for some reason things overlap.
      }
      else {
        el.style.display = "none";
      }
    }
  }  
}

// Reposition anchors onresize in IE. Now _that's_ talking about full circle... *curses IE as much as N4.x used to be cursed*
function reposition() {
  el = document.getElementById('maplocs');
  for (var i = 0; i < el.children.length; i++) {
    // Recalculate what 50% means again
    el.children[i].style.left = "51%";
    el.children[i].style.left = "50%";
  }
}
