$(function () {
    $('#homeText').before($('#homeAnimation'));
    $('#homeAnimationImg1').css('top','-500px').animate({
        top:'0px'
    },2000,function () {
        window.setTimeout(function () {
            $('#homeAnimation').each(function () {
                $('#homeAnimationImg1').animate({
                    opacity:0
                },2000);
                window.setTimeout(function () {
                    $('#homeAnimationImg2').height(1).css({
                        opacity:0,
                        top:'250px',
                        left:'205px'
                    }).animate({
                        top:'0px',
                        left:'0px',
                        height:'500px',
                        opacity:1
                    },2000,function () {
                        window.setTimeout(function () {
                            $('#homeAnimation').slideUp(2000, function () {
                                $('#homeText').after($('#homeAnimation'));
                                $('#homeAnimationImg1').show().css({
                                    top:0,
                                    left:0,
                                    opacity:1
                                });
                                $('#homeAnimationImg2').hide();
                                $('#homeAnimation').fadeIn(1000);
                            });
                        },4000);
                    });
                },1000);
            });
        },6000);
    });
})
