jQuery(function($) {
    var tablemain = $('.navmenu-red');
    tablemain.find("div.sub").bgiframe();
    $('td', tablemain).hover(function() {
        var $td = $(this);
        var $sub = $('>div.sub', this);
        var level = parseInt($(this).attr("level"));
        if (level && level > 0) {
            $sub.css({
                left: $td.width() + "px"
            });
        }
        $sub.show();
        $td.addClass("hover").children(".item").addClass("item-hover");
    }, function() {
        $('>div.sub', this).hide();
        $(this).removeClass("hover").children(".item").removeClass("item-hover"); ;

    });
});