function getXMLHttpRequest(){var b=null;if(window.XMLHttpRequest||window.ActiveXObject){if(window.ActiveXObject){try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){b=new ActiveXObject("Microsoft.XMLHTTP")}}else{b=new XMLHttpRequest()}}else{alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");return null}return b}function dl(a,c){$.post("actions/dl.php",{gid:a,id:c},function b(d){window.location=d;$("#success-dl").fadeIn(300).delay(5000).fadeOut(500)})}function installMap(c,a){$.post("actions/installMap.php",{mid:a,hasGameId:c},function b(e){$("#dialog").dialog("destroy");var d=$("#dialog-base").html();$("#dialog").html('<div id="dialog-base">'+d+"</div>");$("#loader-dialog").html("");if(e.charAt(0)=="C"){$.scrollTo(0,400);$("#erreur-install-connect").fadeIn(300).delay(5000).fadeOut(500)}else{if(e.charAt(0)=="B"){$("#erreur-install").text(e);$.scrollTo(0,400);$("#erreur-install").fadeIn(300).delay(5000).fadeOut(500)}else{$("#dialog").dialog("close");$.scrollTo(0,400);$("#success-install").fadeIn(300).delay(5000).fadeOut(500)}}})}function serveurChoice(a,b){$("#loader").html('<img src="static/img/loader.gif" alt="" />');$.post("actions/serveurChoice.php",{mid:a,gid:b},function c(f){$("#loader").html("");if(f.charAt(0)=="C"){$("#erreur-install-connect").css("display","block")}else{if(f.charAt(0)=="B"){$("#erreur-install").text(f);$("#erreur-install").css("display","block")}else{var e=f.indexOf("#")+1;f=f.substring(e,f.length);var d=$("#dialog").html();$("#dialog").html(d+"<br />"+f);$("#dialog").dialog({width:500,beforeclose:function(h,i){$("#dialog").dialog("destroy");var g=$("#dialog-base").html();$("#dialog").html('<div id="dialog-base">'+g+"</div>")}});$("#serveurChoiceSubmit input").click(function(){var g;$("#serveurChoiceSelect option").each(function(){if($(this).attr("selected")){g=$(this).attr("value")}});$("#loader-dialog").html('<img src="static/img/loader-dialog.gif" alt="" />');$("#dialog #serveurChoiceSubmit input").attr("disabled","disabled");installMap(g,a)})}}})}function menu_develop(a){if($("#menu_develop").css("display")=="none"){$("#menu_develop").slideDown("slow",function(){});if(!($.browser.msie&&$.browser.version.substr(0,1)<7)){$("#menu_right #separation").css("display","block")}if(a=="game"){$("#menu_develop_game").css("display","block")}else{if(a=="top"){$("#menu_develop_top").css("display","block");getTop()}else{if(a=="commentaires"){$("#menu_develop_commentaires").css("display","block")}}}}else{$("#menu_develop").slideUp("slow",function(){});$("#menu_right").css("border-top","1px solid #999999");$("#menu_develop_game").slideUp("slow",function(){});$("#menu_develop_top").slideUp("slow",function(){});$("#menu_develop_commentaires").slideUp("slow",function(){})}}function getTop(){var b;var a;$("#menu_develop_top .top option").each(function(){if($(this).attr("selected")){b=$(this).attr("value")}});$("#menu_develop_top .game option").each(function(){if($(this).attr("selected")){a=$(this).attr("value")}});$.post("actions/getTop.php",{top:b,game:a},function c(d){$("#menu_develop_top ul").html(d)})}$(document).ready(function(){$("#menu_develop_top select").change(function(){getTop()});$("#language #fr").click(function(){$(this).submit()});$("#language #en").click(function(){$(this).submit()});$(".topOfPage").click(function(){$.scrollTo(0,800);return false});$(".message").fadeIn(300).delay(5000).fadeOut(500)});
