$(document).ready(function(){
	
	var daysOfWeek = new Array();
	daysOfWeek[0] = 'monday';
	daysOfWeek[1] = 'tuesday';
	daysOfWeek[2] = 'wednesday';
	daysOfWeek[3] = 'thursday';
	daysOfWeek[4] = 'friday';
	daysOfWeek[5] = 'saturday';
	daysOfWeek[6] = 'sunday';
	daysOfWeek[7] = 'all';
	
	$('.infolink').click(function(){
		$('#info').slideToggle();
	});

	$('#nav a').click(function(el){
		var selectedDay = $(this).attr('rel');
		
		for(var i=0; i < daysOfWeek.length; i++){
			if(daysOfWeek[i] != selectedDay && selectedDay == 'all'){
				$('.'+daysOfWeek[i]).animate({ opacity: 1 }, 200 );
				$('#nav a').removeClass('selected');				
			} else if(daysOfWeek[i] != selectedDay){
				$('.'+daysOfWeek[i]).animate({ opacity: 0.3 }, 200);
				$('#nav a').removeClass('selected');
			} else {
				$('.'+daysOfWeek[i]).animate({ opacity: 1 }, 200 );
			}
		}
		
		$(this).addClass('selected');
		el.preventDefault();
	});
	
	$('#coffees').append('<li class="last"></li>');
	
	$('#footer img').css('opacity', '0.1');
	
	$('#footer p').click(
		function(){
			$('#footer img').animate({ opacity: 1 }, 500 );
			$('#footer em').fadeIn(500);
		},
		function(){
			$('#footer img').animate({ opacity: 0.1 }, 500 );
			$('#footer em').fadeOut(500);
		}
	);
	
	
	var hoverConfig = {    
		sensitivity: 3,
		interval: 200,
		over: showFooter,
		timeout: 500,
		out: hideFooter
	};
	
	function showFooter(){}
	
	function hideFooter(){
		$('#footer img').animate({ opacity: 0.1 }, 500 );
		$('#footer em').fadeOut(500);
	}
	
	$('#footer p').hoverIntent(hoverConfig);
	
});