
$(function() {

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

		expose: { 
			 
	        // you might also consider a "transparent" color for the mask 
	        color: '#fff', 
	 
	        // load mask a little faster 
	        loadSpeed: 200, 
	 
	        // highly transparent 
	        opacity: 0.5 
	        },
		effect: 'apple',

		onBeforeLoad: function() {
	        $('#wrap_content').innerHTML = 'wczytuje...';

			// grab wrapper element inside content
			var wrap = this.getContent().find("div.wrap");
			
			// load the page specified in the trigger
			wrap.load(this.getTrigger().attr("href"));
		},
		
		onBeforeClose: function() {
			
		}

	});
});