/* 外部サービス用メニューバー */

(function($){
	var HTML = '';
			
	var ua = $.browser;
	if(ua.msie)
		HTML += '<a href="javascript:window.external.AddFavorite(\''+window.location.href+'\',\''+document.title+'\');" popup="ブックマーク（お気に入り）に追加"><img id="browser-bookmark-button" src="/mini_buhin/bookmark/browser.gif" alt="お気に入り（ブックマーク）に追加" /></a>';
	if(ua.mozilla)
		HTML += '<a href="javascript:window.sidebar.addPanel(\''+encodeURIComponent(document.title)+'\',\''+window.location.href+'\', \'\');" popup="お気に入り（ブックマーク）に追加"><img id="browser-bookmark-button" src="/mini_buhin/bookmark/browser.gif" alt="ブックマーク（お気に入り）に追加" /></a>';
	if(ua.opera)
		HTML += '<a href="'+window.location.href+'" rel="sidebar" title="'+document.title+'"><img id="browser-bookmark-button" src="/mini_buhin/bookmark/browser.gif" alt="ブックマーク（お気に入り）に追加" /></a>';

	if(ua.safari)
		HTML += ''; // Safari/Chromeは無理？
			
	HTML += '<a target="_blank" href="http://b.hatena.ne.jp/append?'+window.location.href+'" popup="はてなブックマークに追加"><img src="/mini_buhin/bookmark/hatena.gif" alt="はてなブックマークに追加" style="margin-right: 2px;"></a>';
	HTML += '<a href="javascript:void window.open(\'http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t=\'+encodeURIComponent(document.title)+\'&amp; u=\'+encodeURIComponent(window.location.href)+\'&amp;opener=bm&amp;ei=UTF- 8\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=0,left=100,top=50\',0);" popup="Yahoo!ブックマークに追加"><img src="/mini_buhin/bookmark/yahoo.gif" alt="Yahoo!ブックマークに追加" style="margin-right: 2px;" /></a>';
	HTML += '<a target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk='+encodeURIComponent(window.location.href)+'&amp;title='+encodeURIComponent(document.title)+'" popup="Googleブックマークに追加"><img src="/mini_buhin/bookmark/google.gif" alt="Googleブックマークに追加" style="margin-right: 2px;" /></a>';
	HTML += '<a target="_blank" href="http://clip.livedoor.com/redirect?link='+encodeURIComponent(window.location.href)+'&amp;title='+encodeURIComponent(document.title)+'" popup="livedoorクリップに追加"><img src="/mini_buhin/bookmark/livedoor.gif" alt="livedoorクリップに追加" /></a>';
			
	//HTML += '<span class="hatenastar"><a href="'+window.location.href+'" /></span>';
			
	$('#external-services').html(HTML);
	$('#external-services').show();

})(jQuery);
