var akst_tracking = true;function akst_share(id, url, title, html_id, pubid) {
	var form = $('akst_form');
	var post_id = $('akst_post_id');
	
	if (form.style.display == 'block' && post_id.value == id) {
		form.style.display = 'none';
		return;
	}
	
	var link = $('akst_link_' + html_id);
	var offset = Position.cumulativeOffset(link);

	if (document.getElementById('akst_social')) {

		$("akst_delicious").href = akst_share_url("http://del.icio.us/post?url={url}&amp;title={title}", url, title, pubid);
		$("akst_digg").href = akst_share_url("http://digg.com/submit?phase=2&url={url}&title={title}", url, title, pubid);
		$("akst_wong").href = akst_share_url("http://www.mister-wong.de/index.php?action=addurl&bm_url={url}&bm_description={title}", url, title, pubid);
		$("akst_yigg").href = akst_share_url("http://www.yigg.de/neu?exturl={url}&exttitle={title}", url, title, pubid);
		$("akst_readster").href = akst_share_url("http://www.readster.de/submit/?url={url}&title={title}", url, title, pubid);
		$("akst_webnews").href = akst_share_url("http://www.webnews.de/einstellen?url={url}&title={title}", url, title, pubid);
		$("akst_linkarena").href = akst_share_url("http://www.linkarena.com/linkadd.php?url={url}&title={title}", url, title, pubid);
		$("akst_furl").href = akst_share_url("http://furl.net/storeIt.jsp?u={url}&amp;t={title}", url, title, pubid);
		$("akst_netscape").href = akst_share_url(" http://www.netscape.com/submit/?U={url}&amp;T={title}", url, title, pubid);
		$("akst_yahoo_myweb").href = akst_share_url("http://myweb2.search.yahoo.com/myresults/bookmarklet?u={url}&amp;t={title}", url, title, pubid);
		$("akst_technorati").href = akst_share_url("http://www.technorati.com/faves?add={url}", url, title, pubid);
		$("akst_google_bmarks").href = akst_share_url("  http://www.google.com/bookmarks/mark?op=edit&amp;bkmk={url}&amp;title={title}", url, title, pubid);
		$("akst_newsvine").href = akst_share_url("http://www.newsvine.com/_wine/save?u={url}&amp;h={title}", url, title, pubid);
		$("akst_comments").href = akst_share_url("http://co.mments.com/track?url={url}&amp;title={title}", url, title, pubid);
		$("akst_blinklist").href = akst_share_url("http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Url={url}&amp;Title={title}", url, title, pubid);
		$("akst_reddit").href = akst_share_url("http://reddit.com/submit?url={url}&amp;title={title}", url, title, pubid);
		$("akst_blogmarks").href = akst_share_url("http://blogmarks.net/my/new.php?mini=1&url={url}&title={title}", url, title, pubid);
		$("akst_magnolia").href = akst_share_url("http://ma.gnolia.com/bookmarklet/add?url={url}&amp;title={title}", url, title, pubid);
		$("akst_windows_live").href = akst_share_url("https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url={url}&title={title}&top=1", url, title, pubid);
		$("akst_tailrank").href = akst_share_url("http://tailrank.com/share/?link_href={url}&amp;title={title}", url, title, pubid);
		$("akst_stumbleupon").href = akst_share_url("http://www.stumbleupon.com/submit?url={url}&title={title}", url, title, pubid);
		$("akst_facebook").href = akst_share_url("http://www.facebook.com/share.php?u={url}", url, title, pubid);
	}

	if (document.getElementById('akst_email')) {
		post_id.value = id;
	}

	form.style.left = offset[0] + 'px';
	form.style.top = (offset[1] + link.offsetHeight + 3) + 'px';
	form.style.display = 'block';
}

function akst_share_url(base, url, title, pubid) {
	base = base.replace('{url}', url).replace('{title}', title);	
	if (akst_tracking) {
		return 'http://r.sharethis.com/web?destination=' + encodeURIComponent(base) + '&publisher=' + pubid;
	}
	return base;
}

function akst_share_tab(tab) {
	var tab1 = document.getElementById('akst_tab1');
	if (typeof tab1 == 'undefined') {
		tab1 = document.createElement('div');
	}
	var tab2 = document.getElementById('akst_tab2');
	if (typeof tab2 == 'undefined') {
		tab2 = document.createElement('div');
	}
	var body1 = document.getElementById('akst_social');
	if (typeof body1 == 'undefined') {
		body1 = document.createElement('div');
	}
	var body2 = document.getElementById('akst_email');
	if (typeof body1 == 'undefined') {
		body1 = document.createElement('div');
	}
	switch (tab) {
		case '1':
			tab2.className = '';
			tab1.className = 'selected';
			body2.style.display = 'none';
			body1.style.display = 'block';
			break;
		case '2':
			tab1.className = '';
			tab2.className = 'selected';
			body1.style.display = 'none';
			body2.style.display = 'block';
			break;
	}
}

