/*
$(document).ready(function() {
$("#popup").overlay({

	// custom top position
	top: 260,
	
	effect: 'drop',
	// some mask tweaks suitable for popup-looking dialogs
	mask: '#98D4D5',


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

	// load it immediately after the construction
	load: true

});
});
*/

// 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();
   showThis= function(){
	$('#popup').addClass('visible');
	}
	setTimeout(showThis,500)
   // begin animating with our custom easing

   
   /* closing animation */
   }, function(done) {
	
		$('#popup').addClass('closing');
		hideThis= function(){
			 this.getOverlay().animate({opacity:0}, 300, 'drop', function() {
		      //   $(this).hide();



		         done.call();      
		      });
		}
		setTimeout(hideThis,500)
     
   }
);
