function get_xml() 
{
    var xmlhttp=null;
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
            xmlhttp = new XMLHttpRequest();
        }
    }
    return xmlhttp;
}

function checkUnique(fieldObj, outputId)
{
	var output = document.getElementById(outputId);
	if(fieldObj.name == 'supid' && fieldObj.value == document.getElementById('nickName').value) {
		output.innerHTML = 'Account ID cannot be the same as Nickname';
	} else if(fieldObj.name == 'nickName' && fieldObj.value == document.getElementById('supid').value) {
		output.innerHTML = 'Nickname cannot be the same as Account ID';
	} else if(fieldObj.value != '')	{
		var name = fieldObj.name;
		var url = '/?m=Register&a=Searchinfo&'+name+'='+fieldObj.value;
		var xmlHTTP = get_xml();
		xmlHTTP.open("POST", url, true);
		xmlHTTP.onreadystatechange =
			function ()
			{
				if(xmlHTTP.readyState == 4) {
					output.innerHTML = xmlHTTP.responseText;
				}
			}
		xmlHTTP.send(null);
	}
}
