function ipuIsIE50(){return ipuIsIE5()&&!ipuIsIE55()}function ipuIsIE55(){return navigator.userAgent.indexOf("MSIE 5.5")>-1}function ipuIsIE5(){return navigator.userAgent.indexOf("MSIE 5")>-1}function ipuIsIE6(){return navigator.userAgent.indexOf("MSIE 6")>-1&&navigator.userAgent.indexOf("Opera")==-1}function ipuIsIE7(){return navigator.userAgent.indexOf("MSIE 7")>-1&&navigator.userAgent.indexOf("Opera")==-1}function ipuIsIE_x(){return navigator.userAgent.indexOf("MSIE")>-1&&navigator.userAgent.indexOf("Opera")==-1}function ipuIsIE(){return ipuIsIE5()||ipuIsIE6()||ipuIsIE7()||ipuIsIE_x()}function ipuIsOpera(){return navigator.userAgent.indexOf("Opera")>-1}function ipuIsSafari(){return navigator.userAgent.indexOf("Safari")>-1}function ipuGetPageMode(){if(document.compatMode){switch(document.compatMode){case"BackCompat":return 0;case"CSS1Compat":return 1;case"QuirksMode":return 0}}else{if(ipuIE5){return 0}if(ipuSafari){return 1}}return 0}var ipuMouseX=1;var ipuMouseY=1;function ipuMousePos(a){if(!a){var a=window.event}ipuMouseX=0;ipuMouseY=0;if(a.pageX||a.pageY){ipuMouseX=a.pageX;ipuMouseY=a.pageY}else{if(a.clientX||a.clientY){ipuMouseX=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;ipuMouseY=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}}}var ie=document.all;var nn6=document.getElementById&&!document.all;var ipuDragging=false;var ipuDraggedDiv;var ipuCurrX=0;var ipuCurrY=0;function ipuGetScrollLeft(){switch(ipuPageMode){case 0:return document.body.scrollLeft;case 1:if(document.documentElement&&document.documentElement.scrollLeft>0){return document.documentElement.scrollLeft}else{return document.body.scrollLeft}}}function ipuGetScrollTop(){switch(ipuPageMode){case 0:return document.body.scrollTop;case 1:if(document.documentElement&&document.documentElement.scrollTop>0){return document.documentElement.scrollTop}else{return document.body.scrollTop}}}function ipuGetClientHeight(){switch(ipuPageMode){case 0:return document.body.clientHeight;case 1:if(ipuSafari){return self.innerHeight}else{if(!ipuOpera&&document.documentElement&&document.documentElement.clientHeight>0){return document.documentElement.clientHeight}else{return document.body.clientHeight}}}}function ipuGetClientWidth(){switch(ipuPageMode){case 0:return document.body.clientWidth;case 1:if(ipuSafari){return self.innerWidth}else{if(!ipuOpera&&document.documentElement&&document.documentElement.clientWidth>0){return document.documentElement.clientWidth}else{return document.body.clientWidth}}}}function saveClick(a){if(a.layerX&&a.layerX>0){ipuClickedX=a.layerX;ipuClickedY=a.layerY}else{ipuClickedX=this.window.event.offsetX;ipuClickedY=this.window.event.offsetY}if(ipuClickedX<1){ipuClickedX=1}if(ipuClickedY<1){ipuClickedY=1}}function explain_wp(b){var a="/cgi-bin/cgiw?wp_explain";if(b){a+="&miCountryNumber="+b}puShow(a)}function buy_country(b){var a="/cgi-bin/cgiw?buyCountry";if(b){a+="&miCountryNumber="+b}puShow(a)}function glc(b){var a="/cgi-bin/cgiw?glc&miCountryNumber="+b;puShowXL(a)}function gl2c(b){var a="/cgi-bin/cgiw?gl2c&miCountryNumber="+b;this.document.location.replace(a)}function gle(a){var b="/cgi-bin/cgiw?gle&miEnterpriseNumber="+a;puShowXL(b)}function counterAttackMessage(){var a="/cgi-bin/cgiw?warSelectCounter";puShow(a)}function unitAttackMessage(c,b){var a="/cgi-bin/cgiw?warSelectUnit&miDefender="+c+"&miTargetId="+b;puShowAttack(a)}function cntrAttackMessage(b,a){return unitAttackMessage(b,a)}function gl2e(a){var b="/cgi-bin/cgiw?gl2e&miEnterpriseNumber="+a;this.document.location.replace(b)}function tgPopup(c,b){var a="/cgi-bin/cgiw?jxExplainObject&miCountryNumber="+c+"&miTargetId="+b;ipuAjaxShow(a)}function portalMessage(b){var a="/cgi-bin/cgip?mPopup&miIndex="+b;puPortalShow(a)}function portalGameLevels(b){var a="/cgi-bin/cgip?jxExplainGameLevel&miKey="+b;puPortalShow(a)}function pmPopup(b){var a="/cgi-bin/cgiw?pmPopup&miIndex="+b;puShow(a)}function cmPopup(b){var a="/cgi-bin/cgiw?cmPopup&miIndex="+b;puShow(a)}function cobjPopup(b){var a="/cgi-bin/cgiw?cmPopup&miIndex="+b;puShow(a)}function portalDocument(b,c){var a="/cgi-bin/cgid?"+b;if(c!=null&&c!=""){a+="&miDocument="+c}puShow(a)}function extendcredit(a,c,d){var b="/cgi-bin/cgip?extendcredit&miWorldNumber="+a+"&miKey="+c+"&miEID="+d;puShow(b)}function portalFunction(c){var a=window.top;var b="/cgi-bin/cgip?"+c;if(a==null){alert("no main window?");return}a.location.replace(b)}function puShow(c){var f=ipuGetScrollLeft();var e=ipuGetScrollTop();var b=this.document.getElementById("ipop_h");var a=this.document.getElementById("ipop_contents");var d=this.document.getElementById("ipop_box");if(!d||!a){return}a.innerHTML='<iframe style="border:solid black 0px;" frameborder="0" width="600" height="320" border="0" src="'+c+'">';d.style.left=(f+210)+"px";d.style.top=(e+120)+"px";d.style.visibility="visible";if(b){b.onmousedown=ipuDragWindow}else{ipuDebug("?")}}function puShowXL(a){var d=ipuGetScrollLeft();var c=ipuGetScrollTop();var e=210;var h=70;var b=80;var g=70;var f=this.document.getElementById("ipop_h");var k=this.document.getElementById("ipop_contents");var j=this.document.getElementById("ipop_box");if(!j||!k){return}var i=simcViewportSize();k.innerHTML='<iframe style="border:solid black 0px;" frameborder="0" width="'+(i[0]-e-h)+'" height="'+(i[1]-b-g)+'" border="0" src="'+a+'">';j.style.left=(d+e)+"px";j.style.top=(c+b)+"px";j.style.visibility="visible";if(f){f.onmousedown=ipuDragWindow}else{ipuDebug("?")}}function puShowAttack(c){var f=ipuGetScrollLeft();var e=ipuGetScrollTop();var b=this.document.getElementById("ipop_h");var a=this.document.getElementById("ipop_contents");var d=this.document.getElementById("ipop_box");if(!d||!a){return}a.innerHTML='<iframe style="border: none;" frameborder="0" width="790" height="500" border="0" src="'+c+'">';d.style.left=(f+210)+"px";d.style.top=(e+120)+"px";d.style.visibility="visible";if(b){b.onmousedown=ipuDragWindow}else{ipuDebug("?")}}function puPortalShow(c){var f=ipuGetScrollLeft();var e=ipuGetScrollTop();var b=this.document.getElementById("ipop_h");var a=this.document.getElementById("ipop_contents");var d=this.document.getElementById("ipop_box");if(!d||!a){return}a.innerHTML='<iframe style="border: none;" frameborder="0" width="600" height="320" border="0" src="'+c+'">';d.style.left=(f+210)+"px";d.style.top=(e+120)+"px";d.style.visibility="visible";if(b){b.onmousedown=ipuDragWindow}else{ipuDebug("?")}}function ipuAjaxShow(c){var f=ipuGetScrollLeft();var e=ipuGetScrollTop();var b=this.document.getElementById("ipop_h");var a=this.document.getElementById("ipop_contents");var d=this.document.getElementById("ipop_box");if(!d||!a){return}ipuDebug("href="+c);jxGetWindowContents(c);d.style.left=(f+210)+"px";d.style.top=(e+120)+"px";d.style.visibility="visible";if(b){b.onmousedown=ipuDragWindow}else{ipuDebug("?")}}function ipuDragWindow(b){var c=nn6?b.target:event.srcElement;var a=nn6?"HTML":"BODY";ipuDebug("dragWindow()");while(c.tagName!=a&&c.className!="gxpop_box"&&c.className!="wxpop_box"&&c.className!="ipop_box"){c=nn6?c.parentNode:c.parentElement}if(c.tagName==a){alert("oops");return true}ipuDraggedDiv=c;ipuDragging=true;tx=parseInt(ipuDraggedDiv.style.left);ty=parseInt(ipuDraggedDiv.style.top);ipuMousePos(b);ipuCurrX=ipuMouseX;ipuCurrY=ipuMouseY;ipuDebug("1.txy=("+tx+","+ty+")");ipuDebug("1.curr=("+ipuCurrX+","+ipuCurrY+")");ipuDebug("1.ipuMouse=("+ipuMouseX+","+ipuMouseY+")");document.onmousemove=ipuMoveWindow;document.onmouseup=ipuReleaseWindow;return false}function ipuMoveWindow(a){if(!ipuDragging){return false}if(!ipuDraggedDiv){ipuDebug("drag what?")}if(ipuDragging&&ipuDraggedDiv){ipuMousePos(a);ipuDraggedDiv.style.left=tx+ipuMouseX-ipuCurrX;ipuDraggedDiv.style.top=ty+ipuMouseY-ipuCurrY}return false}function ipuReleaseWindow(a){if(ipuDragging){document.onmousemove=null;document.onmouseup=null;ipuDragging=false}}function puclose1(b){var c=b.document.getElementById("ipop_box");var a=b.document.getElementById("ipop_contents");if(!c||!a){alert("oops");return}c.style.visibility="hidden";a.innerHTML="&nbsp;"}function puclose(){puclose1(this)}function puclose2(){puclose1(this.parent)}var ipuPageMode=ipuGetPageMode();var ipuIE50=ipuIsIE50();var ipuIE55=ipuIsIE55();var ipuIE5=ipuIsIE5();var ipuIE6=ipuIsIE6();var ipuIE7=ipuIsIE7();var ipuIE_x=ipuIsIE_x();var ipuIE=ipuIsIE();var ipuOpera=ipuIsOpera();var ipuSafari=ipuIsSafari();var ipuClickedX=1;var ipuClickedY=1;var ipuXmlHttp=null;function ipuSetXmlHttp(){try{ipuXmlHttp=new XMLHttpRequest()}catch(a){try{ipuXmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{ipuXmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){alert("Your browser does not support AJAX!");ipuXmlHttp=null;return false}}}return true}function jxGetWindowContents(a){ipuSetXmlHttp();if(ipuXmlHttp==null){return}ipuXmlHttp.onreadystatechange=function(){if(ipuXmlHttp.readyState==4){if(ipuXmlHttp.status==200){jxGotWindowContents(ipuXmlHttp.responseText)}else{alert("AJAX: ERR response = "+ipuXmlHttp.responseText)}}};ipuXmlHttp.open("POST",a,true);ipuXmlHttp.send(null)}function jxRenameTarget(a){var b=this.document.forms[a];var c;if(!b){ipuDebug("no form");return true}countryNumber=b.elements.miCountryNumber.value;targetId=b.elements.miTargetId.value;targetName=b.elements.miTargetName.value;if(!countryNumber||!targetId||!targetName){ipuDebug("no target");return true}c="cgiw?jxExplainObject&miActionAccept=1&miCountryNumber="+countryNumber+"&miTargetId="+targetId+"&miTargetName="+targetName;ipuSetXmlHttp();if(ipuXmlHttp==null){return}ipuXmlHttp.onreadystatechange=function(){if(ipuXmlHttp.readyState==4){if(ipuXmlHttp.status==200){jxGotWindowContents(ipuXmlHttp.responseText)}else{alert("AJAX: ERR response = "+ipuXmlHttp.responseText)}}};ipuXmlHttp.open("POST",c,true);ipuXmlHttp.send(null);return true}function jxRadarPlane(a){var b=this.document.forms[a];var c;if(!b){ipuDebug("no form");return true}countryNumber=b.elements.miCountryNumber.value;targetId=b.elements.miTargetId.value;planeCount=b.elements.miQuantity.value;if(!countryNumber||!targetId||!planeCount){ipuDebug("no target");return true}c="cgiw?jxExplainObject&miActionSend=1&miCountryNumber="+countryNumber+"&miTargetId="+targetId+"&miQuantity="+planeCount;ipuSetXmlHttp();if(ipuXmlHttp==null){return}ipuXmlHttp.onreadystatechange=function(){if(ipuXmlHttp.readyState==4){if(ipuXmlHttp.status==200){jxGotWindowContents(ipuXmlHttp.responseText)}else{alert("AJAX: ERR response = "+ipuXmlHttp.responseText)}}};ipuXmlHttp.open("POST",c,true);ipuXmlHttp.send(null);return true}function jxGotWindowContents(b){var c=this.document.getElementById("ipop_box");var a=this.document.getElementById("ipop_contents");a.innerHTML=b;c.style.visibility="visible"}function ipuDeployGarrison(b){var a="cgiw?wargudeploy&miResource="+b;this.document.location=a}function ipuDebug(b){return false;var a=document.getElementById("deb");if(!b){return}if(!a){alert(b);return}a.innerHTML+="<br>"+b};