jQuery(document).ready(function($) { 
	// fade out any flash messages we may have after 5 seconds
	setTimeout('$("div.message[id$=Message]").fadeOut();', 5000);
	// remove unwanted menu divider
	$('#wrapper .topMenu ul li:last-child').css('background', 'transparent');
	// removing divider graphics from latest events box
	$('#wrapper .box.width-182 .boxContent .infoRow:last-child').css('background', 'transparent');
	// auto-sizing for the sidebar
	var sidebar = $('body.insidepage #wrapper .sidebar');
	var content = $('body.insidepage #wrapper .content');
	if(sidebar.height() < content.height()) {
		sidebar.css('min-height', content.css('min-height'));
		sidebar.css('height', content.css('height'));
	} else {
		content.css('min-height', sidebar.css('min-height'));
		content.css('height', sidebar.css('height'));		
	}
	// removing unwanted menu div
	$('body.insidepage #wrapper .content .sidebar .subNav ul li:last-child').css('background', 'transparent');
	// init the news ticker
	$().newsTicker({
		newsList: "ul#newsTicker",
		startDelay: 10,
		placeHolder1: " <"
	});
	// treeview init
	$('ul.filetree').treeview({
		collapsed: true
	});	
	// remove the final divider on the calendar
	$('table.calendar td.day a.dayEvent:last-child').css({'border-bottom':'none', 'margin-bottom':'0px'});
	// Hover fix for IE
	$('#wrapper .menu ul li').hover(
		function() {
			$(this).children('ul').fadeIn('fast');
		},
		function() {
			$(this).children('ul').fadeOut('fast');
		}
	);
	$('#wrapper .topMenu ul li').hover(
		function() {
			$(this).children('ul').slideDown('fast');
		},
		function() {
			$(this).children('ul').slideUp('fast');
		}
	);
});

Shadowbox.init();
