var thebody = false;

function socialLinks() {
	var theurl = 'http://lixlpixel.org/mac-keyboard-shortcuts/';
	var thetitle = 'Apple+Macintosh+Keyboard+Shortcuts';
	var thedesc = 'Be+faster+and+more+productive+using+Keyboard+Shortcuts+in+Mac+OS+X.';
	var labels = 'mac,apple,keyboard+shortcuts,os+x';

	var bmarks = [];
	bmarks[0] = new Array('http://del.icio.us/post?url=' + theurl, 'Bookmark at del.icio.us', 'bookmark_del_icio_us.png');
	bmarks[1] = new Array('http://www.google.com/bookmarks/mark?op=add&hl=en&bkmk=' + theurl + '&annotation=&labels=' + labels + '&title=' + thetitle, 'Add to Google Bookmark', 'bookmark_google_bookmark.png');
	bmarks[2] = new Array('http://www.stumbleupon.com/submit?url=' + theurl + '&title=' + thetitle, 'Bookmark at StumbleUpon', 'bookmark_stumbleupon.png');
	bmarks[3] = new Array('http://ma.gnolia.com/bookmarklet/add?url=' + theurl + '&title=' + thetitle + '&description=' + thedesc + '&tags=' + labels, 'Add to ma.gnolia', 'bookmark_magnolia.png');

	var bu = document.createElement('ol');
	bu.id = 'b';
	for(i = 0; i < 4; i++)
	{
		var bs = document.createTextNode(bmarks[i][1]);
		var bp = document.createElement('span');
		var ba = document.createElement('a');
		ba.style.background = 'url(/img/' + bmarks[i][2] + ') no-repeat -1px -1px';
		ba.href = bmarks[i][0];
		ba.target = '_blank';
		ba.title = bmarks[i][1];
		var bl = document.createElement('li');
		bp.appendChild(bs);
		ba.appendChild(bp);
		bl.appendChild(ba);
		bu.appendChild(bl);
	}
	thebody.appendChild(bu);
}

function init() {
	thebody = document.getElementsByTagName('body')[0];
	socialLinks();
}

window.onload = function() {
	init();
}