var akst_tracking = false;function akst_share(id, url, title, html_id, pubid) {
	var form = jQuery('#akst_form');
	var post_id = jQuery('#akst_post_id');
	
	if (form.css('display') == 'block' && post_id.val() == id) {
		form.css('display', 'none');
		return;
	}
	
	var link = jQuery('#akst_link_' + html_id);
	var offset = link.offset();

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

		jQuery("#akst_digg").attr('href', akst_share_url("http://digg.com/submit?phase=2&url={url}&title={title}", url, title, pubid));
		jQuery("#akst_twitter").attr('href', akst_share_url("http://twitter.com/home?status={title}%3A+{url}", url, title, pubid));
		jQuery("#akst_facebook").attr('href', akst_share_url("http://www.facebook.com/share.php?u={url}", url, title, pubid));
		jQuery("#akst_myspace").attr('href', akst_share_url("http://www.myspace.com/index.cfm?fuseaction=postto&u={url}&t={title}", url, title, pubid));
		jQuery("#akst_reddit").attr('href', akst_share_url("http://reddit.com/submit?url={url}&title={title}", url, title, pubid));
		jQuery("#akst_stumbleupon").attr('href', akst_share_url("http://www.stumbleupon.com/submit?url={url}&title={title}", url, title, pubid));
		jQuery("#akst_delicious").attr('href', akst_share_url("http://del.icio.us/post?url={url}&title={title}", url, title, pubid));
		jQuery("#akst_furl").attr('href', akst_share_url("http://furl.net/storeIt.jsp?u={url}&t={title}", url, title, pubid));
		jQuery("#akst_google_bmarks").attr('href', akst_share_url("http://www.google.com/bookmarks/mark?op=edit&bkmk={url}&title={title}", url, title, pubid));
		jQuery("#akst_technorati").attr('href', akst_share_url("http://www.technorati.com/faves?add={url}", url, title, pubid));
		jQuery("#akst_yahoo_myweb").attr('href', akst_share_url("http://myweb2.search.yahoo.com/myresults/bookmarklet?u={url}&t={title}", url, title, pubid));
		jQuery("#akst_windows_live").attr('href', akst_share_url("https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url={url}&title={title}&top=1", url, title, pubid));
	}

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

	form.css('left', offset.left + 'px');
	form.css('top', (offset.top + link.height() + 3) + 'px');
	form.css('display', 'block');
}

function akst_share_url(base, url, title, pubid) {
	base = base.replace('{url}', url).replace('{title}', title);	
	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;
	}
}
