$(document).ready(function() {
    //nav
    $navCurrent = $('#nav li.current');
    $navCurrent.next('li').find('a').css('background-image',$navCurrent.find('a').css('background-image'));

    //content-nav
    $cnav = $('#content-nav li');
    $cnav.hover(function(){
        $cnav.removeClass('current');
        $(this).addClass('current');
    }, function(){
        $cnav.removeClass('current');
    });

    //gallery thumb-list
    $('.thumb-list li.current a img').fadeTo(1, 0.4);

    $thumbList = $('.gallery .thumb-list li');
    gDisplay = $('.gallery .g-display');
    $thumb_img = $thumbList.find('a img');
    $thumb_img.bind('mouseover',function(){
        $this = $(this);
        if ($this.closest('li').hasClass('current')) return;
        $this.stop().fadeTo(100, 0.4);
    }).bind('mouseout', function() {
        $this = $(this);
        if ($this.closest('li').hasClass('current')) return;
        $this.stop().fadeTo(100, 1);
    });
    $thumbList.find('a img').click(function() {
        gDisplay.hide();
        gDisplay.filter('.'+this.className).show();
        $thumbList.removeClass('current').find('a img').fadeTo(1, 1.0);
        $(this).fadeTo(1, 0.4).closest('li').addClass('current');
        //return false;
    });
});