(function(){
var mk = "320a45172cf57fc29236878e91da393bcaf8de79";
var url = location.href.replace("/itemheads", "/items");
document.write('<div class="share_box" style="padding:0 8px">');
document.write('<div style="float:left;height:27px;padding-right:5px">' + get_share(url) + '</div>');
document.write('<div style="float:left;height:27px;padding-right:5px">' + get_mixi_share(mk, url) + '</div>');
document.write('<div style="float:left;height:27px;padding-right:5px">' + get_hatena(url) + '</div>');
document.write('<div style="float:left;height:27px;padding-right:5px">' + get_hatena_count(url) + '</div>');
document.write('<div style="float:left;height:27px;padding-right:5px">' + get_like(url) + '</div>');
document.write('<div style="float:left;height:27px;padding-right:5px">' + get_mixi_like(mk, url) + '</div>');
document.write('<div style="float:left;height:27px;padding-right:5px">' + get_tweet() + '</div>');
document.write('<div style="clear:both"></div>');
document.write('</div>');

function get_mixi_share(mixi_key, url){
	var text = "Check";
	var res = '<a href="http://mixi.jp/share.pl" class="mixi-check-button"';
	res += ' data-key="' + mixi_key + '"';
	res += ' data-url="' + url + '">';
	res += text + "</a>";
	res += '<script type="text/javascript" src="http://static.mixi.jp/js/share.js"></script>';
	return res;
}
function get_mixi_like(mixi_key, url){
	var res = '<iframe scrolling="no" frameborder="0" allowTransparency="true" style="overflow:hidden; border:0; width:';
	res += '58px; height:20px" src="http://plugins.mixi.jp//favorite.pl?href=';
	res += encodeURIComponent(url);
	res += '&service_key=' + mixi_key;
	res += '&show_faces=false&width=58"></iframe>';
	return res;
}
function get_share(url){
	var text = "Share";
	var res = '<style>.FBConnectButton_Text{ line-height:1em; }</style><a name="fb_share" type="button"';
	res += 'share_url="' + url + '">' + text + '</a>';
	res += '<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>';
	return res;
}
function get_like(url){
	var res ='';
	res = '<iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&amp;href=' + encodeURIComponent(url) + '&amp;layout=button_count&amp;show_faces=false&amp;width=78&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:78px; height:21px;" allowTransparency="true"></iframe>';
	return res;
}
function get_tweet(){
	return '<a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-lang="en">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
}
function get_hatena(url){
	var res = '';
	res += '<a target="_top" href="http://b.hatena.ne.jp/add?mode=confirm&url=' + url + '"&title=' + encodeURIComponent(document.title) + '" title="このエントリーをはてなブックマークに追加" >';
	res += '<img src="http://b.st-hatena.com/images/entry-button/button-only.gif" width="20" height="20" style="border: none;" /></a>';
	return res;	
}
function get_hatena_count(url){
	var res = '';
	res += '<a href="http://b.hatena.ne.jp/entry/' + url + '">';
	res += '<img src="http://b.hatena.ne.jp/entry/image/' + url + '" style="border:none">';
	res += '</a>';
	return res;
}
})();

