//hamburger menu jQuery(document).ready(function () { jQuery(".toggle-nav").click(function () { jQuery("#menu-menu-main").slideToggle('slow', 'swing'); }); }); //sub menu jQuery(document).ready(function () { jQuery('.menu-item-has-children').click (function () { jQuery(this).children('ul').slideToggle('slow', 'swing'); jQuery(this).children('a').toggleClass('open'); // jQuery('.menu-item-has-children > a').css("color", "red"); }); }); //chat box 360 jQuery(document).ready(function () { if ($("#kpd_koopidtag").length > 0) { $.getScript("https://us-east.dx.dialpad.com/static/common/js/koopid-embed.min.js").done(function () { kpde.server = "https://us-east.dx.dialpad.com"; $('a[href="#livechat"], a[href="livechat"]').on("click", function (e) { e.preventDefault(); var checker = setInterval(function () { if ($("#kpd_koopidtag").length) { $("#kpd_koopidtag").trigger("click"); } clearInterval(checker); }, 100); }); }); } }); //tabs script function openCourseType(evt, courseType) { var i, coursetabcontent, coursetablinks; coursetabcontent = document.getElementsByClassName("coursetabcontent"); for (i = 0; i < coursetabcontent.length; i++) { coursetabcontent[i].style.display = "none"; } coursetablinks = document.getElementsByClassName("coursetablinks"); for (i = 0; i < coursetablinks.length; i++) { coursetablinks[i].className = coursetablinks[i].className.replace(" coursetypeactive", ""); } document.getElementById(courseType).style.display = "block"; evt.currentTarget.className += " coursetypeactive"; } //accordian script jQuery('.accordion-cont').click(function(){ jQuery(this).toggleClass('accordion-active'); jQuery(this).parent().find('.arrow').toggleClass('arrow-animate'); jQuery(this).parent().find('.accordian-panel').slideToggle(280); }); // //pop-up script // jQuery(function() { // // Open // jQuery('[data-popup-open]').on('click', function(e) { // var targeted_popup_class = jQuery(this).attr('data-popup-open'); // jQuery('[data-popup="' + targeted_popup_class + '"]').fadeIn(350); // e.preventDefault(); // }); // // Close // jQuery('[data-popup-close]').on('click', function(e) { // var targeted_popup_class = jQuery(this).attr('data-popup-close'); // jQuery('[data-popup="' + targeted_popup_class + '"]').fadeOut(350); // e.preventDefault(); // }); // }); //search searchsubmit.setAttribute('value',''); jQuery("form#searchform input:first-of-type").attr("placeholder", " Search"); // // //chat box // function NewTab() { // window.open("https://static.zdassets.com/web_widget/latest/liveChat.html?v=10#key=safetyprovisions.zendesk.com", // "", "width=500, height=600"); // } // function NewTab() { // (function ($) { // if ($("#kpd_koopidtag").length > 0) { // $.getScript("https://us-east.dx.dialpad.com/static/common/js/koopid-embed.min.js").done(function () { // kpde.server = "https://us-east.dx.dialpad.com"; // $('a[href="#livechat"], a[href="livechat"]').on("click", function (e) { // e.preventDefault(); // var checker = setInterval(function () { // if ($("#kpd_koopidtag").length) { // $("#kpd_koopidtag").trigger("click"); // } // clearInterval(checker); // }, 100); // }); // }); // } // })(jQuery); // } //scroll to top mybutton = document.getElementById("myTopBtn"); // When the user scrolls down 20px from the top of the document, show the button window.onscroll = function() {scrollFunction()}; function scrollFunction() { if (document.body.scrollTop > 700 || document.documentElement.scrollTop > 700) { mybutton.style.display = "block"; } else { mybutton.style.display = "none"; } } // When the user clicks on the button, scroll to the top of the document function topFunction() { document.body.scrollTop = 200; // For Safari document.documentElement.scrollTop = 200; // For Chrome, Firefox, IE and Opera }