// bm_* の ロケーションを変更
function ReplaceBookmarkLocation() {

var u=location.href;

// はてな
document.getElementById("bm_hatena").href='http://b.hatena.ne.jp/entry/'+(u);
document.getElementById("bm_hatenauser").src='http://b.hatena.ne.jp/entry/image/'+(u);

// Yahoo!ブックマーク
document.getElementById("bm_yahoo").href='http://bookmarks.yahoo.co.jp/url?url=' + encodeURIComponent(u);

}

// twitter (bit.ly)
function GetBitly() {
    api = 'http://api.bit.ly/shorten?version=2.0.1&format=json&callback=Callback&login=diamondapricot&apiKey=R_faa9c6345274fc97107d7e7e8abdce7e&longUrl=';        
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = api + encodeURIComponent(location.href) ;
    document.body.appendChild(script);
}
function Callback(json) {
	var bitly_url=json.results[location.href]['shortUrl'];
	if ( bitly_url.indexOf("/bit.ly/") == -1 ) {
		location.href='http://twitter.com/?status='+encodeURIComponent(document.title+' '+location.href);
	}else{
		location.href='http://twitter.com/?status='+encodeURIComponent(document.title+' '+bitly_url);
	}
}


