$(function()
{
    $('div.comboWrapp').hover(function()
    {
        $( this ).find( 'a' ).addClass('hover');
    }, function()
    {
        $( this ).find( 'a' ).removeClass('hover');
    });

    $('div.comboWrapp > a').click(function()
    {
        var width = $( this ).width() + 50;

        $( this ).next().toggleClass('hidden').width( width ).find( 'a' ).width( width - 10 );

        return false;
    });

    $('div.comboWrapp div.comboCat ul li a').click(function()
    {
        $( this ).parent().parent().find( 'li.hidden' ).removeClass( 'hidden' );
        $( this ).parent().addClass( 'hidden' );
        $( this ).parents( 'div.comboCat' ).toggleClass( 'hidden' ).prev().find('span').text( $( this ).text() );
    });
    
    $("body").click(function(e) {
         $('div.comboCat').addClass('hidden');
    });
});

$(document).ready(function() {
	$('div.tables').addClass('cat');
});
