grazie mille questo è tutto il codice

<script>
// Create the XML HTTP request object. We try to be
// more cross-browser as possible.
function CreateXmlHttpReq(handler) {
var agt = navigator.userAgent.toLowerCase();
var is_ie5 = (agt.indexOf('msie 5') != -1);
var xmlhttp = null;
try {
xmlhttp = new XMLHttpRequest();
try {
// Fix for some version of Mozilla browser.
http_request.overrideMimeType('text/xml');
} catch(e) { }
xmlhttp.onload = handler;
xmlhttp.onerror = handler;
} catch(e) {
var control = (is_ie5) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP";
xmlhttp = new ActiveXObject(control);
xmlhttp.onreadystatechange = handler;
}
return xmlhttp;
}

var lastid;

function myHandler() {
if (myRequest.readyState == 4 && myRequest.status == 200) {
var e = document.getElementById(lastid + "last");
e.innerHTML = myRequest.responseText;
e.style.color= "red";
e.style.background= "#FFFF00";
}

}

function controllo(id) {
var e = document.getElementById(id);
myRequest = CreateXmlHttpReq(myHandler);
myRequest.open("GET","registrato.php?controllo=" + e.value + "&campo=" + id );
myRequest.send(null);
lastid= id;
}
</script>

<body>

<table width="462" border="0">
<tr>
<td width="168">


Login </td>

<td width="176"><input name="Login" type="text" id="login" onblur="controllo(id);" /></td>
<td width="104"><div id="loginlast"> convalida nome </div>