function ScriptMain(){}var __MonthShortName={"1":"JAN","2":"FEB","3":"MAR","4":"APR","5":"MAY","6":"JUN","7":"JUL","8":"AUG","9":"SEP","10":"OCT","11":"NOV","12":"DEC"};var calendarRootSelector="";function hmkInitCalendar(a,c){var e=$('
');e.appendTo($(a));calendarRootSelector="#gridcontainer";var b=[{name:"filterBy",value:c.filterBy},{name:"filterValue",value:c.filterValue}];var d=$(calendarRootSelector).bcalendar(getDefaultSettings(b,c.ajaxUrl)).BcalGetOp();$("#showtodaybtn").click(showToday);$("#loadCalendarLeft").click(loadPreviousRange);$("#loadCalendarRight").click(loadNextRange);$("body").bind("click",function(f){if($(f.target).closest(".hideOnOutsideClick").length==0){$(".hideOnOutsideClick").css({display:"none"})}});if(d&&d.showday){$("#txtdatetimeshow").text(getShortMonthAndYear(d.showday))}}function getDefaultSettings(b,e){var a="month";var d=e;var f=new Date();f.setDate(15);var c={view:a,theme:3,showday:f,ViewCmdhandler:View,url:d,method:"POST",onBeforeRequestData:cal_beforerequest,onAfterRequestData:cal_afterrequest,onRequestDataError:cal_onerror,extParam:b,autoload:true,height:850};return c}function View(f){$(".calTipBubMenu").remove();if(f[11]!="H"&&f[8]!="F"){var a=ConstructEventPopup(f).join("");$("#dvCalMain").append(a)}var g="#bubMenu_"+f[0];var e=$(g),h,d,c,b;h=$(this).position();d=$(this).width();b=$(this).offset().top-(315+$(g).outerHeight());$(g).removeClass("calendarTipRight");$(g).removeClass("calendarTipLeft");$(g).removeClass("calendarTip");$(g).removeClass("calendarTipBelow");$(g).removeClass("calendarTipBelowLeft");$(g).removeClass("calendarTipBelowRight");if(h.left>800){c=h.left+d/2-380;if(b>=-49){$(g).addClass("calendarTipRight")}else{$(g).addClass("calendarTipBelowRight")}}else{if(h.left<50){c=h.left-20;if(b>=-49){$(g).addClass("calendarTipLeft")}else{$(g).addClass("calendarTipBelowLeft")}}else{c=h.left+d/2-230;if(b>=-49){$(g).addClass("calendarTip")}else{$(g).addClass("calendarTipBelow")}}}if(b<-49){b=$(this).offset().top-(405-$(g).outerHeight())}e.css({left:c+"px",top:b+"px","z-index":"99999999"}).show();e.find("div.greyClose").click(function(){$(this).closest("div.calTipBubMenu").hide()})}function cal_beforerequest(){}function cal_afterrequest(c){$(document).unbind("mouseup");$(document).unbind("mousemove");$.each($("#mvEventContainer .monthdayshow"),function(f,h){var g=$(h);var e=g.parent().attr("abbr");g.attr("rel","#popupContainer");$(this).click(function(){LoadAddEvent(e)})});$("#mvEventContainer div[id^='mvrow_']:last .st-bg-table").addClass("st-bg-lastWeekOfMonth");for(var a=0;a option").size();if($("#Month").get(0).selectedIndex==11&&$("#Year").get(0).selectedIndex==(b-1)){$("#loadCalendarRight").addClass("disabled");$("#loadCalendarRight").unbind("click")}else{if($("#loadCalendarRight").hasClass("disabled")){$("#loadCalendarRight").removeClass("disabled");$("#loadCalendarRight").bind("click",loadNextRange)}}}function changeEventColor(c,b){var a=c+" .rb-m";$(a).attr("style","");if(b[10]=="N"){$(c).addClass("rb-m-newInvite");$(a).css("background-color","#33B6E4");$(a).css("color","#FFFFFF")}else{$(a).attr("style","background-color: #F0E7F9")}}function changeEventText(b,c,a){if(c){$(b).html(''+a+"")}else{$(b).text(a)}}function gotoDateCancel(){$("#GotoDateFilter").css("display","none")}function getShortMonthAndYear(a){return __MonthShortName[a.getMonth()+1]+" "+a.getFullYear()}function ConstructEventPopup(b){var k=[];k.id=b[0];k.title=b[1];k.startDate=b[2];k.startDate2=b[3];k.startTime=b[4];k.endTime=b[5];k.locationDescription=b[6];k.description=b[7];k.source=b[8];k.participantType=b[9];k.rsvpStatus=b[10];k.categoryId=b[11];k.participantId=b[12];k.navigationURL=b[13];k.type=b[14];k.status=b[15];k.addressLine1=b[16];k.addressLine2=b[17];k.city=b[18];k.state=b[19];k.zip=b[20];k.typeDescription=b[21];k.honoree=b[22];k.editPage=b[23];var g=new Date();g.setHours(0,0,0,0);var d=[];var j=(k.startDate.getMonth()+1)+"/"+k.startDate.getDate()+"/"+k.startDate.getFullYear();d.push('")}}else{if(k.status!="D"){d.push('")}}}else{d.push('")}return d}function toggle_visibility(b){var a=document.getElementById(b);if(a.style.display=="none"){a.style.display="block"}else{a.style.display=="none"}}function destroy_calendar(){$("#showtodaybtn").unbind("click");$("#loadCalendarLeft").unbind("click");$("#loadCalendarRight").unbind("click");$("body").unbind("click");$("#txtdatetimeshow").text("");$("#gridcontainer").BcalDestroy();$("#calendarDiv").children().remove()};