function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
		}
	}
}

function shareFb() {
	if (!document.getElementById || !document.getElementById("lnk-fb")) return false;
	u=location.href;
	t=document.title;
	var lnkFb = document.getElementById("lnk-fb");
	lnkFb.onclick = function() {
		window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}
}
function shareDel() {
	if (!document.getElementById || !document.getElementById("lnk-del")) return false;
	var lnkDel = document.getElementById("lnk-del");
	lnkDel.onclick = function() {
		window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550');
		return false;
	}
}

addLoadEvent(shareFb);
addLoadEvent(shareDel);
