/*
 ***************************************
 *		jQuery for Calendar
 ***************************************
 */
function jQueryLocalFunctions()
{
/*
 *	Remove empty tags 
 */
	$("span.bold_").remove();
	$("th:empty").remove();
	$("td:empty").remove();
	$("tr:empty").remove();
	$("tr").not(":has(th),:has(td)").remove();
	$("dl").not(":has(dt),:has(dd)").remove();
/*	
 *	Remove midnight time references	
 */
	$("span:contains('12:00AM ')").each(function() {
		var loop = $(this).html();
		$(this).empty();
		$(this).append(loop.replace(/12:00AM /,''));
	});
/*	
 *	Sean Catchpole's idTabs	
 */
	$("#usual1 ul").idTabs();
/*	
 *	Display details of selected term (when page loaded, and when tab clicked)	
 */
	$("span#insert-term").text($("a.selected").text() + " ");
	$("#trm-details").text($("div#cal-details"+$("a.selected").text().substr(5)).text());
	
	$("#usual1 ul li a").click(function() {
		$("span#insert-term").text($(this).text() + " ");
		$("#trm-details").text($("div#cal-details"+$(this).text().substr(5)).text());
	});
/*	
 *	Checkbox used to display text only version of calendar
 */
	$(":checkbox").click(function () { 
      	var n = $("input:checked").length;
		if (n > 0) {
			$(".cal-grid").hide();
			$(".cal-text").show();
		} else {
			$(".cal-text").hide();
			$(".cal-grid").show();
		} 
    });	
}

