// JavaScript Document
function htmlInclude() {
	var req;
	if (typeof(XMLHttpRequest) == "undefined") {
		// IE
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				return;
			}
		}
	} else {
		// OTHERS
		req = new XMLHttpRequest();
	}
	
	var tags = document.getElementsByTagName("A");
	var i;
	for (i=0; i<tags.length; i++) {
		if (tags[i].getAttribute("rel") == "fragment") {
			
			req.open('GET', tags[i].getAttribute("href"), false);
			req.send(null);
			
			if (req.status == 200) {
				var container = document.createElement("DIV");
				container.innerHTML = req.responseText;
				
				var a = tags[i];
				var next = container.firstChild;
				var actual;
				while ((actual = next) != null) {
					next = actual.nextSibling;
					a.parentNode.insertBefore(actual, a);
				}
				a.parentNode.removeChild(a);
			}
		}
	}
}
		
if (window.attachEvent) {
	// IE
	window.attachEvent("onload", htmlInclude);
	
} else {
	// DOM
	window.addEventListener("load", htmlInclude, false);
	
}
