'; html += '
'; html += '
'; if (result.sectionTitle) {html += '

' + result.sectionTitle + '

';} html += '
'; if (result.title) { var classDis = 'distribuidor-title'; html += '
'; if (result.linkUrl) {html += '';} html += '

' + result.title + '

'; if (result.linkUrl) {html += '
';} html += '
'; } if (result.text) {html += '
' + result.text + '
';} if ((result.linkUrl)&&(result.linkText)) {html += '' + result.linkText + '';} html += '
'; html += '
'; } else if (result.displayMode === 'right') { section.setAttribute('class', ' '); section.setAttribute('id', '_BasicDistributor_INSTANCE_wbDQr50NRE6t_' + result.anchor); html += '
'; } section.innerHTML = html; parentSectionsDiv.append(section); } _BasicDistributor_INSTANCE_wbDQr50NRE6t_getBackgroundJs(_BasicDistributor_INSTANCE_wbDQr50NRE6t_basicDistributorImages); } } _BasicDistributor_INSTANCE_wbDQr50NRE6t_wrapperTextSanitana(); }); } } function _BasicDistributor_INSTANCE_wbDQr50NRE6t_getBackgroundJs(basicDistributorImages) { $.each(basicDistributorImages, function(key, value) {$('.' + key).css('background-image', 'url("' + value + '")');}); } function getCurrentPositionRoute(element) { var userLatitude = 41.3851; var userLongitude = 2.1734; if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { userLatitude = position.coords.latitude; userLongitude = position.coords.longitude; setLocationRoute(element, userLatitude, userLongitude); }, setLocationRoute(element, userLatitude, userLongitude)); } } function setLocationRoute(element, userLatitude, userLongitude){ var loc_route = 'https://www.google.com/maps/dir/?api=1&origin=' + userLatitude + ',' + userLongitude + '&destination=' + element.attr('data-latitude') + ',' + element.attr('data-longitude'); element.attr('href', loc_route); } function pauseVideo(videoId) { var videoUrl = $("#iframe" + videoId).attr("src"); $("#iframe" + videoId).attr("src", videoUrl); } // Nos aseguramos el wrapper-text en sanitana function _BasicDistributor_INSTANCE_wbDQr50NRE6t_wrapperTextSanitana() { var isSanitana = "false"; if (isSanitana) { var $distribuidor = $('.distribuidor-texto'); $distribuidor.each(function () { var $this = $(this); var $firstChild = $this.children().first(); var hasWrapper = $firstChild.hasClass('wrapper-text'); if (!hasWrapper) { var innerContent = $this.html(); $this.html('
' + innerContent + '
'); } }); } }