//Affiche les champs lies au conjoint d un affilie

jQuery(function() {
	
	$('#prefon_souscription_affiliation_statut_0').click(function(){
		$('#champsConjoint').hide();
		$('#prefon_souscription_affiliation_numero_adherent_conjoint').val("");
		$('#prefon_souscription_affiliation_numero_securite_sociale').val("");
		$('#ligCotisationType ul').children(":first-child").show();
		$('#paiement_cotisation_prelevement_echeance').css('top', '-35px'); 
	});
	$('#prefon_souscription_affiliation_statut_1').click(function(){
		$('#champsConjoint').hide();
		$('#prefon_souscription_affiliation_numero_adherent_conjoint').val("");
		$('#prefon_souscription_affiliation_numero_securite_sociale').val("");
		$('#ligCotisationType ul').children(":first-child").hide();
		$('#paiement_cotisation_precompte_date_debut').hide();
		$('#prefon_souscription_affiliation_paiement_cotisation_type_1').attr('checked','checked');
		$('#paiement_cotisation_prelevement_echeance').show();
		$('#paiement_cotisation_prelevement_echeance').css('top', '-90px'); 
	});
	$('#prefon_souscription_affiliation_statut_3').click(function(){
		$('#champsConjoint').hide();
		$('#prefon_souscription_affiliation_numero_adherent_conjoint').val("");
		$('#prefon_souscription_affiliation_numero_securite_sociale').val("");
		$('#ligCotisationType ul').children(":first-child").show();
		$('#paiement_cotisation_prelevement_echeance').css('top', '-35px'); 
	});
	$('#prefon_souscription_affiliation_statut_2').click(function(){
		$('#champsConjoint').show();
		$('#prefon_souscription_affiliation_numero_adherent_conjoint').val("");
		$('#prefon_souscription_affiliation_numero_securite_sociale').val("");
		$('#ligCotisationType ul').children(":first-child").show();
		$('#paiement_cotisation_prelevement_echeance').css('top', '-35px');
	});
	$('#prefon_souscription_affiliation_statut_4').click(function(){
		$('#champsConjoint').hide();
		$('#prefon_souscription_affiliation_numero_adherent_conjoint').val("");
		$('#prefon_souscription_affiliation_numero_securite_sociale').val("");
		$('#ligCotisationType ul').children(":first-child").show();
		$('#paiement_cotisation_prelevement_echeance').css('top', '-35px'); 
	});
	
	if($('#prefon_souscription_affiliation_statut_2').is(':checked')){
		$('#champsConjoint').show();
	}
	else{
		$('#champsConjoint').hide();
	}
	
	if($('#prefon_souscription_affiliation_statut_1').is(':checked'))
	{
		$('#champsConjoint').hide();
		$('#prefon_souscription_affiliation_numero_adherent_conjoint').val();
		$('#prefon_souscription_affiliation_numero_securite_sociale').val();
		$('#ligCotisationType ul').children(":first-child").hide();
		$('#paiement_cotisation_precompte_date_debut').hide();
		$('#prefon_souscription_affiliation_paiement_cotisation_type_1').attr('checked','checked');
		$('#paiement_cotisation_prelevement_echeance').show();
		$('#paiement_cotisation_prelevement_echeance').css('top', '-90px'); 
	}
	else
	{
		$('#prefon_souscription_affiliation_numero_adherent_conjoint').val();
		$('#prefon_souscription_affiliation_numero_securite_sociale').val();
		$('#ligCotisationType ul').children(":first-child").show();
		$('#paiement_cotisation_prelevement_echeance').css('top', '-35px'); 
	}
	
	if($('#prefon_souscription_affiliation_paiement_cotisation_type_0').is(':checked')){
		$('#paiement_cotisation_prelevement_echeance').hide();
		$('#paiement_cotisation_precompte_date_debut').show();
	}else if($('#prefon_souscription_affiliation_paiement_cotisation_type_1').is(':checked')){
		$('#paiement_cotisation_prelevement_echeance').show();
		$('#paiement_cotisation_precompte_date_debut').hide();
	}else{
		$('#paiement_cotisation_prelevement_echeance').hide();
		$('#paiement_cotisation_precompte_date_debut').hide();
	}
	
	$('#prefon_souscription_affiliation_paiement_cotisation_type_0').click(function(){
		$('#paiement_cotisation_prelevement_echeance').hide();
		$('#paiement_cotisation_precompte_date_debut').show();
	});
	
	$('#prefon_souscription_affiliation_paiement_cotisation_type_1').click(function(){
		$('#paiement_cotisation_prelevement_echeance').show();
		$('#paiement_cotisation_precompte_date_debut').hide();
	});
	
	$('#help_prefon_classe_cotisation_id').ready(function() {
		$('#inf_cotisation').hide();
	});
	$('#help_prefon_inf_ancienFonctionnaire').ready(function() {
		$('#inf_ancienFonctionnaire').hide();
	});
	$('#help_prefon_inf_PUPH').ready(function() {
		$('#inf_PUPH').hide();
	});
	$('#help_prefon_inf_precompte').ready(function() {
		$('#inf_precompte').hide();
	});

	$('#help_prefon_classe_cotisation_id').hover(
			function() {
				$('#inf_cotisation').show();
			},
			function() {
				$('#inf_cotisation').hide();
			}
	);
	
	$('#paiement_cotisation_precompte_date_debut').hover(
		function() {
			$('#inf_precompte').show();
			if($('#prefon_souscription_affiliation_statut_2').is(':checked'))
			{
				$('#inf_precompte').css('top', '350px');
			}
		},
		function() {
			$('#inf_precompte').hide();
		}
	);
		
	$('#help_prefon_inf_PUPH').hover(
			function() {
				$('#inf_PUPH').show();
			},
			function() {
				$('#inf_PUPH').hide();
			}
	);
	$('#help_prefon_inf_ancienFonctionnaire').hover(
			function() {
				$('#inf_ancienFonctionnaire').show();
			},
			function() {
				$('#inf_ancienFonctionnaire').hide();
			}
	);
});

