function myspaceShare() {
	var i, description, tags, targetUrl;
	tags = document.getElementsByTagName('meta');
	if (tags) {
		for (i = 0; i < tags.length; i = i + 1) {
			if (tags[i].getAttribute('name') === 'description') {
				description = tags[i].getAttribute('content');
			}
		}
	} else {
		description = document.title;
	}
	targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' +
		't=' + encodeURIComponent(document.title) +
		'&c=' + encodeURIComponent(description.substring(0, 340)) +
		'&u=' + encodeURIComponent(document.location.href) +
		'&r=' + encodeURIComponent(document.location.href);
	window.open(targetUrl);
}

function twitterShare() {
	window.open('http://twitter.com?status=' + encodeURIComponent(document.title + ' - ' + document.location));
}

function facebookShare(url, title, imageurl, summary) {
	var f = 'http://www.facebook.com/sharer.php?s=100' +
		'&p[title]=' + encodeURIComponent(title) +
		'&p[url]=' + encodeURIComponent(url) +
		'&p[images][0]=' + encodeURIComponent(imageurl) +
		'&p[summary]=' + encodeURIComponent(summary);
	var a = function() {
		if (!window.open(f, 'sharer', 'toolbar=0,status=0,resizable=1,width=626,height=436')) {
			document.location.href = f;
		}
	}
	if (/Firefox/.test(navigator.userAgent)) {
		setTimeout(a, 0);
	} else {
		a();
	}
}

