var ext1=".cms";var ext=".cms";var mapDiv="map-canvas";var markers=[],markerCluster,event_click=(/Android|webOS|iPhone|ipad|iPod|BlackBerry/i.test(navigator.userAgent)===true)?"touchstart":"click",event_hover=(/Android|webOS|iPhone|ipad|iPod|BlackBerry/i.test(navigator.userAgent)===true)?"touchstart":"mouseover",map,circle,gplaces=[],mapHeight,mapWidth,platlng,plat,plng,neighbour_marker=[],neighbour_infobubble,c_radius,directionsService,directionsDisplay,p_neighbour_commute_flag,rendererOptions,mapCenter,mapZoom,myLat,myLng,myAdd="",dMarker,marker1,resizeMarker,updateLeftOnZoom=0,hidePropMarkers=false,markerTimer=[],activity_mapping={shopping:"Shopping",restaurants:"Restaurants",hotels:"Hotels"},more_filter_arr=["Shopping","Hotels","Restaurants","Historical Monument","Museums","Cinema","Club"],mapapi="",pagetype="city_guide",event_registered=0,search_off=true,neighbourhood_flag=false,all_flag=false,detail_flag=false,neighbour_all=[],neighbour_type=[],commute_neighbour_marker=[],city_limit_distance=75,lastpid="",map_nearby_search="/travel/map_nearby_search"+ext+"?curpg=1",listing_api="/travel/map_listing_poi"+ext,city_guide_api="/travel/map_city_guide_poi/",poi_detail_api="/travel/map_poi_detail/",map_autocomplete_api="/travel/map_autocomplete"+ext,map_nearby_search="/travel/map_nearby_search"+ext+"?curpg=1",place,gLat,gLng,place_lat="",place_lon="",bus_str="",train_str="",airport_str=""; function initialize(a){if(typeof google==="undefined"){return}$("#closeDiv").hide();showLoading();var b={zoom:3,scrollwheel:false,mapTypeControl:false,navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeId:google.maps.MapTypeId.ROADMAP,panControl:true,panControlOptions:{position:google.maps.ControlPosition.LEFT_CENTER},zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE,position:google.maps.ControlPosition.LEFT_CENTER}}; map=new google.maps.Map(document.getElementById(a),b);markerCluster=new MarkerClusterer(map,[],{minimumClusterSize:4,ignoreHidden:true});updateMapDimensions();poiMarker=new RichMarker({position:location,draggable:false,flat:true,zIndex:1,animation:google.maps.Animation.DROP});google.maps.event.addListener(poiMarker,event_hover,function(){this.setZIndex(9999)});google.maps.event.addListener(poiMarker,"mouseout",function(){this.setZIndex(1)})}function showLoading(){$("#loader").show()}function hideLoading(){$("#loader").hide() }function getPlaceInfo(d,b,c,a){google.maps.event.clearListeners(map,"bounds_changed");google.maps.event.clearListeners(map,"tilesloaded");google.maps.event.clearListeners(map,"resize");markers=[];gplaces=[];markerTimer=[];if(typeof require!=="undefined"){require("tiljs/logger").info(mapapi)}$.ajax({type:"POST",url:mapapi,success:function(e){if(!search_off){e=e.featured}gplaces=e;if(!$.isEmptyObject(gplaces)){if(typeof a!="undefined"){populateMap(a)}else{populateMap()}updateLeftPanel()}if(event_registered==0){register_autocomplete_event() }if(!search_off&&typeof d!=="undefined"&&typeof a!="undefined"){poiDetail.showDetails(d,a);if(typeof b!=="undefined"&&typeof c!==undefined){map.setCenter(new google.maps.LatLng(b,c))}$(".content-list").find('li[data-msid = "'+d+'"]').addClass("selected")}}})}function get_marker_type(f){var f=$.trim(f.toLowerCase());var a=["hotels","budget hotel","mid range hotel","luxury hotel","bed & breakfast","luxury resort","heritage hotel","boutique hotel","hostel","home stay","service apartment","resort"];var g=["place to see","explore","entertainment","holiday","culture","life style","things to do","activities","adventure","adventure holiday","adventure sports","amusement park","archaeological","art","attractions","backpacking","beach","beach holiday","biking","bird watching","bizarre","budget","budget travel","bungee jumping","business travel","camping","casino","ceo travel","cinema","classical dance","cliff diving","crazy","cruise","dance","day tour","driving holiday","eco tourism","family holiday","festival","fishing","flea market","fort","fun with friends","getting around","gliding","guided tour","health & fitness","hiking","historic sites","history","honeymoon holiday","horse riding","ice climbing","itinerary","lake","live music","local commute","local transport","luxury","massage","meditation","memorial sites","mountain","mountain holiday","mountaineering tour","museum","music","music concert","natural wonders","nature sightseeing","nature site seeing","nature tour","night safari","nightlife","offbeat","offbeat travel","palace","parasailing","park","photography tour","pilgrimage tour","places of worship","popular holiday","quirky","rafting","rail journey","relaxed holiday","road trips","romantic holiday","rural sightseeing","scuba diving","sights","sightseeing","spa","spa & massage","spiritual","spiritual sites","sports","surfing","swimming","theatre","tours","travel guide","trekking","water sports","weekend break","weekend getaway","weekend tour","wellness holiday","wildlife","wildlife sanctuary","wildlife tour","yoga","zip lining","zoo","desert"]; var e=["shopping","shopping mall","antiques shopping","book shopping","clothes shopping","electronic shopping","fashion shopping","handicraft shopping","jewellery shopping","local market","market","souvenirs shopping","street shopping","supermarket"];var c=["city guide","survival tips","travel trends","travel tips"];var d=["restaurants","vegetarian","non vegetarian","vegan","north indian restaurant","mughlai restaurant","fast food restaurant","seafood restaurant","south indian restaurant","italian restaurant","chinese restaurant","thai restaurant","french restaurant","asian restaurant","sushi restaurant","mexican restaurant","european restaurant","continental restaurant","fine dining","street food","thai food","mediterranean restaurant","lebanese restaurant","eating out","food","breakfast","lunch","dinner","snack","dessert","cafe","bar","café","cuisine","lounge & disc","nightclub","pub","bakery"]; var b="things_to_do";if($.inArray(f,a)!=-1){b="hotels"}else{if($.inArray(f,e)!="-1"){b="shopping"}else{if($.inArray(f,c)!="-1"||$.inArray(f,g)!="-1"){b="things_to_do"}else{if($.inArray(f,d)!="-1"){b="restaurants"}}}}return b}function get_misc_marker_type(b){var c=$.trim(b.replace(/(&)/g,"&").replace(/&|,|-|\s|\s+|\//g,"_").replace(/(_)+/g,"_").toLowerCase());var a={hotels:"hotels",restaurants:"restaurants",shopping:"shopping",things_to_do:"things_to_do",train_station:"train_station",metro_station:"train_station",bus_station:"bus_station",airport:"airport",camping:"camping",buddhist_sites:"buddhist_sites",wildlife_sanctuary:"wildlife_sanctuary",water_fall:"water_fall",dam:"dam",water_spring:"water_spring",hill_station:"hill_station",zoo:"zoo",bowling_centre:"bowling_centre",adventure_sports:"adventure_sports",beach:"beach",amusement_park_water_parks:"amusement_park_water_parks",amusement_park:"amusement_park_water_parks",water_parks:"amusement_park_water_parks",water_park:"amusement_park_water_parks",lake:"lake",golf_course:"golf_course",art_galleries:"art_galleries",spa:"spa",museums:"museums",tourist_attraction:"tourist_attraction",major_tourist_park_garden:"major_tourist_park_garden",major_tourist_park:"major_tourist_park_garden",garden:"major_tourist_park_garden",forts_palaces:"forts_palaces",forts:"forts_palaces",palaces:"forts_palaces",club:"club",forest:"forest",historical_monument:"historical_monument",theatre:"theatre",police_station:"police_station",ayurveda_yoga:"ayurveda_yoga",recreation_facility:"recreation_facility",cinema:"cinema",nature_other:"nature_other"}; if(typeof a[c]!="undefined"){return a[c]}return"default"}function get_nonfeatured_marker_type(f,c){var f=f.toUpperCase();var a=["HOTHST","HOTRES","HOTPRE","HOTNOP","HOTALL"];var d=["FODCOF","FODCON","FODFFD","FODIND","FODOTH","FODOTL","FODPUB","FODRDS"];var e=["SHPMAL","SHPMKT","SHPOTH","SHPPLZ","SHPRTC","SHPRTS","SHPWIN"];var h=["NTCOTH","RCNCIN","RCNOTH","HLTAUR","COMPOL","RCNTHT","HISMON","NTCFST","RCNCLB","HISFRT","RCNPRK","RCNTST","HISMUS","HLTSPA","RCNART","RCNGLF","NTCLAK","RCNAUS","HOTRES","RCNADV","RCNBWL","RCNZOO","NTCHLS","NTCSPG","RCNDAM","NTCFAL","NTCWLS","PLPBUD","TRNMET","RCNCMP"]; var b=false;if($.inArray(f,a)!=-1){b="hotels"}else{if($.inArray(f,d)!="-1"){b="restaurants"}else{if($.inArray(f,e)!="-1"){b="shopping"}else{if($.inArray(f,h)!="-1"){var g=get_misc_marker_type(c);if(g!==false){activity_mapping[g]=c;b=g}}}}}return b}function getUniqueLatLng(g,d,h){var e=0.99999;var b=1.000001;var a=h.indexOf(g+"@"+d);if(a>=0){var c=g*(Math.random()*(b-e)+e);var f=d*(Math.random()*(b-e)+e);getUniqueLatLng(c,f,h)}else{gLat=g;gLng=d}return}function populateMap(c,b){var d="";var a=new google.maps.LatLngBounds(); c=typeof c!=="undefined"?c:"";b=typeof b!=="undefined"?1:0;if(gplaces!=undefined){$.each(gplaces,function(e,f){var k=f.pid;if(k===undefined){k=e}if(typeof f.location=="undefined"){delete gplaces[e];return true}var g=f.location;if((g.lat!=""&&g.lon!="")&&(g.lat!=null&&g.lon!=null)){var o=new google.maps.LatLng(g.lat,g.lon);if(markers.length>0){gLat="";gLng="";var n="";if(c!==""){n=g.lat+"@"+g.lon+"@"+get_clean_string(f.title)}if(c===""||c!==n){getUniqueLatLng(g.lat,g.lon,d)}else{gLat=g.lat;gLng=g.lon }gplaces[e]["location"]["lat"]=gLat;gplaces[e]["location"]["lon"]=gLng;o=new google.maps.LatLng(gLat,gLng);d=d+"|"+gLat+"@"+gLng}else{d=g.lat+"@"+g.lon}if(b&&f.icon!==undefined){var h="";var m='
'+f.title+''+f.title+"
"}else{var h=get_marker_type(f.travel_activity_tag);var m='
'+f.title+"
" }var j=h;var l=map;var i=new RichMarker({map:l,position:o,draggable:false,flat:true,zIndex:1,animation:google.maps.Animation.DROP,content:m});a.extend(i.position);i.poi_id=k;i.id=e;i.marker_type=j;markers.push(i);google.maps.event.addListener(i,event_hover,function(){this.setZIndex(9999)});google.maps.event.addListener(i,"mouseout",function(){this.setZIndex(1)})}})}map.fitBounds(a);updateLeftOnZoom=1;google.maps.event.addListener(map,event_click,function(){$(".poi").removeClass("scale")});google.maps.event.addListener(map,"zoom_changed",function(){reloadCluster() });google.maps.event.addListenerOnce(map,"tilesloaded",function(){hideLoading()});google.maps.event.addListener(map,"bounds_changed",function(){});google.maps.event.addListener(map,"resize",function(){})}function updateMapDimensions(){mapHeight=400;mapWidth=770;if($("#map-canvas").length==1&&$(".bottom-filter").length==1){var a=$(window).height()-$(".bottom-filter").outerHeight();$("#map-canvas").css("height",a)}if(typeof map!=="undefined"){google.maps.event.trigger(map,"resize")}}function update_scroll(a){$("."+a).mCustomScrollbar("destroy"); $("."+a).mCustomScrollbar({scrollButtons:{enable:true},advanced:{updateOnContentResize:true,updateOnBrowserResize:true}})}function resetDirection(){if(directionsDisplay!="undefined"&&typeof(directionsDisplay)!="undefined"){directionsDisplay.setMap(null)}if(typeof(dMarker)!="undefined"&&dMarker!="undefined"){dMarker.setMap(null)}$("#fromloc").val("")}function handle_map_view(d,a){initialize();$(".map_tab").show();if($("#webklipper-publisher-widget-container").length>0){$("#webklipper-publisher-widget-container").hide() }$(".explore").hide();if($(d).attr("data-latlon")!=undefined){var c=$(d).attr("data-latlon").split("@");place_lat=c[0];place_lon=c[1]}place=$.trim($(d).attr("data-place").toLowerCase());a=typeof a!=="undefined"?a:"";if(place!=undefined){hideAllMarkers();updateMapDimensions();var e=window.location.pathname.split("/");var b=parseInt((e[e.length-1]).replace(/^\D+/g,""));if(!$.isNumeric(b)&&$(d).attr("data-msid")!=""){b=$(d).attr("data-msid")}if($.isNumeric(b)){mapapi=city_guide_api+b+ext;if(a!=""){mapapi+="?pagetype="+a }getPlaceInfo()}}update_scroll("content-list")}function test_map_view(){search_off=false;$(".map_tab").show();$(".explore").hide();place_lat=78;place_lon=21;place="India";pagetype=typeof pagetype!=="undefined"?pagetype:"";if(place!=undefined){hideAllMarkers();updateMapDimensions();mapapi="/map_custom_poi.cms";getPlaceInfo()}update_scroll("content-list")}function set_map_params(c,a,b){if(typeof c!=="undefined"){place_lat=c.center["lat"];place_lon=c.center["lon"];$("#"+a).css({width:c.size["w"],height:c.size["h"]}) }if(event_click=="click"){map.setOptions({draggable:true})}else{map.setOptions({draggable:false})}google.maps.event.addListenerOnce(map,"tilesloaded",function(){if(typeof b!=="undefined"){map.setCenter(new google.maps.LatLng(place_lat,place_lon))}});google.maps.event.addListener(map,"bounds_changed",function(){if(typeof b!=="undefined"){map.setCenter(new google.maps.LatLng(place_lat,place_lon))}google.maps.event.clearListeners(map,"bounds_changed")});google.maps.event.trigger(map,"resize")}function load_custom_map(a){if(typeof google==="undefined"){return }if(a!=undefined&&a!=""){initialize();google.maps.event.clearListeners(map,"bounds_changed");google.maps.event.clearListeners(map,"tilesloaded");google.maps.event.clearListeners(map,"resize");markers=[];gplaces=[];markerTimer=[];hideAllMarkers();if(typeof require!=="undefined"){require("tiljs/logger").info("/map_gs_list/"+a+".cms")}$.ajax({type:"POST",url:"/travel/map_gs_list/"+a+".cms",success:function(b){gplaces=b.n;place=gplaces["1"]["region"];if(!$.isEmptyObject(b.param)){set_map_params(b.param,"map-canvas",1) }if(!$.isEmptyObject(gplaces)){populateMap("",1)}google.maps.event.trigger(map,"resize")}})}}function load_guide_map(c,g,e,b){if(typeof google==="undefined"){return}if(c!=undefined&&c!=""){var a="map-canvas"+c;var f="map_heading"+c;initialize(a);google.maps.event.clearListeners(map,"bounds_changed");google.maps.event.clearListeners(map,"tilesloaded");google.maps.event.clearListeners(map,"resize");markers=[];gplaces=[];markerTimer=[];hideAllMarkers();if(typeof e!="undefined"){var d=e.split("@");place_lat=d[0]; place_lon=d[1]}place=$.trim(g.toLowerCase());if(!b){pagetype="guide"}mapapi=city_guide_api+c+ext+"?pagetype="+pagetype+"&showlocation=1";if(typeof require!=="undefined"){require("tiljs/logger").info(mapapi)}$.ajax({type:"POST",url:mapapi,success:function(h){if(!$.isEmptyObject(h)&&Object.keys(h).length>4){gplaces=h;$("#"+a).css("height","500px");set_map_params();if(!$.isEmptyObject(gplaces)){populateMap("",1)}else{$("."+f).hide()}}else{$("."+f).hide()}}})}}function load_guidecustom_map(b,d,c,a){$.when($.getScript("http://maps.googleapis.com/maps/api/js?key=AIzaSyBx_zCppzoisqZ8OlYZUjakG3s2ckioVDA")).then(function(){initMapOnGuideShow(b,d,c,a) });return false}function Markerdata(a){console.log(a)}function initMapOnGuideShow(d,f,e,c){var c=c;if(typeof e!="undefined"&&d!=""){var a={things_to_do:"http://static.toiimg.com/thumb/msid-80229768,width-30,resizemode-4.cms",hotels:"http://static.toiimg.com/thumb/msid-80229739,width-30,resizemode-4.cms",shopping:"http://static.toiimg.com/thumb/msid-80229716,width-30,resizemode-4.cms",restaurants:"http://static.toiimg.com/thumb/msid-80230255,width-30,resizemode-4.cms"};if(!c){c="guide"}var b="http://jeetbetwin.com/travel/map_city_guide_poi/"+d+".cms?pagetype="+c+"&showlocation=1"; $.ajax({url:b,type:"GET",success:function(k){var m=e.split("@");var l=parseFloat(m[0]);var p=parseFloat(m[1]);var g={lat:l,lng:p};console.log("center::",g);var o="map-canvas"+d;var h=new google.maps.Map(document.getElementById(o),{zoom:10,center:g,mapTypeId:google.maps.MapTypeId.ROADMAP});var j=new google.maps.InfoWindow();for(var n in k){var q=k[n];if(q&&q.location){var i={url:(a[get_marker_type(q.travel_activity_tag)])?a[get_marker_type(q.travel_activity_tag)]:"",scaledSize:new google.maps.Size(25,25),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(0,0)}; marker=new google.maps.Marker({position:new google.maps.LatLng(q.location.lat,q.location.lon),animation:google.maps.Animation.DROP,draggable:false,icon:i,title:q.title,map:h})}}}})}}function populateMap_guild(e,h,a,g,d,c){var d=typeof d!=="undefined"?d:"";var c=typeof c!=="undefined"?1:0;console.log("mapmsid",h);console.log("mlat",a);console.log("mlng",g);console.log("salt_str",d);console.log("custom_map",c);var f=new google.maps.LatLng(a,g);var b={zoom:8,scrollwheel:false,mapTypeControl:false,navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeId:google.maps.MapTypeId.ROADMAP,panControl:true,panControlOptions:{position:google.maps.ControlPosition.LEFT_CENTER},zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE,position:google.maps.ControlPosition.LEFT_CENTER},center:f}; mapObject=new google.maps.Map(document.getElementById(h),b);$.each(e,function(j,i){console.log(i)})}$(function(){check_map_bt_wish_session();require(["tiljs/event"],function(a){a.subscribe("user.status",function(b){if(b){check_map_bt_wish_session()}else{check_map_bt_wish_session()}})});if($.inArray("map",document.location.hash.split("#"))!=-1){handle_map_view($('#city_guide_tabs li:contains("Map View")')[0])}require(["tiljs/is"],function(a){if(a.desktop()){$(".display-filter").show()}});if($(".left-column").length>0){$(".left-column .content-list").css({height:$(window).height()-(42*5)}) }$("body").on(event_click,".mapit_button",function(){initialize();var c=$(this).attr("data-latlon");var a=$(this).attr("data-pid");if(typeof c!="undefined"&&typeof a!="undefined"){c=c.split("@");place_lat=c[0];place_lon=c[1];$(".explore").hide();var d=$.trim($(this).attr("data-title"));$(".map_tab").show();if($("#webklipper-publisher-widget-container").length>0){$("#webklipper-publisher-widget-container").hide()}updateMapDimensions();var b=c[0]+"@"+c[1]+"@"+get_clean_string(d);perform_search(c[0],c[1],a,b); update_scroll("content-list")}});$("body").on(event_click,"#map_wishlist, #map_been_there",function(f){f.preventDefault();if(require("tiljs/login").getUser()==undefined){var c=$(this).attr("id")+"@"+$(this).attr("data-msid")+"@"+$(this).attr("data-title")+"@"+$(this).attr("data-url");sessionStorage.setItem("social_map_nl",c);var b="been_there";if($(this).attr("id")=="map_wishlist"){b="wishlist"}set_wishlist_been_there_cookie($(this),b);fo=new FadeObj("backgroundPopup");require("tiljs/login").login(); return false}else{var a=$(this).attr("data-title");if($(this).attr("data-id")!=undefined&&$(this).attr("data-id")!==""){delete_bt_wishlist($(this).attr("data-id"));$(this).removeAttr("data-id");$(this).removeClass("active")}else{var d="wishlist";if($(this).attr("id")==="map_been_there"){d="been_there"}if($(this).hasClass("active")){$(this).removeClass("active");delete_map_bt_wishlist_after_read(d,$(this).attr("data-msid"))}else{if(typeof $(this).attr("data-msid")!="undefined"&&typeof $(this).attr("data-url")!="undefined"){add_bt_wishlist(d,$(this).attr("data-msid"),a,$(this).attr("data-url")) }$(this).addClass("active")}}}});$("#poi-details").on(event_click,".info-box .footer a.share",function(){$("ul.social-popup").slideToggle()});$(".left-column").on(event_click,".tab-heading",function(){var b=$(this).parents(".navigation-tab");var a=$(b).hasClass("selected");$(".left-column").find(".selected").removeClass("selected");if(a){$(b).removeClass("selected")}else{$(b).addClass("selected")}update_scroll("content-list")});$(window).resize(function(){if(typeof map!=="undefined"){updateMapDimensions() }});$("#poi-details").on(event_click,"#commute .close",function(){resetDirection()});$("body").on(event_hover,".f_marker, .n_marker",function(){$(".f_marker, .n_marker").removeClass("scale");$(this).addClass("scale");$(this).parent().parent().css({"z-index":"9999"})});$("body").on("mouseout",".f_marker, .n_marker",function(){$(this).removeClass("scale");$(this).parent().parent().css({"z-index":"1"})});$("body").on(event_click,".f_marker",function(){var b=$(this).attr("data-id");var a=$(this).attr("data-pid"); if(gplaces[b]["seolocation"]!=undefined&&gplaces[b]["seolocation"]!=""){window.location=gplaces[b]["seolocation"]}else{$(".content-list li").removeClass("selected");$(".content-list").find("li[data-msid = pid]").addClass("selected");poiDetail.showDetails(a)}});$("body").on(event_click,".map-view",function(){initialize();place=$(this).attr("data-title");if(place!=undefined){hideAllMarkers();setMapCenter();mapapi=listing_api;getPlaceInfo()}});$("body").on(event_click,".tabs li.list-heading",function(){place=$(this).attr("data-title"); if(place!=undefined){hideAllMarkers();setMapCenter();populateMap()}});$("body").on("mouseout",".tabs .drop-down li",function(a){a.stopPropagation();var b=$(this).attr("data-msid");if(b!=undefined){$(".poi, .marker").removeClass("scale");$("#pm_"+b).trigger("mouseout")}});$("body").on(event_hover,".tabs .drop-down li",function(a){a.stopPropagation();var b=$(this).attr("data-msid");if(b!=undefined){$(".poi, .marker").removeClass("scale");$("#pm_"+b).trigger(event_hover)}});$("body").on(event_click,".tabs .drop-down li",function(a){a.stopPropagation(); var b=$(this).attr("data-msid");if(b!=undefined){$(".poi, .marker").removeClass("scale");$("#pm_"+b).trigger(event_hover)}});$("body").on(event_click,".content-list li",function(b){b.stopPropagation();$(".content-list li").removeClass("selected");var a=$(this).attr("data-msid");var c=$(this).attr("data-id");if(a!=undefined){$(this).addClass("selected");$(".poi, .marker").removeClass("scale");if($(window).width()<767){$(".collapse-btn2").trigger(event_click)}poiDetail.showDetails(a)}});$("body").on("mouseenter",".content-list li",function(b){b.stopPropagation(); var a=$(this).attr("data-msid");var c=$(this).attr("data-id");if(a!=undefined){$(".poi, .marker").removeClass("scale");if($(window).width()<767&&event_click==="touchstart"){$(".collapse-btn2").trigger(event_click)}$("#pm_"+c).trigger(event_hover)}});$("body").on("mouseleave",".content-list li",function(a){a.stopPropagation();var b=$(this).attr("data-id");if(b!=undefined){$(".poi, .marker").removeClass("scale");$("#pm_"+b).trigger("mouseout")}});$("body").on(event_click,".map_view",function(a){handle_map_view($('#city_guide_tabs li:contains("Map View")')[0]) });$("body").on(event_click,".map_page_button",function(a){handle_map_view($("#map_page_btn"),"")});$("body").on(event_click,"#city_guide_tabs li, #list_view",function(c){var a=$.trim($(this).text().toLowerCase());var b=$(this);search_off=true;if(a=="map view"){handle_map_view(b,"")}else{remove_neighbourhood();$(".map_tab").fadeOut("fast",function(){$("#poi-details").html("");setTimeout(function(){$(".explore").show();check_bt_wish_session();if($("#webklipper-publisher-widget-container").length>0){$("#webklipper-publisher-widget-container").show() }},500);var d="http://"+window.location.host+window.location.pathname+window.location.search;if(typeof history.pushState!=="undefined"){history.pushState({},"",d)}});$("#closeDiv").show()}});$("body").on(event_click,".mapview_button",function(){var a=$(this);pagetype="guide";handle_map_view(a,pagetype)});$(".bottom-filter").on(event_click,".checkbox",function(){$(this).find("label").toggleClass("checked");var a=get_misc_marker_type($.trim($(this).text()));if($(this).find("label").hasClass("checked")){$(".left-column").find("."+a).show(); showMarkerType(a)}else{$(".left-column").find("."+a).hide();hideMarkerType(a)}if(all_flag==true){if($(this).find("label").hasClass("checked")){showNeighbourByType(a,0,1)}else{hideNeighbourByType(a)}}if($(".bottom-filter .primary label.checked").length===0){$(".collapse-btn2").addClass("open");$(".collapse-btn2").trigger(event_click);if($(".collapse-btn2").is(":visible")){$(".collapse-btn2").removeClass("open").addClass("all_clear").hide()}}else{if($(".bottom-filter .primary label.checked").length===1){if(!$(".collapse-btn2").is(":visible")){if($(".collapse-btn2").hasClass("all_clear")){$(".collapse-btn2").addClass("open").removeClass("all_clear").show() }else{$(".collapse-btn2").removeClass("open").trigger(event_click);$(".collapse-btn2").hide()}}else{$(".collapse-btn2").addClass("open").show()}}}});$(".bottom-filter").on(event_click,".btn_group",function(){showLoading();if($.trim($(this).text().toLowerCase())=="all"){all_flag=true;$("#neighbourhood ul li a.active").removeClass("active");$(".more-filter-btn").show();setTimeout(function(){showAllNeighbour()},50)}else{all_flag=false;remove_nonfeatured();$(".more-filter-btn").hide();$(".more-filters").hide() }$(".btn_group").removeClass("active");$(this).addClass("active")});$(".bottom-filter").on(event_click,".more-filter-btn",function(){$(".more-filters").slideToggle();$(this).toggleClass("open")});$(".right-column").on(event_click,".collapse-btn",function(b){b.preventDefault();var a=parseInt($(".info-box").css("width"))+20;if($(this).hasClass("close")){$(".info-box").animate({right:"+="+a},500);$(this).removeClass("close")}else{$(".info-box").animate({right:"-="+a},500);$(this).addClass("close")}}); $(".right-column").on(event_click,".collapse-btn2",function(){if($(this).hasClass("open")){$(".overlay-map .left-column").animate({left:"-218px"},500);$(".top-filtres a.collapse-btn2").animate({left:"0"},500);if($(window).width()>767){$(".overlay-map .inner").animate({"padding-left":"0"},500)}$(this).removeClass("open")}else{$(".overlay-map .left-column").animate({left:"0"},500);$(".top-filtres a.collapse-btn2").animate({left:"219px"},500);if($(window).width()>767){$(".overlay-map .inner").animate({"padding-left":"219px"},500) }$(this).addClass("open")}});$("#poi-details").on(event_click,".tab-strip2 li",function(b){b.preventDefault();$(this).siblings().removeClass("active");$(this).addClass("active");$(".info-box .tab-content").removeClass("show");remove_nonfeatured();resetDirection();var a=$(this).attr("title");$("#"+a).addClass("show");if(a=="neighbourhood"){neighbourhood_flag=true;all_flag=false;remove_neighbourhood();show_neighbourhood();$(".btn_group").removeClass("active");$(".bottom-filter .featured").addClass("active"); $(".more-filters label.checked").removeClass("checked")}else{if(a=="commute"){$("#commute").find(".selected").removeClass("selected");$("#commute .commute-tab:first-child").addClass("selected");remove_neighbourhood();poiDetail.showdirection();commute_facility()}else{remove_neighbourhood();show_neighbourhood()}}if(a=="detail"){update_scroll("detail_tab")}});$("#poi-details").on(event_click,".close_detail",function(){poiDetail.closeDetail()});$("#poi-details").on(event_click,"#commute .commute-tab .heading",function(){resetDirection(); var b=$(this).parents(".commute-tab");$(b).siblings(".commute-tab").removeClass("selected");$(b).addClass("selected");if($(b).find(".results").hasClass("bus_station")){var a="bus_station";showNeighbourByType(a,1,0);update_scroll("bus_station")}else{if($(b).find(".results").hasClass("train_station")){var a="train_station";showNeighbourByType(a,1,0);update_scroll("train_station")}else{if($(b).find(".results").hasClass("airport")){var a="airport";showNeighbourByType(a,1,0);update_scroll("airport")}else{remove_neighbourhood() }}}});$("#poi-details").on(event_click,"#neighbourhood ul li a",function(){var a=get_misc_marker_type($.trim($(this).text()));$("#neighbourhood ul li a.active").removeClass("active");$(this).addClass("active");show_non_featured_by_selection()});$("#times-guide .tabs a.collapse-btn").click(function(a){a.preventDefault();if($(this).hasClass("open")){$("#times-guide .tabs").animate({left:"-=189px"},500);$(this).removeClass("open")}else{$("#times-guide .tabs").animate({left:"+=189px"},500);$(this).addClass("open") }})});function register_autocomplete_event(){if(typeof place!="undefined"&&$("#map_search").length>0){$("#map_search").autocomplete(map_autocomplete_api,{moreInfo:"map_search",max:1000});$("#map_search").setOptions({extraParams:{pt:function(){return place_lat+","+place_lon},q:function(){return $("#map_search").val().replace(/\s|\s+/g,"-").replace(/(-)+/g,"-")}}});$("#map_search").on("travel_search",function(f,d){detail_flag=false;if(d.length==3){place=d[0];var a=d[1];var c=d[2].split("@");var g=c[2]; var b=c[0]+"@"+c[1]+"@"+get_clean_string(g);perform_search(c[0],c[1],a,b)}});event_registered=1}}function get_clean_string(a){return $.trim(decodeURIComponent(a).replace(/(&)/g,"&").replace(/&|,|'|"|-|\s|\s+|\//g,"_").replace(/(_)+/g,"_").toLowerCase())}function perform_search(b,c,d,a){showLoading();search_off=false;mapapi=map_nearby_search+"&latitude="+b+"&longitude="+c+"&distance="+city_limit_distance+"&datatype=featured";hideAllMarkers();var d=typeof d!=="undefined"?d:"";getPlaceInfo(d,b,c,a) }function setMapCenter(){var b={india:{lat:"21",lon:"78",zoom:"4"},non_india:{lat:"0",lon:"0"},asia:{lat:"37.230328",lon:"92.548828"},australia:{lat:"-21.207459",lon:"133.857422"},europe:{lat:"45.398450",lon:"26.630859"},namerica:{lat:"54.059388",lon:"-101.777344"},samerica:{lat:"-7.536764",lon:"-54.316406"},africa:{lat:"6.926427",lon:"21.708984"}};if(b[place]==undefined){place="asia"}updateMapDimensions();map.setCenter(new google.maps.LatLng(b[place]["lat"],b[place]["lon"]));var a=3;if(b[place]["zoom"]!=undefined){a=parseInt(b[place]["zoom"]) }map.setZoom(a)}function updateLeftPanel(){var b="";var e="";var a="";var d="";var c="";$.each(gplaces,function(j,i){var f=i.pid;if(typeof i.location=="undefined"){delete gplaces[j];return true}var h=get_marker_type(i.travel_activity_tag);var g=i.location["lat"]+"@"+i.location["lon"]+"@"+get_clean_string(i.title);b+='
  • '+i.title+''+i.title+'
  • '; if(h=="things_to_do"){d+='
  • '+i.title+''+i.title+'
  • '}else{if(h=="hotels"){e+='
  • '+i.title+''+i.title+'
  • '}else{if(h=="restaurants"){a+='
  • '+i.title+''+i.title+'
  • ' }else{if(h=="shopping"){c+='
  • '+i.title+''+i.title+'
  • '}}}}});if(b!=""){$(".left-column .all .content-list ul").html(b)}else{$(".left-column .all").hide()}if(d!=""){$(".left-column .things_to_do .content-list ul").html(d)}else{$(".left-column .things_to_do").hide();$(".bottom-filter .primary label:contains('Place to See')").removeClass("checked") }if(c!=""){$(".left-column .shopping .content-list ul").html(c)}else{$(".left-column .shopping").hide();$(".bottom-filter .primary label:contains('Shopping')").removeClass("checked")}if(a!=""){$(".left-column .restaurants .content-list ul").html(a)}else{$(".left-column .restaurants").hide();$(".bottom-filter .primary label:contains('Restaurants')").removeClass("checked")}if(e!=""){$(".left-column .hotels .content-list ul").html(e)}else{$(".left-column .hotels").hide();$(".bottom-filter .primary label:contains('Hotels')").removeClass("checked") }update_scroll("content-list")}function remove_nonfeatured(){if(neighbour_marker!="undefined"&&typeof(neighbour_marker)!="undefined"){for(var a=0;a0&&(poiMarker.getMap()!==null&&poiMarker.getMap()!==undefined)){var h=$(".bottom-filter label.checked");var d=[];$.each(h,function(){var i=get_misc_marker_type($.trim($(this).text())); d.push(i)});for(var b=0;bLoading..."); neighbour_type=[];var d="";if(neighbour_marker.length>0){for(var a=0;a'+neighbour_type[a]+""}$("#neighbourhood .section ul").html(d)}function commute_facility(){showLoading();$("#commute .train_station").html(""); $("#commute .bus_station").html("");$("#commute .airport").html("");var a={bus_station:5000,train_station:75000,airport:750000};commute_neighbour_marker=[];map.setZoom(12);service=new google.maps.places.PlacesService(map);var b={location:platlng,radius:a.train_station,types:["train_station","subway_station"],language:"en"};service.nearbySearch(b,callbackCommute);var b={location:platlng,radius:a.bus_station,types:["bus_station"],language:"en"};service.nearbySearch(b,callbackCommute);var b={location:platlng,radius:a.airport,types:["airport"],language:"en"}; service.nearbySearch(b,callbackCommute)}function reload_left_panel(){$(".map_tab .content-list li").show();$(".left-column .navigation-tab").show()}function nearby_facility(b,c){all_flag=false;$(".btn_group").removeClass("active");$(".bottom-filter .featured").addClass("active");$(".more-filters label.checked").removeClass("checked");showLoading();neighbour_marker=[];c_radius=b;var d=new google.maps.LatLng(plat,plng);lastpid=c;map.setCenter(new google.maps.LatLng(plat,parseFloat(plng)+parseFloat(0.0675))); map.setZoom(12);circle=new google.maps.Circle({center:platlng,map:map,editable:false,draggable:false,radius:c_radius,fillColor:"#47a6d7",fillOpacity:0.15,strokeColor:"#47a6d7",strokeWeight:1,zIndex:0});var e=google.maps.geometry.spherical.computeOffset(platlng,c_radius,270);marker1=new RichMarker({map:map,position:e,draggable:false,flat:true,anchor:5,zIndex:999,content:'
    '+Math.round(c_radius/1000)+"Km
    "});resizeMarker=new RichMarker({map:map,position:google.maps.geometry.spherical.computeOffset(platlng,c_radius,90),draggable:true,raiseOnDrag:false,flat:true,anchor:5,zIndex:999,content:''}); google.maps.event.addListener(resizeMarker,"drag",function(){var g=this.getPosition();var h=new google.maps.LatLng(platlng.lat(),g.lng());var f=google.maps.geometry.spherical.computeDistanceBetween(h,platlng);if(f<5000){f=5000}if(f>10000){f=10000}this.setPosition(google.maps.geometry.spherical.computeOffset(platlng,f,90));circle.setRadius(f);var i=google.maps.geometry.spherical.computeOffset(platlng,f,270);marker1.setPosition(i);marker1.setContent('
    '+Math.round(f/1000)+"Km
    ") });google.maps.event.addListener(resizeMarker,"dragend",function(){var h=this.getPosition();this.setContent("");var i=new google.maps.LatLng(platlng.lat(),h.lng());var g=google.maps.geometry.spherical.computeDistanceBetween(i,platlng);if(g<5000){g=5000}if(g>10000){g=10000}this.setPosition(google.maps.geometry.spherical.computeOffset(platlng,g,90));circle.setRadius(g);var f=Math.round(g);if(f>10000){f=10000}marker1.setMap(null);remove_neighbourhood();nearby_facility(f,c)});var a=map_nearby_search+"&latitude="+platlng.lat()+"&longitude="+platlng.lng()+"&distance="+Math.round(c_radius/1000); if(Math.round(c_radius/1000)0){$.each(a,function(){showNeighbourByType(this,0,1);reloadCluster()})}}if($("#poi-details .neighbourhood").hasClass("active")&&$("#neighbourhood").find(".active").text()!==""){b=get_misc_marker_type($("#neighbourhood").find(".active").text())}if(b!==""){showNeighbourByType(b,0,1)}}function reloadCluster(){if(typeof markerCluster!=="undefined"){markerCluster.repaint()}}function createPlaceMarker(h,e){var c=""; var m="";var k=null;if(all_flag==true){k=map}var i=get_nonfeatured_marker_type(e.category_sug,e.category_desc);if(i==false){return}var l=new google.maps.LatLng(e.location.lat,e.location.lon);if(platlng==undefined){platlng=new google.maps.LatLng(map.getCenter().lat(),map.getCenter().lng())}var f=parseFloat((google.maps.geometry.spherical.computeDistanceBetween(platlng,l)/1000).toFixed(2));var g=parseFloat((c_radius/1000).toFixed(2));if(f<=g){var a=neighbour_marker.length;f=f+" Km";var j=l;var b='
    '+e.title+" ("+f+" from "+poiMarker.title+")
    "; if(poiMarker.getMap()==null||poiMarker.getMap()==undefined){b='
    '+e.title+"
    "}var d=new RichMarker({map:k,position:l,draggable:false,flat:true,zIndex:1,animation:google.maps.Animation.DROP,content:b});if(typeof markerCluster!=="undefined"){markerCluster.addMarker(d,false)}d.m_type=i;d.m_name=e.title;d.m_distance=f;neighbour_marker.push(d);google.maps.event.addListener(d,event_hover,function(){this.setZIndex(9999) });google.maps.event.addListener(d,"mouseout",function(){this.setZIndex(1)})}}function callbackCommute(d,b){if(b==google.maps.places.PlacesServiceStatus.OK){for(var c=0;c"+d.name+""+b+" km"}else{if(d.types[0]=="bus_station"&&bus_str.search(d.name)==-1){bus_str=bus_str+"
  • "+d.name+""+b+" km
  • " }else{if(d.types[0]=="train_station"&&train_str.search(d.name)==-1){train_str=train_str+"
  • "+d.name+""+b+" km
  • "}}}b=b+" Km";var c=d.geometry.location;var g=new RichMarker({map:e,position:d.geometry.location,draggable:false,flat:true,zIndex:1,animation:google.maps.Animation.DROP,content:'
    '+d.name+" ("+b+")
    "}); g.m_type=d.types[0];g.m_name=d.name;g.m_distance=b;commute_neighbour_marker.push(g)}function hideneighbourdetail(){$(".n_marker").removeClass("scale");$(".n_marker").parent().parent().css({"z-index":"1"});if(typeof(directionsDisplay)!="undefined"){directionsDisplay.setMap(null)}}function showneighbourdetail(a){resetDirection();hideneighbourdetail();$(".n_marker").removeClass("scale");$("#cm_"+a).addClass("scale");$("#cm_"+a).parent().parent().css({"z-index":"9999"});if(typeof(directionsDisplay)!="undefined"&&directionsDisplay!="undefined"){directionsDisplay.setMap(null) }var b={origin:platlng,destination:commute_neighbour_marker[a].position,travelMode:google.maps.DirectionsTravelMode.DRIVING};directionsService.route(b,function(d,c){if(c==google.maps.DirectionsStatus.OK){directionsDisplay.setMap(map);directionsDisplay.setOptions({preserveViewport:true});directionsDisplay.setDirections(d)}})}function read_map_wishlist(a){var d=typeof a!=="undefined"?a:"";if(d!=""){var c="http://myt.jeetbetwin.com/mytimes/travel/activity?appKey=Travel&activityType=WishList";var b=c+"&msid="+d; if(typeof require!=="undefined"){require("tiljs/logger").info(b)}$.ajaxSetup({async:true});$.ajax({url:b,dataType:"jsonp",success:function(f){if(typeof f!=="undefined"&&f.length>0&&f[0]!=null){var e=f[0]["_id"];if($("#map_wishlist").length>0){if($("#map_wishlist").hasClass("active")){$("#map_wishlist").attr({"data-id":e}).show()}else{$("#map_wishlist").addClass("active").attr({"data-id":e}).show()}}}else{if($("#map_wishlist").hasClass("active")){$("#map_wishlist").removeClass("active").removeAttr("data-id").show() }else{$("#map_wishlist").removeAttr("data-id").show()}}}})}}function read_map_been_there(a){var d=typeof a!=="undefined"?a:"";if(d!=""){var c="http://myt.jeetbetwin.com/mytimes/travel/activity?appKey=Travel&activityType=BeenThere";var b=c+"&msid="+d;if(typeof require!=="undefined"){require("tiljs/logger").info(b)}$.ajaxSetup({async:true});$.ajax({url:b,dataType:"jsonp",success:function(f){if(typeof f!=="undefined"&&f.length>0&&f[0]!=null){var e=f[0]["_id"];if($("#map_been_there").length>0){if($("#map_been_there").hasClass("active")){$("#map_been_there").attr({"data-id":e}).show() }else{$("#map_been_there").addClass("active").attr({"data-id":e}).show()}}}else{if($("#map_been_there").hasClass("active")){$("#map_been_there").removeClass("active").removeAttr("data-id").show()}else{$("#map_been_there").removeAttr("data-id").show()}}}})}}function delete_map_bt_wishlist_after_read(b,a){var d="http://myt.jeetbetwin.com/mytimes/travel/activity?appKey=Travel&activityType=";if(b==="wishlist"){d+="WishList"}else{d+="BeenThere"}var c=d+"&msid="+a;if(typeof require!=="undefined"){require("tiljs/logger").info(c) }$.ajaxSetup({async:true});$.ajax({url:c,dataType:"jsonp",success:function(f){if(typeof f!=="undefined"&&f.length>0){var e=f[0]["_id"];delete_bt_wishlist(e)}else{setTimeout(function(){delete_map_bt_wishlist_after_read(b,a)},500)}}})}function check_map_bt_wish_session(){try{if(require("tiljs/login").getUser()!=undefined){if(sessionStorage.getItem("social_map_nl")!=null&&sessionStorage.getItem("social_map_nl")!==""){var b=sessionStorage.getItem("social_map_nl").split("@");var a="wishlist";if(b[0]==="map_been_there"){a="been_there" }if(b.length==4){add_bt_wishlist(a,b[1],b[2],b[3])}$("#"+b[0]).trigger(event_click);setTimeout(function(){check_bt_wish_session()},5000);sessionStorage.removeItem("social_map_nl")}}add_wishlist_been_there_from_cookie()}catch(c){}}function add_wishlist_been_there_from_cookie(){require(["tiljs/cookie","tiljs/is"],function(b,d){if(d.exists(require("tiljs/login").getUser())){var c=b.get("travel_been_there");if(d.exists(c)){var f=c.split(";");$.each(f,function(){var g=this.match(/\d+/g)[0];add_bt_wishlist("been_there",this.match(/\d+/g)[0],"",this) });b.set("travel_been_there","",-3600,"/",site_config.domain,"")}var a=b.get("travel_wishlist");if(d.exists(a)){var e=a.split(";");$.each(e,function(){var g=this.match(/\d+/g)[0];add_bt_wishlist("wishlist",this.match(/\d+/g)[0],"",this)});b.set("travel_wishlist","",-3600,"/",site_config.domain,"")}}})}function set_wishlist_been_there_cookie(b,a){require(["tiljs/cookie","tiljs/is"],function(d,f){var c=$(b).attr("data-url");var g="travel_been_there";if(a=="wishlist"){g="travel_wishlist"}var e=d.get(g); if(f.exists(e)){if(e.indexOf(c)==-1){e=e+";"+c}}else{e=c}d.set(g,e,365,"/",site_config.domain,"")})}var poiDetail={showDetails:function(a,b){$(".bottom-filter .primary label").addClass("checked");detail_flag=true;showLoading();remove_neighbourhood();updateLeftOnZoom=0;var d=poi_detail_api+a+ext;mapCenter=map.getCenter();mapZoom=map.getZoom();var f=$(".map_tab").find('li[data-msid="'+a+'"]').attr("data-id");if(typeof f==="undefined"&&typeof b!=="undefined"){f=$(".map_tab").find('li[data-salt="'+b+'"]').attr("data-id") }hideSelectiveMarker(a);reload_left_panel();platlng="";if(typeof f!=="undefined"&&typeof gplaces[f]!="undefined"){plat=gplaces[f]["location"]["lat"];plng=gplaces[f]["location"]["lon"];var c=get_marker_type(gplaces[f]["travel_activity_tag"]);var e=$.trim(gplaces[f]["title"]);poiMarker.setContent('
    '+e+"
    ");poiMarker.title=e}if(typeof require!=="undefined"){require("tiljs/logger").info(d) }$.ajax({type:"POST",url:d,data:{pid:a},success:function(h){$("#poi-details").html(h);if(require("tiljs/login").getUser()!=undefined){read_map_wishlist(a);read_map_been_there(a)}hideLoading();require(["tiljs/is"],function(i){if(i.desktop()){$("#poi-details").find(".tab-strip2").removeClass("big")}});$("#poi-details").show();if(typeof plat!=="undefined"&&typeof plng!=="undefined"){platlng=new google.maps.LatLng(plat,plng);poiMarker.setPosition(platlng);poiMarker.setMap(map);poiDetail.showpoidetails(); var g={map:map,maxWidth:300,minWidth:100,shadowStyle:3,padding:0,markerHeight:17,backgroundColor:"#ffffff",arrowBackgroundColor:"#1382c5",borderRadius:4,arrowSize:10,borderWidth:1,borderColor:"#b6b6b6",disableAutoPan:true,hideCloseButton:true,arrowStyle:0};if(directionsDisplay!="undefined"&&typeof(directionsDisplay)!="undefined"){directionsDisplay.setMap(null)}neighbour_infobubble=new InfoBubble(g);google.maps.event.addListener(neighbour_infobubble,"closeclick",function(){if(directionsDisplay!="undefined"&&typeof(directionsDisplay)!="undefined"){directionsDisplay.setMap(null) }});directionsService=new google.maps.DirectionsService();rendererOptions={map:map,suppressMarkers:true,provideRouteAlternatives:false};poiDetail.showneighbourhood(a);if(!search_off){$(".content-list").find('li[data-msid = "'+a+'"]').addClass("selected")}}}})},showneighbourhood:function(a,b){remove_neighbourhood();p_neighbour_commute_flag="1";nearby_facility(5000,a);directionsDisplay=new google.maps.DirectionsRenderer(rendererOptions)},showpoidetails:function(){remove_neighbourhood();map.setCenter(platlng); var a=(mapWidth-$("#poi-details").width())/2;a=(mapWidth/2)-a},showdirection:function(){remove_neighbourhood();var a=document.getElementById("fromloc");var b={types:[],componentRestrictions:{country:"in"}};var c=new google.maps.places.Autocomplete(a,b);google.maps.event.addListener(c,"place_changed",function(){var e=this.getPlace().name;var d=this.getPlace().formatted_address;$("#fromloc").val("");poiDetail.getDirections(d)})},closeDetail:function(){showLoading();$("#poi-details").hide("fast",function(){$("#poi-details").html(""); neighbour_all=[];remove_neighbourhood();$(".left-column").find(".content-list li.selected").removeClass("selected");$(".btn_group").removeClass("active");$(".bottom-filter .primary label").addClass("checked");$(".bottom-filter .featured").addClass("active");showAllMarkers();hideLoading()})},getDirections:function(b){showLoading();resetDirection();directionsDisplay=new google.maps.DirectionsRenderer(rendererOptions);var a={origin:b,destination:platlng,travelMode:google.maps.DirectionsTravelMode.DRIVING}; directionsService.route(a,function(c,d){if(d==google.maps.DirectionsStatus.OK){directionsDisplay.setMap(map);directionsDisplay.setOptions({preserveViewport:true});directionsDisplay.setDirections(c);var e=c.routes[0].legs[0];if(typeof(dMarker)!="undefined"){dMarker.setMap(null)}dMarker=new google.maps.Marker({position:e.start_location,icon:"/photo/25633344.cms",map:map,animation:google.maps.Animation.BOUNCE});google.maps.event.addListener(dMarker,event_click,function(){var f='
    '+c.routes[0].legs[0].start_address+"
    "; neighbour_infobubble.setContent(f);neighbour_infobubble.setPosition(dMarker.position);neighbour_infobubble.open()});hideLoading();setTimeout(function(){dMarker.setAnimation(null)},5000)}else{hideLoading()}})}};