﻿var squares = {};

$(document).ready(function() {

    $('#email').html($('#email').html().replace(/\|\|/g, "@"));

    $('.square').click(function() {
        var t = this;
        squares[$(t).attr("id")] = 1;
        $('.subtitle', t).fadeOut(200);

        $(t).animate({
            width: 250,
            height: 250
        }, 500, function() { if (squares[$(t).attr("id")] == 1) { showText(this); } });
    });
    $('.square').mouseover(function() {
        if ($(this).height() == 100) {
            $('.subtitle', this).fadeIn(500);
        }

    });
    $('.square').mouseleave(function(e) {
        var t = this;
        squares[$(t).attr("id")] = 0;
        $('.text', t).fadeOut(500, function() {
            $(t).animate({ width: 100, height: 100 }, 500, function() { $('.subtitle', this).fadeOut(500) })
        });
    });

    $('#imgWordCV, #imgPdfCV').mouseover(function() { $('#cvDesc').html($(this).attr("alt")) }).mouseout(function() { $('#cvDesc').html("") });

    $('#baseline').mouseenter(function() { $(this).stop().animate({ "height": "50px" }); showIcons(); }).mouseleave(function() { $(this).stop().animate({ "height": "10px" }) });


});

function showIcons() {

}

function hideText(elem, callback) {
    $('.text', elem).fadeOut(500);
    if (callback != undefined) {
        callback();
    }
}
function showText(elem, callback) {
    $('.text', elem).fadeIn(500);
    if (callback != undefined) {
        callback();
    }
}
