window.addEvent('domready', function() {
	if($defined($('popup'))) {
		var draggable = new Drag($('popup'));
		
		$$('.popup_close').addEvent('click', function() {
			$('popup').style.display = 'none';
		});
	}
	if($defined($('popuparticle'))) {
		var draggable = new Drag($('popuparticle'));
		
		$$('.popup_close').addEvent('click', function() {
			$('popuparticle').style.display = 'none';
		});
	}
});


function centrerPopup(el) {
	var taillePopup, tailleWindow, nouvellePosition, decalageY = 0;

	if (Browser.Engine.trident && Browser.Engine.version==4) {
		// La position fixed bug sous IE6
		//el.setStyle('position', 'absolute');
		decalageY = window.getScroll().y;
	} else {
		el.setStyle('position', 'fixed');
	}
	// les x
	taillePopup = el.getSize().y;
	tailleWindow = window.getSize().y;
	nouvellePosition = ((tailleWindow - taillePopup) / 2 * 0.8) + decalageY;
	el.setStyle('top', nouvellePosition+'px');
	// les y
	/*
	taillePopup = el.getSize().x;
	tailleWindow = window.getSize().x;
	nouvellePosition = (tailleWindow - taillePopup) / 2 * 0.8;
	el.setStyle('left', nouvellePosition+'px');
	*/
}