function getHTTPObject() {
        if (typeof XMLHttpRequest != 'undefined') {
                return new XMLHttpRequest();
        } try {
                return new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
                try {
                        return new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
        }
        return false;
}


var http = getHTTPObject();


function lookupAddress() {
        var url = "http://search.gipoco.com/ajax2.php?id=";
        var txt = document.getElementById("txt");
        var dyn = document.getElementById("dyn");
        if (txt.value.length>2) {
                if (!this.working) {
                        var http = this.http;
                        this.http.open("GET", url + escape(txt.value), true);
                        this.http.onreadystatechange = function() {
                                if (http.readyState == 4) {
                                        this.working = false;
                                        dyn.innerHTML = http.responseText;
                                        dyn.style.border = "#000 1px solid";
                                        dyn.style.backgroundColor = '#E0E0E0';
                                }
                        }
                        //this.working = true;
                        this.http.send(null);
                }
        } else {
		dyn.innerHTML = '';
		dyn.style.border = "#fff 1px";
		dyn.style.backgroundColor = '#fff';
	}
}

