var bookmark_img="/jsbookmarker/img";

var bookmark_db={
	news2:          "http://news2.ru/add_story.php?url=[U]",
	bobrdobr:       "http://bobrdobr.ru/addext.html?url=[U]&title=[T]",
	linkstore:      "http://www.linkstore.ru/servlet/LinkStore?a=add&url=[U]&title=[T]",
	rumarkz:        "http://rumarkz.ru/bookmarks/?action=add&popup=1&address=[U]&title=[T]",
	memori:         "http://memori.ru/link/?sm=1&u_data[url]=[U]&u_data[name]=[T]",
	moemesto:       "http://moemesto.ru/post.php?url=[U]&title=[T]",
	technorati:     "http://www.technorati.com/faves?add=[U]",
	smi2:           "http://smi2.ru/add/",
	
	digg:           "http://digg.com/submit?phase=2&url=[U]&title=[T]",
	google:         "http://www.google.com/bookmarks/mark?op=edit&bkmk=[U]&title=[T]",
	yahoo:          "http://myweb2.search.yahoo.com/myresults/bookmarklet?u=[U]&t=[T]",
	netscape:       "http://www.netscape.com/submit/?U=[U]&T=[T]",
	looklater:      "http://api.looklater.com/bookmarks/save?url=[U]&title=[T]",
	blinkbits:      "http://blinkbits.com/bookmarklets/save.php?v=1&source_url=[U]&title=[T]",
	blogmarks:      "http://blogmarks.net/my/new.php?mini=1&simple=1&url=[U]&title=[T]",
	buddymarks:     "http://buddymarks.com/add_bookmark.php?bookmark_title=[T]&bookmark_url=[U]",
	delicious:      "http://del.icio.us/post?v=2&url=[U]&title=[T]",
	feedmelinks:    "http://feedmelinks.com/categorize?from=toolbar&op=submit&name=[T]&url=[U]&version=0.7",
	kinja:          "http://kinja.com/id.knj?url=[U]",
	lilisto:        "http://lister.lilisto.com/?t=[T]&l=[U]",
	gnolia:         "http://ma.gnolia.com/bookmarklet/add?url=[U]&title=[T]",
	mesfavs:        "http://mesfavs.com/bookmarks.php/?action=add&address=[U]&title=[T]",
	netvouz:        "http://netvouz.com/action/submitBookmark?url=[U]&title=[T]&popup=no",
	reddit:         "http://reddit.com/submit?url=[U]&title=[T]",
	scuttle:        "http://scuttle.org/bookmarks.php/?action=add&address=[U]&title=[T]",
	segnalo:        "http://segnalo.com/post.html.php?url=[U]&title=[T]",
	simpy:          "http://simpy.com/simpy/LinkAdd.do?title=[T]&href=[U]&v=6&src=bookmarklet",
	slashdot:       "http://slashdot.org/bookmark.pl?url=[U]&title=[T]",
	sphinn:         "http://sphinn.com/submit.php?url=[U]",
	zurpy:          "http://tag.zurpy.com/?box=1&url=[U]&title=[T]",
	tailrank:       "http://tailrank.com/share/?title=[T]&link_href=[U]",
	unalog:         "http://unalog.com/my/stack/link?url=[U]&title=[T]",
	backflip:       "http://www.backflip.com/add_page_pop.ihtml?url=[U]&title=[T]",
	blinklist:      "http://www.blinklist.com/index.php?Action=Blink/addblink.php&Title=[T]&Url=[U]",
	blogmemes:      "http://www.blogmemes.net/post.php?url=[U]&title=[T]",
	citeulike:      "http://www.citeulike.org/posturl?url=[U]&title=[T]",
	diigo:          "http://www.diigo.com/post?url=[U]&title=[T]",
	dzone:          "http://www.dzone.com/links/add.html?url=[U]&title=[T]",
	feedmarker:     "http://www.feedmarker.com/admin.php?do=bookmarklet_mark&url=[U]&title=[T]",
	furl:           "http://www.furl.net/storeIt.jsp?t=[T]&u=[U]",
	givealink:      "http://www.givealink.org/cgi-pub/bookmarklet/bookmarkletLogin.cgi?&uri=[U]&title=[T]",
	gravee:         "http://www.gravee.com/account/bookmarkpop?u=[U]&t=[T]",
	hyperlinkomatic:"http://www.hyperlinkomatic.com/lm2/add.html?LinkTitle=[T]&LinkUrl=[U]",
	igooi:          "http://www.igooi.com/addnewitem.aspx?self=1&noui=yes&jump=close&url=[U]&title=[T]",
	linkagogo:      "http://www.linkagogo.com/go/AddNoPopup?title=[T]&url=[U]",
	linkroll:       "http://www.linkroll.com/index.php?action=insertLink&url=[U]&title=[T]",
	maple:          "http://www.maple.nu/bookmarks/bookmarklet?bookmark[url]=[U]&bookmark[name]=[T]",
	misterwong:     "http://www.mister-wong.com/index.php?action=addurl&bm_url=[U]&bm_description=[T]",
	newsvine:       "http://www.newsvine.com/_wine/save?u=[U]&h=[T]",
	plugim:         "http://www.plugim.com/submit?url=[U]&title=[T]",
	rawsugar:       "http://www.rawsugar.com/tagger/?turl=[U]&tttl=[T]&editorInitialized=1",
	rojo:           "http://www.rojo.com/add-subscription/?resource=[U]",
	shadows:        "http://www.shadows.com/shadows.aspx?url=[U]",
	spurl:          "http://www.spurl.net/spurl.php?v=3&title=[T]&url=[U]",
	squidoo:        "http://www.squidoo.com/lensmaster/bookmark?[U]",
	stumbleupon:    "http://www.stumbleupon.com/submit?url=[U]&title=[T]",
	tagtooga:       "http://www.tagtooga.com/tapp/db.exe?c=jsEntryForm&b=fx&title=[T]&url=[U]",
	wink:           "http://www.wink.com/_/tag?url=[U]&doctitle=[T]"
}

function bookmark_draw(name,href,title)
{
	var i,data='';

	if(typeof(name)=="object")
	{
		for(i in name)
			data+=bookmark_draw_elem(name[i],href,title);
		document.write(data);
		return;
	}
	switch(name)
	{
	default:
	case ':top':
		bookmark_draw(Array('digg','google','yahoo','netscape','delicious','furl','news2','bobrdobr','memori','moemesto'),href,title);
		break;
	case '':
	case ':all':
		for(i in bookmark_db)
			data+=bookmark_draw_elem(i,href,title)
		break;
	case ':rus':
		bookmark_draw(Array('news2','bobrdobr','rumarkz','memori','moemesto','technorati','smi2'),href,title);
		break;
	}
	document.write(data);
}

function bookmark_draw_elem(name,url,title)
{
	if(!bookmark_db[name])
		return '';
	var host,href=bookmark_db[name];
	href=href.replace(/\[U\]/, encodeURIComponent(url?url:document.location.href));
	href=href.replace(/\[T\]/,encodeURIComponent(title?title:document.title));
	host=href.substring(7);
	host=host.substring(0,host.indexOf('/'));
	return "<a target='_blank' href='"+href+"' title='Bookmark on  "+host+"' ><img alt='' border='0' src='"+bookmark_img+"/"+name+".gif' hspace='1'></a>";
}

