function foc()
{
var formm
formm = document.getElementById('w3domain')
formm.focus()
}
var xmlHttp

function w3showDomain(str)
{ 
	if (isNaN(str)== false)
	{
	}
var domext = document.getElementById("w3suffix").value;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax/whois/index.php";
url=url+"?url="+str+domext;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_w3domain;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged_w3domain() 
{ 
if (xmlHttp.readyState==1)
{ 
document.getElementById("w3_domain").innerHTML='<img src=ajax-loader.gif> Checking Availability...'
document.getElementById("w3_domain").className = 'checking';
}
if (xmlHttp.readyState==4 && xmlHttp.status==200)
{ 
document.getElementById("w3_domain").innerHTML=xmlHttp.responseText;
		var whois_result=document.getElementById("w3_domain").innerHTML;
		var whois_result_low=whois_result.toLowerCase(); 
		if ((whois_result_low.indexOf("no match") < 0) && (whois_result_low.indexOf("not found") < 0) && (whois_result_low.indexOf("please type") < 0) && (whois_result_low.indexOf("please enter") < 0))
		{
		document.getElementById("w3_domain").className= 'nagative';
		document.getElementById("w3_domain").innerHTML= 'Domain is already taken!';
		}
		else
		{
			if ((whois_result_low.indexOf("no match") > -1) || (whois_result_low.indexOf("not found") > -1))
			{
			document.getElementById("w3_domain").className= 'positive';
			document.getElementById("w3_domain").innerHTML= 'Domain is available for registration!';
			}
			else
			{
			document.getElementById("w3_domain").className= 'nagative';
			}
		}
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
