   
function ltspost() 
{	
	url = "/common/scripts/postcode.php";
	ps = "PostCode=" + jQuery("input[name=Postcode]").val();
	
	jQuery.getJSON (	url, ps, getlist )
	
}


function getlist(data) 
{
	var options = '';
	jQuery("#pc").children().remove();
	
    options += '<option value="0">select...</option>'; 
    
    jQuery.each(data.ajaxresponse, function(i,item)
    {		
		addr = item.addr;		
		pstkey = item.pstky;	
		pstkcod = item.pstcd;		
		
		options += '<option value="' + pstkey + '">' + addr + '</option>';	
	})
	
	jQuery("#Validate7").value = pstkcod;
	jQuery("#pc").append(options);	
	
	jQuery("#drppost").show();
	jQuery("#dxppost").show();

}


function stspost() 
{	
	url = "/common/scripts/postcode.php";
	ps = "PostKey=" + jQuery("#pc").val();

	jQuery.getJSON (		
			url,
			ps,		
			getpostcode
		)	
	
}

function getpostcode(data) 
{	
	jQuery("#Organisation").val(data.ajaxresponse[0].organisation);	
	jQuery("#Validate5,#DeliveryValidate5").val(data.ajaxresponse[0].address1);
	jQuery("#Address2,#DeliveryAddress2").val(data.ajaxresponse[0].address2);	
	jQuery("#TownCity,#DeliveryTownCity").val(data.ajaxresponse[0].towncity);	
	jQuery("#Validate6,#DeliveryValidate6").val(data.ajaxresponse[0].county);
	jQuery("#DeliveryPostcode").val(data.ajaxresponse[0].postcode)


}








function ltspost2() 
{	
	url = "/common/scripts/postcode2.php";
	ps2 = "DeliveryPostcode=" + jQuery("input[name=DeliveryPostcode]").val();
	
	jQuery.getJSON (	url, ps2, getlist2 )
	
}


function getlist2(data) 
{
	var options = '';
	jQuery("#pc2").children().remove();
	
    options += '<option value="0">select...</option>'; 
    jQuery.each(data.ajaxresponse, function(i,item)
    {		
		addr = item.addr;		
		pstkey = item.pstky;	
		pstkcod = item.pstcd;		
		
		options += '<option value="' + pstkey + '">' + addr + '</option>';	
	})
	
	jQuery("#DeliveryValidate7").value = pstkcod;
	jQuery("#pc2").append(options);	
	
	jQuery("#drppost2").show();
	jQuery("#dxppost2").show();

}


function stspost2() 
{	
	url = "/common/scripts/postcode2.php";
	ps2 = "PostKey=" + jQuery("#pc2").val();

	jQuery.getJSON (		
			url,
			ps2,		
			getpostcode2
		)	
	
}

function getpostcode2(data) 
{	
	jQuery("#Organisation").val(data.ajaxresponse[0].organisation);	
	jQuery("#DeliveryValidate5").val(data.ajaxresponse[0].address1);
	jQuery("#DeliveryAddress2").val(data.ajaxresponse[0].address2);	
	jQuery("#DeliveryTownCity").val(data.ajaxresponse[0].towncity);	
	jQuery("#DeliveryValidate6").val(data.ajaxresponse[0].county);	
	;
}


