function survey_ok(pays,reponse,duree){
	var date = new Date();
	if (duree == "long"){
		date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
	}else{
		date.setTime(date.getTime() + (7 * 24 * 60 * 60 * 1000));
	}
	$.cookie('survey_'+pays, reponse, { path: '/', expires: date })
}
function survey_me(pays){
	var cook = $.cookie('survey_'+pays);
	
	if (cook != 'oui' && cook != 'non'){
		$.ajax({
			type: "GET",
			url: "/dolceta.xml",
			dataType: "xml",
			success: function(xml) {
				
				$(xml).find(pays).each(function(){
					var nom = $(this).find('survey_nom').text();
					var phrase1 = $(this).find('survey_phrase_1').text();
					var phrase2 = $(this).find('survey_phrase_2').text();
					var oui = $(this).find('survey_oui').text();
					var non = $(this).find('survey_non').text();
					var url = $(this).find('survey').find('url').text();
				
					$.fancybox('<img src="http://survey.dolceta.eu/limesurvey/templates/dolceta/logo_dolceta.png" alt="Dolceta" style="float: left; margin-right: 15px; margin-bottom: 20px;" /><h1 class="Ancien_Mod" style="margin-top: 25px;" >'+nom+'</h1><div class="clear"> </div> <p>'+phrase1+'</p><p>'+phrase2+'</p><p><a href="'+url+'" class="oui iframe" style="float: left;">'+oui+'</a><a href="" class="non" style="float: right;" >'+non+'</a></p>',
						{
							'autoDimensions'	:	false,
							'height'	:	200,
							'modal'	:	true
						});
					$("a.non").click(function(){
						$.fancybox.close;
						survey_ok(pays,"non","court");
					});
					$("a.oui").fancybox();
					$("a.oui").click(function(){
						$("a.oui").fancybox();
						survey_ok(pays,"oui","long");
					});
					
				});
			}
		});
	}
}

