function encurtaUrl(url){
    
    $.ajax({
        dataType: 'json',
        url: root+"site/_misc/routines/routines.php",
        data: {
            action: 'getUrlCurta',
            url: url
        },
        success: function(data){

            if (data) {

                window.openPopup("http://twitter.com/share?text=Acesse%20o%20site&lang=pt&url="+data.url, 400, 300, "Twitter");

            }else{
                
                alert("Ocorreu um erro ao compartilhar o link, tente novamente!");
                
            }

        }

    });
    
}
