/* Minification failed. Returning unminified contents.
(2,1): run-time error CSS1019: Unexpected token, found '('
(2,11): run-time error CSS1031: Expected selector, found '('
(2,11): run-time error CSS1025: Expected comma or open brace, found '('
(146,2): run-time error CSS1019: Unexpected token, found ')'
(147,1): run-time error CSS1019: Unexpected token, found '('
(147,26): run-time error CSS1031: Expected selector, found ')'
(147,26): run-time error CSS1025: Expected comma or open brace, found ')'
(151,1): run-time error CSS1019: Unexpected token, found '$'
(151,2): run-time error CSS1019: Unexpected token, found '('
(151,3): run-time error CSS1019: Unexpected token, found ''.nav''
(151,9): run-time error CSS1019: Unexpected token, found ')'
(151,11): run-time error CSS1030: Expected identifier, found 'stickyNavbar('
(151,11): run-time error CSS1019: Unexpected token, found 'stickyNavbar('
(151,24): run-time error CSS1019: Unexpected token, found '{'
(151,32): run-time error CSS1030: Expected identifier, found ' '
(151,33): run-time error CSS1031: Expected selector, found '$'
(151,33): run-time error CSS1025: Expected comma or open brace, found '$'
 */
;
(function ($, window, document) {

  'use strict';

  $.fn.stickyNavbar = function (prop) {

    var options = $.extend({
      header: '.header-not',
      activeClass: 'active',
      attachActiveClassTo: 'li',
      animationDuration: 500,
      easing: 'swing',
      disableOnMobile: false,
      mobileWidth: 640
    }, prop);

    var header = options.header ? $(options.header) : undefined
      , navBar = $(this);

    if (navBar.length == 0) {
      return;
    }

    if (options.disableOnMobile && $(window).width() <= options.mobileWidth) {
      return;
    }


    var stickyPosition = header ? header.outerHeight(true) : 0
      , heroHeight = navBar.offset().top - stickyPosition,
      navBarHeight = navBar.outerHeight(true);

    // collect all the sections for jumping
    ////var sections = new jQuery();
    ////navBar.find('li a').map(function () {
    ////  var id = $(this).attr('href');
    ////  sections = sections.add($(id));
    ////});

    // because we have header/banner so there is offset for sections
    //var sectionsOffset = stickyPosition + navBarHeight + 2;
    var sectionsOffset = stickyPosition + navBarHeight + 2
    // the active menu in navigator
    var activeOne;


    function initSecondaryNav() {
        navBar.before('<div class="nav-placeholder"></div>');
        $('.nav-placeholder').css('padding-bottom', navBarHeight + 'px');
        $('.nav-placeholder').css('padding-bottom', navBarHeight + 'px');
        $('.nav-placeholder').css('height', '0px');
        $('.nav-placeholder').css('z-index', '-9999');
       // $('.divLogo').css('height', '99px');
        $('.divSiteUrl').css('display', 'inline-block');
        //$('.nav li.active a').css('color', '#ffffff');
        //$('.nav li a').css('color', '#000000');
        navBar.css('margin-top', -navBarHeight + 'px');
        $('#navSingleP').removeClass('backMenuSinglePage').addClass('emptyStyle-SingleP');
      scrollCallback();
    }

    function addActiveState(sections) {

      //var windowScrollHeight = $(window).scrollTop();
      //sections.each(function (index) {
      //    var top = $(this).offset().top
      //      , bottom = $(this).outerHeight(true) + top;

      //    windowScrollHeight = $(window).scrollTop();

      //    if (
      //      (windowScrollHeight > top - sectionsOffset && windowScrollHeight < bottom - sectionsOffset)
      //      || (index == 0 && windowScrollHeight < top - sectionsOffset)
      //      || (index == sections.length - 1 && windowScrollHeight > bottom - sectionsOffset)
      //      ) {

      //      if (activeOne) {
      //        activeOne.removeClass(options.activeClass);
      //      }
      //      activeOne = options.attachActiveClassTo === 'a' ?
      //        navBar.find('li a[href~="#' + this.id + '"]')
      //        : navBar.find('li a[href~="#' + this.id + '"]').parents('li');
      //      activeOne.addClass(options.activeClass);
      //    }

      //  }
      //);

    }

    function positionNavBar() {
      if ($(window).scrollTop() >= 0) {
          $(window).scrollTop() < heroHeight
            ? navBar.css('margin-top', -navBarHeight - $(window).scrollTop() + 'px') 
            : navBar.css('margin-top', -navBarHeight - heroHeight + 'px');

        $(window).scrollTop() < heroHeight
       ? $('#navSingleP').removeClass('backMenuSinglePage').addClass('emptyStyle-SingleP') 
       : $('#navSingleP').addClass('backMenuSinglePage').removeClass('emptyStyle-SingleP');

        //$(window).scrollTop() < heroHeight
        //  ? $('.divLogo').css('height', '99px')
        //  : $('.divLogo').css('height', '100px');

        $(window).scrollTop() < heroHeight
       ? $('.divSiteUrl').css('display', 'inline-block')
       : $('.divSiteUrl').css('display', 'none');

      //  $(window).scrollTop() < heroHeight
     //? $('.nav li.active a').css('color', '#ffffff')
   // : $('.nav li.active a').css('color', '#fbaf17');
       }
     
    }

    function scrollCallback() {
      positionNavBar();
      // put this into next tick
      //setTimeout(function () {
      //  addActiveState(sections);
      //}, 1);
    }

    function smoothScroll(e) {
      e.preventDefault();
      if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
        var target = $(this.hash);
        target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
        if (target.length) {
          $('html, body').stop().animate({
            scrollTop: target.offset().top - stickyPosition - navBarHeight
          }, {
            duration: options.animationDuration,
            easing: options.easing
          });
        }
      }
    }


    initSecondaryNav();
    $(window).on('scroll', scrollCallback);
   /// $(this).find(' a[href*=#]:not([href=#])').on('click', smoothScroll);
  }
})
(jQuery, window, document);



$('.nav').stickyNavbar({banner: $('.banner')});
//$('.nav').stickyNavbar();
