$(function() {

	//publicidad
	
	$.easing.drop = function (x, t, b, c, d) {
	return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
};
// loading animation

$.tools.overlay.addEffect("drop", function(css, done) { 
   
   // use Overlay API to gain access to crucial elements
   var conf = this.getConf(),
       overlay = this.getOverlay();           
   
   // determine initial position for the overlay
   if (conf.fixed)  {
      css.position = 'fixed';
   } else {
      css.top += $(window).scrollTop();
      css.left += $(window).scrollLeft();
      css.position = 'absolute';
   }
   // position the overlay and show it
   overlay.css(css).show();
   // begin animating with our custom easing
   overlay.animate({ top: '+=5',  opacity: 1}, 400, 'drop', done);
   /* closing animation */
   }, function(done) {
      this.getOverlay().animate({top:'-=5', opacity:0}, 300, 'drop', function() {
         $(this).hide();
         done.call();      
      });
   }
);

	$("#publicidad").overlay({
		effect: 'drop',
		// custom top position
		top: 8,
		// some mask tweaks suitable for facebox-looking dialogs
		mask: {
			// you might also consider a "transparent" color for the mask
			color: '#000',
			// load mask a little faster
			loadSpeed: 200,
			// very transparent
			opacity: 0.8
		},
		// disable this for modal dialog-type of overlays
		closeOnClick: false,
		// load it immediately after the construction
		load: true
	});
	
	});

