var logincheck = null;
var logincheck_callback = null;
var logincheck_url = "loginexists/?type={0}&login={1}";

function verifyLogin(type, login, callback)
{
	logincheck_callback = callback;

	logincheck = xml.createHttpRequest(null, true, logincheck_onload);
	logincheck.open("GET", logincheck_url.format(type, login), true);
	logincheck.send(null);
}

function logincheck_onload(xmlRequest)
{
	var loginExists = null;
	if (xmlRequest.responseXML != null)
		loginExists = xmlRequest.responseXML.documentElement.getAttribute("exists") == "true" ? true : false;

	logincheck_callback(loginExists);
}

