'); scope.find('.bigSubmenu').prepend(divGray); divGray.css({width:widthElem, height: menuHeight + 20}) }else{ scope.find('.grayColor').css({width:widthElem, height: menuHeight + 20}) } scope.find('.bigSubmenu').height(menuHeight + 20); scope.find('.bigSubOptions').height(menuHeight + 20); scope.find('.menuOpContainer').height(optionHeight + 20); if(subOptions){ subOptions.each(function(index) { var subScope = $(this) subScope.find('.menuOpContainer').css('marginTop','-' + (subScope.position().top+5) + 'px'); }); } }); } } /*Without elements*/ var indUl = $('.singleDropDown'); indUl.each(function(){ var indLi = $(this).find('li'); if(indLi.length == 1 && indLi.find('a').text() == ""){ $(this).removeClass('singleDropDown'); } }) var addMenu = function(){ $('.addResponsive').remove(); $('.addMenu > a').each(function(i){ var containerAdd = $('
') var anchorL = $(''); var contenidoAn = $(this).text(); anchorL.text(contenidoAn); containerAdd.append(anchorL); $('.ulMenu').append(containerAdd); }) } $('.ulMenu > li').on('mouseenter', function(){ if($('body').hasClass('mobileV') == false ){ $('.bigSubOptions li:first-child').find('.menuOpContainer').css('display','inline-block'); }else{ /*$('.bigSubOptions li:first-child').find('.menuOpContainer').css('display','none');*/ } }) /*TIMING LATERAL MENU NOT CLOSE INMMEDIATLY*/ function hoveringMenu(){ $('.bigSubOptions > li').unbind('mouseenter') $('.bigSubOptions > li').unbind('mouseleave') $('.bigSubOptions > li').mouseenter(function(){ //console.log('entro') $('.bigSubOptions > li').find('.menuOpContainer').hide(); clearTimeout($(this).data('timeout')); $(this).find('.menuOpContainer').css('display','inline-block') }).mouseleave(function(){ var scope = $(this); var timing = setTimeout(function(){ scope.find('.menuOpContainer').hide() //console.log('salgo'); }, 1000) $(this).data('timeout', timing); }); } //hoveringMenu(); menuResponsive(); menuHeighting(); /*Select op*/ var winLocation = window.location.href; var winPrelast = winLocation.split('/'); $('.ulMenu li').find('a').each(function(e){ var scope = $(this); var link = scope.attr('href'); if(link != undefined){ link = link.split('/') if(link[link.length - 1] != ""){ if(link[link.length - 1] == winPrelast[winPrelast.length - 1]){ scope.closest('.firstLevel').addClass('selected'); } } } }); /*Menu hogar negocio empresa select - 240808 @AB */ const familyAnchor = $('.familyMenu a'); let currentSiteId = null; switch (winPrelast[winPrelast.indexOf("web") + 1]) { case "hogar": currentSiteId = 0; break; case "negocios": currentSiteId = 1; break; case "empresas": currentSiteId = 2; break; } if (currentSiteId != null) familyAnchor.eq(currentSiteId).addClass("current"); })$('.ulMenu > li ').each(function(){ var anclaVal = $(this).find('a').text(); if(anclaVal == 'Cámbiate a Telmex'){ $(this).find('a').addClass('azul1'); } });
";if(terminos=="na"||shortText==0||shortText=="0"){var c="
"+shortText+"
"+largeText+"
"}}else{var c="
";if(terminos=="na"||shortText==0||shortText=="0"){var c="
"}}switch(ipn){case"TMX_IP_TELMEXCOM_CHOME":terminos=(terminos!="na")?terminos:"";var e="";if(textoBoton!="na"){e=""+textoBoton+""}var c="
";$(".numBanner_1").empty();$(".numBanner_1").html(c);break;case"TMX_IP_TELMEXCOM_LMITMX":terminos=(terminos!="na")?terminos:"";var e="";if(textoBoton!="na"){e=""+textoBoton+""}var c="
";$(".numBanner_0").empty();$(".numBanner_0").html(c);break;case"TMX_IP_TELMEXCOM_LSVA_CV":var c="
';$("#div_valoresAgrega_1").html(c);$("#div_valoresAgrega_1").css("opacity","1");break;case"TMX_IP_TELMEXCOM_LSVA_CD":var c="
';$("#div_valoresAgrega_2").html(c);$("#div_valoresAgrega_2").css("opacity","1");break;case"TMX_IP_TELMEXCOM_LSVA_SC":$("#div_interactCarrusel_"+l).append("");$("#interactBtnSup_"+l).attr("rel",g);$("#interactBtnSup_"+l).attr("onclick","offerClic(this)");break;case"TMX_IP_TELMEXCOM_LSVA_CC":$("#div_interactCarruselInf_"+l).append("");$("#interactBtnInf_"+l).attr("rel",g);$("#interactBtnInf_"+l).attr("onclick","offerClic(this)");break}if(l=="2.0"||l=="2"){$("#div_interact_2").html(c);$("#div_interact_2").css("opacity","1");dataLayer.push({event:"addevent","macro-page":"Interact Home 2","event-value":j})}if(l=="3.0"||l=="3"){$("#div_interact_3").html(c);$("#div_interact_3").css("opacity","1");dataLayer.push({event:"addevent","macro-page":"Interact Home 3","event-value":j})}var b=getFullPath("");if(b.pathname=="/web/hogar/landing-wifi"){if(l=="1.0"||l=="1"){var f="
"+largeText+" "+shortText+' '+terminos+"
";var d="";$(".interactBanner").html(f);$(".interactImageBanner").html(d)}if(l=="2.0"||l=="2"){var c="
";$(".interactDiv_1").html(c)}}if(j!=""&&g!=""){var a=createPostEventRequestTypeJson(o,"OfferContact",j,g);GetPromiseFn(postEvent,"POST",a,true)}}function crearCookieInteract(a,b){expires=new Date();expires.setTime(expires.getTime()+1750000);document.cookie=a+"="+b+";Secure;expires="+expires.toGMTString()}function leerCookie(a){keyValue=document.cookie.match("(^|;) ?"+a+"=([^;]*)(;|$)");if(keyValue){var b=keyValue[2];if(b.substr(b.length-1)=="="){b=enco*k(b,"d")}return b}else{return null}}function createStartSessionResponseTypeJson(c,e){var d=createAttribute("searchString","internet",null,null);var b=createAttribute("TimeStamp",null,1,null);var h=createAttribute("CustomerId",null,1,null);var a={};a.telephoneNumber=c;a.anonymousID=e;var g={};g.sessionID=null;g.channel="TMX_IC_WEB";g.sessionAttributes=[];var f={channelSession:g,idUser:a};return JSON.stringify(f)}function createIdentifyCustomerRequestTypeJson(d,b){var f=d;var a={};a.telephoneNumber=b;a.anonymousID=null;var c=createAttribute("CustomerId",null,1,null);var e={interactIdsession:f,idUser:a};return JSON.stringify(e)}function createPostEventRequestTypeJson(l,g,f,d){var b=l;var i={};var e="NA";i.eventName=g;i.offerCode=f;i.offerTrackingCode=d;if(g=="Navigation"){var k="";var a=getFullPath("");switch(a.pathname){case"/web/hogar/tomapedidos":var h=getParameter("paq",a);if(h=="389"){k="TC_PI_389"}if(h=="599"){k="TC_PI_599"}if(h=="699"){k="TC_PI_699"}break;case"/web/hogar/conexion-a-internet":k="TC_SERV_PI";break;case"/web/hogar/aumenta-tu-velocidad":k="TC_SERV_AV";break;case"/web/hogar/internet-banda-ancha":k="TC_SERV_SI";break;case"/web/hogar/claro-video":k="TC_SERV_CV";break;case"/web/hogar/valores-infinitum":k="TC_SERV_VI";break;case"/web/hogar/energia-solar":k="TC_ENERGIA_SOLAR";break;case"/web/hogar/fox":k="TC_SERV_CVFOX";break;case"/web/hogar/conexion-internet":k="TC_SERV_INT_IP";break;case"/web/hogar/wifi-movil":k="TC_SERV_INT_WIFI";break;case"/web/hogar/portabilidad-requisitos":k="TC_SERV_VOZ_CAMB";break;case"/web/hogar/fox-premium-app-tv":k="TC_CV_FOX";break;case"/web/hogar/linea-de-credito-personal":k="TC_SERV_TERC_CI";break;case"/web/hogar/valida-telefono":k="TC_SERV_CI_VELOCIDAD";break;case"/web/hogar/credito-telmex":k="TC_SERV_CI_CREDITO";break;case"/web/hogar/antivirusintelsecurity":k="TC_VI_PROT_ANTIVIRUS";break;case"/web/hogar/dropbox-infinitum":k="TC_VI_COM_DROPBOX";break;case"/web/hogar/infinitum-mail":k="TC_VI_COM_MAIL";break;case"/web/asistencia/hogar-internet":k="TC_ASIST_INTERNET";break;case"/web/asistencia/hogar-servicios-de-voz":k="TC_ASIST_SERVICIOSVOZ";break;case"/web/asistencia/hogar-servicios-de-valor-agregado":k="TC_ASIST_VALORES";break;case"/web/asistencia/hogar-mi-telmex":k="TC_ASIST_SERVICIOSLINEA";break;case"/web/hogar/valores-nuevo":k="TC_SERV_VI";break}if(k!==""){i.eventAttributes=[createAttribute("IC_WEBSECTION",k,null,null)]}else{return""}}else{var c="RESPONSECHANNEL";switch(g){case"OfferContact":c="CONTACTCHANNEL";break;case"OfferClick":e="LCL";break;case"OfferAccept":e="CMT";break}i.eventAttributes=[createAttribute(c,"TELMEX.COM",null,null)];var a=getFullPath("");if(a.pathname=="/web/hogar/mi-telmex"){i.eventAttributes=[createAttribute(c,"TELMEX.COM_LMITMX",null,null)]}if(a.pathname=="/web/hogar/landing-wifi"){i.eventAttributes=[createAttribute(c,"LANDING CAIDA WIFI",null,null)]}if(a.pathname=="/web/hogar/valores-nuevo"){i.eventAttributes=[createAttribute(c,"TELMEX.COM_LSVA",null,null)]}if(a.pathname=="/agenda-fibra-optica-360"){i.offerCode=getParameter("offerCode",a);b=getParameter("idSession",a);i.eventAttributes=[createAttribute(c,"PISA_CRM",null,null),createAttribute("DESCRIPCION_OC",enco*k(getParameter("officeName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("DIVISION",enco*k(getParameter("dv",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("AREA",enco*k(getParameter("ar",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("IP_PISA",enco*k(getParameter("ipUser",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("USUARIO_PISA",enco*k(getParameter("userName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("NOMBREUSUARIO_PISA",enco*k(getParameter("fullName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("SIGLAS_OC",enco*k(getParameter("acronymO",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("SIGLAS_PISA",enco*k(getParameter("acronymP",a).replace("\u0000\u0000","").replace("\u0000",""),"d"),null,null)]}if(a.pathname=="/claro-drive-oferta-ideal-confirma"){i.offerCode=getParameter("offerCode",a);b=getParameter("idSession",a);i.eventAttributes=[createAttribute(c,"PISA_CRM",null,null),createAttribute("DESCRIPCION_OC",enco*k(getParameter("officeName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("DIVISION",enco*k(getParameter("dv",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("AREA",enco*k(getParameter("ar",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("IP_PISA",enco*k(getParameter("ipUser",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("USUARIO_PISA",enco*k(getParameter("userName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("NOMBREUSUARIO_PISA",enco*k(getParameter("fullName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("SIGLAS_OC",enco*k(getParameter("acronymO",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("SIGLAS_PISA",enco*k(getParameter("acronymP",a).replace("\u0000\u0000","").replace("\u0000",""),"d"),null,null)]}if(a.pathname=="/activaciones-claro-resumen"){i.offerCode=getParameter("offerCode",a);b=getParameter("idSession",a);i.eventAttributes=[createAttribute(c,"PISA_CRM",null,null),createAttribute("DESCRIPCION_OC",enco*k(getParameter("officeName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("DIVISION",enco*k(getParameter("dv",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("AREA",enco*k(getParameter("ar",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("IP_PISA",enco*k(getParameter("ipUser",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("USUARIO_PISA",enco*k(getParameter("userName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("NOMBREUSUARIO_PISA",enco*k(getParameter("fullName",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("SIGLAS_OC",enco*k(getParameter("acronymO",a),"d").replace("\u0000\u0000","").replace("\u0000",""),null,null),createAttribute("SIGLAS_PISA",enco*k(getParameter("acronymP",a).replace("\u0000\u0000","").replace("\u0000",""),"d"),null,null)]}}var j={interactIdsession:b,eventRequest:i,responseType:e};return JSON.stringify(j)}function getFullPath(a){var b=document.createElement("a");if(a!=""){b.href=a}else{b.href=window.location.href}return b}function getParameter(c,a){var e=a.search.substr(1).split("&");for(var b=0;b
') sugerenciasList.append(sugerencia); } sugerenciasBox.append(sugerenciasList); if(window.location.toString().indexOf('buscador') != -1){ $formValue.closest('form').parent().append(sugerenciasBox); }else{ $('.searchContainer').append(sugerenciasBox); } } $('.sugerencia').on('click', function(e){ e.preventDefault(); $('.sugerenciasBox').parent().find('input[type="text"]').val($(this).text()); $('.sugerenciasBox').parent().find('input[type="submit"]').trigger('click'); }) }) .fail(function(){ console.log('servicio no disponible'); }); } $('input.inputSearch').keyup(function(e){ var scope = $(this); var suggestOp = $('.sugerenciasBox li'); var itemSelected = suggestOp.filter('.selected'); var current; if (e.keyCode === 27){/*Esc*/ $('.sugerenciasBox').remove(); }else if(e.keyCode === 40){ /*Abajo*/ if($('.sugerenciasBox')){ if(itemSelected.length == 0 || itemSelected.is(':last-child')){ current = suggestOp.eq(0); }else{ current = itemSelected.next(); } } }else if(e.keyCode === 38){/*Arriba*/ if(itemSelected.length == 0 || itemSelected.is(':first-child')){ current = suggestOp.last(); }else{ current = itemSelected.prev(); } }else{ showSuggestions($(this), '_nuevo_telmex_todo') } if(current != undefined){ itemSelected.removeClass('selected'); current.addClass('selected'); scope.val(current.text()); } }) function clientCall($sitesValue){ switch($sitesValue) { case "claves_lada": clientValue = "_nuevo_telmex_claves_lada"; break; case "telmex_hogar|telmex_negocio|telmex_empresa": case "asistencia": case "telmex_tienda": default: clientValue = "_nuevo_telmex_todo"; break; } return clientValue; } function buscador(){ $('.sugerenciasBox').remove(); if($('#contenedor_resultados ol').length > 0){ $('.moreElem').show(); var placeContainer = $('.placeCont'); var parentLi = $('.placeCont').first().parent(); var latThis = Number(parentLi.find('.lat').text()); var lngThis = Number(parentLi.find('.long').text()); /*if it has map*/ if(placeContainer.length > 0){ boxPortlet.show(); var markerLetter = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26']; var pinColorBlue = "|0f79ff|ffffff"; var pinColorRed = "|f7544c|000000"; var mapOptions = { zoom: 16, center: { lat: latThis, lng: lngThis } }; var map = new google.maps.Map(boxPortlet[0], mapOptions); var bounds = new google.maps.LatLngBounds(); var infoWindow = new google.maps.InfoWindow(); var infoWindowsArr =[]; $('.tiendas_fisicas').first().prepend('Tiendas Telmex'); $('.sitios_wifi').first().prepend('Sitios Wifi'); /*Creating marks for every place*/ $('.placeCont').each(function(index){ var markLatlng = new google.maps.LatLng( $(this).parent().find('.lat').text(), $(this).parent().find('.long').text() ); marker = new google.maps.Marker({ position: markLatlng, map: map }); infoWindowsArr.push(detailStore($(this).parent())); marker.setOptions({icon: 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=' + markerLetter[index] + pinColorRed}); google.maps.event.addListener(marker, 'click', (function(marker, index){ return function(){ infoWindow.setContent(infoWindowsArr[index]); infoWindow.open(map, marker); }; })(marker, index)); bounds.extend(markLatlng); }) map.fitBounds(bounds); } }else{ console.log('no hay resultados'); $('.moreElem').hide(); } } function loadScript($textValue) { if(isMap == false){ /*var apiKey = "https://maps.googleapis.com/maps/api/js?key=AIzaSyDYOdEf18BjovQEyzpg1EZ7im_hOAFlLuU";*/ var apiKey = 'https://maps.googleapis.com/maps/api/js?client=gme-telefonosdemexico&sensor=true&'; var script = document.createElement('script'); script.type = 'text/javascript'; script.onload = function(){ buscador(); } script.src = apiKey; document.body.appendChild(script); isMap = true; }else{ if(actualSearch != previousSearch){ buscador(); } }; var textValue = $textValue; previousSearch = textValue; } /*Create de div with the store info*/ function detailStore($store){ var storeInfo = $('
'); title.text($store.find('.nombre').text()); address.find('span').text($store.find('.texto-original').text()); var horarioSem = $store.find('.horarioSem').text(); var horarioSab = $store.find('.horarioSab').text(); var cp = $store.find('.cp').text(); var autoSem = $store.find('.horarioAuto1').text(); var autorSab = $store.find('.horarioAuto2').text(); var textDir = ""; var textSchedule = ""; var textAutopago = ""; var textCajero = ""; phone.find('span').text($store.find('.telefono').text()); var nombredeTienda = $store.find('.nombreTienda').text(); var textoOriginal = $store.find('.texto-original').text(); var elTelefono = $store.find('.telefono').text(); var cajero = $store.find('.cajero').text(); var scCajero = $store.find('.horarioCajero').text(); if(jQuery.trim(nombredeTienda) != 'null' && nombredeTienda != ''){ storeInfo.append(title); } if(jQuery.trim(textoOriginal) != 'null' && textoOriginal != ''){ textDir = textoOriginal; storeInfo.append(address); } if(jQuery.trim(cp) != 'null' && cp != ''){ textDir = textDir + ' CP' + cp; } address.find('span').text(textDir); /*CAMBIOS PARA MOSTRAR HORARIOS EN BUEN FIN */ elTelefono=jQuery.trim(elTelefono); if(elTelefono == "" || elTelefono == "null" || elTelefono == null){ if(jQuery.trim(horarioSem) != 'null' && horarioSem !=''){ textSchedule = horarioSem; storeInfo.append(schedule); } if(jQuery.trim(horarioSab) != 'null' && horarioSab !=''){ textSchedule = textSchedule + ' ' + horarioSab; } schedule.find('span').text(textSchedule); }else{ storeInfo.append(phone); } if(jQuery.trim(autoSem) != 'null' && autoSem !='' && autoSem != "Servicio NO disponible"){ textAutopago = autoSem; storeInfo.append(scheduleAuto); } if(jQuery.trim(autorSab) != 'null' && autorSab !=''){ textAutopago = textAutopago + ' ' + autorSab; } scheduleAuto.find('span').text(textAutopago); if(jQuery.trim(cajero) != 'null' && jQuery.trim(cajero) == '1'){ storeInfo.append(services); textCajero = "Cajero automático" } if(jQuery.trim(scCajero) != 'null' && jQuery.trim(scCajero) != '' && scCajero != "Servicio NO disponible"){ textCajero = textCajero + '. Horario: ' + scCajero; } services.find('span').text(textCajero); return(storeInfo.html()); } $('.moreElem').click(function(e){ e.preventDefault() startValue = startValue + 10; $('input[data-search="search"]').each(function(){ var scope = $(this); if(scope.hasClass('functional')){ scope.trigger('click'); } }) }) $('.busMenuSearch a').click(function(){ $('.busMenuSearch a').each(function(){ $(this).removeClass('active'); }) $(this).addClass('active'); }) })