/*	Yes, I am one hell of a motherfucker.*/// 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: '+=55',  opacity: 1,  width: '+=20'}, 400, 'drop', done);      /* closing animation */   }, function(done) {      this.getOverlay().animate({top:'-=55', opacity:0, width:'-=20'}, 300, 'drop', function() {         $(this).hide();         done.call();            });   }   );/***********/$(function() {	$("#gift").overlay({					   mask: '#000', 					   effect: 'drop', 					   fixed:false, 					   closeOnClick:false,					   onClose: function(){						  			callService("action=gift_prompt_no", function(){})					   			},						onLoad: function(){						  			callService("action=gift_icon", function(){})					   			}					   });		$('#deballer_cadeau').click(function(){		callService("action=gift_prompt_yes", function(){})		window.location = "nostalgie.html";		return false;	});		startFade();				if( $('#chat').length > 0 )	{		var file = 'gift/zloche_v1.1_codenameNNY_cs4_lapin.swf?2';		$('#open_popup').click(function(){			$('#open_popup').next().remove();			$('#open_popup').remove();			$('#chat').html('<p style="padding-top:15px;">Le chat est maintenant dans un popup. <br />Pour revoir le chat ici, tu n\'as qu\'&agrave; rafra&icirc;chir la page !');			open_window('popup.html?f=' + encodeURIComponent(file));		});				var so = new SWFObject(file,  "chat-flash", 720, 600, "9", "000000");		so.addParam("scale", "noscale");		so.addParam("align", "tl");		so.addParam("menu", "false");		so.addParam("wmode", "transparent"); //Silly register box :-(		so.addParam("allowfullscreen", "true");		so.write("chat");		$("#createAccount").overlay({			mask: '#000', 			effect: 'drop', 			fixed:false,			onLoad: function(){				$('#register').text('Un instant stp...');				$('#register').load('gift/register.php?' + Math.random())			}		});	}});function open_window(url) {mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0, scrollbars=0, menubar=0,resizable=0,marginheight=0, marginwidth=0,leftmargin=0,topmargin=0,width=720,height=600');mywin.focus(); }function startFade(){	if($('#gift').length == 0)		return;	$('#gift').fadeTo(1200, 1, function(){		$('#gift').fadeTo(1200, 0.5, startFade);	});	}function debug(obj){	try	{		console.log(obj);	}	catch(e){}}
