/** 
*
* @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 = "Segnala presso:";
	var b_desc = "";
	var bookmarthis = "Bookmark this page to ";
	var suggested_tags = "";
	var keyword_list = "";
	// Should be /phpBB/images/sb/
	var img_path = "/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>" + b_title + "</b><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/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk='+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);

	// Wikio
	l_txt = "Wikio";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.wikio.it/vote?new_url='+encodeURIComponent(location.href)+'&new_comment='+encodeURIComponent(document.title)";
	l_img = img_path + "wikio.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// MySpace
	l_txt = "MySpace";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.myspace.com/Modules/PostTo/Pages/?u='+encodeURIComponent(document.location.href)+'&t='+encodeURIComponent(document.title)";
	l_img = img_path + "myspace.png";
	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);

	// Upnews
	l_txt = "Upnews";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.upnews.it/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "upnews.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Diggita
	l_txt = "Diggita";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.diggita.it/submit.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "diggita.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Bookmark.it
	l_txt = "Bookmark";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.bookmark.it/bookmark.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "bookmark.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Segnalo
	l_txt = "Segnalo";
	l_title = bookmarthis + l_txt;
	l_url = "'http://segnalo.com/post.html.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "segnalo.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// NotizieFlash
	l_txt = "NotizieFlash";
	l_title = bookmarthis + l_txt;
	l_url = "'http://notizieflash.com/submit.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "notizieflash.png";
	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";
}

