var xmlHttp;

function fnCheckToSub(SubRef,StateRef,PCodeRef)	{ 
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null)	{
	  alert ("Your browser does not support this feature.");
	  return;
	}  
	
	var CheckSub=document.getElementById(SubRef).value;	  
	var StateID=document.getElementById(StateRef).value;
	var PCode=document.getElementById(PCodeRef).value;
	
	var url="asyncsubcheck.asp";
	url=url+"?StateID="+StateID+"&CheckSub="+CheckSub+"&PCode="+PCode;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function()	{
		if (xmlHttp.readyState==4)	{
	      if (xmlHttp.responseText.search(/Error! /)!=-1)  {
			alert(xmlHttp.responseText.replace(/Error! /,""));
			fnDispList(CheckSub,"ToSubList",SubRef,StateRef,PCodeRef,"")
	      }
		  else  {
		    fnCheckRegion();
		  }
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}