$(document).ready(function () {

	//Append a div with hover class to all the LI
	$('#nav li').append('<div class="hover"></div>');


	$('#nav li').hover(
		
		//Mouseover, fadeIn the hidden hover class	
		function() {
			
			$(this).children('div').fadeIn('1000');	
		
		}, 
	
		//Mouseout, fadeOut the hover class
		function() {
		
			$(this).children('div').fadeOut('1000');	
		
	});

});

$(function() {
		
	$("a[rel]").overlay({top: 50, opacity: 0.5, expose: '#f1f1f1', onBeforeLoad: function() { 
 
            // grab wrapper element inside content 
            var wrap = this.getContent().find(".contentWrap"); 
 
            // load the page specified in the trigger 
            wrap.load(this.getTrigger().attr("href")); } });
	
	$("img[rel]").overlay({top: 50, expose: '#f1f1f1'});
	
	$(".gallery-overlay").overlay({target: '#gallery', top: 50, expose: '#f1f1f1'}).gallery({speed: 800, opacity: 1});
	
});
