(function($){
	$(document).ready(function(){

		//Cufon
		Cufon.replace('h1', {
		    fontFamily: 'centurygothic',
		    color: '-linear-gradient(#a62400, #6c1700)'
		});
		Cufon.replace('h2, #news-list h3', {
		    fontFamily: 'centurygothic'
		});
		Cufon.replace('.ch-img-text', { fontFamily: 'Lucida' });
		Cufon.replace('.ch-img-read', { fontFamily: 'Lucida' });
		Cufon.replace('.ch-button', { fontFamily: 'Lucida' });


		//FacStaff Directory
		$("div.moreinfopanel").hide();
		$(".toggle").click(function(){
			$(this).next("div.moreinfopanel").slideToggle(250);
		});

		$("#home-quick-links ul:eq(0) > li").hover(function() {
			$(this).siblings().find("ul").hide();
			$(this).siblings().find("a").removeClass("active");
			$(this).find("ul").show();
			$(this).find("a:eq(0)").addClass("active");
			$(this).parent().css({
				paddingBottom: $(this).find("ul").outerHeight() + 6
			})
		});

		var firstTime = true;
		$("#home-quick-links").hover(function() {
			$("div", this).show();
			firstTime && setTimeout(function() {
				$("#home-quick-links li:eq(0)").mouseover();
				firstTime = false;
			}, 10);
		}, function() {
			$("div", this).hide();
		});

		if( $("#news-list li").size()>5 ) {
			$("#news-list .list-holder").jcarousel({
				vertical: true,
				visible: 5,
				scroll: 1,
				initCallback: function(carousel) {
					$("#news-list").append("<a href='#' class='arrow arrow-prev'>Prev</a>");
					$("#news-list").append("<a href='#' class='arrow arrow-next'>Next</a>");

					$("#news-list .arrow").click(function() {
						$(this).is(".arrow-prev") ? carousel.prev() : carousel.next();
						return false;
					});
				}
			})
		}
	});
})(jQuery);
