function ajaxRequest(url, id) {
	var xmlhttp = initxmlhttp();
	var container = document.getElementById(id);
	xmlhttp.open("GET", url, true);
	xmlhttp.setRequestHeader("Cache-Control", "no-cache");
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			container.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}


function readmore(section, id, url) {
	var xmlhttp = initxmlhttp();
	var showcontent = document.getElementById(section + "content" + id);
	url += "articles.php?readmore=" + id;
	xmlhttp.open("GET", url, true);
	xmlhttp.setRequestHeader("Cache-Control", "no-cache");
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			showcontent.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}

function hide(section, id) {
	var element = document.getElementById("read" + section + id);
	element.style.display = "none";
}

function showinframe(id, name) {
	//Hide all medias.
	var medias = document.getElementsByName(name);
	for (var i = 0; i < medias.length; i++) {
		medias[i].style.display = "none";
	}
	//Just show the media which has current id.
	var showmedia = document.getElementById(id);
	showmedia.style.display = "block";
}
