var cfUpdate; var montt; function displayCash(data) { document.getElementById("cfunds").innerHTML = '€' + formatNumber(data); cfUpdate = setTimeout('x_getCash(displayCash);', 15000); } function displayPage(data) { var a = data.split("\n"); var b = a[0].split('#'); var str, i, c = '', d = ''; if (b[0] == "0" && b[1] == "0") { if (document.getElementById('tgo')) { c = document.getElementById('tamt').value; d = document.getElementById('tdst').value; } str = drawTransferForm(); } else if (b[0] != "0") { str = drawTransferWait(b[0]); } else if (b[1] != "0") { str = drawTransferVacation(); } document.getElementById('transfer').innerHTML = str; if (b[0] == "0" && b[1] == "0") { document.getElementById('tamt').value = c; document.getElementById('tdst').value = d; } var pcnt = parseInt(b[2],10), fcnt = parseInt(b[3], 10); document.getElementById('pinc').innerHTML = '€' + formatNumber(b[4]); document.getElementById('fupk').innerHTML = '€' + formatNumber(b[5]); document.getElementById('dprof').innerHTML = formatNumber(b[6]); if (pcnt > 0) { str = drawPlanetTableHdr(); for (i=0;i' + '' + name + '€' + formatNumber(pdat[2]) + '' + formatNumber(pdat[7]) + '€' + formatNumber(pdat[3]) + '€' + formatNumber(pdat[4]) + '€' + formatNumber(pdat[5]) + '€' + formatNumber(tmp.toString()) + '€' + formatNumber(pdat[6]) + '€' + formatNumber(pdat[1]) + ''; } str += drawPlanetTableFtr(b[4]); } else str = drawNoPlanets(); document.getElementById('planets').innerHTML = str; if (fcnt > 0) { str = drawFleetTableHdr(); var nb = 1 + pcnt*2; for (i=0;i' + fname; str += '' + lname + '' + fdat[1]; str += '' + fdat[2] + ''; str += '€' + formatNumber(fdat[3]) + ''; } str += drawFleetTableFtr(b[5]); } else str = drawNoFleets(); document.getElementById('fleets').innerHTML = str; setTimeout('x_getCashDetails(displayPage)', 300000); } function transferOk(data) { if (data == '0') { if (cfUpdate) clearTimeout(cfUpdate); x_getCash(displayCash); updateHeader(); document.getElementById('tamt').value = ''; document.getElementById('tdst').value = ''; showTransferOk(); } else tfError(parseInt(data, 10)); document.getElementById('tgo').disabled = false; } function transferFunds() { var a, b; document.getElementById('tgo').disabled = true; a = parseInt(document.getElementById('tamt').value, 10); if (isNaN(a) || a <= 0) { tfError(1); document.getElementById('tgo').disabled = false; return; } b = document.getElementById('tdst').value; if (b == '') { tfError(2); document.getElementById('tgo').disabled = false; return; } if (!confirmTransfer(a, b)) { document.getElementById('tgo').disabled = false; return; } x_transferFunds(b, a, transferOk); }