window.searchProcessing = false; jQuery(document).ready(function ($) { // ttkgroup_slider var swiper = new Swiper(".swiper-cardlist_dropdown", { speed: 400, spaceBetween: 30, slidesPerView: 1, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); //Marketing slider var productSlider = new Swiper(".product-slider", { slidesPerView: 2.5, spaceBetween: 20, breakpoints: { 0: { slidesPerView: 1.6, }, 768: { slidesPerView: 3.1, }, 1024: { slidesPerView: 3, }, 1100: { slidesPerView: 4, }, }, pagination: { el: ".swiper-pagination", type: "progressbar", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); // Product Slider [End] // Pricing Slider [Start] var pricingSlider = new Swiper(".pricing-slider", { slidesPerView: 2.5, spaceBetween: 20, breakpoints: { 0: { slidesPerView: 1.6, }, 768: { slidesPerView: 2.4, }, 1024: { slidesPerView: 3, }, 1100: { slidesPerView: 4, }, }, pagination: { el: ".swiper-pagination", type: "progressbar", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); var newsUpdates9Slider = new Swiper(".cw-news-updates-slider", { slidesPerView: 2.5, spaceBetween: 30, breakpoints: { 0: { slidesPerView: 1.3, }, 768: { slidesPerView: 2.1, }, 1024: { slidesPerView: 2.5, }, }, pagination: { el: ".swiper-pagination", type: "progressbar", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); var swiper_tab = new Swiper('.tab-slider-swiper-container', { spaceBetween: 30, centeredSlides: true, autoplay: { delay: 2500, disableOnInteraction: false, }, pagination: { el: ".swiper-pagination", clickable: true, }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, loop: true, }); var swiper = new Swiper('.swiper-container', { pagination: { el: '.swiper-pagination', type: 'fraction', }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, observer: true, observeParents: true, loop: true, }); // hotspots start $('.ihotspot_hastooltop').each(function () { $(this).data('powertip', function () { var htmlThis = $(this).parents('.ihotspot_tooltop_html').attr('data-html'); return htmlThis; }); var thisPlace = $(this).parents('.ihotspot_tooltop_html').data('placement'); $(this).powerTip({ placement: thisPlace, smartPlacement: true, mouseOnToPopup: true, }).on({ powerTipClose: function () { $('#powerTip').html(''); } }); $('body').on('click', '.close_ihp', function () { $.powerTip.hide(); }); }); // hotspots end // load more news and updates $(document).on("click", "#load-more-news-updates", function (e) { e.preventDefault(); //$("#load-more-news-updates").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_news_and_updates_data', //offset: $('#posts > .post-item').length offset: $('#news-and-updates-listing > div').length, cat: $('#news_and_updates_cat').val(), news_updates_cat_filter: $('#news_updates_cat_filter').val(), news_updates_sort: $('#news_updates_sort').val() }, success: function (result) { if (result.status == 'success') { $('#news-and-updates-listing').append(result.html); $("#load-more-news-updates").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-more-news-updates").attr('style', 'display:none !important'); } } else { $('#news-and-updates-listing').append(result.html); $("#load-more-news-updates").attr('style', 'display:none !important'); } } }) }); $("#news_updates_cat_filter").on("change", function (e) { reloadNewsUpdatesData(e); }); $("#news_updates_sort").on("change", function (e) { reloadNewsUpdatesData(e); }); function reloadNewsUpdatesData(e) { e.preventDefault(); if (window.searchProcessing == false) { window.searchProcessing = true; $('#news-and-updates-listing').fadeOut(); $('#news-and-updates-listing').html(''); //$("#load-more-news-updates").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_news_and_updates_data', //offset: $('#posts > .post-item').length offset: $('#news-and-updates-listing > div').length, cat: $('#news_and_updates_cat').val(), news_updates_cat_filter: $('#news_updates_cat_filter').val(), news_updates_sort: $('#news_updates_sort').val() }, success: function (result) { if (result.status == 'success') { $('#news-and-updates-listing').html(result.html).fadeIn(); //$("#load-more-news-updates").html('Load More'); $("#load-more-news-updates").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { //$("#load-more-news-updates").hide(); $("#load-more-news-updates").attr('style', 'display:none !important'); } window.searchProcessing = false; } else { $('#news-and-updates-listing').html(result.html); $("#load-more-news-updates").attr('style', 'display:none !important'); window.searchProcessing = false; } } }) } } // load more awards $(document).on("click", "#load-more-awards", function (e) { e.preventDefault(); //$("#load-more-awards").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_awards_data', //offset: $('#posts > .post-item').length offset: $('#awards-listing > a').length, cat: 1,//$('#news_and_updates_cat').val(), awards_cat_filter: $('#awards_cat_filter').val(), awards_sort: $('#awards_sort').val(), archive: $('#awards-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { $('#awards-listing').append(result.html); $("#load-more-awards").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-more-awards").attr('style', 'display:none !important'); } } else { $('#awards-listing').append(result.html); $("#load-more-awards").attr('style', 'display:none !important'); } } }) }); $("#awards_cat_filter").on("change", function (e) { reloadAwardsData(e); }); $("#awards_sort").on("change", function (e) { reloadAwardsData(e); }); function reloadAwardsData(e) { e.preventDefault(); if (window.searchProcessing == false) { window.searchProcessing = true; $('#awards-listing').fadeOut(); $('#awards-listing').html(''); //$("#load-more-awards").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_awards_data', //offset: $('#posts > .post-item').length offset: $('#awards-listing > a').length, cat: 1,//$('#news_and_updates_cat').val(), awards_cat_filter: $('#awards_cat_filter').val(), awards_sort: $('#awards_sort').val(), archive: $('#awards-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { $('#awards-listing').html(result.html).fadeIn(); $("#load-more-awards").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-more-awards").attr('style', 'display:none !important'); } window.searchProcessing = false; } else { $('#awards-listing').html(result.html); $("#load-more-awards").attr('style', 'display:none !important'); window.searchProcessing = false; } } }) } } // load more archive awards $(document).on("click", "#load-archive-more-awards", function (e) { e.preventDefault(); //$("#load-archive-more-awards").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_awards_data', //offset: $('#posts > .post-item').length offset: $('#awards-archive-listing > a').length, cat: 1,//$('#news_and_updates_cat').val(), awards_cat_filter: $('#awards_archive_cat_filter').val(), awards_sort: $('#awards_archive_sort').val(), archive: $('#awards-archive-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { $('#awards-archive-listing').append(result.html); $("#load-archive-more-awards").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-archive-more-awards").attr('style', 'display:none !important'); } } else { $('#awards-archive-listing').append(result.html); $("#load-archive-more-awards").attr('style', 'display:none !important'); } } }) }); $("#awards_archive_cat_filter").on("change", function (e) { reloadAwardsArchiveData(e); }); $("#awards_archive_sort").on("change", function (e) { reloadAwardsArchiveData(e); }); function reloadAwardsArchiveData(e) { e.preventDefault(); if (window.searchProcessing == false) { window.searchProcessing = true; $('#awards-archive-listing').fadeOut(); $('#awards-archive-listing').html(''); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_awards_data', //offset: $('#posts > .post-item').length offset: $('#awards-archive-listing > a').length, cat: 1,//$('#news_and_updates_cat').val(), awards_cat_filter: $('#awards_archive_cat_filter').val(), awards_sort: $('#awards_archive_sort').val(), archive: $('#awards-archive-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { $('#awards-archive-listing').html(result.html).fadeIn(); $("#load-archive-more-awards").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-archive-more-awards").attr('style', 'display:none !important'); } window.searchProcessing = false; } else { $('#awards-archive-listing').html(result.html); $("#load-archive-more-awards").attr('style', 'display:none !important'); window.searchProcessing = false; } } }) } } // load more Social $(document).on("click", "#load-more-social", function (e) { e.preventDefault(); //$("#load-more-social").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_social_data', //offset: $('#posts > .post-item').length offset: $('#social-listing > div').length, cat: 1,//$('#news_and_updates_cat').val(), social_cat_filter: $('#social_cat_filter').val(), social_sort: $('#social_sort').val(), archive: $('#social-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { var sociaswiper = new Swiper(".swiper-cardlist_dropdown", { speed: 400, spaceBetween: 30, slidesPerView: 1, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); $('#social-listing').append(result.html); $("#load-more-social").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-more-social").attr('style', 'display:none !important'); } } else { $('#social-listing').append(result.html); $("#load-more-social").attr('style', 'display:none !important'); } } }) }); $("#social_cat_filter").on("change", function (e) { reloadSocialData(e); }); $("#social_sort").on("change", function (e) { reloadSocialData(e); }); function reloadSocialData(e) { e.preventDefault(); if (window.searchProcessing == false) { window.searchProcessing = true; $('#social-listing').fadeOut(); $('#social-listing').html(''); //$("#load-more-social").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_social_data', //offset: $('#posts > .post-item').length offset: $('#social-listing > div').length, cat: 1,//$('#news_and_updates_cat').val(), social_cat_filter: $('#social_cat_filter').val(), social_sort: $('#social_sort').val(), archive: $('#social-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { $('#social-listing').html(result.html).fadeIn(); $("#load-more-social").attr('style', 'display:block !important'); var sociaswiper = new Swiper(".swiper-cardlist_dropdown", { speed: 400, spaceBetween: 30, slidesPerView: 1, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-more-social").attr('style', 'display:none !important'); } window.searchProcessing = false; } else { $('#social-listing').html(result.html); $("#load-more-social").attr('style', 'display:none !important'); window.searchProcessing = false; } } }) } } // load archive more Social $(document).on("click", "#load-archive-more-social", function (e) { e.preventDefault(); //$("#load-archive-more-social").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_social_data', //offset: $('#posts > .post-item').length offset: $('#social-archive-listing > a').length, cat: 1,//$('#news_and_updates_cat').val(), social_cat_filter: $('#social_archive_cat_filter').val(), social_sort: $('#social_archive_sort').val(), archive: $('#social-archive-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { $('#social-archive-listing').append(result.html); $("#load-archive-more-social").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-archive-more-social").attr('style', 'display:none !important'); } } else { $('#social-archive-listing').append(result.html); $("#load-archive-more-social").attr('style', 'display:none !important'); } } }) }); $("#social_archive_cat_filter").on("change", function (e) { reloadArchiveSocialData(e); }); $("#social_archive_sort").on("change", function (e) { reloadArchiveSocialData(e); }); function reloadArchiveSocialData(e) { e.preventDefault(); if (window.searchProcessing == false) { window.searchProcessing = true; $('#social-archive-listing').fadeOut(); $('#social-archive-listing').html(''); //$("#load-archive-more-social").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_social_data', //offset: $('#posts > .post-item').length offset: $('#social-archive-listing > a').length, cat: 1,//$('#news_and_updates_cat').val(), social_cat_filter: $('#social_archive_cat_filter').val(), social_sort: $('#social_archive_sort').val(), archive: $('#social-archive-listing').attr('data-archive') }, success: function (result) { if (result.status == 'success') { $('#social-archive-listing').html(result.html).fadeIn(); $("#load-archive-more-social").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-archive-more-social").attr('style', 'display:none !important'); } window.searchProcessing = false; } else { $('#social-archive-listing').html(result.html); $("#load-archive-more-social").attr('style', 'display:none !important'); window.searchProcessing = false; } } }) } } //Filter for chairman speech $("#year_filter").on("change", function (e) { //fetchMonths(e); var year = $('#year_filter').val(); //console.log(year) var post_id = $(this).find(':selected').data('post_id') //console.log(term_id); reloadChairmanData(post_id, year, e); }); $(document).on('click', '.next_post', function (e) { var year = $(this).data('year'); var post_id = $(this).data('id'); //console.log(year) //console.log(post_id); reloadChairmanData(post_id, year, e); }) $(document).on('click', '.prev_post', function (e) { var year = $(this).data('year'); var post_id = $(this).data('id'); //console.log(year) //console.log(post_id); reloadChairmanData(post_id, year, e); }) /*$(".next_post").on("click", function(e) { reloadChairmanData(1, e); });*/ function reloadChairmanData(id, year, e) { e.preventDefault(); if (window.searchProcessing == false) { window.searchProcessing = true; $('#chairman-listing').fadeOut(); $('#chairman-listing').html(''); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_chairman_speech_data', year_filter: year, post_id: id }, success: function (result) { if (result.status == 'success') { $('#chairman-listing').html(result.html).fadeIn(); $('.prev_next').html(''); if (result.previous_link != "") { $('.prev_next').append(result.previous_link); } if (result.next_link != "") { $('.prev_next').append(result.next_link); } //$('#year_filter option:selected').remove(); $('select[name^="year_filter"] option[value=' + year + ']').removeAttr('selected'); $('select[name^="year_filter"] option[value=' + year + ']').attr("selected", "selected"); /*if(status == 0){ $('#month_filter').html( result.month_dropdown ).fadeIn(); }*/ window.searchProcessing = false; } else { $('#chairman-listing').html(result.html); window.searchProcessing = false; } } }) } } // load more opportunites $(document).on("click", "#load-opp-more", function (e) { e.preventDefault(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_opportunity_data', offset: $('#opportunity-listing > div').length, department_filter: $('#department_filter').val(), location_filter: $('#location_filter').val(), employment_filter: $('#employment_filter').val() }, success: function (result) { if (result.status == 'success') { $('#opportunity-listing').append(result.html); //$("#load-opp-more").html('Load More'); $("#load-opp-more").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-opp-more").attr('style', 'display:none !important'); } } else { $('#opportunity-listing').append(result.html); $("#load-opp-more").attr('style', 'display:none !important'); } } }) }); $("#department_filter").on("change", function (e) { reloadOpportunityData(e); }); $("#location_filter").on("change", function (e) { reloadOpportunityData(e); }); $("#employment_filter").on("change", function (e) { reloadOpportunityData(e); }); function reloadOpportunityData(e) { e.preventDefault(); if (window.searchProcessing == false) { window.searchProcessing = true; // $('#opportunity-listing').fadeOut(); $('#opportunity-listing').html(''); //$("#load-opp-more").html('loading...').show(); $.ajax({ url: ajax_url, type: 'post', dataType: 'json', data: { action: 'load_opportunity_data', offset: $('#opportunity-listing > li').length, department_filter: $('#department_filter').val(), location_filter: $('#location_filter').val(), employment_filter: $('#employment_filter').val() }, success: function (result) { if (result.status == 'success') { $('#opportunity-listing').show().html(result.html); $("#load-opp-more").attr('style', 'display:block !important'); if (parseInt((result.offset + result.display_count)) >= parseInt((result.umax_rows))) { $("#load-opp-more").attr('style', 'display:none !important'); } window.searchProcessing = false; } else { $('#opportunity-listing').html(result.html); $("#load-opp-more").attr('style', 'display:none !important'); window.searchProcessing = false; } } }) } } //Video part $(document).on('click', '.video-link', function (e) { e.preventDefault(); var iframe_code = $(this).data('video_id'); //console.log(iframe_code); var iframe = ''; $('.addIframe').empty().html(iframe); setTimeout(function () { $('#cw-modal-video').modal('show'); }, 500); }) $(document).on('click', '.director_read_more', function (e) { var title = $(this).data('title'); var designation = $(this).data('designation'); var image = $(this).data('image'); var desc = $(this).data('desc'); $('#myModalLabel').html(title); var director_details = ' + title +

' + designation + '

' + desc + '

'; $('.director_details').html(director_details); //console.log(image); });//director_details }); // Tree structure for Investor section - Start var toggler = document.getElementsByClassName("caret"); var i; for (i = 0; i < toggler.length; i++) { toggler[i].addEventListener("click", function () { this.parentElement.querySelector(".nested").classList.toggle("active"); this.classList.toggle("caret-down"); }); } // Tree structure for Investor section - End