As far as I know, you can't call a javascript function with php.
You could write a javascript that triggers on pageload or when the dom is ready.
I know prototype has a way to do this. You can observe if the page is loaded and then use "fire" to start an event. Php could echo this piece of javascript in your page.
Bookmarks