$(document).ready(function () {
    BannerMargin();
    closeSearch();
    filterException();
    hideFilter();
    closeNav();
});

function BannerMargin() {
    var headerHeight = $('header').outerHeight();
    $('.header-height').css('margin-top', headerHeight);
}

// function playVideo() {
//     $('.event-video .play-btn, .event-video+.card-body').hide();
//     $('.event-video .video-view-wrp').show();
// }
function openSearch(){
    $('.search').show();
}
function closeSearch() {
    $('.search').click(function (e) { 
        $('.search').hide();
    });
    menuCloseException();
}

function menuCloseException(){
	$("html").click(function(event){
        $('.search').hide();
	});
	$(".search-box, .search-icon, .btn-search").click(function(event){
		event.stopPropagation();
	});
}

function filterException(){
	$("html").click(function(event){
        $('.filter-options .tab-content .tab-pane').removeClass('active show');
        $('.filter-options .nav-link').removeClass('active');
	});
	$(".filter-options, .filter-options .tab-content").click(function(event){
		event.stopPropagation();
	});
}

function hideFilter(params) {
    $('.filter-options .nav-link').click(function (e) {
        // if ($('.filter-options .nav-link').hasClass('active')) {
        //     $(this).removeClass('active');
        // }
        
    });
}

function closeNav() {
    $("html").click(function(event){
        $('.navbar-collapse.collapse').removeClass('show');
	});
	$(".navbar-collapse").click(function(event){
		event.stopPropagation();
	});
}