function readXML(_id,_userid) {
	getTemplate(_id,_userid);
}

function getTemplate(_id,_userid) {
	xmlhttp = createXMLHttp();
	if (xmlhttp) {
		xmlhttp.onreadystatechange = setPageData;
		tmpname = "http://" + location.hostname + "/cms/lib.php?layoutid=" + _id + "&userid=" + _userid;
		xmlhttp.open('GET', tmpname);
		xmlhttp.send(null);
	}else{
		alert("XMLHttpRequest失敗");
	}
}

function setPageData() {
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		var objcms = document.getElementById("cms");
		objcms.innerHTML = xmlhttp.responseText;
	}
}

// XMLHttpsオブジェクト作成
function createXMLHttp() {
	try {
		return new ActiveXObject ("Microsoft.XMLHTTP");
	}catch(e){
		try {
			return new XMLHttpRequest();
		}catch(e) {
			return null;
		}
	}
	return null;
}

