if (!document.getElementsByClassName) var getElementsByClassName = function(c, el) {
  if (!el) var el = document;
  var all = el.getElementsByTagName('*'), els = [];
  for (var i = 0, j = all.length; i < j; i++) {
    if (all[i].className === c) els.push(all[i]);
  }
  return els
}

function bookmark(m)
	{
	mURI = window.document.location;
	mTitle = window.document.title;

	enURI = encodeURIComponent(mURI);
	enTitle = encodeURIComponent(mTitle);

	switch(m)
		{
		case "Facebook":
			bookmarkWindow = window.open('http://www.facebook.com/sharer.php?u=' + enURI,'Share','height=500,width=600,resizable=yes,scrollbars=yes');
			if (window.focus) {bookmarkWindow.focus()}
			break;
		case "StumbleUpon":
			bookmarkWindow = window.open('http://www.stumbleupon.com/submit?url=' + enURI + '&title=' + enTitle,'Share','height=600,width=750,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes');
			if (window.focus) {bookmarkWindow.focus()}
			break;
		case "Digg":
			bookmarkWindow = window.open('http://digg.com/submit?phase=2&url=' + enURI + '&title=' + enTitle,'Share','height=600,width=750,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes');
			if (window.focus) {bookmarkWindow.focus()}
			break;
		case "Delicious":
			bookmarkWindow = window.open('http://del.icio.us/post?url=' + enURI + '&title=' + enTitle,'Share','height=600,width=750,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes');
			if (window.focus) {bookmarkWindow.focus()}
			break;
		case "Technorati":
			bookmarkWindow = window.open('http://technorati.com/faves?add=' + enURI,'Share','height=600,width=750,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes');
			if (window.focus) {bookmarkWindow.focus()}
			break;
		case "Reddit":
			bookmarkWindow = window.open('http://reddit.com/submit?url=' + enURI + '&title=' + enTitle,'Share','height=600,width=750,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes');
			if (window.focus) {bookmarkWindow.focus()}
			break;
		case "MySpace":
			bookmarkWindow = window.open('http://www.myspace.com/Modules/PostTo/Pages/?u=' + enURI + '&t=' + enTitle,'Share','height=600,width=750,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes');
			if (window.focus) {bookmarkWindow.focus()}
			break;
		default:
			alert('Nuttin');
		}
	}