/* =====================================
Name: Navigation slide menu
Author: Ward Peeters - Coding-tech.com
Contact: warrepeeters@gmail.com

===================================== */
$(function() {
	$('#categorie table tbody').hide();
	$('#categorie table tbody tr:not(.head)').hide();
	
	$('#categorie table thead').click(function() {
		$(this).parent().find('tbody').slideToggle();
	});
	$('#categorie .head').click(function() {
		var el = $(this).next('tr');
		while(!$(el).hasClass('head') && $(el).html() != null) {
			if(!$(el).hasClass('head')) {
				$(el).toggle();
			}
			el = $(el).next('tr'); 
		}

		if(!$(this).next().hasClass('head') && $(this).next().html() != null) return false;
	});

	$('.active').parent().parent().parent().find('tbody').show();
	$('.vactive,.hactive').trigger('click');
});
