
function showBlogAllRecent() {
	document.getElementById('blogRecentMore').setAttribute('href','http://blog.mgame.jp/intro/new_post_list.do');
	document.getElementById('blogNeighborRecent').style.display = 'none';
	document.getElementById('blogAllRecent').style.display = 'block';
	return false;
}

function showBlogNeighborRecent() {
	f_executeXHRequest('get', '/main/blog_neighbor_recent_post.html', true, null, callbackShowBlogNeighborRecent, null);
	return false;
}

function callbackShowBlogNeighborRecent(xmlHttp) {
	document.getElementById('blogNeighborRecentContents').innerHTML = xmlHttp.responseText;
	document.getElementById('blogRecentMore').setAttribute('href','http://blog.mgame.jp/main/main_neighbor_recent_post.do?blogId=-1');
	document.getElementById('blogAllRecent').style.display = 'none';
	document.getElementById('blogNeighborRecent').style.display = 'block';
}

function f_createXHObject() {
	if (window.ActiveXObject) {
		var aVersions = ['Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
		for (var i=0; i<aVersions.length; i++) {
			try { var xmlHttp = new ActiveXObject(aVersions[i]); return xmlHttp; } catch(e) {}
		}
	}else if ( typeof(XMLHttpRequest) != 'undefined' ) {
		var xmlHttp = new XMLHttpRequest(); return xmlHttp;
	}
	return false;
}

function f_executeXHRequest(method, uri, async, postdata, callbackFunction, callbackArguments) {
	var xmlHttp = f_createXHObject();
	if (xmlHttp) {
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState==4) {
				if (xmlHttp.status==200) {
					if ((callbackFunction!=null)&&(callbackFunction.constructor == Function)) { callbackFunction(xmlHttp, callbackArguments); } xmlHttp = null;
				}
			}
			return;
		}
		xmlHttp.open(method.toLowerCase(), uri, async);
		if (method.toLowerCase()=='post') {
			xmlHttp.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
			xmlHttp.send(postdata);
		}else xmlHttp.send(null);
	}
}