You are overwriting the "geochart" variable each time you loop through the loop, so when the loop finishes, there is only 1 "geochart" for the listeners to reference inside their associated functions. Try this instead:
function drawVisualization() {
var geocharts = {};
var dataTables = {};
for (var key in iwmparam) {
var id = parseInt(iwmparam[key]['id']);
message[id] = iwmparam[key]['txt'];
dataTables[key] = google.visualization.arrayToDataTable([
['Country', 'Popularity'],
['Germany', 200],
['United States', 300],
['Brazil', 400],
['Canada', 500],
['France', 600],
['RU', 700]
]);
geocharts[key] = new google.visualization.GeoChart(document.getElementById('map_'+id));
// use a closure to lock the value of "key" in this iteration of the loop to "x" inside the closure
google.visualization.events.addListener(geocharts[key], 'select', (function(x) {
return function () {
var selection = geocharts[x].getSelection();
if (selection.length == 1) {
var selectedRow = selection[0].row;
var selectedRegion = dataTables[x].getValue(selectedRow, 0);
alert(message[id] + " " + selectedRegion);
}
}
})(key));
geocharts[key].draw(dataTables[key], {
region:'world',
width: '500',
legend: 'none'
});
}
}