var header_locked = true;
var header_start_deployed = false;
google.load("jquery", "1");
function initializeDocument() {
    $(document).ready(function() {
        if (header_start_deployed) {
            $('#header').css('height', '495px');
            $('#wordmark').hide();
            $('#treemark').css('top', '0px');
            $('#treemark').show();
            setTimeout(function() {
                $('#header').animate({
                    height: '123px'
                }, 'slow');
                $('#treemark').animate({
                    top: '-372px'
                }, 'slow', function() {
                    $(this).hide();
                    $('#wordmark').show();
                });
            }, 1000);
        }
        $('#header').hover(
            function() {
                header_locked = false;
                setTimeout(function() {
                    if (!header_locked) {
                        $('#wordmark').hide();
                        $('#treemark').show();
                        $('#header').animate({
                            height: '495px'
                        }, 'slow');
                        $('#treemark').animate({
                            top: '0px'
                        }, 'slow');
                    }
                }, 1000);
            },
            function () {
                header_locked = true;
                $('#header').animate({
                    height: '123px'
                }, 'slow');
                $('#treemark').animate({
                    top: '-372px'
                }, 'slow', function() {
                    $('#treemark').hide();
                    $('#wordmark').show();
                });
            }
        ); //#header.hover
        $('.nav_item').hover(
            function() {
                $(this).animate({
                    fontSize: '48px'
                }, 'fast');
            },
            function() {
                $(this).animate({
                    fontSize: '36px'
                }, 'fast');
            }
        ); //.menu_item.hover
        $('.item_summary_more').click(function() {
            if ($(this).text() == 'show more') {
                $(this).text('show less');
                $(this).parent().find('.item_summary_description').slideDown();
            } else {
                $(this).text('show more');
                $(this).parent().find('.item_summary_description').slideUp();
            }
        }); //.project_more.click
        $('.footer_edit').hover(
            function() {
                $(this).find('.button_reveal').fadeIn();
            },
            function() {
                $(this).find('.button_reveal').fadeOut();
            }
        ); //.footer_edit.hover
        $('.image_set').each(function (index, set) {
          $(this).find('.image_set_full').hide();
          $(this).css('height', $(this).height());
        });
        $('.image_set_thumb').click(function () {
          $(this).parent().find('.image_set_thumb').hide();
          $(this).parent().find('.image_set_full[img_number=' + $(this).attr('img_number') + ']').fadeIn();
        });
        $('.image_set_full').click(function () {
          $(this).hide();
          $(this).parent().find('.image_set_thumb').fadeIn();
        });
        $('.unity_preview').find('.unity_play').hide();
        $('.unity_preview').mouseenter(function () {
          $(this).find('.unity_play').fadeIn();
        });
        $('.unity_preview').mouseleave(function () {
          $(this).find('.unity_play').fadeOut();
        });
    }); //document.ready function
}
google.setOnLoadCallback(initializeDocument);
