﻿function tsf_openFacebookShare(rawURL, title) {
    var encodedURI = rawURL;
    var encodeTitle = encodeURI(title);
    window.open('http://www.facebook.com/sharer.php?u=' + encodedURI + "&t=" + encodeTitle, '_blank', 'status=no, menubar=no, scrollbars=no, resizable=no, directories=no, location=no, copyhistory=no');
}

function tsf_openDiggShare(rawURL, title) {
    var encodeTitle = encodeURIComponent(title);
    var encodedURI = encodeURIComponent(rawURL);
    window.open('http://digg.com/submit?phase=2&url=' + encodedURI + "&Title=" + encodeTitle, '_blank', 'width=800, height=900, scrollbars=yes, status=no, menubar=no, resizable=no, directories=no, location=no, copyhistory=no');
}

function tsf_openMySpaceShare(rawURL, title) {
    var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(title) + '&u=' + encodeURI(rawURL);
    window.open(targetUrl,
            '_blank', 'width=800, height=900, scrollbars=yes, status=no, menubar=no, resizable=no, directories=no, location=no, copyhistory=no');
}

function toggle_visibility(id) {
    var e = document.getElementById(id);
    if (e.style.display == 'block')
        e.style.display = 'none';
    else
        e.style.display = 'block';
}