/* Author: Jimmy


*/
$(document).ready(function() {
	
	var speed = 6000;

	$('#banner div.banner_image').fadeIn(1000, function() {
		$('#banner').cycle({
			fx: 'fade',
			timeout: speed
		});
	});
	
	// change heading in gallery to dropdown when clicked
	$('#month_selector_month').click(function() {
		$(this).hide();
		$('#month_selector_dropdown').show();
	});
	
	// auto drop-down month
	var $select = $("#months");
	var change = function(e) {
		var value = $select.val();
		window.location.replace("/events/calendar/" + value + "/");
	};
	$select.change(change);		
	
	// navigation drop-downs
	$('#main_nav li').hover(function() {
		$(this).children('ul').css('display', 'block');
		$(this).children('ul').stop().animate({
			opacity: 1
		}, 150);
	}, function() {
		
		$(this).children('ul').animate({
			opacity: 0
		}, 100, function() {
			// Animation complete.
			$(this).css('display', 'none');
		});
	});

});
