$(document).ready(function(){$(".noEvents ").html(" ");
if(window.name.length>0){$("#eventFilterBox input").removeAttr("checked");
var checkedList=window.name.split(",");
$.each(checkedList,function(idx,val){$("#"+val).attr("checked","true")
});
updateCalendar()
}else{$("#eventFilterBox input").attr("checked","true");
applyEventFilter()
}$(".eventType input").bind("click",function(){applyEventFilter();
formatEventList()
});
initCalendarEvents();
if($(".eventCal tr:last td:first").hasClass("weekend-hidden")){$(".eventCal tr:last").hide()
}});
function applyEventFilter(){var checkedList=[];
var IsAllEventTypeUnchecked=false;
$("#eventFilterBox input").each(function(i){var eventType=$(this).attr("id");
var isChecked=$(this).attr("checked");
if(isChecked==true){checkedList.push(eventType);
IsAllEventTypeUnchecked=true
}});
if(IsAllEventTypeUnchecked){window.name=checkedList.join(",")
}else{window.name="AllEventsUnchecked"
}updateCalendar()
}function updateCalendar(){$(".event").each(function(){var events=$(this).attr("class").split(" ");
var eventVisible=false;
$.each(events,function(key,val){if(val=="event"||val=="isVisible"||val==""){return true
}if($("#"+val).attr("checked")){eventVisible=true;
return false
}});
if(eventVisible){$(this).addClass("isVisible")
}else{$(this).removeClass("isVisible")
}});
$("table[id$=eventListTable] tbody tr.isVisible").show();
$("table[id$=eventListTable] tbody tr:not(.isVisible)").hide();
$("table[id$=eventCal] td").each(function(){if($(this).find(".eventSummary").length>0&&$(this).find(".eventSummary .isVisible").length>0){if($(this).is(":first-child")){$(this).removeClass("saturday")
}else{if($(this).is(":last-child")){$(this).removeClass("sunday")
}else{$(this).removeClass("calDayFont")
}}$(this).addClass("eventBackground");
$(this).find(".eventSummary").show()
}else{$(this).removeClass("eventBackground");
$(this).find(".eventSummary").hide();
if(!($(this).hasClass("weekend-hidden")||$(this).hasClass("hidden"))){if($(this).is(":first-child")){$(this).addClass("saturday")
}else{if($(this).is(":last-child")){$(this).addClass("sunday")
}else{$(this).addClass("calDayFont")
}}}}});
if($("#eventListTable").length>0){if($("#eventListTable tbody tr.isVisible").length==0){$(".calendarContainer").hide();
$(".noEvents").html($(".hiddenNoEventText").val());
$(".eventListNav").hide()
}else{$(".calendarContainer").show();
$(".noEvents").html(" ");
$(".eventListNav").show()
}}if($(".calendarWidgetContainer").length>0){if($(".calendarWidgetContainer .event.isVisible").length==0){$(".calendarWidgetContainer").hide();
$(".noEvents").html($(".hiddenNoEventText").val());
$(".eventListNav").hide()
}else{$(".calendarWidgetContainer").show();
$(".noEvents").html(" ");
$(".eventListNav").show()
}}$(" .event").each(function(){if(($(this)).hasClass("isVisible")){if(($(this).parent()).hasClass("eventSummary")){$(this).parent().show()
}}else{if(($(this).parent()).hasClass("eventSummary")){$(this).parent().hide()
}}})
}function loadPageIntoElement(element,url){$.get(url,function(page){$("#"+element).html(page);
applyEventFilter();
applyShader("#"+element)
})
}function formatEventList(){$("#eventListTable td").removeClass("cancelEventListDividerLine");
$("#eventListTable .isVisible:last td").addClass("cancelEventListDividerLine")
}function initCalendarEvents(){$("#eventListTable td").removeClass("cancelEventListDividerLine");
$("#eventListTable tr").addClass("isVisible");
$("#eventListTable tr:last td").addClass("cancelEventListDividerLine")
}function submitMonthDropDown(){var url=$("#optMonth option:selected").attr("value");
if(url!=""){location.href=(url)
}}function submitYearDropDown(){var url=$("#optYear option:selected").attr("value");
if(url!=""){location.href=(url)
}}function getEvents(url){if(url!=""){location.href=(url)
}};