Because Asynch means it goes off and does things and does not wait. That is how it works.
It calls the function and keeps on chugging away. If the other one is supposed to hapen after the request, than you need to call it from your onreadystatechange functionality. When you do that, you can not use document.write.
Eric [ December 07, 2007: Message edited by: Eric Pascarello ]