	var formuEnCours = 0;
	var dejaouvert = 0;
	var formu = function(racine){
		if(formuEnCours) return;
		formuEnCours = 1;
		if(!$defined($('fondnoir'))){
			new Element('div', {id: 'fondnoir'}).addClass('fondnoir').setStyle('opacity', 0).inject(document.body);
		} else {
			dejaouvert = 1;
		}
		if($defined($('pagecentrale'))) $('fondnoir').setStyle('height', $('pagecentrale').getCoordinates().height.toInt());
		var tw = new Fx.Tween($('fondnoir'), {
			duration: 500, 
			onComplete: function(){
				var div = new Element('div').addClass('contformu');
				div.setStyle('left', ($(document.body).getSize().x / 2) - 220).inject(document.body);
					if(racine) var url = 'formulaire/formulaire.php?racine=1&ajax=1';
					else var url = '../formulaire/formulaire.php?ajax=1';
				var req = new Request.HTML({
					url: url,
					evalScripts: true,
					method: 'get',
					onSuccess: function(html) {	
						div.set('html', '');
						div.adopt(html);
						/*************/
						var postop = $(document.body).getScroll().y + ($(document.body).getSize().y /2) - 200;
						var fx = new Fx.Tween(div, {
							transition: Fx.Transitions.Elastic.easeOut,
							duration: 1500
						});
						fx.start('top', postop);
						/*************/
						$('soumissionirreversiblementexpeditrice').addEvents({
							'mousedown': function(){
								this.setStyle('border', 'gray 1px inset');
							},
							'mouseup': function(){
								this.setStyle('border', 'gray 1px outset');
							}
						});
						/***** traitement par appel de resultat.php ******/
						var monForm = $('monForm');
						monForm.addEvent('submit', function(e){
							e.stop();
							monForm.set('send', {
								onSuccess : function(responseText, responseXML){
									var ok = responseText;
									if(ok.indexOf('envoyé') != -1){
										div.addClass('exped');
										div.set('html', '<br/><br/><h3>Le message va être expédié ...</h3><br/><br/>');
										var expedition = function(){
											var fox = new Fx.Tween(div, {
												transition: Fx.Transitions.Elastic.easeIn,
												duration: 1500,
												onComplete: function(){
													div.destroy();
													var tw00 = new Fx.Tween($('fondnoir'), {
														duration: 1000, 
														onComplete: function(){
															formuEnCours = 0;
															$('fondnoir').destroy();
															}
													});
													tw00.start('opacity', 0);
												}
											});
											fox.start('left', $(document.body).getSize().x + 10);
										}
										expedition.delay(1500);
									} else if(responseText != "cancel") {	//si c'est cancel, on affiche rien
										var pos = (div.getPosition().x).toInt();
										var fux = new Fx.Tween(div, {
											transition: Fx.Transitions.Elastic.easeIn,
											duration: 800,
											onComplete: function(){
												var fux2 = new Fx.Tween(div, {
													transition: Fx.Transitions.Elastic.easeOut,
													duration: 800, 
													onComplete: function(){
														$('resultat').set('html', responseText);
													}
												});
												fux2.start('left', pos);
											}
										});
										fux.start('left', pos - 100);
									}
								}
							});
							monForm.send();
						});
						/************/
						$$('.closage').addEvent('click', function(){
							var fx = new Fx.Tween(div, {
								transition: Fx.Transitions.Elastic.easeIn,
								duration: 1500,
								onComplete: function(){
									div.destroy();
									if(!dejaouvert){ 
										var tw2 = new Fx.Tween($('fondnoir'), {
											duration: 1000, onComplete: function(){
												formuEnCours = 0;
												$('fondnoir').destroy();
											}
										});
										tw2.start('opacity', 0);
									}
								}
							});
							fx.start('top', -300);
							/*************/
							return false;
						});
					},
					onComplete: function() {

					},
					onFailure: function() {
						div.set('text', 'Problème, page non chargée.');
					}
				});
				req.send();
			}
		});
		tw.start('opacity', 0.5);
	}


