var alPgTitles = new Array( 'Main page', 'Leader election', 'Members', 'Planets', 'Military status', 'Pending requests', 'Forums admin.', 'Ranks admin.' ); var mbListHeaders = ['Name', 'Rank', 'Last online', 'On vacation']; var onlineText = "Currently online"; var lastOnlinePrefix = ""; var lastOnlineUnits = ['minute', 'minutes', 'hour', 'hours']; var lastOnlineSuffix = " ago"; var vacationMode = ['No', 'Yes']; function makeAllianceTooltips() { alltt = new Array(); if (ttDelay == 0) { var i; for (i=0;i<300;i++) alltt[i] = ""; return; } alltt[0] = tt_Dynamic("Use this text field to type in the tag of the alliance you wish to join"); alltt[1] = tt_Dynamic("Click here to send your joining request to the alliance's leadership"); alltt[2] = tt_Dynamic("Use this text field to type in the tag of the alliance you wish to create"); alltt[3] = tt_Dynamic("Use this text field to type in the full name of the alliance you wish to create"); alltt[4] = tt_Dynamic("Click here to create the given alliance"); alltt[5] = tt_Dynamic("Click here to cancel your joining request"); alltt[10] = tt_Dynamic("Use this text field to type in the tag of the alliance you wish to get information about"); alltt[11] = tt_Dynamic("Click here to display the information about the alliance you've provided the tag for"); alltt[20] = tt_Dynamic("Click here to step down as leader of this alliance"); alltt[21] = tt_Dynamic("Click here to leave this alliance"); alltt[22] = tt_Dynamic("Use this radio button to switch the alliance in dictatorial mode"); alltt[23] = tt_Dynamic("Use this radio button to switch the alliance in democratric mode"); alltt[24] = tt_Dynamic("Use this text field to type in the name of your successor as leader of the alliance"); alltt[30] = tt_Dynamic("Click here to update the alliance general settings according to your changes"); alltt[31] = tt_Dynamic("Click here to reset the alliance general settings to their previous values"); alltt[40] = tt_Dynamic("Click here to take the presidency of the alliance"); alltt[41] = tt_Dynamic("Click here to apply to presidency of the alliance"); alltt[42] = tt_Dynamic("Click here to cancel your candidacy for the presidency of the alliance"); alltt[43] = tt_Dynamic("Click here to change your vote for the alliance presidency according to what you have selected in the candidates list"); alltt[50] = tt_Dynamic("Click here to sort the candidates list according to this field and switch between ascending and descending ordering"); alltt[51] = tt_Dynamic("Use this radio button to abstain in the presidency election"); alltt[52] = tt_Dynamic("Use this radio button to select which candidate you wish to vote for in the presidency election"); alltt[60] = tt_Dynamic("Use this drop down list to select the alliance listing you wish to display"); alltt[61] = tt_Dynamic("Use this drop down list to select the number of planets to display on each page of the listing"); alltt[62] = tt_Dynamic("Use this radio button if you wish to search for a planet in the listing"); alltt[63] = tt_Dynamic("Use this radio button if you wish to search for a player in the listing"); alltt[64] = tt_Dynamic("Use this text field to type in the name of the planet or player you wish to search for in the listing"); alltt[70] = tt_Dynamic("Click here to order the list according to this field and switch between ascending and descending ordering"); alltt[71] = tt_Dynamic("Click here to go to this individual planet page"); alltt[72] = tt_Dynamic("Click here to send a private message to the owner of this planet"); alltt[73] = tt_Dynamic("Use this drop down list to go to another page of the listing"); alltt[80] = tt_Dynamic("Use this drop down list to select the number of alliance members to display oneach page of the listing"); alltt[81] = tt_Dynamic("Use this text field to type in the name of the player you wish to search for in the listing"); alltt[90] = tt_Dynamic("Click here to kick this member out of the alliance"); alltt[91] = tt_Dynamic("Click here to change the rank of the selected members to the selected rank"); alltt[92] = tt_Dynamic("Use this drop down list to choose the rank you want to give to the selected members"); alltt[100] = tt_Dynamic("Check this checkbox to select this alliance member "); alltt[101] = tt_Dynamic("Click here to send a private message to this alliance member"); alltt[110] = tt_Dynamic("Check this checkbox to select this player requesting to join the alliance"); alltt[111] = tt_Dynamic("Click here to accept this player into the alliance"); alltt[112] = tt_Dynamic("Click here to reject this player's joining request"); alltt[120] = tt_Dynamic("Click here to go to the forum creation form and create a new forum"); alltt[130] = tt_Dynamic("Click here to go to the forum modification form and edit this forum's settings"); alltt[131] = tt_Dynamic("Click here to move this forum up in the forums list"); alltt[132] = tt_Dynamic("Click here to move this forum down in the forums list"); alltt[133] = tt_Dynamic("Click here to delete this forum and all its contents"); alltt[140] = tt_Dynamic("Use this text field to type in the name of the forum"); alltt[141] = tt_Dynamic("Use this radio button if you want everyone to be able to post new threads in this forum"); alltt[142] = tt_Dynamic("Use this radio button if you want the moderators of the forum to be the only ones allowed to post new threads in it"); alltt[143] = tt_Dynamic("Use this drop down list to select where to place this forum in the forums list"); alltt[144] = tt_Dynamic("Use this text area to type in a description for this forum"); alltt[145] = tt_Dynamic("Click here to validate your changes to this forum"); alltt[146] = tt_Dynamic("Click here to cancel your changes to this forum"); alltt[150] = tt_Dynamic("Check this checkbox to select this rank and modify its access level to this forum"); alltt[160] = tt_Dynamic("Click here to give this access level to the selected rank(s) for this forum"); alltt[170] = tt_Dynamic("Click here to go to the rank creation form and create a new rank"); alltt[171] = tt_Dynamic("Click here to display / hide the dtails about this rank"); alltt[172] = tt_Dynamic("Click here to go to the modification form and edit this rank"); alltt[173] = tt_Dynamic("Click to delete this rank"); alltt[180] = tt_Dynamic("Use this text field to type in the rank designation"); alltt[181] = tt_Dynamic("Use this drop down list to select the level of listing access the members with this rank will have"); alltt[182] = tt_Dynamic("Check this checkbox if you want members of this rank to see the list of planets under attack"); alltt[183] = tt_Dynamic("Use this radio button if you want members of this rank to be diplomatic contact for the alliance and to receive all messages sent to the alliance"); alltt[184] = tt_Dynamic("Use this radio button if you don't want members of this rank to be diplomatic contact for the alliance"); alltt[185] = tt_Dynamic("Use this radio button if you want members of this rank to be able to vote for leader elections if the alliance is democratic"); alltt[186] = tt_Dynamic("Use this radio button if you don't want members of this rank to be able to vote for leader elections if the alliance is democratic"); alltt[187] = tt_Dynamic("Use this radio button if you want members of this rank to be able to apply for presidency"); alltt[188] = tt_Dynamic("Use this radio button if you don't want members of this rank to be able to apply for presidency"); alltt[189] = tt_Dynamic("Use this radio button if you want members of this rank to be able to accept or reject new joining requests"); alltt[190] = tt_Dynamic("Use this radio button if you don't want members of this rank to be able to accept or reject new joining requests"); alltt[191] = tt_Dynamic("Use this radio button if you want members of this rank to be forum administrators"); alltt[192] = tt_Dynamic("Use this radio button if you don't want members of this rank to be forum administrators"); alltt[193] = tt_Dynamic("Click here to accept the changes you've made to that rank"); alltt[194] = tt_Dynamic("Click here to cancel the changes you've made to that rank and go back to the previous page"); alltt[195] = tt_Dynamic("Use this radio button if you don't want members of this rank to be able to kick any member out of the alliance"); alltt[196] = tt_Dynamic("Use this radio button if you want members of this rank to be able to kick any member out of the alliance"); alltt[197] = tt_Dynamic("Use this radio button if you want members of this rank to be able to kick only members of a specific rank out of the alliance"); alltt[198] = tt_Dynamic("Use this radio button if you don't want members of this rank to be able to change the rank of any other member of the alliance"); alltt[199] = tt_Dynamic("Use this radio button if you want members of this rank to be able to change the rank of any other member of the alliance"); alltt[200] = tt_Dynamic("Use this radio button if you want members of this rank to be able tochange the rank of other members of the alliance only if they have some specific rank"); alltt[201] = tt_Dynamic("Use this radio button if you don't want members of this rank to have any access to this forum"); alltt[202] = tt_Dynamic("Use this radio button if you want members of this rank to have access to this forum as normal users"); alltt[203] = tt_Dynamic("Use this radio button if you want members of this rank to have access to this forum as moderators"); alltt[204] = tt_Dynamic("Use this drop down list to select to which rank players of the rank you are about to delete are to be demoted to"); alltt[205] = tt_Dynamic("Click here to confirm the deletion of this rank and the demotion of the players of this rank to the selected rank"); alltt[206] = tt_Dynamic("Click here to cancel the deletion of this rank and go back to the previous page"); alltt[210] = tt_Dynamic("Click here to go to this section of the alliance page"); alltt[220] = tt_Dynamic("Check this checkbox to select this rang and provide the corresponding rights over the members of this rank to the members of rank you are editing"); } //-------------------------------------------------- // PAGE WHEN PLAYER IS NOT A MEMBER OF AN ALLIANCE //-------------------------------------------------- function drawPageNoAlliance() { var jd, cd1, cd2, ai; var str = '
'; // Build join/create pannel str += '

Join an alliance

'; if (plAlliance == "") { str += ''; str += ''; str += '
 Alliance tag:'; str += '
'; str += ''; str += '
'; str += '

 

'; str += '

Create a new alliance

'; str += ''; str += ''; str += ''; str += '
 '; str += 'Alliance tag:'; str += ' 
Alliance name:'; str += ''; str += '
'; str += ' 
'; } else { str += '

Request sent to ' + alName + ' [' + alTag + '] '; str += '

'; } // Build alliance info pannel str += '
'; str += drawAllianceInfoPannel(); str += 'Help
'; var i, e, v = new Array(); var a = new Array('aljoin', 'actag', 'acname', 'alinfo'); for (i=0;i'; str += ''; str += ''; str += ' '; var i, a = new Array('tag', 'name', 'ldname', 'rank', 'points', 'nplanets', 'coords'); for (i=0;i  '; str += '  '; str += ' '; str += ''; return str; } function drawPubAllianceInfo() { if (alPubInfo && typeof alPubInfo == 'object') { document.getElementById('aihdtag').innerHTML = 'Alliance tag:'; document.getElementById('aihdname').innerHTML = 'Alliance name:'; document.getElementById('aihdldname').innerHTML = 'Leader:'; document.getElementById('aihdrank').innerHTML = 'Rank:'; document.getElementById('aihdpoints').innerHTML = 'Points:'; document.getElementById('aihdnplanets').innerHTML = 'Planets:'; document.getElementById('aihdcoords').innerHTML = 'Avg. coordinates:'; document.getElementById('aidttag').innerHTML = '[' + alPubInfo.tag + ']'; document.getElementById('aidtname').innerHTML = alPubInfo.name; document.getElementById('aidtldname').innerHTML = (alPubInfo.leader == "" ? 'NONE!' : alPubInfo.leader); document.getElementById('aidtrank').innerHTML = '#' + formatNumber(alPubInfo.rank); document.getElementById('aidtpoints').innerHTML = formatNumber(alPubInfo.points); document.getElementById('aidtnplanets').innerHTML = formatNumber(alPubInfo.nplanets); if (alPubInfo.nplanets > 0) document.getElementById('aidtcoords').innerHTML = '(' + alPubInfo.cx + ',' + alPubInfo.cy + ')'; else document.getElementById('aidtcoords').innerHTML = 'N/A'; if (alPubInfo.victory != '') { document.getElementById('aihdvict').innerHTML = 'Victory:'; document.getElementById('aidtvict').innerHTML = alPubInfo.victory + '%'; } } else { var i, a = new Array('tag', 'name', 'ldname', 'rank', 'points', 'nplanets', 'coords'); for (i=0;i '; str += 'You are '; if (alPrivileges[8] == "1") { str += 'the leader'; } else { str += 'a member'; } str += ' of [' + myPubInfo.tag + '].'; if (alPrivileges[8] == 1 && successor != "") { str += ''; } str += ' '; str += 'Alliance tag:[' + myPubInfo.tag + ']'; str += 'Alliance name:' + myPubInfo.name + ''; // FIXME: message link if not leader str += 'Leader:NONE!' : ('>' + myPubInfo.leader)) + ''; if (successor != "") { str += 'Successor:' + successor + ''; } str += 'Government:' + (isDemocracy ? 'democratic' : 'dictatorial') + 'Tech. trading:'; if (techTrade == 'N') { str += 'disabled'; } else { str += 'enabled' + (techTrade == 'R' ? '' : ' (no requests)'); } str += ''; str += 'Rank:#'+formatNumber(myPubInfo.rank)+''; str += 'Points:'+formatNumber(myPubInfo.points)+''; str += 'Planets:' + formatNumber(myPubInfo.nplanets) + ''; str += 'Avg. coordinates:'; if (myPubInfo.nplanets > 0) str += '(' + myPubInfo.cx + ',' + myPubInfo.cy + ')'; else str += 'N/A'; str += ''; if (myPubInfo.victory != '') { str += 'Victory:' + myPubInfo.victory + '%'; } if (!lockedAlliances) { str += ''; } str += ''; // Alliance settings if (alPrivileges[8] == "1") { if (typeof asDemocracy != "boolean") { asDemocracy = isDemocracy; asSuccessor = successor; asTechTrade = techTrade; } str += '

General settings

'; str += ''; if (!lockedAlliances) { str += ''; } str += '' + '' + '' + '
 Government:' + '
 
Successor:
 
 
'; } // Build alliance info pannel str += drawAllianceInfoPannel(); str += ''; var e = document.getElementById('alinfo'), es; if (e) es = e.value; else es = ""; document.getElementById('alpmain').innerHTML = str; drawPubAllianceInfo(); if (alPrivileges[8] == "1") { document.getElementById('lassucc').value = asSuccessor; updateASControls(); } document.getElementById('alinfo').value = es; asFocus(); } function drawASButtons() { var str = ' '; str += ''; document.getElementById('lasbut').innerHTML = str; } function alertASettings(ei) { var str = 'Error\n'; switch (ei) { case 0: str += "You are no longer the leader of this alliance."; break; case 1: str += 'The player you selected to be your successor could\nnot be found.'; break; case 2: str += 'You can\'t name yourself as your own successor.'; break; case 3: str += 'The player you selected to be your successor is not\na member of the alliance.'; break; case 4: str += "You can't leave the alliance in this game."; break; case 200: str += 'You are not allowed to do that while in vacation mode.'; break; default: str += 'An unknown error has occured.'; break; } alert(str); } function confirmLSD() { return confirm( 'You are about to step down from the head of the\n[' + alTag + '] alliance.\nThis will make ' + successor + ', your successor, the new leader.\n' + 'Please confirm you really want to do this.' ); } function confirmLeave(lt) { var str = 'You are about to leave the [' + alTag + '] alliance.\n'; switch (lt) { case 1: str += 'The successor you designated, ' + successor + ', will take your place\nas the head of the alliance.\n'; break; case 2: str += 'The alliance will be become leader-less until someone is\nelected to replace you at the head of the alliance.\n'; break; case 3: str += 'The alliance will be become a leader-less democracy until\nsomeone is elected to replace you at the head of the alliance.\n'; break; } str += 'Please confirm.'; return confirm(str); } //-------------------------------------------------- // LEADER ELECTION //-------------------------------------------------- function drawElectionLayout() { var str = '

Alliance Leader Election

'; str += ''; str += ''; str += ''; str += '

Candidates

 

Actions

 
'; document.getElementById('alpmain').innerHTML = str; } function drawElectionButtons() { var str = '

'; if (leCanSel||leCanTake||leCanApply||leCanCancel) { if (leCanTake) str += '
'; if (leCanApply) str += '
'; else if (leCanCancel) str += '
'; if (leCanSel && (leNewSel != leSelected)) str += ''; } else { str += 'There is nothing you can do here, since '; if (alPrivileges[8] == 1) str += 'you are the alliance\'s leader.'; else str += 'you don\'t have the right to vote or to apply for presidency.'; } str += '

'; document.getElementById('leaclist').innerHTML = str; } function drawCandidateList() { var str; if (leCandidates.length > 0) { str = ''; // Headers if (leCanSel) str += ''; str += ''; if (leCanSel) { str += ''; str += ''; str += ''; } str += '
 ' : '') + 'Name'; if (leSort == 0) { str += '' + (leSortDir ? '; } str += '' : '') + 'Votes'; if (leSort == 1) { str += '' + (leSortDir ? '; } str += '
' + leCandidates[i].nVotes + '
'; } else str = '

Noone has applied for presidency yet.

'; document.getElementById('lecdlist').innerHTML = str; } function alertElection(ei) { var str = 'Error\n'; switch (ei) { case 0: str += 'You are no longer a member of the alliance.'; break; case 1: str += 'You no longer have the authorization to do that.'; break; case 2: str += "The player you voted for is no longer a candidate."; break case 3: str += "You are already a candidate for presidency."; break case 4: str += "You aren\'t a candidate for presidency anymore."; break case 5: str += "You missed the occasion to seize control of the alliance."; break; case 200: str += 'You are not allowed to use this page while in vacation mode.'; break; default: str += 'An unknown error has occured.'; break; } alert(str); } //-------------------------------------------------- // LISTINGS PAGE //-------------------------------------------------- function drawPlanetList() { var i, str, n, m; // Header str = '

Alliance planets

'; // List header with page selector and search bar str += ''; str += '
Display planets / page'; str += '
'; str += 'Search for