// JavaScript Document
// Esto es para el "almanaque", muestra la capa con los eventos que hay en el día sobre el que estamos
var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false
var ns6 = (document.getElementById && !document.all) ? true: false;
// Para que furule en IE, cambiar el nombre a esto
//var coorX, coorY;
var cooX, cooY;

if (ns6) document.addEventListener("mousemove", mouseMove, true)
if (ns4) {document.captureEvents(Event.MOUSEMOVE); document.mousemove = mouseMove;}

function mouseMove(e)    {
	if (ns4||ns6)    {
		cooX = e.pageX;
		cooY = e.pageY;
	}
	if (ie4)    {
		cooX = window.event.clientX;
		cooY = window.event.clientY;
	}
	cooX += document.body.scrollLeft;
	cooY += document.body.scrollTop;
	return true;
}

function ini()    {
	if (ie4)    document.body.onmousemove = mouseMove;
}

function mostrar(id, dato) {
	with(document.getElementById("ayuda"+id))    {
		style.visibility = "visible"; //alert(event.x+";"+cooX+";"+ie4+";"+document.body.scrollTop);
//alert(cooX+";"+cooY);
if (isNaN(cooX) && event.x) cooX=event.x;
if (isNaN(cooY) && event.y) cooY=event.y;
		style.top = String(cooY + 10);
		style.left = String(cooX + 10);
		//innerHTML = id+"<br/>"+dato;
		innerHTML = dato;
	}
}

function ocultar(id)    {
	document.getElementById("ayuda"+id).style.visibility = "hidden";
}

function mover(id) {
	with(document.getElementById("ayuda"+id)) {
	
if (isNaN(cooX) && event.x) cooX=event.x;
if (isNaN(cooY) && event.y) cooY=event.y;
		style.top = String(cooY + 10);
		style.left = String(cooX + 10);
	}
}
