// resize Tab class function resize() { if ($(window).width() < 478) { $('.awardTabs').removeClass('nav-center'); } else { $('.awardTabs').addClass('nav-center'); } } $(document).ready( function() { $(window).resize(resize); resize(); }); // nav toggle dropdown $(".dropdown-menu").hide(); $('.dropdown .nav-link').click(function(e){ e.preventDefault(); // hide all span var $this = $(this).parent().find('.dropdown-menu'); $(".dropdown-menu").not($this).hide(); $this.slideToggle('fast'); }); // nav sub dropdown $("#Nav-subfinance").hide(); $('#Nav-finance').click(function() { $("#Nav-subCorporate").slideUp(); $("#Nav-subfinance").slideToggle('fast'); }); $("#Nav-subCorporate").hide(); $('#Nav-Corporate').click(function() { $("#Nav-subfinance").slideUp(); $("#Nav-subCorporate").slideToggle('fast'); }); // scroll change nav image $(document).on('scroll', function() { if ($(document).scrollTop() >= 50) { $('.navbar-brand img').css('height', '60px'); $('.nav-dropmenu').css('top', '53px'); } else { $('.navbar-brand img').css('height', '90px'); $('.nav-dropmenu').css('top', '69px'); } }); $(window).click(function() { $(".dropdown-menu").slideUp('fast'); }); $('.nav-dropmenu').click(function(event){ event.stopPropagation(); }); // Scroll to Top $(document).ready(function() { //Check to see if the window is top if not then display button $(window).scroll(function() { if ($(this).scrollTop() > 100) { $('.scrollToTop').fadeIn(); } else { $('.scrollToTop').fadeOut(); } }); //Click event to scroll to top $('.scrollToTop').click(function() { $('html, body').animate({ scrollTop: 0 }, 500); return false; }); }); // tab click onload $('.nav-tabs li.active').removeClass('active').find('a').trigger('click'); // Google map change $(".EachLocation").click(function(){ $( ".EachLocation-DataActive" ).removeClass( "EachLocation-DataActive" ).addClass( "EachLocation-Data" ); $(this).children(".EachLocation-Data").removeClass( "EachLocation-Data" ).addClass( "EachLocation-DataActive" ); }); // slider item $(document).ready(function() { var itemsMainDiv = ('.MultiCarousel'); var itemsDiv = ('.MultiCarousel-inner'); var itemWidth = ""; $('.leftLst, .rightLst').click(function() { var condition = $(this).hasClass("leftLst"); if (condition) click(0, this); else click(1, this) }); ResCarouselSize(); $(window).resize(function() { ResCarouselSize(); }); //this function define the size of the items function ResCarouselSize() { var incno = 0; var dataItems = ("data-items"); var itemClass = ('.item'); var id = 0; var btnParentSb = ''; var itemsSplit = ''; var sampwidth = $(itemsMainDiv).width(); var bodyWidth = $('body').width(); $(itemsDiv).each(function() { id = id + 1; var itemNumbers = $(this).find(itemClass).length; btnParentSb = $(this).parent().attr(dataItems); itemsSplit = btnParentSb.split(','); $(this).parent().attr("id", "MultiCarousel" + id); if (bodyWidth >= 1200) { incno = itemsSplit[3]; itemWidth = sampwidth / incno; } else if (bodyWidth >= 992) { incno = itemsSplit[2]; itemWidth = sampwidth / incno; } else if (bodyWidth >= 768) { incno = itemsSplit[1]; itemWidth = sampwidth / incno; } else { incno = itemsSplit[0]; itemWidth = sampwidth / incno; } $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers }); $(this).find(itemClass).each(function() { $(this).outerWidth(itemWidth); }); $(".leftLst").addClass("over"); $(".rightLst").removeClass("over"); }); } //this function used to move the items function ResCarousel(e, el, s) { var leftBtn = ('.leftLst'); var rightBtn = ('.rightLst'); var translateXval = ''; var divStyle = $(el + ' ' + itemsDiv).css('transform'); var values = divStyle.match(/-?[\d\.]+/g); var xds = Math.abs(values[4]); if (e == 0) { translateXval = parseInt(xds) - parseInt(itemWidth * s); $(el + ' ' + rightBtn).removeClass("over"); if (translateXval <= itemWidth / 2) { translateXval = 0; $(el + ' ' + leftBtn).addClass("over"); } } else if (e == 1) { var itemsCondition = $(el).find(itemsDiv).width() - $(el).width(); translateXval = parseInt(xds) + parseInt(itemWidth * s); $(el + ' ' + leftBtn).removeClass("over"); if (translateXval >= itemsCondition - itemWidth / 2) { translateXval = itemsCondition; $(el + ' ' + rightBtn).addClass("over"); } } $(el + ' ' + itemsDiv).css('transform', 'translateX(' + -translateXval + 'px)'); } //It is used to get some elements from btn function click(ell, ee) { var Parent = "#" + $(ee).parent().attr("id"); var slide = $(Parent).attr("data-slide"); ResCarousel(ell, Parent, slide); } }); // investment subtab $( "#FinancialLink" ).hide(); $( "#CorporateContent" ).hide(); $('#FinancialBTN').click(function() { $("#FinancialLink").slideToggle(); var src = $(".ToggleArrow").attr('src') == "../img/close.png" ? "../img/open.png" : "../img/close.png"; $(".ToggleArrow").attr('src', src); }); $('#FinancialBTNFFF').click(function() { $("#FinancialLink").slideToggle(); var src = $(".ToggleArrowFFF").attr('src') == "../img/close-fff.png" ? "../img/open-fff.png" : "../img/close-fff.png"; $(".ToggleArrowFFF").attr('src', src); }); $('#CorporateBTN').click(function() { $("#CorporateContent").slideToggle(); var src = $("#CorToggleArrow").attr('src') == "../img/close.png" ? "../img/open.png" : "../img/close.png"; $("#CorToggleArrow").attr('src', src); }); $('#CorporateBTNFFF').click(function() { $("#CorporateContent").slideToggle(); var src = $("#CorToggleArrowFFF").attr('src') == "../img/close-fff.png" ? "../img/open-fff.png" : "../img/close-fff.png"; $("#CorToggleArrowFFF").attr('src', src); }); // responsive tab (function($) { 'use strict'; $(document).on('show.bs.tab', '.nav-tabs-responsive [data-toggle="tab"]', function(e) { var $target = $(e.target); var $tabs = $target.closest('.nav-tabs-responsive'); var $current = $target.closest('li'); var $parent = $current.closest('li.dropdown'); $current = $parent.length > 0 ? $parent : $current; var $next = $current.next(); var $prev = $current.prev(); var updateDropdownMenu = function($el, position){ $el .find('.dropdown-menu') .removeClass('pull-xs-left pull-xs-center pull-xs-right') .addClass( 'pull-xs-' + position ); }; $tabs.find('>li').removeClass('next prev'); $prev.addClass('prev'); $next.addClass('next'); updateDropdownMenu( $prev, 'left' ); updateDropdownMenu( $current, 'center' ); updateDropdownMenu( $next, 'right' ); }); })(jQuery); $('#Tab-01').click(function(){ $('#tab-01Img').attr('src', '../img/Logo_BH.png'); $('#tab-02Img').attr('src', '../img/LOGO_CH_dim.png'); $('#tab-03Img').attr('src', '../img/LOGO_PC_dim.png'); $('#tab-04Img').attr('src', '../img/LOGO_PM_dim.png'); $('#tab-05Img').attr('src', '../img/LOGO_LG_dim.png'); }); $('#Tab-02').click(function(){ $('#tab-01Img').attr('src', '../img/LOGO_BH_dim.png'); $('#tab-02Img').attr('src', '../img/Logo_CH.png'); $('#tab-03Img').attr('src', '../img/LOGO_PC_dim.png'); $('#tab-04Img').attr('src', '../img/LOGO_PM_dim.png'); $('#tab-05Img').attr('src', '../img/LOGO_LG_dim.png'); }); $('#Tab-03').click(function(){ $('#tab-01Img').attr('src', '../img/LOGO_BH_dim.png'); $('#tab-02Img').attr('src', '../img/LOGO_CH_dim.png'); $('#tab-03Img').attr('src', '../img/Logo_PCYT.png'); $('#tab-04Img').attr('src', '../img/LOGO_PM_dim.png'); $('#tab-05Img').attr('src', '../img/LOGO_LG_dim.png'); }); $('#Tab-04').click(function(){ $('#tab-01Img').attr('src', '../img/LOGO_BH_dim.png'); $('#tab-02Img').attr('src', '../img/LOGO_CH_dim.png'); $('#tab-03Img').attr('src', '../img/LOGO_PC_dim.png'); $('#tab-04Img').attr('src', '../img/Logo_PM.png'); $('#tab-05Img').attr('src', '../img/LOGO_LG_dim.png'); }); $('#Tab-05').click(function(){ $('#tab-01Img').attr('src', '../img/LOGO_BH_dim.png'); $('#tab-02Img').attr('src', '../img/LOGO_CH_dim.png'); $('#tab-03Img').attr('src', '../img/LOGO_PC_dim.png'); $('#tab-04Img').attr('src', '../img/LOGO_PM_dim.png'); $('#tab-05Img').attr('src', '../img/Logo_LG.png'); });