$(function () {

    $('.slidebtn').click(function (e) {
        e.preventDefault();
        $(this).toggleClass('active');
        var visible = $(this).hasClass("active");
        var href = $(this).attr('href');
        $(href).slideToggle(250, function () {
            //this trick for IE 7, it keep the layout after slide toggling
            if (visible) {
                $(href).removeClass('_refreshed');
            }
        });
    });

    $('.togglebtn').click(function (e) {
        e.preventDefault();
        $(this).toggleClass('active');
        var href = $(this).attr('href');
        $(href).toggle();
    });

    $('#banner a').hover(function () {
        $('#banner a').not('.active').css({ 'background-position': 'left bottom' });
        $(this).css({ 'background-position': 'left top' }).addClass('active');
    }, function () {
        $('#banner a').css({ 'background-position': 'left top' });
        $('#banner a').removeClass('active');
    });

    $('#inschrijven-btn').click(function (e) {
        e.preventDefault();
        $('.form, .error-message').hide();
        $('#bedankt-inschrijving').show();
    });

    $('.share-btn').click(function (e) {
        e.preventDefault();
        $(this).toggleClass('active');
        $('ul#share').slideToggle(250);
    })
    /*
    ** tabs videos
    */
    $('#video-gallery .videos a').click(function (e) {
        e.preventDefault();
        var link = $(this).attr('href');
        $('#video-gallery .videos img').removeClass('active');
        $(this).find('img').addClass('active');
        $('#video-gallery .vid').removeClass('show');
        $(link).addClass('show').show();
    });
    /*
    ** tabs presentaties
    */
    $('.presentaties-wrap a').click(function (e) {
        e.preventDefault();
        var link = $(this).attr('href');
        $('.presentaties-wrap img').removeClass('active');
        $(this).closest('div').find('img').addClass('active');
        $('#presentatie .pre').removeClass('show');
        $(link).addClass('show').show();
    });

});
