﻿function contentShare(siteName, contentUrl, contentTitle, contentDescription)
{
    contentUrl = encodeURIComponent(contentUrl);
    contentTitle = encodeURIComponent(contentTitle);
    contentDescription = encodeURIComponent(contentDescription);

    switch (siteName)
	{
        case "facebook":
            postPopUp('http://www.facebook.com/sharer.php?u=' + contentUrl + '&t=' + contentTitle, siteName, 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
            break;
        case "myspace":
            //http://www.myspace.com/Modules/PostTo/Pages/?t=%E2%80%9CPost%20to%20MySpace%E2%80%9D%20Button%20Released%20for%20Easier%20Sharing&c=MySpace%20is%20now%20providing%20an%20easier%20way%20for%20publishers%20to%20help%20users%20spread%20their%20content%20virally.&u=http%3A%2F%2Fwww.techcrunch.com%2F2008%2F02%2F13%2Fpost-to-myspace-button-released-for-easier-sharing%2F&l=1
            postPopUp('http://www.myspace.com/index.cfm?fuseaction=postto&u=' + contentUrl + '&t=' + contentTitle + '&c=' + contentDescription + '&l=1', siteName, 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
            break;
        case "igoogle":
            postPopUp('http://www.google.com', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
            break;
        case "msn":
            postPopUp('http://www.msn.com', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');
            break;
        case "bebo":
            //http://www.bebo.com/c/share/help
            postPopUp('http://www.bebo.com/c/share?Url=' + contentUrl + '&Title=' + contentDescription, siteName, 'toolbar=0,status=0,height=436,width=626,scrollbars=yes,resizable=yes');
            break;
        case "digg":
            //http://digg.com/tools/integrate
            postPopUp('http://digg.com/remote-submit?phase=2&url=' + contentUrl + '&title=' + contentTitle + '&bodytext=' + contentDescription + '&topic=design', siteName, 'toolbar=0,status=0,height=650,width=650,scrollbars=yes,resizable=yes');
            break;
        case "delicious":
            postPopUp('http://delicious.com/save?jump=close&v=4&noui&jump=close&url=' + contentUrl + '&title=' + contentTitle + '&notes=' + contentDescription, siteName, 'toolbar=0,status=0,height=475,width=660,scrollbars=yes,resizable=yes');
            break;
    }
}
function postPopUp(url, name, params) {
    var win = window.open(url, name, params);
}