var vacation = true; var qbMode = false; var useCTTB = false; var action = 0; var milLevel; var planets; var updTimer; var mustHide; var miSel, miDir; var plstt; function BQItem(type, qt, ttb, cttb) { this.type = type; this.qt = qt; this.ttb = ttb; this.cttb = cttb; this.selected = false; } function Planet(id,name,x,y,orbit,pop,hap,ind,tur,mil,prof,cor,bqstr) { this.id = id; this.name = name; this.x = x; this.y = y; this.orbit = orbit; this.pop = pop; this.hap = hap; this.corruption = cor; this.ind = ind; this.tur = tur; this.mil = mil; this.prof = prof; this.selected = false; var i,j; this.bq = new Array(); bqd = bqstr.split('#'); if (bqd.length == 1) return; ni = bqd.length / 4; for (i=0;i[P]' + '' + '' + planets[ipl].name + '' + '(' + planets[ipl].x + ',' + planets[ipl].y + ',' + planets[ipl].orbit + ')' + '' + formatNumber(planets[ipl].pop) + '' + '' + drawHappiness(planets[ipl].hap) + '' + '' + formatNumber(planets[ipl].ind) + '' + '' + formatNumber(planets[ipl].tur) + '' + '€' + formatNumber(planets[ipl].prof) + '' + '' + ' ' + drawBQSummary(planets[ipl].bq) + '' + drawCorruption(planets[ipl].corruption) + '' + '' + formatNumber(planets[ipl].mil) + '' + '' return str; } function getMilitaryLevel(data) { milLevel = parseInt(data, 10) + 2; document.getElementById('jsplanets').innerHTML = drawQuickBuilder(); } function buildQuickBuilder() { if (!milLevel) x_getMilitaryLevel(getMilitaryLevel); else document.getElementById('jsplanets').innerHTML = drawQuickBuilder(); } function buildQBList() { var e = document.getElementById('qb_ftype'), e2 = document.getElementById('qb_planets'); if (!(e && e2)) setTimeout('buildQBList()', 500); else e2.innerHTML = drawQBList(); } function buildPlanetList() { document.getElementById('jsplanets').innerHTML = drawMainDisplay(); } function planetListReceived(data) { var i, j, lines, np, pdat, nbp, sel, sstr, bqsel, bqstr, bqlen, bqlstr; // Store selections and build queue lengths as strings sel = new Array(); bqlen = new Array(); bqsel = new Array(); if (planets) { np = 0; for (i=0;i= 70) { str += 'ok'; } else if (value >= 40) { str += 'med'; } else if (value >= 20) { str += 'dgr'; } else { str += 'bad'; } str += '">' + value + '%'; return str; } function drawCorruption(value) { var str = '' + value + '%'; return str; }