$(document).ready(function () {
    $(".abuse").click(function () {
        var link = $(this).attr("href");
        window.open(link, 'Abuse', 'toolbar=no,width=400,height=400,scrollbars=1');
        return false;
    });

    $(".dela a").click(function () {
        var link = $(this).attr("href");

        var is_link_twitter = link.indexOf("twitter");
        if (is_link_twitter == -1) {
            /* Det är inte Twitter */
            var link = link.replace("getTitle", encodeURIComponent(document.title));
            var link = link.replace("getUrl", encodeURIComponent(location.href));
            var p_width = 550;
        }
        else {
            /* Det är Twitter */
            var link = link.replace("getTitle", document.title);
            var link = link.replace("getUrl", location.href);
            var p_width = 790;
        }

        window.open(link, 'dela', 'toolbar=no,width=' + p_width + ',height=550,scrollbars=1');
        return false;
    });

});
