$(function() { 
	$('a[rel="#overlay"]').overlay(
		{	
		expose: '#262626',
		onBeforeLoad: function() { 
			// grab wrapper element inside content 
			var wrap = $("div.owrap"); 
	 
			// load only for the first time it is opened 
			if (wrap.is(":empty")) { 
				wrap.load(this.getTrigger().attr("href")); 
			} 
	    },
	    onClose: function() {
			    $("div.owrap").empty(); 
	    	},
	    finish: {
	    	top: 5,
			left: 'center',
			absolute: false
			} 
	});
	$('div.owrap a').live('click', function(e) {
		e.preventDefault();
		$('div.gwrap').fadeOut();
		$('div.owrap').load(this.href, function(){$('div.gwrap').fadeIn();});
	});
});	
