function show_gbox2 (t) { if ($(t).parent().parent().find('div').css('display') == 'none') { $('.gbox').fadeOut('fast'); $('.gbox h3').removeClass('active'); $(t).parent().addClass('active'); $(t).parent().parent().find('div').show(); } else { $('.gbox div').hide(); $(t).parent().removeClass('active'); } } function show_gbox (t) { $('.gbox').hide(); $('#gb' + t).fadeIn('slow'); }