var SmallCalendarTile=Class.create({initialize:function(a){this.element=$(a);this.initializeLinks();Event.observe(document,"click",function(b){this.closeAllTooltips()}.bind(this));this.element.observe("smallcalendar:contentChanged",this.contentChangedListener.bindAsEventListener(this))},initializeLinks:function(){this.element.select("a.calendar_popup_link").each(function(a){a.observe("click",function(d){d.stop();var c=d.findElement("a");var e=$(c.id.substring(20));if(e.visible()){return}this.closeAllTooltips();e.setStyle({left:(c.positionedOffset()["left"]-250)+"px",top:(c.positionedOffset()["top"]+18)+"px"});try{new Effect.Grow(e,{direction:"top-right",duration:0.3,queue:{scope:this.element.id,limit:1}})}catch(b){e.show()}}.bindAsEventListener(this))}.bind(this))},contentChangedListener:function(a){this.initializeLinks();new Effect.Pulsate(a.element().select("table.calendar-header td").first().next(),{duration:0.3,pulses:1})},closeAllTooltips:function(){$$(".small-calendar-popup").each(function(a){a.hide()})}});
