(function() {
  this.fixedBar = function() {
    var $fixed, hTop;
    $fixed = $('.fixed-bottom');
    $fixed.prependTo('body');
    if ($('#hide-fixed-top').length) {
      if ($(window).width() > 1000) {
        hTop = $('#hide-fixed-top').offset().top - ($('.header').height() / 2);
      } else {
        hTop = $('#hide-fixed-top').offset().top;
      }
    } else {
      hTop = 0;
    }
    return $(window).scroll(function() {
      var $checkVal, $sponsoredJobs, bottom, hBottom;
      $fixed.show();
      if ($(window).width() > 1000) {
        hBottom = ($(document).innerHeight() - $(window).innerHeight() - $('footer').innerHeight() + $fixed.innerHeight()) - $(window).scrollTop();
        bottom = '1px';
        if ($('#cb-tip').length) {
          $('#cb-tip').css('top', 0);
        }
      } else {
        hBottom = ($(document).innerHeight() - $(window).innerHeight() - $('footer').innerHeight() - $('#col-right').innerHeight() - $('#cb-tip').innerHeight() - $('.site-takeover-banner-jdp-banner-mobile').innerHeight() + $fixed.innerHeight()) - $(window).scrollTop();
        if ($('#cb-tip').length) {
          $checkVal = $('.site-takeover-banner-jdp-banner-mobile').length ? $('.site-takeover-banner-jdp-banner-mobile').innerHeight() + 40 : 0;
          if (isMobile.any) {
            $sponsoredJobs = 0;
          } else {
            $sponsoredJobs = $('.content-pna').innerHeight() + 20;
          }
          bottom = $('#col-right').innerHeight() + 20 + $('#cb-tip').innerHeight() + $checkVal + $sponsoredJobs;
        } else {
          bottom = $('#col-right').innerHeight() - $('#tn-job-snapshot').innerHeight() + $fixed.innerHeight() + 20;
        }
        if ($('#cb-tip').length) {
          $('#cb-tip').css('top', $fixed.innerHeight());
          $('#col-right').css('top', $fixed.innerHeight());
        }
        if ($('.site-takeover-banner-jdp-banner-mobile').length) {
          if ($('.content-pna').length) {
            $('.site-takeover-banner-jdp-banner-mobile').css('top', $fixed.innerHeight());
          } else {
            $('.site-takeover-banner-jdp-banner-mobile').css('top', $fixed.innerHeight());
          }
        }
        if ($('.content-pna').length) {
          $('.content-pna').css('top', '160px');
          $('.site-takeover-banner-jdp-banner-mobile').addClass('sponsored-jobs-enabled');
        }
      }
      if (hBottom >= 0 && $(window).scrollTop() >= hTop + $('#cookie').innerHeight() + $('.content-pna').innerHeight()) {
        if ($fixed.hasClass('not-fixed')) {
          if ($('.cookie-bar').css('display') !== 'none' && $('#cookie').length) {
            return $fixed.removeClass('not-fixed').css('bottom', $('#cookie').innerHeight()).prependTo('body');
          } else {
            $fixed.removeClass('not-fixed').css('bottom', '15px').prependTo('body');
            if ($('#cookie').length) {
              return $('#cookie').css({
                'bottom': $fixed.innerHeight()
              });
            }
          }
        }
      } else {
        if (!$fixed.hasClass('not-fixed')) {
          $('#tn-job-snapshot').css('padding-bottom', $fixed.innerHeight() + 20);
          $fixed.addClass('not-fixed').css('bottom', bottom).prependTo('footer');
        }
        if ($('#cookie').length) {
          return $('#cookie').css({
            'bottom': '0px'
          });
        }
      }
    });
  };

  this.fixedApply = function() {
    var fixe_top, hTop;
    if ($('.apply-top-anchor').length) {
      hTop = $('.apply-top-anchor').offset().top + ($('.apply-top-anchor').height());
    } else {
      hTop = 0;
    }
    fixe_top = 0;
    return $(window).scroll(function() {
      var bottom, hBottom, top;
      top = $(window).scrollTop() - ($('.header').innerHeight() + $('#jobs-filters').innerHeight() - $(window).innerHeight()) - $('#apply-bottom').innerHeight() - $('#tn-custom-pages-swimlanes').innerHeight() - (parseInt($('#apply-bottom-content').css('marginBottom')) / 2) + fixe_top;
      if ($(window).width() >= 1000) {
        if (fixe_top === 100) {
          fixe_top = 0;
        }
        hBottom = ($(document).innerHeight() - $(window).innerHeight() - $('footer').innerHeight() - parseInt($('#apply-bottom-content').css('marginBottom')) - $('#cb-tip').innerHeight()) - $('#banner-ad').innerHeight() - $('.content-pna').innerHeight() - $(window).scrollTop();
        if ($('.site-takeover-banner-jdp-banner').length > 0) {
          bottom = $('#cb-tip').innerHeight() + $('.site-takeover-banner-jdp-banner-with-slider').innerHeight() + $('#banner-ad').innerHeight() + parseInt($('#apply-bottom-content').css('marginBottom')) + ($('.content-pna').innerHeight() + 20);
        } else {
          bottom = $('#cb-tip').innerHeight() + $('#banner-ad').innerHeight() + parseInt($('#apply-bottom-content').css('marginBottom')) + ($('.content-pna').innerHeight() + 20);
        }
        if (hBottom >= 0 && $(window).scrollTop() >= hTop && !$('.panel-display').length) {
          return $('#apply-bottom').css({
            'top': top,
            'bottom': 'auto'
          });
        } else {
          return $('#apply-bottom').css({
            'top': 'auto',
            'bottom': bottom
          });
        }
      }
    });
  };

  this.fixedBulk = function() {
    return $(window).scroll(function() {
      var $target, has_reach_top, has_reached_bottom, offset;
      $target = $('.fixed-bottom-bulk');
      has_reached_bottom = $(window).scrollTop() > $('#fixed-bulk-apply-marker').offset().top - $(window).height();
      if (typeof $('.static-top-bulk').offset() !== 'undefined') {
        has_reach_top = $(window).scrollTop() < $('.static-top-bulk').offset().top + $('.static-top-bulk').innerHeight() - $('header').innerHeight();
      }
      if ($(window).width() > 1000) {
        $target.appendTo('#fixed-bulk');
        if (has_reached_bottom || has_reach_top) {
          return $target.css('position', 'static');
        } else {
          $target.css('position', 'absolute');
          offset = $(window).scrollTop() - 10;
          $target.css('bottom', '-' + offset + 'px');
          return $target.css('width', $('.static-top-bulk').outerWidth() + 'px');
        }
      } else {
        $target.addClass('full-width-mobile');
        if (has_reached_bottom || has_reach_top) {
          $target.appendTo('#fixed-bulk');
          return $target.css('position', 'static');
        } else {
          $target.prependTo('body');
          $target.css('position', 'fixed');
          return $target.css('bottom', '0px');
        }
      }
    });
  };

  $(function() {
    var filter_fixed, fixedFilter;
    filter_fixed = $('.filter-fixed');
    if ($('#tn-custom-header').length && $('#jobs-filters').length) {
      $('#jobs-filters').css({
        'position': 'sticky',
        'top': $('.header .header-tn').innerHeight()
      });
    }
    fixedFilter = function() {
      var divHeight, scrollTop, top;
      scrollTop = ($(window).height() - filter_fixed.height()) + $(window).scrollTop();
      top = $(window).scrollTop() - ($('.header').innerHeight() + $('.top-bloc').innerHeight() + $('.breadcrumbs').innerHeight() - $(window).innerHeight()) - filter_fixed.innerHeight() - parseInt($('#fixed-parent').css('paddingTop'));
      divHeight = $('#fixed-parent').offset().top + $('#fixed-parent').innerHeight();
      if ($('.cookie-bar').css('display') === 'block') {
        top = top + $('.cookie-bar').innerHeight();
        divHeight = divHeight + $('.cookie-bar').innerHeight();
      }
      if (scrollTop > divHeight) {
        return filter_fixed.removeClass('fixed');
      } else {
        return filter_fixed.addClass('fixed').css({
          top: top
        });
      }
    };
    if (filter_fixed.length) {
      if ($(window).width() > 1029) {
        $(window).scrollTop($(window).scrollTop() + 1);
        fixedFilter();
      } else {
        filter_fixed.removeClass('fixed');
      }
      $(window).scroll(function() {
        if ($(window).width() > 1029) {
          return fixedFilter();
        } else {
          return filter_fixed.removeClass('fixed');
        }
      });
    }
    if ($('.fixed-bottom').length && !$("#similar-jobs-lazy-load").length) {
      fixedBar();
    }
    if ($('#jrpjdp').length) {
      fixedApply();
    }
    if ($('#reco-us').length) {
      return fixedBulk();
    }
  });

}).call(this);
(function() {
  this.initFormMaterial = function() {
    addNotranslateClass();
    return $('.form-material').each(function() {
      var $fields;
      $fields = $(this).find('.field');
      return $fields.each(function() {
        var $input, $label, $this;
        $this = $(this);
        $input = $this.find('input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], textarea, .fake-input-val, select');
        $label = $input.parent().hasClass('easy-autocomplete') ? $input.parent().parent().find('label') : $input.prev('label');
        if ($input.hasClass('fake-input-val') && $input.text() !== "") {
          $input.parent().prev('label').addClass('focus');
        }
        if ($input.is("textarea")) {
          $input.prev('label').addClass('focus');
        }
        if ($input.val() !== "") {
          $label.addClass('focus');
        } else {
          $label.removeClass('focus');
        }
        $input.focus(function() {
          if (!$input.val().length) {
            return $label.addClass('focus');
          }
        });
        $input.on('blur change', function() {
          if (!$input.val() === null && !$input.val().length) {
            return $label.removeClass('focus');
          } else {
            return $label.addClass('focus');
          }
        });
        return $input.on('keydown', function() {
          return $label.addClass('focus');
        });
      });
    });
  };

  this.addNotranslateClass = function() {
    return $('.material-icons, material-icons-outlined').each(function() {
      return $(this).addClass('notranslate');
    });
  };

  $(function() {
    if ($('.pick-me-a-date').length > 0) {
      $('.pick-me-a-date').pickadate({
        min: new Date(1965, 0, 1),
        selectYears: true,
        selectMonths: true,
        container: '.site-container',
        selectYears: 70,
        max: +3650,
        formatSubmit: 'yyyy-mm-dd',
        format: 'dd mmmm yyyy',
        hiddenSuffix: '',
        updateInput: true,
        onOpen: function() {
          if ($('.form-material').length) {
            return this.$node.prev('label').addClass('focus');
          }
        },
        onSet: function() {
          if ($('.form-material').length) {
            if (this.$node.val() !== "") {
              return this.$node.prev('label').addClass('focus');
            } else {
              return this.$node.prev('label').removeClass('focus');
            }
          }
        }
      });
    }
    if ($('.screener-date').length > 0) {
      $('.screener-date').pickadate({
        min: new Date(1965, 0, 1),
        selectYears: true,
        selectMonths: true,
        container: '.site-container',
        selectYears: 70,
        max: +3650,
        formatSubmit: 'mm/dd/yyyy',
        format: 'mm/dd/yyyy',
        hiddenSuffix: '',
        updateInput: true,
        onOpen: function() {
          if ($('.form-material').length) {
            return this.$node.prev('label').addClass('focus');
          }
        },
        onSet: function() {
          if ($('.form-material').length) {
            if (this.$node.val() !== "") {
              return this.$node.prev('label').addClass('focus');
            } else {
              return this.$node.prev('label').removeClass('focus');
            }
          }
        }
      });
    }
    if ($('.airpicker-months').length) {
      $('.airpicker-months').datepicker({
        language: 'en',
        minView: "months",
        view: "months",
        dateFormat: "MM yyyy",
        minDate: new Date(1965, 0, 1),
        maxDate: new Date(),
        autoClose: true
      });
    }
    if ($('.airpicker-years-months---').length) {
      $('.airpicker-years-months').datepicker({
        language: 'en',
        minView: "months",
        view: "years",
        dateFormat: "mm/yyyy",
        minDate: new Date(1965, 0, 1),
        maxDate: new Date(),
        autoClose: true
      });
    }
    if ($('.airpicker-years').length) {
      $('.airpicker-years').each(function() {
        var autoDate;
        autoDate = $(this).val() !== '' ? moment().format($(this).val()) : '';
        return $(this).datepicker({
          language: 'en',
          selectYears: true,
          selectMonths: false,
          dateFormat: 'yyyy',
          view: 'years',
          minView: 'years',
          minDate: new Date(1930, 0, 1),
          maxDate: new Date(),
          autoClose: true
        }).data('datepicker').selectDate(autoDate);
      });
    }
    if ($('.full_date_picker').length) {
      $('.full_date_picker').each(function() {
        var autoDate;
        autoDate = $(this).val() !== '' ? new Date($(this).attr('data-value')) : '';
        return $(this).datepicker({
          language: 'en',
          minDate: new Date(1965, 0, 1),
          maxDate: new Date(),
          autoClose: true,
          dateFormat: $(this).attr('data-format'),
          hiddenSuffix: '',
          updateInput: true,
          toggleSelected: false,
          onSelect: function(formattedDate, date, inst) {
            twoDatesValidation();
            experienceSubmitValidationUS();
            return experienceSubmitValidationUSModal();
          }
        }).data('datepicker').selectDate(autoDate);
      });
    }
    initDatePickerProfileUS_MM_YYYY($('.month_and_year_date_picker'));
    if ($('.airpicker-dob').length) {
      $('.airpicker-dob').datepicker({
        language: 'en',
        selectYears: true,
        selectMonths: true,
        dateFormat: 'yyyy-mm-dd',
        minDate: new Date(1930, 0, 1),
        maxDate: new Date(),
        autoClose: true
      });
    }
    if ($('.form-material').length) {
      initFormMaterial();
    }
    $('.field.password').each(function() {
      var $this, field, show;
      $this = $(this);
      show = $this.find('.show-password');
      field = $this.find('input[type=password]');
      return show.click(function(e) {
        e.preventDefault();
        if (field.attr('type') === 'password') {
          field.attr('type', 'text');
          show.text("" + (I18n.t('js.hide')));
        } else {
          field.attr('type', 'password');
          show.text("" + (I18n.t('js.show')));
        }
        if ($this.next('#password_filter').length) {
          return $this.next('#password_filter').fadeIn();
        }
      });
    });
    if ($(document).find('.form-collapse').length) {
      $(document).on('click', '.trigger-mobile-form-collapse', function(evt) {
        evt.stopImmediatePropagation();
        $('.trigger-mobile-form-collapse').toggleClass('dn-i');
        $('#job-search-form').toggleClass('form-collapse');
        $('#job-search-form #Keywords').focus();
        if ($('#jobs-filters-form-collapse').length) {
          $('#jobs-filters-form-collapse').toggleClass('col-form-collapse');
        }
        if ($('#jobs-filters-content').length && $('#jobs-filters-content').hasClass('display')) {
          return $('#jobs-filters-content').removeClass('display');
        }
      });
      $(document).on('keyup', '#job-search-form #Keywords', function() {
        $('.trigger-mobile-form-collapse').addClass('dn-i');
        if (!isMobile.any) {
          $('#job-search-form').addClass('form-collapse');
        }
        if ($('#jobs-filters-form-collapse').length) {
          return $('#jobs-filters-form-collapse').removeClass('col-form-collapse');
        }
      });
      $(document).on('click', function(evt) {
        if (!$('#job-search-form').hasClass('form-collapse') && (!$(evt.target).closest('#job-search-form').length > 0)) {
          $('.trigger-mobile-form-collapse').removeClass('dn-i');
          $('#job-search-form').addClass('form-collapse');
          if ($('#jobs-filters-form-collapse').length) {
            return $('#jobs-filters-form-collapse').removeClass('col-form-collapse');
          }
        }
      });
    }
    if ($('#job-search-form').length && $('.trigger-mobile-form-collapse').length && $('.trigger-mobile-form-collapse').css('display') === "none" && $('.skip-link').length === 0) {
      return $('#job-search-form #Keywords').trigger('focus');
    }
  });

}).call(this);
(function() {
  $(window).on('load', function() {
    $(document).on('change', '#language-filters input[type=checkbox]', bindSearchLanguageTypes);
    if ($('#lang_all_search').prop('checked') === false) {
      return bindSearchLanguageTypes();
    }
  });

  this.bindSearchLanguageTypes = function(event) {
    var context, languageText, languages, languagesChecked, maxShownLanguage, totalLanguagesChecked;
    languageText = [$('#language_text').attr('placeholder')];
    languages = [];
    maxShownLanguage = 5;
    context = '#language-filters';
    languagesChecked = $('.lang-type:checked', context);
    totalLanguagesChecked = languagesChecked.length;
    if ($('.lang:checked', context).length === 0) {
      $('#lang_all_search').prop('checked', true);
    } else if (event && event.currentTarget.id === 'lang_all_search') {
      languagesChecked.each(function() {
        return $(this).prop('checked', false);
      });
    } else if (totalLanguagesChecked !== $('.lang-type', context).length) {
      languageText.length = 0;
      $('#lang_all_search').prop('checked', false);
      if (totalLanguagesChecked > maxShownLanguage) {
        languageText.push(totalLanguagesChecked + ' Languages selected');
      }
      languagesChecked.each(function() {
        if (totalLanguagesChecked <= maxShownLanguage) {
          languageText.push($(this).next().text());
        }
        return languages.push($(this).val());
      });
    }
    $('#language_text').val(languageText.join(', ')).focus();
    return $('#languages', context).val(languages.join());
  };

}).call(this);
(function ($) {
  var JRPJobClicked = false;
  var onLoadClicked = false;
  let TNResetFilterClicked = false;
  $(document).ready(function() {
    if ($('#jrpjdp').length) {
      setRemoteLinks();
      addListeners();
      if (isWorkFromHomeFilterV2Enabled()) {
        setLastSearchedLocation();
        bindRemoteOnsiteTypes();
        onChangeRemoteOnsiteTypes();
      }
      $('#jrpjdp').find('#jobs_collection').removeClass('disabled');
      filterPositionTN();
    };
    partnerJobsLabel();
  });

  $(document).on('click', '#submit-jobs-filter', function (e) {
    e.preventDefault();
    jobSearchCall(e);
  });

  $(document).on('click', '.easy-apply-no-modal.one-click-easy-apply, .easy-apply-modal-link, .one-click-job-apply', function (e) {
    $('.easy-apply-no-modal.one-click-easy-apply').addClass("btn-disabled");
    if (SettingControlValues.EnableVisitorTracking == 'true') {
      jobDID = $('.data-results-content-parent.active .data-results-content').data('job-did');
      ipath = $('.data-results-content-parent.active .data-results-content').data('ipath');
      jobDID = jobDID !== undefined ? jobDID : job_did;
      if (jobDID !== undefined) {
        trackEvent(jobDID, ipath);
      }
      e.preventDefault();
    }
  });

  var jrpSortingData;
  $(document).on('click', '.jobs-shorting', function(e) {
    var sortingParams = $(this).attr('data-url').split('?')[1];
    jrpSortingData = convertParamsToObj(decodeURIComponent(sortingParams).replace(/['"]+/g, ''));
    jobSearchCall(e);
  });

  $(document).on('click', '#jrp_remote_checkbox', function(e) {
    var sortingParams = $(this).attr('data-url').split('?')[1];
    jrpSortingData = convertParamsToObj(decodeURIComponent(sortingParams).replace(/['"]+/g, ''));
    jrpSortingData.cb_workhome = $(this).is(':checked') ? (isWorkFromHomeFilterV2Enabled() ? 'remote' : 'true') : (isWorkFromHomeFilterV2Enabled() ? 'all' : 'false');
    jrpSortingData.location = $(this).is(':checked') ? processSearchedLocation('remote') : processSearchedLocation('');
    $('#remote_onsite_hidden').val(jrpSortingData.cb_workhome);
    Cookies.set('work_from_home_remote', $(this).is(':checked'));
    jobSearchCall(e);
  });

  // Scripts for JRP collapse company jobs
  var jrpScrollPos = 0;

  $(document).on('click', '.collapse-expand-more-jobs', function(e){
    $parentWrapper = $(this).closest('.collapsed-activated');
    if($parentWrapper.hasClass('collapse-expand')){
      $parentWrapper.removeClass('collapse-expand')
    }else{
      $parentWrapper.addClass('collapse-expand')
    }
    lazyLoad();
  })

  $(document).on('click', '.view_all_company_similar_jobs', function(e) {
    e.preventDefault();
    e.stopImmediatePropagation();
    $(this).prop('disabled', true).find('svg').remove();
    $(this).html($(this).html() + I18n.t('js.spin_icon'));
    var search = location.search.substring(1);
    if (search != '') {
      search = JSON.parse('{"' + decodeURI(search).replace(/["\\]/g, '\\$&').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
      delete search.page_number
    }
    companyData = $(this).data()
    search.keywords = $('#Keywords').val();
    search.location = $('#Location').val();
    js_company = companyData.company;
    js_company_id = companyData.companyDid;
    js_companycollapsehash = companyData.companycollapsehash;
    js_company_filters = true;
    var useCollapse = Object.assign({}, search, $(this).data());
    jrpScrollPos = $('#col-fixed').scrollTop();
    collapseJobsJrpMoreCall(useCollapse)
  })

  $(document).on('click', '.collapse-back-to-result', function(e){
    $('.jrp-jobs-search-result-section').fadeIn(300);
    $('.collapse-company-jobs-section').fadeOut(300);
    $('#col-fixed').scrollTop(jrpScrollPos);
    if($('.jrp-infinity-scroll').length > 0) {
      if($('#load-more-jobs').length > 0) {
        nextURL('#load-more-jobs');
        prevURL('#load-more-jobs');
      }
    }
    Cookies.set('work_from_home_remote', 'false');
  })
  // end

  var filterPositionTN = function () {
    if ($('#jrpjdp #jobs-filters').innerHeight()) {
      if ($('#tn-custom-pages-swimlanes').innerHeight()) {
        if ($('.header-tn-premium').innerHeight()) {
          $('#jobs-filters').css({ 'position': 'sticky', 'top': '66px'})
        } else {
          $('#jobs-filters').css({ 'position': 'sticky'})
        }
      } else if ($('.header .header-tn').innerHeight()) {
        $('#jobs-filters').css('top', $('.header .header-tn').innerHeight())
      }
    }
  }

  var setRemoteLinks = function () {
    if (isDesktop()) {
      $('.job-listing-item').attr('data-remote', true);
    } else {
      $('.job-listing-item').removeAttr('data-remote');
      setExternalUrlForFeedJobs()
    }
    $('#teasing_jobs_collection .job-listing-item').removeAttr('data-remote');
  };

  var setListenerForFeedJobs = function () {
    $('.job-listing-item').each(function (i,e) {
      if ($(this).attr('data-external-company-link') != '' && $(this).attr('data-external-company-link') != undefined && $(this).attr('data-external-company-link') != $(this).attr('href')) {
        if (i == 0 && !$(this).hasClass('first-feed-job')) {
          $(this).addClass('first-feed-job');
        }
        else {
          $(this).on('click', function () {
            window.open($(this).attr('data-external-company-link'), '_blank');
          });
        }
      }
    });

    $('.first-feed-job').on('click', function (e) {
      window.open($(this).attr('data-external-company-link'), '_blank');
    });
  }

  var setExternalUrlForFeedJobs = function () {
    $('.job-listing-item').each(function () {
      if ($(this).attr('data-external-company-link') != '' && $(this).attr('data-external-company-link') != undefined && $(this).attr('data-external-company-link') != $(this).attr('href')) {
        $(this).attr('href', $(this).attr('data-external-company-link')).attr('target', '_blank');
      }
    })
  }

  var addListeners = function () {
    onAjaxTabSelection();
    onChangeEmploymentTypes();
    onChangeLanguages();
    onChangeCategories();
    onChangeFilterOption();
    onHistoryStatePop();
    onLoadMoreJobs();
    onWindowResize();
  };


  var isDesktop = function () {
    return $(window).width() >= 1001;
  };

  var onWindowResize = function () {
    $(window).on('resize', function () {
      setRemoteLinks();
    });
  };

  var onChangeEmploymentTypes = function () {
    $(document).on('change', '.employment-types input[type=checkbox]', bindEmploymentTypes);
    $(document).on('change', '.employer-types input[type=checkbox]', bindEmployerTypes);
    $(document).on('change', '#job-group-filter-content input[type=checkbox]', bindJobGroup);
  };

  var bindEmploymentTypes = function (event) {
    var employmentTypes = '';

    if ($('.emp:checked').length === 0) {
      // No checkbox checked -> Check 'All' option
      $('#emp_all').prop('checked', true);
      employmentTypes = 'all';
    } else if (event.currentTarget.id === 'emp_all') {
      // Checked option is 'all' -> Uncheck all other options
      $('.emp-type:checked').each(function () {
        $(this).prop('checked', false);
      });
      employmentTypes = 'all';
    } else if ($('.emp-type:checked').length === $('.emp-type').length) {
      employmentTypes = 'all';
    } else {
      $('#emp_all').prop('checked', false);
      $('.emp-type:checked').each(function () {
        employmentTypes += $(this).val() + ',';
      });
    };

    $('#emp').val(employmentTypes);
  };
  var bindEmployerTypes = function (event) {
    var employerTypes = '';

    if ($('.employer-emp:checked').length === 0) {
      // No checkbox checked -> Check 'All' option
      $('#employer_all').prop('checked', true);
      employerTypes = 'all';
    } else if (event.currentTarget.id === 'employer_all') {
      // Checked option is 'all' -> Uncheck all other options
      $('.employer-type:checked').each(function () {
        $(this).prop('checked', false);
      });
      employerTypes = 'all';
    } else if ($('.employer-type:checked').length === $('.employer-type').length) {
      employerTypes = 'all';
    } else {
      $('#employer_all').prop('checked', false);
      $('.employer-type:checked').each(function () {
        employerTypes += $(this).val() + ',';
      });
    };
    $('#employer').val(employerTypes);
  };

  var bindJobGroup = function (event) {
    var jobGroups = '';

    if ($('.job-grp:checked').length === 0) {
      // No checkbox checked -> Check 'All' option
      $('#job_group_all').prop('checked', true);
      jobGroups = 'all';
    } else if (event.currentTarget.id === 'job_group_all') {
      // Checked option is 'all' -> Uncheck all other options
      $('.job-group-type:checked').each(function () {
        $(this).prop('checked', false);
      });
      jobGroups = 'all';
    } else if ($('.job-group-type:checked').length === $('.job-group-type').length) {
      $('.job-group-type:checked').each(function () {
        $(this).prop('checked', false);
      });
      $('#job_group_all').prop('checked', true);
      jobGroups = 'all';
    } else {
      $('#job_group_all').prop('checked', false);
      $('.job-group-type:checked').each(function () {
        jobGroups += $(this).val() + ',';
      });
    };
    $('#job-group-filter-button').val(jobGroups);
  };

  var onChangeRemoteOnsiteTypes = function () {
    $(document).on('click', '#jobs-filters-content .filter-option .remote-onsite', bindRemoteOnsiteTypes);
  };

  var bindRemoteOnsiteTypes = function (event) {
    var remoteOnsiteTypes = '';
    var onlyAllChecked = ($('#remote_onsite_all').is(":checked") && $('.remote-onsite-type:checked').length == 0);
    var noOptionChecked = ($('.remote-onsite:checked').length === 0);
    var clickedOnAllOption = (typeof event != 'undefined' && event.currentTarget.id === 'remote_onsite_all');
    var onsiteRemoteHybridCheckedOnly = ($('.remote-onsite-type:checked').length === 3);

    if (onlyAllChecked || noOptionChecked || clickedOnAllOption || onsiteRemoteHybridCheckedOnly) {
      // Check 'All' option
      $('.remote-onsite').prop('checked', true);
      remoteOnsiteTypes = 'all';
    } else {
      $('#remote_onsite_all').prop('checked', false);
      var remoteOnsiteTypesArr = []
      $('.remote-onsite-type:checked').each(function () {
        remoteOnsiteTypesArr.push($(this).val());
      });
      remoteOnsiteTypes = remoteOnsiteTypesArr.join(',');
    };
    $('#remote_onsite_hidden').val(remoteOnsiteTypes);
  };

  var onChangeLanguages = function () {
    $(document).on('change', '#jobs-filters-content .languages input[type=checkbox]', bindLanguageTypes);
  };

  var bindLanguageTypes = function (event) {
    var languages = [];
    var context = '#jobs-filters-content';
    var languageFiltersChecked = $('.lang-type:checked', context);

    if ($('.lang:checked', context).length === 0) {
      // No checkbox checked -> Check 'All' option
      $('#lang_all', context).prop('checked', true);
    } else if (event.currentTarget.id === 'lang_all') {
      // Checked option is 'all' -> Uncheck all other options
      languageFiltersChecked.each(function () {
        $(this).prop('checked', false);
      });
    } else if (languageFiltersChecked.length !== $('.lang-type', context).length) {
      $('#lang_all', context).prop('checked', false);
      languageFiltersChecked.each(function () {
        languages.push($(this).val());
      });
    };
    $('#languages', context).val(languages.join());
  };

  const onChangeCategories = function () {
    $(document).on('change', '#jobs-filters-content .categories input[type=checkbox]', bindCategoryTypes);
  };

  const bindCategoryTypes = function (event) {
    const categories = [];
    const context = '#jobs-filters-content .categories';
    const categoryFiltersChecked = $('.category-value:checked', context);

    if ($('.category:checked', context).length === 0) {
      // No checkbox checked -> Check 'All' option
      $('#category_all', context).prop('checked', true);
    } else if (event.currentTarget.id === 'category_all') {
      // Checked option is 'all' -> Uncheck all other options
      categoryFiltersChecked.each(function () {
        $(this).prop('checked', false);
      });
    } else if (categoryFiltersChecked.length !== $('.category-value', context).length) {
      $('#category_all', context).prop('checked', false);
      categoryFiltersChecked.each(function () {
        categories.push($(this).val());
      });
    };
    $('#filter_category', context).val(categories.join());
  };

  var onChangeFilterOption = function () {
    if (isDesktop() || $('.mobile-filter-tabs').length > 0) {
      $(document).on('change', '#jobs-filters-content .filter-option input', jobSearchCall);
    }
  };

  var onHistoryStatePop = function () {
    $(window).on('popstate', function (event) {
      window.location.reload();
    });
    getSelectedFilters();
  };

  if (isFilterRedesign()) {
    $(document).on('click', '.reset-filter', function(e) {
      $('.filter-form-redesign').find('.filter.redesign-filter-selected input').prop('checked', false);
      $('.filter-form-redesign').find('.fake-filter.redesign-filter-selected .filter-option input:checked').prop('checked', false);
      $('.filter-form-redesign').find('#remote_onsite_hidden').val('all');
      sessionStorage.removeItem('filterOrders');
      sessionStorage.removeItem('filterOrdersMobile');
      Cookies.set('work_from_home_remote', 'false');
      jobSearchCall(e);
    });
    $(document).on('click', '.selected-filters-wrappers .selected-filters li button:not(.default-btn)', function(e){
      var currentCheckboxId = $(this).attr('aria-control');
      if (currentCheckboxId.indexOf('onsite') != -1) {
        $(`#${currentCheckboxId}`).trigger('click');
      } else {
        $(`#${currentCheckboxId}`).prop('checked', false);
      }
      if (!(currentCheckboxId == 'posted_45' || currentCheckboxId == 'radius_30')) {
        filterOrder = sessionStorage.getItem('filterOrdersMobile');
        filterOrder = JSON.parse(filterOrder);
        filterOrder = filterOrder.filter(item => item !== currentCheckboxId);
        var filterOrderStringified = JSON.stringify(filterOrder);
        sessionStorage.setItem('filterOrdersMobile', filterOrderStringified)
      }
      jobSearchCall(e);
    });
  }

  $(document).on('click', '.tn-reset-filter', function (e) {
    e.preventDefault();
    sessionStorage.removeItem('filterOrders');
    sessionStorage.removeItem('filterOrdersMobile');
    TNResetFilterClicked = true;
    jobSearchCall(e);
  });
  
  var resizeElements = function () {
    var fixedTop = $('.header').innerHeight() + $('#jobs-filters').innerHeight();
    if ($('.campaign-enabled').length) {
      $('#col-fixed').height($(window).innerHeight() - fixedTop - 20);
    } else {
      $('#col-fixed .fix-elem-parent').height($(window).innerHeight() - fixedTop - $('#jobs-found').innerHeight() - 20);
    }
    $('#col-fixed').width($('.data .col.small').width());
    if ($('#tn-custom-pages-swimlanes').length)
    {
      $('#col-fixed').css('top', 0).css('position', 'sticky')
    }
    $('#col-fixed').css('top', 0).css('top',fixedTop)
  };

  var getSelectedFilters = function () {
    if(SettingControlValues.HostSite === 'RM' && TNResetFilterClicked) { // TNv3
      return {
        keywords: $('#Keywords').val(),
        location: $('#Location').val().toLowerCase() == I18n.t('js.work_from_home_remote').toLowerCase()  ? '' : $('#Location').val(),
      }
    }

    var url = window.location;
    if ($('#jrpjdp').length) {
      $('#jrpjdp').find('#jobs_collection').removeClass('disabled')
    }
    var postedWithin = $('.posted-within .filter-option input:checked').val();
    if (postedWithin == '45') {
      postedWithin = ''
    }
    var postedWithinHTML = $('.posted-within .filter-option input:checked + label').html();
    var postedWithinTitle = $('.posted-within').parent().parent().find('.filter-title');
    if (isFilterRedesign()) {
      postedWithinParam = true
    } else {
      var postedWithinParam = /posted=/.test(url);
    }

    var radius = '', radiusHTML = '', radiusTitle = '', radiusParam = '';

    if ($('.radius-in-miles').length) {
      radius = $('.radius-in-miles .filter-option input:checked').val();
      radiusHTML = $('.radius-in-miles .filter-option input:checked + label').html();
      radiusTitle = $('.radius-in-miles').parent().parent().find('.filter-title');
      if (isFilterRedesign()) {
        radiusParam = true
      } else {
        radiusParam = /radius=/.test(url);
      }
    }

    var countryCode = $('.country-code').find('.filter-option input:checked').val();

    var category = $('.category .filter-option input:checked').val();
    if (category == '0') {
      category = ''
    }
    var categoryHTML = $('.category .filter-option input:checked + label').html();
    if (categoryHTML == undefined){
      categoryHTML = 'Any'
      $('#cat_0').prop('checked', true);
    }

    var categoryTitle = $('.category').parent().parent().find('.filter-title');
    var categoryParam = /cat=/.test(url);
    
    var jobGroup = $('.cb-job-group .filter-option input:checked').map(function () {
      return $(this).val();
    }).get().join('|');
    if (jobGroup == 'All'){
      jobGroup = ''
    }

    var jobGroupHTML = $('.cb-job-group .filter-option input:checked + label').html();
    if (jobGroupHTML == undefined || jobGroupHTML == 'All' ){
      jobGroupHTML = 'Job Group'
      $('#job_group_all').prop('checked', true);
    }
    var jobGroupTitle = $('.cb-job-group').parent().parent().find('.filter-title');
    var jobGroupParam = /job_group=/.test(url);
    
    var salary = $('.salary .filter-option input:checked').val();
    if (salary == '0') {
      salary = ''
    }
    var salaryHTML = $('.salary .filter-option input:checked + label').html();
    if (salaryHTML == undefined){
      salaryHTML = 'Any'
      $('#pay_0').prop('checked', true);
    }
    var salaryTitle = $('.salary').parent().parent().find('.filter-title');
    var salaryParam = /pay=/.test(url);

    var employmentTypes = $('.employment-types input:checked').map(function () {
      return $(this).val();
    }).get().join();
    if (employmentTypes == null){
      employmentTypes = 'all'
    }
    if((employmentTypes.match(/,/g) || []).length >= 2 && !(isFilterRedesign())) {
      var employmentTypesHTML = $('.employment-types input:checked').first().next('label').html() + "...";
    } else {
      var employmentTypesHTML = $('.employment-types input:checked').first().next('label').html();
    }
    var employmentTypesTitle = $('.employment-types').first().parent().parent().find('.filter-title');

    var employerTypes = $('.employer-types input:checked').map(function () {
      return $(this).val();
    }).get().join();
    if (employerTypes == null || employerTypes == undefined) {
      employerTypes = 'all'
    }

    if((employerTypes.match(/,/g) || []).length >= 1){
      var employerTypesHTML = $('.employer-types input:checked').first().next('label').html() + "...";
    }else{
      var employerTypesHTML = $('.employer-types input:checked').first().next('label').html();
    }
    var employerTypesTitle = $('.employer-types').first().parent().parent().find('.filter-title');

    if (postedWithinParam) {
      if (isFilterRedesign() && isMobile.any) {
        if (postedWithinHTML != undefined ) {
          postedWithinTitle.html(I18n.t('js.date_posted')).append(`<span class="filter-number">${postedWithinHTML}</span>`);
        }
      } else {
        postedWithinTitle.html(postedWithinHTML);
      }
    }

    if (radiusParam) {
      if (isFilterRedesign() && isMobile.any) {
        if (radiusHTML != undefined) {
          radiusTitle.html(I18n.t('js.distance')).append(`<span class="filter-number">${radiusHTML}</span>`);
        }
      } else {
        radiusTitle.html(radiusHTML);
      }
    }

    if (salaryParam) {
      if (isFilterRedesign() && isMobile.any) {
        if (!(salaryHTML == 'Any') && salaryHTML !== undefined) {
          salaryTitle.html(I18n.t('js.pay')).append(`<span class="filter-number">${salaryHTML}</span>`);
        }
      } else {
        salaryTitle.html(salaryHTML);
      }
    }

    if (categoryParam) {
      categoryTitle.html(categoryHTML);
    }

    if (jobGroupParam) {
      var selectedEle = $('.cb-job-group .filter-option input:checked')
      if(selectedEle.length > 1){
        jobGroupHTML = `${jobGroupHTML}<span class="filter-number">${selectedEle.length}</span>`
      }
      jobGroupTitle.html(jobGroupHTML);
    }

    if ($('.employment-types input:checked').attr('id') != 'emp_all') {
      var filterTitle = $('.employment-types').parents('.filter').find('.filter-title');
      if (isFilterRedesign() && $('.employment-types input:checked').length > 1) {
        if ($(filterTitle).find('.filter-number').length > 0) {
          if (isMobile.any) {
            $(filterTitle).find('.filter-number').html(`${$('.employment-types input:checked').length} ${I18n.t('js.selected')}`)
          } else {
            $(filterTitle).find('.filter-number').html(`${$('.employment-types input:checked').length}`)
          }
        }
        else {
          if (isMobile.any) {
            $($(filterTitle)).append(`<span class="filter-number">${$('.employment-types input:checked').length} ${I18n.t('js.selected')}</span>`)
          } else {
            $($(filterTitle)).append(`<span class="filter-number">${$('.employment-types input:checked').length}</span>`);
            $('.employment-types').parents('.filter').addClass('redesign-filter-selected')
          }
        }
      } else if (isFilterRedesign() && isMobile.any && employmentTypesHTML !== undefined) {
          $(filterTitle).html(I18n.t('js.job_type')).append(`<span class="filter-number">${employmentTypesHTML}</span>`);
        } else {
          employmentTypesTitle.html(employmentTypesHTML);
        }
    }

    if ($('.employer-types input:checked').attr('id') != 'employer_all') {
      employerTypesTitle.html(employerTypesHTML);
    }
    if (isWorkFromHomeFilterV2Enabled()){
      changeRemoteOnsiteFilterTitle();
    }

    urlParams = new URLSearchParams(window.location.search);
    if ( SettingControlValues.HostSite == 'RM' || Cookies.get('reveal') == undefined) {
      var data = {
        posted: postedWithin,
        radius: radius,
        cb_apply: $('#cb-apply').is(':checked'),
        keywords: $('#Keywords').val(),
        location: $('#Location').val().toLowerCase() == I18n.t('js.work_from_home_remote').toLowerCase()  ? '' : $('#Location').val(),
        pay: salary,
        emp: employmentTypes
      };
    }else {
      var data = {
        posted: postedWithin,
        radius: radius,
        cb_apply: $('#cb-apply').is(':checked'),
        keywords: $('#Keywords').val(),
        location: $('#Location').val().toLowerCase() == I18n.t('js.work_from_home_remote').toLowerCase()  ? '' : $('#Location').val(),
        pay: salary,
        emp: employmentTypes,
        job_group: jobGroup
      };
    }

    if ($('.category.category-filter-content .filter-option input').length > 0) {
      data['cat1'] = category;
    }

    if (typeof js_company !== 'undefined' && js_company != '') {
      data['company_name'] = js_company;
    }

    if (typeof js_company_id !== 'undefined' && js_company_id != '') {
      data['company_id'] = js_company_id;
    }

    if (typeof js_companycollapsehash !== 'undefined' && js_companycollapsehash != '') {
      data['companycollapsehash'] = js_companycollapsehash
    }

    if (SettingControlValues.EmployerTypeSetting == 'true' && employerTypes != 'all') {
      data['empcat'] = employerTypes;
    }

    // work from home filter
    if (isWorkFromHomeFilterV2Enabled() == false && $('#cb-workhome').length > 0) {
      data.cb_workhome = $('#cb-workhome').is(':checked');
    }

    // veterans medallion filter
    if ($('#cb-veterans').length > 0) {
      data.cb_veterans = $('#cb-veterans').is(':checked');
    }

    if (countryCode != undefined && countryCode != '') {
      data.country_code = countryCode;
    }

    //company filter
    if ($('.filter.company-filter').length > 0) {
      var companyFacet = urlParams.get('company');
      var companyTitle = $('.company-filter .filter-title');
      var company = $('input[name="company"]:checked').val() || companyFacet;
      var companyHTML = $('input[name="company"]:checked + label').html();

      if (/company=/.test(url)) {
        companyTitle.html(companyHTML);
      }

      data.company = company;
    }

    //Top 10 companies filter
    if ($('.filter.top-companies-filter').length > 0) {
      var companyFacet = urlParams.get('companyfilter');
      top_companies = [];
      $('.top-company:checked').each(function () {
        top_companies.push($(this).val());
      });
      data.companyfilter = top_companies.join('||');
    }

    //location filter
    if ($('.filter.location-filter').length > 0) {
      var cityStateFacet = urlParams.get('cityStateFacet');
      var locationTitle = $('.location-filter .filter-title');
      var location = $('input[name="cityStateFacet"]:checked').val() || cityStateFacet;
      var locationHTML = $('input[name="cityStateFacet"]:checked + label').html();

      if (/cityStateFacet=/.test(url)) {
        locationTitle.html(locationHTML);
      }

      data.cityStateFacet = location;
    }

    //job category filter
    if ($('.filter.job-type-filter').length > 0) {
      var categoryFacet = urlParams.get('categoryFacet');
      var jobTypeTitle = $('.job-type-filter .filter-title');
      var jobType = $('input[name="categoryFacet"]:checked').val() || categoryFacet;
      var jobTypeHTML = $('input[name="categoryFacet"]:checked + label').html();

      if (/categoryFacet=/.test(url)) {
        jobTypeTitle.html(jobTypeHTML.replace("&amp;", "&").replace("%28", "(").replace("%29", ")"));
      }

      data.categoryFacet = jobType && jobType.replace("&", "%26").replace("(", "%28").replace(")", "%29");
    }
    // language filter
    if ($('#languages', '#jobs-filters-content').length > 0) {
      var languagesSelected = $('.languages input.lang-type:checked');
      if ($('.languages input:checked').attr('id') !== 'lang_all_filter') {
        var languagesHTML = languagesSelected.first().next('label').html();
        var filterTitle = $('.languages').first().find('.filter-title')
        if (languagesSelected.length > 1) {
          if (isFilterRedesign()) {
            if ($(filterTitle).find('.filter-number').length > 0) {
              if (isMobile.any) {
                $(filterTitle).find('.filter-number').html(`${languagesSelected.length} ${I18n.t('js.selected')}`)
              } else {
                $(filterTitle).find('.filter-number').html(`${languagesSelected.length}`)
              }
            } else {
              if (isMobile.any) {
                $($(filterTitle)).append(`<span class="filter-number">${$('.languages input:checked').length} ${I18n.t('js.selected')}</span>`)
              } else {
                $($(filterTitle)).append(`<span class="filter-number">${$('.languages input:checked').length}</span>`);
                $('.languages').parents('.filter').addClass('redesign-filter-selected')
              }
            }
          } else {
            languagesHTML += "..."
          }
        } else if (isFilterRedesign() && isMobile.any && languagesHTML !== undefined) {
          $(filterTitle).html(I18n.t('js.all_languages')).append(`<span class="filter-number">${languagesHTML}</span>`);
        } else {
          $(filterTitle).html(languagesHTML);
        }
      }
      data.languages = languagesSelected.map(function () {
        return $(this).val();
      }).get().join()
    }

    // Job Categories Filter
    if ($('#filter_category', '#jobs-filters-content').length > 0) {
      const categoriesSelected = $('#jobs-filters-content .categories input.category-value:checked');
      if ($('#jobs-filters-content .categories input:checked').attr('id') !== 'category_all') {
        let categoriesHTML = categoriesSelected.first().next('label').html();
        if (categoriesSelected.length > 1) {
          categoriesHTML += "..."
        }
        $('#jobs-filters-content .categories').first().find('.filter-title').html(categoriesHTML);
      }

      if (categoriesSelected.length) {
        data.filter_category = categoriesSelected.map(function () {
          return $(this).val();
        }).get().join()
      }
    }

    //discrete field filters
    if ($('.discrete-filter-title').length > 0) {
      document.querySelectorAll('.discrete-filter-title').forEach(function (node) {
        var name = node.parentNode.childNodes[2].getElementsByClassName('discretefield')[0].name;
        var DiscreteFieldVal = urlParams.get(`${name}`);
        var DiscreteFieldTitle = $(`[aria-controls=${name}-filter]`);
        var DiscreteFieldValue = $(`input[name=${name}]:checked`).val() || DiscreteFieldVal;
        var DiscreteFieldHTML = $(`input[name=${name}]:checked + label`).html();

        if (new RegExp(`${name}=`).test(url) && DiscreteFieldHTML) {
          DiscreteFieldTitle.html(DiscreteFieldHTML);
        }
        data[`${name}`] = DiscreteFieldValue;
      })
    }

    if (isWorkFromHomeFilterV2Enabled()) {
      // remote onsite filter
      var remoteOnsiteTypes = $('#remote_onsite_hidden').val();
      data.cb_workhome = remoteOnsiteTypes;
      data.location = processSearchedLocation(remoteOnsiteTypes);
    }

    if(jrpSortingData != undefined || jrpSortingData != null) {
      data['sort'] = jrpSortingData['sort'];
    }
    return data;
  };

  var processSearchedLocation = function(remoteOnsiteTypes) {
    try{
        if(remoteOnsiteTypes == 'remote') {
          return '';
        }
        if( $('#Location').val() != '' && $('#Location').val().toLowerCase() != I18n.t('js.work_from_home_remote').toLowerCase()) {
          return $('#Location').val();
        }
        if (Cookies.get('last_searched_location').toLowerCase != I18n.t('js.work_from_home_remote').toLowerCase()) {
          return Cookies.get('last_searched_location');
        }
        return '';
    }catch(e){
      return '';
    }
  }

  var isScrolling = false;
  var onAjaxTabSelection = function () {
    $last_active = $('.data-results-placeholder');
    $(document).on('ajax:beforeSend', '.job-listing-item', function (event, xhr, settings) {
      JRPJobClicked = true;
      event.stopImmediatePropagation();
      event.preventDefault();
      var $this = $(event.currentTarget);

      if (SettingControlValues.EnableFastJdpUrlForJrp == 'true') {
        settings.url = settings.url.replace('/sejob/', '/job/');
      }
      var reqJdp = new URL(settings.url);

      if($('.flash-message.expired-job-msg').is(':visible')) {
        $('.flash-message.expired-job-msg').remove();
      }

      var current_url = new URL(window.location.href);

      current_url.searchParams.forEach(function(value, key) {
          reqJdp.searchParams.set(key, value);
      });

      reqJdp.searchParams.set('ipath', $(event.currentTarget).data('ipath'));

      if ($('.jrp-jobs-search-result-section').length || typeof cbPageType !== 'undefined' && cbPageType == "JRP") {
        reqJdp.searchParams.set('jdp_req_from', 'jrp');
      }
      settings.url = reqJdp.href;

      var uri = $this.context.href;
      var $target = $('#jdp-data');
      var $placeholder = $('#jdp-empty');
      $('#jdp-content').removeClass('dn');
      // Toggle nav-link 'active' class.
      $this.closest('.nav-tabs').find('.data-results-content-parent').removeClass('active');
      $this.closest('.nav-tabs').find('.data-results-content-parent').removeAttr('aria-current');
      $this.parents('.data-results-content-parent').addClass('active');
      $this.parents('.data-results-content-parent').attr('aria-current','true');
      $last_active.addClass('visited');

      var tnCustomPageHeight = $('#tn-custom-pages-swimlanes').innerHeight() || 0;
      if(!isScrolling && window.pageYOffset > 0) {
        isScrolling = !isScrolling;
        $(window).scrollTo(tnCustomPageHeight, 1000, {interrupt: true, always: function(){ isScrolling = !isScrolling }});
      }

      if ((window.location.pathname).includes('job/') == true) {
        window.history.pushState(null, null, uri);
      }
      $('#apply-bottom').remove();
      resizeElements();

      if($('.panel').hasClass('panel-display')) {
        $('.panel').removeClass('panel-display');
      }

      if ($placeholder.length) {
        $target.removeClass('jdp-active');
        $placeholder.addClass('jdp-active');
      }

    }).on('ajax:success', '.job-listing-item', function (event, data, xhr, status) {
      var $this = $(event.currentTarget);
      var $target = $('#jdp-data');
      var $placeholder = $('#jdp-empty');
      $('#jrp-empty').hide();
      $('#jrp-data').show();
      $last_active = $('.job-listing-item.active');

      if ($placeholder.length) {
        $target.addClass('jdp-active');
        $placeholder.removeClass('jdp-active');
      }
      setUpdateJobEvent();

      if (JRPJobClicked && !onLoadClicked) {
        $('#jdp-pane').find('#jdp-data #hide-fixed-top .btn').focus();
        JRPJobClicked = false;
      }
      onLoadClicked = false;
      if ($('.celebrating-site-takeover-banner').length > 0) {
        carouselInit('.slider-jdp', false);
      }
        
      if (cbPageType == 'JDP' && $('#external-apply-hybrid.remodal.remodal-is-initialized').parent().hasClass('remodal-wrapper')) {
        $('#external-apply-hybrid.remodal.remodal-is-initialized').remodal().destroy();
      }

      $externalApplyResModal = $('#external-apply-resume-modal.remodal.remodal-is-initialized');
      if (cbPageType == 'JDP' && $externalApplyResModal.length && $externalApplyResModal.parent().hasClass('remodal-wrapper')) {
        $externalApplyResModal.remodal().destroy();
      }

      if (SettingControlValues.EnableOnlyUsedJSForJdpJrpPage == 'true') {
        setupPna();
        setupPartnerJobs();
      }
      init_applicant_check_clicks();

      if(!isScrolling && window.pageYOffset > 0) {
        isScrolling = !isScrolling;
        $(window).scrollTo(0, 350, {interrupt: true, always: function(){ isScrolling = !isScrolling }});
      }
      if($('.jrp-infinity-scroll').length > 0) {
        if ($('#jrp-data').length > 0) {
          if($('.campaign-enabled').length > 0) {
            document.getElementById('col-fixed').addEventListener('scroll', function() {
              if (($('.collapse-company-jobs-section:visible').length > 0 && $('#load-more-jobs-collapse').length > 0) || ($('.jrp-jobs-search-result-section:visible').length > 0 && $('#load-more-jobs').length> 0)) {
                if ($('.collapse-company-jobs-section:visible').length > 0) {
                  infiniteScroll('col-fixed', 'load-more-jobs-collapse');
                } else {
                  infiniteScroll('col-fixed', 'load-more-jobs');
                }
              }
            })
          } else {
            if ($('.collapse-company-jobs-section:visible').length > 0) {
              document.getElementById('fix-elem-scroll-company').addEventListener('scroll', function() {
                if (($('.collapse-company-jobs-section:visible').length > 0 && $('#load-more-jobs-collapse').length > 0) || ($('.jrp-jobs-search-result-section:visible').length > 0 && $('#load-more-jobs').length> 0)) {
                  infiniteScroll('fix-elem-scroll-company', 'load-more-jobs-collapse');
                }
            });
            } else {
              document.getElementById('fix-elem-scroll').addEventListener('scroll', function() {
                if (($('.collapse-company-jobs-section:visible').length > 0 && $('#load-more-jobs-collapse').length > 0) || ($('.jrp-jobs-search-result-section:visible').length > 0 && $('#load-more-jobs').length> 0)) {
                  infiniteScroll('fix-elem-scroll', 'load-more-jobs');
                }
            })
            }
          }
        }
      }
    }).on('ajax:error', '.job-listing-item', function (event, xhr, status, data) {
      console.log('JDP error');
    });

    if ($('#jrp-data').length && !$('#jdp-seo').length && isDesktop()) {
      setRemoteLinks();
      $('.job-listing-item').first().trigger('click');
      onLoadClicked = true;
      setListenerForFeedJobs();
    }
  };

  var onLoadMoreJobs = function () {
    $(document).on('ajax:success', '#load-more-jobs, #load-more-jobs-collapse', function (event) {
      setRemoteLinks();
      partnerJobsLabel();
    });
  };


  var keepOriginalParams =  function(jPrams) {
    var allParams = new URLSearchParams(jPrams);
    if(allParams.has('company_name')) {
    allParams.set('company_name', '');
    }
    if(allParams.has('keywords')) {
    allParams.set('keywords', '');
    }
    return allParams.toString();
  }

  var showLoadingAnimation = function () {
    $('#jdp-data').removeClass('jdp-active');
    $('#jdp-empty').addClass('jdp-active');
    $('.loading').addClass('loading-active');
    $('#jrp-empty').show();
    $('#jdp-seo').hide();
    $('#jrp-data').hide();
  };

  const removeDefaultFilterValueFromURLForTN = function (filters) {
    const TNFilterDefaultValueOptions = ['all', '', undefined, null];
      Object.entries(filters).map(entry => {
        let key = entry[0];
        let value = entry[1];
        const shouldRemoveThisFilterFromURL = TNFilterDefaultValueOptions.indexOf(value) > -1;
        if(shouldRemoveThisFilterFromURL) {
          delete filters[key]
        }
      });
  }

  var saveSearchHistory = function () {
    const isTN = SettingControlValues.HostSite === 'RM'; //TNv3
    var filters = getSelectedFilters();
    if (filters['pay'] == '0') {
      filters['pay'] = null
    }
    if (filters['job_group'] == 'all') {
      filters['job_group'] = null
    }
    if (filters['emp'] == 'all') {
      filters['emp'] = null
    }
    if (filters['empcat'] == 'all') {
      filters['empcat'] = null
    }
    if (filters['company'] == 'any') {
      filters['company'] = null
    }
    if (filters['cityStateFacet'] == 'all') {
      filters['cityStateFacet'] = null
    }
    if (isTN) {
      removeDefaultFilterValueFromURLForTN(filters);
    }
    
    if (window.location.pathname == '/pages') {
      urlParams = new URLSearchParams(window.location.search);
      var uri = '/pages?page=' + urlParams.get('page') + '&' + $.param(filters);
    } else {
      var uri = window.location.pathname + '?' + $.param(filters);
    }
    window.history.pushState(filters, null, uri);
    if(isTN && TNResetFilterClicked) {
      TNResetFilterClicked = false;
    }
    getSelectedFilters();
  };

  var refreshUrlForCFChallenge = function(data){
    var ret = {redirect: false, uri: ''}
    try{
      if(SettingControlValues.HostSite.toUpperCase() == 'RM'){
        return ret;
      }
      var page_number = parseInt(data['page_number']);
      if( page_number == 5 ){
        ret['redirect'] = true;
        ret['uri'] = window.location.pathname + '?' + $.param(data);
      }
    }catch(e){
    }
    return ret;
  }

  var jobSearchSuccess = function (data, textStatus, jqXHR) {
    // Remove existing job alert modal since it will be added from the incoming data
    $('[data-remodal-id=job_alert_modal]').remove();
    $('#jrpjdp').replaceWith(data);
    onAjaxTabSelection();
    resizeElements();
    saveSearchHistory();
    bindSearchLanguageTypes();
    $('[data-remodal-id=job_alert_modal]').remodal();
    lazyLoad();
    lazyLoadFixedElement();
    if ($('.celebrating-site-takeover-banner').length > 0) {
      carouselInit('.slide-all-page', false);
    }
    bindRemoteOnsiteTypes();
    filterPositionTN();
  };

  var jobSearchError = function (jqXHR, textStatus, errorThrown) {
    console.log('JRP error!', jqXHR, textStatus, errorThrown);
  };

  var convertParamsToObj =  function(jPrams) {
    jPrams = decodeURIComponent(jPrams);
    var sortParams = JSON.parse( '{"' + sanitizeStr(jPrams) + '"}', function(key, value) { return key===""?value:decodeURIComponent(value) })
    return sortParams;
  }

  var sanitizeStr =  function(jPrams) {
    return jPrams.replace(/(&quot;|&apos;)/g, "").replace(/[+]/g, " ").replace(/&/g, '","').replace(/=/g,'":"')
  }

  var jobSearchCall = function (event) {
    if (event && event.type == 'change') {
      jrpSortingData = undefined;
    }

    showLoadingAnimation();
    $.ajax({
      url: js_jobs_word + '.js',
      type: 'GET',
      dataType: 'html',
      data: getSelectedFilters(),
      success: jobSearchSuccess,
      error: jobSearchError
    });
  };

  var collapseJobsJrpMoreCall = function (data) {
    $.ajax({
      url: '/jobs.js',
      type: 'GET',
      data: data,
      success: function() {
        setRemoteLinks();
        resizeElements();
        lazyLoad();
        lazyLoadFixedElement();
        if (isDesktop()) {
          setListenerForFeedJobs();
        }
        if($('.jrp-infinity-scroll').length > 0) {
          if ($('.collapse-company-jobs-section:visible').length > 0 && $('#load-more-jobs-collapse').length > 0) {
            nextURL('#load-more-jobs-collapse');
            prevURL('#load-more-jobs-collapse');
          }
        }
      },
      error: jobSearchError
    });
  };

  if($('.jrp-infinity-scroll').length > 0) {
    var infiniteScrollSettings = function (scrollEle, calculateScroll) {
      if ($('.jrp-jobs-search-result-section:visible').length > 0) {
        var loadMoreParams = $('#load-more-jobs').attr('data-load-more').split('?')[1];
      } else {
        var loadMoreParams = $('#load-more-jobs-collapse').attr('data-load-more').split('?')[1];
      }
      if ((typeof js_company !== 'undefined' && js_company != '' && decodeURIComponent(js_company).includes('&')) || (typeof js_keyword !== 'undefined' && js_keyword != '' && decodeURIComponent(js_keyword).includes('&')))  {
        var loadMoreParams = keepOriginalParams(loadMoreParams)
      }
      var loadData = convertParamsToObj(decodeURIComponent(loadMoreParams).replace(/['"]+/g, ''));
      if (typeof js_company !== 'undefined' && js_company != '' && decodeURIComponent(js_company).includes('&')) {
        loadData['company_name'] = decodeURIComponent(js_company.replace(/&amp;/g, '&'))
      } else {
        if (typeof js_keyword_params !== 'undefined' && js_keyword_params != '' && decodeURIComponent(js_keyword_params).includes('&')) {
          loadData['keywords'] = decodeURIComponent(js_keyword_params).replace(/&amp;/g, '&');
        }
      }
      loadMoreJobsCall(loadData, scrollEle, calculateScroll);
    }

    var infiniteScroll = (targetedEle, loaderBtn) => {
      searchWrapperH = $('.searches-wrapper').innerHeight();
      footerHeight = $('.footer').innerHeight();
      jrpDesc = $('.jrp-desc').innerHeight();
      scrollEle = document.getElementsByTagName('body')[0];
      if(isMobile.any) {
        colScrollT = $(window).scrollTop();
        colEleH = $(window).height();
        colScrollH = $(document).height()
        calculateScroll = colScrollT + colEleH + searchWrapperH + footerHeight + jrpDesc;
      } else {
        scrollEle = document.getElementById(targetedEle);
        colEleH = scrollEle.clientHeight;
        colScrollH = scrollEle.scrollHeight;
        colScrollT = scrollEle.scrollTop;
        calculateScroll = colScrollT + colEleH + searchWrapperH;
      }
      rounOfcalculateScroll = Math.trunc(calculateScroll);
      if ((rounOfcalculateScroll+1) >= colScrollH && !($('#' +loaderBtn).hasClass('disabled'))) {
        if ($('#' +loaderBtn + " .svg-icon").length < 1) {
          infiniteScrollSettings(scrollEle, calculateScroll);
          $('#' +loaderBtn).html(`<span class="svg-icon">${I18n.t('js.spin_icon')}</span>`);
        }
      }
    }

    var loadMoreJobsCall = function (data, scrollEle, calculateScroll) {
      var refreshUrlForCFChallengeData = refreshUrlForCFChallenge(data);
      if( refreshUrlForCFChallengeData.redirect == true ){
        window.location.href = refreshUrlForCFChallengeData.uri;
        return;
      }
      $.ajax({
        url: js_jobs_word + '.js',
        type: 'GET',
        data: data,
        success: function() {
          $('#load-more-jobs, #load-more-jobs-collapse').find('.svg-icon').remove();
          setRemoteLinks();
          if (isDesktop()) {
            setListenerForFeedJobs();
          }
          if($('.jrp-infinity-scroll').length > 0) {
            if ($('.collapse-company-jobs-section:visible').length > 0 && $('#load-more-jobs-collapse').length > 0) {
              nextURL('#load-more-jobs-collapse');
              prevURL('#load-more-jobs-collapse');
            } else if($('.jrp-jobs-search-result-section:visible').length > 0 && $('#load-more-jobs').length > 0) {
              nextURL('#load-more-jobs');
              prevURL('#load-more-jobs');
            }
          }
        },
        error: jobSearchError
      });
    };

    var nextURL = function(currentBtn) {
      var metaNext = document.querySelector('meta[rel="next"]')
      if ($(currentBtn).length > 0) {
        var loadMore = $(currentBtn).attr('data-load-more');
        var nextPage = loadMore.split('page_number=')[1];
        var fullURL = loadMore.split('page_number=')[0];
        fullURL += `page_number=${nextPage}`;
        metaNext.setAttribute('href', fullURL);
      } 
    }

    var prevURL = function(currentBtn) {
      if ($(currentBtn).length > 0) {
        var metaPrev = document.querySelector('meta[rel="prev"]')
        var loadMore = $(currentBtn).attr('data-load-more');
        var fullURL = loadMore.split('page_number=')[0];
        var prevPage = loadMore.split('page_number=')[1];
        prevPage =  Number(loadMore.split('page_number=')[1]);
        prevPage = prevPage - 2
        fullURL += `page_number=${prevPage}`;
        metaPrev.setAttribute('href', fullURL);
      }
    }

  } else {

    $(document).on('click', '#load-more-jobs button, #load-more-jobs-collapse button', function(e){
      $(this).html(I18n.t('js.spin_icon'));
      var loadMoreParams = $(this).attr('data-load-more').split('?')[1];
      if ((typeof js_company !== 'undefined' && js_company != '' && decodeURIComponent(js_company).includes('&')) || (typeof js_keyword !== 'undefined' && js_keyword != '' && decodeURIComponent(js_keyword).includes('&')))  {
        var loadMoreParams = keepOriginalParams(loadMoreParams)
      }
      var loadData = convertParamsToObj(decodeURIComponent(loadMoreParams).replace(/['"]+/g, ''));
      if (typeof js_company !== 'undefined' && js_company != '' && decodeURIComponent(js_company).includes('&')) {
        loadData['company_name'] = decodeURIComponent(js_company.replace(/&amp;/g, '&'))
      } else {
        if (typeof js_keyword_params !== 'undefined' && js_keyword_params != '' && decodeURIComponent(js_keyword_params).includes('&')) {
          loadData['keywords'] = decodeURIComponent(js_keyword_params).replace(/&amp;/g, '&');
        }
      }
      loadMoreJobsCall(loadData);
    });

    var loadMoreJobsCall = function (data) {
      var refreshUrlForCFChallengeData = refreshUrlForCFChallenge(data);
      if( refreshUrlForCFChallengeData.redirect == true ){
        window.location.href = refreshUrlForCFChallengeData.uri;
        return;
      }
      $.ajax({
        url: js_jobs_word + '.js',
        type: 'GET',
        data: data,
        success: function() {
          $('#load-more-jobs button, #load-more-jobs-collapse button').html($('#load-more-jobs button, #load-more-jobs-collapse button').attr('aria-label'));
          setRemoteLinks();
          if (isDesktop()) {
            setListenerForFeedJobs();
          }
        },
        error: jobSearchError
      });
    };
  }

  var partnerJobsLabel = function() {
    if($(document).find('.partner-label').length == 0) {
      var partnerContainer = $(document).find('.data-results-content-parent.partner-job')[0];
      $('<li class="pt10 pb10 partner-label">' + I18n.t("js.partner_jobs_label") + '</li>').insertBefore(partnerContainer);
    }
  }

  var changeRemoteOnsiteFilterTitle = function() {
    if ($('.remote-onsite-types input:checked').length > 0 && !$('.remote-onsite-types input.default-opt').is(':checked')) {
      var title = $('.remote-onsite-types input:checked').first().next('label').html();
      if ($('.remote-onsite-types input:checked').length > 1) {
        if (isMobile.any) {
          if ($('#remote-onsite-filter-button').find('.filter-number').length > 0) {
            $('#remote-onsite-filter-button').find('.filter-number').html(`${$('.remote-onsite-types input:checked').length} ${I18n.t('js.selected')}`);
          } else {
            $('#remote-onsite-filter-button').append(`<span class="filter-number">${$('.remote-onsite-types input:checked').length} ${I18n.t('js.selected')}</span>`);
            $('.remote-onsite-types').parents('.filter').addClass('redesign-filter-selected');
          }
        } else {
          $(".remote-onsite-types input:checked").each(function() {
            var currentValue = $(this).val();
            var upperCase = currentValue.charAt(0).toUpperCase() + currentValue.slice(1);
            if (title != upperCase) {
              title += ',' + upperCase;
            }
          });
          $('#remote-onsite-filter-button').html(title);
        }
      } else if (isFilterRedesign() && isMobile.any && !(title == undefined)) {
        $('#remote-onsite-filter-button').html(I18n.t('js.onsite_remote')).append(`<span class="filter-number">${title}</span>`);
      } else {
        $('#remote-onsite-filter-button').html(title);
      }
    }
  }

  var setLastSearchedLocation = function() {
    try{
        urlParams = new URLSearchParams(window.location.search);
        if(urlParams.get('location') != null && urlParams.get('location').toLowerCase != I18n.t('js.work_from_home_remote').toLowerCase()) {
          Cookies.set('last_searched_location', urlParams.get('location'));
        }
    }catch(e){}
  }

  function isFilterRedesign() {
    return $('.jrp-filter-redesign').length > 0;
  }
  if($('.jrp-infinity-scroll').length > 0) {
    if(isMobile.any) {
      $(window).on("scroll", function() {
        if (($('.collapse-company-jobs-section:visible').length > 0 && $('#load-more-jobs-collapse').length > 0) || ($('.jrp-jobs-search-result-section:visible').length > 0 && $('#load-more-jobs').length> 0)) {
          if ($('.collapse-company-jobs-section:visible').length > 0) {
            infiniteScroll('body', 'load-more-jobs-collapse');
          } else {
            infiniteScroll('body', 'load-more-jobs');
          }
        }
      });
    }
  }
}(jQuery));
(function() {
  $(function() {
    var fixedTop;
    if ($('#col-fixed').length) {
      fixedTop = $('.header').innerHeight() + $('#jobs-filters').innerHeight();
      if ($('#tn-custom-header').length && $('#jobs-filters').length) {
        $('#col-fixed').css('position', 'sticky');
      }
      if ($('.campaign-enabled').length) {
        if ($('.sweepstakes-jdp-campaign').length) {
          $('#col-fixed .fix-elem-parent').height($(window).innerHeight() - fixedTop - $('#jobs-found').innerHeight() - 20);
        } else {
          $('#col-fixed').height($(window).innerHeight() - fixedTop - 20);
        }
      } else {
        $('#col-fixed .fix-elem-parent').height($(window).innerHeight() - fixedTop - $('#jobs-found').innerHeight() - 20);
      }
      $('#col-fixed').width($('.data .col.small').width());
      $(window).resize(function() {
        return $('#col-fixed').width($('.data .col.small').width());
      });
      return $(window).scroll(function() {
        var bottom, temph, topIndent;
        bottom = ($('.site-container').innerHeight() - $(window).innerHeight() - $('footer').innerHeight() - 30) - $(window).scrollTop();
        if ($('#tn-custom-header').length) {
          bottom += $('footer').innerHeight();
        }
        temph = $('#tn-custom-pages-swimlanes').innerHeight();
        if (temph === 0) {
          temph = $('#tn-custom-header #tn-custom-pages-swimlanes').innerHeight();
        }
        topIndent = $('#jobs-filters').innerHeight() + temph - 10;
        if ($(window).scrollTop() >= topIndent && bottom >= 0) {
          $('#col-fixed').css({
            'top': fixedTop,
            'position': 'fixed'
          });
          if (!$('.header-tn').length && $('#tn-custom-header').length) {
            return $('#jobs-filters').css('top', 0);
          }
        } else if (bottom <= 0) {
          return $('#col-fixed').css({
            'position': 'absolute',
            'top': 'auto',
            'bottom': 30
          });
        } else {
          if ($('#tn-custom-pages-swimlanes').length) {
            if (!$('#tn-custom-header').length && $('#tn-custom-footer').length) {
              $('#col-fixed').css('position', 'fixed');
            } else {
              $('#col-fixed').css('position', 'sticky');
            }
          }
          return $('#col-fixed').css('top', 0).css('top', fixedTop);
        }
      });
    }
  });

}).call(this);
(function() {
  $(function() {
    var hoverFiltersDesktop, hoverFiltersMobile, touch;
    $(document).on('click hover touch', '#jobs-filters .filter-option, #jobs-filters .btn', function(e) {
      return e.stopPropagation();
    });
    hoverFiltersMobile = function() {
      return $(document).on('click touch', '#jobs-filters .filter button', function(e) {
        e.preventDefault();
        e.stopImmediatePropagation();
        if (touch) {
          if ($(this).parent().hasClass('active')) {
            $(this).parent().removeClass('active');
            return $(this).parent().find('.filter-title').attr('aria-expanded', false);
          } else {
            $('#jobs-filters .filter').removeClass('active');
            $('#jobs-filters .filter .filter-title').attr('aria-expanded', false);
            $(this).parent().toggleClass('active');
            return $(this).parent().find('.filter-title').attr('aria-expanded', true);
          }
        }
      });
    };
    hoverFiltersDesktop = function() {
      var leaveFilter;
      leaveFilter = null;
      $(document).on('mouseenter', '#jobs-filters .filter', function(e) {
        e.preventDefault();
        if (!touch) {
          clearTimeout(leaveFilter);
          $('#jobs-filters .filter').removeClass('active');
          $('#jobs-filters .filter .filter-title').attr('aria-expanded', false);
          $(this).toggleClass('active');
          return $(this).find('.filter-title').attr('aria-expanded', true);
        }
      });
      $(document).on('mouseenter', '#jobs-filters .show-job-count', function(e) {
        var jobCountList, leaveMenu;
        leaveMenu = null;
        jobCountList = $('#jobs-filters #job-count-list');
        e.preventDefault();
        if (!touch) {
          clearTimeout(leaveMenu);
          jobCountList.removeClass('block-i');
          jobCountList.toggleClass('block-i');
        }
        return $(this).mouseleave(function() {
          return leaveMenu = setTimeout(function() {
            return jobCountList.removeClass('block-i');
          }, 300);
        });
      });
      $(document).on('focus', '#jobs-filters .filter .btn.filter-title, .fake-filter .filter-option .slide-checkbox', function(e) {
        return $('#jobs-filters .filter').removeClass('active');
      });
      $(document).on('keypress', '#jobs-filters .filter', function(e) {
        if (e.keyCode === 13) {
          e.preventDefault();
          clearTimeout(leaveFilter);
          $('#jobs-filters .filter').removeClass('active');
          $('#jobs-filters .filter .filter-title').attr('aria-expanded', false);
          $(this).toggleClass('active');
          return $(this).find('.filter-title').attr('aria-expanded', true);
        }
      });
      return $(document).on('mouseleave', '#jobs-filters .filter', function(e) {
        e.preventDefault();
        e.stopPropagation();
        if (!touch) {
          return leaveFilter = setTimeout(function() {
            $('#jobs-filters .filter').removeClass('active');
            return $('#jobs-filters .filter .filter-title').attr('aria-expanded', false);
          }, 300);
        }
      });
    };
    if (!isMobile.any || $(window).width() >= 1029) {
      touch = false;
      hoverFiltersDesktop();
    } else {
      touch = true;
      hoverFiltersMobile();
    }
    return $(window).resize(function() {
      if (!isMobile.any || $(window).width() >= 1029) {
        touch = false;
        return hoverFiltersDesktop();
      } else {
        touch = true;
        return hoverFiltersMobile();
      }
    });
  });

}).call(this);
(function() {
  $(function() {
    return $(document).on('click', '.trigger-slide-checkbox', function(e) {
      e.preventDefault();
      return $(this).next('.slide-checkbox-content').find('.slide-checkbox').trigger('click');
    });
  });

}).call(this);
(function() {
  this.retrieveAd = function(adPlacement, adArea, vid, keywords, city, state, targetElement) {
    return $.ajax({
      type: "GET",
      url: "//www.careerbuilder.com/jobseeker/ajax/adsservice.aspx?AdPlacement=" + adPlacement + "&AdArea=" + adArea + "&VID=" + vid + "&kw=" + keywords + "&city=" + city + "&state=" + state,
      dataType: 'jsonp',
      success: function(data) {
        if (data) {
          $(targetElement).html(data);
          $(targetElement).show;
          return manageGoogleAdsSize();
        }
      }
    });
  };

  this.manageGoogleAdsSize = function(adEle) {
    var $innerAdIframe;
    if (adEle == null) {
      adEle = $(".hide-mobile#banner-ad div[id^=div-gpt-ad] iframe[id^=google_ads_iframe]");
    }
    if (SettingControlValues.UseCustomGoogleAdsSize === 'false') {
      if (adEle.length > 0 && (adEle.width() > 730 || adEle.height() > 95)) {
        adEle.css({
          'width': '728px',
          'height': '90px'
        });
        adEle.contents().find("img.img_ad").css({
          'width': '728px',
          'height': '90px'
        });
      }
      $innerAdIframe = adEle.contents().find('iframe');
      if ($innerAdIframe.length > 0 && ($innerAdIframe.width() > 730 || $innerAdIframe.height() > 95)) {
        $innerAdIframe.css({
          'width': '728px',
          'height': '90px'
        });
        return $innerAdIframe.contents().find("img.img_ad").css({
          'width': '728px',
          'height': '90px'
        });
      }
    }
  };

}).call(this);
/**
 * Owl Carousel v2.3.4
 * Copyright 2013-2018 David Deutsch
 * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
 */
!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&b<i+f?e=a:"right"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,"<",i)&&this.op(b,">",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?a("<div/>",{class:"owl-video-tn "+j,srcType:c}):a("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("<div/>",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('<div class="owl-video-frame" />').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,
animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('<button role="button">').addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);

$(document).ready(function() {
  initCarousel();
});
function initCarousel() {
  if($('.owl-carousel-cp-us').length){
    $(".owl-carousel-cp-us").owlCarousel({
      margin:20,
      stagePadding: 0,
      loop: false,
      nav: true,
      navText: ['<', '>'],
      responsive:{
        0:{
          items: 2
        },
        700:{
          items: 3
        },
        1000:{
          items: 4
        }
      }

    });
  }

  $('.quick-apply-link').on('click', function(event) {
    var $this = $(event.currentTarget);
    $('.quick-apply-link').on('ajax:beforeSend', function (event) {
      var $this = $(event.currentTarget);
      $this.html("<i class='fa fa-refresh fa-spin'></i>");
      $this.removeClass('link-cta');
      $this.addClass("disabled");
    }).on('ajax:success', function (event) {
      var $this = $(event.currentTarget);
      $this.parent().find('.success-quick-apply').show();
      $this.hide();
    });
  });
};
function getCoContent(){
  $("#company-overview").on('click', function(e) {
    companyOverview()
  })
}
function getCoContentArrowKey(){
  $(document).keyup(function(e) {
    if (e.keyCode == 39 || e.keyCode == 37) {
      if ($('#company-overview').prop('aria-selected', true)) {
        companyOverview()
      }
    }
  });
}

function companyOverview() {
  var cdpUrl = $("#company-overview").data("cdp")
  updateCoTabHref("#jdp_company")

  if(isDesktop()){
    getContentFromCdp(cdpUrl)
  } else {
    if($('.fixed-bottom').length > 0) {
      $('.fixed-bottom').addClass('dn-i')
    }
    redirectToCdp(cdpUrl)
  }
}

function updateCoTabHref(newUrl){
  $("#company-overview").attr("href", newUrl)
}

function getContentFromCdp(cdpUrl){
  if(isEmptyCdp()) {
    makeAsyncRequest(cdpUrl)
  } else {
    setTimeout(function(){
      updateCoTabHref(cdpUrl)
    })
  }
}

function makeAsyncRequest(cdpUrl){
  $.ajax({
    url: cdpUrl + '.js?co_overview=true',
    dataType: "html",
    success: function(data, textStatus, jqXHR) {
      handleResponse(data, cdpUrl)
    }
  })
}

function handleResponse(data, cdpUrl){
  $("#jdp_company .col-2").html(data)
  initCarousel()
  updateCoTabHref(cdpUrl)
}

function isEmptyCdp() {
  return $("#company").length == 0
}

function isDesktop(){
  return deviceType() == "d"
}

function redirectToCdp(cdpUrl){
  window.location = cdpUrl
}

$(document).on('keydown', '.data-display-header_info-apply#hide-fixed-top .btn', function(e) {
  if(e.shiftKey && e.keyCode == 9) { 
    if ($('.data-results-content-parent.active .job-listing-item').length) {
      e.preventDefault();
      $('.data-results-content-parent.active .job-listing-item').focus()
    }  
  }
});
var lazyImages = Array.prototype.slice.call(document.querySelectorAll("img.lazy"));
var active = false;

var isImgVisible = function (lazyImage) {
  return lazyImage.getBoundingClientRect().top <= (window.innerHeight) &&
    lazyImage.getBoundingClientRect().bottom >= 0 &&
    getComputedStyle(lazyImage).display !== "none" &&
    $(lazyImage).is(':visible')
};

var lazyLoad = function () {
  lazyImages = Array.prototype.slice.call(document.querySelectorAll("img.lazy"));
  if (!active) {
    active = true;

    setTimeout(function () {
      lazyImages.forEach(function (lazyImage) {
        if (isImgVisible(lazyImage)) {
          lazyImage.src = lazyImage.dataset.src;
          lazyImage.classList.remove("lazy");

          lazyImages = lazyImages.filter(function (image) {
            return image !== lazyImage;
          });

          if (lazyImages.length === 0) {
            window.removeEventListener("scroll", lazyLoad);
            window.removeEventListener("resize", lazyLoad);
            window.removeEventListener("orientationchange", lazyLoad);
            window.removeEventListener("DOMContentLoaded", lazyLoad);
          }
        }
      });

      active = false;
    }, 200);
  }
};

document.addEventListener("DOMContentLoaded", function (event) {
  lazyLoadFixedElement();
});

function lazyLoadFixedElement() {
  (function () {
    var activeEle = $('.campaign-enabled').length > 0 ? 'campaign-enabled' : 'fix-elem-parent';
    var divs = document.getElementsByClassName(activeEle);
    if (divs.length > 0) {
      for (var i = 0; i < divs.length; i++) {
        divs[i].addEventListener('scroll', lazyLoad, true);
      }
    }
  })();
}
window.addEventListener("scroll", lazyLoad);
window.addEventListener("resize", lazyLoad);
window.addEventListener("orientationchange", lazyLoad);
window.addEventListener("DOMContentLoaded", lazyLoad);
(function() {
  this.loadModal = function(targetModal, triggerElement) {
    var item, keywords, location, urlParams;
    item = (triggerElement.attr('aria-controls') || '').replace('-wrapper', '').replace(/-/g, '_').replace(/_modal$/, '');
    if (item === 'anonymous_job_alert') {
      return $(triggerElement).on('click', function(e) {
        var $keywordsEle;
        $keywordsEle = $(this).closest('form').find('input#Keywords');
        if ($keywordsEle.val() === void 0) {
          $keywordsEle = $('#job-search-form').find('input#Keywords');
        }
        if (($keywordsEle.val() !== void 0 && $keywordsEle.val() !== '') && triggerElement.is(':checked') || triggerElement.prop('type') === 'button') {
          $('#signup-job-alert-modal').remodal({
            closeOnOutsideClick: false,
            closeOnEscape: false
          }).open();
          updateKtext();
        } else {
          $(triggerElement).prop('checked', false);
          $keywordsEle.focus();
        }
        if ($('.trigger-mobile-form-collapse').length && !$('.trigger-mobile-form-collapse').hasClass('dn-i')) {
          return $('.trigger-mobile-form-collapse').trigger('click');
        }
      });
    } else if (!$(targetModal).length) {
      urlParams = new URLSearchParams(window.location.search);
      keywords = urlParams.get('keywords') === null ? $('#Keywords').val() : urlParams.get('keywords');
      location = urlParams.get('location') === null ? $('#Location').val() : urlParams.get('location');
      return $.get({
        url: '/modal/show',
        data: {
          item: item,
          posted: urlParams.get('posted'),
          radius: urlParams.get('radius'),
          cb_apply: urlParams.get('cb_apply'),
          keywords: keywords,
          location: location,
          pay: urlParams.get('pay'),
          emp: urlParams.get('emp'),
          job_group: urlParams.get('job_group'),
          cb_veterans: urlParams.get('cb_veterans'),
          companyfilter: urlParams.get('companyfilter'),
          cb_workhome: urlParams.get('cb_workhome')
        },
        success: function(html) {
          if (html) {
            return $(document.body).append(html);
          }
        }
      });
    } else {
      return $(targetModal).remodal().open();
    }
  };

  this.updateKtext = function() {
    var kWord, keywordLocationText, lWord;
    kWord = $('#job-search-form input[name=keywords]').val();
    lWord = $('#job-search-form input[name=location]').val();
    keywordLocationText = lWord ? kWord + ' in ' + lWord : kWord;
    return $('#signup-job-alert-modal .alert-title span').html(keywordLocationText);
  };

}).call(this);

$(function () {
  var job_alert_modal = '[data-remodal-id=job_alert_modal]';
  $(document).on('click', '#save_search', function (e) {
    loadModal(job_alert_modal, $(this));
  });

  $(document).on('click', '#save_search_seo', function (e) {
    loadModal(job_alert_modal, $(this));
  });

  $(document).on('opened', job_alert_modal, function () {
    modalFocusTrap(job_alert_modal);
  });

  if ($('#save_search').length) {
    loadModal(job_alert_modal, $('#save_search'));
  } else if ($('#save_search_seo').length) {
    loadModal(job_alert_modal, $('#save_search_seo'));
  }

  if ($('#jobs-alert-modal-id').length) {
    $(document).on('click', '#jobs-alert-modal-id', function () {
      if ($(this).prop('checked')) {
        loadModal(job_alert_modal, $(this));
      }
    })
    $(document).on('closing', job_alert_modal, function () {
      if (!$('.alert-confirmed').is(':visible') && !$('.thanks').is(':visible') && !$('.duplicate_alert').is(':visible'))
        $('#jobs-alert-modal-id').prop('checked', false)
    })
  }
});
var SettingControlValues = (function () {
  var hostSite = 'RM';
  var countryCode = 'US';
  var resumeMaxUploadFileSize = 1000;
  var resumeFileExtensions = '.docx, .doc, .rtf, .txt, .pdf';
  var androidAppStoreUrl = 'false';
  var iosAppStoreUrl = 'false';
  var employerTypeSetting = 'false';
  var enableGlobalDesign = 'true';
  var enableAjaxIpathUpdate = 'true';
  var RECAPTCHA_SITE_KEY_V3 = '6LcMC9UZAAAAAN29EstJi5rw1deP_ear54w5aCvJ';
  var enableVisitotTracking = 'true';
  var enableSigninGoogleOneTap = 'false';
  var enableValidateLocation = 'false';
  var useCustomGoogleAdsSize = 'false';
  var colabAutoCompleteCaroteneApiVersion = 'v3_1';
  var enableEmptyDefaultLocationForColab = 'false';
  var enableWorkFromHomeFilterV2 = 'true';
  var enableDefaultJobAppliedCount = 'false';
  var enableFastJdpUrlForJrp = 'false';
  var enableCompanySearchOnJrp = 'false';
  var enableOnlyUsedJSForJdpJrpPage = 'false';

  return {
    HostSite: hostSite,
    CountryCode: countryCode,
    ResumeMaxUploadFileSize: resumeMaxUploadFileSize,
    ResumeFileExtensions: resumeFileExtensions,
    AndroidAppStoreUrl: encodeURI(androidAppStoreUrl),
    IosAppStoreUrl: encodeURI(iosAppStoreUrl),
    EmployerTypeSetting: employerTypeSetting,
    EnableGlobalDesign: enableGlobalDesign,
    EnableAjaxIpathUpdate: enableAjaxIpathUpdate,
    RECAPTCHA_SITE_KEY_V3: RECAPTCHA_SITE_KEY_V3,
    EnableVisitorTracking: enableVisitotTracking,
    EnableSigninWithGoogleOneTap: enableSigninGoogleOneTap,
    EnableValidateEnteredLocation: enableValidateLocation,
    UseCustomGoogleAdsSize: useCustomGoogleAdsSize,
    ColabAutoCompleteCaroteneApiVersion: colabAutoCompleteCaroteneApiVersion,
    EnableEmptyDefaultLocationForColab: enableEmptyDefaultLocationForColab,
    EnableWorkFromHomeFilterV2: enableWorkFromHomeFilterV2,
    EnableDefaultJobAppliedCount: enableDefaultJobAppliedCount,
    EnableFastJdpUrlForJrp: enableFastJdpUrlForJrp,
    EnableCompanySearchOnJrp: enableCompanySearchOnJrp,
    EnableOnlyUsedJSForJdpJrpPage: enableOnlyUsedJSForJdpJrpPage
  }
}());

function applicant_check_now(jobdid, is_external, has_campaign, apply_callback) {
  if (is_external) {
    var current_url = new URL(window.location.href);
    var query = current_url.search;
    var external_url = "";
    if ((SettingControlValues.HostSite.toLowerCase()) == 'rm') {
      external_url = '/interstitial_waiter.html' + query;
    } else {
      external_url = '/interstitial_waiter.html'
    }
    window.ExternalApply = window.open(external_url, 'ExternalApply-' + jobdid);
    if (SettingControlValues.EnableVisitorTracking == 'true'){
      trackEventInterstitialIn(jobdid)
    }
  }

  if (SettingControlValues.EnableOnlyUsedJSForJdpJrpPage == 'true') {
    $(applicant_check_modal_target(jobdid)).remodal({'closeOnOutsideClick': false, 'closeOnEscape': false}).open();
  }

  if (!has_campaign) {
    apply_callback();
    return true;
  }

  var urlPrams = new URLSearchParams(window.location.search)
  var cacheParams = urlPrams.get('cachebypass') == 'true' ? true : false
  var params = { 'dids[]': jobdid, 'cachebypass': cacheParams, 'external': is_external };
  app_check = false;
  $.ajax({
    url: '/applicant/check',
    type: 'GET',
    async: !is_external,
    data: params,
    success: function(data) {
      job_data = data[jobdid.toUpperCase()];
      app_check = applicant_check_callback(job_data, jobdid);
    },
    error: function () {
      app_check = false
    }
  });
  if (app_check) {
    apply_callback();
  }
  return app_check;
}

function close_app_check_modal_and_disable_cta(jobdid, text) {
  $('.applicant-check-btn').addClass('btn-clear-blue disabled');
  $('.applicant-check-btn').text(text);
  $(applicant_check_modal_target(jobdid)).remodal().close();

  //HACK-START - JJ : yes this is ugly ugly hack due to the fact the Ajax is async and modal open too
  $('.remodal-overlay').hide();
  $('.applicant-check-modal').parent().hide();
  $('html').removeClass('remodal-is-locked');
  // HACK-END
}

function applicant_check_callback(data, jobdid) {
  if (data["is_external_apply"]) {
    if (data["out_of_geo_range"]) {
      dataLayer.push({ 'event': 'external_apply_invalid_geo' });
      window.ExternalApply.close();
      close_app_check_modal_and_disable_cta(jobdid, I18n.t('js.billable.out_geo'));
      return false;
    }
    else if (data["has_applied_recently"]) {
      dataLayer.push({ 'event': 'external_apply_duplicate' });
      window.ExternalApply.location.href = '/interstitial?jobdid=' + jobdid;
      window.location = "/recommended/" + jobdid + "?after_external_apply= true&duplicate_apply=true"
      return false;
    }
    else {
      return true;
    }
  }
  else {
    if (data["has_applied_recently"]) {
      dataLayer.push({ 'event': 'internal_apply_duplicate' });
      close_app_check_modal_and_disable_cta(jobdid, I18n.t('js.billable.duplicate', { date_applied: data["last_date_applied"] }));
      return false;
    }
    else if (data["out_of_geo_range"] || data["unacceptable_aqs"]) {
      dataLayer.push({ 'event': 'internal_apply_PIA_show_modal' });
      $(applicant_check_modal_target(jobdid)).find('#apply-check-continue-btn').attr('href', internal_apply_url_from_check(jobdid, data));
      $(applicant_check_modal_target(jobdid)).find('.applicant-check-loader').hide();
      $(applicant_check_modal_target(jobdid)).find('.applicant-check-review').show();
      window.dataLayer = window.dataLayer || [];
      window.dataLayer.push({
        'event': 'qualityCheckModal',
        'modalType':'qualityCheckPrompt',
        'modalAction':'display'
      });
      return false;
    }
    else {
      dataLayer.push({ 'event': 'internal_apply_PIA_success' });
      window.location = internal_apply_url_from_check(jobdid, data);
      return true;
    }
  }
}

function internal_apply_url_from_check(did, data) {
  return "/apply/" + did + "/submit?load_past_applicant_info=true&from_apply_check=true";
}

function init_applicant_check_clicks() {
  $('.applicant-check-pia-btn').on('click', function (e) {
    e.stopImmediatePropagation();
    jobdid = $(this).data('jobdid');
    ipath = $(this).data('ipath')
    trackEvent(jobdid, ipath)
    applicant_check_now(jobdid, false, true, function() {});
  });

  $('#apply-check-continue-btn').on('click', function () {
    dataLayer.push({ 'event': 'internal_apply_PIA_success' });
  });
}

function applicant_check_modal_target(jobdid) {
  return "#applicant_check_modal_" + jobdid;
}

$(document).on('click', '.close-one-click-apply-modal', function (){
  qualityCheckEvent('decline');
});

$(document).on('click', '#apply-check-continue-btn', function (){
  qualityCheckEvent('accept');
});

$(document).on('click', '.edit_resume_btn', function (){
  qualityCheckEvent('edit');
});


function qualityCheckEvent(event) {
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    'event': 'qualityCheckModal',
    'modalType':'qualityCheckPrompt',
    'modalAction': event
  });
}

$(document).ready(function(){
  init_applicant_check_clicks();
  $(document).on('closed', '.applicant-check-modal', function () {
    $(this).find('.applicant-check-loader').show();
    $(this).find('.applicant-check-review').hide();
    if(!$(this).data('external_job')) {
      dataLayer.push({ 'event': 'internal_apply_PIA_failure' });
    }
  });
});













