function initEvent (){
	Event.observe('submit', 'click', submitForm );
}
Event.observe(window ,'load', initEvent ); 

function submitForm(){
	var postBody = $('formu').serialize();
	
	var opt = {
    method: 'post',
    postBody: "action=formContact&"+postBody,
    onSuccess: function(transport)
  	{
     	var t = transport.responseText;
      var rep = t.substring(0,1);
      var txt = t.substring(1, t.length );
      if ( rep == 0 )
      {
      	alert( txt );
      	$('submit').show();
      }
      else
      {
      	new Effect.Appear('result', { duration:0.5, from:1.0, to:0.0 ,
      		afterFinish : function(){
      			$('result').innerHTML = txt;
      			new Effect.Appear('result', { duration:0.5, from:0.0, to:1.0} );
      			}
      	} );
      }
 		}
	};
	new Ajax.Request('dispatcher.php', opt);
}
