//When the DOM tree is loaded
$(document).ready(function() {

    //Add pointer class to .photo .item
    $(".photo .item").addClass("pointer");

    //Hover over photo fade in hidden span
    $(".photo .item").hover(
        function() {
            $(this).find("span").fadeIn();
        },
        function() {
            $(this).find("span").fadeOut();
        }
    );

    $(".eventDay").hover(
        function() {
		clearTimeout($(this).data('hoverTimeout'));		
		$div = $(this).find(".events_today");
		$(".events_today").not($div).hide();
		$div.fadeIn();
	},
        function() {
                var $div = $(this).find('.events_today');
		var timeout = setTimeout(function() {
			$div.fadeOut();
		}, 250);
		$(this).data('hoverTimeout', timeout);
	}
    );
});

