var xmlHttp

function checkDomain(form)
	{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Uw internet browser ondersteunt geen HTTP-ondervragingen, gelieve op te waarderen naar een recentere versie")
	 return
	 }
	 
	var txtDomainName = form.txtDomainName.value
	var url="ajax_is_domain_free.php"
	url=url+"?domain="+txtDomainName
	url=url+"&sid="+Math.random()
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 xmlDoc=xmlHttp.responseXML;
 document.getElementById("txtResult").innerHTML=xmlDoc.getElementsByTagName("domainStatus")[0].childNodes[0].nodeValue;
 document.getElementById("txtDomainNameFormatted").innerHTML=xmlDoc.getElementsByTagName("domainNameFormatted")[0].childNodes[0].nodeValue;
 document.getElementById("txtButton").innerHTML=xmlDoc.getElementsByTagName("button")[0].childNodes[0].nodeValue;
 } 
}

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