         var map = null;
         var shape = null;
         
         function getMap(latitide,longitude,title,description)
         {
            map = new VEMap('map');
			map.SetDashboardSize(VEDashboardSize.Small);
            map.LoadMap(new VELatLong(latitide,longitude), 15 ,'R' ,false);
 			map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
			
			shape = new VEShape(VEShapeType.Pushpin, map.GetCenter());
            map.AddShape(shape);
            shape.SetTitle(title);
            shape.SetDescription(description);
         }  
         
         function setMapCenter(latitide,longitude)
         {
         	map.SetCenter(new VELatLong(latitide,longitude));
         } 
         
         function centerShape(latitide,longitude)
         {
         	shape.SetPoints([new VELatLong(latitide,longitude)]);
         	//This does not work: shape.SetPoints([map.GetCenter()]);
         } 
         
         function setShapeDescription(description)
         {
            shape.SetDescription(description);
         }
         
         function startMap()
         {
         	getMap(document.centers[0].latitude,document.centers[0].longitude,'Autoscuola Potenza',document.centers[0].city);
         	setMapCenter(document.centers[1].latitude,document.centers[1].longitude);
         	centerShape(document.centers[1].latitude,document.centers[1].longitude);
         	setShapeDescription(document.centers[1].city);
         }
         
         function initVE()
         {
        	if ((typeof VEMap!="undefined") && (typeof VEShape!="undefined")) {
	       		getMap(document.centers[0].latitude,document.centers[0].longitude,document.schoolName,document.centers[0].city);
	       	}	
	       	else {
				//needed for IE6: ometimes the microsoft file is not loaded properly
				//location.reload();
			}
         }
         

