// JavaScript Document
// create custom animation algorithm for jQuery called "drop" 
$.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: '+=50',  opacity: 1,  width: '+=10'}, 400, 'drop', done);
   /* closing animation */
   }, function(done) {
      this.getOverlay().animate({top:'-=50', opacity:0, width:'-=10'}, 300, 'drop', function() {
         $(this).hide();
         done.call();      
      });
   }
);

// Functions Callbacks
// What is $(document).ready ? See: http://flowplayer.org/tools/documentation/basics.html#document_ready
$(document).ready(function() {

	$(".overlay_drop[rel]").overlay({
		effect: 'drop',
		mask: '#999'
	});
	
});
