var xmlHttp

function checkID(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="checkcompany_ajax.asp";
url=url+"?q="+str;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 )
{
	//alert("The desired company is not available. Please enter your group id");
document.getElementById('group').innerHTML=xmlHttp.responseText;
document.getElementById('groupid').focus();
}

/*if (xmlHttp.readyState==4)
{ 	
if (xmlHttp.responseText == "<input type="hidden" name="groupid" style="width:400px" class="input"/>")
	document.getElementById("groupid").style.display = 'block';
	alert(xmlHttp.responseText +"hi")
}*/
}

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;
}