
$(document).ready (function ()
{
    function menuOut (ev)
    {
        var menu = this;
        clearTimeout (menu.uidelay);
        menu.uidelay = setTimeout (function ()
        {
            $(menu).next().slideUp(1, function () {$(menu.parentNode).removeClass ('hover');});
        }, 200);
        return false;
    }

    function menuOver (ev)
    {
        var menu = this;
        clearTimeout (menu.uidelay);
        menu.uidelay = setTimeout (function ()
        {
            $(menu.parentNode).addClass ('hover');
            $(menu).next().slideDown(150);
        }, 200);
        return false;
    }

    $('ul.navigation li.main>a')
        .bind ('mouseover', menuOver)
        .bind ('mouseout',  menuOut)
        .next()
            .each (function () { $(this).css ({'width': ($(this).width()+10)+'px'}); })
            .slideUp(1)
            .bind ('mouseover', function (ev) { return menuOver.call ($(this).prev()[0], ev); })
            .bind ('mouseout',  function (ev) { return menuOut.call  ($(this).prev()[0], ev); });
});


