
function DownloadDofus(sType)
{
  if (typeof(pageTracker) != "undefined")
    pageTracker._trackPageview(window.location.pathname.substr(0,3) + "/download/full/" + sType);
}
function BrazilCommunity(){YAHOO.util.Dom.addClass("sb-container","shadowBrazil");Shadowbox.open({content:YAHOO.util.Dom.get("brazil_html").innerHTML,player:"html",height:400,width:604,options:{animate:false,displayNav:false,enableKeys:false,onClose:function(){YAHOO.util.Dom.removeClass("sb-container","shadowBrazil")}}})}function SelectGame(){if(YAHOO.util.Dom.get("select_game").className=="open"){YAHOO.util.Dom.get("select_game").className="open"}else{YAHOO.util.Event.addListener(document,"click",QJAction)}}function QJAction(a){if(YAHOO.util.Dom.get("select_game").className=="open"){YAHOO.util.Dom.get("select_game").className="close";YAHOO.util.Dom.removeClass((YAHOO.util.Dom.get("btn_game")),"active");YAHOO.util.Event.removeListener(document,"click",QJAction)}else{YAHOO.util.Dom.get("select_game").className="open";YAHOO.util.Dom.addClass((YAHOO.util.Dom.get("btn_game")),"active")}}function SelectLang(){if(YAHOO.util.Dom.get("select_lang").className=="open"){YAHOO.util.Dom.get("select_lang").className="open"}else{YAHOO.util.Event.addListener(document,"click",QJActionLang)}}function QJActionLang(a){if(YAHOO.util.Dom.get("select_lang").className=="open"){YAHOO.util.Dom.removeClass((YAHOO.util.Dom.get("btn_lang")),"active");YAHOO.util.Dom.get("select_lang").className="close";YAHOO.util.Event.removeListener(document,"click",QJActionLang)}else{YAHOO.util.Dom.get("select_lang").className="open";YAHOO.util.Dom.addClass((YAHOO.util.Dom.get("btn_lang")),"active")}}function SeeNews(c,b,a){if(document.getElementById(b+"_"+c).style.display=="none"||document.getElementById(b+"_"+c).style.display==""){document.getElementById(b+"_"+c).style.display="block";YAHOO.util.Dom.addClass(document.getElementById(b+"_"+c).parentNode,"news_active")}else{document.getElementById(b+"_"+c).style.display="none";YAHOO.util.Dom.removeClass(document.getElementById(b+"_"+c).parentNode,"news_active")}}function getPreviousNode(a){var b=null;if(a.previousSibling){b=a;do{b=b.previousSibling}while(b.nodeType!==1&&b.previousSibling)}return(b.nodeType===1)?b:null}function GetNewsPage(b,a){oAjax=new Ajax();oAjax.AddParameter("page",b);oAjax.AddParameter("lang",a);oAjax.Get("/requests/tools_news",function(c){YAHOO.util.Dom.get("news").innerHTML=c[0]})}function getNextNode(a){var b=null;if(a.nextSibling){b=a;do{b=b.nextSibling}while(b.nodeType!==1&&b.nextSibling)}return(b.nodeType===1)?b:null}function ShowMenu(a){var b=getNextNode(a);if(YAHOO.util.Dom.hasClass(b,"none")){YAHOO.util.Dom.removeClass(b,"none");YAHOO.util.Dom.addClass(b,"block")}else{YAHOO.util.Dom.removeClass(b,"block");YAHOO.util.Dom.addClass(b,"none")}}function ChooseService(a){aDivService=YAHOO.util.Dom.getElementsByClassName("service_choose","div");for(i=0;i<aDivService.length;i++){aDivService[i].style.display="none"}YAHOO.util.Dom.get("service_"+a).style.display=""}function ShowCarac(b){var a=b;var c=getNextNode(b);var d=b.parentNode;d=getNextNode(d);d=getNextNode(d);if(YAHOO.util.Dom.hasClass(c,"none")){YAHOO.util.Dom.removeClass(a,"block");YAHOO.util.Dom.addClass(a,"none");YAHOO.util.Dom.removeClass(c,"none");YAHOO.util.Dom.addClass(c,"block")}if(YAHOO.util.Dom.hasClass(d,"none")){YAHOO.util.Dom.removeClass(d,"none");YAHOO.util.Dom.addClass(d,"block")}else{YAHOO.util.Dom.removeClass(d,"block");YAHOO.util.Dom.addClass(d,"none")}}function HideCarac(b){var a=b;var c=getPreviousNode(b);var d=b.parentNode;d=getNextNode(d);d=getNextNode(d);if(YAHOO.util.Dom.hasClass(c,"none")){YAHOO.util.Dom.removeClass(a,"block");YAHOO.util.Dom.addClass(a,"none");YAHOO.util.Dom.removeClass(c,"none");YAHOO.util.Dom.addClass(c,"block")}if(YAHOO.util.Dom.hasClass(d,"block")){YAHOO.util.Dom.removeClass(d,"block");YAHOO.util.Dom.addClass(d,"none")}}var sVersionKeep="";function SwitchDownload(c,b){if(b=="dofus_2_0"){c="windows"}var a=YAHOO.util.Dom.get("download");if(typeof(b)!="undefined"){sVersionKeep=b}if(a&&c){switch(c){case"mac":a.href="http://download.dofus.com/full/mac/";break;case"linux":a.href="http://download.dofus.com/full/linux/";break;case"zip":a.href="http://download.dofus.com/full/zip/";break;default:a.href="http://download.dofus.com/full/win/";break}aDiv=YAHOO.util.Dom.getElementsByClassName("choix_support","div");for(i in aDiv){if(typeof(aDiv[i].style)!="undefined"){if(aDiv[i].id=="support_"+c){aDiv[i].style.display="none"}else{aDiv[i].style.display=""}}}aImg=YAHOO.util.Dom.getElementsByClassName("icone_support","span");for(i in aImg){if(typeof(aImg[i].style)!="undefined"){if(aImg[i].id=="icone_"+c){aImg[i].style.display=""}else{aImg[i].style.display="none"}}}}if(sVersionKeep){a.className=sVersionKeep=="dofus_2_0"?"dofus_2_0":"dofus_1_29";YAHOO.util.Dom.removeClass(YAHOO.util.Dom.get("page_type"),sVersionKeep=="dofus_2_0"?"dl_dofus_1_29":"dl_dofus_2_0");YAHOO.util.Dom.addClass(YAHOO.util.Dom.get("page_type"),sVersionKeep=="dofus_2_0"?"dl_dofus_2_0":"dl_dofus_1_29");if(sVersionKeep=="dofus_2_0"){a.href=a.href.replace("/1_29/","/")}else{a.href=a.href.replace("download.dofus.com/","download.dofus.com/1_29/")}YAHOO.util.Dom.get("download_dofus_2_0").style.display=sVersionKeep=="dofus_2_0"?"none":"block";YAHOO.util.Dom.get("download_dofus_1_29").style.display=sVersionKeep=="dofus_2_0"?"block":"none"}}function LoadScreen(iScreenId){oAjax=new Ajax();oAjax.AddParameter("iscreenshot",iScreenId);oAjax.SetLoadingId("screen_loading");YAHOO.util.Dom.get("screen_loading").style.height=YAHOO.util.Dom.get("screen_loading").parentNode.offsetHeight+"px";YAHOO.util.Dom.get("screen_loading").style.width=YAHOO.util.Dom.get("screen_loading").parentNode.offsetWidth-4+"px";oAjax.Get("/requests/discover_screenshot",function(aReturn){YAHOO.util.Dom.get("screen_content").innerHTML=aReturn[0];if(typeof(aReturn[1])!="undefined"){eval(aReturn[1])}})}function LoadDescSpell(c,b,a){oAjax=new Ajax();oAjax.AddParameter("s",b);oAjax.AddParameter("c",c);if(typeof(a)!="undefined"){oAjax.AddParameter("spelllevel",a)}oAjax.SetLoadingId("spells_loading");YAHOO.util.Dom.get("spells_loading").style.height=YAHOO.util.Dom.get("spells_loading").parentNode.offsetHeight+"px";YAHOO.util.Dom.get("spells_loading").style.width=YAHOO.util.Dom.get("spells_loading").parentNode.offsetWidth-4+"px";oAjax.Get("/requests/encyclopedia_spell",function(d){YAHOO.util.Dom.get("spells").innerHTML=d[0];YAHOO.util.Dom.get("anchor_tweak").focus()})}function popupcenter(n,l,m,k,j){var o=Math.round(screen.availWidth/2-m/2);var h=Math.round(screen.availHeight/2-k/2);window.open(n,"","top="+h+",left="+o+",resizable=no,scrollbars="+(j?"yes":"no")+",width="+m+",height="+k)}function ChangeIllu(b){var b=b;var a=document.getElementById("illustration_classes");if(YAHOO.util.Dom.hasClass(a,"illu1_"+b+"_female")){YAHOO.util.Dom.removeClass(a,"illu1_"+b+"_female");YAHOO.util.Dom.addClass(a,"illu1_"+b+"_mal")}else{YAHOO.util.Dom.removeClass(a,"illu1_"+b+"_mal");YAHOO.util.Dom.addClass(a,"illu1_"+b+"_female")}}var Polls={Vote:function(b,a){oAjax=new Ajax();oAjax.SetForm("pollsform_"+b);if(typeof(a)=="undefined"){a=0}oAjax.AddParameter("home",a);oAjax.SetReturn("text");oAjax.Get("/requests/polls_vote",function(c){if(c.length>30){YAHOO.util.Dom.get("polls_"+b).innerHTML=c}})}};function ShowConnect(){YAHOO.util.Dom.addClass("sb-container","shadowLogin");Shadowbox.open({content:YAHOO.util.Dom.get("connect_html").innerHTML,player:"html",height:340,width:452,options:{animate:false,displayNav:false,enableKeys:false,onClose:function(){YAHOO.util.Dom.removeClass("sb-container","shadowLogin")}}})}function ShowConnectAlone(){YAHOO.util.Dom.get("connect").style.textAlign="center";YAHOO.util.Dom.get("connect").style.marginTop=(screen.height/2)-200+"px";if(document.getElementById("connect").style.display=="none"){document.getElementById("connect").style.display="block"}else{document.getElementById("connect").style.display="none"}}function transition(c){if(c!=iCurrentPictureIndex){YAHOO.util.Dom.setStyle(aServicesPictures[c],"display","block");var b=new YAHOO.util.Anim(aServicesPictures[iCurrentPictureIndex],{opacity:{to:0}},0.5,YAHOO.util.Easing.easeBoth);var a=new YAHOO.util.Anim(aServicesPictures[c],{opacity:{to:1}},0.5,YAHOO.util.Easing.easeBoth);b.onStart.subscribe(function(){YAHOO.util.Dom.setStyle("right_services_links","display","none")});a.onComplete.subscribe(function(){YAHOO.util.Dom.setStyle(aServicesPictures[iCurrentPictureIndex],"display","none");iCurrentPictureIndex=c;YAHOO.util.Dom.setStyle("right_services_links","display","block")});b.animate();a.animate()}}function autoTransition(){clearTimeout(oTimer);var a=(iCurrentPictureIndex+1)%aServicesPictures.length;transition(a);oTimer=setTimeout("autoTransition()",5000)}var aServicesPictures=YAHOO.util.Dom.getElementsByClassName("pictures","div","right_services");var iCurrentPictureIndex=0;for(i=1;i<aServicesPictures.length;i++){YAHOO.util.Dom.setStyle(aServicesPictures[i],"opacity",0);YAHOO.util.Dom.setStyle(aServicesPictures[i],"display","none")}var oTimer=setTimeout("autoTransition()",5000);var top;function nav_twitter(b){if(document.getElementById("twitters").innerHTML==""){return}var a=YAHOO.util.Selector.query("#twitters ul");if(a[0].style.top==""){a[0].style.top="0px"}switch(b){case"<":if(parseInt(a[0].offsetHeight-107)>Math.abs(parseInt(a[0].style.top.substr(0,a[0].style.top.length-2)))){top=parseInt(a[0].style.top.substr(0,a[0].style.top.length-2)-107);a[0].style.top=top+"px"}break;case">":if(parseInt(a[0].style.top.substr(0,a[0].style.top.length-2))<0){top=parseInt(parseInt(a[0].style.top.substr(0,a[0].style.top.length-2))+107);a[0].style.top=top+"px"}break}}YAHOO.util.Event.onDOMReady(function(){if(typeof(Ankama.Ads)!="undefined"){Ankama.Ads.Vars({lang:window.location.pathname.substr(1,2)});Ankama.Ads.DomReady(false)}if(YAHOO.util.Dom.get("header_banner")&&typeof(Ankama.Ads)!="undefined"){Ankama.Ads.Zone(312,"header_banner")}if(YAHOO.util.Dom.get("ads_skyscrapper")&&typeof(Ankama.Ads)!="undefined"){Ankama.Ads.Zone(313,"ads_skyscrapper")}if(typeof(Ankama.Ads)!="undefined"){Ankama.Ads.Call()}});YAHOO.util.Event.onDOMReady(function(){if(typeof(Shadowbox)!="undefined"){YAHOO.util.Event.addListener("sb-body-inner","click",function(b){if(this&&this.childNodes&&this.childElementCount==1&&this.children[0].tagName=="IMG"){Shadowbox.next()}})}var a=YAHOO.util.Selector.query("a.screenshoots");if(a.length>0){YAHOO.util.Event.addListener(a,"click",function(b){YAHOO.util.Dom.setStyle("sb-body-inner","cursor","pointer");var c=function(d){YAHOO.util.Dom.setStyle("sb-body-inner","cursor","");YAHOO.util.Event.removeListener("sb-overlay","click",c);YAHOO.util.Event.removeListener("sb-nav-close","click",c)};YAHOO.util.Event.addListener("sb-overlay","click",c);YAHOO.util.Event.addListener("sb-nav-close","click",c)})}});function ActivateCodeSilver(a){oAjax=new Ajax();oAjax.AddParameter("code",YAHOO.util.Dom.get("code_silver").value);oAjax.Get("/requests/code_silver",function(b){if(b&&b[0]==1){YAHOO.util.Dom.get("err_code_silver").innerHTML="";Shadowbox.open({content:b[1],player:"img",height:341,width:500,options:{modal:true,animate:true,displayNav:true,enableKeys:false}})}else{if(b&&b[0]==2){ShowConnect()}else{YAHOO.util.Dom.get("err_code_silver").innerHTML=b[1]}}})}function ShowAlertPopup(a){YAHOO.util.Dom.addClass("sb-container");Shadowbox.open({content:YAHOO.util.Dom.get(a).innerHTML,player:"html",height:70,width:452,options:{animate:false,displayNav:false,enableKeys:false,onClose:function(){YAHOO.util.Dom.removeClass("sb-container")}}})};