			// ****************************************************************** //
			// Sacado del codigo de calendar.js para gestionar el evento mouse over
			  Calendar.dayMouseOver = function(ev) {
					var el = Calendar.getElement(ev);
					if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
						return false;
					}
			
					if (el.ttip) {
						// Esta encima de una fecha
						if (el.ttip.substr(0, 1) == "_") {
							el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
							// Intentamos recuperar el texto para el dia donde esta el raton
							var inf = dateInfo[el.caldate.print("%Y%m%d")];
							
							if (inf){
							   // Si hay texto, lo ponemos en la barra de info de abajo
							   el.ttip = el.ttip + " " +  inf;
							   el.calendar.tooltips.innerHTML = el.ttip;
							} else {
							   el.calendar.tooltips.innerHTML = el.ttip;
							}
							
						} else {
						   el.calendar.tooltips.innerHTML = el.ttip;
						}
				
						
					}
					if (el.navtype != 300) {
						Calendar.addClass(el, "hilite");
						if (el.caldate) {
							Calendar.addClass(el.parentNode, "rowhilite");
						}
					}
					return Calendar.stopEvent(ev);
			  };
			// ****************************************************************** //
			
			
			
			// ****************************************************************** //
			// Codigo para los dias especiales (festivos)
			  function dateIsSpecial(year, month, day) {
				var m = SPECIAL_DAYS[month];
				if (!m) return false;
				for (var i in m) if (m[i] == day) return true;
				return false;
			  };
			
			
			  function ourDateStatusFunc(date, y, m, d) {
				if (dateIsSpecial(y, m, d))
				  return "special";
				else
				  return false; // other dates are enabled
				  // return true if you want to disable other dates
			  };
			// ****************************************************************** //					
			
			
			// ****************************************************************** //
			// Codigo para el texto en los eventos
			  function getDateText(date, d) {
				var inf = dateInfo[date.print("%Y%m%d")];
				if (!inf) {
				  return d + "<div class='inf'>&nbsp;</div>";
				} else {
			//      return d + "<div class='inf'>" + inf + "</div>";
				  // Ponemos un * a los dias con texto(evento)
				  return d + "<div class='inf'>" + "*" + "</div>";
			
				}
			  };
			
			
			  function flatCallback(cal) {
				// Cuando se hace click en un dia
				if (cal.dateClicked) {
				  
				  // Cuando se hace click en un dia con texto(evento)
				  var inf = dateInfo[cal.date.print("%Y%m%d")];
				  if (inf) {
					 //alert("Click sobre un dia con texto");
				  }
				  
				  // Cuando se hace click en un dia especial(festivo)
				  if (dateIsSpecial(cal.date.print("%Y"), cal.date.print("%m")-1, cal.date.print("%d")) ) {
					 //alert("Click sobre un dia especial");
				  }
				  
				  //alert("Click sobre el dia: "+cal.date.print("%Y年%m月%d日"));
				  window.open('/comunes/BotonesIzquierda/eventos/eventos.php?fecha='+encode(cal.date.print("%Y年%m月%d日"),'utf8'),'_self');
				}
			  };
			// ****************************************************************** //					  
			  Calendar.setup(
				{
				 flat: "calendar-container",
				 dateText: getDateText,
				 dateStatusFunc : ourDateStatusFunc,
				 flatCallback: flatCallback
				}
			  );
