';
suggestionHtml = suggestionHtml + '';
suggestionHtml = suggestionHtml + '
';
return suggestionHtml;
},
onSelect: function(suggestion) {
openUrl('/map/#lat=' + suggestion.data.lat + '&lng=' + suggestion.data.lng + '&zoom=' + suggestion.data.zoom);
},
onSearchStart: function(query) {
$('#location-suggestions').hide();
$('#searchbox-icon-div').show();
},
onSearchComplete: function(query, suggestions) {
// Optionally handle search completion
}
};
//explore peaks search
$('#explore-peaks').autocomplete(autocompleteOptions);
var summitLinks = [];
function getMobileOperatingSystem() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
// Windows Phone must come first because its UA also contains "Android"
if (/windows phone/i.test(userAgent)) {
return "Windows Phone";
}
if (/android/i.test(userAgent)) {
return "Android";
}
// iOS detection from: http://stackoverflow.com/a/9039885/177710
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "iOS";
}
if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform)) {
return "iOS";
}
return "unknown";
}
$(document).ready(function() {
var temp = getMobileOperatingSystem();
if (temp == 'iOS') {
$('#btnGetTheAppMobile').attr('src','https://peakery-static.s3.amazonaws.com/img/peakery-apple-app-store.png');
$('#btnGetTheAppLinkMobile').attr('href','https://apps.apple.com/us/app/peakery/id1550210398');
$('#log-summits-image-mobile').show();
} else if (temp == 'Android') {
$('#btnGetTheAppMobile').attr('src','https://peakery-static.s3.amazonaws.com/img/peakery-google-play.png');
$('#btnGetTheAppLinkMobile').attr('href','https://play.google.com/store/apps/details?id=com.peakery.android');
$('#log-summits-image-mobile').show();
} else {
$('#btnGetTheApp').attr('src','https://peakery-static.s3.amazonaws.com/img/peakery-QR-code%402x.png');
$('#log-summits-image').show();
}
summitLinks[0] = '/mount-sanitas-colorado/';
summitLinks[1] = '/mummys-toe-nevada/';
summitLinks[2] = '/north-sister-nevada/';
summitLinks[3] = '/black-sister-nevada/';
summitLinks[4] = '/table-mountain-new-hampshire/';
$('#btnGooglePlay').on('click', function(e) {
window.location.href = 'https://play.google.com/store/apps/details?id=com.peakery.android&utm_source=peakery_web&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1';
e.stopPropagation();
});
$('#slideshow').cycle({
fx: 'fade',
timeout: 3000
});
$('#slideshow').css('position', 'initial');
if ($(window).width() > 768) {
//$('#slideshow').children().css('background-position', 'center -200px');
}
$('#explore-peaks').focus(function() {
var top = $('#explore-peaks').offset().top;
top += 20;
$('#location-suggestions').css({top: top+'px'});
$('#location-suggestions').show();
$('#searchbox-text').hide();
});
$('#searchbox-icon').click(function() {
$('#explore-peaks').autocomplete().disable();
$('#explore-peaks').val('');
$('#searchbox-icon-div').hide();
$('#searchbox-text').show();
});
$('#searchbox-text').click(function() {
$('#explore-peaks').val('');
$('#searchbox-icon-div').hide();
$('#searchbox-text').hide();
$('#explore-peaks').focus();
});
$('#main-caption').click(function() {
if ($(window).width() ' + countryval.country_name + '';
});
if (country == '') {
country = 'Unknown Country';
}
//build region string
var region = '';
var mobile_region = '';
var region_bull_class = 'hidden-lg hidden-md hidden-sm hidden-xs';
$.each(peakval.region, function (regionkey, regionval) {
region_bull_class = '';
region = region + '';
mobile_region = '';
});
if (region == '') {
region = country;
mobile_region = country;
}
//build challenges string
var challenges = '';
var challenge_count = peakval.challenge_count;
if (challenge_count > 0) {
challenges = ' • ' + challenge_count + ' ';
}
//buld distance string
var distance = '';
//build summits string
var summits, tooltip_your_summits;
if (peakval.summit_count > 0) {
summits = '' + peakval.summit_count + '';
} else {
summits = '0Be the first!'; } if (peakval.your_summits > 0) { summits = summits + '
' + peakval.your_summits + 'x by you'; tooltip_your_summits = ' (You ' + peakval.your_summits + 'x)'; } else { tooltip_your_summits = ''; } //show tooltip badges? var showClassic = 'display: none;'; var showChallenges = 'display: none;'; var showYourSummits = 'display: none;'; if (peakval.is_classic == 'True') { showClassic = ''; } if (peakval.challenge_count > 0) { showChallenges = ''; } if (peakval.your_summits > 0) { showYourSummits = ''; } peaklist_html = ''; //show feet or meters? var showFeet = 'display: none;'; var showMeters = 'display: none;'; if ($('#bt_showinmeters').hasClass('meters')) { showMeters = ''; } else { showFeet = ''; } //build peaklist_html string peaklist_html = '
CLASSIC
' + peakval.challenge_count + ' CHALLENGE' + ((peakval.challenge_count != 1) ? 'S' : '') + ' ' + peakval.your_summits + 'x

Search for a location


