/* software_license
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# 
# Creado por Fco. Javier Pérez Pacheco
# javielinux@gmail.com
# http://www.javielinux.com/
*/

	var map;
	
	function center(build) {	
		// heracles
		if (build=="general") {
			map.setCenter(new GLatLng(36.520539, -6.285478), 13);
		} else if (build=="caleta") {
			map.setCenter(new GLatLng(36.530539, -6.305478), 17);
		} else if (build=="paseo") {
			map.setCenter(new GLatLng(36.507347, -6.279456), 17);
		} else if (build=="catedral") {
			map.setCenter(new GLatLng(36.529100, -6.295158), 17);
		}
		
	}
	
	function createMarker(point, txt) {
		var marker = new GMarker(point);
		GEvent.addListener(marker, "click", function() {
		  marker.openInfoWindowHtml(txt);
		});
		return marker;
	}
	
    function load_SampleGButtons() {
      if (GBrowserIsCompatible()) {

        map = new GMap2(document.getElementById("map"));
		
		gbuttons = new GButtons(G_ANCHOR_TOP_RIGHT, 7, "vertical");
		gbuttons.setWidth("100px");
		gbuttons.addButton("Vista general", "center('general');");
		gbuttons.addButton("La Caleta", "center('caleta');");
		gbuttons.addButton("Paseo Marítimo", "center('paseo');");
		gbuttons.addButton("La Catedral", "center('catedral');");
		map.addControl(gbuttons);
				
		map.setCenter(new GLatLng(36.520539, -6.285478), 13);
		
		map.setMapType(G_SATELLITE_MAP);
		
		foto1 = new GLatLng(36.530539, -6.305478);
		marca_foto1 = createMarker(foto1, '<b>Balneario</b><br/><a href="http://www.javielinux.com/fotografia_g.php?dir=fotos/cadiz/monumentos/imgpict0101.jpg"><img src="http://www.javielinux.com/fotos/cadiz/monumentos/pimgpict0101.jpg" border="0" width="149" heigth="112" /></a>');
		map.addOverlay(marca_foto1);
		
		foto2 = new GLatLng(36.507347, -6.279456);
		marca_foto2 = createMarker(foto2, '<b>Paseo Marítimo</b><br/><a href="http://www.javielinux.com/fotografia_g.php?dir=fotos/cadiz/img-2003118-17.59.44.jpg"><img src="http://www.javielinux.com/fotos/cadiz/pimg-2003118-17.59.44.jpg" border="0" width="149" heigth="112" /></a>');
		map.addOverlay(marca_foto2);
		
		foto3 = new GLatLng(36.529100, -6.295158);
		marca_foto3 = createMarker(foto3, '<b>La Catedral</b><br/><a href="http://www.javielinux.com/fotografia_g.php?dir=fotos/cadiz/monumentos/img-20030127-17.44.30.jpg"><img src="http://www.javielinux.com/fotos/cadiz/monumentos/pimg-20030127-17.44.30.jpg" border="0" width="149" heigth="112" /></a>');
		map.addOverlay(marca_foto3);
		
		
      }
    }