var tip_attivo=0;
//alert("Generato in MapTip con valore");
/* ==================================================================== */
/*  MapTipOut(e, contents, values)                                      */
/*  hides the maptips div                                               */
/* ==================================================================== */
function MapTipsOut(e, contents, values)
//function MapTipsOut(contents, values)
{   //alert("entro in maptips out");
    e = (e)?e:((event)?event:null);
    e = (e)?window.event:e;
    var d = document.getElementById('TheMaptipsLayer');
    if (d)
    {
        d.style.visibility = "hidden";
    }    
tip_attivo=0;
}

/* ==================================================================== */
/*  MapTipContent( event, contents, values )                            */
/*  Writes the content to the MapTip DIV                                */
/* ==================================================================== */
function MapTipsOver( e, contents, values )
//function MapTipsOver(contents, values )
{   //alert("entro in maptips over");
    e = (e)?e:((event)?event:null);
    var d = document.getElementById('TheMaptipsLayer');
    if (d == null)
    {
        d = document.createElement( 'div' );
        d.id = 'TheMaptipsLayer';
        d.setAttribute( 'style', 'position:absolute; top:-1000px; left:-1000px; width:150px; height: 16px; background-color:#ffffcf; font-family:arial; font-size:11px; z-index:100; border: 1px solid #00000; padding-left: 3px; padding-right: 3px; width: auto;' );
        d.style.position = 'absolute';
        d.style.top = "-1000px";
        d.style.left = "-1000px";
        d.style.width = "auto";         // d.style.width = "150px";
        d.style.height = "16px";
        d.style.backgroundColor = "#ffffcf";
        d.style.border = "1px solid #000000";
        d.style.fontFamily = "arial";
        d.style.fontSize = "11px";
        d.style.zIndex = 100;
	d.style.paddingLeft = "3px";
	d.style.paddingRight = "3px";
        document.body.appendChild(d);
    }
    //alert("Valori x e y = "+e.clientX+","+e.clientY);
    //alert("Valori x e y = "+e.x+","+e.y);
    //alert("Valori x e y = "+e.wherex+","+e.wherey);
    //d.style.top = (e.clientY + 10) + "px";
    //d.style.left = (e.clientX + 10) + "px";
    //if (!i_geckomozilla)
     d.style.top = (e.clientY + 10) + eval('self.'+docRoot+'.scrollTop') + "px";
      d.style.left = (e.clientX + 10) + eval('self.'+docRoot+'.scrollLeft') + "px";
    //if (i_geckomozilla)
    //{ d.style.top = (e.clientY + 10) + "px";
    //  d.style.left = (e.clientX + 10) + "px"; }
    d.style.height = (16 * contents.length -4)+"px";    // d.style.height = (16 * contents.length)+"px";
    d.style.visibility = "visible";
       //alert("ie5, docRoot = "+ie5+", "+docRoot);
       //confirm("event.x, ScrollLeft = "+event.x+", "+eval('self.'+docRoot+'.scrollLeft'));
       //confirm("event.y, ScrollTop = "+event.y+", "+eval('self.'+docRoot+'.scrollTop'));
    var sep = "";
    var result = "";
    for (var i=0;i<contents.length; i++)
    {
        if (i==0)
        { 
          result = result + sep + unescape(contents[i]);
        }
	else
        result = result + sep + "<b>"+values[i]+":</b> " + contents[i];
        sep = "<br>";
    }
    d.innerHTML = result;
//alert("Generato MapTip con valore = "+result);
tip_attivo=1;            

    return true;

}

