wait whilst loading a web page

Hi

I would like a script to wait while a web page is being loaded. The time this takes can vary by quite a bit so my old chestnut “with timeout 200” etc tends to fail quite a bit.
I can’t find anything in the safari library which I can use ie

repeat while loading loaction x
end repeat

Any help?
Thanks

Use javascript:

http://www.apple.com/applescript/safari/jscript.01.html

gl,

Or see this thread: http://bbs.applescript.net/viewtopic.php?pid=69846#p69846