				var provideAddressOptions = function() {
	
					$.post("/utils/fetchAddressData.php", {postcode: $('#zfb_postCode').attr('value')}, function(data) {
	
						$('#StreetAddressOptions').removeOption(/./);
	
						if (data['IsError']) {
							alert('Search failed: ' + data['ErrorMessage']);
						}
						else {
	
							if (data.length > 0) {
		
								var results = data;
								
								if (results.length > 0) {
									
									$('#StreetAddressOptions').addOption('Result: ', results.length + ' addresses found.  Please select:');

									$.each(results, function(i) {
										$('#StreetAddressOptions').addOption(this['Id'], this['Description'].substr(0, 50) + '...', false);
									});
							
									$('#StreetAddressOptions').attr('disabled', false);
															
									$('#StreetAddressOptions').bind('change', function() {
	
										$('#StreetAddressOptions').selectedOptions().each(function(i) {
											if(this['value'] != '') {
												$.post("/utils/fetchAddressData.php", {id: this['value']}, function(data) {
																						
													if (data['IsError']) {
														alert('Search failed: ' + data['ErrorMessage']);
													}
													else {
														var sLine1 = data['Line1'];
																						
														if (data['Organisation']) {
															if (data['OrganisationName'].length > 0) {
																sLine1 = data['OrganisationName'] + ', ' + sLine1;
															}
														}
												
														$('#zfb_addressLine1').attr('value', sLine1);
												
														$('#zfb_addressLine2').attr('value', data['Line2']);
														$('#zfb_addressLine3').attr('value', data['Line3']);
												
														$('#zfb_townCity').attr('value', data['PostTown']);
														$('#zfb_county').attr('value', data['County']);
													}	

												}, 'json');
											}
										});
										
									});				
									
								}
								else {
									alert('Search failed: No matching addresses were found for the postcode provided');
								}
							}
							else {
								alert('Search failed: No matching addresses were found for the postcode provided');							
							}
							
						}
							
				     }, 'json');
				
					return false;
				
				}
