//agaraMenu読み込み

//読み込み中のメッセージ（html可）
var strInit = 'メニュー読み込み中……';
//読み込み html
var strMenuUrl = "http://blog.agara.co.jp/eigasai/menu/getmenu.html";

function agaraHttpRequest()
{
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {
		if (window.navigator.platform.match(new RegExp("mac", "i"))) {
			return null;
		}
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
	} 
	else {
		return null;
	}
}

function getMenu()
{

	var xmlobj = agaraHttpRequest();
	if (xmlobj) {
		if (document.getElementById) {
			document.getElementById("agaraMenu").innerHTML = strInit;
			xmlobj.onreadystatechange = function() 
			{ 
				if (xmlobj.readyState ==4 ) {
					if (xmlobj.status == 200 && xmlobj.responseText) {
						document.getElementById("agaraMenu").innerHTML = xmlobj.responseText;
					}
				}
			}
		    xmlobj.open("GET", strMenuUrl, true);
			xmlobj.send("");
		}
	}
}

document.write('<span id="agaraMenu"></span>');
getMenu();
