
function openNewsLetterSubscription() 
{
	popupWin = window.open('NewsletterSubscription.aspx?EmailAddress=', 'open_window', 'width=650, height=300');
}

function openNewsLetterUnSubscription(strEmail) 
{
	var objNewsletterWindow;
	objNewsletterWindow = window.open('NewsletterSubscription.aspx?EmailAddress=' + strEmail + '&Action=UnSubscribe','Newsletter_Subscription','width=650,height=300,,,resizable=no,scrollbars=yes');
	var strEmail,objNewsletterWindow;
}


 function load(Latitude, Longitude) {
			if (GBrowserIsCompatible()) {
				var map = new GMap2(document.getElementById("divMap"));
				map.addControl(new GSmallMapControl());
				map.addControl(new GMapTypeControl());
				map.setCenter(new GLatLng(Latitude, Longitude), 13);
				
				var point = new GLatLng(Latitude, Longitude);
				map.addOverlay(new GMarker(point));
				var points = [];
				points.push(new GLatLng(Latitude, Longitude));
				map.addOverlay(new GPolyline(points));

				}
			}
			
	function loadGoogleMap(Latitude, Longitude, isLoad)
				{
					if(Latitude==0 || Longitude==0)
					 return false;
					else 
					{
					  if(isLoad)
					     load(Latitude, Longitude);
					  else
					     GUnload();
					} 
				}
				
				
	function LoadMapURL(URLString, PageTitleString, iWidth, iHeight, iResizable, iScrollbar)
				{
					var WindowParamterString = 'width=' + iWidth + ',height=' + iHeight + ',resizable=' + iResizable + ',scrollbars=' + iScrollbar;
					window.open(URLString , PageTitleString, WindowParamterString ); 
					return false; 
				}	
				
	function LoadMultipleLoactions()
	{
		if (GBrowserIsCompatible()) 
		{
				var map = new GMap2(document.getElementById("divMap"));
				var points = [];
				map.addControl(new GSmallMapControl());
				map.addControl(new GMapTypeControl());

				if (HotelLatLngArray.length != 0)
				{
					map.setCenter(new GLatLng(HotelLatLngArray[0][0], HotelLatLngArray[0][1]), 13);
					
					for (var i=0; i<HotelLatLngArray.length; i=i+2) 
					{
						var point = new GLatLng(HotelLatLngArray[i][0], HotelLatLngArray[i][1]);
						map.addOverlay(new GMarker(point));
					}
				}
		}
	}
	
	var tooltip;
	var map;
		
	function LoadMultipleMapsWithIcons()
	{
		map = new GMap2(document.getElementById("divMap"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		//map.setCenter(new GLatLng(37.4419, -122.1419), 13);

		// ====== set up marker mouseover tooltip div ======
		tooltip = document.createElement("div");
		document.getElementById("divMap").appendChild(tooltip);
		tooltip.style.visibility="hidden";

		// Create a base icon for all of our markers that specifies the
		// shadow, icon dimensions, etc.
		var baseIcon = new GIcon();
        baseIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        baseIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
        baseIcon.iconSize = new GSize(12, 20);
        baseIcon.shadowSize = new GSize(22, 20);
        baseIcon.iconAnchor = new GPoint(6, 20);
        baseIcon.infoWindowAnchor = new GPoint(5, 1);      

        //iconblue = new GIcon(icon,"http://labs.google.com/ridefinder/images/mm_20_blue.png"); 
        //icongreen = new GIcon(icon,"http://labs.google.com/ridefinder/images/mm_20_green.png"); 
        //iconyellow = new GIcon(icon,"http://labs.google.com/ridefinder/images/mm_20_yellow.png"); 

		// Creates a marker whose info window displays the letter corresponding
		// to the given index.
		function createMarker(point, index) 
		{
			// Create a lettered icon for this point using our icon class
			var letter = String.fromCharCode("A".charCodeAt(0) + index);
			var letteredIcon = new GIcon(baseIcon);

			// Set up our GMarkerOptions object
			markerOptions = { icon:letteredIcon };
			var marker = new GMarker(point, markerOptions);
	        // === store the name so that the tooltip function can use it ===
		    marker.tooltip = '<div class="MapTooltip">'+HotelNameArray[index]+'<\/div>';

			//Added by Manoj Contract type is added in hotelprofile URL
			
			if (HotelIDSupplierIDArray[index][1] == "4" )
			{
				GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml('<div id="MapInfoWindowDiv" class="MapInfoWindow"><div id="MapHotelDetails" class="MapHotelDetails"><div id="MapHotelName" class="MapHotelName"><span>' + HotelNameArray[index] + '<\/span><\/div><div id="MapHotelStarRating" class="MapHotelStarRating">' + HotelStarArray[index] + '<\/div><div id="MapHotelViewDetails" class="MapHotelViewDetails"><a href=hotelProfile.aspx?hotelID=' + HotelIDSupplierIDArray[index][0] + '&supplierID=' + HotelIDSupplierIDArray[index][1] + '&Contract=' + HotelIDSupplierIDArray[index][2] + '><span>[view details...]<\/span><\/a><\/div><div id="MapHotelAddress" class="MapHotelAddress">' + HotelAddressArray[index] + '<\/div><div id="MapHotelPrice" class="MapHotelPrice"><span class="MapHotelPricesFromText">Prices from <\/span><span>' + HotelPriceArray[index] + '<\/span><\/div><div id="MapHotelBook" class="MapHotelBook"><a href=hotelProfile.aspx?hotelID=' + HotelIDSupplierIDArray[index][0] + '&supplierID=' + HotelIDSupplierIDArray[index][1] + '&Contract=' + HotelIDSupplierIDArray[index][2] + '><img src="image/Buttons/book.gif" border="0"><\/img><\/a><\/div><\/div><div id="MapHotelThumbnail" class="MapHotelThumbnail"><img height="70" width="70" src=' + HotelThumbnailArray[index] + '><\/div><\/div>');});
			}
			else
			{
			GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml('<div id="MapInfoWindowDiv" class="MapInfoWindow"><div id="MapHotelDetails" class="MapHotelDetails"><div id="MapHotelName" class="MapHotelName"><span>' + HotelNameArray[index] + '<\/span><\/div><div id="MapHotelStarRating" class="MapHotelStarRating">' + HotelStarArray[index] + '<\/div><div id="MapHotelViewDetails" class="MapHotelViewDetails"><a href=hotelProfile.aspx?hotelID=' + HotelIDSupplierIDArray[index][0] + '&supplierID=' + HotelIDSupplierIDArray[index][1] + '><span>[view details...]<\/span><\/a><\/div><div id="MapHotelAddress" class="MapHotelAddress">' + HotelAddressArray[index] + '<\/div><div id="MapHotelPrice" class="MapHotelPrice"><span class="MapHotelPricesFromText">Prices from <\/span><span>' + HotelPriceArray[index] + '<\/span><\/div><div id="MapHotelBook" class="MapHotelBook"><a href=hotelProfile.aspx?hotelID=' + HotelIDSupplierIDArray[index][0] + '&supplierID=' + HotelIDSupplierIDArray[index][1] + '><img src="image/Buttons/book.gif" border="0"><\/img><\/a><\/div><\/div><div id="MapHotelThumbnail" class="MapHotelThumbnail"><img height="70" width="70" src=' + HotelThumbnailArray[index] + '><\/div><\/div>');});
			}
			
			
	        //  ======  The new marker "mouseover" and "mouseout" listeners  ======
			GEvent.addListener(marker,"mouseover", function() { showTooltip(marker); });        
			GEvent.addListener(marker,"mouseout", function() { tooltip.style.visibility="hidden" });        
			return marker;
		}

        var gmarkersA = [];      
        var gmarkersB = [];      
        var gmarkersC = [];      
        var gmarkersD = [];      

		var bSetMapCenter = false;
		
		if (HotelLatLngArray.length != 0)
		{
			for (var i=0; i<HotelLatLngArray.length; i++) 
			{
				var point = new GLatLng(HotelLatLngArray[i][0], HotelLatLngArray[i][1]);
				//map.addOverlay(createMarker(point,i));
				var marker = createMarker(point,i);
				gmarkersA.push(marker);
	
				if (bSetMapCenter == false)
				{
					if (HotelLatLngArray[i][0] != 0 && HotelLatLngArray[i][1] != 0)
					{
						map.setCenter(new GLatLng(HotelLatLngArray[i][0], HotelLatLngArray[i][1]), 11);
						bSetMapCenter = true;
					}
				}
			}
			//map.setCenter(new GLatLng(HotelLatLngArray[0][0], HotelLatLngArray[0][1]), 11);
	        var mm = new GMarkerManager(map, {borderPadding:1});
	        mm.addMarkers(gmarkersA,0,17);
		    mm.refresh();
		}
	}
	
	  // ====== This function displays the tooltip ======
      function showTooltip(marker) 
      {
		tooltip.innerHTML = marker.tooltip;
		var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),map.getZoom());
		var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
		var anchor=marker.getIcon().iconAnchor;
		var width=marker.getIcon().iconSize.width;
		var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y)); 
		pos.apply(tooltip);
		tooltip.style.visibility="visible";
      }

	