Usually this is done with a named anchor tag:
<a name="focusHere"></a>
Then you link to the url that is on with the additional anchor name information:
<a href="mypage.aspx#focusHere">Click me</a>
If you want to do this with the javascript, you would typically put the javascript in the page's body tag onLoad handler do it fires after the page is loaded.
-Peter
compiledthoughts.com