$(function() {

	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	$("a[rel]").overlay({

		expose: '#333333',
		effect: 'apple',

		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"));
		}

	});
	// load it immediately after the construction

});
/*

$(window).load()(function() {
	alert('ciao');
	$("#app").overlay({

	// custom top position
	top: 260,

	// some mask tweaks suitable for facebox-looking dialogs
	mask: {

		// you might also consider a "transparent" color for the mask
		color: '#fff',

		// load mask a little faster
		loadSpeed: 200,

		// very transparent
		opacity: 0.5
	},

	// disable this for modal dialog-type of overlays
	closeOnClick: true,

	// load it immediately after the construction
	load: true

});
});
*/

/*
$(window).load()(function() {
//		var wrap = this.getContent().find(".contentWrap");
		var wrap2 = $("#app").find(".contentWrap");
		wrap2.load("app.html");
})

$(document).ready(function() {
   $(document).overlay({

		expose: '#333333',
		effect: 'apple',

		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"));
		}

	});
  // Handler for .ready() called.
});
*/


