var transitionEffect = false;

function show(id, caption){
    if (transitionEffect) {
        $('#image_effects').fadeOut('slow', function(){
            $('#image').html($('#'+id).html());
            $('#caption').html(caption);
            $('#image_effects').fadeIn('slow');
        });
    } else {
        $('#image').html($('#'+id).html());
        $('#caption').html(caption);
    }
}

function show(id, caption, data) {
    var img = $('<img/>').attr({src:data});
    if (transitionEffect) {
        $('#image_effects').fadeOut('slow', function(){
            $('#image').html(img);
            $('#caption').html(caption);
            $('#image_effects').fadeIn('slow');
        });
    } else {
        $('#image').html(img);
        $('#caption').html(caption);
    }
}

$(document).ready(function(){
    var hash = window.location.hash;
    if (hash) {
        hash = hash.substring(1);
        $('#'+hash+'-lnk').click();
    } else {
        $('.browse_image a').first().click();
    }
    transitionEffect = true;
    $(".chrom").hover(
        function () {
            $('.gallery').hide();
            $('.gallery').html('CHROMATIC ENERGY');
            $('.gallery').fadeIn();
        },
        function () {
            $('.gallery').hide();
        }
        );
    $(".Holoc").hover(
        function () {
            $('.gallery').hide();
            $('.gallery').html('THE HOLOCAUST SUITE');
            $('.gallery').fadeIn();
        },
        function () {
            $('.gallery').hide();
        }
        );
    $(".works").hover(
        function () {
            $('.gallery').hide();
            $('.gallery').html('OTHER WORKS');
            $('.gallery').fadeIn();
        },
        function () {
            $('.gallery').hide();
        }
        );
    $(".donat").hover(
        function () {
            $('.gallery').hide();
            $('.gallery').html('DONATIONS');
            $('.gallery').fadeIn();
        },
        function () {
            $('.gallery').hide();
        }
        );
    $(".print").hover(
        function () {
            $('.gallery').hide();
            $('.gallery').html('PRINTS');
            $('.gallery').fadeIn();
        },
        function () {
            $('.gallery').hide();
        }
        );
    $(".now").hover(
        function () {
            $('.gallery').hide();
            $('.gallery').html('NOW');
            $('.gallery').fadeIn();
        },
        function () {
            $('.gallery').hide();
        }
        );
});
