// this function is called from a <img [...] onmouseover='displayPict(this);'> generated previously with innerHTML
function displayPict(me){
alert("document : "+document.getElementsByTagName('body')[0].tagName);
// returns "body"
myDisplayDiv = window.document.createElement("div");
myDisplayDiv.id="displayDiv";
myDisplayDiv.width="150px";
myDisplayDiv.height="150px";
myDisplayDiv.innerHTML="test";
window.document.getElementsByTagName("body")[0].appendChild(myDisplayDiv);
alert("my div : " + document.getElementById('displayDiv'));
// returns "null"
}