$(function() {
$("#search input").keyup(function() {
var srch = $(this).val().toLowerCase();
$('#toc li').each(function() {
var self = $(this);
if (self.find('a').text().toLowerCase().indexOf(srch) != -1) {
self.show();
} else {
self.hide();
}
});
$('#toc .container').show();
$('#toc ul').each(function() {
var self = $(this);
if (self.find('li:visible').length == 0) {
self.closest('.container').hide();
}
});
if ($('#toc .container:visible').length == 0) {
$("#notfound").show();
} else {
$("#notfound").hide();
}
});
$("#search input").val('').trigger('keyup');
$('.ui.embed').embed();
});