function travelMap(id, center_latitude, center_longitude, zoom)
{
	this.reset = function()
	{
		this.map.closeInfoWindow();
		this.map.setCenter(new GLatLng(this.center_latitude, this.center_longitude), zoom);
	}

	this.addHotel = function(hotel)
	{
		hotel.html = '';

		hotel.html += '	<div class="main_container">';
		hotel.html += '		<span class="hotel_name">' + hotel.name + '</span><br />';
		hotel.html += '		<span>' + hotel.address + '</span>';
		hotel.html += '	</div>';

		hotel.marker = this.pointMarker(hotel.longitude, hotel.latitude, hotel.html, "http://www.hotelschart.com/images/hotel.png");

		this.hotels[hotel.ID] = hotel;

	}
	this.addHotelLink = function(hotel)

	{

		hotel.html = '';



		hotel.html += '	<div class="main_container">';

		hotel.html += '		<span class="hotel_name"><a target="_parent" href="'+ hotel.fullurl +'">' + hotel.name + '</a></span><br />';

		hotel.html += '		<span>' + hotel.address + '</span>';

		hotel.html += '	</div>';



		hotel.marker = this.pointMarker(hotel.longitude, hotel.latitude, hotel.html, "http://www.hotelschart.com/images/hotel.png");



		this.hotels[hotel.ID] = hotel;



	}

	this.addLandmark = function(lmark)
	{
		lmark.html = '';

		lmark.html += '	<div class="main_container">';
		lmark.html += '		<span class="lmark_name">' + lmark.name + '</span><br />';
		lmark.html += '	</div>';

		lmark.marker = this.pointMarkerCustom(lmark.longitude, lmark.latitude, lmark.html, lmark.imageURL);

		this.lmarks[lmark.ID] = lmark;

	}

	this.viewHotel = function(ID)
	{
    this.hotels[ID].marker.openInfoWindowHtml(this.hotels[ID].html);
	}
	this.viewLmark = function(ID)
	{
    this.lmarks[ID].marker.openInfoWindowHtml(this.lmarks[ID].html);
	}

	this.addAmenity = function(longitude, latitude, name)
	{

		var amenity = { // da esportare
			name: name,
			latitude: latitude,
			longitude: longitude
		};

		amenity.html = '';
		amenity.html += '<div style="font-family:verdana; font-size:10px; width:120px;">'+name+'</div>';

		amenity.marker = this.pointMarker(amenity.longitude, amenity.latitude, amenity.html, "http://www.hotelschart.com/images/attraction.png");

		this.amenities.push(amenity);
	}


	this.pointMarkerCustom = function(longitude, latitude, html, icon)

	{
		var customicon = new GIcon(G_DEFAULT_ICON, icon);
		var marker = new GMarker(new GLatLng(latitude, longitude), customicon);

		GEvent.addListener(marker, 'mouseover', function()

			{

				this.openInfoWindowHtml(html);

			}

		);

		this.map.addOverlay(marker);

		return marker;

	}

	this.pointMarker = function(longitude, latitude, html, icon)
	{
		var marker = new GMarker(new GLatLng(latitude, longitude), new GIcon(G_DEFAULT_ICON, icon));
		GEvent.addListener(marker, 'mouseover', function()
			{
				this.openInfoWindowHtml(html);
			}
		);
		this.map.addOverlay(marker);
		return marker;
	}


	this.addArea = function(area)
	{
		var Garea = Array();
		for(var i = 0; i < area.length; i++)
		{
			Garea[i] = new GLatLng(area[i].latitude, area[i].longitude);
		}

		Garea[Garea.length] = Garea[0];

		var polyline = new GPolyline(Garea, "#ff0000", 2);

		this.map.addOverlay(polyline);

	}


	this.hotelCenter = function(ID)
	{
	  var hotel = this.hotels[ID];
		if(''+hotel+'' != 'undefined')
		{
		  this.center_latitude = hotel.latitude;
		  this.center_longitude = hotel.longitude;
		  this.reset();
		  hotel.marker.openInfoWindowHtml(hotel.html);
		}
	}

	this.hotelCenterNoDesc = function(ID)
	{
	  var hotel = this.hotels[ID];
		if(''+hotel+'' != 'undefined')
		{
		  this.center_latitude = hotel.latitude;
		  this.center_longitude = hotel.longitude;
		  this.reset();
		}
	}


	this.map = new GMap2(document.getElementById(id));
	this.center_latitude = center_latitude;
	this.center_longitude = center_longitude;

	this.hotels = Array();
	this.amenities = Array();
	this.lmarks = Array();

	this.map.addControl(new GLargeMapControl());
	this.map.addControl(new GMapTypeControl());

	this.reset();

}

document.write('<style type="text/css"> v\:* { behavior:url(#default#VML); } </style>');


var map;
