/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var positionWindow = 157;

//Função - Abrindo janela de contato de equipe, efetuando auto-rolagem da página
function abreJanelaContatoEquipe(){
    jQuery("#blockWindow").fadeIn(1000, function(){
        jQuery("html:not(:animated),body:not(:animated)").animate({scrollTop: positionWindow}, 500, function(){
            jQuery("#contatoEquipe").fadeIn(1000);
        });
    });
}

//Função - Fechando janela de contato de equipe
function fechaJanelaContatoEquipe(elemento){
    var elementClicked   = jQuery(elemento);
    var destination      = jQuery(elementClicked).offset().top;
    if(destination < 157){
        destination = 0;
    }
    jQuery("#contatoEquipe").fadeOut(1000, function(){
        jQuery("#blockWindow").fadeOut(1000, function (){
            jQuery("html:not(:animated),body:not(:animated)").animate({scrollTop: destination}, 500);
        });
    });
}


