function open_popup(url, title, width, height) {
    if (typeof(width) == 'undefined')
        var width = 700;
    if (typeof(height) == 'undefined')
        var height = 400;
    var top = (screen.height/2) - (height/2);
    var left = (screen.width/2) - (width/2);
    window.open(url, title, 'toolbar=no,top='+top+',left='+left+',width='+width+',height='+height+',scrollbar=yes,resizable=yes');
}

function share_twitter(url, title) {
    url = title + ' - http://coisadecachorro.com.br' + url;
    open_popup('http://twitter.com/?status=' + escape(url), 'Compartilhe pelo Twitter', 800, 400);
    return false;
}

function share_facebook(url) {
    url = 'http://coisadecachorro.com.br' + url;
    open_popup('http://www.facebook.com/sharer.php?u=' + escape(url), 'Compartilhe pelo Facebook');
    return false;
}

function share_email(url, title) {
    url = 'http://coisadecachorro.com.br' + url;
    open_popup('/compartilhar/?url=' + escape(url) + '&title=' + escape(title), 'Compartilhe por email', 560, 400);
    return false;
}

