var xmlHttp

function showHint(str,x)
{
var array_one = new Array('txtSpot','results','term','category');
var array_two = new Array('txtSpot2','results','first','');
var array_three = new Array('txtSpot3','results','second','');
var all_arrays = new Array(array_one,array_two,array_three);
var which_array = all_arrays[x];
document.getElementById(which_array[0]).style.border='1px solid #000000';
document.getElementById(which_array[0]).style.visibility='visible';
document.getElementById(which_array[1]).style.visibility='hidden';
document.getElementById(which_array[0]).style.height='auto';
var y = 0;
if (str.length==0)
  { 
  document.getElementById(which_array[2]).innerHTML="";
  return;
  } else {
	document.getElementById(which_array[0]).style.border='1px solid #000000';
	}
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var which_text = "txtSpot";        
var url="http://www.thumbwarz.com/xyz.php";
url=url+"?term="+str+"&which="+x;
xmlHttp.onreadystatechange = function() {
  if (xmlHttp.readyState==4)
   { 
   document.getElementById(which_array[0]).innerHTML=xmlHttp.responseText;
   }
}
xmlHttp.open("GET",'xyz.php?term='+str+'&which='+x,true);
xmlHttp.send(null);
} 
/*
function stateChanged() 
{ 
if (xmlHttp.readyState==4)
   { 
   document.getElementById("txtSpot").innerHTML=xmlHttp.responseText;
   }
}
*/
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;
}
function updateBox(xyz,x) {
  var array_one = new Array('txtSpot','results','term','category');
  var array_two = new Array('txtSpot2','results','first','');
  var array_three = new Array('txtSpot3','results','second','');
  var all_arrays = new Array(array_one,array_two,array_three);
  var which_array = all_arrays[x];
	//alert("x="+x+"which_array="+which_array[2]);
  document.getElementById(which_array[2]).value=xyz;
	document.getElementById(which_array[0]).style.visibility='hidden';
	document.getElementById(which_array[3]).style.visibility='hidden';
	return false;
}
function highLight(the_ref) {
  document.getElementById(the_ref).style.backgroundColor='#3366CC';
	document.getElementById(the_ref).style.color='#ffffff';
}
function unHighLight(the_ref) {
  document.getElementById(the_ref).style.backgroundColor='#ffffff';
	document.getElementById(the_ref).style.color='#000000';
}
