/** 
*
* @package Simple Social Bookmarks
* @version $Id: bookmarks.js,v 0.2.2 2007/02/02 13:48:48 dcz Exp $
* @copyright (c) 2007 dcz - www.phpbb-seo.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/
function social_bookmarks() {
	// Config
	// Language vars
	var b_title = "Bookmark menu";
	var b_desc = "Bookmark the pages you prefer in your favorite social bookmarking service";
	var bookmarthis = "Bookmark this page to ";
	var suggested_tags = "<b>Some Suggested Tags :</b> plastering";
	var keyword_list = "plaster, plaster repair, plastering, plastering over artex";
	// Should be /phpBB/images/sb/
	var img_path = "/diy/plaster/bookmarks/images/sb/";
	// Style
	// Here you can chose to add some code arround the bookmark links table
	var header ="";
	var footer ="";
	// Let's go
	var l_title = "";
	var l_txt = "";
	var l_url = "";
	var l_img = "";
	var output = header + "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\" align=\"center\">\n<tr>\n\t<td colspan=\"20\" class=\"gensmall\" align=\"center\">" + b_title + "<br/>\n\t" + b_desc + "<br/>\n\t</td>\n</tr>\n<tr>\n\t";

	// Delicious
	l_txt = "Del.icio.us";
	l_title = bookmarthis + l_txt;
	l_url = "'http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "delicious.jpg";
	output = output +  build_link(l_title, l_txt, l_url,l_img);

	// Digg
	l_txt = "Digg";
	l_title = bookmarthis + l_txt;
	l_url = "'http://digg.com/submit?phase=2&url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "digg.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Technorati
	l_txt = "Technorati";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.technorati.com/faves?add='+escape(document.location)";
	l_img = img_path + "technorati.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Slashdot
	l_txt = "Slashdot";
	l_title = bookmarthis + l_txt;
	l_url = "'http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "slashdot.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Yahoo
	l_txt = "Yahoo";
	l_title = bookmarthis + l_txt;
	l_url = "'http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+encodeURIComponent(document.title)+'&u='+encodeURIComponent(window.location.href)+'&tag=" + keyword_list + "'";
	l_img = img_path + "yahoo.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Google
	l_txt = "Google";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.google.com/ig/add?feedurl='+encodeURIComponent(location.href)+'&Title='+encodeURIComponent(document.title)";
	l_img = img_path + "google.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Reddit
	l_txt = "Reddit";
	l_title = bookmarthis + l_txt;
	l_url = "'http://reddit.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "reddit.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Stumbleupon
	l_txt = "Stumble";
	l_title = bookmarthis + l_txt + " (need to download Stumbleupon Toolbar!)";
	l_url = "'http://www.stumbleupon.com/refer.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "stumbleupon.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Fark
	l_txt = "Fark";
	l_title = bookmarthis + l_txt;
	l_url = "'http://cgi.fark.com/cgi/fark/submit.pl?new_url='+encodeURIComponent(location.href)+'&new_comment='+encodeURIComponent(document.title)";
	l_img = img_path + "fark.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Furl
	l_txt = "Furl";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(document.location.href)+'&t='+encodeURIComponent(document.title)";
	l_img = img_path + "furl.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Newsvine
	l_txt = "Newsvine";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.newsvine.com/_tools/seed&save?u='+encodeURIComponent(location.href)+'&h='+encodeURIComponent(document.title)";
	l_img = img_path + "newsvine.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// BlinkList
	l_txt = "BlinkList";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url='+encodeURIComponent(location.href)+'&Title='+encodeURIComponent(document.title)";
	l_img = img_path + "blink.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Spurl
	l_txt = "Spurl";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.spurl.net/spurl.php?v=3&title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(document.location.href)+'&blocked='+encodeURIComponent(document.selection?document.selection.createRange().text:document.getSelection())";
	l_img = img_path + "spurl.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Simpy
	l_txt = "Simpy";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.simpy.com/simpy/LinkAdd.do?title='+encodeURIComponent(document.title)+'&href='+encodeURIComponent(location.href)";
	l_img = img_path + "simpy.jpg";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Scoopeo
	l_txt = "Scoopeo";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.scoopeo.com/scoop/new?newurl='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "scoopeo.gif";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Fuzz
	l_txt = "Fuzz";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.fuzz.fr/?nws_article?link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "fuzz.gif";
	output = output + build_link(l_title, l_txt, l_url,l_img);


	output = output + "\n\t</tr>\n\t<tr>\n\t<td colspan=\"20\" class=\"gensmall\" align=\"center\">" + suggested_tags + "</td>\n</tr>\n</table>" + footer;
	document.write(output);
}
function build_link(title, txt, url,img) {
	return "<td align=\"center\"><a href=\"javascript:void window.open(" + url + ")\" class=\"gensmall\" title=\"" + title + "\"><img src=\"" + img + "\" alt=\"" + title + "\" border=\"0\" height=\"18\" width=\"18\"><br/>\n\t" + txt + "</a></td>\n\t";
}


