function akst_share(id, url, title) {
	var form = jQuery('#akst_form');
	var post_id = document.getElementById('akst_post_id');
	
	if (form.css('display') == 'block' && post_id.value == id) {
		form.css('display', 'none');
		return;
	}
	
	var link = jQuery('#akst_link_' + id);
	
	// Set up the form
	post_id.value = id;
	document.getElementById("akst_facebook").href = akst_share_url("http://www.facebook.com/share.php?u={url}", url, title);
	document.getElementById("akst_technorati").href = akst_share_url("http://www.technorati.com/faves?add={url}", url, title);
	document.getElementById("akst_delicious").href = akst_share_url("http://del.icio.us/post?url={url}&title={title}", url, title);
	document.getElementById("akst_meneame").href = akst_share_url("http://meneame.net/submit.php?url={url}", url, title);
	document.getElementById("akst_floreame").href = akst_share_url("http://floreame.net/submit.php?url={url}", url, title);
	document.getElementById("akst_fresqui").href = akst_share_url("http://tec.fresqui.com/post?url={url}&title={title}", url, title);
	document.getElementById("akst_blinklist").href = akst_share_url("http://es.blinklist.com/index.php?Action=Blink/addblink.php&Url={url}&Title={title}", url, title);
	document.getElementById("akst_barrapunto").href = akst_share_url("http://barrapunto.com/submit.pl?story=&subj={title}", url, title);
	document.getElementById("akst_blogmemes").href = akst_share_url("http://www.blogmemes.com/post.php?url={url}&title={title}", url, title);
	document.getElementById("akst_enchilame").href = akst_share_url("http://enchilame.com/submit.php?url={url}", url, title);
	document.getElementById("akst_chido").href = akst_share_url("http://chido.blogsmexico.com/submit.php?url={url}", url, title);
	document.getElementById("akst_misterwong").href = akst_share_url("http://www.mister-wong.es/index.php?action=addurl&bm_url={url}&bm_description={title}", url, title);
	document.getElementById("akst_digg").href = akst_share_url("http://digg.com/submit?phase=2&url={url}&title={title}", url, title);
	document.getElementById("akst_google_bmarks").href = akst_share_url("http://www.google.com/bookmarks/mark?op=edit&bkmk={url}&title={title}", url, title);
	document.getElementById("akst_yahoo_myweb").href = akst_share_url("http://myweb2.search.yahoo.com/myresults/bookmarklet?u={url}&t={title}", url, title);
	document.getElementById("akst_stumbleupon").href = akst_share_url("http://www.stumbleupon.com/submit?url={url}&title={title}", url, title);
	link.after(form);
	//form.css('display', 'block');
	form.slideDown('fast');
}

function akst_share_url(base, url, title) {
	base = base.replace('{url}', url);
	return base.replace('{title}', title);
}

function akst_share_tab(tab) {
	var tab1 = document.getElementById('akst_tab1');
	var tab2 = document.getElementById('akst_tab2');
	var body1 = document.getElementById('akst_social');
	var body2 = document.getElementById('akst_email');
	
	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;
	}
}

