Index: binaries/data/mods/public/gui/session/session.js
===================================================================
--- binaries/data/mods/public/gui/session/session.js	(revision 14702)
+++ binaries/data/mods/public/gui/session/session.js	(working copy)
@@ -850,119 +850,166 @@
 {
 	if (!Engine.HasXmppClient())
 		return;
+	// units
+	var unitsClasses = [
+		"total",
+		"Infantry",
+		"Worker",
+		"Female",
+		"Cavalry",
+		"Champion",
+		"Hero",
+		"Ship"
+	];
+	var unitsCountersTypes = [
+		"unitsTrained",
+		"unitsLost",
+		"enemyUnitsKilled"
+	];
+	// buildings
+	var buildingsClasses = [
+		"total",
+		"CivCentre",
+		"House",
+		"Economic",
+		"Outpost",
+		"Military",
+		"Fortress",
+		"Wonder"
+	];
+	var buildingsCountersTypes = [
+		"buildingsConstructed",
+		"buildingsLost",
+		"enemyBuildingsDestroyed"
+	];
+	// resources
+	var resourcesTypes = [
+		"wood",
+		"food",
+		"stone",
+		"metal"
+	];
+	var resourcesCounterTypes = [
+		"resourcesGathered",
+		"resourcesUsed",
+		"resourcesSold",
+		"resourcesBought"
+	];
+	
 
-	// Resources gathered and used
-	var playerFoodGatheredString = "";
-	var playerWoodGatheredString  = "";
-	var playerStoneGatheredString = "";
-	var playerMetalGatheredString = "";
-	var playerFoodUsedString = "";
-	var playerWoodUsedString  = "";
-	var playerStoneUsedString = "";
-	var playerMetalUsedString = "";
-	// Resources exchanged
-	var playerFoodBoughtString = "";
-	var playerWoodBoughtString = "";
-	var playerStoneBoughtString = "";
-	var playerMetalBoughtString = "";
-	var playerFoodSoldString = "";
-	var playerWoodSoldString = "";
-	var playerStoneSoldString = "";
-	var playerMetalSoldString = "";
-	var playerTradeIncomeString = "";
+	var playerStatistics = { };
+	
 	// Unit Stats
-	var playerUnitsLostString = "";
-	var playerUnitsTrainedString = "";
-	var playerEnemyUnitsKilledString = "";
+	for each (var unitCounterType in unitsCountersTypes)
+	{
+		if (!playerStatistics[unitCounterType])
+			playerStatistics[unitCounterType] = { };
+		for each (var unitsClass in unitsClasses)
+			playerStatistics[unitCounterType][unitsClass] = "";
+	}
+			
+	playerStatistics.unitsLostValue = "";
+	playerStatistics.unitsKilledValue = "";
 	// Building stats
-	var playerBuildingsConstructedString = "";
-	var playerBuildingsLostString = "";
-	var playerEnemyBuildingsDestroyedString = "";
-	var playerCivCentersBuiltString = "";
-	var playerEnemyCivCentersDestroyedString = "";
+	for each (var buildingCounterType in buildingsCountersTypes)
+	{
+		if (!playerStatistics[buildingCounterType])
+			playerStatistics[buildingCounterType] = { };
+		for each (var buildingsClass in buildingsClasses)
+			playerStatistics[buildingCounterType][buildingsClass] = "";
+	}
+			
+	playerStatistics.buildingsLostValue = "";
+	playerStatistics.enemyBuildingsDestroyedValue = "";
+	// Resources
+	for each (var resourcesCounterType in resourcesCounterTypes)
+	{
+		if (!playerStatistics[resourcesCounterType])
+			playerStatistics[resourcesCounterType] = { };
+		for each (var resourcesType in resourcesTypes)
+			playerStatistics[resourcesCounterType][resourcesType] = "";
+	}
+	playerStatistics.resourcesGathered.vegetarianFood = "";
+			
+	playerStatistics.tradeIncome = "";
 	// Tribute
-	var playerTributeSentString = "";
-	var playerTributeReceivedString = "";
+	playerStatistics.tributesSent = "";
+	playerStatistics.tributesReceived = "";
 	// Various
+	playerStatistics.treasuresCollected = "";
+	playerStatistics.feminisation = "";
+	playerStatistics.percentMapExplored = "";
 	var mapName = Engine.GetMapSettings().Name;
-	var playerStatesString = "";
-	var playerCivsString = "";
-	var playerPercentMapExploredString = "";
-	var playerTreasuresCollectedString = "";
+	var playerStates = "";
+	var playerCivs = "";
+	var teams = "";
+	var teamsLocked = true;
 
 	// Serialize the statistics for each player into a comma-separated list.
 	for each (var player in extendedSimState.players)
 	{
-		playerStatesString += player.state + ",";
-		playerCivsString += player.civ + ",";
-		playerFoodGatheredString += player.statistics.resourcesGathered.food + ",";
-		playerWoodGatheredString += player.statistics.resourcesGathered.wood + ",";
-		playerStoneGatheredString += player.statistics.resourcesGathered.stone + ",";
-		playerMetalGatheredString += player.statistics.resourcesGathered.metal + ",";
-		playerFoodUsedString += player.statistics.resourcesUsed.food + ",";
-		playerWoodUsedString += player.statistics.resourcesUsed.wood + ",";
-		playerStoneUsedString += player.statistics.resourcesUsed.stone + ",";
-		playerMetalUsedString += player.statistics.resourcesUsed.metal + ",";
-		playerUnitsLostString += player.statistics.unitsLost + ",";
-		playerUnitsTrainedString += player.statistics.unitsTrained + ",";
-		playerEnemyUnitsKilledString += player.statistics.enemyUnitsKilled + ",";
-		playerBuildingsConstructedString += player.statistics.buildingsConstructed + ",";
-		playerBuildingsLostString += player.statistics.buildingsLost + ",";
-		playerEnemyBuildingsDestroyedString += player.statistics.enemyBuildingsDestroyed + ",";
-		playerFoodBoughtString += player.statistics.resourcesBought.food + ",";
-		playerWoodBoughtString += player.statistics.resourcesBought.wood + ",";
-		playerStoneBoughtString += player.statistics.resourcesBought.stone + ",";
-		playerMetalBoughtString += player.statistics.resourcesBought.metal + ",";
-		playerFoodSoldString += player.statistics.resourcesSold.food + ",";
-		playerWoodSoldString += player.statistics.resourcesSold.wood + ",";
-		playerStoneSoldString += player.statistics.resourcesSold.stone + ",";
-		playerMetalSoldString += player.statistics.resourcesSold.metal + ",";
-		playerTributeSentString += player.statistics.tributesSent + ",";
-		playerTributeReceivedString += player.statistics.tributesReceived + ",";
-		playerPercentMapExploredString += player.statistics.precentMapExplored = ",";
-		playerCivCentersBuiltString += player.statistics.civCentresBuilt + ",";
-		playerEnemyCivCentersDestroyedString += player.statistics.enemyCivCentresDestroyed + ",";
-		playerTreasuresCollectedString += player.statistics.treasuresCollected + ",";
-		playerTradeIncomeString += player.statistics.tradeIncome + ",";
+		playerStates += player.state + ",";
+		playerCivs += player.civ + ",";
+		teams += player.team + ",";
+		teamsLocked = teamsLocked && player.teamsLocked;
+		for each (var resourcesCounterType in resourcesCounterTypes)
+			for each (var resourcesType in resourcesTypes)
+				playerStatistics[resourcesCounterType][resourcesType] += player.statistics[resourcesCounterType][resourcesType] + ",";
+		playerStatistics.resourcesGathered.vegetarianFood += player.statistics.resourcesGathered.vegetarianFood + ",";
+				
+		for each (var unitCounterType in unitsCountersTypes)
+			for each (var unitsClass in unitsClasses)
+				playerStatistics[unitCounterType][unitsClass] += player.statistics[unitCounterType][unitsClass] + ",";
+				
+		for each (var buildingCounterType in buildingsCountersTypes)
+			for each (var buildingsClass in buildingsClasses)
+				playerStatistics[buildingCounterType][buildingsClass] += player.statistics[buildingCounterType][buildingsClass] + ",";
+				
+		playerStatistics.tradeIncome += player.statistics.tradeIncome + ",";
+		playerStatistics.tributesSent += player.statistics.tributesSent + ",";
+		playerStatistics.tributesReceived += player.statistics.tributesReceived + ",";
+		playerStatistics.percentMapExplored += player.statistics.percentMapExplored + ",";
+		playerStatistics.treasuresCollected += player.statistics.treasuresCollected + ",";
 	}
 
 	// Send the report with serialized data
-	Engine.SendGameReport({
-			"timeElapsed" : extendedSimState.timeElapsed,
-			"playerStates" : playerStatesString,
-			"playerID": Engine.GetPlayerID(),
-			"matchID": g_MatchID,
-			"civs" : playerCivsString,
-			"mapName" : mapName,
-			"foodGathered": playerFoodGatheredString,
-			"woodGathered": playerWoodGatheredString,
-			"stoneGathered": playerStoneGatheredString,
-			"metalGathered": playerMetalGatheredString,
-			"foodUsed": playerFoodUsedString,
-			"woodUsed": playerWoodUsedString,
-			"stoneUsed": playerStoneUsedString,
-			"metalUsed": playerMetalUsedString,
-			"unitsLost": playerUnitsLostString,
-			"unitsTrained": playerUnitsTrainedString,
-			"enemyUnitsKilled": playerEnemyUnitsKilledString,
-			"buildingsLost": playerBuildingsLostString,
-			"buildingsConstructed": playerBuildingsConstructedString,
-			"enemyBuildingsDestroyed": playerEnemyBuildingsDestroyedString,
-			"foodBought": playerFoodBoughtString,
-			"woodBought": playerWoodBoughtString,
-			"stoneBought": playerStoneBoughtString,
-			"metalBought": playerMetalBoughtString,
-			"foodSold": playerFoodSoldString,
-			"woodSold": playerWoodSoldString,
-			"stoneSold": playerStoneSoldString,
-			"metalSold": playerMetalSoldString,
-			"tributeSent": playerTributeSentString,
-			"tributeReceived": playerTributeReceivedString,
-			"precentMapExplored": playerPercentMapExploredString,
-			"civCentersBuilt": playerCivCentersBuiltString,
-			"enemyCivCentersDestroyed": playerEnemyCivCentersDestroyedString,
-			"treasuresCollected": playerTreasuresCollectedString,
-			"tradeIncome": playerTradeIncomeString
-		});
+	var reportObject = { };
+	reportObject.timeElapsed = extendedSimState.timeElapsed;
+	reportObject.playerStates = playerStates;
+	reportObject.playerID = Engine.GetPlayerID();
+	reportObject.matchID = g_MatchID;
+	reportObject.civs = playerCivs;
+	reportObject.teams = teams;
+	reportObject.teamsLocked = teamsLocked;
+	reportObject.mapName = mapName;
+	for each (var rct in resourcesCounterTypes)
+	{
+		for each (var rt in resourcesTypes)
+			reportObject[rt+rct.substr(9)] = playerStatistics[rct][rt];
+			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
+	}
+	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
+	for each (var type in unitsClasses)
+	{
+		// eg. type = Infantry (type.substr(0,1)).toLowerCase()+type.substr(1) = infantry
+		reportObject[(type.substr(0,1)).toLowerCase()+type.substr(1)+"UnitsTrained"] = playerStatistics.unitsTrained[type];
+		reportObject[(type.substr(0,1)).toLowerCase()+type.substr(1)+"UnitsLost"] = playerStatistics.unitsLost[type];
+		reportObject["enemy"+type+"UnitsKilled"] = playerStatistics.enemyUnitsKilled[type];
+	}
+	for each (var type in buildingsClasses)
+	{
+		reportObject[(type.substr(0,1)).toLowerCase()+type.substr(1)+"BuildingsConstructed"] = playerStatistics.buildingsConstructed[type];
+		reportObject[(type.substr(0,1)).toLowerCase()+type.substr(1)+"BuildingsLost"] = playerStatistics.buildingsLost[type];
+		reportObject["enemy"+type+"BuildingsDestroyed"] = playerStatistics.enemyBuildingsDestroyed[type];
+	}	
+	reportObject.tributesSent = playerStatistics.tributesSent;
+	reportObject.tributesReceived = playerStatistics.tributesReceived;
+	reportObject.precentMapExplored = playerStatistics.percentMapExplored;
+	reportObject.treasuresCollected = playerStatistics.treasuresCollected;
+	reportObject.tradeIncome = playerStatistics.tradeIncome;
+	
+	Engine.SendGameReport(reportObject);
 }
 
+
+
Index: binaries/data/mods/public/gui/summary/summary.js
===================================================================
--- binaries/data/mods/public/gui/summary/summary.js	(revision 14702)
+++ binaries/data/mods/public/gui/summary/summary.js	(working copy)
@@ -1,9 +1,6 @@
 // Max player slots for any map (should read from config)
 const MAX_SLOTS = 8;
 
-var panelNames = [ 'scorePanel', 'unitsBuildingsPanel', 'conquestPanel', 'resourcesPanel', 'marketPanel' ];
-var panelButtonNames = [ 'scorePanelButton', 'unitsBuildingsPanelButton', 'conquestPanelButton', 'resourcesPanelButton', 'marketPanelButton' ];
-
 /**
  * Select active panel
  * @param panelNumber Number of panel, which should get active state (integer)
@@ -10,33 +7,504 @@
  */
 function selectPanel(panelNumber)
 {
+	var panelNames = [ 'scorePanel', 'buildingsPanel', 'unitsPanel', 'resourcesPanel', 'marketPanel', 'miscPanel' ];
+	
+	function adjustTabDividers(tabSize)
+	{
+		var leftSpacer = Engine.GetGUIObjectByName("tabDividerLeft");
+		var rightSpacer = Engine.GetGUIObjectByName("tabDividerRight");
+		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++)
 	{
 		if (i != panelNumber)
 		{
 			Engine.GetGUIObjectByName(panelNames[i]).hidden = true;
-			Engine.GetGUIObjectByName(panelButtonNames[i]).sprite = "BackgroundTab";
+			Engine.GetGUIObjectByName(panelNames[i] + 'Button').sprite = "BackgroundTab";
 		}
 		else
 		{
 			Engine.GetGUIObjectByName(panelNames[i]).hidden = false;
-			Engine.GetGUIObjectByName(panelButtonNames[i]).sprite = "ForegroundTab";
-			adjustTabDividers(Engine.GetGUIObjectByName(panelButtonNames[i]).size);
+			Engine.GetGUIObjectByName(panelNames[i] + 'Button').sprite = "ForegroundTab";
+			adjustTabDividers(Engine.GetGUIObjectByName(panelNames[i] + 'Button').size);
 		}
 	}
 }
 
-function adjustTabDividers(tabSize)
+function init(data)
 {
-	var leftSpacer = Engine.GetGUIObjectByName("tabDividerLeft");
-	var rightSpacer = Engine.GetGUIObjectByName("tabDividerRight");
-	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;
-}
+	// 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"]';
 
-function init(data)
-{
+	// 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)
+	{
+		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) + "%";
+		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;
+		}
+
+		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)
+		{
+			counter.teamsScores[playerState.team] = { };
+			counter.teamsScores[playerState.team].unitsTrained = 0;
+			counter.teamsScores[playerState.team].unitsLost = 0;
+			counter.teamsScores[playerState.team].enemyUnitsKilled = 0;
+		}
+
+		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]';
+	}
+	
+	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();
+	// Map
 	var mapSize = "Scenario";
 
 	Engine.GetGUIObjectByName("timeElapsed").caption = "Time elapsed: " + timeToString(data.timeElapsed);
@@ -61,245 +529,296 @@
 	}
 
 	Engine.GetGUIObjectByName("mapName").caption = data.mapSettings.Name + " - " + mapSize;
+	
+	// Panels
+	// Align headers
+	var left = 50;
+	for each (var panel in panels)	// for all panels
+		alignHeaders(panel.headings);
 
-	// Space player boxes
-	var boxSpacing = 32;
-	for (var i = 0; i < panelNames.length; ++i)
+	// TODO set maxPlayers as playerCounters.length
+	var maxPlayers = data.playerStates.length - 1;
+	var maxTeams = 0;
+
+	var teams = [ ];
+	if (data.mapSettings.LockTeams)	// teams ARE locked
 	{
-		for (var j = 0; j < MAX_SLOTS; ++j)
+		// count teams
+		for(var t = 0; t < maxPlayers; ++t)
 		{
-			var box = Engine.GetGUIObjectByName("playerBox"+i+"["+j+"]");
-			var boxSize = box.size;
-			var h = boxSize.bottom - boxSize.top;
-			boxSize.top = j * boxSpacing;
-			boxSize.bottom = j * boxSpacing + h;
-			box.size = boxSize;
+			if (!teams[data.playerStates[t+1].team])
+			{
+				teams[data.playerStates[t+1].team] = 1;
+				continue;
+			}
+			teams[data.playerStates[t+1].team]++;
 		}
+		
+		if (teams.length == maxPlayers)
+			teams = false;	// Each player has his own team. Displaying teams makes no sense.
 	}
-
-	// TODO set maxPlayers as playerCounters.length
-	var maxPlayers = data.playerStates.length - 1;
-
-	// Align headers
-	var left = 50;
-	var width = 100;
-	var playerNameHeadingWidth = 200;
-	// Special cased to make the (Sent / Received) part fit
-	var tributesWidth = 121;
-	Engine.GetGUIObjectByName("playerName0Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
-	Engine.GetGUIObjectByName("economyScoreHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("militaryScoreHeading").size = left +  " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("explorationScoreHeading").size = left +  " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("totalScoreHeading").size = left +  " 16 " + (left + width) + " 100%"; left += width;
+	else				// teams are NOT locked
+		teams = false;
 	
-	left = 50;
-	Engine.GetGUIObjectByName("playerName1Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
-	Engine.GetGUIObjectByName("unitsTrainedHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("unitsLostHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("enemyUnitsKilledHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("buildingsConstructedHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("buildingsLostHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("enemyBuildingsDestroyedHeading").size = left + " 6 " + (left + width) + " 100%"; left += width;
-
-	left = 50;
-	Engine.GetGUIObjectByName("playerName2Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
-	Engine.GetGUIObjectByName("civCentresBuiltHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("enemyCivCentresDestroyedHeading").size = left +  " 6 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("mapExplorationHeading").size = left +  " 6 " + (left + width) + " 100%"; left += width;
-
-	left = 50;
-	Engine.GetGUIObjectByName("playerName3Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
-	Engine.GetGUIObjectByName("resourceHeading").size = left + " 16 " + (left + width * 4) + " 100%";
-	Engine.GetGUIObjectByName("foodGatheredHeading").size = left + " 34 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("woodGatheredHeading").size = left + " 34 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("stoneGatheredHeading").size = left + " 34 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("metalGatheredHeading").size = left + " 34 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("vegetarianRatioHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("treasuresCollectedHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("resourcesTributedHeading").size = left + " 16 " + (left + tributesWidth) + " 100%"; left += tributesWidth;
-
-	left = 50;
-	Engine.GetGUIObjectByName("playerName4Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
-	Engine.GetGUIObjectByName("exchangedFoodHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("exchangedWoodHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("exchangedStoneHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("exchangedMetalHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("barterEfficiencyHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-	Engine.GetGUIObjectByName("tradeIncomeHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
-
-	// Show counters
-	for (var i = 0; i < MAX_SLOTS; ++i)
+	// Erase teams data if teams are not displayed
+	if (!teams)
 	{
-		if (i < maxPlayers)
+		for(var p = 0; p < maxPlayers; ++p)
+			data.playerStates[p+1].team = -1;
+	}
+	
+	// Count players without team	(or all if teams are not displayed)
+	var withoutTeam = maxPlayers;
+	if (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 playerState = data.playerStates[i+1];
-
-			for (var k = 0; k < panelNames.length; ++k)
+			var yStart = TEAMS_BOX_Y_START + withoutTeam * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP);
+			for (var i = 0; i < teams.length; ++i)
 			{
-				var playerBox = Engine.GetGUIObjectByName("playerBox"+k+"["+i+"]");
-				playerBox.hidden = false;
-
-				var colourString = "colour: "
-					+ Math.floor(playerState.colour.r * 255) + " "
-					+ Math.floor(playerState.colour.g * 255) + " "
-					+ Math.floor(playerState.colour.b * 255);
-				playerBox.sprite = colourString + " 32";
-				var playerColourBox = Engine.GetGUIObjectByName("playerColourBox"+k+"["+i+"]");
-				playerColourBox.sprite = colourString + " 255";
-
-				// 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"+k+"["+i+"]");
-				playerName.caption = data.players[i+1].name;
-
-				Engine.GetGUIObjectByName("civIcon"+k+"["+i+"]").sprite = "stretched:"+civData[playerState.civ].Emblem;
-				Engine.GetGUIObjectByName("civIcon"+k+"["+i+"]").tooltip = civData[playerState.civ].Name;
+				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++;
+		}
+	}
+	
+	if (withoutTeam)
+	{
+		// Show boxes for no teams
+		for (var b = 0; b < PANELS_COUNT; ++b)
+			Engine.GetGUIObjectByName("noTeamsBox"+b).hidden = false;
+	}
 
-			var economyScore = Engine.GetGUIObjectByName("economyScore["+i+"]");
-			var militaryScore = Engine.GetGUIObjectByName("militaryScore["+i+"]");
-			var explorationScore = Engine.GetGUIObjectByName("explorationScore["+i+"]");
-			var totalScore = Engine.GetGUIObjectByName("totalScore["+i+"]");
+	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;
 
-			var unitsTrained = Engine.GetGUIObjectByName("unitsTrained["+i+"]");
-			var unitsLost = Engine.GetGUIObjectByName("unitsLost["+i+"]");
-			var enemyUnitsKilled = Engine.GetGUIObjectByName("enemyUnitsKilled["+i+"]");
-			var buildingsConstructed = Engine.GetGUIObjectByName("buildingsConstructed["+i+"]");
-			var buildingsLost = Engine.GetGUIObjectByName("buildingsLost["+i+"]");
-			var enemyBuildingsDestroyed = Engine.GetGUIObjectByName("enemyBuildingsDestroyed["+i+"]");
+		if (playerState.team != -1)
+			tn = "t"+playerState.team+"p";
 
-			var civCentresBuilt = Engine.GetGUIObjectByName("civCentresBuilt["+i+"]");
-			var enemyCivCentresDestroyed = Engine.GetGUIObjectByName("enemyCivCentresDestroyed["+i+"]");
-			var mapExploration = Engine.GetGUIObjectByName("mapExploration["+i+"]");
-
-			var foodGathered = Engine.GetGUIObjectByName("foodGathered["+i+"]");
-			var woodGathered = Engine.GetGUIObjectByName("woodGathered["+i+"]");
-			var stoneGathered = Engine.GetGUIObjectByName("stoneGathered["+i+"]");
-			var metalGathered = Engine.GetGUIObjectByName("metalGathered["+i+"]");
-			var vegetarianRatio = Engine.GetGUIObjectByName("vegetarianRatio["+i+"]");
-			var treasuresCollected = Engine.GetGUIObjectByName("treasuresCollected["+i+"]");
-			var resourcesTributed = Engine.GetGUIObjectByName("resourcesTributed["+i+"]");
-
-			var exchangedFood = Engine.GetGUIObjectByName("exchangedFood["+i+"]");
-			var exchangedWood = Engine.GetGUIObjectByName("exchangedWood["+i+"]");
-			var exchangedStone = Engine.GetGUIObjectByName("exchangedStone["+i+"]");
-			var exchangedMetal = Engine.GetGUIObjectByName("exchangedMetal["+i+"]");
-			var barterEfficiency = Engine.GetGUIObjectByName("barterEfficiency["+i+"]");
-			var tradeIncome = Engine.GetGUIObjectByName("tradeIncome["+i+"]");
-
-			// align counters
-
-			left = 240;
-			width = 100;
-			economyScore.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			militaryScore.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			explorationScore.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			totalScore.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			var size = Engine.GetGUIObjectByName("playerBox0["+i+"]").size;
-			size.right = left + 10;
-			Engine.GetGUIObjectByName("playerBox0["+i+"]").size = size;
+		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;
 			
-			left = 240;
-			unitsTrained.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			unitsLost.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			enemyUnitsKilled.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			buildingsConstructed.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			buildingsLost.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			enemyBuildingsDestroyed.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			size = Engine.GetGUIObjectByName("playerBox1["+i+"]").size;
-			size.right = left + 10;
-			Engine.GetGUIObjectByName("playerBox1["+i+"]").size = size;
+			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;
 
-			left = 240;
-			civCentresBuilt.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			enemyCivCentresDestroyed.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			mapExploration.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			size = Engine.GetGUIObjectByName("playerBox2["+i+"]").size;
-			size.right = left + 10;
-			Engine.GetGUIObjectByName("playerBox2["+i+"]").size = size;
-
-			left = 240;
-			foodGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			woodGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			stoneGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			metalGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			vegetarianRatio.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			treasuresCollected.size	= left + " 2 " + (left + width) + " 100%"; left += width;
-			resourcesTributed.size = left + " 2 " + (left + tributesWidth) + " 100%"; left += tributesWidth;
-			size = Engine.GetGUIObjectByName("playerBox3["+i+"]").size;
-			size.right = left + 10;
-			Engine.GetGUIObjectByName("playerBox3["+i+"]").size = size;
-
-			left = 240;
-			exchangedFood.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			exchangedWood.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			exchangedStone.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			exchangedMetal.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			barterEfficiency.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			tradeIncome.size = left + " 2 " + (left + width) + " 100%"; left += width;
-			size = Engine.GetGUIObjectByName("playerBox4["+i+"]").size;
-			size.right = left + 10;
-			Engine.GetGUIObjectByName("playerBox4["+i+"]").size = size;
-
-			// display counters
-			economyScore.caption = Math.round((playerState.statistics.resourcesGathered.food + playerState.statistics.resourcesGathered.wood + 
-				playerState.statistics.resourcesGathered.stone + playerState.statistics.resourcesGathered.metal) / 10);
-			militaryScore.caption = Math.round((playerState.statistics.enemyUnitsKilledValue + playerState.statistics.enemyBuildingsDestroyedValue) / 10);
-			explorationScore.caption = playerState.statistics.percentMapExplored * 10;
-			totalScore.caption = Number(economyScore.caption) + Number(militaryScore.caption) + Number(explorationScore.caption);
+			var civIcon = Engine.GetGUIObjectByName("civIcon"+j+playerIdentityString);
+			civIcon.sprite = "stretched:"+civData[playerState.civ].Emblem;
+			civIcon.tooltip = civData[playerState.civ].Name;
 			
-			unitsTrained.caption = playerState.statistics.unitsTrained;
-			unitsLost.caption = playerState.statistics.unitsLost;
-			enemyUnitsKilled.caption = playerState.statistics.enemyUnitsKilled;
-			buildingsConstructed.caption = playerState.statistics.buildingsConstructed;
-			buildingsLost.caption = playerState.statistics.buildingsLost;
-			enemyBuildingsDestroyed.caption = playerState.statistics.enemyBuildingsDestroyed;
-
-			civCentresBuilt.caption = playerState.statistics.civCentresBuilt;
-			enemyCivCentresDestroyed.caption = playerState.statistics.enemyCivCentresDestroyed;
-			mapExploration.caption = playerState.statistics.percentMapExplored + "%";
-
-			const SOLD_COLOR = '[color="201 255 200"]';
-			const BOUGHT_COLOR = '[color="255 213 213"]';
-			foodGathered.caption = SOLD_COLOR + playerState.statistics.resourcesGathered.food + "[/color] / " +
-				BOUGHT_COLOR + (playerState.statistics.resourcesUsed.food - playerState.statistics.resourcesSold.food) + "[/color]";
-			woodGathered.caption = SOLD_COLOR + playerState.statistics.resourcesGathered.wood + "[/color] / " +
-				BOUGHT_COLOR + (playerState.statistics.resourcesUsed.wood - playerState.statistics.resourcesSold.wood) + "[/color]";
-			stoneGathered.caption = SOLD_COLOR + playerState.statistics.resourcesGathered.stone + "[/color] / " +
-				BOUGHT_COLOR + (playerState.statistics.resourcesUsed.stone - playerState.statistics.resourcesSold.stone) + "[/color]";
-			metalGathered.caption = SOLD_COLOR + playerState.statistics.resourcesGathered.metal + "[/color] / " +
-				BOUGHT_COLOR + (playerState.statistics.resourcesUsed.metal - playerState.statistics.resourcesSold.metal) + "[/color]";
-			vegetarianRatio.caption = Math.floor(playerState.statistics.resourcesGathered.food > 0 ?
-				(playerState.statistics.resourcesGathered.vegetarianFood / playerState.statistics.resourcesGathered.food) * 100 : 0) + "%";
-			treasuresCollected.caption = playerState.statistics.treasuresCollected;
-			resourcesTributed.caption = SOLD_COLOR + playerState.statistics.tributesSent + "[/color] / " +
-				BOUGHT_COLOR + playerState.statistics.tributesReceived + "[/color]";
-
-			exchangedFood.caption = SOLD_COLOR + '+' + playerState.statistics.resourcesBought.food
-				+ '[/color] ' + BOUGHT_COLOR + '-' + playerState.statistics.resourcesSold.food + '[/color]';
-			exchangedWood.caption = SOLD_COLOR + '+' + playerState.statistics.resourcesBought.wood
-				+ '[/color] ' + BOUGHT_COLOR + '-' + playerState.statistics.resourcesSold.wood + '[/color]';
-			exchangedStone.caption = SOLD_COLOR + '+' + playerState.statistics.resourcesBought.stone
-				+ '[/color] ' + BOUGHT_COLOR + '-' + playerState.statistics.resourcesSold.stone + '[/color]';
-			exchangedMetal.caption = SOLD_COLOR + '+' + playerState.statistics.resourcesBought.metal
-				+ '[/color] ' + BOUGHT_COLOR + '-' + playerState.statistics.resourcesSold.metal + '[/color]';
-			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;
-			barterEfficiency.caption = Math.floor(totalSold > 0 ? (totalBought / totalSold) * 100 : 0) + "%";
-			tradeIncome.caption = playerState.statistics.tradeIncome;
+			// 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++;
 		}
-		else
+		
+		// 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)
 		{
-			// hide player boxes
-			for (var k = 0; k < panelNames.length; ++k)
+			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();
+		// TODO: probably change from simple sum to union from range manager
+		panels.miscelanous.counters.mapExploration.teamsScores[playerState.team] += playerState.statistics.percentMapExplored;
+		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 = "Team total";
+			
+			var left = 250;
+			for (var c in panel.counters)
 			{
-				var playerBox = Engine.GetGUIObjectByName("playerBox"+k+"["+i+"]");
-				playerBox.hidden = true;
+				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++;
 		}
 	}
 
Index: binaries/data/mods/public/gui/summary/summary.xml
===================================================================
--- binaries/data/mods/public/gui/summary/summary.xml	(revision 14702)
+++ binaries/data/mods/public/gui/summary/summary.xml	(working copy)
@@ -57,31 +57,36 @@
 		<object name="tabDividerLeft" type="image" sprite="TabSpacer" size="172 120 174 122"/>
 		<object name="tabDividerRight" type="image" sprite="TabSpacer" size="328 120 330 122"/>
 
-		<object name="scorePanelButton" type="button" sprite="ForegroundTab" size="20 95 170 120">
+		<object name="scorePanelButton" type="button" sprite="ForegroundTab" size="20 82 136 120">
 			<action on="Press">selectPanel(0);</action>
 			<object type="text" style="TitleText" ghost="true">Score</object>
 		</object>
 		
-		<object name="unitsBuildingsPanelButton" type="button" sprite="BackgroundTab" size="176 95 326 120">
+		<object name="buildingsPanelButton" type="button" sprite="BackgroundTab" size="142 82 260 120">
 			<action on="Press">selectPanel(1);</action>
-			<object type="text" style="TitleText" ghost="true">Units/buildings</object>
+			<object type="text" style="TitleText" ghost="true">Buildings</object>
 		</object>
 
-		<object name="conquestPanelButton" type="button" sprite="BackgroundTab" size="332 95 480 120">
+		<object name="unitsPanelButton" type="button" sprite="BackgroundTab" size="266 82 384 120">
 			<action on="Press">selectPanel(2);</action>
-			<object type="text" style="TitleText" ghost="true">Conquest</object>
+			<object type="text" style="TitleText" ghost="true">Units</object>
 		</object>
 
-		<object name="resourcesPanelButton" type="button" sprite="BackgroundTab" size="486 95 636 120">
+		<object name="resourcesPanelButton" type="button" sprite="BackgroundTab" size="390 82 508 120">
 			<action on="Press">selectPanel(3);</action>
 			<object type="text" style="TitleText" ghost="true">Resources</object>
 		</object>
 
-		<object name="marketPanelButton" type="button" sprite="BackgroundTab" size="642 95 792 120">
+		<object name="marketPanelButton" type="button" sprite="BackgroundTab" size="514 82 632 120">
 			<action on="Press">selectPanel(4);</action>
 			<object type="text" style="TitleText" ghost="true">Market</object>
 		</object>
-
+		
+		<object name="miscPanelButton" type="button" sprite="BackgroundTab" size="638 82 756 120">
+			<action on="Press">selectPanel(5);</action>
+			<object type="text" style="TitleText" ghost="true">Miscellaneous</object>
+		</object>
+		
 		<object name="scorePanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58">
 
 			<object size="0 0 100% 100%-50">
@@ -102,95 +107,437 @@
 				</object>
 			</object>
 
-			<object size="0 65 100% 100%-50">
+			<object type="image" name="teamBox0t0" size="0 65 100% 100%-50" hidden="true">
+				<object type="text" name="teamNameHeading0t0" size="15 5 100% 100%" style="LeftTabLabelText"/>
+				<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="LeftLabelText" />
+							<object name="civIcon0t0p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="economyScoret0p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="militaryScoret0p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="explorationScoret0p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="totalScoret0p[n]"       type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading0t0"     type="text" style="LeftTabLabelText"/>
+				<object name="economyScoret0"     type="text" style="CenteredLabelText"/>
+				<object name="militaryScoret0"    type="text" style="CenteredLabelText"/>
+				<object name="explorationScoret0" type="text" style="CenteredLabelText"/>
+				<object name="totalScoret0" 	  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon0t1p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="economyScoret1p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="militaryScoret1p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="explorationScoret1p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="totalScoret1p[n]"       type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading0t1"     type="text" style="LeftTabLabelText"/>
+				<object name="economyScoret1"     type="text" style="CenteredLabelText"/>
+				<object name="militaryScoret1"    type="text" style="CenteredLabelText"/>
+				<object name="explorationScoret1" type="text" style="CenteredLabelText"/>
+				<object name="totalScoret1" 	  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon0t2p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="economyScoret2p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="militaryScoret2p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="explorationScoret2p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="totalScoret2p[n]"       type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading0t2"     type="text" style="LeftTabLabelText"/>
+				<object name="economyScoret2"     type="text" style="CenteredLabelText"/>
+				<object name="militaryScoret2"    type="text" style="CenteredLabelText"/>
+				<object name="explorationScoret2" type="text" style="CenteredLabelText"/>
+				<object name="totalScoret2" 	  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon0t3p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="economyScoret3p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="militaryScoret3p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="explorationScoret3p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="totalScoret3p[n]"       type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading0t3"     type="text" style="LeftTabLabelText"/>
+				<object name="economyScoret3"     type="text" style="CenteredLabelText"/>
+				<object name="militaryScoret3"    type="text" style="CenteredLabelText"/>
+				<object name="explorationScoret3" type="text" style="CenteredLabelText"/>
+				<object name="totalScoret3" 	  type="text" style="CenteredLabelText"/>
+			</object>yy
+			
+			<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 name="playerColourBox0[n]"     		type="image" size="10 4 30 24" />
-						<object name="playerName0[n]"          		type="text"  style="LeftLabelText" size="40 2 208 100%" />
-						<object name="civIcon0[n]"          		type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="economyScore[n]"      		type="text" style="CenteredLabelText"/>
-						<object name="militaryScore[n]" 			type="text" style="CenteredLabelText"/>
-						<object name="explorationScore[n]" 			type="text" style="CenteredLabelText"/>
-						<object name="totalScore[n]" 				type="text" style="CenteredLabelText"/>
+						<object name="playerColourBox0[n]" type="image" size="10 4 30 24"/>
+						<object name="playerName0[n]"      type="text"  size="40 2 208 100%" style="LeftLabelText"/>
+						<object name="civIcon0[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+						<object name="economyScore[n]"     type="text"  style="CenteredLabelText"/>
+						<object name="militaryScore[n]"    type="text"  style="CenteredLabelText"/>
+						<object name="explorationScore[n]" type="text"  style="CenteredLabelText"/>
+						<object name="totalScore[n]"       type="text"  style="CenteredLabelText"/>
 					</object>
 				</repeat>
 			</object>
-
 		</object>
-		<object name="unitsBuildingsPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58" hidden="true">
+		
+		<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="LeftTabLabelText">
 					Player name
 				</object>
-				<object name="unitsTrainedHeading" type="text" style="CenteredTabLabelText">
-					Units&#10;trained
+				<object name="buildingsHeading" type="text" style="CenteredTabLabelText">
+					Buildings Statistics (Constructed / Lost / Destroyed)
 				</object>
-				<object name="unitsLostHeading" type="text" style="CenteredTabLabelText">
-					Units&#10;lost
+				<object name="totalBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Total
 				</object>
-				<object name="enemyUnitsKilledHeading" type="text" style="CenteredTabLabelText">
-					Enemy units&#10;killed
+				<object name="houseBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Houses
 				</object>
-				<object name="buildingsConstructedHeading" type="text" style="CenteredTabLabelText">
-					Buildings&#10;constructed
+				<object name="economicBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Economic
 				</object>
-				<object name="buildingsLostHeading" type="text" style="CenteredTabLabelText">
-					Buildings&#10;lost
+				<object name="outpostBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Outposts
 				</object>
-				<object name="enemyBuildingsDestroyedHeading" type="text" style="CenteredTabLabelText">
-					Enemy&#10;buildings&#10;destroyed
+				<object name="militaryBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Military
+				</object> 
+				<object name="fortressBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Fortresses
 				</object>
+				<object name="civCentreBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Civ&#160;Centers
+				</object>
+				<object name="wonderBuildingsHeading" type="text" style="CenteredTabLabelText">
+					Wonders
+				</object>
+
 			</object>
-
-			<object size="0 65 100% 100%-50">
+			
+			<object type="image" name="teamBox1t0" size="0 65 100% 100%-50" hidden="true">
+				<object type="text" name="teamNameHeading1t0" size="15 5 100% 100%" style="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon1t0p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="totalBuildingst0p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="houseBuildingst0p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="economicBuildingst0p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="outpostBuildingst0p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="militaryBuildingst0p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="fortressBuildingst0p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="civCentreBuildingst0p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="wonderBuildingst0p[n]"    type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading1t0"       type="text" style="LeftTabLabelText"/>
+				<object name="totalBuildingst0"     type="text" style="CenteredLabelText"/>
+				<object name="houseBuildingst0"     type="text" style="CenteredLabelText"/>
+				<object name="economicBuildingst0"  type="text" style="CenteredLabelText"/>
+				<object name="outpostBuildingst0"   type="text" style="CenteredLabelText"/>
+				<object name="militaryBuildingst0"  type="text" style="CenteredLabelText"/>
+				<object name="fortressBuildingst0"  type="text" style="CenteredLabelText"/>
+				<object name="civCentreBuildingst0" type="text" style="CenteredLabelText"/>
+				<object name="wonderBuildingst0"    type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon1t1p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="totalBuildingst1p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="houseBuildingst1p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="economicBuildingst1p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="outpostBuildingst1p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="militaryBuildingst1p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="fortressBuildingst1p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="civCentreBuildingst1p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="wonderBuildingst1p[n]"    type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading1t1"       type="text" style="LeftTabLabelText"/>
+				<object name="totalBuildingst1"     type="text" style="CenteredLabelText"/>
+				<object name="houseBuildingst1"     type="text" style="CenteredLabelText"/>
+				<object name="economicBuildingst1"  type="text" style="CenteredLabelText"/>
+				<object name="outpostBuildingst1"   type="text" style="CenteredLabelText"/>
+				<object name="militaryBuildingst1"  type="text" style="CenteredLabelText"/>
+				<object name="fortressBuildingst1"  type="text" style="CenteredLabelText"/>
+				<object name="civCentreBuildingst1" type="text" style="CenteredLabelText"/>
+				<object name="wonderBuildingst1"    type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon1t2p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="totalBuildingst2p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="houseBuildingst2p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="economicBuildingst2p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="outpostBuildingst2p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="militaryBuildingst2p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="fortressBuildingst2p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="civCentreBuildingst2p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="wonderBuildingst2p[n]"    type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading1t2"       type="text" style="LeftTabLabelText"/>
+				<object name="totalBuildingst2"     type="text" style="CenteredLabelText"/>
+				<object name="houseBuildingst2"     type="text" style="CenteredLabelText"/>
+				<object name="economicBuildingst2"  type="text" style="CenteredLabelText"/>
+				<object name="outpostBuildingst2"   type="text" style="CenteredLabelText"/>
+				<object name="militaryBuildingst2"  type="text" style="CenteredLabelText"/>
+				<object name="fortressBuildingst2"  type="text" style="CenteredLabelText"/>
+				<object name="civCentreBuildingst2" type="text" style="CenteredLabelText"/>
+				<object name="wonderBuildingst2"    type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon1t3p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="totalBuildingst3p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="houseBuildingst3p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="economicBuildingst3p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="outpostBuildingst3p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="militaryBuildingst3p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="fortressBuildingst3p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="civCentreBuildingst3p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="wonderBuildingst3p[n]"    type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading1t3"       type="text" style="LeftTabLabelText"/>
+				<object name="totalBuildingst3"     type="text" style="CenteredLabelText"/>
+				<object name="houseBuildingst3"     type="text" style="CenteredLabelText"/>
+				<object name="economicBuildingst3"  type="text" style="CenteredLabelText"/>
+				<object name="outpostBuildingst3"   type="text" style="CenteredLabelText"/>
+				<object name="militaryBuildingst3"  type="text" style="CenteredLabelText"/>
+				<object name="fortressBuildingst3"  type="text" style="CenteredLabelText"/>
+				<object name="civCentreBuildingst3" type="text" style="CenteredLabelText"/>
+				<object name="wonderBuildingst3"    type="text" style="CenteredLabelText"/>
+			</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 name="playerColourBox1[n]"     		type="image" size="10 4 30 24" />
-						<object name="playerName1[n]"          		type="text" style="LeftLabelText" size="40 2 208 100%" />
-						<object name="civIcon1[n]"          		type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="unitsTrained[n]"         		type="text" style="CenteredLabelText"/>
-						<object name="unitsLost[n]"            		type="text" style="CenteredLabelText"/>
-						<object name="enemyUnitsKilled[n]"     		type="text" style="CenteredLabelText"/>
-						<object name="buildingsConstructed[n]" 		type="text" style="CenteredLabelText"/>
-						<object name="buildingsLost[n]"        		type="text" style="CenteredLabelText"/>
-						<object name="enemyBuildingsDestroyed[n]"   	type="text" style="CenteredLabelText"/>
+						<object name="playerColourBox1[n]"   type="image" size="10 4 30 24"/>
+						<object name="playerName1[n]"        type="text"  size="40 2 208 100%" style="LeftLabelText"/>
+						<object name="civIcon1[n]"           type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
+						<object name="totalBuildings[n]"     type="text"  style="CenteredLabelText"/>
+						<object name="houseBuildings[n]"     type="text"  style="CenteredLabelText"/>
+						<object name="economicBuildings[n]"  type="text"  style="CenteredLabelText"/>
+						<object name="outpostBuildings[n]"   type="text"  style="CenteredLabelText"/>
+						<object name="militaryBuildings[n]"  type="text"  style="CenteredLabelText"/>
+						<object name="fortressBuildings[n]"  type="text"  style="CenteredLabelText"/>
+						<object name="civCentreBuildings[n]" type="text"  style="CenteredLabelText"/>
+						<object name="wonderBuildings[n]"    type="text"  style="CenteredLabelText"/>
 					</object>
 				</repeat>
 			</object>
-
 		</object>
-		<object name="conquestPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-58" hidden="true">
+		
+		<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="LeftTabLabelText">
 					Player name
 				</object>
-				<object name="civCentresBuiltHeading" type="text" style="CenteredTabLabelText">
-					Civ centres&#10;built
+				<object name="unitsHeading" type="text" style="CenteredTabLabelText">
+					Units Statistics (Trained / Lost / Killed)
 				</object>
-				<object name="enemyCivCentresDestroyedHeading" type="text" style="CenteredTabLabelText">
-					Enemy&#10;civ centres&#10;destroyed
+				<object name="totalUnitsHeading" type="text" style="CenteredTabLabelText">
+					Total
 				</object>
-				<object name="mapExplorationHeading" type="text" style="CenteredTabLabelText">
-					Map&#10;exploration
+				<object name="infantryUnitsHeading" type="text" style="CenteredTabLabelText">
+					Infantry
 				</object>
+				<object name="workerUnitsHeading" type="text" style="CenteredTabLabelText">
+					Worker
+				</object>
+				<object name="cavalryUnitsHeading" type="text" style="CenteredTabLabelText">
+					Cavalry
+				</object>
+				<object name="championUnitsHeading" type="text" style="CenteredTabLabelText">
+					Champion
+				</object>
+				<object name="heroesUnitsHeading" type="text" style="CenteredTabLabelText">
+					Heroes
+				</object>
+				<object name="navyUnitsHeading" type="text" style="CenteredTabLabelText">
+					Navy
+				</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon2t0p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
+							<object name="totalUnitst0p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="infantryUnitst0p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="workerUnitst0p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="cavalryUnitst0p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="championUnitst0p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="heroesUnitst0p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="navyUnitst0p[n]"        type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading2t0"  type="text" style="LeftTabLabelText"/>
+				<object name="totalUnitst0"    type="text" style="CenteredLabelText"/>
+				<object name="infantryUnitst0" type="text" style="CenteredLabelText"/>
+				<object name="workerUnitst0"   type="text" style="CenteredLabelText"/>
+				<object name="cavalryUnitst0"  type="text" style="CenteredLabelText"/>
+				<object name="championUnitst0" type="text" style="CenteredLabelText"/>
+				<object name="heroesUnitst0"   type="text" style="CenteredLabelText"/>
+				<object name="navyUnitst0"     type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon2t1p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
+							<object name="totalUnitst1p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="infantryUnitst1p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="workerUnitst1p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="cavalryUnitst1p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="championUnitst1p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="heroesUnitst1p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="navyUnitst1p[n]"        type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading2t1"  type="text" style="LeftTabLabelText"/>
+				<object name="totalUnitst1"    type="text" style="CenteredLabelText"/>
+				<object name="infantryUnitst1" type="text" style="CenteredLabelText"/>
+				<object name="workerUnitst1"   type="text" style="CenteredLabelText"/>
+				<object name="cavalryUnitst1"  type="text" style="CenteredLabelText"/>
+				<object name="championUnitst1" type="text" style="CenteredLabelText"/>
+				<object name="heroesUnitst1"   type="text" style="CenteredLabelText"/>
+				<object name="navyUnitst1"     type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon2t2p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
+							<object name="totalUnitst2p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="infantryUnitst2p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="workerUnitst2p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="cavalryUnitst2p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="championUnitst2p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="heroesUnitst2p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="navyUnitst2p[n]"        type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading2t2"  type="text" style="LeftTabLabelText"/>
+				<object name="totalUnitst2"    type="text" style="CenteredLabelText"/>
+				<object name="infantryUnitst2" type="text" style="CenteredLabelText"/>
+				<object name="workerUnitst2"   type="text" style="CenteredLabelText"/>
+				<object name="cavalryUnitst2"  type="text" style="CenteredLabelText"/>
+				<object name="championUnitst2" type="text" style="CenteredLabelText"/>
+				<object name="heroesUnitst2"   type="text" style="CenteredLabelText"/>
+				<object name="navyUnitst2"     type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon2t3p[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
+							<object name="totalUnitst3p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="infantryUnitst3p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="workerUnitst3p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="cavalryUnitst3p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="championUnitst3p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="heroesUnitst3p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="navyUnitst3p[n]"        type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading2t3"  type="text" style="LeftTabLabelText"/>
+				<object name="totalUnitst3"    type="text" style="CenteredLabelText"/>
+				<object name="infantryUnitst3" type="text" style="CenteredLabelText"/>
+				<object name="workerUnitst3"   type="text" style="CenteredLabelText"/>
+				<object name="cavalryUnitst3"  type="text" style="CenteredLabelText"/>
+				<object name="championUnitst3" type="text" style="CenteredLabelText"/>
+				<object name="heroesUnitst3"   type="text" style="CenteredLabelText"/>
+				<object name="navyUnitst3"     type="text" style="CenteredLabelText"/>
+			</object>
 
-			<object size="0 65 100% 100%-50">
+			<object type="image" name="noTeamsBox2" 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 name="playerColourBox2[n]"     		type="image" size="10 4 30 24" />
-						<object name="playerName2[n]"          		type="text"  style="LeftLabelText" size="40 2 208 100%" />
-						<object name="civIcon2[n]"          		type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="civCentresBuilt[n]"      		type="text" style="CenteredLabelText"/>
-						<object name="enemyCivCentresDestroyed[n]" 	type="text" style="CenteredLabelText"/>
-						<object name="mapExploration[n]" 		type="text" style="CenteredLabelText"/>
+						<object name="playerColourBox2[n]" type="image" size="10 4 30 24" />
+						<object name="playerName2[n]"      type="text"  size="40 2 208 100%" style="LeftLabelText"/>
+						<object name="civIcon2[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+						<object name="totalUnits[n]"       type="text"  style="CenteredLabelText"/>
+						<object name="infantryUnits[n]"    type="text"  style="CenteredLabelText"/>
+						<object name="workerUnits[n]"      type="text"  style="CenteredLabelText"/>
+						<object name="cavalryUnits[n]"     type="text"  style="CenteredLabelText"/>
+						<object name="championUnits[n]"    type="text"  style="CenteredLabelText"/>
+						<object name="heroesUnits[n]"      type="text"  style="CenteredLabelText"/>
+						<object name="navyUnits[n]"        type="text"  style="CenteredLabelText"/>
 					</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">
@@ -212,8 +559,8 @@
 				<object name="metalGatheredHeading" type="text" style="CenteredTabLabelText">
 					Metal
 				</object>
-				<object name="vegetarianRatioHeading" type="text" style="CenteredTabLabelText">
-					Vegetarian&#10;ratio
+				<object name="totalGatheredHeading" type="text" style="CenteredTabLabelText">
+					Total
 				</object>
 				<object name="treasuresCollectedHeading" type="text" style="CenteredTabLabelText">
 					Treasures&#10;collected
@@ -223,24 +570,133 @@
 				</object>
 			</object>
 
-			<object size="0 65 100% 100%-50">
+			<object type="image" name="teamBox3t0" size="0 65 100% 100%-50" hidden="true">
+				<object type="text" name="teamNameHeading3t0" size="15 5 100% 100%" style="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon3t0p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="foodGatheredt0p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="woodGatheredt0p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="stoneGatheredt0p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="metalGatheredt0p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="totalGatheredt0p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="treasuresCollectedt0p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="resourcesTributedt0p[n]"  type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading3t0"       type="text" style="LeftTabLabelText"/>
+				<object name="foodGatheredt0"       type="text" style="CenteredLabelText"/>
+				<object name="woodGatheredt0"       type="text" style="CenteredLabelText"/>
+				<object name="stoneGatheredt0"      type="text" style="CenteredLabelText"/>
+				<object name="metalGatheredt0"      type="text" style="CenteredLabelText"/>
+				<object name="totalGatheredt0"      type="text" style="CenteredLabelText"/>
+				<object name="treasuresCollectedt0" type="text" style="CenteredLabelText"/>
+				<object name="resourcesTributedt0"  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon3t1p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="foodGatheredt1p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="woodGatheredt1p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="stoneGatheredt1p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="metalGatheredt1p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="totalGatheredt1p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="treasuresCollectedt1p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="resourcesTributedt1p[n]"  type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading3t1"       type="text" style="LeftTabLabelText"/>
+				<object name="foodGatheredt1"       type="text" style="CenteredLabelText"/>
+				<object name="woodGatheredt1"       type="text" style="CenteredLabelText"/>
+				<object name="stoneGatheredt1"      type="text" style="CenteredLabelText"/>
+				<object name="metalGatheredt1"      type="text" style="CenteredLabelText"/>
+				<object name="totalGatheredt1"      type="text" style="CenteredLabelText"/>
+				<object name="treasuresCollectedt1" type="text" style="CenteredLabelText"/>
+				<object name="resourcesTributedt1"  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon3t2p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="foodGatheredt2p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="woodGatheredt2p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="stoneGatheredt2p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="metalGatheredt2p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="totalGatheredt2p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="treasuresCollectedt2p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="resourcesTributedt2p[n]"  type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading3t2"       type="text" style="LeftTabLabelText"/>
+				<object name="foodGatheredt2"       type="text" style="CenteredLabelText"/>
+				<object name="woodGatheredt2"       type="text" style="CenteredLabelText"/>
+				<object name="stoneGatheredt2"      type="text" style="CenteredLabelText"/>
+				<object name="metalGatheredt2"      type="text" style="CenteredLabelText"/>
+				<object name="totalGatheredt2"      type="text" style="CenteredLabelText"/>
+				<object name="treasuresCollectedt2" type="text" style="CenteredLabelText"/>
+				<object name="resourcesTributedt2"  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon3t3p[n]"           type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="foodGatheredt3p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="woodGatheredt3p[n]"       type="text"  style="CenteredLabelText"/>
+							<object name="stoneGatheredt3p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="metalGatheredt3p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="totalGatheredt3p[n]"      type="text"  style="CenteredLabelText"/>
+							<object name="treasuresCollectedt3p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="resourcesTributedt3p[n]"  type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading3t3"       type="text" style="LeftTabLabelText"/>
+				<object name="foodGatheredt3"       type="text" style="CenteredLabelText"/>
+				<object name="woodGatheredt3"       type="text" style="CenteredLabelText"/>
+				<object name="stoneGatheredt3"      type="text" style="CenteredLabelText"/>
+				<object name="metalGatheredt3"      type="text" style="CenteredLabelText"/>
+				<object name="totalGatheredt3"      type="text" style="CenteredLabelText"/>
+				<object name="treasuresCollectedt3" type="text" style="CenteredLabelText"/>
+				<object name="resourcesTributedt3"  type="text" style="CenteredLabelText"/>
+			</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 name="playerColourBox3[n]" 		type="image" size="10 4 30 24" />
-						<object name="playerName3[n]"      		type="text"  style="LeftLabelText" size="40 2 208 100%" />
-						<object name="civIcon3[n]"      		type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="foodGathered[n]"     		type="text" style="CenteredLabelText"/>
-						<object name="woodGathered[n]"     		type="text" style="CenteredLabelText"/>
-						<object name="stoneGathered[n]"    		type="text" style="CenteredLabelText" />
-						<object name="metalGathered[n]"    		type="text" style="CenteredLabelText"/>
-						<object name="vegetarianRatio[n]"  		type="text" style="CenteredLabelText"/>
-						<object name="treasuresCollected[n]"    	type="text" style="CenteredLabelText"/>
-						<object name="resourcesTributed[n]"	    type="text" style="CenteredLabelText"/>
+						<object name="playerColourBox3[n]"   type="image" size="10 4 30 24" />
+						<object name="playerName3[n]"        type="text"  size="40 2 208 100%" style="LeftLabelText"/>
+						<object name="civIcon3[n]"           type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
+						<object name="foodGathered[n]"       type="text"  style="CenteredLabelText"/>
+						<object name="woodGathered[n]"       type="text"  style="CenteredLabelText"/>
+						<object name="stoneGathered[n]"      type="text"  style="CenteredLabelText" />
+						<object name="metalGathered[n]"      type="text"  style="CenteredLabelText"/>
+						<object name="totalGathered[n]"      type="text"  style="CenteredLabelText"/>
+						<object name="treasuresCollected[n]" type="text"  style="CenteredLabelText"/>
+						<object name="resourcesTributed[n]"  type="text"  style="CenteredLabelText"/>
 					</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">
@@ -266,25 +722,245 @@
 					Trade&#10;income
 				</object>
 			</object>
-
-			<object size="0 65 100% 100%-50">
+			
+			<object type="image" name="teamBox4t0" size="0 65 100% 100%-50" hidden="true">
+				<object type="text" name="teamNameHeading4t0" size="15 5 100% 100%" style="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon4t0p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="exchangedFoodt0p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedWoodt0p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedStonet0p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="exchangedMetalt0p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="barterEfficiencyt0p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="tradeIncomet0p[n]"      type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading4t0"     type="text" style="LeftTabLabelText"/>
+				<object name="exchangedFoodt0"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedWoodt0"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedStonet0"   type="text" style="CenteredLabelText"/>
+				<object name="exchangedMetalt0"   type="text" style="CenteredLabelText"/>
+				<object name="barterEfficiencyt0" type="text" style="CenteredLabelText"/>
+				<object name="tradeIncomet0"      type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon4t1p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="exchangedFoodt1p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedWoodt1p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedStonet1p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="exchangedMetalt1p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="barterEfficiencyt1p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="tradeIncomet1p[n]"      type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading4t1"     type="text" style="LeftTabLabelText"/>
+				<object name="exchangedFoodt1"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedWoodt1"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedStonet1"   type="text" style="CenteredLabelText"/>
+				<object name="exchangedMetalt1"   type="text" style="CenteredLabelText"/>
+				<object name="barterEfficiencyt1" type="text" style="CenteredLabelText"/>
+				<object name="tradeIncomet1"      type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon4t2p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="exchangedFoodt2p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedWoodt2p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedStonet2p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="exchangedMetalt2p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="barterEfficiencyt2p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="tradeIncomet2p[n]"      type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading4t2"     type="text" style="LeftTabLabelText"/>
+				<object name="exchangedFoodt2"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedWoodt2"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedStonet2"   type="text" style="CenteredLabelText"/>
+				<object name="exchangedMetalt2"   type="text" style="CenteredLabelText"/>
+				<object name="barterEfficiencyt2" type="text" style="CenteredLabelText"/>
+				<object name="tradeIncomet2"      type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon4t3p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="exchangedFoodt3p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedWoodt3p[n]"    type="text"  style="CenteredLabelText"/>
+							<object name="exchangedStonet3p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="exchangedMetalt3p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="barterEfficiencyt3p[n]" type="text"  style="CenteredLabelText"/>
+							<object name="tradeIncomet3p[n]"      type="text"  style="CenteredLabelText"/>
+						</object>
+					</repeat>
+				</object>
+				<object name="teamHeading4t3"     type="text" style="LeftTabLabelText"/>
+				<object name="exchangedFoodt3"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedWoodt3"    type="text" style="CenteredLabelText"/>
+				<object name="exchangedStonet3"   type="text" style="CenteredLabelText"/>
+				<object name="exchangedMetalt3"   type="text" style="CenteredLabelText"/>
+				<object name="barterEfficiencyt3" type="text" style="CenteredLabelText"/>
+				<object name="tradeIncomet3"      type="text" style="CenteredLabelText"/>
+			</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 name="playerColourBox4[n]"      type="image" size="10 4 30 24" />
-						<object name="playerName4[n]"           type="text"  style="LeftLabelText" size="40 2 208 100%" />
-						<object name="civIcon4[n]"              type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
-						<object name="exchangedFood[n]"         type="text" style="CenteredLabelText"/>
-						<object name="exchangedWood[n]"         type="text" style="CenteredLabelText"/>
-						<object name="exchangedStone[n]"         type="text" style="CenteredLabelText"/>
-						<object name="exchangedMetal[n]"         type="text" style="CenteredLabelText"/>
-						<object name="barterEfficiency[n]"      type="text" style="CenteredLabelText"/>
-						<object name="tradeIncome[n]"           type="text" style="CenteredLabelText"/>
+						<object name="playerColourBox4[n]" type="image" size="10 4 30 24"/>
+						<object name="playerName4[n]"      type="text"  size="40 2 208 100%" style="LeftLabelText"/>
+						<object name="civIcon4[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+						<object name="exchangedFood[n]"    type="text"  style="CenteredLabelText"/>
+						<object name="exchangedWood[n]"    type="text"  style="CenteredLabelText"/>
+						<object name="exchangedStone[n]"   type="text"  style="CenteredLabelText"/>
+						<object name="exchangedMetal[n]"   type="text"  style="CenteredLabelText"/>
+						<object name="barterEfficiency[n]" type="text"  style="CenteredLabelText"/>
+						<object name="tradeIncome[n]"      type="text"  style="CenteredLabelText"/>
 					</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="LeftTabLabelText">
+					Player name
+				</object>
+				<object name="vegetarianRatioHeading" type="text" style="CenteredTabLabelText">
+					Vegetarian&#10;ratio
+				</object>
+				<object name="feminisationHeading" type="text" style="CenteredTabLabelText">
+					Feminisation
+				</object>
+				<object name="killDeathRatioHeading" type="text" style="CenteredTabLabelText">
+					Kill / Death&#10;ratio
+				</object>
+				<object name="mapExplorationHeading" type="text" style="CenteredTabLabelText">
+					Map&#10;exploration
+				</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon5t0p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="vegetarianRatiot0p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="feminisationt0p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="killDeathRatiot0p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="mapExplorationt0p[n]"   type="text"  style="CenteredLabelText"/>
+						</object>	
+					</repeat>
+				</object>
+				<object name="teamHeading5t0"    type="text" style="LeftTabLabelText"/>
+				<object name="vegetarianRatiot0" type="text" style="CenteredLabelText"/>
+				<object name="feminisationt0"    type="text" style="CenteredLabelText"/>
+				<object name="killDeathRatiot0"  type="text" style="CenteredLabelText"/>
+				<object name="mapExplorationt0"  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon5t1p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="vegetarianRatiot1p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="feminisationt1p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="killDeathRatiot1p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="mapExplorationt1p[n]"   type="text"  style="CenteredLabelText"/>
+						</object>	
+					</repeat>
+				</object>
+				<object name="teamHeading5t1"    type="text" style="LeftTabLabelText"/>
+				<object name="vegetarianRatiot1" type="text" style="CenteredLabelText"/>
+				<object name="feminisationt1"    type="text" style="CenteredLabelText"/>
+				<object name="killDeathRatiot1"  type="text" style="CenteredLabelText"/>
+				<object name="mapExplorationt1"  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon5t2p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="vegetarianRatiot2p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="feminisationt2p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="killDeathRatiot2p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="mapExplorationt2p[n]"   type="text"  style="CenteredLabelText"/>
+						</object>	
+					</repeat>
+				</object>
+				<object name="teamHeading5t2"    type="text" style="LeftTabLabelText"/>
+				<object name="vegetarianRatiot2" type="text" style="CenteredLabelText"/>
+				<object name="feminisationt2"    type="text" style="CenteredLabelText"/>
+				<object name="killDeathRatiot2"  type="text" style="CenteredLabelText"/>
+				<object name="mapExplorationt2"  type="text" style="CenteredLabelText"/>
+			</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="LeftTabLabelText"/>
+				<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="LeftLabelText"/>
+							<object name="civIcon5t3p[n]"         type="image" size="208 0 240 32"  tooltip_style="sessionToolTip"/>
+							<object name="vegetarianRatiot3p[n]"  type="text"  style="CenteredLabelText"/>
+							<object name="feminisationt3p[n]"     type="text"  style="CenteredLabelText"/>
+							<object name="killDeathRatiot3p[n]"   type="text"  style="CenteredLabelText"/>
+							<object name="mapExplorationt3p[n]"   type="text"  style="CenteredLabelText"/>
+						</object>	
+					</repeat>
+				</object>
+				<object name="teamHeading5t3"    type="text" style="LeftTabLabelText"/>
+				<object name="vegetarianRatiot3" type="text" style="CenteredLabelText"/>
+				<object name="feminisationt3"    type="text" style="CenteredLabelText"/>
+				<object name="killDeathRatiot3"  type="text" style="CenteredLabelText"/>
+				<object name="mapExplorationt3"  type="text" style="CenteredLabelText"/>
+			</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 name="playerColourBox5[n]" type="image" size="10 4 30 24"/>
+						<object name="playerName5[n]"      type="text"  size="40 2 208 100%" style="LeftLabelText"/>
+						<object name="civIcon5[n]"         type="image" size="208 0 240 32" tooltip_style="sessionToolTip"/>
+						<object name="vegetarianRatio[n]"  type="text"  style="CenteredLabelText"/>
+						<object name="feminisation[n]"     type="text"  style="CenteredLabelText"/>
+						<object name="killDeathRatio[n]"   type="text"  style="CenteredLabelText"/>
+						<object name="mapExploration[n]"   type="text"  style="CenteredLabelText"/>
+					</object>	
+				</repeat>
+			</object>
 		</object>
-
+		
 		<object type="button" style="StoneButton" size="100%-164 100%-52 100%-24 100%-24">
 			Continue
 			<action on="Press"><![CDATA[
Index: binaries/data/mods/public/simulation/components/Foundation.js
===================================================================
--- binaries/data/mods/public/simulation/components/Foundation.js	(revision 14702)
+++ binaries/data/mods/public/simulation/components/Foundation.js	(working copy)
@@ -314,11 +314,7 @@
 		// ----------------------------------------------------------------------
 		
 		var cmpPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker);
-		cmpPlayerStatisticsTracker.IncreaseConstructedBuildingsCounter();
-
-		var cmpIdentity = Engine.QueryInterface(building, IID_Identity);
-		if (cmpIdentity.GetClassesList().indexOf("CivCentre") != -1)
-			cmpPlayerStatisticsTracker.IncreaseBuiltCivCentresCounter();
+		cmpPlayerStatisticsTracker.IncreaseConstructedBuildingsCounter(building);
 		
 		var cmpHealth = Engine.QueryInterface(this.entity, IID_Health);
 		var cmpBuildingHealth = Engine.QueryInterface(building, IID_Health);
Index: binaries/data/mods/public/simulation/components/ProductionQueue.js
===================================================================
--- binaries/data/mods/public/simulation/components/ProductionQueue.js	(revision 14702)
+++ binaries/data/mods/public/simulation/components/ProductionQueue.js	(working copy)
@@ -571,7 +571,7 @@
 		}
 
 		var cmpPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker);
-		cmpPlayerStatisticsTracker.IncreaseTrainedUnitsCounter();
+		cmpPlayerStatisticsTracker.IncreaseTrainedUnitsCounter(ent);
 
 		// Play a sound, but only for the first in the batch (to avoid nasty phasing effects)
 		if (createdEnts.length == 0)
Index: binaries/data/mods/public/simulation/components/StatisticsTracker.js
===================================================================
--- binaries/data/mods/public/simulation/components/StatisticsTracker.js	(revision 14702)
+++ binaries/data/mods/public/simulation/components/StatisticsTracker.js	(working copy)
@@ -3,51 +3,120 @@
 StatisticsTracker.prototype.Schema =
 	"<a:component type='system'/><empty/>";
 
-StatisticsTracker.prototype.Init = function()
-{
-	// units
-	this.unitsTrained = 0;
-	this.unitsLost = 0;
-	this.unitsLostValue = 0;
-	this.enemyUnitsKilled = 0;
-	this.enemyUnitsKilledValue = 0;
-	//buildings
-	this.buildingsConstructed = 0;
-	this.buildingsLost = 0;
-	this.buildingsLostValue = 0;
-	this.enemyBuildingsDestroyed = 0;
-	this.enemyBuildingsDestroyedValue = 0;
-	// civ centres
-	this.civCentresBuilt = 0;
-	this.enemyCivCentresDestroyed = 0;
-	// resources
-	this.resourcesGathered = {
-			"food": 0,
-			"wood": 0,
-			"metal": 0,
-			"stone": 0,
-			"vegetarianFood": 0
-	};
-	this.resourcesUsed = {
-			"food": 0,
-			"wood": 0,
-			"metal": 0,
-			"stone": 0
-	};
-	this.resourcesSold = {
-			"food": 0,
-			"wood": 0,
-			"metal": 0,
-			"stone": 0
-	};
-	this.resourcesBought = {
-			"food": 0,
-			"wood": 0,
-			"metal": 0,
-			"stone": 0
-	};
-	this.tributesSent = 0;
-	this.tributesReceived = 0;
+StatisticsTracker.prototype.Init = function()
+{
+	// units
+	this.unitsClasses = [
+		"Infantry",
+		"Worker",
+		"Female",
+		"Cavalry",
+		"Champion",
+		"Hero",
+		"Ship"
+	];	
+	this.unitsTrained = {
+		"Infantry": 0,
+		"Worker": 0,
+		"Female": 0,
+		"Cavalry": 0,
+		"Champion": 0,
+		"Hero": 0,
+		"Ship": 0,
+		"total": 0
+	};
+	this.unitsLost = {
+		"Infantry": 0,
+		"Worker": 0,
+		"Female": 0,
+		"Cavalry": 0,
+		"Champion": 0,
+		"Hero": 0,
+		"Ship": 0,
+		"total": 0
+	};
+	this.unitsLostValue = 0;
+	this.enemyUnitsKilled = {
+		"Infantry": 0,
+		"Worker": 0,
+		"Female": 0,
+		"Cavalry": 0,
+		"Champion": 0,
+		"Hero": 0,
+		"Ship": 0,
+		"total": 0
+	};
+	this.enemyUnitsKilledValue = 0;
+	// buildings
+	this.buildingsClasses = [
+		"House",
+		"Economic",
+		"Outpost",
+		"Military",
+		"Fortress",
+		"CivCentre",
+		"Wonder"
+	];
+	this.buildingsConstructed = {
+		"House": 0,
+		"Economic": 0,
+		"Outpost": 0,
+		"Military": 0,
+		"Fortress": 0,
+		"CivCentre": 0,
+		"Wonder": 0,
+		"total": 0	
+	};
+	this.buildingsLost = {
+		"House": 0,
+		"Economic": 0,
+		"Outpost": 0,
+		"Military": 0,
+		"Fortress": 0,
+		"CivCentre": 0,
+		"Wonder": 0,
+		"total": 0
+		};
+	this.buildingsLostValue = 0;
+	this.enemyBuildingsDestroyed = {
+		"House": 0,
+		"Economic": 0,
+		"Outpost": 0,
+		"Military": 0,
+		"Fortress": 0,
+		"CivCentre": 0,
+		"Wonder": 0,
+		"total": 0
+		};
+	this.enemyBuildingsDestroyedValue = 0;
+	// resources
+	this.resourcesGathered = {
+		"food": 0,
+		"wood": 0,
+		"metal": 0,
+		"stone": 0,
+		"vegetarianFood": 0
+	};
+	this.resourcesUsed = {
+		"food": 0,
+		"wood": 0,
+		"metal": 0,
+		"stone": 0
+	};
+	this.resourcesSold = {
+		"food": 0,
+		"wood": 0,
+		"metal": 0,
+		"stone": 0
+	};
+	this.resourcesBought = {
+		"food": 0,
+		"wood": 0,
+		"metal": 0,
+		"stone": 0
+	};
+	this.tributesSent = 0;
+	this.tributesReceived = 0;
 	this.tradeIncome = 0;
 	this.treasuresCollected = 0;
 };
@@ -62,14 +131,12 @@
 		"enemyUnitsKilledValue": this.enemyUnitsKilledValue,
 		"buildingsConstructed": this.buildingsConstructed,
 		"buildingsLost": this.buildingsLost,
-		"buildingsLostValue": this.buildingsLostValue,
-		"enemyBuildingsDestroyed": this.enemyBuildingsDestroyed,
-		"enemyBuildingsDestroyedValue": this.enemyBuildingsDestroyedValue,
-		"civCentresBuilt": this.civCentresBuilt,
-		"enemyCivCentresDestroyed": this.enemyCivCentresDestroyed,
-		"resourcesGathered": this.resourcesGathered,
-		"resourcesUsed": this.resourcesUsed,
-		"resourcesSold": this.resourcesSold,
+		"buildingsLostValue": this.buildingsLostValue,
+		"enemyBuildingsDestroyed": this.enemyBuildingsDestroyed,
+		"enemyBuildingsDestroyedValue": this.enemyBuildingsDestroyedValue,
+		"resourcesGathered": this.resourcesGathered,
+		"resourcesUsed": this.resourcesUsed,
+		"resourcesSold": this.resourcesSold,
 		"resourcesBought": this.resourcesBought,
 		"tributesSent": this.tributesSent,
 		"tributesReceived": this.tributesReceived,
@@ -76,99 +143,140 @@
 		"tradeIncome": this.tradeIncome,
 		"treasuresCollected": this.treasuresCollected,
 		"percentMapExplored": this.GetPercentMapExplored()
-	};
-};
-
-StatisticsTracker.prototype.IncreaseTrainedUnitsCounter = function()
+	};
+};
+
+/**
+ * Increments counter associated with certain entity/counter and type of given entity.
+ * @param entity The entity id
+ * @param counter The name of the counter to increment (e.g. "unitsTrained")
+ * @param type The type of the counter (e.g. "workers")
+ */
+StatisticsTracker.prototype.CounterIncrement = function(entity, counter, type)
+{
+	var classes = entity.GetClassesList();
+	if (!classes)
+		return;
+	if (classes.indexOf(type) != -1)
+		this[counter][type]++;
+};
+
+/** 
+ * Counts the total number of units trained as well as an individual count for 
+ * each unit type. Based on templates.
+ * @param trainedUnit The unit that has been trained 
+ */ 
+StatisticsTracker.prototype.IncreaseTrainedUnitsCounter = function(trainedUnit)
+{
+	var cmpUnitEntityIdentity = Engine.QueryInterface(trainedUnit, IID_Identity);
+
+	if (!cmpUnitEntityIdentity)
+		return;
+
+	for each (var type in this.unitsClasses)
+		this.CounterIncrement(cmpUnitEntityIdentity, "unitsTrained", type);
+
+	this.unitsTrained.total++;
+};
+
+/** 
+ * Counts the total number of buildings constructed as well as an individual count for 
+ * each building type. Based on templates.
+ * @param constructedBuilding The building that has been constructed 
+ */ 
+StatisticsTracker.prototype.IncreaseConstructedBuildingsCounter = function(constructedBuilding)
+{
+	var cmpBuildingEntityIdentity = Engine.QueryInterface(constructedBuilding, IID_Identity);
+		
+	if (!cmpBuildingEntityIdentity)
+		return;
+
+	for each(var type in this.buildingsClasses)
+		this.CounterIncrement(cmpBuildingEntityIdentity, "buildingsConstructed", type);
+
+	this.buildingsConstructed.total++;
+};
+
+StatisticsTracker.prototype.KilledEntity = function(targetEntity)
 {
-	return this.unitsTrained++;
-};
-
-StatisticsTracker.prototype.IncreaseConstructedBuildingsCounter = function()
-{
-	return this.buildingsConstructed++;
-};
-
-StatisticsTracker.prototype.IncreaseBuiltCivCentresCounter = function()
-{
-	return this.civCentresBuilt++;
-};
-
-StatisticsTracker.prototype.KilledEntity = function(targetEntity)
-{
-	var cmpTargetEntityIdentity = Engine.QueryInterface(targetEntity, IID_Identity);
-	var cmpCost = Engine.QueryInterface(targetEntity, IID_Cost);
-	var costs = cmpCost.GetResourceCosts();
-	if (cmpTargetEntityIdentity)
-	{
-		var cmpFoundation = Engine.QueryInterface(targetEntity, IID_Foundation);
-		// We want to deal only with real structures, not foundations
-		var targetIsStructure = cmpTargetEntityIdentity.HasClass("Structure") && cmpFoundation == null;
-		var targetIsDomesticAnimal = cmpTargetEntityIdentity.HasClass("Animal") && cmpTargetEntityIdentity.HasClass("Domestic");
-		// Don't count domestic animals as units
-		var targetIsUnit = cmpTargetEntityIdentity.HasClass("Unit") && !targetIsDomesticAnimal;
-		var targetIsCivCentre = cmpTargetEntityIdentity.HasClass("CivCentre");
-
-		var cmpTargetOwnership = Engine.QueryInterface(targetEntity, IID_Ownership);
-	    
-		// Don't increase counters if target player is gaia (player 0)
-		if (cmpTargetOwnership.GetOwner() != 0)
-		{
-			if (targetIsUnit)
-			{
-				this.enemyUnitsKilled++;
-				for (var r in costs)
-				{
-					this.enemyUnitsKilledValue += costs[r];
-				}
-			}	
-			if (targetIsStructure)
-			{
-				this.enemyBuildingsDestroyed++;
-				for (var r in costs)
-				{
-					this.enemyBuildingsDestroyedValue += costs[r];
-				}
-			}
-			if (targetIsCivCentre && targetIsStructure)
-				this.enemyCivCentresDestroyed++;
-		}
-	}
-};
-
+	var cmpTargetEntityIdentity = Engine.QueryInterface(targetEntity, IID_Identity);
+	var cmpCost = Engine.QueryInterface(targetEntity, IID_Cost);
+	var costs = cmpCost.GetResourceCosts();
+	if (!cmpTargetEntityIdentity)
+		return;
+
+	var cmpFoundation = Engine.QueryInterface(targetEntity, IID_Foundation);
+	// We want to deal only with real structures, not foundations
+	var targetIsStructure = cmpTargetEntityIdentity.HasClass("Structure") && cmpFoundation == null;
+	var targetIsDomesticAnimal = cmpTargetEntityIdentity.HasClass("Animal") && cmpTargetEntityIdentity.HasClass("Domestic");
+	// Don't count domestic animals as units
+	var targetIsUnit = cmpTargetEntityIdentity.HasClass("Unit") && !targetIsDomesticAnimal;
+
+	var cmpTargetOwnership = Engine.QueryInterface(targetEntity, IID_Ownership);
+    
+	// Don't increase counters if target player is gaia (player 0)
+	if (cmpTargetOwnership.GetOwner() == 0)
+		return;
+
+	if (targetIsUnit)
+	{
+		for each (var type in this.unitsClasses)
+			this.CounterIncrement(cmpTargetEntityIdentity, "enemyUnitsKilled", type);
+
+		this.enemyUnitsKilled.total++;
+		
+		for each (var cost in costs)
+			this.enemyUnitsKilledValue += cost;
+	}	
+	if (targetIsStructure)
+	{
+		for each (var type in this.buildingsClasses)
+			this.CounterIncrement(cmpTargetEntityIdentity, "enemyBuildingsDestroyed", type);
+
+		this.enemyBuildingsDestroyed.total++;
+		
+		for each (var cost in costs)
+			this.enemyBuildingsDestroyedValue += cost;
+	}
+};
+
 StatisticsTracker.prototype.LostEntity = function(lostEntity)
 {
-	var cmpLostEntityIdentity = Engine.QueryInterface(lostEntity, IID_Identity);
-	var cmpCost = Engine.QueryInterface(lostEntity, IID_Cost);
-	var costs = cmpCost.GetResourceCosts();
-	if (cmpLostEntityIdentity)
-	{
-		var cmpFoundation = Engine.QueryInterface(lostEntity, IID_Foundation);
-		// We want to deal only with real structures, not foundations
-		var lostEntityIsStructure = cmpLostEntityIdentity.HasClass("Structure") && cmpFoundation == null;
-		var lostEntityIsDomesticAnimal = cmpLostEntityIdentity.HasClass("Animal") && cmpLostEntityIdentity.HasClass("Domestic");
-		// Don't count domestic animals as units
-		var lostEntityIsUnit = cmpLostEntityIdentity.HasClass("Unit") && !lostEntityIsDomesticAnimal;
-
-		if (lostEntityIsUnit)
-		{
-			this.unitsLost++;
-			for (var r in costs)
-			{
-				this.unitsLostValue += costs[r];
-			}	
-		}	
-		if (lostEntityIsStructure)
-		{
-			this.buildingsLost++;
-			for (var r in costs)
-			{
-				this.buildingsLostValue += costs[r];
-			}
-		}
-	}
-};
-
+	var cmpLostEntityIdentity = Engine.QueryInterface(lostEntity, IID_Identity);
+	var cmpCost = Engine.QueryInterface(lostEntity, IID_Cost);
+	var costs = cmpCost.GetResourceCosts();
+	if (!cmpLostEntityIdentity)
+		return;
+	
+	var cmpFoundation = Engine.QueryInterface(lostEntity, IID_Foundation);
+	// We want to deal only with real structures, not foundations
+	var lostEntityIsStructure = cmpLostEntityIdentity.HasClass("Structure") && cmpFoundation == null;
+	var lostEntityIsDomesticAnimal = cmpLostEntityIdentity.HasClass("Animal") && cmpLostEntityIdentity.HasClass("Domestic");
+	// Don't count domestic animals as units
+	var lostEntityIsUnit = cmpLostEntityIdentity.HasClass("Unit") && !lostEntityIsDomesticAnimal;
+
+	if (lostEntityIsUnit)
+	{
+		for each (var type in this.unitsClasses)
+			this.CounterIncrement(cmpLostEntityIdentity, "unitsLost", type);
+
+		this.unitsLost.total++;
+		
+		for each (var cost in costs)
+			this.unitsLostValue += cost;	
+	}	
+	if (lostEntityIsStructure)
+	{
+		for each (var type in this.buildingsClasses)
+			this.CounterIncrement(cmpLostEntityIdentity, "buildingsLost", type);
+
+		this.buildingsLost.total++;
+		
+		for each (var cost in costs)
+			this.buildingsLostValue += cost;
+	}
+};
+
 /**
  * @param type Generic type of resource (string)
  * @param amount Amount of resource, whick should be added (integer)
@@ -176,13 +284,13 @@
  */
 StatisticsTracker.prototype.IncreaseResourceGatheredCounter = function(type, amount, specificType)
 {
-	this.resourcesGathered[type] += amount;
-	
-	if (type == "food" && (specificType == "fruit" || specificType == "grain"))
-		this.resourcesGathered["vegetarianFood"] += amount;
-};
-
-/**
+	this.resourcesGathered[type] += amount;
+	
+	if (type == "food" && (specificType == "fruit" || specificType == "grain"))
+		this.resourcesGathered.vegetarianFood += amount;
+};
+
+/**
  * @param type Generic type of resource (string)
  * @param amount Amount of resource, whick should be added (integer)
  */
@@ -190,39 +298,39 @@
 {
 	this.resourcesUsed[type] += amount;
 };
-
-StatisticsTracker.prototype.IncreaseTreasuresCollectedCounter = function()
-{
-	return this.treasuresCollected++;
-};
-
-StatisticsTracker.prototype.IncreaseResourcesSoldCounter = function(type, amount)
-{
-	this.resourcesSold[type] += amount;
-}
-
-StatisticsTracker.prototype.IncreaseResourcesBoughtCounter = function(type, amount)
-{
-	this.resourcesBought[type] += amount;
-}
-
-StatisticsTracker.prototype.IncreaseTributesSentCounter = function(amount)
-{
-	this.tributesSent += amount;
-}
-
-StatisticsTracker.prototype.IncreaseTributesReceivedCounter = function(amount)
-{
-	this.tributesReceived += amount;
-}
-
-StatisticsTracker.prototype.IncreaseTradeIncomeCounter = function(amount)
-{
-	this.tradeIncome += amount;
-}
-
-StatisticsTracker.prototype.GetPercentMapExplored = function()
-{
+
+StatisticsTracker.prototype.IncreaseTreasuresCollectedCounter = function()
+{
+	this.treasuresCollected++;
+};
+
+StatisticsTracker.prototype.IncreaseResourcesSoldCounter = function(type, amount)
+{
+	this.resourcesSold[type] += amount;
+};
+
+StatisticsTracker.prototype.IncreaseResourcesBoughtCounter = function(type, amount)
+{
+	this.resourcesBought[type] += amount;
+};
+
+StatisticsTracker.prototype.IncreaseTributesSentCounter = function(amount)
+{
+	this.tributesSent += amount;
+};
+
+StatisticsTracker.prototype.IncreaseTributesReceivedCounter = function(amount)
+{
+	this.tributesReceived += amount;
+};
+
+StatisticsTracker.prototype.IncreaseTradeIncomeCounter = function(amount)
+{
+	this.tradeIncome += amount;
+};
+
+StatisticsTracker.prototype.GetPercentMapExplored = function()
+{
 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
 	var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player);
 	return cmpRangeManager.GetPercentMapExplored(cmpPlayer.GetPlayerID());
