// JavaScript Document

    //<![CDATA[

	var map = null;
	var geocoder = null;

    function load() 
	{
    	if (GBrowserIsCompatible()) 
	  	{
        	// Crea mappa
			map = new GMap2(document.getElementById("map"));
        	
			// Creo GeoCoder Max 1.6 query/sec
			geocoder = new GClientGeocoder();
		
			// Imposta centro su Roma (LAT 41.90, LONG 12.49)
			map.setCenter(new GLatLng(41.90, 12.49), 5);
			
			// Visualizza controlli - TIPO MAPPA
			map.addControl(new GMapTypeControl());
			
			// Visualizza controlli - ZOOM GRANDE
			map.addControl(new GLargeMapControl());
			
			
						
      	}
    }

// Create our "tiny" marker icon
var tinyIcon = new GIcon();
tinyIcon.image = "/images/icona.png";
tinyIcon.shadow = "/images/icona_shadow.png";
tinyIcon.iconSize = new GSize(30, 30);
tinyIcon.shadowSize = new GSize(45, 30);
tinyIcon.iconAnchor = new GPoint(15 ,30);
tinyIcon.infoWindowAnchor = new GPoint(12, 10);

                
// Set up our GMarkerOptions object
markerOptions = { icon:tinyIcon };
DIV_option_in = "<div class=\"google_map\">"
DIV_option_out ="</div>"

//Array location
var maker_array = new Array();
var label_array = new Array();
var lat_array = new Array(45.727700, 40.915168, 45.64274, 41.0063802, 41.123485,40.678523, 45.409568 );
var long_array = new Array(12.245877, 14.819639, 11.765575, 14.325260, 16.803859,14.761487,11.876589);


label_array[0] = DIV_option_in+"<h2>Parco commerciale di Villorba</h2>   Via Pacinotti Antonio, 14 -  Fontane Di Villorba (Treviso)<br />Tel. 0422.919317 <br />email: treviso@vistaexpert.it<br />Lunedì 15,30 / 20,00 <br />Martedì/Sabato:<br /> 9,30 - 13,00 / 15,30 - 20,00  "+DIV_option_out

label_array[1] = DIV_option_in+"<h2>Parco commerciale Appia(all'interno del Famila) </h2> Via Appia, 124 - Atripalda (Avellino)<br />Tel 0825.628231<br /> email: atripalda@vistaexpert.it<br />Lunedi/Venerdi:<br /> 9,00 - 13,00 / 15,30 - 20,30<br />Sabato: <br />9,00 / 20,30  <br /> Domenica:<br />  9,30 / 13,00  "+DIV_option_out

label_array[2] = DIV_option_in+"<h2>Centro commerciale Aliper</h2>  Via Marconi, 92 Int.1 - Fontaniva (Padova)<br />Tel. 049.9404538 <br />email: fontaniva@vistaexpert.it<br />Lunedi/Sabato: <br />8,30/20,00  "+DIV_option_out

label_array[3] = DIV_option_in+"<h2>Centro commerciale Campania</h2>  Marcianise (Caserta)<br />tel. 0823. 609003<br /> email: centrocampania@vistaexpert.it<br />Lunedi/Domenica:<br /> 9,00/22,00  "+DIV_option_out

label_array[4] = DIV_option_in+"<h2>Centro direzionale Piazza Europa</h2> Piazza Europa 13-16 - San Paolo (Bari) <br />Tel. 080.5370280 <br />email: bari@vistaexpert.it<br />Lunedi/Sabato:<br /> 9,00 - 13,00 / 16,00 - 20,00"+DIV_option_out

label_array[5] = DIV_option_in+"<h2>Salerno centro storico</h2>Via mercanti, 34<br />tel. 089.229636   <br />email: siano@vistaexpert.it<br />Lunedi/Sabato:<br /> 9,00/13,00 - 16,30/20,00 <br /> "+DIV_option_out

label_array[6] = DIV_option_in+"<h2>Centro commerciale Il Parco</h2>Via Straelle, 15 - Camposanpiero (Padova)<br />tel. 049.9303171 <br />email: camposampiero@vistaexpert.it<br />Lunedi: 14,00/20,00 <br />Marted&igrave; - Venerd&igrave; 9,00/20,00 <br /> Sabato  9,00/20,30 "+DIV_option_out



// Crea il marker con la label passata come parametro
function createMarker(point, label) 
{
	// Variabile marker
	var marker = new GMarker(point , markerOptions);
  	
	// Crea listener per il click sull'oggetto
	GEvent.addListener(marker, "click", function() 
	{
    	marker.openInfoWindowHtml(label);
  	});
maker_array.push(marker)
  	return marker;
}

function showAll(){
	
for(i=0; i<label_array.length; i++){
		
			map.addOverlay(createMarker(new GLatLng(lat_array[i], long_array[i]), label_array[i])); 
			};	
}

function showAdressCoo(location){
	map.setZoom(20)	
	map.addOverlay(createMarker(new GLatLng(lat_array[location], long_array[location]), label_array[location]));
	point = new GLatLng(lat_array[location], long_array[location]);
	map.setCenter(point);
	showLabel(location);
	 

};

function showLabel(label){

maker_array[label].openInfoWindowHtml(label_array[label]);
}


    //]]>


