/*1769700258000*/ /*1769700258000*/ function headers_header_myFunction() { let x = document.getElementById("searchMenu"); if (x.style.display === "none") { x.style.display = "flex"; document.getElementById("openSearch").style.display = "none"; } else { x.style.display = "none"; } } $('[data-toggle="popover"]').popover({ placement : 'bottom', height: 'auto', html : true, title :"" , }); $(document).on("click", ".popover .close" , function(){ $(this).parents(".popover").popover('hide'); }); $('.popover-dismiss').popover({ trigger: 'focus' }) $('input.animate-label').focus(function(){ $(this).parents('.form-group').addClass('focused'); }); $('input.animate-label').blur(function(){ var inputValue = $(this).val(); if ( inputValue == "" ) { $(this).removeClass('filled'); $(this).parents('.form-group').removeClass('focused'); } else { $(this).addClass('filled'); } }) if ($(window).width() < 992) { $('#tables_comparator #sticky-header').css({ // scroll to that element or below it display: 'block', position: 'sticky', top: '124px' }); } /* ----- Start Header ------- */ function headers_header_myFunction45() { let x = document.getElementById("searchMenu5"); if (x.style.display === "none") { x.style.display = "flex"; document.getElementById("openSearch5").style.display = "none"; } else { x.style.display = "none"; } } function close_search45(){ let x = document.getElementById("searchMenu5"); if (x.style.display === "flex") { x.style.display = "none"; document.getElementById("openSearch5").style.display = "block"; } else { x.style.display = "none"; } } function close_search(){ let x = document.getElementById("searchMenu"); if (x.style.display === "flex") { x.style.display = "none"; document.getElementById("openSearch").style.display = "block"; } else { x.style.display = "none"; } } function remove_text(){ $('.search-item').val(''); } function headers_header_myFunction2() { let x = document.getElementById("searchMenu3"); if (x.style.display === "none") { x.style.display = "block"; document.getElementById("openSearch2").style.display = "none"; } else { x.style.display = "none"; } } function headers_header_mobileOpen() { let x = document.getElementById("openMobileMenu"); if (x.style.display === "none") { x.style.display = "block"; document.getElementById("secondMobileMenu").style.display = "block"; } else { x.style.display = "none"; document.getElementById("secondMobileMenu").style.display = "none"; } } function headers_header_change_icon() { if ($('#navbarSupportedContent').hasClass('show')) { $('.navbar-toggler-icon , .navbar-light .navbar-brand , .mobile-login').css('display','flex'); $('#cross-icon-header').hide(); $(this).hide(); $('html').removeClass('overflow-y-hidden'); } else { $('.navbar-toggler-icon , .navbar-light .navbar-brand , .mobile-login').hide(); $('#cross-icon-header').css('display','block'); $('html').addClass('overflow-y-hidden'); $('.customer-access-dropdown-content').hide(); } hideMenuText(); hideShowMainLogo(); } $(document).ready(function(){ $('#_com_liferay_login_web_portlet_LoginPortlet_password').attr('autocomplete','off'); $('a').each(function(){ var currentTitle = $(this).text(); $(this).attr('title', currentTitle); }); $('.header-top-style .options .nav-link').click(function(){ $(this).parent().parent().find(".tabcontent").css('display','none'); $(this).parent().parent().find(".tabcontent[id='"+$(this).attr('data-id')+"']").css('display','block'); $(this).parent().find(".nav-link").removeClass('active'); $(this).addClass('active'); }); menuShowHide(); $('.content-menu ul.list').closest('.acc__panel').find('i').show(); // $('input[type=number]').on('input propertychange', function() { // charLimit(this, 16); // }); $('input[type=number].applyNowNationalId, input[type=number].type3NationalId, input[type=number].typeFourApplyNowNationalId, input[type=number].typeFiveNationalId, input[type=number].hfNationalId').on('input propertychange', function() { charLimit(this, 10); }); $('textarea').on('keypress', function (event) { var regex = new RegExp("^[\u0600-\u06FF0-9a-zA-Z\n\r. -]+$"); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); if (!regex.test(key)) { event.preventDefault(); return false; } }); $('.layout-content input[type=text]').on('keypress', function (event) { var regex = new RegExp("^[\u0600-\u06FF0-9a-zA-Z\n\r. -]+$"); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); if (!regex.test(key)) { event.preventDefault(); return false; } }); function charLimit(input, maxChar) { var len = $(input).val().length; if (len > maxChar) { $(input).val($(input).val().substring(0, maxChar)); } } $('input[type=number]').keydown(function(e){ if ([69, 107, 109, 187, 188, 189, 190].includes(e.keyCode)) { e.preventDefault(); } }); $('#tables_comparator .arrow.arrow-left').prop('disabled', true); $('.switch-and-cards.tables_comparator').scroll(function(){ var currentScrollPosition = $(this).scrollLeft(); currentScrollPosition = Math.ceil(currentScrollPosition); var scrollableElement = $('.switch-and-cards.tables_comparator')[0]; var maxScrollPosition = scrollableElement.scrollWidth; var elementClientWidht = scrollableElement.clientWidth; var desiredWidth = maxScrollPosition - elementClientWidht; var scrollDifference = Math.abs(currentScrollPosition - desiredWidth); desiredWidth = Math.ceil(desiredWidth); if (currentScrollPosition == 0) { $('#tables_comparator .arrow.arrow-left').prop('disabled', true); $('#tables_comparator .arrow.arrow-right').prop('disabled', false); } else if (scrollDifference < 3) { $('#tables_comparator .arrow.arrow-left').prop('disabled', false); $('#tables_comparator .arrow.arrow-right').prop('disabled', true); } else { $('#tables_comparator .arrow.arrow-left').prop('disabled', false); $('#tables_comparator .arrow.arrow-right').prop('disabled', false); } }); }); scrollAnimations = (className) => { $(className).each(function(){ var isThisVisible = $(this).is(':visible'); if(isThisVisible) { var resultsTop = $(this).offset().top; resultsTop-=250; $('html, body').animate({ scrollTop: resultsTop }, 1000); return false; } }); } hideMenuText = () => { var paraContent, imageContent; $('.content-menu ul.only-mobile li').each(function(){ if($(this).find('.tableCommonHeading').length) { paraContent = $(this).find('.tableCommonHeading').html(); imageContent = $(this).find('.tableCommonHeading + div').html(); $(this).find('.tableCommonHeading + div').remove(); $(this).find('.tableCommonHeading').remove(); $(this).find('.acc__panel').append(paraContent); $(this).find('.acc__panel').append(imageContent); } }) } hideShowMainLogo = () => { $(window).resize(function(){ if($(this).width() > 992) { $('.navbar-brand.logo').show(); } else { if($('.only-mobile + .content-menu').hasClass('show')) { $('.navbar-brand.logo').hide(); } else { $('.navbar-brand.logo').show(); } } }) } // $(function() { // $('.nav-item.acc__card h6').click(function(j) { // var dropDown = $(this).parent().find('.acc__panel'); // $(this).closest('.acc__panel.active').find('.acc__panel').not(dropDown).slideUp(); // if ($(this).hasClass('active')) { // $(this).removeClass('active'); // $(this).find('.icon-minus').removeClass('icon-minus').addClass('icon-plus'); // } else { // $(this).closest('.acc__panel.active').find('.acc__title.active').removeClass('active'); // $(this).closest('.acc__panel.active').find('.icon-minus').removeClass('icon-minus').addClass('icon-plus'); // $(this).addClass('active'); // $(this).find('.icon-plus').removeClass('icon-plus').addClass('icon-minus'); // } // dropDown.stop(false, true).slideToggle(); // j.preventDefault(); // }); // }); // $(function() { // $('ul.only-mobile li .acc__title').click(function(j) { // var dropDown = $(this).parent().find('.acc__panel'); // $(this).closest('ul.only-mobile').find('.acc__panel').not(dropDown).slideUp(); // $(this).parent().find('>i.only-mobile').toggleClass('icon-minus icon-plus'); // $(this).toggleClass('active'); // // if ($(this).hasClass('active')) { // // $(this).removeClass('active'); // // $(this).parent().find('> i.only-mobile').removeClass('icon-minus').addClass('icon-plus'); // // } else { // // $(this).closest('ul.only-mobile').find('> .acc__title.active').removeClass('active'); // // $(this).closest('ul.only-mobile').find('> i.only-mobile').removeClass('icon-minus').addClass('icon-plus'); // // $(this).addClass('active'); // // $(this).parent().find('> i.only-mobile').removeClass('icon-plus').addClass('icon-minus'); // // } // dropDown.stop(false, true).slideToggle(); // j.preventDefault(); // }); // $('ul.only-mobile li > i.only-mobile').click(function(k){ // var dropDown = $(this).parent().find('.acc__panel'); // $(this).closest('ul.only-mobile').find('.acc__panel').not(dropDown).slideUp(); // $(this).toggleClass('icon-minus icon-plus'); // $(this).parent().find('a.acc__title').toggleClass('active'); // //var hasActive = $(this).parent().find('a.acc_title').hasClass('active'); // // if (!hasActive) { // // $(this).removeClass('icon-plus').addClass('icon-minus'); // // $(this).parent().find('a.acc__title').addClass('active'); // // } else { // // $(this).removeClass('icon-minus').addClass('icon-plus'); // // $(this).parent().find('a.acc__title').removeClass('active'); // // } // dropDown.stop(false, true).slideToggle(); // k.preventDefault(); // }) // }); //Mobile menu fix $(document).ready(function(){ $('ul.only-mobile > li').each(function(){ $(this).find('.acc__panel').slideUp(); }) $('ul.only-mobile > li').each(function(){ var subHeading = $(this).find('h6').length; if(!subHeading) { $(this).find('ul.list').slideDown(); $(this).find('.acc__panel').slideUp(); } }); $('ul.only-mobile > li').each(function(){ $(this).find('>div').addClass('demo'); $(this).find('>i').click(function(){ $(this).toggleClass('icon-plus icon-minus'); $(this).closest('li').find('.acc__panel').slideToggle(); var currentIndex = $(this).closest('li').index(); currentIndex+=1; $('ul.only-mobile > li').each(function(){ var currenMenuIndex = $(this).index(); currenMenuIndex+=1; if(currenMenuIndex != currentIndex) { $(this).find('.acc__panel').slideUp(); $(this).find('>i').removeClass('icon-minus').addClass('icon-plus'); } else { return } }) }); }); }) // scroll fix $(window).scroll(function(){ if ($(window).scrollTop() >= 125) { $('.scroll-header').addClass('fixed-header'); } else { $('.scroll-header').removeClass('fixed-header'); } }); $('ul.only-mobile li').each(function(){ $(this).find('ul.list').slideUp(); $(this).find('h6').click(function(){ $(this).closest('.acc__panel').find('ul.list').slideToggle(); $(this).find('>i').toggleClass('icon-plus icon-minus') }); }); $('.top-header .nav.options a').each(function(){ $(this).click(function(){ menuShowHide(); hideMenuText(); }) }) menuShowHide = () => { var currentPostion = 0, oldPosition, windowPosition; $(window).scroll(function() { windowPosition = $(window).scrollTop(); if(windowPosition > 160) { oldPosition = currentPostion; currentPostion = $(this).scrollTop(); (oldPosition < currentPostion) ? ( $('.headers_header').css('top','-121px') ) : ( $('.headers_header').css('top','0px') ) ; } }); } /* ----- End Header ------- */ /* ----- Faq Page ------- */ $(document).ready(function(){ $('.menuBox').click(function(){ $(this).closest('.quick-actions').find(".resulttab[id='"+$(this).attr('data-id')+"']").css('display','block'); $(this).closest('.quick-actions').find(".menuBox").removeClass('active'); $(this).addClass('active'); }); }); $(document).ready(function(){ $('.faq-box').click(function(){ $(this).closest('.quick-faq').find(".faq-tab").css('display','none'); $(this).closest('.quick-faq').find(".faq-tab[id='"+$(this).attr('data-id')+"']").css('display','block'); $(this).closest('.quick-faq').find(".faq-box").removeClass('active'); $(this).addClass('active'); }); //Showing only 5 faq entries var editMode = $('body').hasClass('has-edit-mode-menu'); if(!editMode) { $('.faqLess, .faqMore').hide(); var noOfFaqs = $('.list_faqs > div:not(.row) > div').length; if(noOfFaqs > 5) { $('.faqMore').show(); $('.list_faqs > div:not(.row) > div').each(function(){ $(this).addClass('extraQuestions'); }); for(var i=6; i<=noOfFaqs; i++){ $('.extraQuestions:nth-child('+i+')').addClass('shouldCollapse'); } $('.shouldCollapse').wrapAll('
'); $('.moreQuestions').slideUp(); $('.faqMore').click(function(){ $(this).hide(); $('.faqLess').show(); $('.moreQuestions').slideDown(); }); $('.faqLess').click(function(){ $(this).hide(); $('.faqMore').show(); $('.moreQuestions').slideUp(); var faqTop = $('.list_faqs').position(); $("html, body").animate({ scrollTop: faqTop.top }, "slow"); }); } } if(!editMode) { $('.faq-wrapper .accordion').each(function(){ var currentFaqCount = $(this).find('.faqs').length; if(currentFaqCount>5) { $(this).find('.mainFaqMore').show(); for(var i=6; i<=currentFaqCount; i++) { $(this).find('.faqs:nth-child('+i+')').addClass('faqMainExtra'); } $(this).find('.faqMainExtra').wrapAll('
'); $(this).find('.mainMoreQuestions').slideUp(); $(this).find('.mainFaqMore').click(function(){ $(this).hide(); $(this).closest('.list_faqs').find('.mainMoreQuestions').slideDown(); $(this).closest('.list_faqs').find('.mainFaqLess').show(); }); $(this).find('.mainFaqLess').click(function(){ $(this).hide(); $(this).closest('.list_faqs').find('.mainMoreQuestions').slideUp(); $(this).closest('.list_faqs').find('.mainFaqMore').show(); }); } }) } }); /* ------ End -------- */ $("#buttonSelector .radio:first").children().addClass("checkedlabel"); $(document).on("change","input", function(){ $("#buttonSelector label").removeClass("checkedlabel"); if($(this).is(":checked")) $(this).closest("label").addClass("checkedlabel"); }); function headers_header_button_tabs_openPage(evt, cityName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("nav-item"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; } $('.title-accordion').on('click', function(evt) { $(evt.target).closest('.title-accordion').toggleClass('arrow-change'); // $(evt.target,'.title-accordion').toggleClass('arrow-change'); $(evt.target).closest('.title-accordion').siblings('.panel-collapse').toggleClass('d-block'); // $(evt.target).siblings('.panel-collapse').toggleClass('d-block'); }); function list_credit_cards_menu_openMainMenu() { let x = document.getElementById("credit_cards_menu"); let iconopen = document.getElementById("icon-plus"); let iconclose = document.getElementById("icon-minus"); if (x.style.display === "none") { x.style.display = "block"; iconopen.style.display = "none"; iconclose.style.display = "block"; } else { x.style.display = "none"; iconopen.style.display = "block"; iconclose.style.display = "none"; } } $('.tables_table_2_cols_with_icons .row:odd').addClass('odd'); $('.tables_table_2_cols_with_icons .row:even').addClass('even'); $('.linkactive').closest('.panel-collapse').addClass('d-block'); $('.haschild.linkactive').next('.panel-collapse').addClass('d-block'); $('.panel-collapse .linkactive').closest('.accordion').addClass('childactive'); $('.childactive').children('.title-accordion').removeClass('arrow-change'); $('.d-block').closest('.list-menu .title-accordion').removeClass('arrow-change'); $(document).ready(function(){ $(window).resize(); /*var currentPath = window.location.pathname; if(currentPath.includes('corporate-banking')){ $('.top-header .nav.options a:nth-child(1)').removeClass('active'); $('.top-header .nav.options a:nth-child(2)').removeClass('active'); $('.top-header .nav.options a:nth-child(3)').addClass('active'); } else if(currentPath.includes('business-banking')) { $('.top-header .nav.options a:nth-child(1)').removeClass('active'); $('.top-header .nav.options a:nth-child(2)').addClass('active'); $('.top-header .nav.options a:nth-child(3)').removeClass('active'); } else { $('.top-header .nav.options a:nth-child(1)').addClass('active'); $('.top-header .nav.options a:nth-child(2)').removeClass('active'); $('.top-header .nav.options a:nth-child(3)').removeClass('active'); }*/ $('h4.pdf-year').each(function(){ var currentYear = $(this).text(); $('.filter-credit select.dropdown-toggle').append(''); }); $('.filter-credit select.dropdown-toggle').append(''); $('select.dropdown-toggle').change(function() { var checkValue = $('select.dropdown-toggle :selected').val(); if(checkValue == 'seeAll'){ $('.journal-content-article').each(function(){ $(this).show(); }) } else{ var currentYearSection; $('.journal-content-article').each(function(){ currentYearSection = $(this).find('.pdf-year').text(); if(currentYearSection.includes(checkValue)) { $(this).show(); } else { $(this).hide(); } }) } }); $('.childContainer').each(function(){ var currentParagraph = $(this).find('.rb-component-paragraph').text(); $(this).find('.rb-component-paragraph').attr('title', currentParagraph); }) var currentWidth = $(window).width(); if(currentWidth >= 768 && currentWidth <= 991) { var headingHeights = []; var maxHeight; $('.container ~ div').each(function(){ $(this).find('.row .col').each(function(){ $(this).find('.childContainer h6.component-heading').height(); headingHeights.push(currentHeight); }) maxHeight = Math.max(...headingHeights); $(this).find('.row .col').each(function(){ $(this).find('.childContainer h6.component-heading').css('height', maxHeight); }) }) } $(window).resize(function(){ var resizedWidth = $(this).width(); if(resizedWidth>=768 && resizedWidth<=991) { var headingHeights = []; var maxHeight; $('.container ~ div').each(function(){ $(this).find('.row .col').each(function(){ $(this).find('.childContainer h6.component-heading').height(); headingHeights.push(currentHeight); }) maxHeight = Math.max(...headingHeights); $(this).find('.row .col').each(function(){ $(this).find('.childContainer h6.component-heading').css('height', maxHeight); }) }) } }) $('#incomeCalculator #ButtonSelector .btn').click(function () { var text = $(this).html(); $(".mobile-select").html(text); $(this).closest('#incomeCalculator').find(".tabcontent").css('display', 'none'); $(this).closest('#incomeCalculator').find(".optionS ").css('display', 'none'); $(this).closest('#incomeCalculator').find(".tabcontent[id='" + $(this).attr('data-id') + "']").css('display', 'block'); $(this).closest('#ButtonSelector').find(".btn").removeClass('active'); $(this).addClass('active'); }); var allHeights = [], currentHeight, maxHeight; $('.offers-row .offers-row').each(function(){ $(this).find('.offers-section.Awards-section').each(function(){ var currentHeight = $(this).find('.component-heading').innerHeight(); allHeights.push(currentHeight); }); maxHeight = Math.max(...allHeights); allHeights=[]; $(this).find('.offers-section.Awards-section').each(function(){ $(this).find('.component-heading').innerHeight(maxHeight); }) }); }) var faqLeng = $('.faqs').length; var count = 0; $('.faqs').each(function(){ count+=1; if(count == faqLeng){ $(this).addClass("last-faq"); } }); var listfaqLeng = $('.list_faqs').length; var count = 0; $('.list_faqs').each(function(){ count+=1; if(count == listfaqLeng){ $(this).addClass("last-list_faqs"); } }); function topchangeLinkf() { var url = document.URL; var title = '${the_title}'; var href = "https://www.facebook.com/share.php?u=" + url + "&title=" + title; var link = document.getElementById("topfacebook"); link.setAttribute("href", href); return false; } function topchangeLinkt() { var url = document.URL; var title = '${the_title}'; var href = "https://twitter.com/intent/tweet?status=" + title + "+" + url; var link = document.getElementById("toptwitter"); link.setAttribute("href", href); return false; } function topchangeLinkl() { var url = document.URL; var title = '${the_title}'; var href = "https://www.linkedin.com/shareArticle?mini=true&url=" + url + "&title=" + title + "&source={{source}}"; var link = document.getElementById("toplinkedin"); link.setAttribute("href", href); return false; } function topchangeLinke() { var url = document.URL; var title = '${the_title}'; var href = "mailto:someone@example.com?subject=" + title + "&body=" + url; var link = document.getElementById("topemail"); link.setAttribute("href", href); return false; } var sliders_page_presentation_swiper = new Swiper('.swiper-container.slider-page-presentation', { autoHeight: false, //enable auto height spaceBetween: 20, loop:true, pagination: { el: '.swiper-container.slider-page-presentation .swiper-pagination-slider-card', clickable : 'true', }, autoplay: { delay: 5000, }, }); //SAR slider coloring //document.getElementById("rangeSAR").oninput = function() { //this.style.background = 'linear-gradient(to right, #00af9a 0%, #00af9a ' + this.value + '%, #b8bdc7 ' + this.value + '%, white 100%)' //} //SAR Value equal to slider value * 1000 $( document ).ready(function() { $('.space-options a.second-option').each(function(){ currentLink = $(this).text(); $(this).attr('title', currentLink); }) giveValue(); giveBalance(); $('#incomeCalculator #rangeSAR').change(function(){ giveValue(); }); $('#incomeCalculator #rangeSAR1').change(function(){ giveBalance(); }); $('.btn-group .bank-calculator-btn:first-child').click(function(){ giveValue(); }) $('.btn-group .bank-calculator-btn:last-child').click(function(){ giveValue(); }) }); function giveValue() { let slider = $("#incomeCalculator #rangeSAR"); let output = $("#incomeCalculator #income #title_amount"); let amount = slider.val() * 1000; // format1(amount); output.html(format1(amount)); let isArabic = $('html').hasClass('rtl'); if(!isArabic) { slider.on( "input" , function() { output.html((this.value * 1000).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')); this.style.background = 'linear-gradient(to right, #00af9a 0%, #00af9a ' + this.value + '%, #b8bdc7 ' + this.value + '%, white 100%)'; }) } else { slider.on( "input" , function() { output.html((this.value * 1000).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')); this.style.background = 'linear-gradient(to left, #00af9a 0%, #00af9a ' + this.value + '%, #b8bdc7 ' + this.value + '%, white 100%)'; }) } } function giveBalance() { let slider = $("#incomeCalculator #rangeSAR1"); let output = $("#incomeCalculator #balance #title_amount"); let amount = slider.val() * 1000; // format1(amount); output.html(format1(amount)); let isArabic = $('html').hasClass('rtl'); if(!isArabic) { slider.on( "input" , function() { output.html((this.value * 1000).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')); this.style.background = 'linear-gradient(to right, #00af9a 0%, #00af9a ' + this.value/20 + '%, #b8bdc7 ' + this.value/20 + '%, white 100%)'; }) } else { slider.on( "input" , function() { output.html((this.value * 1000).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')); this.style.background = 'linear-gradient(to left, #00af9a 0%, #00af9a ' + this.value/20 + '%, #b8bdc7 ' + this.value/20 + '%, white 100%)'; }) } } function format1(amount) { let formattedAmount = (amount).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); return formattedAmount; } $(".collapsible-header .icon-cross").on("click",function(){ $(this).toggleClass("icon-plus"); $(this).toggleClass("icon-cross"); }); //The function actually applying the offset function offsetAnchor() { if (location.hash.length !== 0) { window.scrollTo(window.scrollX, window.scrollY - 350); } } // Captures click events of all a elements with href starting with # $(document).on('click', 'a[href^="#"]', function(event) { // Click events are captured before hashchanges. Timeout // causes offsetAnchor to be called after the page jump. window.setTimeout(function() { offsetAnchor(); }, 0); }); // Set the offset when entering page with hash present in the url window.setTimeout(offsetAnchor, 0); var sliders_photo_slider = new Swiper('.sliders_slider_logo_partner .swiper-container', { autoHeight: true, loop: true, grabCursor: true, // simulateTouch: false, navigation: { nextEl: '.sliders_slider_logo_partner .swiper-button-next', prevEl: '.sliders_slider_logo_partner .swiper-button-prev', }, breakpoints: { 0: { slidesPerView: 2, spaceBetween: 16 }, 768: { slidesPerView: 4, spaceBetween: 16 }, 992: { slidesPerView: 6, spaceBetween: 32 } } }); /* offer Panigation */ /* Socall Wall */ /* $(document).ready(function(){ tableResize(); $(window).resize(function(){ tableResize(); }) function tableResize() { var wid = $(this).width(); if(wid < 768) { var headerHeights = []; var contentHeights = []; var currentHeight; $('.table-header .col').each(function(){ currentHeight = $(this).height(); headerHeights.push(currentHeight); }); $('.table-content .pdf-icon').each(function(){ currentHeight = $(this).height(); contentHeights.push(currentHeight); }); for(var i=0; i= contentHeights[i]){ $('.table-header .col:nth-child('+(i+1)+'), .table-content .pdf-icon:nth-child('+(i+1)+')').css('height', headerHeights[i]); } else { $('.table-header .col:nth-child('+(i+1)+'), .table-content .pdf-icon:nth-child('+(i+1)+')').css('height', contentHeights[i]); } } } } })*/ $(window).resize(function() { setSticky(); }); //crn number validation $(document).ready(function(){ $(".crnNumberlengthErrMsg").hide(); $(".crnNumberErrMsg").hide(); $(".crnNumberFrm").blur(function(e){ $(".crnNumberErrMsg").hide(); $(".validIdentificationNumberErrMsg").hide(); var nationId = $(".crnNumberFrm").val(); if($('.ciCommercialRegNumber').is(":checked") && nationId.length > 0){ if($(".crnNumberFrm").val().toString().charAt(0) != 7){ isCIValidated=false; $(".crnNumberErrMsg").show(); $(".crnNumberFrm").css('border-color','#ff6d70'); scrollAnimations(".crnNumberErrMsg"); }else if(nationId.length < 10 || nationId.length > 13){ isCIValidated=false; $(".validIdentificationNumberErrMsg").show(); $(".crnNumberFrm").css('border-color','#ff6d70'); scrollAnimations(".validIdentificationNumberErrMsg"); }else{ $(".crnNumberFrm").css('border-color','#230871'); } } else if($('.ciFreelancer').is(":checked") && nationId.length > 0){ if(nationId.length < 8 || nationId.length > 20){ isCIValidated=false; $(".validIdentificationNumberErrMsg").show(); $(".crnNumberFrm").css('border-color','#ff6d70'); scrollAnimations(".validIdentificationNumberErrMsg"); }else{ $(".crnNumberFrm").css('border-color','#230871'); } } else if(nationId.length > 0){ if(nationId.length < 10 || nationId.length > 13){ isCIValidated=false; $(".validIdentificationNumberErrMsg").show(); $(".crnNumberFrm").css('border-color','#ff6d70'); scrollAnimations(".validIdentificationNumberErrMsg"); }else{ $(".crnNumberFrm").css('border-color','#230871'); } } }); $(".companyIdentificationRe").on('change',function(){ var companyIdentification = $(this).val(); $(".crnNumberErrMsg").hide(); $(".validIdentificationNumberErrMsg").hide(); var nationId = $(".crnNumberFrm").val(); if(companyIdentification == "Commerical Registration Number"){ if($(".crnNumberFrm").val().toString().charAt(0) != 7){ $(".crnNumberErrMsg").show(); }else if(nationId.length < 10 || nationId.length > 13){ $(".validIdentificationNumberErrMsg").show(); scrollAnimations(".validIdentificationNumberErrMsg"); } } else if(companyIdentification == "Freelancer" && nationId.length > 0){ if(nationId.length < 8 || nationId.length > 20){ $(".validIdentificationNumberErrMsg").show(); scrollAnimations(".validIdentificationNumberErrMsg"); } } else if(nationId.length > 0){ if(nationId.length < 10 || nationId.length > 13){ $(".validIdentificationNumberErrMsg").show(); scrollAnimations(".validIdentificationNumberErrMsg"); } } }) }); $(document).ready(function(){ $(window).resize(); //$( ".offers-row" ).wrapAll( "
"); $('.offers-section').each(function(){ var currentPara = $(this).find('.rb-component-paragraph').text(); $(this).find('.rb-component-paragraph').attr('title', currentPara); }); $('.offers-section').each(function(){ var currentTitle = $(this).find('.component-heading').text(); $(this).find('.component-heading').attr('title',currentTitle); }); $('.offers-section').each(function(){ var currentDate = $(this).find('.date div').text(); currentDate = currentDate.replace(':',''); $(this).find('.date div').text(currentDate); }) function offerHeight(){ var allHeights=[], currentHeight, maxHeight; $('.offers-section').parent().parent().parent().parent().parent().parent().addClass('offers-row'); $('.offers-row').each(function(){ $(this).find('.offers-section').each(function(){ currentHeight = $(this).height(); allHeights.push(currentHeight); }) maxHeight = Math.max(...allHeights); $(this).find('.offers-section').each(function(){ $(this).height(maxHeight); }) allHeights=[]; }); } function resizeOfferHeight(){ var currentWindowSize = $(window).width(); if(currentWindowSize < 767){ $('.offers-section').each(function(){ $(this).height('auto'); }) } else { offerHeight(); } } offerHeight(); resizeOfferHeight(); $(window).resize(function(){ resizeOfferHeight(); }); if(window.matchMedia("(max-width: 767px)").matches){ var boxTotal = $('.offers-data .offers-section ').length; var boxShown = 5; var numPages = boxTotal/boxShown; if(boxTotal > 5){ if($('div').hasClass("pagination") == false){ $('.offers-data').after (''); $('#pagination').append (' '); for (i = 0;i < numPages;i++) { var pageNum = i + 1; $('#pagination').append (''+pageNum+' '); } $('#pagination').append (' '); $('#pagination a:first').addClass('active'); $('.offers-data .offers-section').hide(); $('.offers-data .offers-section').slice (0, boxShown).show(); }else{ $('#pagination').show(); var currPage = $('#pagination a.active').attr('rel'); var startItem = currPage * boxShown; var endItem = startItem + boxShown; $('.offers-data .offers-section').hide(); $('.offers-data .offers-section').slice (startItem, endItem).show(); } $('#pagination a').click(function(e){ $('#pagination a').removeClass('active'); $('#pagination a:first').removeClass('active'); var offers_position; offers_position = $('.form_organisms_filter').offset().top; $('html, body').stop().animate({ scrollTop: offers_position }, 500); e.preventDefault(); $(this).addClass('active'); var currPage = $(this).attr('rel'); var startItem = currPage * boxShown; var endItem = startItem + boxShown; $('.offers-data .offers-section').hide().slice(startItem, endItem).css({ "display": "block"}); }); $('#pagination i').click(function(e){ var currPage = $('#pagination a.active').attr('rel'); var currLastPage = $('#pagination a:last').attr('rel'); var offers_position; offers_position = $('.form_organisms_filter').offset().top; $('html, body').stop().animate({ scrollTop: offers_position }, 500); e.preventDefault(); if($(this).hasClass('icon-chevron-left')==true && currPage > 0){ e.preventDefault(); $('#pagination a.active').removeClass('active').prev().addClass('active'); var currPage1 = $('#pagination a.active').attr('rel'); var startItem = (currPage1) * boxShown; var endItem = startItem + boxShown; $('.offers-data .offers-section').hide(); $('.offers-data .offers-section').slice (startItem, endItem).show(); }else if($(this).hasClass('icon-chevron-right')==true && $('#pagination a.active').attr('rel') != currLastPage){ e.preventDefault(); $('#pagination a.active').removeClass('active').next().addClass('active'); var currPage2 = $('#pagination a.active').attr('rel'); var startItem1 = (currPage2) * boxShown; var endItem1 = startItem1 + boxShown; $('.offers-data .offers-section').hide(); $('.offers-data .offers-section').slice (startItem1, endItem1).show(); } }); } } else{ $('.offers-data .offers-section').show(); $('#pagination').hide(); } }); //end crn number validation function setSticky() { const el = $('#tables_comparator #sticky-header'); let fixmeTop = el?.offset()?.top; if (el.offset() !== undefined) { /* Desktop */ if ($(this).width() > 992) { fixmeTop = $('#tables_comparator #sticky-header').offset().top; // get initial position of the element $(window).scroll(function() { // assign scroll event listener let currentScroll = $(window).scrollTop(); // get current position if (currentScroll - 400 >= fixmeTop) { // apply position: sticky if you $('#tables_comparator #sticky-header').css({ // scroll to that element or below it display: 'block', position: 'sticky', top: '108px' }); $('#tables_comparator #sticky-header').addClass("is-sticky"); $('body').addClass("is-sticky-product-comparison"); } else { // apply position: static $('#tables_comparator #sticky-header').css({ // if you scroll above it position: 'sticky' }); $('#tables_comparator #sticky-header').removeClass("is-sticky"); } }); } else if ($(this).width() < 992) { fixmeTop = $('#tables_comparator #sticky-header').offset().top; // get initial position of the element $(window).scroll(function() { // assign scroll event listener let currentScroll = $(window).scrollTop(); // get current position // if ((currentScroll > fixmeTop) && (currentScroll > 350)) { if (currentScroll - 350 >= fixmeTop) { // apply position: sticky if you $('#tables_comparator #sticky-header').css({ // scroll to that element or below it display: 'block', position: 'sticky', top: '108px' }); $("#tables_comparator #sticky-header .title-and-switch").css("display","none"); } else if((currentScroll <= fixmeTop) && (currentScroll < 250)){ // less or equal than // apply position: static $('#tables_comparator #sticky-header').css({ // if you scroll above it display: 'block', position: 'sticky', top: '108px' }); $("#tables_comparator #sticky-header .title-and-switch").css("display","block"); } }); } } } setSticky();