
var RecipeHtml = "";
var mycat = ""
var officialBlog_dispText = '<img src="img/toppage/up-b.gif" style="float:none;margin-left:4px;margin-bottom:2px">';
var officialBlog_dispTime = 60 * 24 * 2; // 
var officialBlog_enableTime = new Date().getTime() - ((60 * 1000) * officialBlog_dispTime);

function RecipeBlogWrite(){
	document.write( RecipeHtml );
}

function MovableTypeJsonCallback(data) {

	for ( var i=0, entry  ; entry = data.entry[i]; i++){
		if(entry.category.substr(0,3) == "") {
			mycat = "500";
		}
		if(entry.category.substr(0,3) < 150) {
			mycat = "100";
		}
		else if(entry.category.substr(0,3) < 200) {
			mycat = "150";
		}
		else if(entry.category.substr(0,3) < 300) {
			mycat = "200";
		}
		else if(entry.category.substr(0,3) < 400) {
			mycat = "300";
		}
		else if(entry.category.substr(0,3) < 500) {
			mycat = "400";
		}
		else if(entry.category.substr(0,3) < 600) {
			mycat = "500";
		}
		else if(entry.category.substr(0,3) < 700) {
			mycat = "600";
		}
		else if(entry.category.substr(0,3) < 800) {
			mycat = "700";
		}
		else {
			mycat = "500";
		}

		if(mycat == "") {
			mycat = "500";
		}

		var date_yyyy = parseInt( entry.published.substr(  0, 4 ), 10 );
		var date_mm   = parseInt( entry.published.substr(  5, 2 ), 10 ) - 1;
		var date_dd   = parseInt( entry.published.substr(  8, 2 ), 10 );
		var time_hh   = parseInt( entry.published.substr( 11, 4 ), 10 );
		var time_mm   = parseInt( entry.published.substr( 14, 2 ), 10 );
		
		var targetTime = new Date( date_yyyy, date_mm, date_dd, time_hh, time_mm ).getTime();
		
		officialBlog_enableTime = parseInt( officialBlog_enableTime / (1000 * 60) ) * (1000 * 60);
		var subTime = officialBlog_enableTime - targetTime;

		RecipeHtml += "<li class='feed clearfix'><img src='img/toppage/" + mycat + ".jpg'>" + "<a href='" + entry.link + "'>" + entry.title + " (" + entry.published.substr(5,2) + "/" + entry.published.substr(8,2) + ") ";
			if ( subTime <= 0 )
			{
				RecipeHtml += officialBlog_dispText;
			}
		RecipeHtml += "</a></li>";
		mycat = "";
	}

}

