showError = function(){
	$('#fixed').width($(document).width());
	$('#fixed').height($(document).height());

	var windowWidth  = $(window).width();	
	var windowHeight = $(window).height();
	var windowScroolTop = $(window).scrollTop();
	var divWidth = $('#message_error').width();
	var divHeight = $('#message_error').height();
	
	
	var totalWidth = windowWidth/2 - divWidth/2;
	var totalHeight = windowHeight/2 - divHeight/2 + windowScroolTop;	
	
	$('#message_error').css({'margin-left':totalWidth});
	$('#message_error').css({'margin-top':totalHeight});	
	
	// apparition des blocs
	$('#fixed').fadeTo("slow", 0.75);
	$('#message_error').fadeIn("slow");
}

closeError = function(){
	$('#fixed').fadeOut("fast");
	$('#message_error').fadeOut("fast");
}

deleteInput = function(){
	document.contact.company.value="";
	document.contact.nom.value="";
	document.contact.prenom.value="";
	document.contact.tel.value="";
	document.contact.email.value="";
	document.contact.message.value="";
}

$(document).ready(function(){
	
	$('#fixed').css({left:0});						   

    $('#contact').ajaxForm({ 
        // target identifies the element(s) to update with the server response 
        target: '#message_error', 
 
        // success identifies the function to invoke when the server response 
        // has been received; here we apply a fade-in effect to the new content 
        success: function() {
			showError(); 
        } 
    }); 

});