﻿var hidden = true;
function showShare(sender,e)
{
    if (hidden)
        sender.findName("share_show").Begin();
    else
        sender.findName("share_hide").Begin();
    hidden = !hidden;
}

function getMediaInfo()
{
    if(currentMediaInfo != null && currentMediaInfo != "")
        return currentMediaInfo;
    else
        return "0";
}

function getLink()
{
    var link = "http://www.microsoft.com/australia/services/microsoftservices/sdc_openday.mspx?videoID=" + getMediaInfo();
    return link;
}

function openLink(url)
{
    window.open(url);
}

function showEmail(sender,e)
{
    var link = getLink();
    var subject = "Successful software delivery in practice	from the Australian SDC";
    var body = link;
    openLink("mailto:?subject=" + escape(subject) + "&body=" + escape(body));
}

function showFacebook(sender,e)
{
    var location = getLink();
    openLink("http://www.facebook.com/share.php?u=" + escape(location));
}

function showLive(sender,e)
{
    var location = getLink();
    var description = "Successful software delivery in practice	from the Australian SDC";
    openLink("http://spaces.live.com/BlogIt.aspx?Title=" + escape(document.title) + "&SourceURL=" + escape(location) + "&description=" + escape(description));
}

function showDigg(sender,e)
{
    var location = getLink();
    openLink('http://digg.com/submit?phase=2&url=' + escape(location) + '&title=' + escape(document.title));
}

function showMyspace(sender,e)
{
    var location = getLink();
    openLink("http://www.myspace.com/Modules/PostTo/Pages/?u=" + escape(location) + "&t=" + escape(document.title));
}

function showDelicious(sender,e)
{
    var location = getLink();
    openLink("http://del.icio.us/post?url=" + escape(location) + "&title=" + escape(document.title));
}

