$(document).ready(function() {
    $('#nav>li.hover>ul.snav').hover(
        function() {
            var id = $(this).attr('id').replace('snav_', '');
            $(this).prev().children('img:first').attr('src', '/image/nav/bt' + id + '_on.gif');
        },
        function() {
            var id = $(this).attr('id').replace('snav_', '');
            $(this).prev().children('img:first').attr('src', '/image/nav/bt' + id + '.gif');
    });
});

/*
function    nav_show(id, nav) {
    nav_hide_all();
   
    var el;
    if (! (el = $(id)))
        return;

    el.addClassName('hover');
    el.show();
}

function    nav_hide_all() {
	$$('ul.hover').each(function(el) {
        el.hide();
    });
}

Event.observe(window, 'load', function() {
	$$('#nav li.nav:not(li.active)').each(function(el) {
        el.observe('mouseover', function() {  
            nav_show(el.identify().sub('nav', 'snav'), el);
        });
    });

	$$('ul.snav').each(function(el) {
        el.observe('mouseout', nav_mouseout);
    });
});

function    nav_mouseout(event) {
    var el = Event.element(event);

    var snav;
    if (! (snav = el.up('ul')))
        return;

    var t_offset = snav.cumulativeOffset();
    var t_size   = snav.getDimensions();

    var x = Event.pointerX(event);
    var y = Event.pointerY(event);

    //alert(t_offset + ' - ' + t_size.width + ',' + t_size.height + ' - ' + x + ',' + y);

    if (x >= t_offset.left && x < t_offset.left + t_size.width &&
        y >= t_offset.top && y < t_offset.top + t_size.height - 4)
        return;

    nav_hide_all();
}
*/
