function Initialize(a){$("#CalendarShowMore").click(function(){a.MaxCount+=a.ShowMoreCount;a.GetCurrentMonth()});$("#CalendarMonthArea > div:first > a").click(function(){a.CurrentMonth.setMonth(a.CurrentMonth.getMonth()-1);a.GetCurrentMonth()});$("#CalendarMonthArea > div:last > a").click(function(){a.CurrentMonth.setMonth(a.CurrentMonth.getMonth()+1);a.GetCurrentMonth()})}function Calendar(a,b,c){this.AjaxPath="/Templates/Ajax/CalendarControl.aspx";this.MaxCount=b;this.ShowMoreCount=c;this.CurrentMonth=new Date();this.GetCurrentMonth=function(){month=this.CurrentMonth.getMonth();month++;this.GetCalendarItems(this.CurrentMonth.getFullYear()+"-"+month)};this.GetCalendarItems=function(d){$.getJSON(this.AjaxPath,{Action:"GetCalendarItems",PageLink:a,Month:d,MaxCount:this.MaxCount},function(e){$("#CalendarMonthArea > DIV.CalendarMonth").html(e.calendarItems.currentMonthName);var g=e.calendarItems.isMoreAvailable=="True"?"visible":"hidden";$("#CalendarShowMore").css("visibility",g);var f=function(h){html="";html+='<div class="CalendarItemArea">';html+='<div class="CalendarItemDateArea">';html+='<div class="CalendarItemMonth">'+h.monthName+"</div>";html+='<div class="CalendarItemDate">'+h.startDay+"</div>";html+="</div>";html+='<div class="CalendarItemText">';html+="<div>"+h.location+"</div>";html+='<div><a href="'+unescape(h.link)+'">'+h.name+"</a></div>";html+="</div>";html+="</div>";return html};html="&nbsp;";$.each(e.calendarItems,function(h,j){if(h=="calendarItem"){if(isNaN(j.length)){html=f(j)}else{html="";$.each(j,function(k,l){html+=f(l)})}}});$("#CalendarItems").html(html)})}};