

var map;

var markerOptions;



function initialize()

{

      if (GBrowserIsCompatible())

      {

		

        map = new GMap2(document.getElementById("map_canvas"));

        map.setCenter(new GLatLng(4.570868, -74.297333), 5);

        var customUI = map.getDefaultUI();

        map.setUI(customUI);

		alert(marks);

		cargaDatos();

      }

}



/*

 *

 * @access public

 * @return void

 **/

function centrar(id)

{





	switch(id)

	{



	case 1:

	map.setCenter(new GLatLng(6.2589909942876325, -75.57117462158203));

	map.setZoom(12);

	break;



	case 2:

	map.setCenter(new GLatLng(7.890588474156229, -76.563720703125));

	map.setZoom(11);





	break;



	case 3:

	map.setCenter(new GLatLng(5.038278895550081, -75.49324035644531));

	map.setZoom(11);

	break;



	case 4:

	map.setCenter(new GLatLng(4.815003069563151, -75.6917667388916));

	map.setZoom(14);

	break;



	case 5:

	map.setCenter(new GLatLng(3.4222215866469567, -76.52406692504883));

	map.setZoom(11);



	break;



	case 6:

	map.setCenter(new GLatLng(3.743671274749731, -76.2890625));

	map.setZoom(10);

	break;



	case 7:

	map.setCenter(new GLatLng(3.2479805508984985, -76.5333366394043));

	map.setZoom(13);

	break;



	case 8:

	map.setCenter(new GLatLng(4.683876452449536, -74.080810546875));

	map.setZoom(12);

	break;



	case 9:

	map.setCenter(new GLatLng(4.789942967844043, -74.1522216796875));

	map.setZoom(10);

	break;



	case 10:

	map.setCenter(new GLatLng(7.115371743143529, -73.11148166656494));

	map.setZoom(15);

	break;



	case 11:

	map.setCenter(new GLatLng(10.976246247006731, -74.81002807617188));

	map.setZoom(13);

	break;



	case 12:

	map.setCenter(new GLatLng(10.403910151587073, -75.52310943603516));

	map.setZoom(13);

	break;



	case 13:

	map.setCenter(new GLatLng(6.500899137995968, -75.39093017578125));

	map.setZoom(9);

	

	case 14:

	map.setCenter(new GLatLng(4.52874, -75.704292));

	map.setZoom(9);



	}





}



/*window.addEvent('domready', function(){

	$('drop_down_menu').getElements('li.menu').each( function( elem ){

		var list = elem.getElement('ul.links');

		var myFx = new Fx.Slide(list).hide();

		elem.addEvents({

			'mouseenter' : function(){

				myFx.cancel();

				myFx.slideIn();

			},

			'mouseleave' : function(){

				myFx.cancel();

				myFx.slideOut();

			}

		});

	})

});*/





/**

 *

 * @Clase Place

 * @return void

 **/

function place(){



	this.latitude;

	this.longitude;



	this.direccion;

	this.telefono;

	this.descripcion;



}



/**

 *

 * @access public

 * @return void

 **/

function cargaDatos()

{



		for(var i=0;i<marks.length;i++)

		{

		 var aux=marks[i];
		


		 var marker=createMarker(new GLatLng(aux.latitude,aux.longitude),aux.descripcion);
			




		 	map.addOverlay(marker);



		}



}



function createMarker(point,desc) {

          // Create a lettered icon for this point using our icon class

          var myIcon = new GIcon(G_DEFAULT_ICON);

		 myIcon.shadow = null;

		 myIcon.image = "images/icon.png";

		 myIcon.iconSize = new GSize(30, 30);

		 markerOptions = { icon:myIcon };



          var marker = new GMarker(point, markerOptions);



          GEvent.addListener(marker, "click", function() {

            marker.openInfoWindowHtml(desc);

          });

          return marker;

        }

		

	


