Index: binaries/data/mods/public/gui/summary/counters.js
===================================================================
--- binaries/data/mods/public/gui/summary/counters.js	(revision 17126)
+++ binaries/data/mods/public/gui/summary/counters.js	(working copy)
@@ -2,13 +2,11 @@
 var teamMiscHelperData = [];
 
 function resetDataHelpers()
-{
 	teamMiscHelperData = [];
-}
 
 function updateCountersPlayer(playerState, counters, idGUI)
 {
-	for (var w in counters)
+	for (let w in counters)
 	{
 		var fn = counters[w].fn;
 		Engine.GetGUIObjectByName(idGUI + "[" + w + "]").caption = fn && fn(playerState, w);
@@ -18,7 +16,7 @@
 function calculateEconomyScore(playerState, position)
 {
 	let total = 0;
-	for each (var res in playerState.statistics.resourcesGathered)
+	for each (let res in playerState.statistics.resourcesGathered)
 		total += res;
 
 	return Math.round(total / 10);
@@ -26,8 +24,8 @@
 
 function calculateMilitaryScore(playerState, position)
 {
-	return Math.round((playerState.statistics.enemyUnitsKilledValue +
-		playerState.statistics.enemyBuildingsDestroyedValue) / 10);
+	return Math.round((playerState.statistics.enemyUnitsKilledValue + 
+	       playerState.statistics.enemyBuildingsDestroyedValue) / 10);
 }
 
 function calculateExplorationScore(playerState, position)
@@ -38,21 +36,21 @@
 function calculateScoreTotal(playerState, position)
 {
 	return calculateEconomyScore(playerState) + 
-		calculateMilitaryScore(playerState) +
-		calculateExplorationScore(playerState);
+	       calculateMilitaryScore(playerState) + 
+	       calculateExplorationScore(playerState);
 }
 
 function calculateScoreTeam(counters)
 {
-	for (var t in g_Teams)
+	for (let t in g_Teams)
 	{
 		if (t == -1)
 			continue;
 
-		for (var w in counters)
+		for (let w in counters)
 		{
 			var total = 0;
-			for (var p = 0; p < g_Teams[t]; ++p)
+			for (let p = 0; p < g_Teams[t]; ++p)
 				total += (+Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption);
 
 			Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = total;
@@ -64,18 +62,18 @@
 {
 	var type = BUILDINGS_TYPES[position];
 	return TRAINED_COLOR + playerState.statistics.buildingsConstructed[type] + '[/color] / ' +
-	LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color] / ' +
-	KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]';
+	       LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color] / ' +
+	       KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]';
 }
 
 function calculateColorsTeam(counters)
 {
-	for (var t in g_Teams)
+	for (let t in g_Teams)
 	{
 		if (t == -1)
 			continue;
 
-		for (var w in counters)
+		for (let w in counters)
 		{
 			var total = {
 				c : 0,
@@ -82,7 +80,7 @@
 				l : 0,
 				d : 0
 			};
-			for (var p = 0; p < g_Teams[t]; ++p)
+			for (let p = 0; p < g_Teams[t]; ++p)
 			{
 				var caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption;
 				// clean [Color=""], [/Color] and white space for make the sum more easy
@@ -106,8 +104,8 @@
 {
 	var type = UNITS_TYPES[position];
 	return TRAINED_COLOR + playerState.statistics.unitsTrained[type] + '[/color] / ' +
-	LOST_COLOR + playerState.statistics.unitsLost[type] + '[/color] / ' +
-	KILLED_COLOR + playerState.statistics.enemyUnitsKilled[type] + '[/color]';
+	       LOST_COLOR + playerState.statistics.unitsLost[type] + '[/color] / ' +
+	       KILLED_COLOR + playerState.statistics.enemyUnitsKilled[type] + '[/color]';
 }
 
 function calculateResources(playerState, position)
@@ -114,7 +112,7 @@
 {
 	var type = RESOURCES_TYPES[position];
 	return INCOME_COLOR + playerState.statistics.resourcesGathered[type] + '[/color] / ' +
-	OUTCOME_COLOR + (playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type]) + '[/color]';
+	       OUTCOME_COLOR + (playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type]) + '[/color]';
 }
 
 function calculateTotalResources(playerState, position)
@@ -122,7 +120,7 @@
 	var totalGathered = 0;
 	var totalUsed = 0;
 
-	for each (var type in RESOURCES_TYPES)
+	for each (let type in RESOURCES_TYPES)
 	{
 		totalGathered += playerState.statistics.resourcesGathered[type];
 		totalUsed += playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type];
@@ -143,17 +141,18 @@
 
 function calculateTributeSent(playerState, position)
 {
-	return INCOME_COLOR + playerState.statistics.tributesSent + "[/color] / " + OUTCOME_COLOR + playerState.statistics.tributesReceived + "[/color]";
+	return INCOME_COLOR + playerState.statistics.tributesSent + "[/color] / " + 
+	       OUTCOME_COLOR + playerState.statistics.tributesReceived + "[/color]";
 }
 
 function calculateResourcesTeam(counters)
 {
-	for (var t in g_Teams)
+	for (let t in g_Teams)
 	{
 		if (t == -1)
 			continue;
 
-		for (var w in counters)
+		for (let w in counters)
 		{
 			var teamTotal = "undefined";
 
@@ -161,7 +160,7 @@
 				i : 0,
 				o : 0
 			};
-			for (var p = 0; p < g_Teams[t]; ++p)
+			for (let p = 0; p < g_Teams[t]; ++p)
 			{
 				var caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption;
 				// clean [Color=""], [/Color] and white space for make the sum more easy
@@ -192,16 +191,16 @@
 {
 	var type = RESOURCES_TYPES[position];
 	return INCOME_COLOR + '+' + playerState.statistics.resourcesBought[type] + '[/color] ' +
-		OUTCOME_COLOR + '-' + playerState.statistics.resourcesSold[type] + '[/color]';
+	       OUTCOME_COLOR + '-' + playerState.statistics.resourcesSold[type] + '[/color]';
 }
 
 function calculateBatteryEfficiency(playerState, position)
 {
 	var totalBought = 0;
-	for each (var boughtAmount in playerState.statistics.resourcesBought)
+	for each (let boughtAmount in playerState.statistics.resourcesBought)
 		totalBought += boughtAmount;
 	var totalSold = 0;
-	for each (var soldAmount in playerState.statistics.resourcesSold)
+	for each (let soldAmount in playerState.statistics.resourcesSold)
 		totalSold += soldAmount;
 
 	return Math.floor(totalSold > 0 ? (totalBought / totalSold) * 100 : 0) + "%";
@@ -214,12 +213,12 @@
 
 function calculateMarketTeam(counters)
 {
-	for (var t in g_Teams)
+	for (let t in g_Teams)
 	{
 		if (t == -1)
 			continue;
 
-		for (var w in counters)
+		for (let w in counters)
 		{
 			var teamTotal = "undefined";
 
@@ -227,7 +226,7 @@
 				i : 0,
 				o : 0
 			};
-			for (var p = 0; p < g_Teams[t]; ++p)
+			for (let p = 0; p < g_Teams[t]; ++p)
 			{
 				var caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption;
 				// clean [Color=""], [/Color], white space, + and % for make the sum more easy
@@ -334,12 +333,12 @@
 
 function calculateMiscellaneous(counters)
 {
-	for (var t in g_Teams)
+	for (let t in g_Teams)
 	{
 		if (t == -1)
 			continue;
 
-		for (var w in counters)
+		for (let w in counters)
 		{
 			var teamTotal = "undefined";
 
Index: binaries/data/mods/public/gui/summary/layout.js
===================================================================
--- binaries/data/mods/public/gui/summary/layout.js	(revision 17126)
+++ binaries/data/mods/public/gui/summary/layout.js	(working copy)
@@ -16,7 +16,7 @@
 		],
 		"teamCounterFn": calculateScoreTeam
 	},
-    {	// buildings panel
+	{	// buildings panel
 		"headings": [	// headings on buildings panel
 			{ "caption": translate("Player name"), "yStart": 26, "width": 200 },
 			{ "caption": translate("Total"), "yStart": 34, "width": 105 },
@@ -32,14 +32,14 @@
 			{ "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed)"), "yStart": 16, "width": (85 * 7 + 105) },	// width = 700
 		],
 		"counters": [	// counters on buildings panel
-			{"width": 105, "fn": calculateBuildings},
-			{"width": 85, "fn": calculateBuildings},
-			{"width": 85, "fn": calculateBuildings},
-			{"width": 85, "fn": calculateBuildings},
-			{"width": 85, "fn": calculateBuildings},
-			{"width": 85, "fn": calculateBuildings},
-			{"width": 85, "fn": calculateBuildings},
-			{"width": 85, "fn": calculateBuildings}
+			{ "width": 105, "fn": calculateBuildings },
+			{ "width": 85, "fn": calculateBuildings },
+			{ "width": 85, "fn": calculateBuildings },
+			{ "width": 85, "fn": calculateBuildings },
+			{ "width": 85, "fn": calculateBuildings },
+			{ "width": 85, "fn": calculateBuildings },
+			{ "width": 85, "fn": calculateBuildings },
+			{ "width": 85, "fn": calculateBuildings }
 		],
 		"teamCounterFn": calculateColorsTeam
 	},
@@ -59,14 +59,14 @@
 			{ "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 7 + 120) },	// width = 820
 		],
 		"counters": [	// counters on units panel
-			{"width": 120, "fn": calculateUnits},
-			{"width": 100, "fn": calculateUnits},
-			{"width": 100, "fn": calculateUnits},
-			{"width": 100, "fn": calculateUnits},
-			{"width": 100, "fn": calculateUnits},
-			{"width": 100, "fn": calculateUnits},
-			{"width": 100, "fn": calculateUnits},
-			{"width": 100, "fn": calculateUnits}
+			{ "width": 120, "fn": calculateUnits },
+			{ "width": 100, "fn": calculateUnits },
+			{ "width": 100, "fn": calculateUnits },
+			{ "width": 100, "fn": calculateUnits },
+			{ "width": 100, "fn": calculateUnits },
+			{ "width": 100, "fn": calculateUnits },
+			{ "width": 100, "fn": calculateUnits },
+			{ "width": 100, "fn": calculateUnits }
 		],
 		"teamCounterFn": calculateColorsTeam
 	},
@@ -86,14 +86,14 @@
 			{ "caption": translate("Resource Statistics (Gathered / Used)"), "yStart": 16, "width": (100 * 4 + 110) }, // width = 510
 		],
 		"counters": [	// counters on resources panel
-			{"width": 100, "fn": calculateResources},
-			{"width": 100, "fn": calculateResources},
-			{"width": 100, "fn": calculateResources},
-			{"width": 100, "fn": calculateResources},
-			{"width": 110, "fn": calculateTotalResources},
-			{"width": 121, "fn": calculateTributeSent},
-			{"width": 100, "fn": calculateTreasureCollected},
-			{"width": 100, "fn": calculateLootCollected}
+			{ "width": 100, "fn": calculateResources },
+			{ "width": 100, "fn": calculateResources },
+			{ "width": 100, "fn": calculateResources },
+			{ "width": 100, "fn": calculateResources },
+			{ "width": 110, "fn": calculateTotalResources },
+			{ "width": 121, "fn": calculateTributeSent },
+			{ "width": 100, "fn": calculateTreasureCollected },
+			{ "width": 100, "fn": calculateLootCollected }
 		],
 		"teamCounterFn": calculateResourcesTeam
 	},
@@ -109,12 +109,12 @@
 		],
 		"titleHeadings": [],
 		"counters": [	// counters on market panel
-			{"width": 100, "fn": calculateResourceExchanged},
-			{"width": 100, "fn": calculateResourceExchanged},
-			{"width": 100, "fn": calculateResourceExchanged},
-			{"width": 100, "fn": calculateResourceExchanged},
-			{"width": 100, "fn": calculateBatteryEfficiency},
-			{"width": 100, "fn": calculateTradeIncome}
+			{ "width": 100, "fn": calculateResourceExchanged },
+			{ "width": 100, "fn": calculateResourceExchanged },
+			{ "width": 100, "fn": calculateResourceExchanged },
+			{ "width": 100, "fn": calculateResourceExchanged },
+			{ "width": 100, "fn": calculateBatteryEfficiency },
+			{ "width": 100, "fn": calculateTradeIncome }
 		],
 		"teamCounterFn": calculateMarketTeam
 	},
@@ -132,12 +132,12 @@
 			{ "caption": translate("Map control"), "xOffset": 400, "yStart": 16, "width": 200 }
 		],
 		"counters": [	// counters on miscellaneous panel
-			{"width": 100, "fn": calculateVegetarianRatio},
-			{"width": 100, "fn": calculateFeminization},
-			{"width": 100, "fn": calculateKillDeathRatio},
-			{"width": 100, "fn": calculateMapExploration},
-			{"width": 100, "fn": calculateMapPeakControl},
-			{"width": 100, "fn": calculateMapFinalControl}
+			{ "width": 100, "fn": calculateVegetarianRatio },
+			{ "width": 100, "fn": calculateFeminization },
+			{ "width": 100, "fn": calculateKillDeathRatio },
+			{ "width": 100, "fn": calculateMapExploration },
+			{ "width": 100, "fn": calculateMapPeakControl },
+			{ "width": 100, "fn": calculateMapFinalControl }
 		],
 		"teamCounterFn": calculateMiscellaneous
 	}
@@ -145,7 +145,7 @@
 
 function resetGeneralPanel()
 {
-	for (var h = 0; h < MAX_HEADINGTITLE; ++h) 
+	for (let h = 0; h < MAX_HEADINGTITLE; ++h) 
 	{
 		Engine.GetGUIObjectByName("titleHeading["+ h +"]").hidden = true;
 		Engine.GetGUIObjectByName("Heading[" + h + "]").hidden = true;
@@ -164,7 +164,7 @@
 function updateGeneralPanelHeadings(headings)
 {
 	var left = 50;
-	for (var h in headings)
+	for (let h in headings)
 	{
 		var headerGUIName = "playerNameHeading";
 		if (h > 0)
@@ -183,7 +183,7 @@
 function updateGeneralPanelTitles(titleHeadings)
 {
 	var left = 250;
-	for (var th in titleHeadings)
+	for (let th in titleHeadings)
 	{
 		if (th >= MAX_HEADINGTITLE)
 			break;
@@ -209,7 +209,7 @@
 	{
 		left = 240;
 		var counterObject;
-		for (var w in counters)
+		for (let w in counters)
 		{
 			counterObject = Engine.GetGUIObjectByName("valueData[" + p + "][" + w + "]");
 			counterObject.size = left + " 6 " + (left + counters[w].width) + " 100%";
@@ -223,7 +223,7 @@
 		for (let t = 0; t < g_MaxTeams; ++t)
 		{
 			left = 240;
-			for (var w in counters)
+			for (let w in counters)
 			{
 				counterObject = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]");
 				counterObject.size = left + " 6 " + (left + counters[w].width) + " 100%";
@@ -253,7 +253,7 @@
 		return;
 
 	var yStart = TEAMS_BOX_Y_START + g_WithoutTeam * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP);
-	for (var i = 0; i < g_Teams.length; ++i)
+	for (let i = 0; i < g_Teams.length; ++i)
 	{
 		if (!g_Teams[i])
 			continue;
Index: binaries/data/mods/public/gui/summary/summary.js
===================================================================
--- binaries/data/mods/public/gui/summary/summary.js	(revision 17126)
+++ binaries/data/mods/public/gui/summary/summary.js	(working copy)
@@ -52,7 +52,7 @@
 		rightSpacer.size = (tabSize.right - 2) + " " + rightSpacer.size.top + " 100%-20 " + rightSpacer.size.bottom;
 	}
 
-	for (var i = 0; i < panelNames.length; ++i)
+	for (let i = 0; i < panelNames.length; ++i)
 	{
 		Engine.GetGUIObjectByName(panelNames[i] + 'Button').sprite = "BackgroundTab";
 	}
@@ -73,7 +73,7 @@
 	updateGeneralPanelTeams();
 
 	var playerBoxesCounts = [ ];
-	for (var i = 0; i < g_PlayerCount; ++i)
+	for (let i = 0; i < g_PlayerCount; ++i)
 	{
 		var playerState = g_GameData.playerStates[i+1];
 
@@ -98,9 +98,9 @@
 		}
 
 		var colorString = "color: "
-				+ Math.floor(playerState.color.r * 255) + " "
-				+ Math.floor(playerState.color.g * 255) + " "
-				+ Math.floor(playerState.color.b * 255);
+		                + Math.floor(playerState.color.r * 255) + " "
+		                + Math.floor(playerState.color.g * 255) + " "
+		                + Math.floor(playerState.color.b * 255);
 
 		var rowPlayerObject = Engine.GetGUIObjectByName(rowPlayer);
 		rowPlayerObject.hidden = false;
@@ -146,7 +146,7 @@
 		var mapSizes = initMapSizes();
 
 		// retrieve the index of the map size
-		for (var mapSizeIndex in mapSizes.tiles)
+		for (let mapSizeIndex in mapSizes.tiles)
 		{
 			if (mapSizes.tiles[mapSizeIndex] == data.mapSettings.Size)
 			{
@@ -164,7 +164,7 @@
 	if (data.mapSettings.LockTeams)	// teams ARE locked
 	{
 		// Count teams
-		for(var t = 0; t < g_PlayerCount; ++t)
+		for(let t = 0; t < g_PlayerCount; ++t)
 		{
 			let playerTeam = data.playerStates[t+1].team;
 			if (g_Teams[playerTeam])
@@ -182,7 +182,7 @@
 	// Erase teams data if teams are not displayed
 	if (!g_Teams)
 	{
-		for(var p = 0; p < g_PlayerCount; ++p)
+		for(let p = 0; p < g_PlayerCount; ++p)
 			data.playerStates[p+1].team = -1;
 	}
 
@@ -190,7 +190,7 @@
 	if (g_Teams)
 	{
 		// Count players without team (or all if teams are not displayed)
-		for (var i = 0; i < g_Teams.length; ++i)
+		for (let i = 0; i < g_Teams.length; ++i)
 			g_WithoutTeam -= g_Teams[i] ? g_Teams[i] : 0;
 	}
