PageSourceSearch

https://www.mptourism.com//js/main.js

js mptourism.com collected 2026-10-02 07:46:03 UTC 12,548 bytes, 518 lines download raw bytes

1/**
2 * Site-wide text zoom (A− / A / A+). CSS: css/menu.css (--site-text-scale, html zoom).
3 * Runs when this file loads (footer) to apply stored scale ASAP; binds toolbar on DOM ready.
4 */
5(function () {
6  var STORAGE_KEY = 'mpt_site_text_scale';
7  var LEGACY_KEY = 'mpt_site_text_size';
8  var MIN = 0.75;
9  var MAX = 1.55;
10  var STEP = 0.1;
11
12  function clampScale(n) {
13    if (isNaN(n)) return 1;
14    var r = Math.round(n * 100) / 100;
15    return Math.min(MAX, Math.max(MIN, r));
16  }
17
18  function readStoredScale() {
19    try {
20      var raw = localStorage.getItem(STORAGE_KEY);
21      if (raw !== null && raw !== '') {
22        var s = parseFloat(raw);
23        if (!isNaN(s)) return clampScale(s);
24      }
25      var t = localStorage.getItem(LEGACY_KEY);
26      if (t === 'small') return 0.9;
27      if (t === 'large') return 1.2;
28    } catch (e) {}
29    return 1;
30  }
31
32  function applyScale(scale) {
33    scale = clampScale(scale);
34    document.documentElement.style.setProperty('--site-text-scale', String(scale));
35    try {
36      localStorage.setItem(STORAGE_KEY, String(scale));
37    } catch (e) {}
38
39    var buttons = document.querySelectorAll('.header .font-size-btn');
40    for (var i = 0; i < buttons.length; i++) {
41      var b = buttons[i];
42      var tier = b.getAttribute('data-tier');
43      var pressed = 'false';
44      if (tier === 'normal' && scale === 1) pressed = 'true';
45      else if (tier === 'small' && scale < 1) pressed = 'true';
46      else if (tier === 'large' && scale > 1) pressed = 'true';
47      b.setAttribute('aria-pressed', pressed);
48    }
49    try {
50      window.setTimeout(function () {
51        window.dispatchEvent(new Event('resize'));
52      }, 0);
53    } catch (e) {}
54  }
55
56  function bootstrapScaleFromStorage() {
57    try {
58      document.documentElement.style.setProperty('--site-text-scale', String(readStoredScale()));
59    } catch (e) {}
60  }
61
62  function initFontSizeToolbar() {
63    applyScale(readStoredScale());
64
65    var btns = document.querySelectorAll('.header .font-size-btn');
66    for (var j = 0; j < btns.length; j++) {
67      btns[j].addEventListener('click', function () {
68        var tier = this.getAttribute('data-tier');
69        var current = parseFloat(
70          getComputedStyle(document.documentElement).getPropertyValue('--site-text-scale').trim()
71        );
72        if (isNaN(current)) current = readStoredScale();
73
74        if (tier === 'small') {
75          applyScale(current - STEP);
76        } else if (tier === 'large') {
77          applyScale(current + STEP);
78        } else {
79          applyScale(1);
80        }
81      });
82    }
83  }
84
85  bootstrapScaleFromStorage();
86
87  if (document.readyState === 'loading') {
88    document.addEventListener('DOMContentLoaded', initFontSizeToolbar);
89  } else {
90    initFontSizeToolbar();
91  }
92})();
93
94
95	
96
97// Navbar hover animatio
98$(function(){
99
100    setTimeout(function() {
101        $('.tab-pane.active .initial_content').fadeOut('fast');
102    }, 2000);
103
104
105
106
107     
108
109    var lastScrollTop = 0;
110    $(window).on('scroll', function() {
111        ss = $(this).scrollTop();
112        if(ss < lastScrollTop) {
113             $(".header").removeClass("not-visible");
114        }
115        else {
116             $(".header").addClass("not-visible");
117        }
118        lastScrollTop = ss;
119    });
120
121});
122
123
124
125$(document).ready(function () {
126  function mptSyncHeaderHeightVar() {
127    var el = document.querySelector(".header");
128    if (!el) return;
129    var h = Math.round(el.getBoundingClientRect().height || el.offsetHeight);
130    if (h < 72) h = 150;
131    document.documentElement.style.setProperty("--mpt-header-height", h + "px");
132  }
133
134  mptSyncHeaderHeightVar();
135  requestAnimationFrame(function () {
136    mptSyncHeaderHeightVar();
137  });
138  $(window).on("load resize", mptSyncHeaderHeightVar);
139
140  function mptHeaderStickThreshold() {
141    var raw = getComputedStyle(document.documentElement)
142      .getPropertyValue("--mpt-header-height")
143      .trim();
144    var px = parseInt(raw, 10);
145    return !isNaN(px) && px > 0 ? px : 150;
146  }
147
148  $(window).on("scroll", function () {
149    var sc = $(window).scrollTop();
150    if (sc > mptHeaderStickThreshold()) {
151      $(".header").addClass("fixed-header");
152      $(".planitinerary-cnt").addClass("show-form");
153    } else {
154      $(".header").removeClass("fixed-header not-visible");
155      $(".planitinerary-cnt").removeClass("show-form");
156    }
157  });
158});
159// range slider
160
161$(document).ready(function() {
162  var rangeInput = $("#cowbell");
163  var rangeValue = $(".rangevalu span");
164  
165  // Set initial value
166  rangeValue.text(rangeInput.val());
167  
168  // Update value on all types of input
169  rangeInput.on('input change touchstart touchmove touchend', function() {
170    var value = $(this).val();
171    rangeValue.text(value);
172  });
173});
174
175// close Notification
176
177$(document).ready(function() {
178 
179  $(".close-notification").click(function(){
180    $(".notification").hide("slide", { direction: "right" }, 1000);
181    $(".noti-icon").addClass("active-icon");
182  });
183  $(".noti-icon").click(function(){
184    $(".notification").show("slide", { direction: "right" }, 1000);
185    $(".noti-icon").removeClass("active-icon");
186  });
187   
188});
189
190
191// Search popup
192$(document).ready(function() {
193
194  $(".search-item").click(function(){
195    $(".serch-pop").addClass("active-ser-pop");
196  });
197
198  $(".close-pop").click(function(){
199    $(".serch-pop").removeClass("active-ser-pop");
200  });
201
202});
203// select box
204
205$(document).ready(function() {
206$('select').niceSelect();
207});
208
209// Scrolling animation
210$('.animate').scrolla({
211  mobile: true,
212  once: true
213});
214
215// owl carousel
216var owl = $('.event-slider');
217owl.owlCarousel({
218  stagePadding: 160,
219  loop:true,
220  margin:20,
221  nav:false,
222  items:1,
223  smartSpeed : 800, 
224  touchDrag: false,
225  mouseDrag: false,
226  responsiveClass: true,
227  responsive:{
228      0:{
229          items:1,
230          stagePadding: 0,
231      },
232      400:{
233          items:1,
234          stagePadding: 0,
235          margin:0
236      },
237      1000:{
238          items:1,
239      }
240  }
241});
242$('.customNextBtn').click(function() {
243  owl.trigger('next.owl.carousel');
244});
245$('.customPreviousBtn').click(function() {
246  owl.trigger('prev.owl.carousel');
247});
248
249
250
251$(document).ready(function() {
252  var $events_txt = $('.owl-item.active .eventsslide-item .overly-txt').clone();
253  $('.events-slide-txt').html($events_txt);
254  $('.customNextBtn, .customPreviousBtn').click(function() {
255    var $events_txt = $('.owl-item.active .eventsslide-item .overly-txt').clone();
256    $('.events-slide-txt').html($events_txt);
257  });
258 
259});
260
261
262
263// Related owl carousel
264var related_owl = $('.related-slider');
265related_owl.owlCarousel({
266  loop:true,
267  margin:0,
268  items:1,
269  autoplay: true,
270  nav:true,
271  navText:['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
272  smartSpeed : 800,
273  responsive:{
274      0:{
275          items:1
276      },
277      600:{
278          items:1
279      },
280      1000:{
281          items:1,
282      }
283  }
284});
285$('.relatedNextBtn').click(function() {
286  related_owl.trigger('next.owl.carousel');
287});
288$('.relatedPreviousBtn').click(function() {
289  related_owl.trigger('prev.owl.carousel');
290});
291
292
293
294
295
296// Notification Scrolltop
297$(document).ready(function() {
298  $( ".notification-click" ).click(function( event ) {
299    event.preventDefault();
300    $("html, body").animate({ 
301      scrollTop: $($(this).attr("href")).offset().top - 110
302    }, 800);
303  });
304});
305
306
307
308
309
310$.simpleTicker($("#ticker-fade"),{
311  speed : 1000,
312  delay : 5000,
313  easing : 'swing',
314  effectType : 'slide'
315});
316
317
318
319// $(function() {
320//   $("#video-tabs").tabs({
321//     hide:{effect:"slide", direction:"left"},
322//     show:{effect:"slide", direction:"right"}
323//   });
324// });
325
326$(function() {
327  // $("#heritage-tabs").tabs({
328  //   hide:{effect:"slide", direction:"left"},
329  //   show:{effect:"slide", direction:"right"}
330  // });
331
332  $("#heritage-tabs .js-tabs-nav .nav-tabs-link").aniTabs({animation:"slide", animationSpeed:800, slideDirection:"left", drag:false,autoHeight:false});
333});
334
335// Custom video button
336
337/*$('.video').parent().click(function () {
338  if($(this).children(".video").get(0).paused){$(this).children(".video").get(0).play();   $(this).children(".playpause").fadeOut();
339    }else{       $(this).children(".video").get(0).pause();
340  $(this).children(".playpause").fadeIn();
341    }
342});*/
343
344
345
346  jQuery(function($){
347    $(".rvs-container").rvslider();
348    
349    $(".story-carousel").owlCarousel({
350                  loop:false,
351                  margin:10,
352                  items:1,
353                  dots:false,
354                  nav:true,
355                  navText:['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
356                  smartSpeed : 800,
357                  responsive:{
358                      0:{
359                          items:1
360                      },
361                      401:{
362                          items:1
363                      },
364                      600:{
365                          items:2
366                      },
367                      1000:{
368                          items:3,
369                      }
370                  }
371                });
372    
373
374  });
375
376$(window).on('load', function() {
377	// Animate loader off screen
378	jQuery(".se-pre-con").fadeOut("slow");
379});
380
381$(document).ready(function(){
382  $(".header .menu-icon").click(function(){
383    $(".collapse-menu").addClass("show-hide-menu");
384  });
385
386  $(".close-rt-pnl").click(function(){
387    $(".collapse-menu").removeClass("show-hide-menu");
388  });
389  
390  $('.header .nav-item').click(function(){
391      
392      if($(window).width() < 768){
393        $(this).toggleClass("active-toggle");
394      }
395  });
396
397  $('.header .nav-link').click(function(){
398    if($(window).width() < 768){
399    $(this).toggleClass("active");
400    }
401  });
402
403});
404
405
406
407
408
409
410
411$(document).ready(function() {
412
413  var sync1 = $("#sync1");
414  var sync2 = $("#sync2");
415  var slidesPerPage = 12; //globaly define number of elements per page
416  var syncedSecondary = true;
417
418  sync1.owlCarousel({
419    items : 1,
420    slideSpeed : 2000,
421    nav: true,
422    navText: ['<div class="owl-arrows"><i class="fa fa-angle-left" aria-hidden="true"></i></div>','<div class="owl-arrows"><i class="fa fa-angle-right" aria-hidden="true"></i></div>'],
423    autoplay: false,
424    dots: false,
425    loop: true,
426    responsiveRefreshRate : 200,
427   
428  }).on('changed.owl.carousel', syncPosition);
429
430  sync2
431    .on('initialized.owl.carousel', function () {
432      sync2.find(".owl-item").eq(0).addClass("current");
433    })
434    .owlCarousel({
435    items : slidesPerPage,
436    dots: false,
437    margin: 10,
438    nav: true,
439    navText: ['<div class="owl-arrows"><i class="fa fa-arrow-left" aria-hidden="true"></i></div>','<div class="owl-arrows"><i class="fa fa-arrow-right" aria-hidden="true"></i></div>'],
440    smartSpeed: 200,
441    slideSpeed : 500,
442    slideBy: slidesPerPage, //alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel
443    responsiveRefreshRate : 100,
444    responsiveClass: true,
445    responsive: {
446        0:{
447          items: 3
448        },
449        480:{
450          items: 3
451        },
452        769:{
453          items: slidesPerPage,
454        }
455    }
456  }).on('changed.owl.carousel', syncPosition2);
457
458  function syncPosition(el) {
459    //if you set loop to false, you have to restore this next line
460    //var current = el.item.index;
461    
462    //if you disable loop you have to comment this block
463    var count = el.item.count-1;
464    var current = Math.round(el.item.index - (el.item.count/2) - .5);
465    
466    if(current < 0) {
467      current = count;
468    }
469    if(current > count) {
470      current = 0;
471    }
472    
473    //end block
474
475    sync2
476      .find(".owl-item")
477      .removeClass("current")
478      .eq(current)
479      .addClass("current");
480    var onscreen = sync2.find('.owl-item.active').length - 1;
481    var start = sync2.find('.owl-item.active').first().index();
482    var end = sync2.find('.owl-item.active').last().index();
483    
484    if (current > end) {
485      sync2.data('owl.carousel').to(current, 100, true);
486    }
487    if (current < start) {
488      sync2.data('owl.carousel').to(current - onscreen, 100, true);
489    }
490  }
491  
492  function syncPosition2(el) {
493    if(syncedSecondary) {
494      var number = el.item.index;
495      sync1.data('owl.carousel').to(number, 100, true);
496    }
497  }
498  
499  sync2.on("click", ".owl-item", function(e){
500    e.preventDefault();
501    var number = $(this).index();
502    sync1.data('owl.carousel').to(number, 300, true);
503  });
504
505
506
507
508
509
510
511$(".open-lightbox").click(function(){
512  $(".custom-lightbox").addClass("lightbox-opend");
513});
514$(".lightbox-close").click(function(){
515  $(".custom-lightbox").removeClass("lightbox-opend");
516});
517
518});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.