	function peticionGET(url,parametros,XHR)
	{
		noCache=parseInt(Math.random()*99999999);
		XHR.open("GET",url+'?'+parametros+'&noCache='+noCache,true)
		XHR.send(null);
	}
	
	function peticionPOST(url,parametros,XHR)
	{
		XHR.open("POST",url,true)
		XHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		XHR.send(parametros);
	}
	
	function ajax(url,parametros,funcionRespuesta,metodo)
	{
		var XHR=obtenerXHR();
		XHR.onreadystatechange = function ()
		{
			//Si la respuesta del servidor se completo
			if (XHR.readyState==4)
			{
				//Los datos llegaron bien y estan disponibles
				if (XHR.status==200)
				{
					funcionRespuesta(XHR.responseText);
				}
			}
		}
		if(metodo=='post')
		{
			peticionPOST(url,parametros,XHR);
		}
		else
		{
			peticionGET(url,parametros,XHR);	
		}
	}