  var IE = false;      // Microsoft Internet Explorer
  var NN4  = false;     // Netscape 4+
  var W3C = false;     // W3C compliant (inc NS6)
  var isUnknown = true;  // in case something else comes along

  if (document.getElementById) {
    W3C = true ; // NS6, MSIE 5.5 & 6 and Opera in Opera mode
    isUnknown = false;
  }
  if (document.all) {
    IE = true ; // MSIE (all versions) and Opera in MSIE 5 mode
    isUnknown = false;
  }
  if (document.layers) {
    NN4  = true ; // NS 4
    isUnknown = false;
  }

  if (IE){
      doc = "document.all";
      sty = ".style";
  } else if (W3C) {
      doc = "document.getElementById";
      sty = ".style";
  } else if (NN4) {
      doc = "document";
      sty = "";
  }

  function colocaLayers() {
    if (NN4 || IE){
      infoObj = eval(doc + '["info"]' + sty);
      infoObj.width = 210;
    } else if (W3C){
      infoObj = eval(doc + '("info")' + sty);
      infoObj.width = 210;
    }
  }
  
  function init() {
    colocaLayers();
    document.onmousemove = mouseMove
    if (NN4) document.captureEvents(Event.MOUSEMOVE)
  }
  
  Xoffset=-600;
  Yoffset=-600;
  
  function mouseMove(e){
    var x = 0;
    var y = 0;
      if (IE){
        x = event.x + document.body.scrollLeft;
        y = event.y + document.body.scrollTop;
        infoObj.left = x + Xoffset;
        infoObj.top = y + Yoffset;
      } else if (W3C){
        x = e.clientX + window.pageXOffset;
        y = e.clientY + window.pageYOffset;
        infoObj.left = x + Xoffset;
        infoObj.top = y + Yoffset;
      } else if (NN4) {
        x = e.pageX;
        y = e.pageY;
        infoObj.left = x + Xoffset;
        infoObj.top = y + Yoffset;
      }
  }

  function mostra(localitat,dades){
    Xoffset=10;
    Yoffset=10;
    var content="<table border='0' cellspacing='1' cellpadding='0' bgcolor='#ffffff'><tr><td><table width='100%' border='0' cellspacing='0' cellpadding='1' bgcolor='#5eb935'><tr><td width='100%'><font face='Verdana, Arial, Helvetica, sans-serif' size='1' color='#FFFFFF'><b>&nbsp;"+localitat+"&nbsp;</b></font></td></tr></table></td></tr></table>"
    if(IE){
      document.all("info").innerHTML=content;
    } else if(W3C){
      document.getElementById("info").innerHTML=content;
    } else if(NN4){
      infoObj.document.write(content);
      infoObj.document.close();
    }
    infoObj.visibility="visible";
    
  }
  
  function amaga(){
    Xoffset=-600;
    Yoffset=-600;
    infoObj.visibility="hidden";
  }

