That is a freeware script of exactly what you want, use it as a reference to see what needs to be done, I couldn't really find a better resource for you, sorry.
I did this ajax whois myself! take a look: http://hostinstall.com/work/whois4.php (its not public now, but you can use it)
just type your domain name and it gives you the result in the same page(ajax doesn't work in IE6)
you can go and download some php whois scripts(they are free on the net) and look at the codes! its easy