$(document).ready(function() {

	// Mailchimp form
	$("#mc-embedded-subscribe-form input").on({
		focusin: function() {
			if ($(this).val() == "Your email address") { $(this).val(''); }
		},
		focusout: function() {
			if ($(this).val() == "") { $(this).val('Your email address'); }
		}
	});

	// Apply infinite carousel
	$("#carousel").carousel("#carouselprev", "#carouselnext");
	
	// Apply Biggerlink to updates and events
	$(".updateprogressbottom, .eventbottom, .detailsbottom").biggerlink({hoverclass:'rollover'});

	// Clear search input
	$("#searchinput").click(function() {
		$(this).val("");
	});

	// Category menu
	$(".categories").hide();

	$(".subnav").hover(function() {
		$(".categories").stop(true, true).fadeIn(250);
	}, function() {
		$(".categories").stop(true, true).fadeOut(250);
	});

	$(".categories a").click(function(e) {
		var categoryName = $(this).text();
		var categoryURL = $(this).attr('href');
		$(".choosecategory").show().text(categoryName);
		$(".categories").hide();
	});

});
