$(document).ready(function(){
    $('[data-toggle="tooltip"]').tooltip();
});
$(function () {
    $('a[href="#search"]').on('click', function(event) {
        event.preventDefault();
        $('#search').addClass('open');
        $('#search > form > input[type="text"]').focus();
    });
    
    $('#search, #search button.searchclose').on('click keyup', function(event) {
        if (event.target == this || event.target.className == 'searchclose' || event.keyCode == 27) {
            $(this).removeClass('open');
        }
    });
});
jQuery(document).ready(function(){
	$(".scroll-to-top").click(function()	{
		$("html, body").animate({ scrollTop: 0 }, 600);
		 return false;
	});
});
$('.popover-nav').each(function() {
  var $this = $(this);
  $this.popover({
    trigger: 'hover',
    placement: 'bottom',
    html: true,
    content: $this.find('.pop-nav').html()  
  });
});