﻿function generateShareOnSocialTags(shortTitle)
{
    var network = new Array()
    //network.push({ label: "newsvine" })
    network.push({ label: "delicious" })
    //network.push({ label: "digg"})
    network.push({ label: "facebook"})
    //network.push({ label: "reddit"})
    network.push({ label: "kirtsy" })

    var link = "<div>"
    for (var i = 0; i < network.length; i++) {
        var label = network[i].label
        if (label == "delicious") {
            network[i].url = "http://del.icio.us/post?title=" +
		    escape(shortTitle) + "&url=" +
		    window.location.href
        }
        else if (label == "digg") {
            network[i].url = "http://digg.com/submit?phase=2&title=" + escape(shortTitle) +
		    "&url=" + window.location.href
        }
        else if (label == "newsvine") {
            network[i].url = "http://www.newsvine.com/_tools/seed?popoff=0&u=" + window.location.href;
        }
        else if (label == "reddit") {
            network[i].url = 'http://reddit.com/submit?url=' +
		    encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(shortTitle);
        }
        else if (label == "facebook") {
            network[i].url = "http://www.facebook.com/sharer.php?u=" +
		    window.location.href + "&t=" + shortTitle + "&src=sc&pos=top&from_posted=1";
        }
        else if (label == "kirtsy") {
            network[i].url = "http://www.kirtsy.com/submit.php?url=" + window.location.href;
        }
        link += '<a href="' + network[i].url + '" target="_blank"><img src="../assets/images/icons/ss_' + label + '.gif" border="0"></a> '
    }
    link += "</div>"
    document.write(link)
}
