MyLife Recovery Centers Open House

Up Ribbon: OPEN HOUSE
950) { $info.addClass('col-lg-3'); } var store = window.localStorage; var key = "5-list-view"; var printKey = "24-list-view"; $('.gz-view-btn').click(function (e) { e.preventDefault(); $('.gz-view-btn').removeClass('active'); $(this).addClass('active'); if ($(this).hasClass('gz-list-view')) { store.setItem(key, true); store.setItem(printKey, true); $('.gz-list-card-wrapper').removeClass('col-sm-6 col-md-4').addClass('gz-list-col'); } else { store.setItem(key, false); store.setItem(printKey, false); $('.gz-list-card-wrapper').addClass('col-sm-6 col-md-4').removeClass('gz-list-col'); } }); var isListView = store.getItem(key) == null ? MNI.DEFAULT_LISTING : store.getItem(key) == "true"; if (isListView) $('.gz-view-btn.gz-list-view').click(); store.setItem(printKey, isListView); MNI.LayoutResolution(); (function ($modal) { if ($modal[0]) { $('#gz-info-contactfriend').on('shown.bs.modal', function (e) { $modal.css('max-height', $(window).height() + 'px'); $modal.addClass('isLoading'); $.ajax({ url: MNI.BaseUrl + '/inforeq/contactFriend?itemType='+MNI.ITEM_TYPE+'&itemId='+MNI.ITEM_ID }) .then(function (r) { $modal.find('.modal-body') .html($.parseHTML(r.Html)); $modal.removeClass('isLoading'); $('#gz-info-contactfriend').addClass('in'); $.getScript("https://www.google.com/recaptcha/api.js"); }); }); $('#gz-info-contactfriend .send-btn').click(function () { var $form = $modal.find('form'); $modal.addClass('isLoading'); $.ajax({ url: $form.attr('action'), type: 'POST', data: $form.serialize(), dataType: 'json' }).then(function (r) { if (r.Success) $('#gz-info-contactfriend').modal('hide'); else $modal.find('.modal-body').html($.parseHTML(r.Html)); $.getScript("https://www.google.com/recaptcha/api.js"); $modal.removeClass('isLoading'); }); }); } })($('#gz-info-contactfriend .modal-content')); (function ($modal) { if ($modal[0]) { $('#gz-info-subscribe').on('shown.bs.modal', function (e) { $('#gz-info-subscribe .send-btn').show(); $modal.addClass('isLoading'); $.ajax({ url: MNI.SUBSCRIBE_URL }) .then(function (r) { $modal.find('.modal-body') .html(r); $modal.removeClass('isLoading'); }); }); $('#gz-info-subscribe .send-btn').click(function () { var $form = $modal.find('form'); $modal.addClass('isLoading'); waitForGrecaptcha(() => { setReCaptchaToken($form, () => { $.ajax({ url: $form.attr('action'), type: 'POST', data: $form.serialize() }).then(function (r) { if (r.toLowerCase().search('thank you') != -1) { $('#gz-info-subscribe .send-btn').hide(); } $modal.find('.modal-body').html(r); $modal.removeClass('isLoading'); }); }, "hotDealsSubscribe"); }) }); } })($('#gz-info-subscribe .modal-content')); (function ($modal) { $('#gz-info-calendarformat').on('shown.bs.modal', function (e) { var backdropElem = "

"; $('#gz-info-calendarformat').addClass('in'); if (!($('#gz-info-calendarformat .modal-backdrop').length)) { $('#gz-info-calendarformat').prepend(backdropElem); } else { $('#gz-info-calendarformat .modal-backdrop').addClass('in'); } }); $('#gz-info-calendarformat').on('hidden.bs.modal', function (e) { $('#gz-info-calendarformat').removeClass('in'); $('#gz-info-calendarformat .modal-backdrop').remove(); }); if ($modal[0]) { $('.calendarLink').click(function (e) { $('#gz-info-calendarformat').modal('hide'); }); } })($('#gz-info-calendarformat .modal-content')); // Constructs the Find Members type ahead suggestion engine. Tokenizes on the Name item in the remote return object. Case Sensitive usage. var members = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: MNI.BaseUrl + '/list/find?q=%searchTerm', wildcard: '%searchTerm', replace: function () { var q = MNI.BaseUrl + '/list/find?q=' + encodeURIComponent($('.gz-search-keyword').val()); var categoryId = $('#catgId').val(); var quickLinkId = $('#qlId').val(); if (categoryId) { q += "&catgId=" + encodeURIComponent(categoryId); } if (quickLinkId) { q += "&qlid=" + encodeURIComponent(quickLinkId); } return q; } } }); // Initializing the typeahead using the Bloodhound remote dataset. Display the Name and Type from the dataset via the suggestion template. Case sensitive. $('.member-typeahead').typeahead({ hint: false, }, { display: 'Name', source: members, limit: Infinity, templates: { suggestion: function (data) { return '
' + data.Name + '
' + data.Type + '
' } } }); $('.member-typeahead').on('typeahead:selected', function (evt, item) { var openInNewWindow = MNI.Page.MemberPagePopup var doAction = openInNewWindow ? MNI.openNewWindow : MNI.redirectTo; switch (item.ResultType) { case 1: // AutocompleteSearchResultType.Category doAction(MNI.Path.Category(item.SlugWithID)); break; case 2: // AutocompleteSearchResultType.QuickLink doAction(MNI.Path.QuickLink(item.SlugWithID)); break; case 3: // AutocompleteSearchResultType.Member if (item.MemberPageAction == 1) { MNI.logHitStat("mbrws", item.ID).then(function () { var location = item.WebParticipation < 10 ? MNI.Path.MemberKeywordSearch(item.Name) : MNI.Path.Member(item.SlugWithID); doAction(location); }); } else { var location = item.WebParticipation < 10 ? MNI.Path.MemberKeywordSearch(item.Name) : MNI.Path.Member(item.SlugWithID); doAction(location); } break; } }) $('#category-select').change(function () { // Store the category ID in a hidden field so the remote fetch can use it when necessary var categoryId = $('#category-select option:selected').val(); $('#catgId').val(categoryId); // Don't rely on prior locally cached data when the category is changed. $('.member-typeahead').typeahead('destroy'); $('.member-typeahead').typeahead({ hint: false, }, { display: 'Name', source: members, limit: Infinity, templates: { suggestion: function (data) { return '
' + data.Name + '
' + data.Type + '
' } } }); }); MNI.Plugins.AutoComplete.Init('#mn-search-geoip input', { path: '/' + MNI.MemberFilterUrl + '/find-geographic' }); }); })(MNI.jQuery);