function AddressListBegin(Key, Postcode1, Postcode2) {
                    var scriptTag = document.getElementById("pcascript"),
                        headTag = document.getElementsByTagName("head").item(0),
                        strUrl = "";

                    //Build the url
                    strUrl = "http://services.postcodeanywhere.co.uk/PostcodeAnywhere/Interactive/FindByPostcode/v1.00/json.ws?";
                    strUrl += "&Key=" + escape(Key);
                    strUrl += "&Postcode=" + escape(Postcode1)+escape(Postcode2);
                    strUrl += "&CallbackFunction=AddressListEnd";
                    document.getElementById("vpc").value = escape(Postcode1);
                    //Make the request
                    if (scriptTag) try { headTag.removeChild(scriptTag) } catch (e) { }

                    scriptTag = document.createElement("script");
                    scriptTag.src = strUrl;
                    scriptTag.type = "text/javascript";
                    scriptTag.id = "pcascript";
                    headTag.appendChild(scriptTag);
                }

                function AddressListEnd(response) {
                    if (response.length == 1 && typeof (response[0].Error) != 'undefined')
                     // alert(response[0].Description);
                     alert("Sorry, you have reached today's free look-up allocation.");
                    else {
                        if (response.length == 0)
                            alert("Sorry, no matching items found");
                        else {
                            var lstAddressIP = document.getElementById("vbuilding");

                            lstAddressIP.options.length = 0;

                            lstAddressIP.options[0] = new Option("Select Address","");

                            for (var i in response) {
                                lstAddressIP.options[lstAddressIP.options.length] = new Option(response[i].StreetAddress, response[i].Id);
                            }

                            lstAddressIP.onchange = function () { SelectAddress('FX66-AC92-CM12-JT44', this.value); }
                            document.getElementById("divAddressListIP").style.display = "";
                        }
                    }
                }

                function SelectAddress(Key, Id) {
                    if (!Id) return;
                
                    var scriptTag = document.getElementById("pcascript"),
                        headTag = document.getElementsByTagName("head").item(0),
                        strUrl = "";

                    //Build the url
                    strUrl = "http://services.postcodeanywhere.co.uk/PostcodeAnywhere/Interactive/RetrieveById/v1.00/json.ws?";
                    strUrl += "&Key=" + escape(Key);
                    strUrl += "&Id=" + escape(Id);
                    strUrl += "&CallbackFunction=SelectAddressEnd";

                    //Make the request
                    if (scriptTag) try { headTag.removeChild(scriptTag) } catch (e) { }

                    scriptTag = document.createElement("script");
                    scriptTag.src = strUrl;
                    scriptTag.type = "text/javascript";
                    scriptTag.id = "pcascript";
                    headTag.appendChild(scriptTag);
                }

                function SelectAddressEnd(response) {
                    if (response.length == 1 && typeof (response[0].Error) != 'undefined')
                     alert(response[0].Description);
                     // alert("Sorry, you have reached today's free look-up allocation.");
                    else {
                        if (response.length == 0)
                            alert("Sorry, no matching items found");
                        else {
                            document.getElementById("divAddressListIP").style.display = "none";
                            document.getElementById("vcompany").value = response[0].Company;
                            document.getElementById("vline1").value = response[0].Line1;
                            document.getElementById("vline2").value = response[0].Line2;
                            document.getElementById("vline3").value = response[0].Line3;
                            document.getElementById("vline4").value = response[0].Line4;
                            document.getElementById("vline5").value = response[0].Line5;
                            document.getElementById("vtown").value = response[0].PostTown;
                            document.getElementById("vcounty").value = response[0].County;
						}
                    }
                }

