/***** Gestion du menu déroulant *****/
include("manageMenu.js", function() {
	ManageMenu("#menu", "simple");
});

/***** Gestion globale des événements *****/
//function Manage(){}
//Event.observe(window, "load", Manage);

function displayComptes(id){
	$$('.comptes').each(function(c){
		if($(c).identify() != id)
			//$(c).hide();
			new Effect.Fade($(c), { duration : 0.2, afterFinish: function(){
				if($(id) != null && $(id).style.display == "none"){
					new Effect.Appear($(id), { duration : 0.5 });
					//$(id).show();
				}
			} });
	});

}


// calcul sur les impots
function calculDeduction(){
	if($('impotRevenu').checked)
		coef = 0.66;
	else if($('impotFortune').checked)
		coef = 0.75;
	else{
		alert("Veuillez choisir votre type d'impôt.");
		return false;
	}
	don = parseFloat($('donation').getValue());
	reduction = parseFloat($('reduction').getValue());
	if(don > 0){
		res = (don * coef).toFixed(2);
		$('reduction').setValue(res);
		$('donation').setValue(don.toFixed(2));
		cout = don - res ;
	}
	else if(reduction > 0){
		res = (reduction / coef).toFixed(2);
		$('donation').setValue(res);
		$('reduction').setValue(reduction.toFixed(2));
		cout = res - reduction ;
	}
	$('cout').setValue(cout.toFixed(2));
	return false;

}

