Index: binaries/data/mods/public/gui/summary/countersHelper.js
===================================================================
--- binaries/data/mods/public/gui/summary/countersHelper.js	(revision 0)
+++ binaries/data/mods/public/gui/summary/countersHelper.js	(working copy)
@@ -0,0 +1,347 @@
+// FUNCTIONS FOR CALCULATING SCORES
+var teamMiscHelperData = [];
+
+function resetDataHelpers()
+{
+	teamMiscHelperData = [];
+}
+
+function updateCountersPlayer(playerState, counters, idGUI)
+{
+	for (var w in counters)
+	{
+		var fn = counters[w].fn;
+		Engine.GetGUIObjectByName(idGUI + "[" + w + "]").caption = fn && fn(playerState, w);
+	}
+}
+
+function updateTeamCounters(counters, fn)
+{
+	if (g_teams && fn)
+		fn(counters);
+}
+
+function calculateEconomyScore(playerState, position)
+{
+	var total = 0
+	for each (var res in playerState.statistics.resourcesGathered)
+		total += res;
+
+	return Math.round(total / 10);
+}
+
+function calculateMilitaryScore(playerState, position)
+{
+	return Math.round((playerState.statistics.enemyUnitsKilledValue +
+			playerState.statistics.enemyBuildingsDestroyedValue) / 10);
+}
+
+function calculateExplorationScore(playerState, position)
+{
+	return playerState.statistics.percentMapExplored * 10;
+}
+
+function calculateScoreTotal(playerState, position)
+{
+	return calculateEconomyScore(playerState) + calculateMilitaryScore(playerState) 
+			+ calculateExplorationScore(playerState);
+}
+
+function calculateScoreTeam(counters)
+{
+	for (var t in g_teams)
+	{
+		if (t == -1)
+			continue;
+
+		for (var w in counters)
+		{
+			var total = 0;
+			for (var p = 0; p < g_teams[t]; ++p)
+				total += (+Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption);
+
+			Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = total;
+		}
+	}
+}
+
+function calculateBuildings(playerState, position)
+{
+	var type = BUILDINGS_TYPES[position];
+	return TRAINED_COLOR + playerState.statistics.buildingsConstructed[type] + '[/color] / ' +
+				LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color] / ' +
+				KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]';
+}
+
+function calculateColorsTeam(counters)
+{
+	for (var t in g_teams)
+	{
+		if (t == -1)
+			continue;
+
+		for (var w in counters)
+		{
+			var total = {
+				c : 0,
+				l : 0,
+				d : 0
+			};
+			for (var p = 0; p < g_teams[t]; ++p)
+			{
+				var caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption;
+				// clean [Color=""], [/Color] and white space for make the sum more easy
+				caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s/g, "");
+
+				var splitCaption = caption.split("/");
+
+				total.c += (+splitCaption[0]);
+				total.l += (+splitCaption[1]);
+				total.d += (+splitCaption[2]);
+			}
+			var teamTotal = TRAINED_COLOR + total.c + '[/color] / ' +
+				LOST_COLOR + total.l + '[/color] / ' + KILLED_COLOR + total.d + '[/color]';
+
+			Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal;
+		}
+	}
+}
+
+function calculateUnits(playerState, position)
+{
+	var type = UNITS_TYPES[position];
+	return TRAINED_COLOR + playerState.statistics.unitsTrained[type] + '[/color] / ' +
+				LOST_COLOR + playerState.statistics.unitsLost[type] + '[/color] / ' +
+				KILLED_COLOR + playerState.statistics.enemyUnitsKilled[type] + '[/color]';
+}
+
+function calculateResources(playerState, position)
+{
+	var type = RESOURCES_TYPES[position];
+	return INCOME_COLOR + playerState.statistics.resourcesGathered[type] + '[/color] / ' +
+				OUTCOME_COLOR + (playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type]) + '[/color]';
+}
+
+function calculateTotalResources(playerState, position)
+{
+	var totalGathered = 0;
+	var totalUsed = 0;
+
+	for each (var type in RESOURCES_TYPES)
+	{
+		totalGathered += playerState.statistics.resourcesGathered[type];
+		totalUsed += playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type];
+	}
+
+	return INCOME_COLOR + totalGathered + '[/color] / ' + OUTCOME_COLOR + totalUsed + '[/color]';
+}
+
+function calculateTreasureCollected(playerState, position)
+{
+	return playerState.statistics.treasuresCollected;
+}
+
+function calculateTributeSent(playerState, position)
+{
+	return INCOME_COLOR + playerState.statistics.tributesSent + "[/color] / " + OUTCOME_COLOR + playerState.statistics.tributesReceived + "[/color]";
+}
+
+function calculateResourcesTeam(counters)
+{
+	for (var t in g_teams)
+	{
+		if (t == -1)
+			continue;
+
+		for (var w in counters)
+		{
+			var teamTotal = "undefined";
+
+			var total = {
+				i : 0,
+				o : 0
+			};
+			for (var p = 0; p < g_teams[t]; ++p)
+			{
+				var caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption;
+				// clean [Color=""], [/Color] and white space for make the sum more easy
+				caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s/g, "");
+
+				if (w == 5)
+					total.i += (+caption);
+				else
+				{
+					var splitCaption = caption.split("/");
+
+					total.i += (+splitCaption[0]);
+					total.o += (+splitCaption[1]);
+				}
+			}
+
+			if (w == 5)
+				teamTotal = total.i;
+			else
+				teamTotal = INCOME_COLOR + total.i + "[/color] / " + OUTCOME_COLOR + total.o + "[/color]";
+
+			Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal;
+		}
+	}
+}
+
+function calculateResourceExchanged(playerState, position)
+{
+	var type = RESOURCES_TYPES[position];
+	return INCOME_COLOR + '+' + playerState.statistics.resourcesBought[type] + '[/color] ' +
+				OUTCOME_COLOR + '-' + playerState.statistics.resourcesSold[type] + '[/color]';
+}
+
+function calculateBatteryEfficiency(playerState, position)
+{
+	var totalBought = 0;
+	for each (var boughtAmount in playerState.statistics.resourcesBought)
+		totalBought += boughtAmount;
+	var totalSold = 0;
+	for each (var soldAmount in playerState.statistics.resourcesSold)
+		totalSold += soldAmount;
+
+	return Math.floor(totalSold > 0 ? (totalBought / totalSold) * 100 : 0) + "%";
+}
+
+function calculateTradeIncome(playerState, position)
+{
+	return playerState.statistics.tradeIncome;
+}
+
+function calculateMarketTeam(counters)
+{
+	for (var t in g_teams)
+	{
+		if (t == -1)
+			continue;
+
+		for (var w in counters)
+		{
+			var teamTotal = "undefined";
+
+			var total = {
+				i : 0,
+				o : 0
+			};
+			for (var p = 0; p < g_teams[t]; ++p)
+			{
+				var caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption;
+				// clean [Color=""], [/Color], white space, + and % for make the sum more easy
+				caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s|\+|\%/g, "");
+
+				if (w >= 4)
+					total.i += (+caption);
+				else
+				{
+					var splitCaption = caption.split("-");
+					total.i += (+splitCaption[0]);
+					total.o += (+splitCaption[1]);
+				}
+			}
+
+			if (w >= 4)
+				teamTotal = total.i +(w == 4 ? "%" : "");
+			else
+				teamTotal = INCOME_COLOR + '+' + total.i + '[/color] ' + OUTCOME_COLOR + '-' + total.o + '[/color]';
+
+			Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal;
+		}
+	}
+}
+
+function calculateVegetarianRatio(playerState, position)
+{
+	if (!teamMiscHelperData[playerState.team])
+		teamMiscHelperData[playerState.team] = [];
+	if (!teamMiscHelperData[playerState.team][position])
+		teamMiscHelperData[playerState.team][position] = {"food": 0, "vegetarianFood": 0};
+
+	if (playerState.statistics.resourcesGathered.vegetarianFood && playerState.statistics.resourcesGathered.food)
+	{
+		teamMiscHelperData[playerState.team][position].food += playerState.statistics.resourcesGathered.food;
+		teamMiscHelperData[playerState.team][position].vegetarianFood += playerState.statistics.resourcesGathered.vegetarianFood;
+		return Math.floor((playerState.statistics.resourcesGathered.vegetarianFood / playerState.statistics.resourcesGathered.food) * 100) + "%";
+	}
+	else
+		return 0 + "%";
+}
+
+function calculateFeminisation(playerState, position)
+{
+	if (!teamMiscHelperData[playerState.team])
+		teamMiscHelperData[playerState.team] = [];
+	if (!teamMiscHelperData[playerState.team][position])
+		teamMiscHelperData[playerState.team][position] = {"Female": 0, "Worker": 0};
+
+	if (playerState.statistics.unitsTrained.Worker && playerState.statistics.unitsTrained.Female)
+	{
+		teamMiscHelperData[playerState.team][position].Female = playerState.statistics.unitsTrained.Female;
+		teamMiscHelperData[playerState.team][position].Worker = playerState.statistics.unitsTrained.Worker;
+		return Math.floor((playerState.statistics.unitsTrained.Female / playerState.statistics.unitsTrained.Worker) * 100) + "%";
+	}
+	else
+		return 0 + "%";
+}
+
+function calculateKillDeathRatio(playerState, position)
+{
+	if (!teamMiscHelperData[playerState.team])
+		teamMiscHelperData[playerState.team] = [];
+	if (!teamMiscHelperData[playerState.team][position])
+		teamMiscHelperData[playerState.team][position] = {"enemyUnitsKilled": 0, "unitsLost": 0};
+
+	teamMiscHelperData[playerState.team][position].enemyUnitsKilled = playerState.statistics.enemyUnitsKilled.total;
+	teamMiscHelperData[playerState.team][position].unitsLost = playerState.statistics.unitsLost.total;
+
+	if (!playerState.statistics.enemyUnitsKilled.total)
+		return DEFAULT_DECIMAL;
+	if (!playerState.statistics.unitsLost.total)	// and enemyUnitsKilled.total > 0
+		return INFINITE_SYMBOL; // infinity symbol
+
+	return Math.round((playerState.statistics.enemyUnitsKilled.total / playerState.statistics.unitsLost.total)*100)/100;
+}
+
+function calculateMapExploration(playerState, position)
+{
+	if (!teamMiscHelperData[playerState.team])
+		teamMiscHelperData[playerState.team] = [];
+
+	teamMiscHelperData[playerState.team][position] = playerState.statistics.teamPercentMapExplored;
+	return playerState.statistics.percentMapExplored + "%";
+}
+
+function calculateMiscellaneous(counters)
+{
+	for (var t in g_teams)
+	{
+		if (t == -1)
+			continue;
+
+		for (var w in counters)
+		{
+			var teamTotal = "undefined";
+
+			if (w == 0)
+				teamTotal = (teamMiscHelperData[t][w].food == 0 ? "0" : Math.floor((teamMiscHelperData[t][w].vegetarianFood / teamMiscHelperData[t][w].food) * 100)) + "%";
+			else if (w == 1)
+				teamTotal = (teamMiscHelperData[t][w].Worker == 0 ? "0" : Math.floor((teamMiscHelperData[t][w].Female / teamMiscHelperData[t][w].Worker) * 100)) + "%";
+			else if (w == 2)
+			{
+				if (!teamMiscHelperData[t][w].enemyUnitsKilled)
+					teamTotal = DEFAULT_DECIMAL;
+				else if (!teamMiscHelperData[t][w].unitsLost)	// and enemyUnitsKilled.total > 0
+					teamTotal = INFINITE_SYMBOL; // infinity symbol
+				else
+					teamTotal = Math.round((teamMiscHelperData[t][w].enemyUnitsKilled / teamMiscHelperData[t][w].unitsLost)*100)/100;
+			}
+			else if (w == 3)
+				teamTotal = teamMiscHelperData[t][w] + "%";
+
+			Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal;
+		}
+	}
+}
\ No newline at end of file
Index: binaries/data/mods/public/gui/summary/layoutsHelper.js
===================================================================
--- binaries/data/mods/public/gui/summary/layoutsHelper.js	(revision 0)
+++ binaries/data/mods/public/gui/summary/layoutsHelper.js	(working copy)
@@ -0,0 +1,282 @@
+var panelsData = [
+	{	// Scores panel
+		"headings": [	// headings on score panel
+			{ "caption": "Player name","yStart": 26, "width": 200 },
+			{ "caption": "Economy score","yStart": 16, "width": 100 },
+			{ "caption": "Military score","yStart": 16, "width": 100 },
+			{ "caption": "Exploration score","yStart": 16, "width": 100 },
+			{ "caption": "Total score","yStart": 16, "width": 100 }
+		],
+		"titleHeadings": [],
+		"counters": [	// counters on score panel
+			{ "width": 100, "fn": calculateEconomyScore },
+			{ "width": 100, "fn": calculateMilitaryScore },
+			{ "width": 100, "fn": calculateExplorationScore },
+			{ "width": 100, "fn": calculateScoreTotal}
+		],
+		"teamCounterFn": calculateScoreTeam
+	},
+    {	// buildings panel
+		"headings": [	// headings on buildings panel
+			{ "caption": "Player name", "yStart": 26, "width": 200 },
+			{ "caption": "Total", "yStart": 34, "width": 105 },
+			{ "caption": "Houses", "yStart": 34, "width": 85 },
+			{ "caption": "Economic", "yStart": 34, "width": 85 },
+			{ "caption": "Outposts", "yStart": 34, "width": 85 },
+			{ "caption": "Military", "yStart": 34, "width": 85 },
+			{ "caption": "Fortresses", "yStart": 34, "width": 85 },
+			{ "caption": "Civ centers", "yStart": 34, "width": 85 },
+			{ "caption": "Wonders", "yStart": 34, "width": 85 }
+		],
+		"titleHeadings": [
+			{ "caption": "Buildings Statistics (Constructed / Lost / Destroyed)", "yStart": 16, "width": (85 * 7 + 105) },	// width = 735
+		],
+		"counters": [	// counters on buildings panel
+			{"width": 105, "fn": calculateBuildings},
+			{"width": 85, "fn": calculateBuildings},
+			{"width": 85, "fn": calculateBuildings},
+			{"width": 85, "fn": calculateBuildings},
+			{"width": 85, "fn": calculateBuildings},
+			{"width": 85, "fn": calculateBuildings},
+			{"width": 85, "fn": calculateBuildings},
+			{"width": 85, "fn": calculateBuildings}
+		],
+		"teamCounterFn": calculateColorsTeam
+	},
+	{	// units panel
+		"headings": [	// headings on units panel
+			{ "caption": "Player name", "yStart": 26, "width": 200 },
+			{ "caption": "Total", "yStart": 34, "width": 120 },
+			{ "caption": "Infantry", "yStart": 34, "width": 100 },
+			{ "caption": "Worker", "yStart": 34, "width": 100 },
+			{ "caption": "Cavalry", "yStart": 34, "width": 100 },
+			{ "caption": "Champion", "yStart": 34, "width": 100 },
+			{ "caption": "Heroes", "yStart": 34, "width": 100 },
+			{ "caption": "Navy", "yStart": 34, "width": 100 }
+		],
+		"titleHeadings": [
+			{ "caption": "Units Statistics (Trained / Lost / Killed)", "yStart": 16, "width": (100 * 6 + 120) },	// width = 720
+		],
+		"counters": [	// counters on units panel
+			{"width": 120, "fn": calculateUnits},
+			{"width": 100, "fn": calculateUnits},
+			{"width": 100, "fn": calculateUnits},
+			{"width": 100, "fn": calculateUnits},
+			{"width": 100, "fn": calculateUnits},
+			{"width": 100, "fn": calculateUnits},
+			{"width": 100, "fn": calculateUnits}
+		],
+		"teamCounterFn": calculateColorsTeam
+	},
+	{	// resources panel
+		"headings": [	// headings on resources panel
+			{ "caption": "Player name", "yStart": 26, "width": 200 },
+			{ "caption": "Food", "yStart": 34, "width": 100 },
+			{ "caption": "Wood", "yStart": 34, "width": 100 },
+			{ "caption": "Stone", "yStart": 34, "width": 100 },
+			{ "caption": "Metal", "yStart": 34, "width": 100 },
+			{ "caption": "Total", "yStart": 34, "width": 110 },
+			{ "caption": "Treasures collected", "yStart": 16, "width": 100 },
+			{ "caption": "Tributes (Sent / Received)", "yStart": 16, "width": 121 }
+		],
+		"titleHeadings": [
+			{ "caption": "Resource Statistics (Gathered / Used)", "yStart": 16, "width": (100 * 4 + 110) }, // width = 510
+		],
+		"counters": [	// counters on resources panel
+			{"width": 100, "fn": calculateResources},
+			{"width": 100, "fn": calculateResources},
+			{"width": 100, "fn": calculateResources},
+			{"width": 100, "fn": calculateResources},
+			{"width": 110, "fn": calculateTotalResources},
+			{"width": 100, "fn": calculateTreasureCollected}, 
+			{"width": 121, "fn": calculateTributeSent}
+		],
+		"teamCounterFn": calculateResourcesTeam
+	},
+	{	// market panel
+		"headings": [	// headings on market panel
+			{ "caption": "Player name", "yStart": 26, "width": 200 },
+			{ "caption": "Food exchanged", "yStart": 16, "width": 100 },
+			{ "caption": "Wood exchanged", "yStart": 16, "width": 100 },
+			{ "caption": "Stone exchanged", "yStart": 16, "width": 100 },
+			{ "caption": "Metal exchanged", "yStart": 16, "width": 100 },
+			{ "caption": "Barter efficiency", "yStart": 16, "width": 100 },
+			{ "caption": "Trade income", "yStart": 16, "width": 100 }
+		],
+		"titleHeadings": [],
+		"counters": [	// counters on market panel
+			{"width": 100, "fn": calculateResourceExchanged},
+			{"width": 100, "fn": calculateResourceExchanged},
+			{"width": 100, "fn": calculateResourceExchanged},
+			{"width": 100, "fn": calculateResourceExchanged},
+			{"width": 100, "fn": calculateBatteryEfficiency},
+			{"width": 100, "fn": calculateTradeIncome}
+		],
+		"teamCounterFn": calculateMarketTeam
+	},
+	{	// miscelanous panel
+		"headings": [	// headings on miscelanous panel
+			{ "caption": "Player name", "yStart": 26, "width": 200 },
+			{ "caption": "Vegetarian\nratio", "yStart": 16, "width": 100 },
+			{ "caption": "Feminisation", "yStart": 26, "width": 100 },
+			{ "caption": "Kill / Death\nratio", "yStart": 16, "width": 100 },
+			{ "caption": "Map\nexploration", "yStart": 16, "width": 100 }
+		],
+		"titleHeadings": [],
+		"counters": [	// counters on miscelanous panel
+			{"width": 100, "fn": calculateVegetarianRatio},
+			{"width": 100, "fn": calculateFeminisation},
+			{"width": 100, "fn": calculateKillDeathRatio},
+			{"width": 100, "fn": calculateMapExploration}
+		],
+		"teamCounterFn": calculateMiscellaneous
+	}
+];
+
+function resetGeneralPanel()
+{
+	Engine.GetGUIObjectByName("titleHeading").hidden = true;
+	for (var h = 0; h < MAX_HEADINGTITLE; ++h) 
+	{
+		var headerGUIName = "Heading[" + h + "]";
+		Engine.GetGUIObjectByName(headerGUIName).hidden = true;
+		for (var p = 0; p < MAX_SLOTS; ++p)
+		{
+			Engine.GetGUIObjectByName("valueData[" + p + "][" + h + "]").hidden = true;
+			for (var t = 0; t < MAX_TEAMS; ++t) 
+			{
+				Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + h + "]").hidden = true;
+				Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + h + "]").hidden = true;
+			}
+		}
+	}
+}
+
+function updateGeneralPanelHeadings(headings)
+{
+	var left = 50;
+	for (var h in headings)
+	{
+		var headerGUIName = "playerNameHeading";
+		if (h > 0)
+			headerGUIName = "Heading[" + (h - 1) + "]";
+
+		var headerGUI = Engine.GetGUIObjectByName(headerGUIName);
+		headerGUI.caption = translate(headings[h].caption);
+		headerGUI.size = left + " " + headings[h].yStart + " " + (left + headings[h].width) + " 100%";
+		headerGUI.hidden = false;
+
+		if (headings[h].width < LONG_HEADING_WIDTH)
+			left += headings[h].width;
+	}
+}
+
+function updateGeneralPanelTitles(titleHeadings)
+{
+	var left = 250;
+	// for this implementation only one titleHeadings is going to support
+	// TODO: Expand for more titleHeadings in summary.xml
+	for (var th in titleHeadings)
+	{
+		var headerGUI = Engine.GetGUIObjectByName("titleHeading");
+		headerGUI.caption = translate(titleHeadings[th].caption);
+		headerGUI.size = left + " " + titleHeadings[th].yStart + " " + (left + titleHeadings[th].width) + " 100%";
+		headerGUI.hidden = false;
+		break;
+	}
+}
+
+function updateGeneralPanelCounter(counters)
+{
+	var rowPlayerObjectWidth = 0;
+	var left = 0;
+	for (var p = 0; p < MAX_SLOTS; ++p)
+	{
+		left = 240;
+		var counterObject;
+		for (var w in counters)
+		{
+			counterObject = Engine.GetGUIObjectByName("valueData[" + p + "][" + w + "]");
+			counterObject.size = left + " 6 " + (left + counters[w].width) + " 100%";
+			counterObject.hidden = false;
+			left += counters[w].width;
+		}
+		if (rowPlayerObjectWidth == 0)
+			rowPlayerObjectWidth = left;
+
+		var counterTotalObject;
+		for (var t = 0; t < MAX_TEAMS; ++t)
+		{
+			left = 240;
+			for (var w in counters)
+			{
+				counterObject = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]");
+				counterObject.size = left + " 6 " + (left + counters[w].width) + " 100%";
+				counterObject.hidden = false;
+
+				if (g_teams[t])
+				{
+					var yStart = 30 + teams[t] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 2;
+					counterTotalObject = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]");
+					counterTotalObject.size = (left + 20) + " " + yStart + " " + (left + counters[w].width) + " 100%";
+					counterTotalObject.hidden = false;
+				}
+
+				left += counters[w].width;
+			}
+		}
+	}
+	return rowPlayerObjectWidth;
+}
+
+function updateGeneralPanelTeams()
+{
+	if (!g_teams || g_withoutTeam > 0)
+		Engine.GetGUIObjectByName("noTeamsBox").hidden = false;
+
+	if (!g_teams)
+		return;
+
+	var yStart = TEAMS_BOX_Y_START + g_withoutTeam * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP);
+	for (var i = 0; i < g_teams.length; ++i)
+	{
+		var teamBox = Engine.GetGUIObjectByName("teamBoxt["+i+"]");
+		teamBox.hidden = false;
+		var teamBoxSize = teamBox.size;
+		teamBoxSize.top = yStart;
+		teamBox.size = teamBoxSize;
+
+		yStart += 30 + g_teams[i] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 32;
+
+		Engine.GetGUIObjectByName("teamNameHeadingt["+i+"]").caption = "Team "+(i+1);
+
+		var teamHeading = Engine.GetGUIObjectByName("teamHeadingt["+i+"]");
+		var yStartTotal = 30 + teams[i] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 2;
+		teamHeading.size = "50 "+yStartTotal+" 100% "+(yStartTotal+20);
+		teamHeading.caption = translate("Team total");
+	}
+	// If there are no players without team, hide "player name" heading
+	if (!g_withoutTeam)
+		Engine.GetGUIObjectByName("playerNameHeading").caption = "";
+}
+
+function updateObjectPlayerPosition()
+{
+	for (var h = 0; h < MAX_SLOTS; ++h) 
+	{
+		var playerBox = Engine.GetGUIObjectByName("playerBox[" + h + "]");
+		var boxSize = playerBox.size;
+		boxSize.top += h * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP);
+		boxSize.bottom = boxSize.top + PLAYER_BOX_Y_SIZE;
+		playerBox.size = boxSize;
+
+		for (var i = 0; i < MAX_TEAMS; ++i)
+		{
+			var playerBoxt = Engine.GetGUIObjectByName("playerBoxt[" + i + "][" + h + "]");
+			boxSize = playerBoxt.size;
+			boxSize.top += h * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP);
+			boxSize.bottom = boxSize.top + PLAYER_BOX_Y_SIZE;
+			playerBoxt.size = boxSize;
+		};
+	};
+}
\ No newline at end of file
Index: binaries/data/mods/public/gui/summary/summary.js
===================================================================
--- binaries/data/mods/public/gui/summary/summary.js	(revision 16142)
+++ binaries/data/mods/public/gui/summary/summary.js	(working copy)
@@ -1,6 +1,44 @@
 // Max player slots for any map (should read from config)
 const MAX_SLOTS = 8;
+const MAX_TEAMS = 4;
+const MAX_HEADINGTITLE = 8;
 
+// const for filtering long collective headings
+const LONG_HEADING_WIDTH = 250;
+// vertical size of player box
+const PLAYER_BOX_Y_SIZE = 30;
+// gap between players boxes
+const PLAYER_BOX_GAP = 2;
+// alpha for player box
+const PLAYER_BOX_ALPHA = " 32";
+// alpha for player colour box
+const PLAYER_COLOUR_BOX_ALPHA = " 255";
+// yStart value for spaceing teams boxes (and noTeamsBox)
+const TEAMS_BOX_Y_START = 65;
+// colours used for units and buildings
+const TRAINED_COLOR = '[color="201 255 200"]';
+const LOST_COLOR = '[color="255 213 213"]';
+const KILLED_COLOR = '[color="196 198 255"]';
+
+const BUILDINGS_TYPES = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ];
+const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship" ];
+const RESOURCES_TYPES = [ "food", "wood", "stone", "metal" ];
+
+// colours used for gathered and traded resources
+const INCOME_COLOR = '[color="201 255 200"]';
+const OUTCOME_COLOR = '[color="255 213 213"]';
+
+const DEFAULT_DECIMAL = "0.00";
+const INFINITE_SYMBOL = "\u221E";
+// Load data
+var g_civData = loadCivData();
+var g_teams = [ ];
+// TODO set g_maxPlayers as playerCounters.length
+var g_maxPlayers = 0;
+// Count players without team	(or all if teams are not displayed)
+var g_withoutTeam = 0;
+var g_gameData;
+
 /**
  * Select active panel
  * @param panelNumber Number of panel, which should get active state (integer)
@@ -7,8 +45,8 @@
  */
 function selectPanel(panelNumber)
 {
-	var panelNames = [ 'scorePanel', 'buildingsPanel', 'unitsPanel', 'resourcesPanel', 'marketPanel', 'miscPanel' ];
-	
+	var panelNames = [ 'scorePanel', 'buildingsPanel', 'unitsPanel', 'resourcesPanel', 'marketPanel', 'miscPanel'];
+
 	function adjustTabDividers(tabSize)
 	{
 		var leftSpacer = Engine.GetGUIObjectByName("tabDividerLeft");
@@ -16,494 +54,86 @@
 		leftSpacer.size = "20 " + leftSpacer.size.top + " " + (tabSize.left + 2) + " " + leftSpacer.size.bottom;
 		rightSpacer.size = (tabSize.right - 2) + " " + rightSpacer.size.top + " 100%-20 " + rightSpacer.size.bottom;
 	}
-	
-	for (var i = 0; i < panelNames.length; i++)
+
+	for (var i = 0; i < panelNames.length; ++i)
 	{
-		if (i != panelNumber)
-		{
-			Engine.GetGUIObjectByName(panelNames[i]).hidden = true;
-			Engine.GetGUIObjectByName(panelNames[i] + 'Button').sprite = "BackgroundTab";
-		}
-		else
-		{
-			Engine.GetGUIObjectByName(panelNames[i]).hidden = false;
-			Engine.GetGUIObjectByName(panelNames[i] + 'Button').sprite = "ForegroundTab";
-			adjustTabDividers(Engine.GetGUIObjectByName(panelNames[i] + 'Button').size);
-		}
+		Engine.GetGUIObjectByName(panelNames[i] + 'Button').sprite = "BackgroundTab";
 	}
+
+	Engine.GetGUIObjectByName(panelNames[panelNumber] + 'Button').sprite = "ForegroundTab";
+	adjustTabDividers(Engine.GetGUIObjectByName(panelNames[panelNumber] + 'Button').size);
+
+	updatePanelData(panelsData[panelNumber]);
 }
 
-function init(data)
+function updatePanelData(panelInfo)
 {
-	// LOCAL CONSTS, VARIABLES & FUNCTIONS
-	// const for filtering long collective headings
-	const LONG_HEADING_WIDTH = 250;
-	// number of panels
-	const PANELS_COUNT = 6;
-	// alpha for player box
-	const PLAYER_BOX_ALPHA = " 32";
-	// alpha for player colour box
-	const PLAYER_COLOUR_BOX_ALPHA = " 255";
-	// yStart value for spaceing teams boxes (and noTeamsBox)
-	const TEAMS_BOX_Y_START = 65;
-	// vertical size of player box
-	const PLAYER_BOX_Y_SIZE = 30;
-	// gap between players boxes
-	const PLAYER_BOX_GAP = 2;
-	
-	// colours used for units and buildings
-	const TRAINED_COLOR = '[color="201 255 200"]';
-	const LOST_COLOR = '[color="255 213 213"]';
-	const KILLED_COLOR = '[color="196 198 255"]';
+	resetGeneralPanel();
+	resetDataHelpers();
+	updateGeneralPanelHeadings(panelInfo.headings);
+	updateGeneralPanelTitles(panelInfo.titleHeadings);
+	var rowPlayerObjectWidth = updateGeneralPanelCounter(panelInfo.counters);
+	updateGeneralPanelTeams();
 
-	// colours used for gathered and traded resources
-	const INCOME_COLOR = '[color="201 255 200"]';
-	const OUTCOME_COLOR = '[color="255 213 213"]';
-	
-	const BUILDINGS_TYPES = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ];
-	const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship" ];
-	const RESOURCES_TYPES = [ "food", "wood", "stone", "metal" ];
-	
-	var panels = {
-		"score": {		// score panel
-			"headings": {	// headings on score panel
-				"playerName0Heading":      { "yStart": 26, "width": 200 },
-				"economyScoreHeading":     { "yStart": 16, "width": 100 },
-				"militaryScoreHeading":    { "yStart": 16, "width": 100 },
-				"explorationScoreHeading": { "yStart": 16, "width": 100 },
-				"totalScoreHeading":       { "yStart": 16, "width": 100 }
-			},
-			"counters": {	// counters on score panel
-				"economyScore":     {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"militaryScore":    {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"explorationScore": {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"totalScore":       {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] }
-			}
-		},
-		"buildings": {		// buildings panel
-			"headings": {	// headings on buildings panel
-				"playerName1Heading":        {"yStart": 26, "width": 200 },
-				"buildingsHeading":          {"yStart": 16, "width": (85 * 7 + 105) },	// width = 735
-				"totalBuildingsHeading":     {"yStart": 34, "width": 105 },
-				"houseBuildingsHeading":     {"yStart": 34, "width": 85 },
-				"economicBuildingsHeading":  {"yStart": 34, "width": 85 },
-				"outpostBuildingsHeading":   {"yStart": 34, "width": 85 },
-				"militaryBuildingsHeading":  {"yStart": 34, "width": 85 },
-				"fortressBuildingsHeading":  {"yStart": 34, "width": 85 },
-				"civCentreBuildingsHeading": {"yStart": 34, "width": 85 },
-				"wonderBuildingsHeading":    {"yStart": 34, "width": 85 }
-			},
-			"counters": {	// counters on buildings panel
-				"totalBuildings":     {"width": 105, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"houseBuildings":     {"width": 85,  "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"economicBuildings":  {"width": 85,  "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"outpostBuildings":   {"width": 85,  "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"militaryBuildings":  {"width": 85,  "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"fortressBuildings":  {"width": 85,  "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"civCentreBuildings": {"width": 85,  "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"wonderBuildings":    {"width": 85,  "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] }
-			}
-		},
-		"units": {		// units panel
-			"headings": {	// headings on units panel
-				"playerName2Heading":   {"yStart": 26, "width": 200 },
-				"unitsHeading":         {"yStart": 16, "width": (100 * 6 + 120) },	// width = 720
-				"totalUnitsHeading":    {"yStart": 34, "width": 120 },
-				"infantryUnitsHeading": {"yStart": 34, "width": 100 },
-				"workerUnitsHeading":   {"yStart": 34, "width": 100 },
-				"cavalryUnitsHeading":  {"yStart": 34, "width": 100 },
-				"championUnitsHeading": {"yStart": 34, "width": 100 },
-				"heroesUnitsHeading":   {"yStart": 34, "width": 100 },
-				"navyUnitsHeading":     {"yStart": 34, "width": 100 }
-			},
-			"counters": {	// counters on units panel
-				"totalUnits":    {"width": 120, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"infantryUnits": {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"workerUnits":   {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"cavalryUnits":  {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"championUnits": {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"heroesUnits":   {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"navyUnits":     {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] }
-			}
-		},
-		"resources": {		// resources panel
-			"headings": {	// headings on resources panel
-				"playerName3Heading":        {"yStart": 26, "width": 200 },
-				"resourceHeading":           {"yStart": 16, "width": (100 * 4 + 110) },//width = 510
-				"foodGatheredHeading":       {"yStart": 34, "width": 100 },
-				"woodGatheredHeading":       {"yStart": 34, "width": 100 },
-				"stoneGatheredHeading":      {"yStart": 34, "width": 100 },
-				"metalGatheredHeading":      {"yStart": 34, "width": 100 },
-				"totalGatheredHeading":      {"yStart": 34, "width": 110 },
-				"treasuresCollectedHeading": {"yStart": 16, "width": 100 },
-				"resourcesTributedHeading":  {"yStart": 16, "width": 121 }
-			},
-			"counters": {	// counters on resources panel
-				"foodGathered":       {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"woodGathered":       {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"stoneGathered":      {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"metalGathered":      {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"totalGathered":      {"width": 110, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"treasuresCollected": {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"resourcesTributed":  {"width": 121, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] }
-			}
-		},
-		"market": {		// market panel
-			"headings": {	// headings on market panel
-				"playerName4Heading":      {"yStart": 26, "width": 200 },
-				"exchangedFoodHeading":    {"yStart": 16, "width": 100 },
-				"exchangedWoodHeading":    {"yStart": 16, "width": 100 },
-				"exchangedStoneHeading":   {"yStart": 16, "width": 100 },
-				"exchangedMetalHeading":   {"yStart": 16, "width": 100 },
-				"barterEfficiencyHeading": {"yStart": 16, "width": 100 },
-				"tradeIncomeHeading":      {"yStart": 16, "width": 100 }
-			},
-			"counters": {	// counters on market panel
-				"exchangedFood":    {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"exchangedWood":    {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"exchangedStone":   {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"exchangedMetal":   {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"barterEfficiency": {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"tradeIncome":      {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] }
-			}
-		},
-		"miscelanous": {	// miscelanous panel
-			"headings": {	// headings on miscelanous panel
-				"playerName5Heading":     {"yStart": 26, "width": 200 },
-				"vegetarianRatioHeading": {"yStart": 16, "width": 100 },
-				"feminisationHeading":    {"yStart": 26, "width": 100 },
-				"killDeathRatioHeading":  {"yStart": 16, "width": 100 },
-				"mapExplorationHeading":  {"yStart": 16, "width": 100 }
-			},
-			"counters": {	// counters on miscelanous panel
-				"vegetarianRatio": {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"feminisation":    {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"killDeathRatio":  {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] },
-				"mapExploration":  {"width": 100, "objects": [ ], "teamsScores": [ ], "teamsScoresCaption": [ ] }
-			}
-		}
-	};
-	
-	function alignHeaders(headings)
-	{		
-		left = 50;
-		for (var h in headings)
-		{
-			Engine.GetGUIObjectByName(h).size = left + " " + headings[h].yStart + " " + (left + headings[h].width) + " 100%";
-			if (headings[h].width < LONG_HEADING_WIDTH)
-				left += headings[h].width;			
-		}
-	}
-	
-	function alignCounters(counters, player)
+	var playerBoxesCounts = [ ];
+	for (var i = 0; i < g_maxPlayers; ++i)
 	{
-		left = 240;
-		for each (var counter in counters)
-		{
-			counter.objects[player].size = left + " 2 " + (left + counter.width) + " 100%";
-			left += counter.width;
-		}
-		
-		return left;
-	}
-	
-	// caption counters functions
-	function captionEconomyScore()
-	{
-		var total = 0;
-		for each (var res in playerState.statistics.resourcesGathered)
-			total += res;
-			
-		return Math.round(total / 10);
-	}
-	
-	function captionBuildings(object, type)
-	{		
-		object.caption = TRAINED_COLOR + playerState.statistics.buildingsConstructed[type] + '[/color] / ' +
-				LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color] / ' +
-				KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]';
-	}
-	
-	function captionUnits(object, type)
-	{
-		object.caption = TRAINED_COLOR + playerState.statistics.unitsTrained[type] + '[/color] / ' +
-				LOST_COLOR + playerState.statistics.unitsLost[type] + '[/color] / ' +
-				KILLED_COLOR + playerState.statistics.enemyUnitsKilled[type] + '[/color]';
-	}
-	
-	function captionResourcesGathered(object, type)
-	{
-		object.caption = INCOME_COLOR + playerState.statistics.resourcesGathered[type] + '[/color] / ' +
-				OUTCOME_COLOR + (playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type]) + '[/color]';
-	}
-	
-	function captionTotalResourcesGathered()
-	{
-		var totalGathered = 0;
-		var totalUsed = 0;
-		
-		for each (var type in RESOURCES_TYPES)
-		{
-			totalGathered += playerState.statistics.resourcesGathered[type];
-			totalUsed += playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type];
-		}
-			
-		return INCOME_COLOR + totalGathered + '[/color] / ' + OUTCOME_COLOR + totalUsed + '[/color]';
-	}
-	
-	function captionResourcesTributed()
-	{
-		return INCOME_COLOR + playerState.statistics.tributesSent + "[/color] / " + OUTCOME_COLOR + playerState.statistics.tributesReceived + "[/color]";
-	}
-	
-	function captionResourcesExchanged(object, type)
-	{	
-		object.caption = INCOME_COLOR + '+' + playerState.statistics.resourcesBought[type] + '[/color] ' +
-				OUTCOME_COLOR + '-' + playerState.statistics.resourcesSold[type] + '[/color]';		
-	}
-	
-	function captionBarterEfficiency()
-	{
-		var totalBought = 0;
-		for each (var boughtAmount in playerState.statistics.resourcesBought)
-			totalBought += boughtAmount;
-		var totalSold = 0;
-		for each (var soldAmount in playerState.statistics.resourcesSold)
-			totalSold += soldAmount;
-			
-		return Math.floor(totalSold > 0 ? (totalBought / totalSold) * 100 : 0) + "%";
-	}
-	
-	function captionVegetarianRatio()
-	{
-		if (playerState.statistics.resourcesGathered.vegetarianFood && playerState.statistics.resourcesGathered.food)
-			return Math.floor((playerState.statistics.resourcesGathered.vegetarianFood / playerState.statistics.resourcesGathered.food) * 100) + "%";
+		var playerState = g_gameData.playerStates[i+1];
+
+		if (!playerBoxesCounts[playerState.team+1])
+			playerBoxesCounts[playerState.team+1] = 1;
 		else
-			return 0 + "%";	
-	}
-	
-	function captionFeminisation()
-	{
-		if (playerState.statistics.unitsTrained.Worker && playerState.statistics.unitsTrained.Female)
-			return Math.floor((playerState.statistics.unitsTrained.Female / playerState.statistics.unitsTrained.Worker) * 100) + "%";
-		else
-			return 0 + "%";
-	}
-	
-	function captionKillDeathRatio()
-	{
-		if (!playerState.statistics.enemyUnitsKilled.total)
-			return "0.00";
-		if (!playerState.statistics.unitsLost.total)	// and enemyUnitsKilled.total > 0
-			return "\u221E"; // infinity symbol
-		return Math.round((playerState.statistics.enemyUnitsKilled.total / playerState.statistics.unitsLost.total)*100)/100;
-	}
-	
-	function sumTeamBuildings(counter, type)
-	{		
-		if (counter.teamsScores[playerState.team] == 0)
-		{			
-			counter.teamsScores[playerState.team] = { };
-			counter.teamsScores[playerState.team].buildingsConstructed = 0;
-			counter.teamsScores[playerState.team].buildingsLost = 0;
-			counter.teamsScores[playerState.team].enemyBuildingsDestroyed = 0;
-		}
+			playerBoxesCounts[playerState.team+1] += 1;
 
-		counter.teamsScores[playerState.team].buildingsConstructed += playerState.statistics.buildingsConstructed[type];
-		counter.teamsScores[playerState.team].buildingsLost += playerState.statistics.buildingsLost[type];
-		counter.teamsScores[playerState.team].enemyBuildingsDestroyed += playerState.statistics.enemyBuildingsDestroyed[type];
-		
-		counter.teamsScoresCaption[playerState.team] = TRAINED_COLOR + counter.teamsScores[playerState.team].buildingsConstructed + '[/color] / ' +
-			LOST_COLOR + counter.teamsScores[playerState.team].buildingsLost + '[/color] / ' +
-			KILLED_COLOR + counter.teamsScores[playerState.team].enemyBuildingsDestroyed + '[/color]';
-	}
-	
-	function sumTeamUnits(counter, type)
-	{		
-		if (counter.teamsScores[playerState.team] == 0)
+		var positionObject = playerBoxesCounts[playerState.team+1] - 1;
+		var rowPlayer = "playerBox[" + positionObject + "]";
+		var playerNameColumn = "playerName[" + positionObject + "]";
+		var playerColourBoxColumn = "playerColourBox[" + positionObject + "]";
+		var playerCivicBoxColumn = "civIcon[" + positionObject + "]";
+		var playerCounterValue = "valueData[" + positionObject + "]";
+		if (playerState.team != -1)
 		{
-			counter.teamsScores[playerState.team] = { };
-			counter.teamsScores[playerState.team].unitsTrained = 0;
-			counter.teamsScores[playerState.team].unitsLost = 0;
-			counter.teamsScores[playerState.team].enemyUnitsKilled = 0;
+			rowPlayer = "playerBoxt[" + playerState.team + "]p[" + positionObject + "]";
+			playerNameColumn = "playerNamet[" + playerState.team + "]p[" + positionObject + "]";
+			playerColourBoxColumn = "playerColourBoxt[" + playerState.team + "]p[" + positionObject + "]";
+			playerCivicBoxColumn = "civIcont[" + playerState.team + "]p[" + positionObject + "]";
+			playerCounterValue = "valueDataTeam[" + playerState.team + "]p[" + positionObject + "]";
 		}
 
-		counter.teamsScores[playerState.team].unitsTrained += playerState.statistics.unitsTrained[type];
-		counter.teamsScores[playerState.team].unitsLost += playerState.statistics.unitsLost[type];
-		counter.teamsScores[playerState.team].enemyUnitsKilled += playerState.statistics.enemyUnitsKilled[type];
-		
-		counter.teamsScoresCaption[playerState.team] = TRAINED_COLOR + counter.teamsScores[playerState.team].unitsTrained + '[/color] / ' +
-			LOST_COLOR + counter.teamsScores[playerState.team].unitsLost + '[/color] / ' +
-			KILLED_COLOR + counter.teamsScores[playerState.team].enemyUnitsKilled + '[/color]';
+		var colourString = "colour: "
+				+ Math.floor(playerState.colour.r * 255) + " "
+				+ Math.floor(playerState.colour.g * 255) + " "
+				+ Math.floor(playerState.colour.b * 255);
+
+		var rowPlayerObject = Engine.GetGUIObjectByName(rowPlayer);
+		rowPlayerObject.hidden = false;
+		rowPlayerObject.sprite = colourString + PLAYER_BOX_ALPHA;
+		var boxSize = rowPlayerObject.size;
+		boxSize.right = rowPlayerObjectWidth;
+		rowPlayerObject.size = boxSize;
+
+		var playerColourBox = Engine.GetGUIObjectByName(playerColourBoxColumn);
+		playerColourBox.sprite = colourString + PLAYER_COLOUR_BOX_ALPHA;
+
+		Engine.GetGUIObjectByName(playerNameColumn).caption = g_gameData.players[i+1].name;
+
+		var civIcon = Engine.GetGUIObjectByName(playerCivicBoxColumn);
+		civIcon.sprite = "stretched:"+g_civData[playerState.civ].Emblem;
+		civIcon.tooltip = g_civData[playerState.civ].Name;
+
+		// update counters
+		updateCountersPlayer(playerState, panelInfo.counters, playerCounterValue);
 	}
-	
-	function sumResourcesGathered(counter, type)
-	{		
-		if (counter.teamsScores[playerState.team] == 0)
-		{
-			counter.teamsScores[playerState.team] = { };
-			counter.teamsScores[playerState.team].resourcesGathered = 0;
-			counter.teamsScores[playerState.team].resourcesUsed = 0;
-		}
-		
-		counter.teamsScores[playerState.team].resourcesGathered += playerState.statistics.resourcesGathered[type];
-		counter.teamsScores[playerState.team].resourcesUsed += playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type];
-		
-		counter.teamsScoresCaption[playerState.team] = INCOME_COLOR + counter.teamsScores[playerState.team].resourcesGathered + '[/color] / ' +
-			OUTCOME_COLOR + counter.teamsScores[playerState.team].resourcesUsed + '[/color]';
-	}
-	
-	function sumTotalResourcesGathered()
-	{
-		if (panels.resources.counters.totalGathered.teamsScores[playerState.team] == 0)
-		{
-			panels.resources.counters.totalGathered.teamsScores[playerState.team] = { };
-			panels.resources.counters.totalGathered.teamsScores[playerState.team].resourcesGathered = 0;
-			panels.resources.counters.totalGathered.teamsScores[playerState.team].resourcesUsed = 0;
-		}
-		
-		for each (var type in RESOURCES_TYPES)
-		{
-			panels.resources.counters.totalGathered.teamsScores[playerState.team].resourcesGathered += playerState.statistics.resourcesGathered[type];
-			panels.resources.counters.totalGathered.teamsScores[playerState.team].resourcesUsed +=
-				playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type];
-		}
-		
-		panels.resources.counters.totalGathered.teamsScoresCaption[playerState.team] =
-			INCOME_COLOR + panels.resources.counters.totalGathered.teamsScores[playerState.team].resourcesGathered + '[/color] / ' +
-			OUTCOME_COLOR + panels.resources.counters.totalGathered.teamsScores[playerState.team].resourcesUsed + '[/color]';
-	}
-	
-	function sumResourcesTributed()
-	{
-		if (panels.resources.counters.resourcesTributed.teamsScores[playerState.team] == 0)
-		{
-			panels.resources.counters.resourcesTributed.teamsScores[playerState.team] = { };
-			panels.resources.counters.resourcesTributed.teamsScores[playerState.team].tributesSent = 0;
-			panels.resources.counters.resourcesTributed.teamsScores[playerState.team].tributesReceived = 0;
-		}
-		
-		panels.resources.counters.resourcesTributed.teamsScores[playerState.team].tributesSent += playerState.statistics.tributesSent;
-		panels.resources.counters.resourcesTributed.teamsScores[playerState.team].tributesReceived += playerState.statistics.tributesReceived;
-		
-		panels.resources.counters.resourcesTributed.teamsScoresCaption[playerState.team] =
-			INCOME_COLOR + panels.resources.counters.resourcesTributed.teamsScores[playerState.team].tributesSent + "[/color] / " +
-			OUTCOME_COLOR + panels.resources.counters.resourcesTributed.teamsScores[playerState.team].tributesReceived + "[/color]";
-	}
-	
-	function sumResourcesExchanged(counter, type)
-	{		
-		if (counter.teamsScores[playerState.team] == 0)
-		{
-			counter.teamsScores[playerState.team] = { };
-			counter.teamsScores[playerState.team].resourcesBought = 0;
-			counter.teamsScores[playerState.team].resourcesSold = 0;
-		}
-		
-		counter.teamsScores[playerState.team].resourcesBought += playerState.statistics.resourcesBought[type];
-		counter.teamsScores[playerState.team].resourcesSold += playerState.statistics.resourcesSold[type];
-		
-		counter.teamsScoresCaption[playerState.team] =
-			INCOME_COLOR + '+' + counter.teamsScores[playerState.team].resourcesBought + '[/color] ' +
-			OUTCOME_COLOR + '-' + counter.teamsScores[playerState.team].resourcesSold + '[/color]';
-	}
-	
-	function sumBarterEfficiency()
-	{
-		if (panels.market.counters.barterEfficiency.teamsScores[playerState.team] == 0)
-		{
-			panels.market.counters.barterEfficiency.teamsScores[playerState.team] = { };
-			panels.market.counters.barterEfficiency.teamsScores[playerState.team].resourcesBought = 0;
-			panels.market.counters.barterEfficiency.teamsScores[playerState.team].resourcesSold = 0;
-		}
-		
-		for each (var boughtAmount in playerState.statistics.resourcesBought)
-			panels.market.counters.barterEfficiency.teamsScores[playerState.team].resourcesBought += boughtAmount;
-		for each (var soldAmount in playerState.statistics.resourcesSold)
-			panels.market.counters.barterEfficiency.teamsScores[playerState.team].resourcesSold += soldAmount;
-			
-		panels.market.counters.barterEfficiency.teamsScoresCaption[playerState.team] =
-			Math.floor(panels.market.counters.barterEfficiency.teamsScores[playerState.team].resourcesSold > 0 ?
-			(panels.market.counters.barterEfficiency.teamsScores[playerState.team].resourcesBought /
-			 panels.market.counters.barterEfficiency.teamsScores[playerState.team].resourcesSold) * 100 : 0) + "%";
-	}
-	
-	function sumVegetarianRatio()
-	{
-		if (panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team] == 0)
-		{
-			panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team] = { };
-			panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].vegetarianFood = 0;
-			panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].food = 0;
-		}
-		
-		panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].vegetarianFood += playerState.statistics.resourcesGathered.vegetarianFood;
-		panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].food += playerState.statistics.resourcesGathered.food;
-		
-		if (panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].food &&
-		    panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].vegetarianFood)
-		{
-			panels.miscelanous.counters.vegetarianRatio.teamsScoresCaption[playerState.team] =
-				Math.floor((panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].vegetarianFood /
-					   panels.miscelanous.counters.vegetarianRatio.teamsScores[playerState.team].food) * 100) + "%";
-			return;
-		}
-		panels.miscelanous.counters.vegetarianRatio.teamsScoresCaption[playerState.team] = 0 + "%";
-	}
-	
-	function sumFeminisation()
-	{
-		if (panels.miscelanous.counters.feminisation.teamsScores[playerState.team] == 0)
-		{
-			panels.miscelanous.counters.feminisation.teamsScores[playerState.team] = { };
-			panels.miscelanous.counters.feminisation.teamsScores[playerState.team].femalesTrained = 0;
-			panels.miscelanous.counters.feminisation.teamsScores[playerState.team].workersTrained = 0;
-		}
-		
-		panels.miscelanous.counters.feminisation.teamsScores[playerState.team].femalesTrained += playerState.statistics.unitsTrained.Female;
-		panels.miscelanous.counters.feminisation.teamsScores[playerState.team].workersTrained += playerState.statistics.unitsTrained.Worker;
-		
-		if (panels.miscelanous.counters.feminisation.teamsScores[playerState.team].femalesTrained &&
-		    panels.miscelanous.counters.feminisation.teamsScores[playerState.team].workersTrained)
-		{
-			panels.miscelanous.counters.feminisation.teamsScoresCaption[playerState.team] =
-				Math.floor((panels.miscelanous.counters.feminisation.teamsScores[playerState.team].femalesTrained /
-					    panels.miscelanous.counters.feminisation.teamsScores[playerState.team].workersTrained) * 100) + "%";
-				return;
-		}
-		panels.miscelanous.counters.feminisation.teamsScoresCaption[playerState.team] = 0 + "%";
-	}
-	
-	function sumKillDeathRatio()
-	{
-		if (panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team] == 0)
-		{
-			panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team] = { };
-			panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].enemyUnitsKilled = 0;
-			panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].unitsLost = 0;
-		}
-		
-		panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].enemyUnitsKilled += playerState.statistics.enemyUnitsKilled.total;
-		panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].unitsLost += playerState.statistics.unitsLost.total;
-		
-		if (!panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].enemyUnitsKilled)
-		{
-			panels.miscelanous.counters.killDeathRatio.teamsScoresCaption[playerState.team] = "0.00";
-			return;
-		}
-		if (!panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].unitsLost)
-		{
-			panels.miscelanous.counters.killDeathRatio.teamsScoresCaption[playerState.team] = "\u221E"; // infinity symbol
-			return;
-		}
-		panels.miscelanous.counters.killDeathRatio.teamsScoresCaption[playerState.team] =
-			Math.round((panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].enemyUnitsKilled /
-				    panels.miscelanous.counters.killDeathRatio.teamsScores[playerState.team].unitsLost) * 100)/100;
-	}
-	
-	// FUNCTION BODY
-	// Load data
-	var civData = loadCivData();
+	// update team counters
+	var teamCounterFn = panelInfo.teamCounterFn
+	updateTeamCounters(panelInfo.counters, teamCounterFn);
+}
+
+function init(data)
+{
+	updateObjectPlayerPosition();
+	g_gameData = data;
+
 	// Map
 	var mapDisplayType = translate("Scenario");
 
@@ -529,297 +159,43 @@
 	}
 
 	Engine.GetGUIObjectByName("mapName").caption = sprintf(translate("%(mapName)s - %(mapType)s"), { mapName: translate(data.mapSettings.Name), mapType: mapDisplayType});
-	
+
 	// Panels
-	// Align headers
-	var left = 50;
-	for each (var panel in panels)	// for all panels
-		alignHeaders(panel.headings);
+	g_maxPlayers = data.playerStates.length - 1;
 
-	// TODO set maxPlayers as playerCounters.length
-	var maxPlayers = data.playerStates.length - 1;
-	var maxTeams = 0;
-
-	var teams = [ ];
 	if (data.mapSettings.LockTeams)	// teams ARE locked
 	{
 		// count teams
-		for(var t = 0; t < maxPlayers; ++t)
+		for(var t = 0; t < g_maxPlayers; ++t)
 		{
-			if (!teams[data.playerStates[t+1].team])
+			if (!g_teams[data.playerStates[t+1].team])
 			{
-				teams[data.playerStates[t+1].team] = 1;
+				g_teams[data.playerStates[t+1].team] = 1;
 				continue;
 			}
-			teams[data.playerStates[t+1].team]++;
+			g_teams[data.playerStates[t+1].team]++;
 		}
-		
-		if (teams.length == maxPlayers)
-			teams = false;	// Each player has his own team. Displaying teams makes no sense.
+
+		if (g_teams.length == g_maxPlayers)
+			g_teams = false;	// Each player has his own team. Displaying teams makes no sense.
 	}
 	else				// teams are NOT locked
-		teams = false;
-	
+		g_teams = false;
+
 	// Erase teams data if teams are not displayed
-	if (!teams)
+	if (!g_teams)
 	{
-		for(var p = 0; p < maxPlayers; ++p)
+		for(var p = 0; p < g_maxPlayers; ++p)
 			data.playerStates[p+1].team = -1;
 	}
-	
-	// Count players without team	(or all if teams are not displayed)
-	var withoutTeam = maxPlayers;
-	if (teams)
+
+	g_withoutTeam = g_maxPlayers;
+	if (g_teams)
 	{
 		// count players without team	(or all if teams are not displayed)
-		for (var i = 0; i < teams.length; ++i)
-			withoutTeam -= teams[i];
-		
-		// Display teams boxes
-		var p = 0;
-		for each (var panel in panels)
-		{
-			var yStart = TEAMS_BOX_Y_START + withoutTeam * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP);
-			for (var i = 0; i < teams.length; ++i)
-			{
-				var teamBox = Engine.GetGUIObjectByName("teamBox"+p+"t"+i);
-				teamBox.hidden = false;
-				var teamBoxSize = teamBox.size;
-				teamBoxSize.top = yStart;
-				teamBox.size = teamBoxSize;
-				
-				yStart += 30 + teams[i] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 32;
-				
-				Engine.GetGUIObjectByName("teamNameHeading"+p+"t"+i).caption = "Team "+(i+1);
-				
-				// Make place to store team scores
-				for each (var counter in panel.counters)
-				{
-					counter.teamsScores[i] = 0;
-					counter.teamsScoresCaption[i] = "0";
-				}
-			}
-			
-			// If there are no players without team, hide "player name" heading
-			if (!withoutTeam)
-				Engine.GetGUIObjectByName("playerName"+p+"Heading").caption = "";	
-			
-			p++;
-		}
+		for (var i = 0; i < g_teams.length; ++i)
+			g_withoutTeam -= g_teams[i];
 	}
-	
-	if (withoutTeam)
-	{
-		// Show boxes for no teams
-		for (var b = 0; b < PANELS_COUNT; ++b)
-			Engine.GetGUIObjectByName("noTeamsBox"+b).hidden = false;
-	}
 
-	var playerBoxesCounts = [ ];
-	for (var i = 0; i < maxPlayers; ++i)
-	{
-		var tn = "";
-		var playerState = data.playerStates[i+1];
-		
-		if (!playerBoxesCounts[playerState.team+1])
-			playerBoxesCounts[playerState.team+1] = 1;
-		else
-			playerBoxesCounts[playerState.team+1] += 1;
-
-		if (playerState.team != -1)
-			tn = "t"+playerState.team+"p";
-
-		var j = 0;
-		for each (var panel in panels)
-		{
-			var playerIdentityString = tn+"["+(playerBoxesCounts[playerState.team+1]-1)+"]";
-			// Display boxes for players
-			var playerBox = Engine.GetGUIObjectByName("playerBox"+j+playerIdentityString); 
-			playerBox.hidden = false;
-			
-			var boxSize = playerBox.size;
-			boxSize.top += (playerBoxesCounts[playerState.team+1] - 1) * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP);
-			boxSize.bottom = boxSize.top + PLAYER_BOX_Y_SIZE;
-			playerBox.size = boxSize;
-			
-			var colourString = "colour: "
-				+ Math.floor(playerState.colour.r * 255) + " "
-				+ Math.floor(playerState.colour.g * 255) + " "
-				+ Math.floor(playerState.colour.b * 255);
-			
-			playerBox.sprite = colourString + PLAYER_BOX_ALPHA;
-			
-			var playerColourBox = Engine.GetGUIObjectByName("playerColourBox"+j+playerIdentityString);
-			playerColourBox.sprite = colourString + PLAYER_COLOUR_BOX_ALPHA;
-			
-			// Show the multiplayer name, e.g. "Foobar" rather than "Player 1".
-			// TODO: Perhaps show both the multiplayer and map-specific name?
-			var playerName = Engine.GetGUIObjectByName("playerName"+j+playerIdentityString);
-			playerName.caption = data.players[i+1].name;
-
-			var civIcon = Engine.GetGUIObjectByName("civIcon"+j+playerIdentityString);
-			civIcon.sprite = "stretched:"+civData[playerState.civ].Emblem;
-			civIcon.tooltip = civData[playerState.civ].Name;
-			
-			// Get counters
-			for (var c in panel.counters)
-			{
-				panel.counters[c].objects[i] = Engine.GetGUIObjectByName(c+playerIdentityString);
-			}
-			
-			// Align counters
-			var right = alignCounters(panel.counters, i);
-			boxSize.right = right;
-			playerBox.size = boxSize;
-			
-			j++;
-		}
-		
-		// Assign counters
-		// score panel
-		panels.score.counters.economyScore.objects[i].caption = captionEconomyScore();
-		panels.score.counters.militaryScore.objects[i].caption = Math.round((playerState.statistics.enemyUnitsKilledValue +
-			playerState.statistics.enemyBuildingsDestroyedValue) / 10);
-		panels.score.counters.explorationScore.objects[i].caption = playerState.statistics.percentMapExplored * 10;
-		panels.score.counters.totalScore.objects[i].caption = (+panels.score.counters.economyScore.objects[i].caption) +
-			(+panels.score.counters.militaryScore.objects[i].caption) +
-			(+panels.score.counters.explorationScore.objects[i].caption);
-		// buildings panel
-		var t = 0;
-		for each (var counter in panels.buildings.counters)
-		{
-			captionBuildings(counter.objects[i], BUILDINGS_TYPES[t]);
-			t++;
-		}
-		// units panel
-		t = 0;
-		for each (var counter in panels.units.counters)
-		{
-			captionUnits(counter.objects[i], UNITS_TYPES[t]);
-			t++;
-		}
-		// resources panel
-		t = 0;
-		for each (var counter in panels.resources.counters)
-		{
-			if (t >= 4)	// only 4 first counters
-				break;
-			
-			captionResourcesGathered(counter.objects[i], RESOURCES_TYPES[t]);
-			t++;
-		}
-		panels.resources.counters.totalGathered.objects[i].caption = captionTotalResourcesGathered();
-		panels.resources.counters.treasuresCollected.objects[i].caption = playerState.statistics.treasuresCollected;
-		panels.resources.counters.resourcesTributed.objects[i].caption = captionResourcesTributed();
-		// market panel
-		t = 0;
-		for (var c in panels.market.counters)
-		{
-			if (t >= 4)	// only 4 first counters
-				break;
-			
-			captionResourcesExchanged(panels.market.counters[c].objects[i], RESOURCES_TYPES[t]);
-			t++;
-		}
-		panels.market.counters.barterEfficiency.objects[i].caption = captionBarterEfficiency();
-		panels.market.counters.tradeIncome.objects[i].caption = playerState.statistics.tradeIncome;
-		// miscelanous panel
-		panels.miscelanous.counters.vegetarianRatio.objects[i].caption = captionVegetarianRatio();
-		panels.miscelanous.counters.feminisation.objects[i].caption = captionFeminisation();
-		panels.miscelanous.counters.killDeathRatio.objects[i].caption = captionKillDeathRatio();
-		panels.miscelanous.counters.mapExploration.objects[i].caption = playerState.statistics.percentMapExplored + "%";
-		
-		if (!teams)
-			continue;
-		
-		if (playerState.team == -1)
-			continue;
-		
-		// Evaluate team total score
-		// score panel
-		for (var c in panels.score.counters)
-		{
-			panels.score.counters[c].teamsScores[playerState.team] += (+panels.score.counters[c].objects[i].caption);
-			panels.score.counters[c].teamsScoresCaption[playerState.team] = panels.score.counters[c].teamsScores[playerState.team];
-		}
-		// buildings panel
-		var t = 0;
-		for each (var counter in panels.buildings.counters)
-		{
-			sumTeamBuildings(counter, BUILDINGS_TYPES[t]);
-			t++;
-		}
-		// units panel
-		t = 0;
-		for each (var counter in panels.units.counters)
-		{
-			sumTeamUnits(counter, UNITS_TYPES[t]);
-			t++;
-		}
-		// resources panel
-		t = 0;
-		for each (var counter in panels.resources.counters)
-		{
-			if (t >= 4)	// only 4 first counters
-				break;
-			
-			sumResourcesGathered(counter, RESOURCES_TYPES[t]);
-			t++;
-		}
-		sumTotalResourcesGathered();
-		panels.resources.counters.treasuresCollected.teamsScores[playerState.team] += playerState.statistics.treasuresCollected;
-		panels.resources.counters.treasuresCollected.teamsScoresCaption[playerState.team] = panels.resources.counters.treasuresCollected.teamsScores[playerState.team];
-		sumResourcesTributed();
-		// market panel
-		t = 0;
-		for (var c in panels.market.counters)
-		{
-			if (t >= 4)	// only 4 first counters
-				break;
-			
-			sumResourcesExchanged(panels.market.counters[c], RESOURCES_TYPES[t]);
-			t++;
-		}
-		sumBarterEfficiency();
-		panels.market.counters.tradeIncome.teamsScores[playerState.team] += playerState.statistics.tradeIncome;
-		panels.market.counters.tradeIncome.teamsScoresCaption[playerState.team] = panels.market.counters.tradeIncome.teamsScores[playerState.team];
-		// miscelanous panel
-		sumVegetarianRatio();
-		sumFeminisation();
-		sumKillDeathRatio();
-		panels.miscelanous.counters.mapExploration.teamsScores[playerState.team] = playerState.statistics.teamPercentMapExplored;
-		panels.miscelanous.counters.mapExploration.teamsScoresCaption[playerState.team] = panels.miscelanous.counters.mapExploration.teamsScores[playerState.team] + "%";
-	}
-	
-	if (!teams)
-	{
-		selectPanel(0);
-		return;
-	}
-	
-	// Display teams totals counters
-	for (var i = 0; i < teams.length; ++i)
-	{
-		var pn = 0;
-		for each (var panel in panels)
-		{
-			var teamHeading = Engine.GetGUIObjectByName("teamHeading"+pn+"t"+i);
-			var yStart = 30 + teams[i] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 2;
-			teamHeading.size = "50 "+yStart+" 100% "+(yStart+20);
-			teamHeading.caption = translate("Team total");
-			
-			var left = 250;
-			for (var c in panel.counters)
-			{
-				var counter = Engine.GetGUIObjectByName(c+"t"+i);
-				counter.size = left + " " + yStart + " " + (left + panel.counters[c].width) + " " + (yStart+20);
-				counter.caption = panel.counters[c].teamsScoresCaption[i];
-				
-				left += panel.counters[c].width;
-			}
-			pn++;
-		}
-	}
-
 	selectPanel(0);
-}
+}
\ No newline at end of file
Index: binaries/data/mods/public/gui/summary/summary.xml
===================================================================
--- binaries/data/mods/public/gui/summary/summary.xml	(revision 16142)
+++ binaries/data/mods/public/gui/summary/summary.xml	(working copy)
@@ -9,6 +9,8 @@
 <objects>
 	<script file="gui/common/functions_civinfo.js"/>
 	<script file="gui/common/functions_utility.js"/>
+	<script file="gui/summary/countersHelper.js"/>
+	<script file="gui/summary/layoutsHelper.js"/>
 	<script file="gui/summary/summary.js"/>
 
 	<object type="image"
@@ -94,893 +96,65 @@
 				<translatableAttribute id="caption">Miscellaneous</translatableAttribute>
 			</object>
 		</object>
-		
-		<object name="scorePanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58">
 
+		<object name="generalPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58">
 			<object size="0 0 100% 100%-50">
-				<object name="playerName0Heading" type="text" style="ModernLeftTabLabelText">
+				<object name="playerNameHeading" type="text" style="ModernLeftTabLabelText">
 					<translatableAttribute id="caption">Player name</translatableAttribute>
 				</object>
-				<object name="economyScoreHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Economy score</translatableAttribute>
+				<object name="titleHeading" type="text" style="ModernTabLabelText">
 				</object>
-				<object name="militaryScoreHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Military score</translatableAttribute>
-				</object>
-				<object name="explorationScoreHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Exploration score</translatableAttribute>
-				</object>
-				<object name="totalScoreHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Total score</translatableAttribute>
-				</object>
-			</object>
-
-			<object type="image" name="teamBox0t0" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading0t0" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox0t0p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox0t0p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName0t0p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText" />
-							<object name="civIcon0t0p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="economyScoret0p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="militaryScoret0p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="explorationScoret0p[n]" type="text"  style="ModernLabelText"/>
-							<object name="totalScoret0p[n]"       type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading0t0"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="economyScoret0"     type="text" style="ModernLabelText"/>
-				<object name="militaryScoret0"    type="text" style="ModernLabelText"/>
-				<object name="explorationScoret0" type="text" style="ModernLabelText"/>
-				<object name="totalScoret0" 	  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox0t1" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading0t1" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox0t1p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox0t1p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName0t1p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon0t1p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="economyScoret1p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="militaryScoret1p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="explorationScoret1p[n]" type="text"  style="ModernLabelText"/>
-							<object name="totalScoret1p[n]"       type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading0t1"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="economyScoret1"     type="text" style="ModernLabelText"/>
-				<object name="militaryScoret1"    type="text" style="ModernLabelText"/>
-				<object name="explorationScoret1" type="text" style="ModernLabelText"/>
-				<object name="totalScoret1" 	  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox0t2" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading0t2" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox0t2p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox0t2p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName0t2p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon0t2p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="economyScoret2p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="militaryScoret2p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="explorationScoret2p[n]" type="text"  style="ModernLabelText"/>
-							<object name="totalScoret2p[n]"       type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading0t2"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="economyScoret2"     type="text" style="ModernLabelText"/>
-				<object name="militaryScoret2"    type="text" style="ModernLabelText"/>
-				<object name="explorationScoret2" type="text" style="ModernLabelText"/>
-				<object name="totalScoret2" 	  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox0t3" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading0t3" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox0t3p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox0t3p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName0t3p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon0t3p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="economyScoret3p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="militaryScoret3p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="explorationScoret3p[n]" type="text"  style="ModernLabelText"/>
-							<object name="totalScoret3p[n]"       type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading0t3"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="economyScoret3"     type="text" style="ModernLabelText"/>
-				<object name="militaryScoret3"    type="text" style="ModernLabelText"/>
-				<object name="explorationScoret3" type="text" style="ModernLabelText"/>
-				<object name="totalScoret3" 	  type="text" style="ModernLabelText"/>
-			</object>
-			
-			<object type="image" name="noTeamsBox0" size="0 65 100% 100%-50" hidden="true"> 
-				<repeat count="8">
-					<object type="image" name="playerBox0[n]" size="10 0 10 30" hidden="true">
-						<object type="image" sprite="ForegroundBox" size="10 4 34 28">
-							<object name="playerColourBox0[n]" type="image" size="2 2 22 22"/>
-						</object>
-						<object name="playerName0[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-						<object name="civIcon0[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-						<object name="economyScore[n]"     type="text"  style="ModernLabelText"/>
-						<object name="militaryScore[n]"    type="text"  style="ModernLabelText"/>
-						<object name="explorationScore[n]" type="text"  style="ModernLabelText"/>
-						<object name="totalScore[n]"       type="text"  style="ModernLabelText"/>
+				<repeat var="x" count="8">
+					<object name="Heading[x]" type="text" style="ModernTabLabelText">
+						<translatableAttribute id="caption">Demo</translatableAttribute>
 					</object>
 				</repeat>
 			</object>
-		</object>
-		
-		<object name="buildingsPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58" hidden="true">
 
-			<object size="0 0 100% 100%-50">
-				<object name="playerName1Heading" type="text" style="ModernLeftTabLabelText">
-					<translatableAttribute id="caption">Player name</translatableAttribute>
-				</object>
-				<object name="buildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Buildings Statistics (Constructed / Lost / Destroyed)</translatableAttribute>
-				</object>
-				<object name="totalBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Total</translatableAttribute>
-				</object>
-				<object name="houseBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Houses</translatableAttribute>
-				</object>
-				<object name="economicBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Economic</translatableAttribute>
-				</object>
-				<object name="outpostBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Outposts</translatableAttribute>
-				</object>
-				<object name="militaryBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Military</translatableAttribute>
-				</object> 
-				<object name="fortressBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Fortresses</translatableAttribute>
-				</object>
-				<object name="civCentreBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Civ Centers</translatableAttribute>
-				</object>
-				<object name="wonderBuildingsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Wonders</translatableAttribute>
-				</object>
-
-			</object>
-			
-			<object type="image" name="teamBox1t0" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading1t0" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox1t0p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox1t0p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName1t0p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon1t0p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="totalBuildingst0p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="houseBuildingst0p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="economicBuildingst0p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="outpostBuildingst0p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="militaryBuildingst0p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="fortressBuildingst0p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="civCentreBuildingst0p[n]" type="text"  style="ModernLabelText"/>
-							<object name="wonderBuildingst0p[n]"    type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading1t0"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalBuildingst0"     type="text" style="ModernLabelText"/>
-				<object name="houseBuildingst0"     type="text" style="ModernLabelText"/>
-				<object name="economicBuildingst0"  type="text" style="ModernLabelText"/>
-				<object name="outpostBuildingst0"   type="text" style="ModernLabelText"/>
-				<object name="militaryBuildingst0"  type="text" style="ModernLabelText"/>
-				<object name="fortressBuildingst0"  type="text" style="ModernLabelText"/>
-				<object name="civCentreBuildingst0" type="text" style="ModernLabelText"/>
-				<object name="wonderBuildingst0"    type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox1t1" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading1t1" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox1t1p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox1t1p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName1t1p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon1t1p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="totalBuildingst1p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="houseBuildingst1p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="economicBuildingst1p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="outpostBuildingst1p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="militaryBuildingst1p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="fortressBuildingst1p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="civCentreBuildingst1p[n]" type="text"  style="ModernLabelText"/>
-							<object name="wonderBuildingst1p[n]"    type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading1t1"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalBuildingst1"     type="text" style="ModernLabelText"/>
-				<object name="houseBuildingst1"     type="text" style="ModernLabelText"/>
-				<object name="economicBuildingst1"  type="text" style="ModernLabelText"/>
-				<object name="outpostBuildingst1"   type="text" style="ModernLabelText"/>
-				<object name="militaryBuildingst1"  type="text" style="ModernLabelText"/>
-				<object name="fortressBuildingst1"  type="text" style="ModernLabelText"/>
-				<object name="civCentreBuildingst1" type="text" style="ModernLabelText"/>
-				<object name="wonderBuildingst1"    type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox1t2" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading1t2" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox1t2p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox1t2p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName1t2p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon1t2p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="totalBuildingst2p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="houseBuildingst2p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="economicBuildingst2p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="outpostBuildingst2p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="militaryBuildingst2p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="fortressBuildingst2p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="civCentreBuildingst2p[n]" type="text"  style="ModernLabelText"/>
-							<object name="wonderBuildingst2p[n]"    type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading1t2"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalBuildingst2"     type="text" style="ModernLabelText"/>
-				<object name="houseBuildingst2"     type="text" style="ModernLabelText"/>
-				<object name="economicBuildingst2"  type="text" style="ModernLabelText"/>
-				<object name="outpostBuildingst2"   type="text" style="ModernLabelText"/>
-				<object name="militaryBuildingst2"  type="text" style="ModernLabelText"/>
-				<object name="fortressBuildingst2"  type="text" style="ModernLabelText"/>
-				<object name="civCentreBuildingst2" type="text" style="ModernLabelText"/>
-				<object name="wonderBuildingst2"    type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox1t3" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading1t3" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox1t3p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox1t3p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName1t3p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon1t3p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="totalBuildingst3p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="houseBuildingst3p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="economicBuildingst3p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="outpostBuildingst3p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="militaryBuildingst3p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="fortressBuildingst3p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="civCentreBuildingst3p[n]" type="text"  style="ModernLabelText"/>
-							<object name="wonderBuildingst3p[n]"    type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading1t3"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalBuildingst3"     type="text" style="ModernLabelText"/>
-				<object name="houseBuildingst3"     type="text" style="ModernLabelText"/>
-				<object name="economicBuildingst3"  type="text" style="ModernLabelText"/>
-				<object name="outpostBuildingst3"   type="text" style="ModernLabelText"/>
-				<object name="militaryBuildingst3"  type="text" style="ModernLabelText"/>
-				<object name="fortressBuildingst3"  type="text" style="ModernLabelText"/>
-				<object name="civCentreBuildingst3" type="text" style="ModernLabelText"/>
-				<object name="wonderBuildingst3"    type="text" style="ModernLabelText"/>
-			</object>
-			
-			<object type="image" name="noTeamsBox1" size="0 65 100% 100%-50" hidden="true"> 
-				<repeat count="8">
-					<object type="image" name="playerBox1[n]" size="10 0 10 30" hidden="true">
-						<object type="image" sprite="ForegroundBox" size="10 4 34 28">
-							<object name="playerColourBox1[n]" type="image" size="2 2 22 22"/>
-						</object>
-						<object name="playerName1[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-						<object name="civIcon1[n]"           type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="totalBuildings[n]"     type="text"  style="ModernLabelText"/>
-						<object name="houseBuildings[n]"     type="text"  style="ModernLabelText"/>
-						<object name="economicBuildings[n]"  type="text"  style="ModernLabelText"/>
-						<object name="outpostBuildings[n]"   type="text"  style="ModernLabelText"/>
-						<object name="militaryBuildings[n]"  type="text"  style="ModernLabelText"/>
-						<object name="fortressBuildings[n]"  type="text"  style="ModernLabelText"/>
-						<object name="civCentreBuildings[n]" type="text"  style="ModernLabelText"/>
-						<object name="wonderBuildings[n]"    type="text"  style="ModernLabelText"/>
+			<repeat count="4" var="i">
+				<object type="image" name="teamBoxt[i]" size="0 65 100% 100%-50" hidden="true">
+					<object type="text" name="teamNameHeadingt[i]" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
+					<object size="0 30 100% 100%">
+						<repeat count="8" var="n">
+							<object type="image" name="playerBoxt[i][n]" size="10 0 10 30" hidden="true">
+								<object name="playerColourBoxt[i][n]" type="image" size="10 4 30 24"/>
+								<object name="playerNamet[i][n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText" />
+								<object name="civIcont[i][n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+								<repeat var="x" count="8">
+									<object name="valueDataTeam[i][n][x]" type="text" style="ModernTabLabelText">
+										<translatableAttribute id="caption">DemoOhsi</translatableAttribute>
+									</object>
+								</repeat>
+							</object>
+						</repeat>
 					</object>
-				</repeat>
-			</object>
-		</object>
-		
-		<object name="unitsPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58" hidden="true">
-
-			<object size="0 0 100% 100%-50">
-				<object name="playerName2Heading" type="text" style="ModernLeftTabLabelText">
-					<translatableAttribute id="caption">Player name</translatableAttribute>
-				</object>
-				<object name="unitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Units Statistics (Trained / Lost / Killed)</translatableAttribute>
-				</object>
-				<object name="totalUnitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Total</translatableAttribute>
-				</object>
-				<object name="infantryUnitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Infantry</translatableAttribute>
-				</object>
-				<object name="workerUnitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Worker</translatableAttribute>
-				</object>
-				<object name="cavalryUnitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Cavalry</translatableAttribute>
-				</object>
-				<object name="championUnitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Champion</translatableAttribute>
-				</object>
-				<object name="heroesUnitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Heroes</translatableAttribute>
-				</object>
-				<object name="navyUnitsHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Navy</translatableAttribute>
-				</object>
-			</object>
-			
-			<object type="image" name="teamBox2t0" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading2t0" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox2t0p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox2t0p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName2t0p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon2t0p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-							<object name="totalUnitst0p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="infantryUnitst0p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="workerUnitst0p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="cavalryUnitst0p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="championUnitst0p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="heroesUnitst0p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="navyUnitst0p[n]"        type="text"  style="ModernLabelText"/>
+					<object name="teamHeadingt[i]"     type="text" style="ModernLeftTabLabelText"/>
+					<repeat var="x" count="8">
+						<object name="valueDataTeam[i][x]" type="text" style="ModernTabLabelText">
+							<translatableAttribute id="caption">DemoNormal</translatableAttribute>
 						</object>
 					</repeat>
 				</object>
-				<object name="teamHeading2t0"  type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalUnitst0"    type="text" style="ModernLabelText"/>
-				<object name="infantryUnitst0" type="text" style="ModernLabelText"/>
-				<object name="workerUnitst0"   type="text" style="ModernLabelText"/>
-				<object name="cavalryUnitst0"  type="text" style="ModernLabelText"/>
-				<object name="championUnitst0" type="text" style="ModernLabelText"/>
-				<object name="heroesUnitst0"   type="text" style="ModernLabelText"/>
-				<object name="navyUnitst0"     type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox2t1" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading2t1" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox2t1p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox2t1p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName2t1p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon2t1p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-							<object name="totalUnitst1p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="infantryUnitst1p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="workerUnitst1p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="cavalryUnitst1p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="championUnitst1p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="heroesUnitst1p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="navyUnitst1p[n]"        type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading2t1"  type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalUnitst1"    type="text" style="ModernLabelText"/>
-				<object name="infantryUnitst1" type="text" style="ModernLabelText"/>
-				<object name="workerUnitst1"   type="text" style="ModernLabelText"/>
-				<object name="cavalryUnitst1"  type="text" style="ModernLabelText"/>
-				<object name="championUnitst1" type="text" style="ModernLabelText"/>
-				<object name="heroesUnitst1"   type="text" style="ModernLabelText"/>
-				<object name="navyUnitst1"     type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox2t2" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading2t2" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox2t2p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox2t2p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName2t2p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon2t2p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-							<object name="totalUnitst2p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="infantryUnitst2p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="workerUnitst2p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="cavalryUnitst2p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="championUnitst2p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="heroesUnitst2p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="navyUnitst2p[n]"        type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading2t2"  type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalUnitst2"    type="text" style="ModernLabelText"/>
-				<object name="infantryUnitst2" type="text" style="ModernLabelText"/>
-				<object name="workerUnitst2"   type="text" style="ModernLabelText"/>
-				<object name="cavalryUnitst2"  type="text" style="ModernLabelText"/>
-				<object name="championUnitst2" type="text" style="ModernLabelText"/>
-				<object name="heroesUnitst2"   type="text" style="ModernLabelText"/>
-				<object name="navyUnitst2"     type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox2t3" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading2t3" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox2t3p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox2t3p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName2t3p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon2t3p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-							<object name="totalUnitst3p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="infantryUnitst3p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="workerUnitst3p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="cavalryUnitst3p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="championUnitst3p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="heroesUnitst3p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="navyUnitst3p[n]"        type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading2t3"  type="text" style="ModernLeftTabLabelText"/>
-				<object name="totalUnitst3"    type="text" style="ModernLabelText"/>
-				<object name="infantryUnitst3" type="text" style="ModernLabelText"/>
-				<object name="workerUnitst3"   type="text" style="ModernLabelText"/>
-				<object name="cavalryUnitst3"  type="text" style="ModernLabelText"/>
-				<object name="championUnitst3" type="text" style="ModernLabelText"/>
-				<object name="heroesUnitst3"   type="text" style="ModernLabelText"/>
-				<object name="navyUnitst3"     type="text" style="ModernLabelText"/>
-			</object>
+			</repeat>
 
-			<object type="image" name="noTeamsBox2" size="0 65 100% 100%-50" hidden="true"> 
+			<object type="image" name="noTeamsBox" size="0 65 100% 100%-50" hidden="true"> 
 				<repeat count="8">
-					<object type="image" name="playerBox2[n]" size="10 0 10 30" hidden="true">
+					<object type="image" name="playerBox[n]" size="10 0 10 30" hidden="true">
 						<object type="image" sprite="ForegroundBox" size="10 4 34 28">
-							<object name="playerColourBox2[n]" type="image" size="2 2 22 22"/>
+							<object name="playerColourBox[n]" type="image" size="2 2 22 22"/>
 						</object>
-						<object name="playerName2[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-						<object name="civIcon2[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-						<object name="totalUnits[n]"       type="text"  style="ModernLabelText"/>
-						<object name="infantryUnits[n]"    type="text"  style="ModernLabelText"/>
-						<object name="workerUnits[n]"      type="text"  style="ModernLabelText"/>
-						<object name="cavalryUnits[n]"     type="text"  style="ModernLabelText"/>
-						<object name="championUnits[n]"    type="text"  style="ModernLabelText"/>
-						<object name="heroesUnits[n]"      type="text"  style="ModernLabelText"/>
-						<object name="navyUnits[n]"        type="text"  style="ModernLabelText"/>
+						<object name="playerName[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
+						<object name="civIcon[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+						<repeat var="x" count="8">
+							<object name="valueData[n][x]" type="text" style="ModernTabLabelText">
+								<translatableAttribute id="caption">DemoValueData</translatableAttribute>
+							</object>
+						</repeat>
 					</object>
 				</repeat>
 			</object>
 		</object>
-		
-		<object name="resourcesPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58" hidden="true">
-
-			<object size="0 0 100% 100%-50">
-				<object name="playerName3Heading" type="text" style="ModernLeftTabLabelText">
-					<translatableAttribute id="caption">Player name</translatableAttribute>
-				</object>
-				<object name="resourceHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Resource Statistics (Gathered / Used)</translatableAttribute>
-				</object>
-				<object name="foodGatheredHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Food</translatableAttribute>
-				</object>
-				<object name="woodGatheredHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Wood</translatableAttribute>
-				</object>
-				<object name="stoneGatheredHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Stone</translatableAttribute>
-				</object>
-				<object name="metalGatheredHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Metal</translatableAttribute>
-				</object>
-				<object name="totalGatheredHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Total</translatableAttribute>
-				</object>
-				<object name="treasuresCollectedHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Treasures collected</translatableAttribute>
-				</object>
-				<object name="resourcesTributedHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Tributes (Sent / Received)</translatableAttribute>
-				</object>
-			</object>
-
-			<object type="image" name="teamBox3t0" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading3t0" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox3t0p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox3t0p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName3t0p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon3t0p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="foodGatheredt0p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="woodGatheredt0p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="stoneGatheredt0p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="metalGatheredt0p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="totalGatheredt0p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="treasuresCollectedt0p[n]" type="text"  style="ModernLabelText"/>
-							<object name="resourcesTributedt0p[n]"  type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading3t0"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="foodGatheredt0"       type="text" style="ModernLabelText"/>
-				<object name="woodGatheredt0"       type="text" style="ModernLabelText"/>
-				<object name="stoneGatheredt0"      type="text" style="ModernLabelText"/>
-				<object name="metalGatheredt0"      type="text" style="ModernLabelText"/>
-				<object name="totalGatheredt0"      type="text" style="ModernLabelText"/>
-				<object name="treasuresCollectedt0" type="text" style="ModernLabelText"/>
-				<object name="resourcesTributedt0"  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox3t1" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading3t1" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox3t1p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox3t1p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName3t1p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon3t1p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="foodGatheredt1p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="woodGatheredt1p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="stoneGatheredt1p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="metalGatheredt1p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="totalGatheredt1p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="treasuresCollectedt1p[n]" type="text"  style="ModernLabelText"/>
-							<object name="resourcesTributedt1p[n]"  type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading3t1"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="foodGatheredt1"       type="text" style="ModernLabelText"/>
-				<object name="woodGatheredt1"       type="text" style="ModernLabelText"/>
-				<object name="stoneGatheredt1"      type="text" style="ModernLabelText"/>
-				<object name="metalGatheredt1"      type="text" style="ModernLabelText"/>
-				<object name="totalGatheredt1"      type="text" style="ModernLabelText"/>
-				<object name="treasuresCollectedt1" type="text" style="ModernLabelText"/>
-				<object name="resourcesTributedt1"  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox3t2" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading3t2" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox3t2p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox3t2p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName3t2p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon3t2p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="foodGatheredt2p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="woodGatheredt2p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="stoneGatheredt2p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="metalGatheredt2p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="totalGatheredt2p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="treasuresCollectedt2p[n]" type="text"  style="ModernLabelText"/>
-							<object name="resourcesTributedt2p[n]"  type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading3t2"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="foodGatheredt2"       type="text" style="ModernLabelText"/>
-				<object name="woodGatheredt2"       type="text" style="ModernLabelText"/>
-				<object name="stoneGatheredt2"      type="text" style="ModernLabelText"/>
-				<object name="metalGatheredt2"      type="text" style="ModernLabelText"/>
-				<object name="totalGatheredt2"      type="text" style="ModernLabelText"/>
-				<object name="treasuresCollectedt2" type="text" style="ModernLabelText"/>
-				<object name="resourcesTributedt2"  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox3t3" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading3t3" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox3t3p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox3t3p[n]"   type="image" size="10 4 30 24"/>
-							<object name="playerName3t3p[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon3t3p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="foodGatheredt3p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="woodGatheredt3p[n]"       type="text"  style="ModernLabelText"/>
-							<object name="stoneGatheredt3p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="metalGatheredt3p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="totalGatheredt3p[n]"      type="text"  style="ModernLabelText"/>
-							<object name="treasuresCollectedt3p[n]" type="text"  style="ModernLabelText"/>
-							<object name="resourcesTributedt3p[n]"  type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading3t3"       type="text" style="ModernLeftTabLabelText"/>
-				<object name="foodGatheredt3"       type="text" style="ModernLabelText"/>
-				<object name="woodGatheredt3"       type="text" style="ModernLabelText"/>
-				<object name="stoneGatheredt3"      type="text" style="ModernLabelText"/>
-				<object name="metalGatheredt3"      type="text" style="ModernLabelText"/>
-				<object name="totalGatheredt3"      type="text" style="ModernLabelText"/>
-				<object name="treasuresCollectedt3" type="text" style="ModernLabelText"/>
-				<object name="resourcesTributedt3"  type="text" style="ModernLabelText"/>
-			</object>
-			
-			<object type="image" name="noTeamsBox3" size="0 65 100% 100%-50" hidden="true"> 
-				<repeat count="8">
-					<object type="image" name="playerBox3[n]" size="10 0 10 30" hidden="true">
-						<object type="image" sprite="ForegroundBox" size="10 4 34 28">
-							<object name="playerColourBox3[n]" type="image" size="2 2 22 22"/>
-						</object>
-						<object name="playerName3[n]"        type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-						<object name="civIcon3[n]"           type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="foodGathered[n]"       type="text"  style="ModernLabelText"/>
-						<object name="woodGathered[n]"       type="text"  style="ModernLabelText"/>
-						<object name="stoneGathered[n]"      type="text"  style="ModernLabelText" />
-						<object name="metalGathered[n]"      type="text"  style="ModernLabelText"/>
-						<object name="totalGathered[n]"      type="text"  style="ModernLabelText"/>
-						<object name="treasuresCollected[n]" type="text"  style="ModernLabelText"/>
-						<object name="resourcesTributed[n]"  type="text"  style="ModernLabelText"/>
-					</object>
-				</repeat>
-			</object>
-		</object>
-		
-		<object name="marketPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58" hidden="true">
-
-			<object size="0 0 100% 100%-50">
-				<object name="playerName4Heading" type="text" style="ModernLeftTabLabelText">
-					<translatableAttribute id="caption">Player name</translatableAttribute>
-				</object>
-				<object name="exchangedFoodHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Food exchanged</translatableAttribute>
-				</object>
-				<object name="exchangedWoodHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Wood exchanged</translatableAttribute>
-				</object>
-				<object name="exchangedStoneHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Stone exchanged</translatableAttribute>
-				</object>
-				<object name="exchangedMetalHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Metal exchanged</translatableAttribute>
-				</object>
-				<object name="barterEfficiencyHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Barter efficiency</translatableAttribute>
-				</object>
-				<object name="tradeIncomeHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Trade income</translatableAttribute>
-				</object>
-			</object>
-			
-			<object type="image" name="teamBox4t0" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading4t0" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox4t0p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox4t0p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName4t0p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon4t0p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="exchangedFoodt0p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedWoodt0p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedStonet0p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="exchangedMetalt0p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="barterEfficiencyt0p[n]" type="text"  style="ModernLabelText"/>
-							<object name="tradeIncomet0p[n]"      type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading4t0"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="exchangedFoodt0"    type="text" style="ModernLabelText"/>
-				<object name="exchangedWoodt0"    type="text" style="ModernLabelText"/>
-				<object name="exchangedStonet0"   type="text" style="ModernLabelText"/>
-				<object name="exchangedMetalt0"   type="text" style="ModernLabelText"/>
-				<object name="barterEfficiencyt0" type="text" style="ModernLabelText"/>
-				<object name="tradeIncomet0"      type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox4t1" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading4t1" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox4t1p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox4t1p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName4t1p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon4t1p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="exchangedFoodt1p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedWoodt1p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedStonet1p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="exchangedMetalt1p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="barterEfficiencyt1p[n]" type="text"  style="ModernLabelText"/>
-							<object name="tradeIncomet1p[n]"      type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading4t1"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="exchangedFoodt1"    type="text" style="ModernLabelText"/>
-				<object name="exchangedWoodt1"    type="text" style="ModernLabelText"/>
-				<object name="exchangedStonet1"   type="text" style="ModernLabelText"/>
-				<object name="exchangedMetalt1"   type="text" style="ModernLabelText"/>
-				<object name="barterEfficiencyt1" type="text" style="ModernLabelText"/>
-				<object name="tradeIncomet1"      type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox4t2" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading4t2" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox4t2p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox4t2p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName4t2p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon4t2p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="exchangedFoodt2p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedWoodt2p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedStonet2p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="exchangedMetalt2p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="barterEfficiencyt2p[n]" type="text"  style="ModernLabelText"/>
-							<object name="tradeIncomet2p[n]"      type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading4t2"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="exchangedFoodt2"    type="text" style="ModernLabelText"/>
-				<object name="exchangedWoodt2"    type="text" style="ModernLabelText"/>
-				<object name="exchangedStonet2"   type="text" style="ModernLabelText"/>
-				<object name="exchangedMetalt2"   type="text" style="ModernLabelText"/>
-				<object name="barterEfficiencyt2" type="text" style="ModernLabelText"/>
-				<object name="tradeIncomet2"      type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox4t3" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading4t3" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox4t3p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox4t3p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName4t3p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon4t3p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="exchangedFoodt3p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedWoodt3p[n]"    type="text"  style="ModernLabelText"/>
-							<object name="exchangedStonet3p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="exchangedMetalt3p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="barterEfficiencyt3p[n]" type="text"  style="ModernLabelText"/>
-							<object name="tradeIncomet3p[n]"      type="text"  style="ModernLabelText"/>
-						</object>
-					</repeat>
-				</object>
-				<object name="teamHeading4t3"     type="text" style="ModernLeftTabLabelText"/>
-				<object name="exchangedFoodt3"    type="text" style="ModernLabelText"/>
-				<object name="exchangedWoodt3"    type="text" style="ModernLabelText"/>
-				<object name="exchangedStonet3"   type="text" style="ModernLabelText"/>
-				<object name="exchangedMetalt3"   type="text" style="ModernLabelText"/>
-				<object name="barterEfficiencyt3" type="text" style="ModernLabelText"/>
-				<object name="tradeIncomet3"      type="text" style="ModernLabelText"/>
-			</object>
-			
-			<object type="image" name="noTeamsBox4" size="0 65 100% 100%-50" hidden="true"> 
-				<repeat count="8">
-					<object type="image" name="playerBox4[n]" size="10 0 10 30" hidden="true">
-						<object type="image" sprite="ForegroundBox" size="10 4 34 28">
-							<object name="playerColourBox4[n]" type="image" size="2 2 22 22"/>
-						</object>
-						<object name="playerName4[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-						<object name="civIcon4[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-						<object name="exchangedFood[n]"    type="text"  style="ModernLabelText"/>
-						<object name="exchangedWood[n]"    type="text"  style="ModernLabelText"/>
-						<object name="exchangedStone[n]"   type="text"  style="ModernLabelText"/>
-						<object name="exchangedMetal[n]"   type="text"  style="ModernLabelText"/>
-						<object name="barterEfficiency[n]" type="text"  style="ModernLabelText"/>
-						<object name="tradeIncome[n]"      type="text"  style="ModernLabelText"/>
-					</object>
-				</repeat>
-			</object>
-		</object>
-
-		<object name="miscPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58" hidden="true">
-
-			<object size="0 0 100% 100%-50">
-				<object name="playerName5Heading" type="text" style="ModernLeftTabLabelText">
-					<translatableAttribute id="caption">Player name</translatableAttribute>
-				</object>
-				<object name="vegetarianRatioHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Vegetarian\nratio</translatableAttribute>
-				</object>
-				<object name="feminisationHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Feminisation</translatableAttribute>
-				</object>
-				<object name="killDeathRatioHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Kill / Death\nratio</translatableAttribute>
-				</object>
-				<object name="mapExplorationHeading" type="text" style="ModernTabLabelText">
-					<translatableAttribute id="caption">Map\nexploration</translatableAttribute>
-				</object>
-			</object>
-			
-			<object type="image" name="teamBox5t0" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading5t0" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox5t0p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox5t0p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName5t0p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon5t0p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="vegetarianRatiot0p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="feminisationt0p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="killDeathRatiot0p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="mapExplorationt0p[n]"   type="text"  style="ModernLabelText"/>
-						</object>	
-					</repeat>
-				</object>
-				<object name="teamHeading5t0"    type="text" style="ModernLeftTabLabelText"/>
-				<object name="vegetarianRatiot0" type="text" style="ModernLabelText"/>
-				<object name="feminisationt0"    type="text" style="ModernLabelText"/>
-				<object name="killDeathRatiot0"  type="text" style="ModernLabelText"/>
-				<object name="mapExplorationt0"  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox5t1" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading5t1" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox5t1p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox5t1p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName5t1p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon5t1p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="vegetarianRatiot1p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="feminisationt1p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="killDeathRatiot1p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="mapExplorationt1p[n]"   type="text"  style="ModernLabelText"/>
-						</object>	
-					</repeat>
-				</object>
-				<object name="teamHeading5t1"    type="text" style="ModernLeftTabLabelText"/>
-				<object name="vegetarianRatiot1" type="text" style="ModernLabelText"/>
-				<object name="feminisationt1"    type="text" style="ModernLabelText"/>
-				<object name="killDeathRatiot1"  type="text" style="ModernLabelText"/>
-				<object name="mapExplorationt1"  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox5t2" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading5t2" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox5t2p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox5t2p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName5t2p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon5t2p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="vegetarianRatiot2p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="feminisationt2p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="killDeathRatiot2p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="mapExplorationt2p[n]"   type="text"  style="ModernLabelText"/>
-						</object>	
-					</repeat>
-				</object>
-				<object name="teamHeading5t2"    type="text" style="ModernLeftTabLabelText"/>
-				<object name="vegetarianRatiot2" type="text" style="ModernLabelText"/>
-				<object name="feminisationt2"    type="text" style="ModernLabelText"/>
-				<object name="killDeathRatiot2"  type="text" style="ModernLabelText"/>
-				<object name="mapExplorationt2"  type="text" style="ModernLabelText"/>
-			</object>
-			<object type="image" name="teamBox5t3" size="0 65 100% 100%-50" hidden="true">
-				<object type="text" name="teamNameHeading5t3" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
-				<object size="0 30 100% 100%">
-					<repeat count="8">
-						<object type="image" name="playerBox5t3p[n]" size="10 0 10 30" hidden="true">
-							<object name="playerColourBox5t3p[n]" type="image" size="10 4 30 24"/>
-							<object name="playerName5t3p[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-							<object name="civIcon5t3p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
-							<object name="vegetarianRatiot3p[n]"  type="text"  style="ModernLabelText"/>
-							<object name="feminisationt3p[n]"     type="text"  style="ModernLabelText"/>
-							<object name="killDeathRatiot3p[n]"   type="text"  style="ModernLabelText"/>
-							<object name="mapExplorationt3p[n]"   type="text"  style="ModernLabelText"/>
-						</object>	
-					</repeat>
-				</object>
-				<object name="teamHeading5t3"    type="text" style="ModernLeftTabLabelText"/>
-				<object name="vegetarianRatiot3" type="text" style="ModernLabelText"/>
-				<object name="feminisationt3"    type="text" style="ModernLabelText"/>
-				<object name="killDeathRatiot3"  type="text" style="ModernLabelText"/>
-				<object name="mapExplorationt3"  type="text" style="ModernLabelText"/>
-			</object>
-			
-			<object type="image" name="noTeamsBox5" size="0 65 100% 100%-50" hidden="true"> 
-				<repeat count="8">
-					<object type="image" name="playerBox5[n]" size="10 0 10 30" hidden="true">
-						<object type="image" sprite="ForegroundBox" size="10 4 34 28">
-							<object name="playerColourBox5[n]" type="image" size="2 2 22 22"/>
-						</object>
-						<object name="playerName5[n]"      type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
-						<object name="civIcon5[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="vegetarianRatio[n]"  type="text"  style="ModernLabelText"/>
-						<object name="feminisation[n]"     type="text"  style="ModernLabelText"/>
-						<object name="killDeathRatio[n]"   type="text"  style="ModernLabelText"/>
-						<object name="mapExploration[n]"   type="text"  style="ModernLabelText"/>
-					</object>	
-				</repeat>
-			</object>
-		</object>
-		
+	
 		<object type="button" style="StoneButton" size="100%-164 100%-52 100%-24 100%-24">
 			<translatableAttribute id="caption">Continue</translatableAttribute>
 			<action on="Press"><![CDATA[
@@ -997,4 +171,4 @@
 			</action>
 		</object>
 	</object>
-</objects>
+</objects>
\ No newline at end of file