
function _findAddress(){
if (document.form1.postcode.value!=''){
	$("#loading").html('<img src="images/loading.gif" alt="loading" />');
	$("#loading").css('display','');
  
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
      //	  alert("Readystate=4");
	   $("#add1").css("background-color","");
	   $("#town").css("background-color","");
	   $("#postcode2").css("background-color","");
	   
	    $("#loading").html('&nbsp;');
		$("#loading").css('display','none');
		$("#addresslist").html(xmlHttp.responseText).slideDown({duration: 1000, easing: 'easeInOutCirc'});
		
        }
      }
	// var filhouseno = document.getElementById("houseno");
	
	  var filter = document.getElementById("postcode");
	  var val = filter.value;
     // var houseno = filhouseno.value;
	 var houseno = '';
	// alert("opening xmlHttp object");
	  xmlHttp.open("GET","findaddress.asp?rand="+Math.floor(Math.random() * 1001)+"&postcode="+houseno+","+val,true);
   	// xmlHttp.open("GET","images.html",true);
	  xmlHttp.send(null);
	  
	 
	  
  }
  else
  {
  alert('Please enter your Postcode')
  }
  
  
  }
  
function _setAddress()
{
		
		$("#address").slideDown({duration: 1000, easing: 'easeInOutCirc'});
		
	//alert('set address');
		var addstr = document.getElementById('AddressLine1')[document.getElementById('AddressLine1').selectedIndex].value;
		
		var addr = addstr.split('|');
		
		
		

		$("#add1").val(addr[0]);
		$("#add2").val(addr[1]);
		$("#town").val($("#lkup_Town").val());
		$("#county").val($("#lkup_County").val());
		$("#country").val("U K");
		$("#postcode").val($("#lkup_Postcode").val());
		$("input#postcode2").attr("value",$("#lkup_Postcode").val());

		$("#id_addgonein").val(1);

		
}
function notlisted(){
		$(".form-row-addresslist").slideUp({complete:function(){$("#address").slideDown({duration: 1000, easing: 'easeInOutCirc'});}});
		
	 }
function outsideuk(){
		$("#address").slideDown({duration: 1000, easing: 'easeInOutCirc'});
	 }
