$(function() {
    // The widgets below the square icon start hidden,
    // see style.css
    var shown = false,
	asides = $.makeArray(
			     $('#secondary aside')
			     ).concat($('#secondary aside.widget_nav_menu li.menu-item-home a'));
  
    $('#secondary li:first-child').click(function(e) {
	    var i = asides.length, $aside;
	    
	    // Allow normal links
	    if (e.target.tagName === 'A') return true;

	    // Otherwise, hide or show the rest of the widgets
	    while (i--) {
		$aside = $(asides[i]);
		if ( ! $aside.hasClass('widget_nav_menu')) {
		    if (shown) $aside.slideUp();
		    else $aside.slideDown();
		}
	    }

	    shown = ! shown;
	    return false;
    });
});
