// JavaScript Document
    //<![CDATA[
			   
//  var map = null;
  var geocoder = null;
	var ec = null;
	var et = false;
	
// A TextualZoomControl is a GControl that displays textual "Zoom In"
// and "Zoom Out" buttons (as opposed to the iconic buttons used in
// Google Maps).

function TextualZoomControl() {
}
TextualZoomControl.prototype = new GControl();
// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualZoomControl.prototype.initialize = function(map) {  
	var container = document.createElement("div");  
	var zoomInDiv = document.createElement("div");  
	this.setButtonStyle_(zoomInDiv);  
	container.appendChild(zoomInDiv); 
	zoomInDiv.appendChild(document.createTextNode("Zoom in"));  
	GEvent.addDomListener(zoomInDiv, "click", function() {    
		map.zoomIn();  
	});  
	var zoomOutDiv = document.createElement("div");  
	this.setButtonStyle_(zoomOutDiv);  
	container.appendChild(zoomOutDiv);  
	zoomOutDiv.appendChild(document.createTextNode("Zoom out"));  
	GEvent.addDomListener(zoomOutDiv, "click", function() {    
		map.zoomOut(); 
	});  
	map.getContainer().appendChild(container);  
	return container;
	}
	// By default, the control will appear in the top left corner of the
	// map with 7 pixels of padding.
	TextualZoomControl.prototype.getDefaultPosition = function() {  
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
	}
	// Sets the proper CSS for the given button element.
	TextualZoomControl.prototype.setButtonStyle_ = function(button) {  
		button.style.textDecoration = "none";  
		button.style.color = "#000000";  
		button.style.backgroundColor = "#ffcc33";  
		button.style.font = "small-caps 10pt/8pt Tahoma ";  
		button.style.border = "1px solid white";  
		button.style.padding = "1px";  
		button.style.marginBottom = "2px";  
		button.style.textAlign = "center";  
		button.style.width = "6em";  
		button.style.cursor = "pointer";
	}

// Change map type selector to custom texts
function TextualMapType() {
}
TextualMapType.prototype = new GControl();
// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualMapType.prototype.initialize = function(map) {  
	var container = document.createElement("div");  
	var mapDiv = document.createElement("div");  
	this.setButtonStyle_(mapDiv);  
	container.appendChild(mapDiv); 
	mapDiv.appendChild(document.createTextNode("Map"));  
	GEvent.addDomListener(mapDiv, "click", function() {    
		map.setMapType(G_NORMAL_MAP);  
	});  
	var satelliteDiv = document.createElement("div");  
	this.setButtonStyle_(satelliteDiv);  
	container.appendChild(satelliteDiv);  
	satelliteDiv.appendChild(document.createTextNode("Photo"));  
	GEvent.addDomListener(satelliteDiv, "click", function() {    
		map.setMapType(G_SATELLITE_MAP); 
	});  
	var hybridDiv = document.createElement("div");  
	this.setButtonStyle_(hybridDiv);  
	container.appendChild(hybridDiv);  
	hybridDiv.appendChild(document.createTextNode("Both"));  
	GEvent.addDomListener(hybridDiv, "click", function() {    
		map.setMapType(G_HYBRID_MAP); 
	});  
	map.getContainer().appendChild(container);  
	return container;
	}
	// By default, the control will appear in the top right corner of the
	// map with 7 pixels of padding.
	TextualMapType.prototype.getDefaultPosition = function() {  
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7));
	}
	// Sets the proper CSS for the given button element.
	TextualMapType.prototype.setButtonStyle_ = function(button) {  
		button.style.textDecoration = "none";  
		button.style.color = "#000000";  
		button.style.backgroundColor = "#ffcc33";  
		button.style.font = "small-caps 10pt/8pt Tahoma ";  
		button.style.border = "1px solid white";  
		button.style.padding = "1px";  
		button.style.marginBottom = "2px";  
		button.style.textAlign = "center";  
		button.style.width = "6em";  
		button.style.cursor = "pointer";
	}
	
			   // Disparar formul al clicar sobre el marcador
   function createMarkerX(point, number, text, link) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
      window.location=link;
      window.refresh;
    });
      GEvent.addListener(marker,"mouseover", function() {
      marker.openInfoWindowHtml(text);
     });        
   return marker;
  }

	
		// Creates a marker at the given point with the given number label
   function createMarker(point, number, text) {
     var marker = new GMarker(point);
     GEvent.addListener(marker, "click", function() {
     marker.openInfoWindowHtml(text);
     });
    return marker;
   }

  function createMarker0(point, html, icon) {
    var marker = new GMarker(point, icon);
    GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml(html);
    });
      GEvent.addListener(marker,"mouseover", function() {
     marker.openInfoWindowHtml(html);
     });        
   return marker;
  }

// zoom in
	function zoomIn() {
		var map = new GMap2(document.getElementById("map"));
		//var mag = map.getZoom();
		//var centre = map.getCenter();
		//if (mag < (map.getCurrentMapType()).getMaximumResolution(centre)) {
		//	map.setCenter(centre, ++mag);		
		//}
		map.zoomIn();
	}
// zoom out
	function zoomOut() {
		var map = new GMap2(document.getElementById("map"));
		//var mag = map.getZoom();
		//var centre = map.getCenter();
		//if (mag > (map.getCurrentMapType()).getMinimumResolution(centre)) {
		//	map.setCenter(centre, --mag);
		//}
		map.zoomOut();
	}

//]]>

