var strload='<img src="/static/img/modules/ajax-loader.gif" alt="" style="margin:5px;" /> Chargement ...';function popup(a){if(a.length<3){return}$("#popup").css("height","530px").show();$("#enlarge").hide();document.getElementById("title").innerHTML="...";$("#popup_contenu").html(strload).load("core.php?url="+a+"&ajax=true",function(){document.getElementById("title").innerHTML=$("#popup-titre").text();global.etat.popup=true})}function bulleProfil(c){if(!c.evenement){e=window.event}else{e=c.evenement}var b=$("#profil");var a=document.documentElement.scrollTop||document.body.scrollTop;$("#profilView").html('<img src="/static/img/ajax-loader.gif" alt="loading..." style="margin:20px;" />');b.css("top",(a+e.clientY+9)+"px");b.css("left",(e.clientX-197)+"px");b.show("fast");$("#profilView").load("/ajax/bulle.ajax?beeid="+c.beeid)}function setHash(a){if(a!=undefined){window.location.hash="#"+a+"|"+player.x+","+player.y}else{window.location.hash="#|"+player.x+","+player.y}}var oAlert=alert;function alert(c,a){try{if(a==undefined){a=c;c="Rue du Fric"}jAlert(a,c)}catch(b){oAlert()}}var oConfirm=confirm;function confirm(d,a,b){try{jConfirm(a,d,b)}catch(c){if(oConfirm(a,d)){b()}}}$(function(){var a="";$("#navigation a").mouseover(function(){$(this).css("text-indent","inherit")}).mouseout(function(){$(this).css("text-indent","-1000em")});$("#actions-bonus a").mouseover(function(){$(this).css("text-indent","inherit")}).mouseout(function(){$(this).css("text-indent","-1000em")});if(!TemplateNotGame){$("#bloc_minimap").live("click",function(b){document.getElementById("popup_contenu").style.display="block"});$('body a[target!="_blank"]').live("click",function(i){try{var d=$(this);var f=d.attr("href");var h="";if(navigator.userAgent.indexOf("MSIE")!=-1){if(f.indexOf("http://")!=-1){lastSlash=f.indexOf("/",7);f=f.substr(lastSlash,f.length)}}if(d.hasClass("noajax")){h="noajax"}else{if(d.hasClass("popup")){h="popup"}else{h="ajax"}}var c=document.getElementById("bubble");if(c){c.style.display="none"}switch(h){case"ajax":var b=f.lastIndexOf(".html");if(b>0){var g=f.substr(0,b)}else{var g=f.substr(1)}a=g;$("#content").load("core.php?url="+g+"&ajax=true",function(){$("body").show();setHash(g)});break;case"popup":var b=f.lastIndexOf(".ajax");if(b>0){var g=f.substr(0,b)}else{var g=f.substr(1)}a=g;$("#popup").show().css("height","530px");$("#enlarge").hide();document.getElementById("title").innerHTML="...";$("#popup_contenu").html(strload).load("core.php?url="+g+"&ajax=true",function(){document.getElementById("title").innerHTML=$("#popup-titre").text();global.etat.popup=true;document.getElementById("popup_contenu").style.display="block";setHash(g);document.getElementById("bubble").style.display="none"});break;default:window.location=f}return false}catch(j){alert(j);return false}})}});var LANG_ALT_MAILOK="Email ok";var LANG_ALT_MAILWRONG="Email incorrect";var LANG_ALT_LOADING="Chargement ...";function verifEmail(a){if(a==""){return false}$.get("/membre/funcVerifEmail.ajax?email="+a,null,function(b){if(b=="ok"){$("#verifEmail").html('<img src="/static/img/modules/membre/ok.gif" />')}else{$("#verifEmail").html('<img src="/static/img/modules/membre/nok.gif" />')}})}function verifPseudo(a){$.get("/membre/funcVerifPseudo.ajax?pseudo="+a,null,function(b){if(b=="ok"){$("#verifPseudo").html('<img src="/static/img/modules/membre/ok.gif" />')}else{if(b=="nok"){$("#verifPseudo").html('<img src="/static/img/modules/membre/nok.gif" />')}else{$("#pseudo").attr("value",b);verifPseudo(b)}}})}function showhide(a){$("#"+a).slideToggle()}function verifPseudo(c,b){var a=$("#"+c);$.ajax({type:"GET",url:"/membre/funcVerifPseudo.ajax",data:{pseudo:b},success:function(d){switch(d){case"ok":a.removeClass().addClass("defaultInput");break;case"nok":a.removeClass().addClass("errorInput");break;default:a.removeClass().addClass("errorInput")}}})}$("#pseudo").focus(function(){this.removeClass().addClass("defaultInput")});function fb_connexion(){FB.ensureInit(function(){FB.Connect.requireSession(function(){window.location="/facebookConnect.html"})})}function fb_deconnexion(){FB.ensureInit(function(){FB.Connect.logoutAndRedirect("/membre/logout.html")
})}function fb_permission_inscription(){if($("#cgu:checked").val()==1){FB.ensureInit(function(){FB.Connect.showPermissionDialog("email,publish_stream,offline_access",function(a){$("#nouveauCompte").submit()})})}else{return false}}function fb_permission_synchronisation(){FB.ensureInit(function(){FB.Connect.showPermissionDialog("email,publish_stream,offline_access",function(a){$("#synchronisation").submit()})})}function stream_publish_inscription(){var b={name:"Rue Du Fric : jeu immobilier !",href:"http://blog.ruedufric.com",caption:"{*actor*} vient de s'inscrire à Rue du Fric",description:"Incarne un financier et deviens l'Homme le plus puissant de la ville à travers tes acquisitions : appartements, villas, hôtels, bureaux...",media:[{type:"image",src:"http://www.ruedufric.com/static/img/template/accueil/3.jpg",href:"http://www.ruedufric.com"}]};var a=[{text:"Jouer à Rue du Fric",href:"http://www.ruedufric.com"}];return FB.Connect.streamPublish("",b,a)}function LoadMembre(){$("#compte").tabs();$("#editProfil").submit(function(){var a=$(this).serialize();$.post("/ajax/membre.ajax",a,function(b){alert(b.txt)},"json");return false});$("#reglages-automatiques").hide();$("#reglages-personnalises").hide();$("#reglages-persos").submit(function(){var a=$(this).serialize();$.ajax({type:"POST",url:"/ajax/membre.ajax",data:a,success:function(){var d,c,b;if(document.getElementById("option_animation0").checked==true){d=0}if(document.getElementById("option_animation1").checked==true){d=1}if(document.getElementById("option_zoom0").checked==true){c=1}if(document.getElementById("option_zoom1").checked==true){c=1}if(document.getElementById("option_carte1").checked==true){b=1}if(document.getElementById("option_carte2").checked==true){b=2}if(document.getElementById("option_carte3").checked==true){b=3}options.effet=d;options.zoom=c;options.mode=b;options.zoom=(options.zoom)?1:0;options.effet=(options.effet)?1:0;if(options.effet==0){jQuery.fx.off=true}else{jQuery.fx.off=false}graphic.LoadDesign();InitEvent();alert("Réglages personnalisés sauvegardés !")}});return false});$("#wizard-low").click(function(){wizardLow()});$("#wizard-middle").click(function(){wizardNormal()});$("#wizard-high").click(function(){wizardHigh()});$("#statistiques #play").live("click",function(){$("#statistiques").empty();$("#statistiques").append("<ul></ul>");$("#statistiques").append('<button id="stop">Mettre en pause</button>');var c=new Date();var b=(c.getHours()<10)?"0"+c.getHours():c.getHours();var d=(c.getMinutes()<10)?"0"+c.getMinutes():c.getMinutes();var a=(c.getSeconds()<10)?"0"+c.getSeconds():c.getSeconds();$("#statistiques ul").append("<li>"+b+":"+d+":"+a+" &raquo; Lancement du test</li>");$("#statistiques ul").append('<li id="nbElements">'+b+":"+d+":"+a+" &raquo; Test en cours</li>");benchmark=new BenchMark();idLoop=setTimeout(ExecuterBenchmark(benchmark),100)});$("#statistiques #stop").live("click",function(){if(etatButton){$("#stop").html("Mettre en pause")}else{$("#stop").html("Reprendre")}etatButton=!etatButton;benchmark.Switch()})}function partirVacances(a){message="Voulez-vous vraiment partir en vacances ?<br/><br/>";message+="Il vous reste "+a+" jours de vacances. Une fois ces jours utilisés, votre compte passera automatiquement inactif !";message+="<br/><br/><strong>En validant ce message, toutes vos affaires et enchères en cours seront annulées. Vous serez déconnecté et renvoyé à l'accueil</strong>";confirm("Attention !",message,function(b){if(b==true){$.post("/ajax/membre.ajax",{action:"partirVacances"},function(){window.location.href="/accueil.html"})}})}function afficher(b,c){$("#gameOptions").children().each(function(){if($(this).attr("id")!=c&&$(this).css("display")=="block"&&$(this).attr("class")!="sousMenu"){$(this).slideUp("fast")}});var a=b.target;sousMenuNormal($("#current"));$("#current").attr("id","");$("#"+c).slideDown("fast",function(){$(a).parent().attr("id","current");sousMenuHover($("#current"))})}function sousMenuNormal(a){a.children().css({"background-position":"0 bottom"})}function sousMenuHover(a){a.children().css({"background-position":"0 top"})
}$(".sousMenu li a").hover(function(){sousMenuHover($(this).parent())},function(){if($(this).parent().attr("id")!="current"){sousMenuNormal($(this).parent())}});function wizardLow(){document.getElementById("option_animation0").checked=true;document.getElementById("option_zoom0").checked=true;document.getElementById("option_carte1").checked=true;global.options.mode=1;global.options.zoom=false;global.options.effet=false;global.options.zoom=(global.options.zoom)?1:0;global.options.effet=(global.options.effet)?1:0;if(global.options.effet==0){jQuery.fx.off=true}else{jQuery.fx.off=false}var a={action:"modifOptions",taille_carte:global.options.mode,zoom:global.options.zoom,animations:global.options.effet};$.post("/ajax/membre.ajax",a,function(b){});graphic.LoadDesign();InitEvent()}function wizardNormal(){document.getElementById("option_animation1").checked=true;document.getElementById("option_zoom0").checked=true;document.getElementById("option_carte2").checked=true;global.options.mode=2;global.options.zoom=false;global.options.effet=true;global.options.zoom=(global.options.zoom)?1:0;global.options.effet=(global.options.effets)?1:0;if(global.options.effet==0){jQuery.fx.off=true}else{jQuery.fx.off=false}var a={action:"modifOptions",taille_carte:global.options.mode,zoom:global.options.zoom,animations:global.options.effet};$.post("/ajax/membre.ajax",a,function(b){});graphic.LoadDesign();InitEvent()}function wizardHigh(){document.getElementById("option_animation1").checked=true;document.getElementById("option_zoom1").checked=true;document.getElementById("option_carte3").checked=true;global.options.mode=3;global.options.zoom=true;global.options.effet=true;global.options.zoom=(global.options.zoom)?1:0;global.options.effet=(global.options.effet)?1:0;if(global.options.effet==0){jQuery.fx.off=true}else{jQuery.fx.off=false}var a={action:"modifOptions",taille_carte:global.options.mode,zoom:global.options.zoom,animations:global.options.effet};$.post("/ajax/membre.ajax",a,function(b){});graphic.LoadDesign();InitEvent()}function resetCompte(){if(document.getElementById("compte_reset").checked==true){confirm("Recommencer le jeu : attention !","Recommencer le jeu à zéro ?",function(a){if(a==true){$.post("/ajax/membre.ajax",{action:"resetCompte"},function(b){sound.Play("confirm-ok");window.location="/membre/logout.html"})}else{sound.Play("confirm-nok")}})}else{alert("Tu dois cocher la case pour recommencer le jeu !")}}function deleteCompte(){if(document.getElementById("compte_delete").checked==true){confirm("Cloturer le compte : attention !","Cloturer définitivement le compte ?",function(a){if(a==true){$.post("/ajax/membre.ajax",{action:"deleteCompte"},function(b){sound.Play("confirm-ok");window.location="/membre/logout.html"})}else{sound.Play("confirm-nok")}})}else{alert("Tu dois cocher la case pour cloturer ton compte !")}}function BenchMark(){this.play=true;this.nbElement=10;this.fps=null;this.world=[];this.nbElement=$("#nbElements");this.blocFps=$("#fps");this.lastTime=new Date();this.last=null;this.last2=null;this.lastAjout=new Date();this.AjouterElement();this.moyenneFps=0;this.iteration=1}BenchMark.prototype.Lancer=function(){var a=new Date();this.iteration++;if(a-this.lastTime>10&&this.play){this.Animer();this.lastTime=a}if(a-this.lastAjout>50&&this.play){this.AjouterElement();this.Update();this.lastAjout=a}var b=(new Date()-a);this.last2=this.last;this.last=this.fps;this.fps=Math.ceil(1000/b);if(this.fps<50&&this.last<50&&this.last2<50){this.Terminer()}};BenchMark.prototype.AjouterElement=function(){var b={x:0,y:0};var c={x:Math.floor(Math.random()*575),y:Math.floor(Math.random()*400)};var a={x:Math.floor(Math.random()*11),y:Math.floor(Math.random()*11)};b.x=c.x;b.y=c.y;b.vx=a.x;b.vy=a.y;if(b.vx<1){b.vx=1}if(b.vy<1){b.vy=1}$("#cadre").append('<div id="e_'+(this.world.length-1)+'" class="entity" style="left : '+b.x+"px; top : "+b.y+'px;" ></div>');b.bloc=$("#e_"+(this.world.length-1));this.world.push(b)};BenchMark.prototype.Animer=function(){var b={x:0,y:0};for(var c=0;c<this.world.length;c++){var b=this.world[c];this.Collision(c);b.x+=b.vx;
b.y+=b.vy;var a=document.getElementById("e_"+(c-1));a.style.left=b.x+"px";a.style.top=b.y+"px"}};BenchMark.prototype.Collision=function(b){var a=this.world[b];if(a.x<10){a.x=10;a.vx=-a.vx}else{if(a.x>510){a.x=510;a.vx=-a.vx}else{if(a.y<30){a.y=30;a.vy=-a.vy}else{if(a.y>410){a.y=410;a.vy=-a.vy}}}}};BenchMark.prototype.Update=function(){var c=new Date();var b=(c.getHours()<10)?"0"+c.getHours():c.getHours();var d=(c.getMinutes()<10)?"0"+c.getMinutes():c.getMinutes();var a=(c.getSeconds()<10)?"0"+c.getSeconds():c.getSeconds();this.nbElement.html(b+":"+d+":"+a+" &raquo; Test en cours")};BenchMark.prototype.Switch=function(){this.play=!this.play};BenchMark.prototype.Terminer=function(){this.Switch();var g=this.world.length;var f="Nous vous recommandons le réglage prédéfini ";if(g<100){f+='"faible"<br/><a href="#" onclick="wizardLow();" class="noajax">Appliquer ce réglage</a>'}else{if(g>100&&g<200){f+='"normal"<br/><a href="#" onclick="wizardNormal();" class="noajax">Appliquer ce réglage</a>'}else{f+='"Ã©levÃ©"<br/><a href="#" onclick="wizardHigh();" class="noajax">Appliquer ce réglage</a>'}}var c=new Date();var b=(c.getHours()<10)?"0"+c.getHours():c.getHours();var d=(c.getMinutes()<10)?"0"+c.getMinutes():c.getMinutes();var a=(c.getSeconds()<10)?"0"+c.getSeconds():c.getSeconds();$("#statistiques ul").append("<li>"+b+":"+d+":"+a+" &raquo; Fin du test</li>");$("#statistiques").append("<h3>"+f+"</h3>");$("#play").hide();$("#stop").hide()};var idLoop=null;var etatButton=false;function ExecuterBenchmark(a){return function(){a.Lancer();setTimeout(ExecuterBenchmark(a),10)}}var LANG_ALT_MAILOK="Email ok";var LANG_ALT_MAILWRONG="Email incorrect";var LANG_ALT_LOADING="Chargement ...";function verifEmail(a){if(a==""){return false}$.get("/membre/funcVerifEmail.ajax?email="+a,null,function(b){if(b=="ok"){$("#verifEmail").html('<img src="/static/img/modules/membre/ok.gif" />')}else{$("#verifEmail").html('<img src="/static/img/modules/membre/nok.gif" />')}})}function verifPseudo(a){$.get("/membre/funcVerifPseudo.ajax?pseudo="+a,null,function(b){if(b=="ok"){$("#verifPseudo").html('<img src="/static/img/modules/membre/ok.gif" />')}else{if(b=="nok"){$("#verifPseudo").html('<img src="/static/img/modules/membre/nok.gif" />')}else{$("#pseudo").attr("value",b);verifPseudo(b)}}})}function addFriend(a){$.ajax({type:"POST",url:"/ajax/profil.ajax",data:{addFriend:true,idFriend:a},success:function(b){switch(b){case"ok":alert("Ta demande a bien &eacute;t&eacute; &eacute;ffectu&eacute;e.<br/>");$("#addFriendLink").html("<span>Demande d'ami en attente...</span>");break;case"no":alert("Une erreur s'est produite.<br/>R&eacute;essayes plus tard. Merci.");break;case"already":alert("Tu es d&eacute;j&agrave; amis avec ce joueur.");break;default:alert("Une erreur s'est produite.<br/>R&eacute;essayes plus tard. Merci.");break}}})}function showFaq(){$("#formFaq").show();$("#faqAjax").html('<a href="javascript:;" onclick="hideFaq();">Masquer la question</a>')}function hideFaq(){$("#formFaq").hide();$("#faqAjax").html('<a href="javascript:;" onclick="showFaq();">Ajouter une question</a>')}function LoadFaq(){$("#formulaireFaq").submit(function(){var a=$(this).serialize();$("#faqAjax").html('<img src="/static/img/modules/ajax-loader.gif" />').load("/ajax/faq.ajax",{fields:a});setTimeout("window.location.href= '/faq.html'",2000);return false})}function updateFaq(a){$.ajax({type:"POST",url:"/ajax/faq.ajax",data:"updateId="+a,dataType:"json",success:function(b){showFaq();$("#questionFaq").val(b.question);$("#reponseFaq").val(b.reponse);$("#faqId").val(b.faqId)}});return false}function deleteFaq(a){confirm("Supprimer de la Faq ?","Supprimer cette question / réponse de la Faq ?",function(b){if(b==true){$("#faqAjax").html('<img src="/static/img/modules/ajax-loader.gif" />').load("/ajax/faq.ajax",{faqId:a,deleteFaq:"on"});setTimeout("window.location.href= '/faq.html'",2000)}})}var isIe=
/*@cc_on!@*/
false;var isChrome=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;function addFav(){if(isChrome){alert("Cliquez sur l'étoile en haut à gauche de l'adresse internet")}else{if(!isIe){alert(window.sidebar.addPanel(document.title,location.href,""))
}else{window.external.AddFavorite(location.href,document.title)}}};