
function createXMLHTTP(){
	//Crear una variable de Bool para comprobar si se está usando Internet Explorer.
	var xmlhttp = false;

	//Comprobar si se está usando IE.
	try {
		//Si la versión de javascript es superior a la 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		
	} catch (e) {
		//Si no, utilizar el tradicional objeto ActiveX.
		try {
			//Si se está usando Internet Explorer.
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			
		} catch (E) {
			//En caso contrario no se debe estar usando Internet Explorer.
			xmlhttp = false;
		}
	}
	
	//Si no se está usando IE, crear una instancia ActiveX del objeto.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

	function callFlashFunctions(pk){
		obj1=createXMLHTTP();
		modificaPath(pk,obj1);
		obj2=createXMLHTTP();
		modificaRSS(pk,obj2);
		obj3=createXMLHTTP();
		cargarCategorias(pk,obj3);
	}
	function cargarCategorias(pk,obj) {
		var url="getPost.php?pk="+pk;
		obj.open("GET", url);
		obj.onreadystatechange = function() {
			if (obj.readyState == 4 && obj.status == 200) {
				// devuelvo la lista de post en formato HTML
				resultado=obj.responseText;
				document.getElementById("content").innerHTML=resultado;
			}
		}
		obj.send(null);
	}

	function modificaPath(pk,obj) {

		var url="getPath.php?pk="+pk;
		obj.open("GET", url);
		obj.onreadystatechange = function() {
			if (obj.readyState == 4 && obj.status == 200) {
				// devuelvo el path en formato HTML
				resultado=obj.responseText;
				miPath=document.getElementById("path");
				if(miPath) miPath.innerHTML=resultado;
			}
		}
		obj.send(null);
	}
	
	function modificaRSS(pk,obj) {
		var url="getRSS.php?pk="+pk;
		obj.open("GET", url);
		obj.onreadystatechange = function() {
			if (obj.readyState == 4 && obj.status == 200) {
				// devuelvo el path en formato HTML
				resultado=obj.responseText;
				document.getElementById("submenu").innerHTML=resultado;
			}
		}
		obj.send(null);
	}
	