function init()
{
	if (typeof XMLHttpRequest == 'undefined')
	{
		objects = Array(
			'Microsoft.XMLHTTP',
			'MSXML2.XMLHTTP',
			'MSXML2.XMLHTTP.3.0 ',
			'MSXML2.XMLHTTP.4.0',
			'MSXML2.XMLHTTP.5.0'
		);

		for (i in objects)
		{
			try
			{
				return new ActiveXObject(objects[i]);
			}
			catch (e) {}
		}
	}
	else
	{
		return new XMLHttpRequest();
	}
}

function get(id)
{
	return document.getElementById(id);
}

function update(file)
{
	var http = init();

	if (file == 'htpasswd')
	{
		http.open('GET', '/process.php?file=' + file + '&user=' + escape(get('user').value) + '&pass=' + escape(get('pass').value), true);
	}
	else
	{
		http.open('GET', '/process.php?file=' + file + '&url=' + escape(get('url').value), true);
	}
	get('result').innerHTML = '<img src="http://www.secondversion.com/images/8-1.gif" alt="Loading..." title="Loading..." />';

	http.onreadystatechange = function()
	{
		if (http.readyState == 4)
		{
			get('result').innerHTML = http.responseText;
		}
	}
	http.send(null);
}