var httpobject;

function getInfo(str,foo)
{
	if(str.length != 0)
 	{
		httpobject=GetHttpObject();
		if (httpobject !=null)
		{
			var url="ajax"+foo+".php";
			url=url+"?q="+str;
			//url=url+"&l="+leng;
			httpobject.onreadystatechange=function()
				{
					if (httpobject.readyState==4)
					{
						str = httpobject.responseText
						document.getElementById(foo+"1").innerHTML=str;	
					}
				}
			httpobject.open("GET",url,true);
			httpobject.send(null);
		}
	}
	else
	{
		document.getElementById(foo).innerHTML="";
	}
}

function GetHttpObject()
{
	if (window.ActiveXObject) 
	  return new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest) 
	return new XMLHttpRequest();
	else 
	{
		alert("Your browser does not support AJAX.");
	  	return null;	
	}
}

function setValue(str, foo)
{
	document.getElementById(foo).value=str;
	document.getElementById(foo + '1').style.display = "none";
}

function divFlip(d){
	foo = d + '1';
	if(document.getElementById(foo).style.display == "none"){
		document.getElementById(foo).style.display = "block";
		document.getElementById(d).innerHTML="[&ndash; Hide Providers]";
	}
	else{
		document.getElementById(foo).style.display = "none";	
		document.getElementById(d).innerHTML="[+ Show Providers]"; 
	}
}

function divShow(d)
{
       document.getElementById(d).style.display = "block";
}
function divHide(d)
{
       document.getElementById(d).style.display = "none";
}