$(
function(){	
		//Ajout des tooltips d'aide
		$('#help_1_1').qtip({
		content: $('#content_help_1_1'),show: 'mouseover',hide: {delay:3000},
			style: {border: {width: 5,radius: 10},padding: 10,textAlign: 'center',tip: true,name: 'cream'}			
		});

		//Ajout des tooltips d'aide
		$('#help_1_2').qtip({
			content: $('#content_help_1_2'),show: 'mouseover',hide: {delay:3000},
			style: {border: {width: 5,radius: 10},padding: 10,textAlign: 'center',tip: true,name: 'cream'}			
		});
		//Ajout des tooltips d'aide
		$('#help_1_5').qtip({
			content: $('#content_help_1_5'),show: 'mouseover',hide: {delay:3000},
			style: {border: {width: 5,radius: 10},padding: 10,textAlign: 'center',tip: true,name: 'cream'}			
		});
		//Ajout des tooltips d'aide
		$('#help_1_6').qtip({
			content: $('#content_help_1_6'),show: 'mouseover',hide: {delay:3000},
			style: {border: {width: 5,radius: 10},padding: 10,textAlign: 'center',tip: true,name: 'cream'}			
		});
		//Ajout des tooltips d'aide
		$('#help_1_7').qtip({
			content: $('#content_help_1_7'),show: 'mouseover',hide: {delay:3000},
			style: {border: {width: 5,radius: 10},padding: 10,textAlign: 'center',tip: true,name: 'cream'}			
		});
		//Ajout des tooltips d'aide
		$('#help_1_8').qtip({
			content: $('#content_help_1_8'),show: 'mouseover',hide: {delay:3000},
			style: {border: {width: 5,radius: 10},padding: 10,textAlign: 'center',tip: true,name: 'cream'}			
		});
		//Ajout des tooltips d'aide
		$('#help_1_9').qtip({
			content: $('#content_help_1_9'),show: 'mouseover',hide: {delay:3000},
			style: {border: {width: 5,radius: 10},padding: 10,textAlign: 'center',tip: true,name: 'cream'}			
		});

		//ajout de regle de validation particuliere
		
	

		$('#type_dossier').change(
			function(event){
				if($('#type_dossier').val()=="prop"){	
					$('#si_prop_1,#si_prop_2,#si_prop_3').show();
					$('#tr_credit_immo_titre,#tr_credit_immo_1,#tr_credit_immo_2,#tr_credit_immo_3').show();
					$('#tr_charge_loyer_1,#tr_charge_loyer_2,#tr_charge_loyer_3').hide();			
					$('#duree_prop').show();
					$('#duree_loc_heb').hide();
					
					//pour validation
					$('#Vous_etes,#valeur_bien,#estimation_par,#lab_nb_credit_immo,#total_mens_immo,#restant_du_immo').addClass("pageRequired");
					$('#loyer_hors_charge #montant_charges').removeClass("pageRequired");
					
				}
				else if($('#type_dossier').val()=="prop_loc"){
				
					$('#si_prop_1,#si_prop_2,#si_prop_3').show();					
					$('#tr_credit_immo_titre,#tr_credit_immo_1,#tr_credit_immo_2,#tr_credit_immo_3').show();
					$('#tr_charge_loyer_1,#tr_charge_loyer_2,#tr_charge_loyer_3').show();
					$('#duree_prop').show();
					$('#duree_loc_heb').hide();
					
					//pour validation
					$('#Vous_etes,#valeur_bien,#estimation_par,#lab_nb_credit_immo,#total_mens_immo,#restant_du_immo').addClass("pageRequired");
					$('#loyer_hors_charge #montant_charges').addClass("pageRequired");
				}
				else{
				
					$('#si_prop_1,#si_prop_2,#si_prop_3').hide();
					$('#tr_credit_immo_titre,#tr_credit_immo_1,#tr_credit_immo_2,#tr_credit_immo_3').hide();
					$('#tr_charge_loyer_1,#tr_charge_loyer_2,#tr_charge_loyer_3').show();
					
					//pour validation
					$('#Vous_etes,#valeur_bien,#estimation_par,#lab_nb_credit_immo,#total_mens_immo,#restant_du_immo').removeClass("pageRequired");
					//$('#loyer_hors_charge,#montant_charges').addClass("pageRequired");
					$('#duree_prop').hide();
					$('#duree_loc_heb').show();

				}				
		});
		$('#nb_credit_immo').change(
			function(event){
				if ($('#nb_credit_immo').val() == "0") {
					$('#tr_credit_immo_1,#tr_credit_immo_2').hide();
					$('#total_mens_immo,#restant_du_immo').removeClass("pageRequired");
				}
				else {
					$('#tr_credit_immo_1,#tr_credit_immo_2').show();
					$('#total_mens_immo,#restant_du_immo').addClass("pageRequired");
				}
			}
		);
	
	$('#type_dossier').trigger("change");
	
	
	
	
	$('#financement_achat').change(
		function(event){
		
			var v = event.currentTarget.value;
			if(v=="") $('#tr_montant_devis').hide();
			else $('#tr_montant_devis').show();			
		});
	
	$('#nbr_enfant').change(
	function(event){
		var nb = event.currentTarget.value;
		for(var cpt=1;cpt<=10;cpt++){
			$("#enfant_"+cpt).hide();
			//pour validation
			$('#dn_jour_'+cpt).removeClass("pageRequired");
			$('#dn_mois_'+cpt).removeClass("pageRequired");
			$('#dn_annee_'+cpt).removeClass("pageRequired");
		}
		if(nb>0){
			for(var cpt=1;cpt<=nb;cpt++){
				$("#enfant_"+cpt).show();
				//pour validation
				$('#dn_jour_'+cpt).addClass("pageRequired");
				$('#dn_mois_'+cpt).addClass("pageRequired");
				$('#dn_annee_'+cpt).addClass("pageRequired");
			}
		this.nb_enfant=nb;
		}
	});
});
