///////////////////////////////////johnnnnnnnnnnnnnnn//////////////////////////
function initialize(map) 
    {
    //HotelsResults1:HotelsLatLon
		//debugger ;
		var LatLonId=document.getElementById("HotelsLatLonClientID").value;
		var Hdn=document.getElementById(LatLonId);
		/*if(document.getElementById("MainBody:HotelsLatLon")==null)
		{
			Hdn=document.getElementById("HotelsResults1:HotelsLatLon")
		}
		else
		{
			Hdn=document.getElementById("MainBody:HotelsLatLon")
			
		}*/
		if(Hdn==null || Hdn.value=="")
		return null;
		var arr=Hdn.value.split("|");
		var MapCentre=arr[0].split("*");
	    
			if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById(map));
			map.setCenter(new GLatLng(MapCentre[0], MapCentre[1]), 8);
	      
			var customUI = map.getDefaultUI(); 
			customUI.keyboard = false; 
			map.setUI(customUI);
			
			var baseIcon = new GIcon();
			baseIcon.iconSize = new GSize(37, 40);
			baseIcon.iconAnchor = new GPoint(9, 34);
			baseIcon.infoWindowAnchor = new GPoint(9, 2);
			function createMarker(point, index,hname,address,price,starrate,img,hc,sc,RID,transid,citycode) {
			var letter = String.fromCharCode("A".charCodeAt(0) + index);
			var letteredIcon = new GIcon(baseIcon);
			letteredIcon.image ="../Hotels/googleimages/Hotel-icon.gif"; 

			// Set up our GMarkerOptions object
			markerOptions = { icon:letteredIcon };
			var marker = new GMarker(point, markerOptions);
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml(DrawGoogleBallon(hname,address,price,starrate,img,hc,sc,RID,transid,citycode));
	            
			});
			return marker;
			}
			for (var i = 0; i < arr.length; i++) {
			var point=arr[i].split("*");
			var latlng = new GLatLng(point[0],point[1]);
			map.addOverlay(createMarker(latlng, i,point[2],point[3],point[4],point[5],point[6],point[7],point[8],point[9],point[10],point[11]));
			}
		}
		
    }
    function DrawGoogleBallon(hname,haddress,hprice,starrate,img,hc,sc,RID,transid,citycode)
    {
		var str=document.getElementById("ballon").innerHTML;
		str=str.replace("__hotelname",hname);
		str=str.replace("__hoteladdress",haddress);
		if(hprice>0)
		{
			str=str.replace("__hotelprice","$"+hprice);
		}
		else
		{
			str=str.replace("__hotelprice","Check");
		}
		str=str.replace("__hotelimage",img);
		str=str.replace("__starrate",GenerateStars(starrate));
		str=str.replace("__hotelcode",hc);
		str=str.replace("__sourcecode",sc);
		str=str.replace("__ResultID",RID);
		str=str.replace("__transid",transid);
		str=str.replace("__citycode",citycode);
		
		
		return str;		
    }
    function GenerateStars(starrate)
    {
		StarsHtml="<img src='../hotels/Images/"+starrate+".gif'>";	
		return StarsHtml
    }
/////////////////////////////////////////////////////////////////////////////////