function toggleImageCard(n){var t=$(n).closest(".img-card").hasClass("open"),i,u,r;t?($(n).closest(".row").find(".top-links").hide(),i=$(n).closest(".row").find(".caption-card").first().height(),i+=90,$(n).closest(".row").find(".top-links").show(),$(n).closest(".img-card").height(i)):$(n).closest(".img-card").css("height","auto");$(n).closest(".img-card").toggleClass("open");$(n).html(t?"Show More <i class='fas fa-chevron-down ml-2'><\/i>":"Show Less <i class='fas fa-chevron-up ml-2'><\/i>");u=$(n).parent();r=u.find(".top-links").first();t?r.hide():r.show()}function searchTopLocation(n){var t=$(n).find(".location-title").first(),i;t&&(i=t.data("search-text"),window.location.href="search?searchText="+i+"&type=HomeForRent")}function submitForm(n,t){var i=n.closest("form"),r="";typeof searchCity!="undefined"&&searchCity!=null&&searchCity!=""&&(r+=searchCity.replace(" ","_")+"");typeof searchState!="undefined"&&searchState!=null&&searchState!=""&&(r+=searchState+" ");typeof searchCountry!="undefined"&&searchCountry!=null&&searchCountry!=""&&(r+=searchCountry);r=r.replace(new RegExp("[ ]","g"),"--");var h=i.find(".search-text-autocomplete").val(),e=i.find('input[name="ListingType"]').val(),o=i.find("#FromDate").val(),s=i.find("#ToDate").val(),u=i.find('input[name="PlaceIdSearch"]').val(),c=i.find('input[name="Lat"]').val(),l=i.find('input[name="Lng"]').val(),a=i.find(".search-text-autocomplete-home").val(),f=i.find('input[name="PlaceIdHome"]').val(),v=i.find('input[name="LatHome"]').val(),y=i.find('input[name="LngHome"]').val();u&&f?window.location.href="/search?searchtext="+h+"&typeids="+e+"&fromdate="+o+"&todate="+s+"&placeidsearch="+u+"&lat="+c+"&lng="+l+"&radius=10&searchType="+t+"&searchTextHome="+a+"&placeIdHome="+f+"&latHome="+v+"&lngHome="+y:u?window.location.href="/search?searchtext="+h+"&typeids="+e+"&fromdate="+o+"&todate="+s+"&placeidsearch="+u+"&lat="+c+"&lng="+l+"&radius=10&searchType="+t:f?window.location.href="/search?typeids="+e+"&fromdate="+o+"&todate="+s+"&radius=10&searchType="+t+"&searchTextHome="+a+"&placeIdHome="+f+"&latHome="+v+"&lngHome="+y:t!=1&&i.find(".search-text-autocomplete").focus()}function changeSearchNav(){$(".dropdown-search").addClass("show");$("body").on("click",function(n){$(n.target).closest(".dropdown-search").length==0&&$(".dropdown-search").removeClass("show")});$(".navbar-nav .nav-item").mouseenter(function(){$(".dropdown-search").removeClass("show")});scrollSearchNav()}function scrollSearchNav(){var n=$(window).scrollTop();$(window).scroll(function(){var t=$(window).scrollTop();t>n?$(".pac-container").css("display","none"):$(".pac-container").css("display","none");n=t})}function clearHomeInput(){$("#ExchangesInterestedInMyAreaOnly").val(!1);$(".search-text-autocomplete-home").val("");$('input[name="LatHome"]').val(0);$('input[name="LngHome"]').val(0);$('input[name="PlaceIdHome"]').val("")}var locationInput;$(document).ready(function(){$(".search-text-autocomplete").keypress(function(n){n.keyCode==13&&n.preventDefault()});$(".search-text-autocomplete").keyup(function(n){n.keyCode==8&&($('input[name="Lat"]').val(""),$('input[name="Lng"]').val(""),$('input[name="PlaceIdSearch"]').val(""));$(this).val()||($('input[name="Lat"]').val(""),$('input[name="Lng"]').val(""),$('input[name="PlaceIdSearch"]').val(""))});$(".search-text-autocomplete").bind({paste:function(){userCopyPasteCutSearchText()},cut:function(){userCopyPasteCutSearchText()}});$(".dropdown-search .search-text-autocomplete, .dropdown-search .search-text-autocomplete-home").bind("focus blur",function(n){n.type=="focus"?($(".dropdown-search").addClass("show"),scrollSearchNav(),$(".navbar-nav .nav-item").mouseenter(function(){$(".dropdown-search").removeClass("show")})):n.type=="blur"&&$(".dropdown-search").removeClass("show")});$(".dropdown-search .btn-group-search-bar a").on("click",function(){changeSearchNav()});$("input[type=text].date").datepicker().on("changeDate",function(){$(this).next().hide().parent().removeClass("has-feedback")}).on("clearDate",function(){$(this).next().show().parent().addClass("has-feedback")});$(".nav-searchbar .listing-type-filter").focusout(function(n){var t=n.originalEvent.relatedTarget;if(t&&(t.className=="exchange"||t.className=="house"||t.className=="tenant"))return!1;$(this).removeClass("show");$(this).siblings(".dropdown-menu").first().removeClass("show")});$(".nav-searchbar .listing-type-filter").on("click",function(){$(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show");var n=$(this).next(".dropdown-menu");n.toggleClass("show");$(this).parents("li.nav-item.dropdown.show").on("hidden.bs.dropdown",function(){$("#navbarDropdown .show").removeClass("show")});return!1});$(".house, .exchange, .tenant").click(function(){var t=$(this).closest("form"),i,n,r;$(".listing-type-filter").find("li.active").removeClass("active");$(this).parent().addClass("active");$('.search-bar-settings .location input[name="SearchText"]').attr("placeholder","Your Destination");$(this).hasClass("house")?(t.find('input[name="ListingType"]').val("1"),i=1,n="Home Rental",$(".location-home").hide(),clearHomeInput(),$("input[name=SearchText]").attr("placeholder","Where would you like to go?"),$(".home .default-location-home").removeClass("col-md-6 col-lg-6").addClass("col-md-12 col-lg-12"),$(".nav-searchbar .btn-icon i, .mobile-menu .btn-icon i").removeClass().addClass("fas fa-home"),$(".nav-searchbar .default-location-home").removeClass("col-xl-3").addClass("col-xl-6"),$(".nav-searchbar .btn-text").text(n),$(".generic-search-bar .btn-icon i").removeClass().addClass("fas fa-home"),$(".generic-search-bar .btn-text").text(n),$(".generic-search-bar .search-text-autocomplete").attr("placeholder","City or University"),$(".generic-search-bar .search-text-label").text("Where would you like to go?")):$(this).hasClass("exchange")?(t.find('input[name="ListingType"]').val("2"),i=2,n="Home Exchange",$(".location-home").show(),$(".home .default-location-home").removeClass("col-md-12 col-lg-12").addClass("col-md-6 col-lg-6"),$(".home .default-location-home").length&&($("input[name=SearchText]").attr("placeholder","Where would you like to go?"),$("input[name=SearchTextHome]").attr("placeholder","Where are you coming from?")),$(".nav-searchbar .btn-icon i, .mobile-menu .btn-icon i").removeClass().addClass("fas fa-exchange"),$(".nav-searchbar .default-location-home").removeClass("col-xl-6").addClass("col-xl-3"),$(".nav-searchbar .btn-text").text(n),$(".generic-search-bar .btn-icon i").removeClass().addClass("fas fa-exchange"),$(".generic-search-bar .btn-text").text(n),$(".generic-search-bar .search-text-autocomplete").attr("placeholder","Your Destination"),$(".generic-search-bar .search-text-label").text("Where would you like to go?")):$(this).hasClass("tenant")&&(t.find('input[name="ListingType"]').val("4"),i=4,n="Tenant",$(".location-home").hide(),clearHomeInput(),$('.search-bar-settings .location input[name="SearchText"]').attr("placeholder","Where are you offering a home?"),$(".nav-searchbar .btn-icon i, .mobile-menu .btn-icon i").removeClass().addClass("fas fa-user"),$(".nav-searchbar .default-location-home").removeClass("col-xl-3").addClass("col-xl-6"),$(".nav-searchbar .btn-text").text(n),$(".generic-search-bar .btn-icon i").removeClass().addClass("fas fa-user"),$(".generic-search-bar .btn-text").text(n),$(".generic-search-bar .search-text-label").text("Where are you offering a home?"),$('.generic-search-bar .search-bar-settings .location input[name="SearchText"]').attr("placeholder","City or University"));t.find(".typeId").each(function(){$(this).prop("checked",!1)});r=t.find('.typeId[Value="'+i+'"]').first();r.prop("checked",!0);$(this).closest(".btn-group-search-bar").removeClass("show");$(this).closest(".btn-group-search-bar").find(".dropdown-menu").first().removeClass("show")})});$(".btn-group .dropdown-menu.multi a").click(function(){var u=$(this).data("value"),t,i,r,n;return $(this).find("span:first-child").removeClass("far"),$(this).find("span:first-child").addClass("fas"),$(this).next().prop("checked",!$(this).next().prop("checked")),$(this).closest(".btn-group").hasClass("btn-group-search-bar")?($(this).closest("ul").find("li a").each(function(){$(this).find("span:first-child").removeClass("fas").addClass("far");$(this).next().prop("checked",!1)}),$(this).next().prop("checked",!0),$(this).find("span:first-child").addClass("fas"),n=$(this).find(".filter-text").first().text(),$(this).closest(".btn-group").find(".btn-text").first().text(n)):(t=[],$(this).closest(".dropdown-menu").find("span:first-child").each(function(){$(this).hasClass("fas")&&t.push($(this).next().text())}),$(this).closest(".btn-group").find(".btn-text").first().text(t.join(", "))),i=$(this).closest(".btn-group"),i.hasClass("guests")&&(r=$("#guest-btn"),n=$(this).find(".filter-text").text(),r.html('<i class="fas fa-users"><\/i> '+n),$(this).closest(".dropdown-menu").removeClass("show"),$(this).closest(".form-group").removeClass("show")),!1});locationInput=document.getElementsByClassName("search-text-autocomplete"),function(n){var t={types:[],componentRestrictions:{country:[]}};Array.from(n).forEach(n=>{function r(t,i){if(t==="keydown"||t==="blur"){var r=i;i=function(i){var u=$(".pac-item-selected").first().length>0,f=i.keyCode||i.which,e;f!==13&&f!==9||u?t==="blur"&&!u:(e=$.Event("keydown",{keyCode:40,which:40}),r.apply(n,[e]));r.apply(n,[i])}}u.apply(n,[t,i])}var u=n.addEventListener?n.addEventListener:n.attachEvent,i;n.addEventListener=r;n.attachEvent=r;i=new google.maps.places.Autocomplete(n,t);i.setFields(["address_components","geometry","types","place_id"]);google.maps.event.addListener(i,"place_changed",function(){var n=i.getPlace(),u=n.address_components,t,r;$(u).each(function(){this.types[0]==="locality"&&(searchCity=this.long_name);this.types[0]==="administrative_area_level_1"&&(searchState=this.short_name);this.types[0]==="country"&&(searchCountry=this.short_name)});n.geometry;t=Math.round(n.geometry.location.lat()*1e6)/1e6;r=Math.round(n.geometry.location.lng()*1e6)/1e6;$('input[name="Lat"]').val(t);$('input[name="Lng"]').val(r);$('input[name="PlaceIdSearch"]').val(n.place_id)})})}(locationInput);var locationInputHome=document.getElementsByClassName("search-text-autocomplete-home")[0],locationInputHome1=document.getElementsByClassName("search-text-autocomplete-home")[1],locationInputHome2=document.getElementsByClassName("search-text-autocomplete-home")[2];locationInputHome&&function(n){function r(t,r){if(t==="keydown"||t==="blur"){var u=r;r=function(i){var r=$(".pac-item-selected").first().length>0,f=i.keyCode||i.which,e;f!==13&&f!==9||r?t==="blur"&&!r:(e=$.Event("keydown",{keyCode:40,which:40}),u.apply(n,[e]));u.apply(n,[i])}}i.apply(n,[t,r])}var i,t;n&&(i=n.addEventListener?n.addEventListener:n.attachEvent,n.addEventListener=r,n.attachEvent=r,t=new google.maps.places.Autocomplete(n,{types:[],componentRestrictions:{country:[]}}),t.setFields(["address_components","geometry","types","place_id"]),google.maps.event.addListener(t,"place_changed",function(){var n=t.getPlace(),u=n.address_components,i,r;$(u).each(function(){this.types[0]==="locality"&&(searchCity=this.long_name);this.types[0]==="administrative_area_level_1"&&(searchState=this.short_name);this.types[0]==="country"&&(searchCountry=this.short_name)});i=Math.round(n.geometry.location.lat()*1e6)/1e6;r=Math.round(n.geometry.location.lng()*1e6)/1e6;$('input[name="LatHome"]').val(i);$('input[name="LngHome"]').val(r);$('input[name="PlaceIdHome"]').val(n.place_id);updateExchangeInMyAreaLabel()}))}(locationInputHome);locationInputHome1&&function(n){function r(t,r){if(t==="keydown"||t==="blur"){var u=r;r=function(i){var r=$(".pac-item-selected").first().length>0,f=i.keyCode||i.which,e;f!==13&&f!==9||r?t==="blur"&&!r:(e=$.Event("keydown",{keyCode:40,which:40}),u.apply(n,[e]));u.apply(n,[i])}}i.apply(n,[t,r])}var i,t;n&&(i=n.addEventListener?n.addEventListener:n.attachEvent,n.addEventListener=r,n.attachEvent=r,t=new google.maps.places.Autocomplete(n,{types:[],componentRestrictions:{country:[]}}),t.setFields(["address_components","geometry","types","place_id"]),google.maps.event.addListener(t,"place_changed",function(){var n=t.getPlace(),u=n.address_components,i,r;$(u).each(function(){this.types[0]==="locality"&&(searchCity=this.long_name);this.types[0]==="administrative_area_level_1"&&(searchState=this.short_name);this.types[0]==="country"&&(searchCountry=this.short_name)});i=Math.round(n.geometry.location.lat()*1e6)/1e6;r=Math.round(n.geometry.location.lng()*1e6)/1e6;$('input[name="LatHome"]').val(i);$('input[name="LngHome"]').val(r);$('input[name="PlaceIdHome"]').val(n.place_id);updateExchangeInMyAreaLabel()}))}(locationInputHome1);locationInputHome2&&function(n){function r(t,r){if(t==="keydown"||t==="blur"){var u=r;r=function(i){var r=$(".pac-item-selected").first().length>0,f=i.keyCode||i.which,e;f!==13&&f!==9||r?t==="blur"&&!r:(e=$.Event("keydown",{keyCode:40,which:40}),u.apply(n,[e]));u.apply(n,[i])}}i.apply(n,[t,r])}var i,t;n&&(i=n.addEventListener?n.addEventListener:n.attachEvent,n.addEventListener=r,n.attachEvent=r,t=new google.maps.places.Autocomplete(n,{types:[],componentRestrictions:{country:[]}}),t.setFields(["address_components","geometry","types","place_id"]),google.maps.event.addListener(t,"place_changed",function(){var n=t.getPlace(),u=n.address_components,i,r;$(u).each(function(){this.types[0]==="locality"&&(searchCity=this.long_name);this.types[0]==="administrative_area_level_1"&&(searchState=this.short_name);this.types[0]==="country"&&(searchCountry=this.short_name)});i=Math.round(n.geometry.location.lat()*1e6)/1e6;r=Math.round(n.geometry.location.lng()*1e6)/1e6;$('input[name="LatHome"]').val(i);$('input[name="LngHome"]').val(r);$('input[name="PlaceIdHome"]').val(n.place_id);updateExchangeInMyAreaLabel()}))}(locationInputHome2)