function getXmlHttp()
{
	var xmlHttp = null;

	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				return null;
			}
		}
	}

	return xmlHttp;
}

function loadRates(id, location)
{
        var el = document.getElementById(id);
        if (!el) return;

	var xmlHttp = getXmlHttp();
	if (!xmlHttp) return false;

	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4)
		{
			el.innerHTML = xmlHttp.responseText;
		}
	}

	xmlHttp.open('GET', '/rates.php?location=' + location, true);
	xmlHttp.send(null);
}
