         var map = null;
         var LA = new VELatLong(28.1100556,-17.2394444);
	 var icon_url = '../images/pin.gif';
	 var zoom = 11;
                  
         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap(LA, 14, VEMapStyle.Road, false, VEMapMode.Mode2D, true, 1);
	    map.SetZoomLevel(zoom);

	    // zoom to cursor and center
            map.SetMouseWheelZoomToCenter(true);
	    map.AttachEvent("onendzoom",EndZoomHandler);

	    //GetHotels();
	    GetCity();
        }

	function EndZoomHandler(e)
	{                  

			map.Clear();
			if( map.GetZoomLevel() > zoom )
			{
				//Pins anzeigen
				GetHotels();
			}
			else
			{
				GetCity();
			}
	}

	function GetCity()
	{
		SetCityPin("Alajero" , 28.063584119081504, -17.23778016865255);
		SetCityPin("Hermigua", 28.1655764579773, -17.197128608822812);
		SetCityPin("Valle Gran Rey", 28.107997,-17.324028);
		SetCityPin("Playa Santiago", 28.0387778,-17.1941667);
	}

	function SetCityPin(id,la,lo)
	{
		var cityPin = new VEPushpin(id,
   			new VELatLong(la,lo), icon_url, '', '');
            	map.AddPushpin(cityPin);
	}

	function SetHotelPosition(id,title,text,img,la,lo)
	{
		//image gegen dummy tauschen falls nicht vorhanden
		if(img == null || img == '') img = 'http://www.holidaa.de/graphics/images/black/hotelpic_dummy.jpg';

		var url_link = '<a href=\"' + GetBookingUrl(id) + '\">zum Buchen hier klicken</a>';
		var myText = '<table border=\"0\"><tr><td>' + text + '</td><td align=\"right\"><img src=\"' + img + '"\" width=\"100\"></td></tr></table>' + url_link;

            	var pushpin = new VEPushpin(id,
   			new VELatLong(la,lo), icon_url, title, myText);
            	map.AddPushpin(pushpin);

		var element = document.getElementById(id);
		element.onclick=HandleEventPinClick;

	} 

	function HandleEventPinClick(e) 
 	{
	 	var obj_id = window.event.srcElement.id.split("_", 1);

		var obj_url = GetBookingUrl(obj_id);
		if(obj_url != null)
		{
			document.location.href = obj_url;
		}

  	}

	function GetBookingUrl(obj_id)
	{
		var obj_url = null;
		if( obj_id  == 677732 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=Bz4C2Ya4J-E";
		if( obj_id  == 677745 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=Ek0m4Cll/3Q";
		if( obj_id  == 677746 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=Bz4C2Ya4J-E";
		if( obj_id  == 681115 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=L8vYqDCEKhU";
		if( obj_id  == 289793 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=uN5nWe/RTX0";
		if( obj_id  == 289667 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=GL1A1pjgYYE";
		if( obj_id  == 681106 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=gHrnYOt-cFc";
		if( obj_id  == 681102 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=XgTIfGVu1jg";
		if( obj_id  == 681103 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=JkdamZiAr4o";
		if( obj_id  == 681108 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=kfTqNQP2lfI";
		if( obj_id  == 289660 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=v9OwZemQbHA";
		if( obj_id  == 79290 )  obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=xKcxWH9TwPg";
		if( obj_id  == 380671 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=Vo0oU-VjgQM";
		if( obj_id  == 681111 ) obj_url = "http://www.urlaubsunterkunft-kanaren.de/gomera/gomera_buchen.htm?hotelid=lHcibkftF00";
		return obj_url;
	}

    function GetHotels()
    {

		SetHotelPosition('677732','Objekt 677732',
					'Alajero<br/>La Gomera',
					'http://www.holidaa.de/hotel/img/hotelpic/small/bilder_toural/677732_2.jpg',
					 28.0630556,
					-17.2394444
					);

		SetHotelPosition('677745','Objekt 677745',
					'Hermigua<br/>La Gomera',
					'http://www.holidaa.de/hotel/img/hotelpic/small/bilder_toural/677745_1.jpg',
					 28.175,
					-17.1883333
					);

		SetHotelPosition('677746','Objekt 677746',
					'Hermigua<br/>La Gomera',
					'http://www.holidaa.de/hotel/img/hotelpic/small/bilder_toural/677746_1.jpg',
					 28.1727778,
					-17.1897222
					);

		SetHotelPosition('681115','Ferienwohnung Elicasa',
					'Los Gomeros 12<br/>Hermigua',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/w60/681115_1.jpg',
					 28.1708333,
					-17.1883333
					);

		SetHotelPosition('289793','Hotel Jardin Tecina **** ',
					'Lomada de Tecina<br/>Playa de Santiago',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/289793_1.jpg',
					 28.027,
					-17.1972
					);

		SetHotelPosition('289667','Ibo Alfaro Hotel Rural',
					'Barrio Ibo Alfaro<br/>Hermigua',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/289667_1.jpg',
					 28.1672222,
					-17.2011111
					);


		SetHotelPosition('681106','Appartaments ORONE-PLAYA',
					'Avda. Maritima 14<br/>Playa de Santiago',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/681106_1.jpg',
					 28.0283333,
					-17.1969444
					);

		SetHotelPosition('681102','El Paso Hotel Suite',
					'Lomo Los Cardos<br/>Alajero',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/681102_1.jpg',
					 28.0613889,
					-17.2388889
					);

		SetHotelPosition('681103','Apartamentos Bellavista',
					'Calle Santa Ana  s/n<br/>Playa de Santiago',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/681103_1.jpg',
					 28.0613889,
					-17.2391667
					);

		SetHotelPosition('681108','Finca Santa Ana s/n',
					'<br/>Playa de Santiago',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/681108_1.jpg',
					 28.0327778,
					-17.1941667
					);

		SetHotelPosition('289660','Hotel Gran Rey',
					'La Puntilla<br/>Valle Gran Rey',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/289660_1.jpg',
					 28.0858333,
					-17.3366667
					);

		SetHotelPosition('79290','Hotel Rural Tamahuche',
					'La Puntilla<br/>Vallehermoso',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/79290.jpg',
					 28.1788889,
					-17.2641667
					);

		SetHotelPosition('380671','Las Tres Palmeras',
					'La Playa<br/>Valle Gran Rey',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/380671_1.jpg',
					 28.0955556,
					-17.3441667
					);

		SetHotelPosition('681111','Apartemento Casa Ricardo',
					'El Martin - Casa de la Seda<br/>Valle Gran Rey',
					'http://www.holidaa.de/hotel/img/hotelpic/mini/holidaa_kanaren/681111_1.jpg',
					 28.107997,
					-17.324028
					);


      }
	

