$(document).ready(function(){
    $("a.overlay").overlay({
		mask: {
			color:'#1C0216',
			loadSpeed:200,
			opacity:0.8,
			zIndex:100002
		},
		closeOnClick:true,
		onBeforeLoad:function() {
			
			// grab wrapper element inside content
			var wrap = this.getOverlay().find(".overlay_content_wrap");

			// load the page specified in the trigger
			jQuery.ajax({
				 url:		this.getTrigger().attr("href"),
				 success: 	function(result) {
					 			wrap.html(result);
						  	},
				 async:   	false
			});
		},
		onLoad:function() {
			this.getOverlay().data("overlay",this.getTrigger().data("overlay"));
		}
	});
});
