$(document).ready(function () {
    $('.reservation-week-table .list-group-item, .reservartion-day .list-group-item').on('mouseover', function (event) {
        $(this).find('.create-reservation-link').show();
    });
    $('.reservation-week-table .list-group-item, .reservartion-day .list-group-item').on('mouseout', function (event) {
        $(this).find('.create-reservation-link').hide();
    });
    $('.toggle').click(function (e) {
        e.preventDefault();
        if ($('.list-group-item').is('.hidden')) {
            $('.list-group > .hidden').addClass('showed');
            $('.list-group > .hidden').removeClass('hidden');
        }
        else {
            $('.list-group > .showed').addClass('hidden');
            $('.list-group > .showed').removeClass('showed');
        }
        var tx = $('.toggle').text();
        if (tx.includes('Show',0)) {
            tx = tx.replace('Show all', 'Hide early');                    
        }
        else {
            tx = tx.replace('Hide early', 'Show all');
        }
        $('.toggle').text(tx);
    });
});