// (c) Xatcom.net 2006
// Prohibida la copia o reproducción parcial o total de este documento
// realizado por Carlos Martínez

var nav = (navigator.appName).search("Microsoft");

function Showhelp( e, msg, fecha ) {
	var xx; var yy; var WinSize;
	var DIV_W; var DIV_H;
	var DIVobj; var DIVobj_tit; var DIVobj_desc;
	var yscroll;
	WinSize = GetInnerSize(); //Get window size
	if ( nav==-1 ) {
		DIVobj = document.getElementById("dCalInfo");
		DIVobj_tit = document.getElementById("dCalInfo_tit");
		DIVobj_desc = document.getElementById("dCalInfo_desc");
	} else {
		var da=document.all;
		DIVobj = da.dCalInfo;
		DIVobj_tit = da.dCalInfo_tit;
		DIVobj_desc = da.dCalInfo_desc;
	}

	if (!e) var e = window.event
	
	//Get Click position & calendar width
	if (nav==-1) {
		xx = e.clientX + window.scrollX;
		yy = e.clientY + window.scrollY;
		yscroll = window.scrollY;
	} else {
		xx = e.clientX + document.body.scrollLeft;
		yy = e.clientY + document.body.scrollTop;
		yscroll = document.body.scrollTop;
	}
	DIV_W = parseInt(DIVobj.style.width) + 35;

	if ( (xx+DIV_W)>=WinSize[0] ) {
		if ( nav == -1 ) { DIVobj.style.left = (xx-DIV_W+25)*1 + "px"; } else { DIVobj.style.pixelLeft = xx-DIV_W+25; }
	} else {
		if ( nav == -1 ) { DIVobj.style.left = (xx+20)*1 + "px"; } else { DIVobj.style.pixelLeft = xx+20; }
	}

	DIVobj_desc.innerHTML = "";
	//DIVobj_desc.style.height = "";
	DIVobj_tit.innerHTML = "&nbsp;&nbsp;&nbsp;" + fecha;
	DIVobj_desc.innerHTML = msg;

	DIV_H = GetLayerHeight("dCalInfo_desc") + 10;
	//DIVobj_desc.style.height = (DIV_H+5)*1 + "px";

	if ( (yy+DIV_H)>=(WinSize[1]+yscroll-15) ) {
		if ( nav==-1 ) { DIVobj.style.top = (WinSize[1]+yscroll-DIV_H-45)*1 + "px"; } else { DIVobj.style.pixelTop = yy-DIV_H+10; }
	} else {
		if ( nav==-1 ) { DIVobj.style.top = (yy-12)*1 + "px"; } else {  DIVobj.style.pixelTop = yy-12; }
	}
	//Show help
	DIVobj.style.visibility = "visible";
} //Function

function Hidehelp() {
	if ( nav == -1 )
		document.getElementById('dCalInfo').style.visibility = "hidden";
	else
		document.all.dCalInfo.style.visibility = "hidden";
}

function VerMes(mes,any) {
	AJAXLoading(true,1,"dCal");
	Ajax_Open("lib_php/libcalendari.php?mes=" + mes + "&any=" + any,"AJAXLoading_result(1,'dCal')",1);
}

function VerMes2(mes,any) {
	AJAXLoading(true,0);
	AJAXLoading(true,1);
	Ajax_Open("libcalendari.php?mes=" + mes + "&any=" + any,"AJAXLoading_result(1,'dCal')", 1);
	Ajax_Open("llistaevents.php?mes=" + mes + "&any=" + any,"AJAXLoading_result(0,'dCal')", 0);
}
