var iconBiz;iconBiz=new GIcon(G_DEFAULT_ICON);iconBiz.iconSize=new GSize(12,20);iconBiz.shadowSize=new GSize(0,0);iconBiz.iconAnchor=new GPoint(5,5);hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());hMap.BizMarker.push(new Array());function GetNearBiz(e,b,d,a,c){$.ajax({type:"GET",contentType:"text/json; charset=utf-8",url:hMap.BaseURL+"GetHotelNearBiz.ashx?BizType="+d+"&hLat="+e+"&hLng="+b,data:"",dataType:"json",success:function(h){$(c).attr("disabled","");try{for(var f=0;f<h.length;f++){AddMarkerBiz(h[f],d,a)}}catch(g){}},error:function(h,f,g){$(c).attr("disabled","")}})}function ShowNearBiz(d,b,c,a){$.ajax({type:"GET",contentType:"text/json; charset=utf-8",url:hMap.BaseURL+"GetHotelNearBiz.ashx?BizType="+c+"&hLat="+d+"&hLng="+b,data:"",dataType:"json",success:function(g){try{for(var e=0;e<g.length;e++){AddMarkerBiz(g[e],c,a)}}catch(f){}},error:function(g,e,f){}})}function GetAllHotelGPS(){$.ajax({type:"GET",contentType:"text/json; charset=utf-8",url:hMap.BaseURL+"GetHotelListGPS.ashx?City="+hMap.City+"&State="+hMap.State+"&Country="+hMap.Country,data:"",dataType:"json",success:function(c){try{for(var a=0;a<c.length;a++){if((c[a].Name!=hMap.HotelName)&&(c[a].Address!=hMap.Address)){AddMarkerHotelInDB(c[a],"6","Other Hotels")}}}catch(b){}$("#dMap #gHotelBiz").show();$("#dMap #loading").hide()},error:function(c,a,b){}})}function AddMarkerBiz(e,d,c){var b=new GLatLng(e.Lng,e.Lat);iconBiz.image=hMap.BizIcon+d+".png";iconBiz.iconSize=new GSize(12,20);iconBiz.shadowSize=new GSize(0,0);iconBiz.iconAnchor=new GPoint(5,5);var a=new GMarker(b,{icon:iconBiz,title:e.Name});hMap.BizMarker[d-1].push(a);map.addOverlay(a)}function AddMarkerHotelInDB(f,b,a){hMap.Lat=f.Latitude;hMap.Lng=f.Longitude;var k=new GLatLng(f.Latitude,f.Longitude);iconBiz.iconSize=new GSize(24,24);iconBiz.shadowSize=new GSize(0,0);iconBiz.iconAnchor=new GPoint(5,5);iconBiz.image=hMap.BizImage+"hotel1.png";var g=new GMarker(k,{icon:iconBiz,title:f.Name});hMap.BizMarker[b-1].push(g);map.addOverlay(g);var d="";var h="";if(f.Address!=""){h=h+f.Address+", "}if(f.Country!=""){h=h+f.Country+", "}if(f.City!=""){h=h+f.City+", "}if(f.State!=""){h=h+f.State+", "}h=h.substring(0,h.length-2);if(f.ZipCode!=""){h=h+" "+f.ZipCode}d=d+'<div id="ghint">';d=d+'<p class="nam">'+f.Name+"</p><br/>";if(hMap.ShowHotelRating){var c="";var j=0;if((f.StarRating!=null)&&(f.StarRating!="")){j=f.StarRating;c=hMap.BaseURL+hMap.RatingImage;for(var e=0;e<j;e++){d=d+'<img src="'+c+'" alt="'+j+'" width="10px" height="10px"/>'}c=hMap.BaseURL+hMap.RatingImageGray;j=6-f.StarRating;for(var e=0;e<j;e++){d=d+'<img src="'+c+'" alt="'+j+'" width="10px" height="10px"/>'}}d=d+"<br/>"}d=d+'<p class="ads">'+h+"</p><br/>";d=d+'<p class="ads"><a href="/Hotels/To-'+f.Name+"/"+f.HotelWizID+'/Default.aspx">Hotel Details</a></p></div>';GEvent.addListener(g,"click",function(){g.openInfoWindowHtml(d)})}function ClearOverlayBizByType(b){var c=b-1;for(var a=0;a<hMap.BizMarker[c].length;a++){map.removeOverlay(hMap.BizMarker[c][a])}hMap.BizMarker[c]=[]}function ClearOverlayBiz(){for(var b=0;b<hMap.BizMarker.length;b++){for(var a=0;a<hMap.BizMarker[b].length;a++){map.removeOverlay(hMap.BizMarker[b][a])}hMap.BizMarker[b]=[]}}function MoveToPosition(b,a){map.panTo(new GLatLng(b,a))}function initialize(){if(GBrowserIsCompatible()&&jQuery(typeof(xhAddr)!="undefined"||(hMap.Address!=""&&hMap.City!=""))){var a=new GLatLng(hMap.Lat,hMap.Lng);map=new GMap2(document.getElementById("gmap"));map.setCenter(a,8);map.setUIToDefault();map.enableGoogleBar();LoadMapAddress()}if(window.attachEvent){window.attachEvent("onunload",function(){GUnload()})}else{window.addEventListener("unload",function(){GUnload()},false)}}function SetCheckboxEvent(a,b){$(document).ready(function(){$("#gHotelBiz input[type=checkbox]").click(function(){var d=$(this).val();if($(this).attr("checked")){$(this).attr("disabled","disabled");var c=$(this).next().html();GetNearBiz(a,b,d,c,$(this))}else{ClearOverlayBizByType(d)}})})}function LoadMapAddress(){if(jQuery&&(typeof(xhAddr)!="undefined"||(hMap.Address!=""&&hMap.City!=""))){var f=(typeof(xhAddr)=="undefined")?hMap.Address:xhAddr;var e=(typeof(xhCity)=="undefined")?hMap.City:xhCity;var c=(typeof(xhState)=="undefined")?hMap.State:xhState;var d=(hMap.Country=="")?"US":hMap.City;var b=(typeof(xhZip)=="undefined")?hMap.ZipCode:xhZip;var a=(typeof(xhRating)=="undefined")?hMap.Rating:xhRating;$("#dMap #loading").show();$.ajax({type:"GET",contentType:"text/json; charset=utf-8",url:hMap.BaseURL+"GetHotelPosition.ashx?Addr="+f+"&City="+e+"&State="+c+"&Country="+d+"&Zip="+b,data:"",dataType:"json",success:function(n){try{if(n.length>0){hMap.Lat=n[0].Lng;hMap.Lng=n[0].Lat}var t=hMap.Lat;var g=hMap.Lng;if(typeof(GpsLatitude)!="undefined"){if(GpsLatitude!=null){t=GpsLatitude}}if(typeof(GpsLongitude)!="undefined"){if(GpsLongitude!=null){g=GpsLongitude}}hMap.Lat=t;hMap.Lng=g;if(hMap.EnableNearBiz){SetCheckboxEvent(t,g)}var s=new GLatLng(t,g);iconBiz.iconSize=new GSize(32,32);iconBiz.shadowSize=new GSize(0,0);iconBiz.iconAnchor=new GPoint(5,5);if(hMap.ShowHotelInDB=="True"){iconBiz.image=hMap.BizImage+"hotel2.png";var o=new GMarker(s,{icon:iconBiz,title:hMap.HotelName})}else{var o=new GMarker(s,{title:hMap.HotelName})}var l="";var q="";if(f!=""){q=q+f+", "}if(d!=""){q=q+d+", "}if(e!=""){q=q+e+", "}if(c!=""){q=q+c+", "}q=q.substring(0,q.length-2);if(b!=""){q=q+" "+b}l=l+'<div id="ghint">';l=l+'<p class="nam">'+hMap.HotelName+"</p><br/>";if(hMap.ShowHotelRating){var k="";var r=0;if((a!=null)&&(a!="")){r=a;k=hMap.BaseURL+hMap.RatingImage;for(var m=0;m<r;m++){l=l+'<img src="'+k+'" alt="'+r+'" width="10px" height="10px"/>'}k=hMap.BaseURL+hMap.RatingImageGray;r=6-a;for(var m=0;m<r;m++){l=l+'<img src="'+k+'" alt="'+r+'" width="10px" height="10px"/>'}}l=l+"<br/>"}l=l+'<p class="ads">'+q;l=l+"</p></div>";GEvent.addListener(o,"click",function(){o.openInfoWindowHtml(l)});map.addOverlay(o);map.setCenter(s,parseInt(hMap.ZoomLevel));if(hMap.ShowHotelInDB=="True"){GetAllHotelGPS()}if(hMap.ShowCarRental=="True"){var t=hMap.Lat;var g=hMap.Lng;var p="3";var h="Car Rental";ShowNearBiz(t,g,p,h)}$("#dMap p.title").show();if(hMap.ShowHotelInDB=="False"){$("#dMap #gHotelBiz").show();$("#dMap #loading").hide()}}catch(j){}}})}}function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){if(b){b()}a()}}}addLoadEvent(initialize);