$(document).ready(function(){
	$("input[name=isConjoint]").click(function(i){
		if(this.value==1) {
			$("#votre_conjoint").show();
		}
		else {
			$("#votre_conjoint").hide();
		}
	});
	
	$("#vos_besoins li:not(.selected) input").click(function(i){
		if(this.value==2) {
			$("#choix_2_1").show();
			$("#choix_2_2").show();
		}
		else{
			$("#choix_2_1").hide();
			$("#choix_2_2").hide();	
			if(document.getElementById('ss_besoin_id1')){
    			document.getElementById('ss_besoin_id1').checked = false;
    			document.getElementById('ss_besoin_id2').checked = false;	    
			}
		}
		
		if(this.value==5) {
			$("#choix_5_1").show();
			$("#choix_5_2").show();
		}
		else{
			$("#choix_5_1").hide();
			$("#choix_5_2").hide();	
			if(document.getElementById('ss_besoin_id5_1')){
    			document.getElementById('ss_besoin_id5_1').checked = false;
    			document.getElementById('ss_besoin_id5_2').checked = false;	    
			}
		}
	});
	
	
	$("ul.display_info")	.hide()
							.css( {
								position: "absolute",
								border: "1px solid red",
								padding: "0 10px",
								background: "#EDEDED",
								zIndex: "999",
								width: "400px",
								bottom: "260px"
							})
							.children("li").css( {
								padding: "5px 0",
								margin: "0",
								background: "none"
							});
	$("ul.display_info.resultat").css( {
								left: "450px",
								marginTop: "-150px"
							});
	$("ul.display_info.form").css( {
								left: "85px",
								marginTop: "-150px"
							});
	$("span.survol_info")	.css( {
							  	color: "#AF0000",
							  	textDecoration: "underline",
								cursor: "pointer"
							})
							.hover( function() {
								$(this).parent().next("ul.display_info").show();
								
								var popinHeight = $(this).parent().next("ul.display_info").height();
								var popinWidth = $(this).parent().next("ul.display_info").width();
								var popinOffset =  $(this).parent().next("ul.display_info").offset();
								var wraperOffset =  $("#vos_besoins").offset();
								var iframeTop = popinOffset.top - wraperOffset.top;
								var iframeLeft = popinOffset.left - wraperOffset.left;
								$(this).parent().next("ul.display_info").after("<iframe src='_blank' class='iframeShime' frameborder='' />");
								$(".iframeShime").css({
									border: "0px",
									position: "absolute",
									zIndex: "990",
									width: popinWidth,
									height: popinHeight,
									top: iframeTop - "1",
									left: iframeLeft - "1"
								});
								
											 }, function(){
								$(".iframeShime").remove();
								$(this).parent().next("ul.display_info").hide();
							});
						
	
    /*$('#day').keyup(function(event){
        if(((document.getElementById('day').value).length == 2) && (isNaN(document.getElementById('month').value))) {
            document.getElementById('month').value = '';
            document.getElementById('month').focus();
        }
    });

    $('#month').keyup(function(event){
        if(((document.getElementById('month').value).length == 2) && (isNaN(document.getElementById('year').value))) {
            document.getElementById('year').value = '';
            document.getElementById('year').focus();      
        }
    });*/
});


