function getSong(songId) {
	xmlHttpSong = createXmlHttpRequestObject();
	xmlHttpSong.open("GET", ("home_music.php?id=" + songId), true);
	xmlHttpSong.onreadystatechange = function() {
		if (xmlHttpSong.readyState == 4) {
			document.getElementById("musicContent").innerHTML = xmlHttpSong.responseText;
		}
	};
	xmlHttpSong.send(null);
}

function getStudio() {
	xmlHttpStudio = createXmlHttpRequestObject();
	xmlHttpStudio.open("GET", ("estudio.php"), true);
	xmlHttpStudio.onreadystatechange = function() {
		if (xmlHttpStudio.readyState == 4) {
			document.getElementById("mainContent").innerHTML = xmlHttpStudio.responseText;
		}
	};
	xmlHttpStudio.send(null);
}

function getSection(sectionName) {
	xmlHttpSection = createXmlHttpRequestObject();
	xmlHttpSection.open("GET", ("home_section.php?section=" + sectionName), true);
	xmlHttpSection.onreadystatechange = function() {
		if (xmlHttpSection.readyState == 4) {
			document.getElementById("mainContent").innerHTML = xmlHttpSection.responseText;
		}
	};
	xmlHttpSection.send(null);
}

function getRecetaImg(id) {
	xmlHttpImg = createXmlHttpRequestObject();
	xmlHttpImg.open("GET", ("receta_img.php?id=" + id), true);
	xmlHttpImg.onreadystatechange = function() {
		if (xmlHttpImg.readyState == 4) {
			document.getElementById("recetaImg").innerHTML = xmlHttpImg.responseText;
		}
	};
	xmlHttpImg.send(null);
}

function createXmlHttpRequestObject()
{
	// will store the reference to the XMLHttpRequest object
	var xmlHttp;
	// this should work for all browsers except IE6 and older
	try
	{
		// try to create XMLHttpRequest object
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
	// assume IE6 or older
	try
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHttp");
	}
		catch(e) { }
	}
	// return the created object or display an error message
	if (!xmlHttp)
	alert("Error creating the XMLHttpRequest object.");
	else
	return xmlHttp;
}
