var akst_tracking = true;function akst_share(id, url, title, html_id, pubid) {
//	var form = jQuery('#akst_form');
//	var post_id = $('#akst_post_id');
	var form = document.getElementById('akst_form');
	var post_id = document.getElementById('akst_post_id');
	
	if (form.style.display == 'block' && post_id.value == id) {
		form.style.display = 'none';
		return;
	}

//	if (form.css('display') == 'block' && post_id.value == id) {
//	form.css({'display':'none'});
//		return;
//	}

	
//	var link = jQuery('#akst_link_' + html_id);
	var link = document.getElementById('akst_link_' + html_id);
	var offset = Position.cumulativeOffset(link);

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

		document.getElementById("akst_delicious").href = akst_share_url("http://del.icio.us/post?url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_facebook").href = akst_share_url("http://www.facebook.com/share.php?u={url}", url, title, pubid);
		document.getElementById("akst_twitter").href = akst_share_url("http://myadbird.appspot.com/tunnel?uri={url}", url, title, pubid);
		document.getElementById("akst_diigo").href = akst_share_url("http://secure.diigo.com/post?url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_google_reader").href = akst_share_url("http://www.google.com/reader/link?url={url}&title={title}&srcUrl={url}&srcTitle={title}", url, title, pubid);
		document.getElementById("akst_technorati").href = akst_share_url("http://www.technorati.com/faves?add={url}", url, title, pubid);
		document.getElementById("akst_stumbleupon").href = akst_share_url("http://www.stumbleupon.com/submit?url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_favoritos").href = akst_share_url("http://fa.voritos.com/bookmarks/?action=add&address={url}&title={title}", url, title, pubid);
		document.getElementById("akst_blogblogs").href = akst_share_url("http://blogblogs.com.br/my/bookmarks/add?bookmark_url[url]={url}&title={title}", url, title, pubid);
		document.getElementById("akst_gostei").href = akst_share_url("http://gostei.abril.com.br/post/new?t={title}&u={url}", url, title, pubid);
		document.getElementById("akst_digg").href = akst_share_url("http://digg.com/submit?phase=2&url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_domelhor").href = akst_share_url("http://www.domelhor.net/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_dihitt").href = akst_share_url("http://dihitt.com.br/submit.php?url={url}&titulo={title}", url, title, pubid);
		document.getElementById("akst_fixolas").href = akst_share_url("http://www.fixolas.com/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_blogosfera").href = akst_share_url("http://blogosfera.portaldasnoticias.com/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_ouvidizer").href = akst_share_url("http://www.ouvidizer.com/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_atalhovirtual").href = akst_share_url("http://www.atalhovirtual.com/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_linkou").href = akst_share_url("http://www.linkou.com.br/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_websapiens").href = akst_share_url("http://www.websapiens.net/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_linkk").href = akst_share_url("http://www.linkk.com.br/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_digacultura").href = akst_share_url("http://www.digacultura.net/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_reddit").href = akst_share_url("http://reddit.com/r/pt/submit?url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_rec6").href = akst_share_url("http://rec6.via6.com/link.php?url={url}&titulo={title}", url, title, pubid);
		document.getElementById("akst_ueba").href = akst_share_url("http://ueba.com.br/NovoLink?url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_linkto").href = akst_share_url("http://www.linkto.com.br/site.enviaNoticia.php?title={title}&url={url}", url, title, pubid);
		document.getElementById("akst_linkloko").href = akst_share_url("http://www.linkloko.com.br/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_pigg").href = akst_share_url("http://www.pigg.com.br/submit.php?url={url}", url, title, pubid);
		document.getElementById("akst_sapo").href = akst_share_url("http://tags.sapo.pt/post?v=3&url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_yahoo_myweb").href = akst_share_url("http://myweb2.search.yahoo.com/myresults/bookmarklet?u={url}&title={title}", url, title, pubid);
		document.getElementById("akst_yahoo_bookmarks").href = akst_share_url("http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u={url}", url, title, pubid);
		document.getElementById("akst_google_bmarks").href = akst_share_url("  http://www.google.com/bookmarks/mark?op=edit&bkmk={url}&title={title}", url, title, pubid);
		document.getElementById("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);
		document.getElementById("akst_blogmarks").href = akst_share_url("http://blogmarks.net/my/new.php?mini=1&url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_meneame").href = akst_share_url("http://www.meneame.net/submit.php?url={url}&title={title}", url, title, pubid);
		document.getElementById("akst_livejournal").href = akst_share_url("http://www.livejournal.com/update.bml?subject={title}&event={url}", url, title, pubid);
		document.getElementById("akst_myspace").href = akst_share_url("http://www.myspace.com/Modules/PostTo/Pages/?l=3&u={url}&t={title}&c=", url, title, pubid);
	}

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

//	form.css({'left':offset[0] + 'px','top':(offset[1] + link.offsetHeight + 3) + 'px','display':'block'});

	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;
	}
}
