var u=location.href;
var t=document.title;

var encodedURL = encodeURIComponent(u);
var encodedTitle = encodeURIComponent(t);

//FACEBOOK - supplied by them
function fbs_click()
{
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}

//Digg
function digg_click()
{
    var desc = getDescription();
    window.open('http://digg.com/submit?url=' + encodedURL + '&title=' + encodedTitle + '&bodytext=' + desc + '&media=news&topic=health','digg_share');
    return false;
}

//delicious
function delicious_click()
{
    window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodedURL+'&amp;title='+encodedTitle, 'delicious','toolbar=no,width=550,height=550'); 
    return false;
}

//reddit
function reddit_click()
{
    window.open('http://www.reddit.com/submit?url='+encodedURL, 'reddit');
    return false;
}

//stumbleupon 
function stumbleupon_click()
{
    window.open('http://www.stumbleupon.com/submit?url='+encodedURL + '&title=' + encodedTitle, 'stumbleupon');
    return false;
}

//myspace
function myspace_click()
{
    var desc = getDescription();
    window.open('http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodedTitle + '&c=' + desc + '&u=' + encodedURL + '&l=' + 5, 'myspace');
    return false;
}

//playahead
function playahead_click()
{
    var desc = getDescription();
    window.open('http://www.playahead.se', 'playahead');
    return false;
}

//lunarstorm
function lunarstorm_click()
{
    var desc = getDescription();
    window.open('http://www.lunarstorm.se', 'lunarstorm');
    return false;
}





//COMMON FUNCTIONS
function getDescription()
{
    var metatags;
    if (document.getElementsByTagName)
    {
        metatags = document.getElementsByTagName('meta')[0];
        for(var meta in metatags)
        {
            if (meta.name=='description')
            {
                return meta.content;
            }
        }
    }
    return "";
}
