var xmlHttp
var ListRef
var SubFieldRef
var StateListRef

function fnDispList(Sub,ListID,SubFieldID,StateListID)  { 

  ListRef=ListID;
  SubFieldRef=SubFieldID;
  StateListRef=StateListID;
  xmlHttp=GetXmlHttpObject();

  if (xmlHttp==null)  {
    alert ("Your browser does not support this feature.");
    return;
  }  
      
  var url="asyncSubs.php";
  url=url+"?ListID="+ListRef+"&SubFieldID="+SubFieldRef+"&Sub="+Sub;
  url=url+"&sid="+Math.random();
  xmlHttp.onreadystatechange=stateChanged;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  
}

function stateChanged()
{ 
if (xmlHttp.readyState==4)
   { 
	document.getElementById(ListRef).innerHTML=xmlHttp.responseText;
	document.getElementById(ListRef).style.display="block";
   }
}

function fnHighlight(RowID)
{
	document.getElementById(RowID).style.background='#E1E8F7';
	document.getElementById(RowID).style.cursor="pointer";
}

function fnReset(RowID)
{
	document.getElementById(RowID).style.background='#FFFFFF';
}
function fnUpdateSub(Sub,State)
{
	if (Sub!=null)
	{
		document.getElementById(SubFieldRef).value=Sub;
		document.getElementById(StateListRef).value=State;
		document.getElementById(ListRef).innerHTML="";
		document.getElementById(ListRef).style.display="inline";
	}
}

function fnRemoveList(ListRef)
{
	setTimeout('fnRemoveListFinally(ListRef)',250);
}

function fnRemoveListFinally(ListRef)	{

	document.getElementById(ListRef).innerHTML="";
	document.getElementById(ListRef).style.display="inline";
}
