jQuery(function ($) { $(".gallery-tab-title-icon img").attr({width:"32",height:"24"}); $('.embed').click(function(){ $('.example1').fadeIn(10000) }); $(".mega-menu .imcm").addClass("cbp-hrmenu"); $(".mega-menu .imsc").addClass("cbp-hrsub"); $(".mega-menu .imsubc").addClass("cbp-hrsub-inner"); $(".mega-menu .Menu >span>div>.imcm > ul > li").each(function () { $(this).hover(function () { $(".mega-menu .Menu >span>div>.imcm > ul > li").removeClass("cbp-hropen"); $(this).toggleClass("cbp-hropen"); }); $(this).mouseleave(function () { $(".mega-menu .Menu >span>div>.imcm > ul > li").removeClass("cbp-hropen"); }); }); $(".collapse-button").click(function () { $(".mega-menu").toggle("slow"); }); $(function () { cbpHorizontalMenu.init(); }); jQuery("document").ready(function ($) { $('table.PrintControl').appendTo('.print') }); $(window).scroll(function () { if ($(window).scrollTop() > 100) { $(".navbar-fixed-top").addClass('past-main'); } else { $(".navbar-fixed-top").removeClass('past-main'); } }); (function ($) { $.fn.countTo = function (options) { options = options || {}; return $(this).each(function () { var settings = $.extend({}, $.fn.countTo.defaults, { from: $(this).data('from'), to: $(this).data('to'), speed: $(this).data('speed'), refreshInterval: $(this).data('refresh-interval'), decimals: $(this).data('decimals') }, options); var loops = Math.ceil(settings.speed / settings.refreshInterval), increment = (settings.to - settings.from) / loops; var self = this, $self = $(this), loopCount = 0, value = settings.from, data = $self.data('countTo') || {}; $self.data('countTo', data); if (data.interval) { clearInterval(data.interval); } data.interval = setInterval(updateTimer, settings.refreshInterval); render(value); function updateTimer() { value += increment; loopCount++; render(value); if (typeof (settings.onUpdate) == 'function') { settings.onUpdate.call(self, value); } if (loopCount >= loops) { $self.removeData('countTo'); clearInterval(data.interval); value = settings.to; if (typeof (settings.onComplete) == 'function') { settings.onComplete.call(self, value); } } } function render(value) { var formattedValue = settings.formatter.call(self, value, settings); $self.html(formattedValue); } }); }; $.fn.countTo.defaults = { from: 0, to: 0, speed: 1000, refreshInterval: 100, decimals: 0, formatter: formatter, onUpdate: null, onComplete: null }; function formatter(value, settings) { return value.toFixed(settings.decimals); } } (jQuery)); jQuery(function ($) { $('#count-number').data('countToOptions', { formatter: function (value, options) { return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); } }); $('#count-number2').data('countToOptions', { formatter: function (value, options) { return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); } }); $('#count-number3').data('countToOptions', { formatter: function (value, options) { return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); } }); $('#count-number4').data('countToOptions', { formatter: function (value, options) { return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); } }); $('.timer').each(count); function count(options) { var $this = $(this); options = $.extend({}, options || {}, $this.data('countToOptions') || {}); $this.countTo(options); } }); $(window).scroll(function () { if ($(this).scrollTop() > 300) { $('.scrollToTop').fadeIn(); } else { $('.scrollToTop').fadeOut(); } }); $('.scrollToTop').click(function () { $('html, body').animate({ scrollTop: 0 }, 800); return false; }); jQuery(window).load(function () { $('#status').fadeOut(); $('#preloader').delay(100).fadeOut('slow'); $('body').delay(100).css({ 'overflow': 'visible' }); }) var lastId, topMenu = $("#top-menu"), topMenuHeight = topMenu.outerHeight() + 13, menuItems = topMenu.find("a"), scrollItems = menuItems.map(function () { var item = $(this).attr("href"); if (item.length) { return item; } }); /* menuItems.click(function (e) { var href = $(this).attr("href"), offsetTop = href === "#" ? 0 : $(href).offset().top - topMenuHeight + 1; $('html, body').stop().animate({ scrollTop: offsetTop }, 900); e.preventDefault(); });*/ /*$(window).scroll(function () { var fromTop = $(this).scrollTop() + topMenuHeight; var cur = scrollItems.map(function () { if ($(this).offset().top < fromTop) { return this; } }); cur = cur[cur.length - 1]; var id = cur && cur.length ? cur[0].id : ""; if (lastId !== id) { lastId = id; menuItems.parent().removeClass("active").end().filter("[href=#" + id + "]").parent().addClass("active"); } })*/ }); var cbpHorizontalMenu = (function () { var b = $(".mega-menu .imcm > ul > li"), g = b.children("a"), c = $("body"), d = -1; function f() { g.on("mouseenter", a); b.on("mouseenter", function (h) { h.stopPropagation() }) } function a(j) { if (d !== -1) { b.eq(d).removeClass("cbp-hropen") } var i = $(j.currentTarget).parent("li"), h = i.index(); if (d === h) { i.removeClass("cbp-hropen"); d = -1 } else { i.addClass("cbp-hropen"); d = h; c.off("mouseenter").on("mouseenter", e) } return false } function e(h) { b.eq(d).removeClass("cbp-hropen"); d = -1 } return { init: f } })(); $(document).on("scroll", function () { if ($(document).scrollTop() > 120) { $("nav").addClass("small"); } else { $("nav").removeClass("small"); } }); jQuery("document").ready(function ($) { $('table.PrintControl').appendTo('.print'); $(".NavigationBar .NavigationCurrent").each(function () { $(this).text(" > "); }) $("a[rel='country2']").click(function(){ window.dispatchEvent(new Event('resize'));}) }); /////////////////////////////////////////////////////////////////////////////////////////////////// $(document).on('click', '#ulaitem0z2', function () { $("#countrytabs li:first-child a").click(); }); function heighti(){ var hei=$("#News-article .container").height(); $(".news").height(hei); }; $(function(){ setInterval("heighti",200); }) // menu-responsive $(document).ready(function () { var Flag = 0; $('.mega-menu .cdd0_main_menu li ').each(function () { if ($(this).find('.imsubc').length > 0) { $(this).addClass('hassubmenu') } }) function MenuResponsive() { if (window.matchMedia("(max-width: 768px)").matches && !Flag) { $('.mega-menu .cdd0_main_menu > li>a').click(function () { $('.cdd0_main_menu> li >a').not(this).parent().children('.imsc').children('.imsubc').css('display', 'none') $('.cdd0_main_menu> li> a').not(this).parent().removeClass('submenuisopen') $(this).parent().toggleClass('submenuisopen'); $(this).parent().children('.imsc').children('.imsubc').fadeToggle(); }) $('.mega-menu .cdd0_main_menu .cdd0_sub_menu > li >a').click(function () { $('.mega-menu .cdd0_main_menu .cdd0_sub_menu > li >a').not(this).parent().children('.imsc').children('.imsubc').css('display', 'none') $('.mega-menu .cdd0_main_menu .cdd0_sub_menu > li> a').not(this).parent().removeClass('submenuisopen') $(this).parent().toggleClass('submenuisopen') $(this).parent().children('.imsc').children('.imsubc').fadeToggle(); }); Flag = 1; } else { $('.mega-menu .cdd0_main_menu li .imsubc').css('display', ''); } } MenuResponsive(); $(window).resize(function () { $('.mega-menu .cdd0_main_menu li .imsubc').slideUp(); $('.mega-menu .cdd0_main_menu li ').removeClass('submenuisopen') MenuResponsive(); }) })