$(document).ready(function() {
						   
	var hash = window.location.hash.substr(1);
	var href = $('#labels a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-5)){
			var toLoad = hash+'.html #wines-content';
			$('#wines-content').load(toLoad)
		}											
	});

	$('#labels a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #wines-content';
		$('#wines-content').delay(200).fadeOut('normal',loadContent);				
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-0);
		function loadContent() {
			$('#wines-content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#wines-content').delay(800).fadeIn('normal');
		}		
		return false;
		
	});

});

$(document).ready(function(){
				//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
				//Caption Sliding (Partially Hidden to Visible)
				$('.boxgrid.caption').hover(function(){
					$(".cover", this).stop().animate({top:'130px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'155px'},{queue:false,duration:160});
				});
			});

