function changeMenuItem(a){var b=a.src,c="";if(a.className=="inactive"){c=b.lastIndexOf("_active");if(c!=-1)c=b.substring(0,c)+".gif";else{c=b.lastIndexOf(".");c=b.substring(0,c)+"_active.gif"}a.src=c}}
function showBuildingTimeTooltip(a,b,c){if(c==0)html=document.getElementById("tooltipBuildingTime").innerHTML+" "+document.getElementById("tooltipBuildingTimeInf").innerHTML;else{var d=0;d=a-b;b=d/(c/3600);a=Math.floor(b/3600);c=b-a*3600;b=Math.floor(c/60);c=Math.floor(c-b*60);if(a<=0){neededtimeclock=" "+b+"m "+c+"s";if(b<=0)neededtimeclock=" "+c+"s"}else neededtimeclock=" "+a+"h "+b+"m "+c+"s";html=document.getElementById("tooltipBuildingTime").innerHTML+neededtimeclock}Tip(html)}
function togglePanel(a,b,c){var d=a.id,e=a.src,f=d.lastIndexOf(":");f=d.substring(0,f+1)+b;b=window.document.getElementById(f);f=e.lastIndexOf("/");if(b.style.display=="block"){b.style.display="none";a.src=c=="small"?e.substring(0,f+1)+"detailSmallClosed.gif":e.substring(0,f+1)+"detailClosed.gif"}else{b.style.display="block";a.src=c=="small"?e.substring(0,f+1)+"detailSmallOpen.gif":e.substring(0,f+1)+"detailOpen.gif"}}function clearIntField(a){if(a.value=="")a.value=0}
function remainingtime(a,b,c){for(var d=0,e=0;;e++)if(document.getElementById(a+":"+e+":"+c))d+=1;else break;d>0&&new remainingtimecalculate(a,b,c,d)}
function remainingtimecalculate(a,b,c,d){timezero=false;for(var e=0;e<d;e++){var f=a+":"+e+":"+b,h=document.getElementById(a+":"+e+":"+c),g=0;if(h)g=h.innerHTML;if(g>0){remainingtimeshow(g,f);g-=1;h.innerHTML=g;timezero=true}else if(f=document.getElementById(f))f.innerHTML="fertig"}timezero==true&&window.setTimeout("remainingtimecalculate('"+a+"', '"+b+"', '"+c+"', '"+d+"')",1E3)}
function remainingtimeshow(a,b){var c=Math.floor(a/86400);a-=c*24*3600;var d=Math.floor(a/3600);a-=d*3600;var e=Math.floor(a/60);a-=e*60;var f="";if(c>0)f=c+"d ";if(d>0)f+=d+"h ";if(e>0)f+=e+"m ";f+=a+"s";if(c=document.getElementById(b))c.innerHTML=f}function changePictureSimple(a,b){window.document.getElementById(a).src=b}function time(){var a=new Date,b=document.getElementById("currenttime").innerHTML;a=a.getTime();timecalculate(b-a)}
function timecalculate(a){var b=new Date((new Date).getTime()+a),c=b.getDate();if(c<10)c="0"+c;var d=b.getMonth()+1,e=b.getFullYear();if(d<10)d="0"+d;c=" "+c+"."+d+"."+e+"  ";d=b.getHours();e=b.getMinutes();b=b.getSeconds();if(d<10)d="0"+d;if(e<10)e="0"+e;if(b<10)b="0"+b;Time=c+(" "+d+":"+e+":"+b);document.getElementById("currenttime").innerHTML=Time;window.setTimeout("timecalculate("+a+")",1E3)}
function showNobilityBox(a){document.getElementById(a.id+"Box").style.display="block";document.getElementById("emptyBox").style.display="none";document.getElementById(a.id).style.color="#FFFFFF"}function hideNobilityBox(a){document.getElementById(a.id+"Box").style.display="none";document.getElementById("emptyBox").style.display="block";document.getElementById(a.id).style.color="#000000"}
function showNobilityInfo(a){document.getElementById(a.id+"Info").style.display="block";document.getElementById("emptyInfo").style.display="none";document.getElementById(a.id).style.color="#FFFFFF"}function hideNobilityInfo(a){document.getElementById(a.id+"Info").style.display="none";document.getElementById("emptyInfo").style.display="block";document.getElementById(a.id).style.color="#000000"}
function duelCounter(a){if(a<7){document.getElementById("duel"+a).style.display="block";a++;window.setTimeout("duelCounter("+a+")",2E3)}};

