﻿/* Funções gerais */

$(window).load(function () {

    var delay = 0;

    //Exibe os itens em sequência
    $('.item-trabalho').each(function () {
        $(this).delay(delay).fadeIn();
        delay += 150;
    });

    //Mostra as infos de cada item
    $('.item-trabalho').hover(
        function (event) { event.preventDefault(true, true); $(this).children('.info').stop().slideDown(); },
        function (event) { event.preventDefault(true, true); $(this).children('.info').stop().slideUp(function () { $(this).attr('style', 'asd') }); }
    );

});

//Exibe a aba de contato
function showForm($obj){
    
    var ov_height = 0;
    if ($('body').outerHeight(true) < screen.height) {
        ov_height = screen.height;
    } else {
        ov_height = $('body').outerHeight(true);    
    }
    $('body').prepend('<div class="shadow" style="height:' + ov_height + 'px; display:none;"></div>');    
    $('body .shadow').fadeIn();
    $obj.animate({right:'0'},'slow');
    
    $('body .shadow').click(function(){
        $(this).fadeOut(function(){$(this).remove();});
        
        $obj.animate({right:'-500px'},'slow');  
    });
    
}

