
function ajaxFunction()
{
	
var xmlhttp;
if (window.XMLHttpRequest) 
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("This requires JavaScript to work");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
	  
	  if(xmlhttp.responseText == '')
	  {
		  document.getElementById('paflookuperror').innerHTML = 'There was a problem with your address. Please check and reenter.';	
  }
	  else
	  {
		   var fields=xmlhttp.responseText.split("###");

		   document.register.address2_F.value=fields[0];
		   document.register.address3_F.value=fields[1];
		   document.register.town_F.value=fields[2];
		   document.register.county_F.value=fields[3]; 
		   document.register.postcode_F.value=fields[4];	   
		   document.getElementById('paf-fields-returned').style.display = "block";

		   
		     
  	  }
  }
}
xmlhttp.open("GET","/thisissussex/paf-lookup.php?postcode="+document.register.postcode_F.value,true);
xmlhttp.send(null);
}