const startTime=Date.now();let timerPaths=config.timerPathList;if(timerPaths){timerPaths=JSON.parse(timerPaths);}else{timerPaths=['/s1'];} let foreGroundTimer=0;let foreGroundInv=null;const setCookie=(name,value)=>{let domain=config.trackingCookieDomain;let secure=config.cookieSecure?"secure":"";document.cookie=`${name}=${value};path=/;domain=${domain};${secure}`;};const getCookie=(name)=>{const match=document.cookie.match(new RegExp(`(^| )${name}=([^;]+)`));if(match){return match[2];} return"";} const deleteCookie=name=>{let domain=config.trackingCookieDomain;let secure=config.cookieSecure?"secure":"";let expires=new Date().toUTCString();document.cookie=`${name}="";path=/;domain=${domain};expires=${expires};${secure}`;};const getCityCode=function(cityName=''){if(!cityName){return'NA';} let cityNameFinal=cityName.trim();cityNameFinal=cityNameFinal.toUpperCase();if(lsqCityCodes){lsqCityCodesParsed=JSON.parse(lsqCityCodes);return lsqCityCodesParsed[cityNameFinal]?lsqCityCodesParsed[cityNameFinal]:'NA';}else{return'NA';}} const autoSubmitLeadTrigger=(mssg,autoTriggerByClick=false)=>{if(document.cookie.indexOf("FooBar=true")>=0){return;} if(!getCookie('login_from_app')){return;} if(!config.enableAutoLeadSubmit){return;} if(autoTriggerByClick){window.autoSubmitUserInfo(mssg);return;} if(window.maxVerticalScroll<(config.mwebScrollTriggerPercent||25)){return;} if((foreGroundTimer*1000)<(config.contactUsAppTimer||60000)){return;} if(timerPaths.indexOf(document.location.pathname)>=0){let triggerMssg=`AutoTriggerSubmit from ${document.location.pathname}`;triggerMssg=triggerMssg.replaceAll('/','..');window.autoSubmitUserInfo(triggerMssg);}} const foreGroundTimerStart=()=>{if(!getCookie('login_from_app')){return;} if(timerPaths.indexOf(document.location.pathname)<0){return;} foreGroundInv=setInterval(()=>{triggerScrollAndForegroundFunctions();if(document.cookie.indexOf("FooBar=true")>=0||(foreGroundTimer*1000)>(config.contactUsAppTimer||60000)){clearInterval(foreGroundInv);}else{foreGroundTimer=foreGroundTimer+1;}},1000);} const triggerScrollAndForegroundFunctions=()=>{autoSubmitLeadTrigger();} let siteSource='D-web';let platformName=getCookie('os_name')||'Web';if(isMobile()){siteSource='M-web';} if(platformName.toUpperCase()==='ANDROID'){platformName='Android';siteSource='Ola App';}else if(platformName.toUpperCase()==='IOS'){platformName='IOS';siteSource='Ola App';} require(['jquery','jquery/ui','slick'],function($){$(document).ready(function(){var self=this;var throttlescroll;window.maxVerticalScroll=0;window.addEventListener("scroll",function(){clearTimeout(throttlescroll);throttlescroll=setTimeout(function(){const scrollPercent=amountscrolled();window.maxVerticalScroll=scrollPercent>window.maxVerticalScroll?scrollPercent:window.maxVerticalScroll;triggerScrollAndForegroundFunctions();},200);},false);document.addEventListener("visibilitychange",()=>{const state=document.visibilityState;if(state==="hidden"){clearInterval(foreGroundInv);} if(state==="visible"){foreGroundTimerStart();}});window.uiPlatform='BROWSER_WEB';const osName=getCookie('os_name');if(osName){if(/ANDROID/.test(osName.toUpperCase())){window.uiPlatform='ANDROID_WEB';}else if(/IOS/.test(osName.toUpperCase())){window.uiPlatform='IOS_WEB';}} if(getCookie('oem_auth_token')){$('.sign-in').addClass('menu-hidden');$('.sign-out').removeClass('menu-hidden');$('.my-account').removeClass('menu-hidden');}else{$('.sign-in').removeClass('menu-hidden');$('.sign-out').addClass('menu-hidden');$('.my-account').addClass('menu-hidden');} $('.my-account').click(function(){window.redirectToPurchase('ORDERS',null);});$('.sign-out').click(function(){deleteCookie('oem_auth_token');$('.sign-in').removeClass('menu-hidden');$('.sign-out').addClass('menu-hidden');$('.my-account').addClass('menu-hidden');});function closeWebView(){const ref=window.OlaJSNativeBridge.addAppEventListener('closeWebView',()=>{},{},);window.OlaJSNativeBridge.removeAppEventListener(ref);};function handleBackButtonLogic(){if(isMobile()){if(window.uiPlatform==='ANDROID_WEB'||window.uiPlatform==='IOS_WEB'){jQuery('.logo').hide();jQuery('.top-back-btn').show();} else{jQuery('.logo').show();}}else{jQuery('.logo').show();} jQuery(window).scroll(function(){var aTop=jQuery('.page-header').height();if(jQuery(self).scrollTop()>=aTop){jQuery(".logo").show();jQuery(".top-back-btn").hide();jQuery(".page-header").addClass("header_top_content_bg");}else{if(isMobile()){if(window.uiPlatform==='ANDROID_WEB'||window.uiPlatform==='IOS_WEB'){jQuery(".logo").hide();jQuery('.top-back-btn').show();} else{jQuery('.logo').show();}} jQuery(".page-header").removeClass("header_top_content_bg")}});jQuery('.top-back-btn').click(function(){history.back();const tmOut=setTimeout(()=>{closeWebView();clearTimeout(tmOut);},800);});} function handleHomePageBackButtonLogic(){if(isMobile()){if(window.uiPlatform==='ANDROID_WEB'||window.uiPlatform==='IOS_WEB'){if(getCookie('back_disabled')=='true'){jQuery('.logo').show();jQuery('.top-back-btn').hide();}else{jQuery('.logo').hide();jQuery('.top-back-btn').show();}} else{jQuery('.logo').show();}}else{jQuery('.logo').show();} jQuery(window).scroll(function(){var aTop=jQuery('.page-header').height();if(jQuery(self).scrollTop()>=aTop){jQuery(".logo").show();jQuery(".top-back-btn").hide();jQuery(".page-header").addClass("header_top_content_bg");}else{if(isMobile()){if(window.uiPlatform==='ANDROID_WEB'||window.uiPlatform==='IOS_WEB'){if(getCookie('back_disabled')=='true'){jQuery(".logo").show();jQuery('.top-back-btn').hide();} else{jQuery(".logo").hide();jQuery('.top-back-btn').show();}} else{jQuery('.logo').show();}} jQuery(".page-header").removeClass("header_top_content_bg")}});jQuery('.top-back-btn').click(function(){history.back();const tmOut=setTimeout(()=>{closeWebView();clearTimeout(tmOut);},800);});} function isHomePage(){return window.location.pathname==="/";} if(!isHomePage()){handleBackButtonLogic();}else{handleHomePageBackButtonLogic();} window.redirectToPurchase=function(target,model=null,variant=null){if(!config){return;} let subSource=getUrlQueryParam('last_source')||'';if(target==='REFERRAL'){if(siteSource==='Ola App'){subSource=subSource||'ola_app_daily_feed_card';}else{subSource=subSource||'oe_direct_referral_page';}} const els=[{id:'os_name',value:platformName,type:"text"},{id:'os_version',value:getCookie('os_version'),type:"text"},{id:'app_version',value:getCookie('app_version'),type:"text"},{id:'utm_uuid',value:getCookie('utm_uuid'),type:"text"},{id:'device_id',value:getCookie('device_id'),type:"text"},{id:'source',value:siteSource,type:"text"},{id:'subSource',value:subSource,type:"text"},{id:'backNavigation',value:config.backNavigation,type:"text"},{id:'backNavigationUrl',value:config.backNavigationUrl,type:"text"},{id:'login_from_app',value:getCookie('login_from_app'),type:"text"},{id:'app_to_discovery',value:getCookie('app_to_discovery'),type:"text"},{id:'oem_auth_token',value:getCookie('oem_auth_token'),type:"text"},{id:'utm_source',value:getUrlQueryParam('utm_source')||'',type:"text"},{id:'utm_medium',value:getUrlQueryParam('utm_medium')||'',type:"text"},{id:'utm_campaign',value:getUrlQueryParam('utm_campaign')||'',type:"text"},{id:'utm_term',value:getUrlQueryParam('utm_term')||'',type:"text"},{id:'utm_content',value:getUrlQueryParam('utm_content')||'',type:"text"},];if(model==='BIKE'){els.push({id:'selectedModel',value:model,type:"text"});els.push({id:'selectedVariant',value:variant||'',type:"text"});}else if(model==='NEW_SCOOTER'){els.push({id:'new_scooter_id',value:variant||'S1',type:"text"});}else{els.push({id:'selectedModel',value:model||'S1',type:"text"});els.push({id:'selectedVariant',value:model||'S1',type:"text"});} let finalUrl=config.purchaseRedirectionUrl;if(target==='OLA_EXCHANGE'){finalUrl=config.purchaseExchangeUrl;}else if(target==='ORDERS'){els.push({id:'redirectTo',value:'myReservations',type:"text"});}else if(target==='STORE'){els.push({id:'redirectTo',value:'accessorystore',type:"text"});}else if(target==='REFERRAL'){els.push({id:'redirectTo',value:'toaddContact',type:"text"});finalUrl=config.referralUrl;} var purchaseRedirectionForm=document.createElement("form");purchaseRedirectionForm.setAttribute("method","post");purchaseRedirectionForm.setAttribute("action",finalUrl);for(el in els){const inp=document.createElement("input");inp.setAttribute("type",els[el].type);inp.setAttribute("name",els[el].id);inp.setAttribute("value",els[el].value);purchaseRedirectionForm.append(inp);} document.body.appendChild(purchaseRedirectionForm);purchaseRedirectionForm.submit();} window.redirectToTR=function(){if(!config){return;} if(!getCookie('login_from_app')||!getCookie('oem_auth_token')){window.location.href=config.testRideGetRedirectionUrl;return;} const els=[{id:'os_name',value:platformName,type:"text"},{id:'os_version',value:getCookie('os_version'),type:"text"},{id:'app_version',value:getCookie('app_version'),type:"text"},{id:'utm_uuid',value:getCookie('utm_uuid'),type:"text"},{id:'device_id',value:getCookie('device_id'),type:"text"},{id:'source',value:siteSource,type:"text"},{id:'subSource',value:getUrlQueryParam('last_source')||'',type:"text"},{id:'backNavigation',value:config.backNavigation,type:"text"},{id:'backNavigationUrl',value:config.backNavigationUrl,type:"text"},{id:'login_from_app',value:getCookie('login_from_app'),type:"text"},{id:'app_to_discovery',value:getCookie('app_to_discovery'),type:"text"},{id:'oem_auth_token',value:getCookie('oem_auth_token'),type:"text"},{id:'utm_source',value:getUrlQueryParam('utm_source')||'',type:"text"},{id:'utm_medium',value:getUrlQueryParam('utm_medium')||'',type:"text"},{id:'utm_campaign',value:getUrlQueryParam('utm_campaign')||'',type:"text"},{id:'utm_term',value:getUrlQueryParam('utm_term')||'',type:"text"},{id:'utm_content',value:getUrlQueryParam('utm_content')||'',type:"text"},];var purchaseRedirectionForm=document.createElement("form");purchaseRedirectionForm.setAttribute("method","post");purchaseRedirectionForm.setAttribute("action",config.testRideRedirectionUrl);for(el in els){const inp=document.createElement("input");inp.setAttribute("type",els[el].type);inp.setAttribute("name",els[el].id);inp.setAttribute("value",els[el].value);purchaseRedirectionForm.append(inp);} document.body.appendChild(purchaseRedirectionForm);purchaseRedirectionForm.submit();} window.redirectNewTR=function(){if(!config){return;} if(!getCookie('login_from_app')&&!(getCookie('oem_auth_token')||getCookie('wasc'))){window.location.href=config.testRideNoneLoginRedirectionUrl;return;}else{const els=[{id:'os_name',value:platformName,type:"text"},{id:'os_version',value:getCookie('os_version'),type:"text"},{id:'app_version',value:getCookie('app_version'),type:"text"},{id:'utm_uuid',value:getCookie('utm_uuid'),type:"text"},{id:'device_id',value:getCookie('device_id'),type:"text"},{id:'source',value:siteSource,type:"text"},{id:'subSource',value:getUrlQueryParam('last_source')||'',type:"text"},{id:'backNavigation',value:config.backNavigation,type:"text"},{id:'backNavigationUrl',value:config.backNavigationUrl,type:"text"},{id:'login_from_app',value:getCookie('login_from_app'),type:"text"},{id:'app_to_discovery',value:getCookie('app_to_discovery'),type:"text"},{id:'oem_auth_token',value:getCookie('oem_auth_token'),type:"text"},{id:'wasc',value:getCookie('wasc'),type:"text"},{id:'utm_source',value:getUrlQueryParam('utm_source')||'',type:"text"},{id:'utm_medium',value:getUrlQueryParam('utm_medium')||'',type:"text"},{id:'utm_campaign',value:getUrlQueryParam('utm_campaign')||'',type:"text"},{id:'utm_term',value:getUrlQueryParam('utm_term')||'',type:"text"},{id:'utm_content',value:getUrlQueryParam('utm_content')||'',type:"text"},];var testRedirectionForm=document.createElement("form");testRedirectionForm.setAttribute("method","post");testRedirectionForm.setAttribute("action",config.testRideLoginRedirectionaUrl);for(el in els){const inp=document.createElement("input");inp.setAttribute("type",els[el].type);inp.setAttribute("name",els[el].id);inp.setAttribute("value",els[el].value);testRedirectionForm.append(inp);} document.body.appendChild(testRedirectionForm);testRedirectionForm.submit();}} $('.store-redirection').click(function(){window.redirectToPurchase('STORE')});window.openPagePopup=(uniqueId)=>{if(!uniqueId){return;}else{$(uniqueId).css('display','flex');}} window.closePagePopup=(uniqueId)=>{if(uniqueId){$(uniqueId).hide();}else{$('#outer-wrapper').hide();}} $('.auto-submit-lead').click(function(evt){let mssg='Clicked';const classes=$(evt.currentTarget).attr('class');const classesArr=classes.split(' ');classesArr.forEach((cl=>{if(/message/.test(cl)){mssg=cl.split('_')[1];}}));if(getCookie('login_from_app')&&config.enableAutoLeadSubmit){autoSubmitLeadTrigger(mssg,true);}});window.autoSubmitUserInfo=function(mssg=''){if(document.cookie.indexOf("FooBar=true")>=0){return;} document.cookie="FooBar=true; max-age=2592000";window?.sendMoengageEvent&&window?.sendMoengageEvent({label:'Login_auto_trigger',event:'evdp-trigger',description:'Auto trigger on login'});jQuery.ajax({type:"POST",url:"/exp_center/experience/login",headers:{usertoken:getCookie('oem_auth_token'),device_id:getCookie('device_id'),os_name:getCookie('os_name'),os_version:getCookie('os_version'),app_version:getCookie('app_version'),device_model:getCookie('device_model'),},data:{city_code:getCityCode(getCookie('app_city_name')),city_name:getCookie('app_city_name'),message:mssg,leadSource:lsqMapping[siteSource],insideSalesCohort:'Auto Triggered Leads'},global:false,success:function(data){console.log('Info submitted successfully');},error:function(err){},})} if($('#cf-leadSource')){$('#cf-leadSource').val(lsqMapping[siteSource]);} var swatchLength=$('.swatch-attribute').length;if(swatchLength>=1){if($('.swatch-attribute').hasClass("color")){$('.swatch-option.image').first().trigger('click');$('.swatch-option.text').first().trigger('click');}} $("#nav-container .button").click(function(){$(this).addClass('hide_menubar');$("#nav-content").css("transform","translateX(0)");$(".page-wrapper").addClass("transparent_bg");$("body").css("overflow-y","hidden");});$("#nav-content .menu_close a").click(function(){$("#nav-container .button").removeClass('hide_menubar');$("#nav-content").css("transform","translateX(100%)");$(".page-wrapper").removeClass("transparent_bg");});$(".regular").slick({dots:true,infinite:true,slidesToShow:3,slidesToScroll:3});$(".product_demo").slick({dots:true,autoplay:true,arrows:true,autoplaySpeed:5000,pauseOnFocus:false,pauseOnHover:false,infinite:true,slidesToShow:1,slidesToScroll:1});$(".slider-vertical").slick({infinite:true,arrows:false,dots:false,autoplay:false,vertical:true,speed:800,slidesToShow:1,slidesToScroll:1});var percentTime;var tick;var time=.1;var progressBarIndex=0;$('.sliderContainer .progressBarContainer .progressBar').each(function(index){var progress="
";$(this).html(progress);});function startProgressbar(){resetProgressbar();percentTime=0;tick=setInterval(interval,10);} function interval(){if(($('.slider-vertical .slick-track div[data-slick-index="'+progressBarIndex+'"]').attr("aria-hidden"))==="true"){progressBarIndex=$('.slider-vertical .slick-track div[aria-hidden="false"]').data("slickIndex");startProgressbar();}else{percentTime+=1 /(time+5);$('.sliderContainer .inProgress'+progressBarIndex).css({height:percentTime+"%"});$('.sliderContainer .inProgress'+progressBarIndex).parent().parent().parent('.item').addClass('active');if(percentTime>=100){$('.slider-vertical').slick('slickNext');progressBarIndex++;if(progressBarIndex>2){progressBarIndex=0;} startProgressbar();}}} function resetProgressbar(){$('.sliderContainer .inProgress').css({height:0+'%'});$('.sliderContainer .item').removeClass('active');clearInterval(tick);} startProgressbar();$('.sliderContainer .item').click(function(){clearInterval(tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;$('.slider-vertical').slick('slickGoTo',goToThisIndex,false);startProgressbar();});$(".for_you_everywhere > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,vertical:true,speed:800,slidesToShow:1,slidesToScroll:1});var percentTime;var tick;var time=.1;var progressBarIndex=0;$('.foryou_evereywhere_slider .progressBarContainer .progressBar').each(function(index){var progress="";$(this).html(progress);});function everystartProgressbar(){everyresetProgressbar();percentTime=0;tick=setInterval(everyinterval,10);} function everyinterval(){if(($('.for_you_everywhere .slick-track div[data-slick-index="'+progressBarIndex+'"]').attr("aria-hidden"))==="true"){progressBarIndex=$('.for_you_everywhere .slick-track div[aria-hidden="false"]').data("slickIndex");everystartProgressbar();}else{percentTime+=1 /(time+5);$('.foryou_evereywhere_slider .inProgress'+progressBarIndex).css({height:percentTime+"%"});$('.foryou_evereywhere_slider .inProgress'+progressBarIndex).parent().parent().parent('.item').addClass('active');if(percentTime>=100){$('.for_you_everywhere > .mgz-element-inner').slick('slickNext');progressBarIndex++;if(progressBarIndex>2){progressBarIndex=0;} everystartProgressbar();}}} function everyresetProgressbar(){$('.foryou_evereywhere_slider .inProgress').css({height:0+'%'});$('.foryou_evereywhere_slider .item').removeClass('active');clearInterval(tick);} everystartProgressbar();$('.foryou_evereywhere_slider .item').click(function(){clearInterval(tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;$('.for_you_everywhere > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);everystartProgressbar();});$(".section_technology_truly .slick-vertical > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,vertical:true,speed:800,slidesToShow:1,slidesToScroll:1});var technology_truly_percentTime;var technology_truly_tick;var technology_truly_time=.1;var technology_truly_progressBarIndex=0;$('.section_technology_truly .progressBarContainer .progressBar').each(function(index){var progress="";$(this).html(progress);});function technology_truly_startProgressbar(){technology_truly_resetProgressbar();technology_truly_percentTime=0;technology_truly_tick=setInterval(technology_truly_interval,10);} function technology_truly_interval(){if(($('.section_technology_truly .slick-vertical .slick-track div[data-slick-index="'+technology_truly_progressBarIndex+'"]').attr("aria-hidden"))==="true"){technology_truly_progressBarIndex=$('.section_technology_truly .slick-vertical .slick-track div[aria-hidden="false"]').data("slickIndex");technology_truly_startProgressbar();}else{technology_truly_percentTime+=1 /(technology_truly_time+5);$('.section_technology_truly .inProgress'+technology_truly_progressBarIndex).css({height:technology_truly_percentTime+"%"});$('.section_technology_truly .inProgress'+technology_truly_progressBarIndex).parent().parent().parent('.item').addClass('active');if(technology_truly_percentTime>=100){$('.section_technology_truly .slider > .mgz-element-inner').slick('slickNext');technology_truly_progressBarIndex++;if(technology_truly_progressBarIndex>2){technology_truly_progressBarIndex=0;} technology_truly_startProgressbar();}}} function technology_truly_resetProgressbar(){$('.section_technology_truly .inProgress').css({height:0+'%'});$('.section_technology_truly .item').removeClass('active');clearInterval(technology_truly_tick);} technology_truly_startProgressbar();$('.section_technology_truly .item').click(function(){clearInterval(technology_truly_tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;$('.section_technology_truly .slick-vertical > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);technology_truly_startProgressbar();});$(".introducing_ola_s1_slider_info > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,vertical:true,speed:800,slidesToShow:1,slidesToScroll:1});var introducin_percentTime;var introducing_tick;var introducing_time=.1;var introduce_progressBarIndex=0;$('.introducing_ola_s1 .progressBarContainer .progressBar').each(function(index){var progress="";$(this).html(progress);});function introstartProgressbar(){introresetProgressbar();introducin_percentTime=0;introducing_tick=setInterval(introinterval,10);} function introinterval(){if(($('.introducing_ola_s1_slider_info .slick-track div[data-slick-index="'+introduce_progressBarIndex+'"]').attr("aria-hidden"))==="true"){introduce_progressBarIndex=$('.introducing_ola_s1_slider_info .slick-track div[aria-hidden="false"]').data("slickIndex");introstartProgressbar();}else{introducin_percentTime+=1 /(introducing_time+5);$('.introducing_ola_s1 .inProgress'+introduce_progressBarIndex).css({height:introducin_percentTime+"%"});$('.introducing_ola_s1 .inProgress'+introduce_progressBarIndex).parent().parent().parent('.item').addClass('active');if(introducin_percentTime>=100){$('.introducing_ola_s1_slider_info > .mgz-element-inner').slick('slickNext');introduce_progressBarIndex++;if(introduce_progressBarIndex>2){introduce_progressBarIndex=0;} introstartProgressbar();}}} function introresetProgressbar(){$('.introducing_ola_s1 .inProgress').css({height:0+'%'});$('.introducing_ola_s1 .item').removeClass('active');clearInterval(introducing_tick);} introstartProgressbar();$('.introducing_ola_s1 .item').click(function(){clearInterval(introducing_tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;$('.introducing_ola_s1_slider_info > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);introstartProgressbar();});if($(".slider-horizontal").length>0){jQuery(".slider-horizontal > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,speed:800,slidesToShow:1,slidesToScroll:1,vertical:false});} var s1_percentTime;var s1_tick;var s1_time=1;var s1_progressBarIndex=0;jQuery('.horizontal_slider_progress_bar .progressBarContainer .progressBar').each(function(index){var progress="";jQuery(this).html(progress);});function s1_startProgressbar(){s1_resetProgressbar();s1_percentTime=0;s1_tick=setInterval(s1_interval,10);} function s1_interval(){if((jQuery('.slider-horizontal > .mgz-element-inner .slick-track div[data-slick-index="'+s1_progressBarIndex+'"]').attr("aria-hidden"))==="true"){s1_progressBarIndex=jQuery('.slider-horizontal > .mgz-element-inner .slick-track div[aria-hidden="false"]').data("slickIndex");s1_startProgressbar();}else{s1_percentTime+=1 /(time+5);$('.horizontal_slider_progress_bar .inProgress'+s1_progressBarIndex).css({width:s1_percentTime+"%"});$('.horizontal_slider_progress_bar .inProgress'+s1_progressBarIndex).parent().parent().parent('.item').addClass('active');if(s1_percentTime>=100){$('.slider-horizontal > .mgz-element-inner').slick('slickNext');s1_progressBarIndex++;if(s1_progressBarIndex>2){s1_progressBarIndex=0;} s1_startProgressbar();}}} function s1_resetProgressbar(){jQuery('.horizontal_slider_progress_bar .inProgress').css({width:0+'%'});$('.horizontal_slider_progress_bar .item').removeClass('active');clearInterval(s1_tick);} s1_startProgressbar();jQuery('.horizontal_slider_progress_bar .item').click(function(){clearInterval(s1_tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;jQuery('.slider-horizontal > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);s1_startProgressbar();});if($(".slider-horizontal_banner > .mgz-element-inner").length>0){jQuery(".slider-horizontal_banner > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,speed:800,slidesToShow:1,slidesToScroll:1,vertical:false});} var home_percentTime;var home_tick;var home_time=1;var home_progressBarIndex=0;jQuery('.horizontal_slider_progress_bar_banner .progressBarContainer .progressBar').each(function(index){var progress="";jQuery(this).html(progress);});function home_startProgressbar(){home_resetProgressbar();home_percentTime=0;home_tick=setInterval(home_interval,10);} function home_interval(){if((jQuery('.slider-horizontal_banner .slick-track div[data-slick-index="'+home_progressBarIndex+'"]').attr("aria-hidden"))==="true"){home_progressBarIndex=jQuery('.slider-horizontal_banner .slick-track div[aria-hidden="false"]').data("slickIndex");home_startProgressbar();}else{home_percentTime+=1 /(home_time+5);$('.horizontal_slider_progress_bar_banner .inProgress'+home_progressBarIndex).css({width:home_percentTime+"%"});if(home_percentTime>=100){$('.slider-horizontal_banner > .mgz-element-inner').slick('slickNext');home_progressBarIndex++;if(home_progressBarIndex>2){home_progressBarIndex=0;} home_startProgressbar();}}} function home_resetProgressbar(){jQuery('.horizontal_slider_progress_bar_banner .inProgress').css({width:0+'%'});clearInterval(home_tick);} home_startProgressbar();jQuery('.horizontal_slider_progress_bar_banner .item').click(function(){clearInterval(home_tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;jQuery('.slider-horizontal_banner > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);home_startProgressbar();});if($(".slider-horizontal_banner-mobile > .mgz-element-inner").length>0){jQuery(".slider-horizontal_banner-mobile > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,speed:800,slidesToShow:1,slidesToScroll:1,vertical:false});var home_percentTime_mo;var home_tick_mo;var home_time_mo=1;var home_progressBarIndex_mo=0;jQuery('.horizontal_slider_progress_bar_banner-mobile .progressBarContainer .progressBar').each(function(index){var progress="";jQuery(this).html(progress);});function home_startProgressbar_mo(){home_resetProgressbar_mo();home_percentTime_mo=0;home_tick_mo=setInterval(home_interval_mo,10);} function home_interval_mo(){if((jQuery('.slider-horizontal_banner-mobile .slick-track div[data-slick-index="'+home_progressBarIndex_mo+'"]').attr("aria-hidden"))==="true"){home_progressBarIndex_mo=jQuery('.slider-horizontal_banner-mobile .slick-track div[aria-hidden="false"]').data("slickIndex");home_startProgressbar_mo();}else{home_percentTime_mo+=1 /(home_time_mo+5);$('.horizontal_slider_progress_bar_banner-mobile .inProgress'+home_progressBarIndex_mo).css({width:home_percentTime_mo+"%"});if(home_percentTime_mo>=100){$('.slider-horizontal_banner-mobile > .mgz-element-inner').slick('slickNext');home_progressBarIndex_mo++;if(home_progressBarIndex_mo>2){home_progressBarIndex_mo=0;} home_startProgressbar_mo();}}} function home_resetProgressbar_mo(){jQuery('.horizontal_slider_progress_bar_banner-mobile .inProgress').css({width:0+'%'});clearInterval(home_tick_mo);} home_startProgressbar_mo();jQuery('.horizontal_slider_progress_bar_banner-mobile .item').click(function(){clearInterval(home_tick_mo);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;jQuery('.slider-horizontal_banner-mobile > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);home_startProgressbar_mo();});} jQuery(".slider_horizontal_glide_through_distance > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,speed:800,slidesToShow:1,slidesToScroll:1,vertical:false});var glide_percentTime;var glide_tick;var glide_time=1;var glide_progressBarIndex=0;jQuery('.glide_through_distance_progress_bar .progressBarContainer .progressBar').each(function(index){var progress="";jQuery(this).html(progress);});function glide_startProgressbar(){glide_resetProgressbar();glide_percentTime=0;glide_tick=setInterval(glide_interval,10);} function glide_interval(){if((jQuery('.slider_horizontal_glide_through_distance > .mgz-element-inner .slick-track div[data-slick-index="'+glide_progressBarIndex+'"]').attr("aria-hidden"))==="true"){glide_progressBarIndex=jQuery('.slider_horizontal_glide_through_distance > .mgz-element-inner .slick-track div[aria-hidden="false"]').data("slickIndex");glide_startProgressbar();}else{glide_percentTime+=1 /(glide_time+5);$('.glide_through_distance_progress_bar .inProgress'+glide_progressBarIndex).css({width:glide_percentTime+"%"});$('.glide_through_distance_progress_bar .inProgress'+glide_progressBarIndex).parent().parent().parent('.item').addClass('active');if(glide_percentTime>=100){$('.slider_horizontal_glide_through_distance > .mgz-element-inner').slick('slickNext');glide_progressBarIndex++;if(glide_progressBarIndex>2){glide_progressBarIndex=0;} glide_startProgressbar();}}} function glide_resetProgressbar(){jQuery('.glide_through_distance_progress_bar .inProgress').css({width:0+'%'});$('.glide_through_distance_progress_bar .item').removeClass('active');clearInterval(glide_tick);} glide_startProgressbar();jQuery('.glide_through_distance_progress_bar .item').click(function(){clearInterval(glide_tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;jQuery('.slider_horizontal_glide_through_distance > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);glide_startProgressbar();});jQuery(".s1_glide_safety .slider > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,speed:800,slidesToShow:1,slidesToScroll:1,vertical:false});var s1_glide_safety_percentTime;var s1_glide_tick;var s1_glide_time=1;var s1_glide_safety_progressBarIndex=0;jQuery('.ola_s1_distance_progress_bar .progressBarContainer .progressBar').each(function(index){var progress="";jQuery(this).html(progress);});function s1_glide_safety_startProgressbar(){s1_glide_safety_resetProgressbar();s1_glide_safety_percentTime=0;s1_glide_tick=setInterval(s1_glide_safety_interval,10);} function s1_glide_safety_interval(){if((jQuery('.s1_glide_safety .slider > .mgz-element-inner .slick-track div[data-slick-index="'+s1_glide_safety_progressBarIndex+'"]').attr("aria-hidden"))==="true"){s1_glide_safety_progressBarIndex=jQuery('.s1_glide_safety .slider > .mgz-element-inner .slick-track div[aria-hidden="false"]').data("slickIndex");s1_glide_safety_startProgressbar();}else{s1_glide_safety_percentTime+=1 /(s1_glide_time+5);$('.ola_s1_distance_progress_bar .inProgress'+s1_glide_safety_progressBarIndex).css({width:s1_glide_safety_percentTime+"%"});$('.ola_s1_distance_progress_bar .inProgress'+s1_glide_safety_progressBarIndex).parent().parent().parent('.item').addClass('active');if(s1_glide_safety_percentTime>=100){$('.s1_glide_safety .slider > .mgz-element-inner').slick('slickNext');s1_glide_safety_progressBarIndex++;if(s1_glide_safety_progressBarIndex>2){s1_glide_safety_progressBarIndex=0;} s1_glide_safety_startProgressbar();}}} function s1_glide_safety_resetProgressbar(){jQuery('.ola_s1_distance_progress_bar .inProgress').css({width:0+'%'});$('.ola_s1_distance_progress_bar .item').removeClass('active');clearInterval(s1_glide_tick);} s1_glide_safety_startProgressbar();jQuery('.ola_s1_distance_progress_bar .item').click(function(){clearInterval(s1_glide_tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;jQuery('.s1_glide_safety .slider > .mgz-element-inner').slick('slickGoTo',goToThisIndex,false);s1_glide_safety_startProgressbar();});jQuery(".horizontal_content_mobile_slider > .mgz-element-inner").slick({infinite:true,arrows:false,dots:false,autoplay:false,speed:800,slidesToShow:1,slidesToScroll:1,vertical:false});var horizontal_mobile_percentTime;var horizontal_mobile_tick;var horizontal_mobile_time=1;var horizontal_mobile_progressBarIndex=0;jQuery('.horizontal_content_mobile_slider .item .progressBar').each(function(index){var progress="";jQuery(this).html(progress);});function horizontal_mobile_startProgressbar(){horizontal_mobile_resetProgressbar();horizontal_mobile_percentTime=0;horizontal_mobile_tick=setInterval(horizontal_mobile_interval,10);} function horizontal_mobile_interval(){if((jQuery('.horizontal_content_mobile_slider > .mgz-element-inner .slick-track div[data-slick-index="'+horizontal_mobile_progressBarIndex+'"]').attr("aria-hidden"))==="true"){horizontal_mobile_progressBarIndex=jQuery('.horizontal_content_mobile_slider > .mgz-element-inner .slick-track div[aria-hidden="false"]').data("slickIndex");horizontal_mobile_startProgressbar();}else{horizontal_mobile_percentTime+=1 /(time+5);$('.horizontal_content_mobile_slider .inProgress'+horizontal_mobile_progressBarIndex).css({width:horizontal_mobile_percentTime+"%"});$('.horizontal_content_mobile_slider .inProgress'+horizontal_mobile_progressBarIndex).parent().parent().parent('.item').addClass('active');if(horizontal_mobile_percentTime>=100){$('.horizontal_content_mobile_slider > .mgz-element-inner').slick('slickNext');horizontal_mobile_progressBarIndex++;if(horizontal_mobile_progressBarIndex>2){horizontal_mobile_progressBarIndex=0;} horizontal_mobile_startProgressbar();}}} function horizontal_mobile_resetProgressbar(){jQuery('.horizontal_content_mobile_slider .inProgress').css({width:0+'%'});$('.horizontal_content_mobile_slider .item').removeClass('active');clearInterval(horizontal_mobile_tick);} horizontal_mobile_startProgressbar();$(".turn_head_wherever_you_go_slider_info").slick({infinite:true,arrows:false,dots:false,autoplay:false,vertical:true,speed:800,slidesToShow:1,slidesToScroll:1});var s1_h_percentTime;var s1_h_tick;var s1_h_time=.1;var s1_h_progressBarIndex=0;$('.turn_head_wherever_you_go_ola_s1 .progressBarContainer .progressBar').each(function(index){var progress="";$(this).html(progress);});function s1_h_startProgressbar(){s1_h_resetProgressbar();s1_h_percentTime=0;s1_h_tick=setInterval(s1_h_interval,10);} function s1_h_interval(){if(($('.turn_head_wherever_you_go_slider_info .slick-track div[data-slick-index="'+s1_h_progressBarIndex+'"]').attr("aria-hidden"))==="true"){s1_h_progressBarIndex=$('.turn_head_wherever_you_go_slider_info .slick-track div[aria-hidden="false"]').data("slickIndex");s1_h_startProgressbar();}else{s1_h_percentTime+=1 /(s1_h_time+5);$('.turn_head_wherever_you_go_ola_s1 .inProgress'+s1_h_progressBarIndex).css({height:s1_h_percentTime+"%"});$('.turn_head_wherever_you_go_ola_s1 .inProgress'+s1_h_progressBarIndex).parent().parent().parent('.item').addClass('active');if(s1_h_percentTime>=100){$('.turn_head_wherever_you_go_slider_info').slick('slickNext');s1_h_progressBarIndex++;if(s1_h_progressBarIndex>2){s1_h_progressBarIndex=0;} s1_h_startProgressbar();}}} function s1_h_resetProgressbar(){$('.turn_head_wherever_you_go_ola_s1 .inProgress').css({height:0+'%'});$('.turn_head_wherever_you_go_ola_s1 .item').removeClass('active');clearInterval(s1_h_tick);} s1_h_startProgressbar();$('.turn_head_wherever_you_go_ola_s1 .item').click(function(){clearInterval(s1_h_tick);const blocks=$(this).attr('id');var goToThisIndex=blocks-1;$('.turn_head_wherever_you_go_slider_info').slick('slickGoTo',goToThisIndex,false);s1_h_startProgressbar();});jQuery(document).on('click',function(event){if(!jQuery(event.target).closest('.experience_city_dropdown .exp_city_search').length){jQuery("#mylocation").hide();}});jQuery(document).on('click',function(event){if(!jQuery(event.target).closest('.grid-image-container, #center-details_2, .exp_popup_container, .experience_city_dropdown .exp_city_search').length){jQuery("#myForm").hide();jQuery("body").removeClass("hide_scrollbar");}});jQuery(document).on('click',function(event){if(!jQuery(event.target).closest('.take_your_pick .product-items.model-section .select-s1_air-slote, .take_your_pick .product-items.model-section .select-s1-slote, .take_your_pick .product-items.model-section .select-s1_pro-slote, .vcDropdown_variantName__llaRA').length){jQuery(".vcDropdown_variantOptionsContainer__u30Vi").hide();}});jQuery(document).on('click',function(event){if(!jQuery(event.target).closest('.view_brochure a, .brochure_popup > .mgz-element-inner > .inner-content').length){jQuery(".brochure_popup").hide();jQuery("body").removeClass("brochure_popup_overlapping");} if(!jQuery(event.target).closest('.full_spec_sheet a, .specification_sheet_popup > .mgz-element-inner > .inner-content').length){jQuery(".specification_sheet_popup").hide();jQuery("body").removeClass("popup_overlapping");} if(!jQuery(event.target).closest('#nav-content, #nav-container .button').length){$("#nav-container .button").removeClass('hide_menubar');$("#nav-content").css("transform","translateX(100%)");$(".page-wrapper").removeClass("transparent_bg");$("body").css("overflow-y","unset");}});$('.experience_view-more-city .city_view').click(function(){$('.experience_gallery_inner').toggleClass("view_all_city");if($(".experience_gallery_inner").hasClass("view_all_city")){$('.city_view').text("Hide");}else{$('.city_view').text("View all cities");}});$('.request_experts_call ').click(function(){$('.interested-pop-up').show();});$("#home-charger-icon").click(function(){window.openPagePopup('#home-charger-page-modal');});$("#home-charger-close-icon").click(function(){window.closePagePopup('#home-charger-page-modal');});$("#performance-upgrade-icon").click(function(){window.openPagePopup('#performance-upgrade-page-modal');});$("#performance-upgrade-close-icon").click(function(){window.closePagePopup('#performance-upgrade-page-modal');});$("#subsidy-icon").click(function(){window.openPagePopup('#fame-2-subsidy-page-modal');});$("#subsidy-close-icon").click(function(){window.closePagePopup('#fame-2-subsidy-page-modal');});$("#insurance-icon").click(function(){$(".insurance-modal").css({display:"block",});$("body").addClass("hide_scrollbar");});$("#insurance-close-icon").click(function(){$(".insurance-modal").css({display:"none",});$("body").removeClass("hide_scrollbar");});jQuery("#home-charger-icon-mobile").click(function(){window.openPagePopup('#home-charger-page-modal');});jQuery("#insurance-icon-mobile").click(function(){$(".insurance-modal").css({display:"block",});$("body").addClass("hide_scrollbar");});jQuery("#performance-upgrade-icon-mobile").click(function(){window.openPagePopup('#performance-upgrade-page-modal');});jQuery("#subsidy-icon-mobile").click(function(){window.openPagePopup('#fame-2-subsidy-page-modal');});jQuery(".page-popup-overlay").click(function(){window.closePagePopup('.page-popup-overlay');});$(".interested-pop-up-container img").click(function(){$(".interested-pop-up").hide();$('.columns .column.main').removeAttr('style');});$(".what_covered_content_list:first-child").addClass('active');$(".what_covered_img:first-child").addClass('active');$(document).ready(function(){$(".what_covered_content_list:first-child").hover(function(){$(this).siblings().removeClass("active");$(this).addClass("active");$(".what_covered_img").hide();$(".what_covered_img:first-child").show();$(this).siblings().find('.description').hide();$(this).find('.description').show();});$(".what_covered_content_list:nth-child(2)").hover(function(){$(this).siblings().removeClass("active");$(this).addClass("active");$(".what_covered_img").hide();$(".what_covered_img:nth-child(2)").show();$(this).siblings().find('.description').hide();$(this).find('.description').show();});$(".what_covered_content_list:nth-child(3)").hover(function(){$(this).siblings().removeClass("active");$(this).addClass("active");$(".what_covered_img").hide();$(".what_covered_img:nth-child(3)").show();$(this).siblings().find('.description').hide();$(this).find('.description').show();});$(".what_covered_content_list:nth-child(4)").hover(function(){$(this).siblings().removeClass("active");$(this).addClass("active");$(".what_covered_img").hide();$(".what_covered_img:nth-child(4)").show();$(this).siblings().find('.description').hide();$(this).find('.description').show();});$(".hero_info > .hero-icon").click(function(){$("body").addClass("popup_overlapping");$(".custom_popup").show();$(".custom_popup").addClass("outside_area")});$(".custom_popup_container > a, .custom_popup_container .dismiss_btn a").click(function(){$(".custom_popup").hide();$("body").removeClass("popup_overlapping");$(".custom_popup").removeClass("outside_area");});$(".pricing_content > .home_charger").click(function(){$("body").addClass("popup_overlapping");$(".home_charger_popup").css({"display":"flex","justify-content":"center","align-items":"center"}).addClass("outside_area");$(".custom_popup").removeClass("outside_area");});$(".home_charger_popup > .specification_popup_container > a").click(function(){$(".home_charger_popup").css({"display":"none"});$("body").removeClass("popup_overlapping");$(".custom_popup").addClass("outside_area");});$(".pricing_content > .state_subsidy").click(function(){$("body").addClass("popup_overlapping");$(".state_subsidy_popup.specification_popup").css({"display":"flex","justify-content":"center","align-items":"center"}).addClass("outside_area");$(".custom_popup").removeClass("outside_area");});$(".state_subsidy_popup > .specification_popup_container > a").click(function(){$(".state_subsidy_popup").css({"display":"none"});$("body").removeClass("popup_overlapping");$(".custom_popup").addClass("outside_area");});$(".pricing_content > .performance_upgrade").click(function(){$("body").addClass("popup_overlapping");$(".performance_upgrade_popup").css({"display":"flex","justify-content":"center","align-items":"center"});$(".custom_popup").removeClass("outside_area");});$(".performance_upgrade_popup > .specification_popup_container > a").click(function(){$(".performance_upgrade_popup").css({"display":"none"});$("body").removeClass("popup_overlapping");$(".custom_popup").addClass("outside_area");});$(".pricing_content > .fame_subsidy").click(function(){$("body").addClass("popup_overlapping");$(".fame_subsidy_popup").css({"display":"flex","justify-content":"center","align-items":"center"});$(".custom_popup").removeClass("outside_area");});$(".fame_subsidy_popup > .specification_popup_container > a").click(function(){$(".fame_subsidy_popup").css({"display":"none"});$("body").removeClass("popup_overlapping");$(".custom_popup").addClass("outside_area");});$(".view_brochure a").click(function(){$('body').addClass('brochure_popup_overlapping');$('.brochure_popup').show();});$(".close_brochure a").click(function(){$('body').removeClass('brochure_popup_overlapping');$('.brochure_popup').hide();});$(".full_spec_sheet a").click(function(){$('body').addClass('popup_overlapping');$('.specification_sheet_popup').show();});$(".spec_sheet_close_btn a").click(function(){$('body').removeClass('popup_overlapping');$('.specification_sheet_popup').hide();});$('.cms-home-page-redesign video, .cms-home video').each(function(){newvideosource=$(this).find('source').attr('data-src');if(newvideosource!=""){$(this).find('source').attr('src',newvideosource);}})});setTimeout(function(){$('.cms-home-page-redesign video, .cms-home video').each(function(){$(this).removeAttr('autoplay');videosource=$(this).find('source').attr('src');if(videosource!=""){$(this).find('source').attr('data-src',videosource);}})},1000);setTimeout(function(){$('.cms-home-page-redesign video, .cms-home video').each(function(){$(this).removeAttr('autoplay');videosource=$(this).find('source').attr('src');if(videosource!=""){$(this).find('source').attr('data-src',videosource);}})},2000);setTimeout(function(){$('.cms-home-page-redesign video, .cms-home video').each(function(){$(this).removeAttr('autoplay');videosource=$(this).find('source').attr('src');if(videosource!=""){$(this).find('source').attr('data-src',videosource);}})},3000);function interested(){document.cookie="FooBarv1=true; max-age=43200";$('.interested-pop-up').show();$('.columns .column.main').attr('style','z-index: -1');window?.sendMoengageEvent&&window?.sendMoengageEvent({label:'Request_call_back_auto_popup',event:'evdp-trigger',description:'Request call back popup auto triggered'});} $(".footer-logo-placeholder").click(function(){window.location=BASE_URL;}) $("#Requestcall").click(function(){interested();}) if(document.cookie.indexOf("FooBarv1=true")==-1){if(getCookie('login_from_app')&&config.enableAutoLeadSubmit){foreGroundTimerStart();}else{if(document.location.pathname!=='/'){const tmOut=setTimeout(()=>{interested();clearTimeout(tmOut);},config.contactUsWebTimer||10000);}}} jQuery(".specification_sheet_popup > div > div > div > div").on('scroll',function(){if(jQuery(this).scrollTop()>=80){jQuery(".spec_sheet_top_product_select").addClass("sticky_spec_sheet_top")} else{jQuery(".spec_sheet_top_product_select").removeClass("sticky_spec_sheet_top")}});});});