function prendiElementoDaId(id_elemento) {
	var elemento;
	if(document.getElementById)
		elemento = document.getElementById(id_elemento);
	if(parent.document.getElementById)
		elemento = parent.document.getElementById(id_elemento);
	if(top.document.getElementById)
		elemento = top.document.getElementById(id_elemento);
	else
		elemento = document.all[id_elemento];
	return elemento;
}

function openMarker(id){
	markers[id]['marker'].openExtInfoWindow(
		map,
		markers[id]['box'],
		markers[id]['html'],
		{beakOffset: 18}
	);
	return(false);
}

function setBarZoom(){
	zoomAtt=map.getZoom();
	// alert(zoomAtt);
	idImg=Math.round(zoomAtt/2)-1;
	idImg=(idImg>9)? 9 : idImg;
	idImg=(idImg<0)? 0 : idImg;
	oggetto=prendiElementoDaId("bott_bar");
	if(oggetto){
		oggetto.src=skinUrl+"gmapfiles/icons/bar_dot_"+idImg+".png";
	} else {
		//alert("non trovato:"+idImg);	
	}
}

function zoomma(i){
	map.setZoom(i);
	setBarZoom();
}

function initialize() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById('map'));

		function setBott(id, stato){
			oggetto=prendiElementoDaId("bott_"+id);
			if(oggetto){
				// alert("trovato");
				oggetto.src=skinUrl+"gmapfiles/buttons/"+id+((stato==1)?"_up":"")+".png";
			} else {
				// alert("non trovato:"+id);	
			}
		}


		/* -------------------------------------------------------------------------------------------------------------- */

		/* BOTTONE MAPPA */
		function bottMappa() {}
		bottMappa.prototype = new GControl();
		bottMappa.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_mappa" src="'+skinUrl+'gmapfiles/buttons/mappa_up.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.setMapType(G_NORMAL_MAP);
				setBott("terreno", 0);
				setBott("mappa", 1);
				setBott("satellite", 0);
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottMappa.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(119, 10));
		}
		/* FINE BOTTONE MAPPA */

		/* BOTTONE SATELLITE */
		function bottSatellite() {}
		bottSatellite.prototype = new GControl();
		bottSatellite.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_satellite" src="'+skinUrl+'gmapfiles/buttons/satellite.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.setMapType(G_SATELLITE_MAP);
				setBott("terreno", 0);
				setBott("mappa", 0);
				setBott("satellite", 1);
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottSatellite.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(65, 10));
		}
		/* FINE BOTTONE SATELLITE */

		/* BOTTONE TERRENO */
		function bottTerreno() {}
		bottTerreno.prototype = new GControl();
		bottTerreno.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_terreno" src="'+skinUrl+'gmapfiles/buttons/terreno.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.setMapType(G_PHYSICAL_MAP);
				setBott("terreno", 1);
				setBott("mappa", 0);
				setBott("satellite", 0);
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottTerreno.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10, 10));
		}
		/* FINE BOTTONE TERRENO */

		/* -------------------------------------------------------------------------------------------------------------- */

		/* BOTTONE UP */
		function bottUp() {}
		bottUp.prototype = new GControl();
		bottUp.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_up" src="'+skinUrl+'gmapfiles/icons/up.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.panDirection(0,1);
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottUp.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 10));
		}
		/* FINE BOTTONE UP */

		/* BOTTONE SX */
		function bottSx() {}
		bottSx.prototype = new GControl();
		bottSx.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_sx" src="'+skinUrl+'gmapfiles/icons/sx.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.panDirection(1,0);
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottSx.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10, 28));
		}
		/* FINE BOTTONE SX */

		/* BOTTONE DX */
		function bottDx() {}
		bottDx.prototype = new GControl();
		bottDx.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_dx" src="'+skinUrl+'gmapfiles/icons/dx.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.panDirection(-1,0);
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottDx.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(45, 28));
		}
		/* FINE BOTTONE DX */

		/* BOTTONE DN */
		function bottDn() {}
		bottDn.prototype = new GControl();
		bottDn.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_dn" src="'+skinUrl+'gmapfiles/icons/dn.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.panDirection(0,-1);
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottDn.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 45));
		}
		/* FINE BOTTONE DN */

		/* BOTTONE CN */
		function bottCn() {}
		bottCn.prototype = new GControl();
		bottCn.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_cn" src="'+skinUrl+'gmapfiles/icons/cn.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				centraMappa();
				setBarZoom();
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottCn.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 28));
		}
		/* FINE BOTTONE CN */

		/* -------------------------------------------------------------------------------------------------------------- */

		/* BOTTONE ZOOM IN */
		function bottZin() {}
		bottZin.prototype = new GControl();
		bottZin.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_zin" src="'+skinUrl+'gmapfiles/icons/zoomin.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.zoomIn();
				setBarZoom();
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottZin.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 79));
		}
		/* FINE BOTTONE ZOOM IN */

		/* BOTTONE ZOOM OUT */
		function bottZout() {}
		bottZout.prototype = new GControl();
		bottZout.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_zout" src="'+skinUrl+'gmapfiles/icons/zoomout.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				map.zoomOut();
				setBarZoom();
			});
			Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottZout.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 185));
		}
		/* FINE BOTTONE ZOOM OUT */

		/* BOTTONE BAR */
		function bottBar() {}
		bottBar.prototype = new GControl();
		bottBar.prototype.initialize = function(map) {
			var container = document.createElement("div");
			
			var Bottone = document.createElement("div");
			container.appendChild(Bottone);
			Bottone.innerHTML = '<img id="bott_bar" src="'+skinUrl+'gmapfiles/icons/bar.png">';
			GEvent.addDomListener(Bottone, "click", function() {
				// map.zoomIn();
			});
			// Bottone.style.cursor = "pointer";
			map.getContainer().appendChild(container);
			return container;
		}
		bottBar.prototype.getDefaultPosition = function() {
			return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 96));
		}
		/* FINE BOTTONE BAR */

		/* -------------------------------------------------------------------------------------------------------------- */

		/* INIZIO BOTTONI SLIDE BAR */
			function getBottoniSlide(){
				var bottoniSlide=new Array();
				bottoniSlide[0]=new Array(20, 8, 7);
				bottoniSlide[1]=new Array(18, 15, 8);
				bottoniSlide[2]=new Array(16, 23, 7);
				bottoniSlide[3]=new Array(14, 30, 7);
				bottoniSlide[4]=new Array(12, 37, 8);
				bottoniSlide[5]=new Array(10, 45, 7);
				bottoniSlide[6]=new Array(8, 52, 8);
				bottoniSlide[7]=new Array(6, 60, 6);
				bottoniSlide[8]=new Array(4, 66, 8);
				bottoniSlide[9]=new Array(2, 74, 6);
				return(bottoniSlide);	
			}

			var bottoniSlide=getBottoniSlide();
			var posizione="";

			/* BOTTONE SLIDE */
			var bottSlide=new Array();
			var Bottone =new Array();
			var newZoom=0;

			for(i=0;i<bottoniSlide.length;i++){
				newZoom=bottoniSlide[i][0];
				bottSlide[i]=function(){}
				bottSlide[i].prototype = new GControl();
				bottSlide[i].prototype.initialize = function(map) {
					var container = document.createElement("div");
					
					Bottone[i] = document.createElement("div");
					container.appendChild(Bottone[i]);
					Bottone[i].innerHTML = '<div id="bottSlide_'+i+'" style="width:19px; height:'+bottoniSlide[i][2]+'px; background:url(gmapfiles/img/blank.gif) left top repeat;" onClick="zoomma('+bottoniSlide[i][0]+')">';
					GEvent.addDomListener(Bottone[i], "click", function() {
						// zoomma(i);
					});
					Bottone[i].style.height = bottoniSlide[i][2]+"px";
					Bottone[i].style.overflow = "hidden";
					Bottone[i].style.cursor = "pointer";
					
					map.getContainer().appendChild(container);
					return container;
				}
				bottSlide[i].prototype.getDefaultPosition = function() {
					return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 96+bottoniSlide[i][1]));
				}
			}
			/* FINE BOTTONE SLIDE */

		/* FINE BOTTONI SLIDE BAR */
		/* -------------------------------------------------------------------------------------------------------------- */

		map.addControl(new bottMappa());
		map.addControl(new bottSatellite());
		map.addControl(new bottTerreno());
		map.addControl(new bottUp());
		map.addControl(new bottSx());
		map.addControl(new bottDx());
		map.addControl(new bottDn());
		map.addControl(new bottCn());
		map.addControl(new bottZin());
		map.addControl(new bottZout());
		map.addControl(new bottBar());
		for(i=0;i<bottoniSlide.length;i++){
			map.addControl(new bottSlide[i]);
		}

		map.enableScrollWheelZoom();
		map.enableContinuousZoom();
		map.setMapType(G_NORMAL_MAP);

	}
	else{
		alert('Spiacenti. Il suo browswer non supporta Google Maps.');
	}
}

function definisciIcone(){
	redIcon = new GIcon(G_DEFAULT_ICON); // icona rossa
	redIcon.image = skinUrl+"gmapfiles/markers/redmarker.png";
	redIcon.iconSize = new GSize(15, 23);
	redIcon.shadow = "";
	redIcon.iconAnchor = new GPoint(0, 0);
	redIcon.infoWindowAnchor = new GPoint(0,0);
	
	greenIcon = new GIcon(G_DEFAULT_ICON); // icona verde
	greenIcon.image = skinUrl+"gmapfiles/markers/greenmarker.png";
	greenIcon.iconSize = new GSize(15, 23);
	greenIcon.shadow = "";
	greenIcon.iconAnchor = new GPoint(0, 0);
	greenIcon.infoWindowAnchor = new GPoint(0,0);
}

function showAddress(address,icona,tipo,html) { // icona: redIcon/greenIcon ; tipo: boxred/boxgreen
  if (geocoder) {
	geocoder.getLatLng(
	  address,
	  function(point) {
		if (!point) {
			alert(address + " not found");
		} else {
			map.setCenter(point, 11);
			var marker = new GMarker(point, {icon:icona});
			GEvent.addListener(marker, 'click', function(){ 
				marker.openExtInfoWindow(
					map,
					tipo,
					html,
					{beakOffset: 18}
				); 
			});
			map.addOverlay(marker);
		}
	  }
	);
  }
}

function caricaMappa(){
	initialize();
	centraMappa();
	setBarZoom();
	definisciIcone();
	caricaPunti();
}

function defaultMapStyle(map) {
	function setBott(id, stato){
		oggetto=prendiElementoDaId("bott_"+id);
		if(oggetto){
			// alert("trovato");
			oggetto.src=skinUrl+"gmapfiles/buttons/"+id+((stato==1)?"_up":"")+".png";
		} else {
			// alert("non trovato:"+id);	
		}
	}


	/* -------------------------------------------------------------------------------------------------------------- */

	/* BOTTONE MAPPA */
	function bottMappa() {}
	bottMappa.prototype = new GControl();
	bottMappa.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_mappa" src="'+skinUrl+'gmapfiles/buttons/mappa_up.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.setMapType(G_NORMAL_MAP);
			setBott("terreno", 0);
			setBott("mappa", 1);
			setBott("satellite", 0);
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottMappa.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(119, 10));
	}
	/* FINE BOTTONE MAPPA */

	/* BOTTONE SATELLITE */
	function bottSatellite() {}
	bottSatellite.prototype = new GControl();
	bottSatellite.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_satellite" src="'+skinUrl+'gmapfiles/buttons/satellite.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.setMapType(G_SATELLITE_MAP);
			setBott("terreno", 0);
			setBott("mappa", 0);
			setBott("satellite", 1);
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottSatellite.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(65, 10));
	}
	/* FINE BOTTONE SATELLITE */

	/* BOTTONE TERRENO */
	function bottTerreno() {}
	bottTerreno.prototype = new GControl();
	bottTerreno.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_terreno" src="'+skinUrl+'gmapfiles/buttons/terreno.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.setMapType(G_PHYSICAL_MAP);
			setBott("terreno", 1);
			setBott("mappa", 0);
			setBott("satellite", 0);
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottTerreno.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10, 10));
	}
	/* FINE BOTTONE TERRENO */

	/* -------------------------------------------------------------------------------------------------------------- */

	/* BOTTONE UP */
	function bottUp() {}
	bottUp.prototype = new GControl();
	bottUp.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_up" src="'+skinUrl+'gmapfiles/icons/up.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.panDirection(0,1);
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottUp.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 10));
	}
	/* FINE BOTTONE UP */

	/* BOTTONE SX */
	function bottSx() {}
	bottSx.prototype = new GControl();
	bottSx.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_sx" src="'+skinUrl+'gmapfiles/icons/sx.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.panDirection(1,0);
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottSx.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10, 28));
	}
	/* FINE BOTTONE SX */

	/* BOTTONE DX */
	function bottDx() {}
	bottDx.prototype = new GControl();
	bottDx.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_dx" src="'+skinUrl+'gmapfiles/icons/dx.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.panDirection(-1,0);
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottDx.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(45, 28));
	}
	/* FINE BOTTONE DX */

	/* BOTTONE DN */
	function bottDn() {}
	bottDn.prototype = new GControl();
	bottDn.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_dn" src="'+skinUrl+'gmapfiles/icons/dn.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.panDirection(0,-1);
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottDn.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 45));
	}
	/* FINE BOTTONE DN */

	/* BOTTONE CN */
	function bottCn() {}
	bottCn.prototype = new GControl();
	bottCn.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_cn" src="'+skinUrl+'gmapfiles/icons/cn.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			centraMappa();
			setBarZoom();
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottCn.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 28));
	}
	/* FINE BOTTONE CN */

	/* -------------------------------------------------------------------------------------------------------------- */

	/* BOTTONE ZOOM IN */
	function bottZin() {}
	bottZin.prototype = new GControl();
	bottZin.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_zin" src="'+skinUrl+'gmapfiles/icons/zoomin.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.zoomIn();
			setBarZoom();
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottZin.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 79));
	}
	/* FINE BOTTONE ZOOM IN */

	/* BOTTONE ZOOM OUT */
	function bottZout() {}
	bottZout.prototype = new GControl();
	bottZout.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_zout" src="'+skinUrl+'gmapfiles/icons/zoomout.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			map.zoomOut();
			setBarZoom();
		});
		Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottZout.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 185));
	}
	/* FINE BOTTONE ZOOM OUT */

	/* BOTTONE BAR */
	function bottBar() {}
	bottBar.prototype = new GControl();
	bottBar.prototype.initialize = function(map) {
		var container = document.createElement("div");
		
		var Bottone = document.createElement("div");
		container.appendChild(Bottone);
		Bottone.innerHTML = '<img id="bott_bar" src="'+skinUrl+'gmapfiles/icons/bar.png">';
		GEvent.addDomListener(Bottone, "click", function() {
			// map.zoomIn();
		});
		// Bottone.style.cursor = "pointer";
		map.getContainer().appendChild(container);
		return container;
	}
	bottBar.prototype.getDefaultPosition = function() {
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 96));
	}
	/* FINE BOTTONE BAR */

	/* -------------------------------------------------------------------------------------------------------------- */

	/* INIZIO BOTTONI SLIDE BAR */
		function getBottoniSlide(){
			var bottoniSlide=new Array();
			bottoniSlide[0]=new Array(20, 8, 7);
			bottoniSlide[1]=new Array(18, 15, 8);
			bottoniSlide[2]=new Array(16, 23, 7);
			bottoniSlide[3]=new Array(14, 30, 7);
			bottoniSlide[4]=new Array(12, 37, 8);
			bottoniSlide[5]=new Array(10, 45, 7);
			bottoniSlide[6]=new Array(8, 52, 8);
			bottoniSlide[7]=new Array(6, 60, 6);
			bottoniSlide[8]=new Array(4, 66, 8);
			bottoniSlide[9]=new Array(2, 74, 6);
			return(bottoniSlide);	
		}

		var bottoniSlide=getBottoniSlide();
		var posizione="";

		/* BOTTONE SLIDE */
		var bottSlide=new Array();
		var Bottone =new Array();
		var newZoom=0;

		for(i=0;i<bottoniSlide.length;i++){
			newZoom=bottoniSlide[i][0];
			bottSlide[i]=function(){}
			bottSlide[i].prototype = new GControl();
			bottSlide[i].prototype.initialize = function(map) {
				var container = document.createElement("div");
				
				Bottone[i] = document.createElement("div");
				container.appendChild(Bottone[i]);
				Bottone[i].innerHTML = '<div id="bottSlide_'+i+'" style="width:19px; height:'+bottoniSlide[i][2]+'px; background:url(gmapfiles/img/blank.gif) left top repeat;" onClick="zoomma('+bottoniSlide[i][0]+')">';
				GEvent.addDomListener(Bottone[i], "click", function() {
					// zoomma(i);
				});
				Bottone[i].style.height = bottoniSlide[i][2]+"px";
				Bottone[i].style.overflow = "hidden";
				Bottone[i].style.cursor = "pointer";
				
				map.getContainer().appendChild(container);
				return container;
			}
			bottSlide[i].prototype.getDefaultPosition = function() {
				return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 96+bottoniSlide[i][1]));
			}
		}
		/* FINE BOTTONE SLIDE */

	/* FINE BOTTONI SLIDE BAR */
	/* -------------------------------------------------------------------------------------------------------------- */

	map.addControl(new bottMappa());
	map.addControl(new bottSatellite());
	map.addControl(new bottTerreno());
	map.addControl(new bottUp());
	map.addControl(new bottSx());
	map.addControl(new bottDx());
	map.addControl(new bottDn());
	map.addControl(new bottCn());
	map.addControl(new bottZin());
	map.addControl(new bottZout());
	map.addControl(new bottBar());
	for(i=0;i<bottoniSlide.length;i++){
		map.addControl(new bottSlide[i]);
	}

	map.enableScrollWheelZoom();
	map.enableContinuousZoom();
	map.setMapType(G_NORMAL_MAP);
}



