/**
*
* @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 questo topic su...";
	var b_desc = "Segnala questo topic sui tuoi Social Network preferiti";
	var bookmarthis = "Segnala su ";
	var suggested_tags = " ";
	var keyword_list = "Keywords";
	// Should be /forum/images/sb/
	var img_path = "/forum/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 width=\"40%\" class=\"gensmall\" align=\"center\"></td>\n\t<td width=\"60%\" colspan=\"20\" class=\"gensmall\" align=\"right\"><b>" + b_title + "</b>&nbsp;&nbsp;</td>\n\t";

	// Facebook
	l_txt = "Facebook";
	l_title = bookmarthis + l_txt;
	l_url = "'http://www.facebook.com/share.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)";
	l_img = img_path + "facebook.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(location.href)+'&t='+encodeURIComponent(document.title)";
	l_img = img_path + "myspace.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Windows Live Spaces
	l_txt = "Live Spaces";
	l_title = bookmarthis + l_txt;
	l_url = "'https://favorites.live.com/quickadd.aspx?marklet=0&mkt=it-it&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "windowslive.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// OkNO
	l_txt = "OkNO";
	l_title = bookmarthis + l_txt;
	l_url = "'http://oknotizie.virgilio.it/post.html.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "okno.gif";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Delicious
	l_txt = "Del.icio.us";
	l_title = bookmarthis + l_txt;
	l_url = "'http://del.icio.us/post?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "delicious.png";
	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.it/bookmarks/mark?op=edit&output=popup&bkmk='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
	l_img = img_path + "google.png";
	output = output + build_link(l_title, l_txt, l_url,l_img);

	// Yahoo!
	l_txt = "Yahoo!";
	l_title = bookmarthis + l_txt;
	l_url = "'http://it.bookmarks.yahoo.com/toolbar/savebm?opener=tb&u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)";
	l_img = img_path + "yahoo.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.virgilio.it/post.html.php?uri='+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);

	output = output + "\n\t</tr>\n\t</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=\"16\" width=\"16\"><br/>\n\t" + txt + "</a></td>\n\t";
}

