var i_sondage = 0; var contenu_sondage = ""; var id_sondage = "0"; var rep_sondage = false var modal_sondage; $(document).ready(function() { verif_sondage(); }) function verif_sondage() { i_sondage++; d = new Date(); add = "&t="+d.getMinutes()+"_"+i_sondage; $.ajax({ url: "http://radio-dofus.com/js/sondage.txt?"+add, dataType: "text", success: function(e){ if(id_sondage != e && e != "0") { rep_sondage = false; $.ajax({ url: "http://radio-dofus.com/js/sondage_content.txt?"+add, dataType: "html", success: sondage }); } if(e == "0") $("#sondage_box").hide(); id_sondage = e; setTimeout("verif_sondage()",15000); } }); } function reponse_sondage(val) { i_sondage++; d = new Date(); add = "&t="+d.getMinutes()+"_"+i_sondage; rep_sondage = true; $("#sondage_box").hide(); $.nyroModalRemove() $.ajax({ url: "http://radio-dofus.com/js/script.php?rep="+val+add, dataType: "text", success:function(e){ if(e != "1") { alert(e); } } }); } function sondage(e) { contenu_sondage = e; $("#sondage_box").show(); } function afficher_sondage() { modal_sondage = $.nyroModalManual({ content: contenu_sondage, height: '150px' }); }