var $j = jQuery;

function setCopyright() {
	var date = new Date();
	$j("#copy_str").text("Copyright(C) NEC BIGLOBE, Ltd. 1996 - " + date.getFullYear());
}
function setMenuHeight() {
	if ( $j("#primary").height() < $j("#content").height()) {
		$j("#primary").height($j("#content").height());
	}
}
function appendHatebu() {

	$j(".hentry").each(function() {
		var url = $j(this).find(".entry-title > a[rel='bookmark']").attr("href");
		if(url) {
			var hateb_api = "http://b.hatena.ne.jp/entry/";
			var hateb_icon = $j("<img />").attr("src", hateb_api+"image/"+url);
			var hateb = $j("<a></a>").attr("href", hateb_api+url).addClass("hateb").append(hateb_icon).attr("target", "_blank");
			$j(this).find(".entry-meta .entry-date-left a.hatena").after(hateb);
		}
	
	});
}

$j(function(){
	setCopyright();
	$j(".entry-content img").removeAttr("width").removeAttr("height");
	// setMenuHeight();
	appendHatebu();
});

window.onload = setMenuHeight;