﻿var evokeSocialNetworks = {
    shareFacebook: function(url) {
        var shareUrl = window.location.href;
        if (url != undefined && url != null)
            shareUrl = url;
        window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(shareUrl), 'facebook', 'toolbar=0,status=0,width=626,height=436');
    },
    shareTwitter: function(msg) {
        var shareUrl = window.location.href;
        if (msg == undefined || msg == null)
            window.open("http://twitter.com/home?status=" + encodeURIComponent(shareUrl), "twitter");
        else
            window.open("http://twitter.com/home?status=" + encodeURIComponent(msg), "twitter");
    },
    shareDigg: function(url) {
        var shareUrl = window.location.href;
        if (url != undefined && url != null)
            shareUrl = url;
        window.open("http://digg.com/submit?url=" + encodeURIComponent(shareUrl) + "&title=" + encodeURIComponent(document.title) + "&topic=health&thumbnails=0", "digg");
    },
    shareMySpace: function(url, title, content, location) {
        var targetUrl = "http://www.myspace.com/index.cfm?fuseaction=postto";
        var shareUrl = window.location.href;
        if (url != undefined && url != null)
            shareUrl = url;
        targetUrl += ("&u=" + encodeURIComponent(shareUrl));
        if (title != undefined && title != null)
            targetUrl += ("&t=" + encodeURIComponent(title));
        if (content != undefined && content != null)
            targetUrl += ("&c=" + encodeURIComponent(content));
        if (location != undefined && location != null)
            targetUrl += ("&l=" + encodeURIComponent(location));
        window.open(targetUrl, "myspace");
    }
};