$(function () {
    $('body').height($(window).height());

    $('div#qr').mouseenter(function () {
        disolveQR(1);
    });

    $(window).resize(function () { $('body').height($(window).height()); });
});

function disolveQR(current) {
    $('#qr' + current).animate({ opacity: 0 }, 150, 'linear', function () { current < 7 ? disolveQR(current + 1) : moveSquares() }, { queue: false });
}

function moveSquares() {
    $('#qrsq3').animate({ bottom: 130 }, 400);
    $('#qrsq2').animate({ right: 130 }, 400, function () { $('#qrsq3').hide(); $('#qrsq2').hide(); squareEmail(); });
}

function squareEmail() {
    $('#qrsq1').animate({ height: 14, top: 2, right: 170 }, 300, function () { $('#qrsq1').fadeOut(); $('.email').fadeIn(function () { $('div#qr').animate({ height: 20 }, 300); }); });
}
