var jsLibUrl = "/includes/javascript/lib/pbs/social_bookmarks";
function insertSocialBookmarkLinks(pageUrl,title,whichOnes) {
if( !pageUrl )
pageUrl = location.href;
if( !title )
title = document.title;
if(!whichOnes)
whichOnes = ["delicious","digg","technorati","reddit","stumbleupon"];
var info;
var output = "";
for( var i=0; i < whichOnes.length; i++ ) {
info = null;
switch( whichOnes[i] ) {
case "delicious":
info = getDeliciousInfo(pageUrl,title);
break;
case "digg":
info = getDiggInfo(pageUrl,title);
break;
case "technorati":
info = getTechnoratiInfo(pageUrl,title);
break;
case "reddit":
info = getRedditInfo(pageUrl,title);
break;
case "stumbleupon":
info = getStumbleUponInfo(pageUrl,title);
break;
case "slashdot":
info = getSlashdotInfo(pageUrl,title);
break;
case "facebook":
info = getFacebookInfo(pageUrl,title);
}
if( info ) {
output += getListItem(info);
}
}
document.write("
");
}
function getListItem(info) {
var output = "" + info.text + "";
return output;
}
function getDeliciousInfo(pageUrl,title) {
var info = new Object();
info.handle = "delicious";
info.text = "del.icio.us";
info.href = "http://del.icio.us/post?v=4&noui&jump=close&url="+encodeURIComponent(pageUrl)+"&title="+encodeURIComponent(title);
info.onclick = "window.open(this.href,'"+info.handle+"','toolbar=no,width=700,height=400');return false;";
info.alt = "del.icio.us";
return info;
}
function getDiggInfo(pageUrl,title) {
var info = new Object();
info.handle = "digg";
info.text = "Digg";
info.href = "http://digg.com/submit?phase=2&url="+encodeURIComponent(pageUrl)+"&title="+encodeURIComponent(title)+"&topic=television";
info.onclick = "";
info.alt = "Digg!";
return info;
}
function getTechnoratiInfo(pageUrl,title) {
var info = new Object();
info.handle = "technorati";
info.text = "Technorati";
info.href = "http://technorati.com/faves/?add="+encodeURIComponent(pageUrl);
info.onclick = "";
info.alt = "Technorati";
return info;
}
function getRedditInfo(pageUrl,title) {
var info = new Object();
info.handle = "reddit";
info.text = "reddit";
info.href = "http://reddit.com/submit?url="+encodeURIComponent(pageUrl);
info.onclick = "";
info.alt = "Reddit";
return info;
}
function getStumbleUponInfo(pageUrl,title) {
var info = new Object();
info.handle = "stumbleupon";
info.text = "StumbleUpon";
info.href = "http://www.stumbleupon.com/submit?url="+encodeURIComponent(pageUrl)+"&title="+encodeURIComponent(title);
info.onclick = "";
info.alt = "StumbleUpon";
return info;
}
function getSlashdotInfo(pageUrl,title) {
var info = new Object();
info.handle = "slashdot";
info.text = "Slashdot";
info.href = "http://slashdot.org/bookmark.pl?url="+encodeURIComponent(pageUrl)+"&title="+encodeURIComponent(title);
info.onclick = "";
info.alt = "Slashdot It!";
return info;
}
function getFacebookInfo(pageUrl,title) {
var info = new Object();
info.handle = "facebook";
info.text = "Facebook";
info.href = "http://www.facebook.com/share.php?u="+encodeURIComponent(pageUrl)+"&t="+encodeURIComponent(title);
info.onclick = "";
info.alt = "Share on Facebook";
return info;
}