var map;

function createMarker(point, text, title,iconFile) {
    	var marker =new GMarker(point,{title:title, icon:iconFile});
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(text);
        });
    	return marker;
    }
    
function load(myPlaces) {
	if (GBrowserIsCompatible()){
    	map = new GMap2(document.getElementById("map"));
    	map.setUIToDefault();
    	map.setCenter(new GLatLng(45.329222,11.6425), 12);
    	for(i=0;i<myPlaces.length; i++){
    		for(j=0;j<myPlaces[i].length; j++){
    			map.addOverlay(myPlaces[i][j]);
    		}
        }
    }
}
/*
function getIpos(){
	navigator.geolocation.getCurrentPosition(navHandler);
}

function navHandler(location) {
	map.setCenter(new GLatLng(location.coords.latitude,location.coords.longitude), 12);
}*/

//ICONE
icons = new Array();
icons['blue'] = new GIcon(G_DEFAULT_ICON);
icons['blue'].image = "http://www.tekweb.it/fileadmin/icons/blue.png";
icons['green'] = new GIcon(G_DEFAULT_ICON);
icons['green'].image = "http://www.tekweb.it/fileadmin/icons/green.png";
icons['yellow'] = new GIcon(G_DEFAULT_ICON);
icons['yellow'].image = "http://www.tekweb.it/fileadmin/icons/yellow.png";
icons['red'] = new GIcon(G_DEFAULT_ICON);
icons['red'].image = "http://www.tekweb.it/fileadmin/icons/red.png";



//LUOGHI
var places = new Array();

//food
places[0] = new Array();
places[0][0] = createMarker(new GLatLng(45.313601,11.646667),"Trattoria ai Capitelli<br/><br/>Via Capitelli, 60, 35030 Vo' Padova <br/><br/>Tel. 049 994 0094<br/><br/>", "Trattoria ai Capitelli",icons['red']);





jQuery(document).ready(function(){
	jQuery('#map').attr("style","width: 538px; height: 350px; margin:0 0 10px 0");
	load(places);
});


