﻿// ------------------------- //
// -------contact---------- //
// action effectuées lorsqu'on clique sur contact
$(document).ready(function() {
	// ajax envoi
	envoiAjax("formContact", "formContactResult");
	$("input.fermercontontact").click(function(e){ // reset
		closeFormulaire();		
	})
	// bouton de contact
	$("li#linkContact").click(function(e){
		$("ul#toolsbar").hide();
		$("div#zoneInsert").animate({height: '250'}, {duration: 600}).show();
		
	});	
})
function envoiAjax(form, result){
	$("#"+form).submit(function(event) {
		event.preventDefault(); 
		$("div#"+result).show();
		$(this).hide();
		$.ajax({
			type: "POST",
			url: $(this).attr("action"),
			data: $(this).serialize()
		});
	});
}
function closeFormulaire(){
	$("div#zoneInsert").slideUp('slow', function() {
		$("ul#toolsbar").show();
	});
}
function confirmation(){
	closeFormulaire();
}
function disabledBts(disabled){
	$("input#valider").attr("disabled", disabled);
	$("input#abandonner").attr("disabled", disabled);
}

