var xmlHttp

function checkForm(str, id)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
 		alert ("Browser does not support HTTP Request")
 		return
 	}
	var url="verifuser.php?q="+str+"&id="+id
	xmlHttp.onreadystatechange = function()
    {
    	if(xmlHttp.readyState==4)
		{
			text = xmlHttp.responseText
 			document.getElementById(id).style.borderColor = text.substring(0,7);
			document.getElementById(id+"v").innerHTML = text.substring(8)
		}
	}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

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;
}