var div_movil;

function asignaToolTip(capa)
{
	
	capa2=document.getElementById(capa);
	if (condicion=capa2!=undefined){
	div_movil=capa2;

//	div_movil.className="leyendaInfo";
	}
	return condicion;
}
var offsetfrommouse=[15,15];
var displayduration=0;
var currentimageheight = 100;
function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
function controlaventana(e)
{

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)

	if (typeof e != "undefined"){
			xcoord += e.pageX;
			ycoord += e.pageY;
		

	} else if (typeof window.event != "undefined"){
			xcoord += truebody().scrollLeft+event.clientX
			ycoord += truebody().scrollTop + event.clientY;
	
	}
	if(div_movil.className=="leyendaInfoHidden")div_movil.className="leyendaInfo";
	div_movil.style.left=xcoord+"px";
	div_movil.style.top= ycoord+"px";


}
function ocultaToolTip(capa)
{
var capa=document.getElementById(capa);
window.onmousemove=null;
document.onmousemove=null;
if(capa!=undefined) capa.className="leyendaInfoHidden";
return capa!=undefined;
}
function manejaLeyenda(obj)
{
	var existe=asignaToolTip("leyenda"+obj.parentNode.id);
	if (existe){
	window.onmousemove=controlaventana;
	document.onmousemove=controlaventana;
	}
}
function ocultaLeyenda(obj)
{
	var existe=ocultaToolTip("leyenda"+obj.parentNode.id);
	if (existe){
		//window.onmousemove=document.onmousemove=null;
	}
}