var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(52.2, 19.2), 6);


//define urls
baseUrl = "http://www.quovadis.com";
mapUrl = baseUrl + "/index.php?pid=825&miasto=";
imageUrl = baseUrl + "/storage/images/googlemap/";


// Create a base icon for all of our markers that specifies the
// shadow, icon dimensions, etc.
var baseIcon = new GIcon();
baseIcon.shadow = imageUrl + "shadow50.png";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
baseIcon.infoShadowAnchor = new GPoint(18, 25);



// Creates a marker whose info window displays the letter corresponding
// to the given index.
function createMarker(point, index, info, city) {
  // Create a lettered icon for this point using our icon class
  var icon = new GIcon(baseIcon);
  icon.image = imageUrl +"cityH.png";
  var marker = new GMarker(point, icon);
  
//show city info with photo
/*	
	GEvent.addListener(marker, "mouseover", function() {
	    marker.openInfoWindowHtml("<h2>" + info + "</h2><img class=miniCity src=" + imageUrl + city + ".jpg/> ");
			 })
*/
//redirect to city map			 
	GEvent.addListener(marker, "click", function() {
	    window.location.replace(mapUrl + city);
		//window.location.go(mapUrl + city);
			 })
			 
		 
			 
  return marker;
}



var cityData = [
[52.2494,21.0199,'Warsaw','warszawa'],
[50.0617,19.9374,'Cracow','krakow'],
[52.4063,16.9235,'Poznan','poznan'],
[51.11,17.0302,'Wroclaw','wroclaw'],
[54.3537,18.651,'Trojmiasto','gdansk'],
[49.2979,19.9571,'Zakopane','zakopane'],
[53.0412,18.6102,'Torun','torun'],
[53.141,18.01,'Bydgoszcz','bydgoszcz'],
[53.4366,14.545,'Szczecin','szczecin'],
[51.7567,19.4689,'Lodz','lodz'],
[50.2711,19.0201,'Katowice','katowice'],
[50.8137,19.1293,'Czestochowa','czestochowa'],
[51.2381,22.5705,'Lublin','lublin'],
[50.0543,22.0001,'Rzeszow','rzeszow'],
[53.7877,20.4902,'Olsztyn','olsztyn'],
[53.1501,23.1606,'Bialystok','bialystok'],
[51.9023,15.4494,'Zielona Gora','zielonagora'],
[50.89,20.65,'Kielce','kielce'],
[51.77,18.1,'Kalisz','kalisz'],
[50.9032,15.734395,'Jelenia Gora','jeleniagora']];

	 for(var i=0; i < cityData.length;  i++)
		{
			var point = new GLatLng(cityData[i][0],cityData[i][1]);
			map.addOverlay(createMarker(point, i, cityData[i][2], cityData[i][3] )); 
	
			

		}



