function    bookmark() {
    if (navigator.appName == 'Microsoft Internet Explorer') {
        window.external.AddFavorite(document.location.href, document.title);
    }
    else {
        window.sidebar.addPanel(document.title, document.location.href, '');
    }
}

$(document).ready(function() {
    var i = 0;
    $('#nav>li').each(function() {
        /*
        this.style.margin = 0;
        this.style.padding = 0;
        this.style.height = '25px';
        */

        var a = $(this).children('a');
        var text = a.text();

        a.text('');
        a.append(
            '<img src="/image/nav/' +
            i +
            '.png" alt="' +
            text +
            '" />'
        );

        i += 1;
    });

    $('#nav>li').hover(
        function() {
            var img = $(this).find('img');
            var src = img.attr('src').replace('/image/nav/', '/image/nav/on/');
            img.attr('src', src);

            var ul = $(this).find('ul');
            //ul.slideDown('fast');
            ul.fadeIn(200);
        },
        function() {
            var img = $(this).find('img');
            var src = img.attr('src').replace('/image/nav/on/', '/image/nav/');
            img.attr('src', src);

            var ul = $(this).find('ul');
            //ul.slideUp(300);
            ul.fadeOut(400);
        }
    );
    
    /* ouverture des liens externe dans une nouvelle fenetre */
    //FIXME: do not do this
    $('a.external').click(function() {
       window.open(this.href);
       return false;
    });

});
