a) You're referring to "javascript", not "java" (different languages, purposes, and development interests)
b) Here ya go:
<body onload="top.menu.location='menu.php'">
Where (1) "top" refers to the top-level window (the primary browser) and (2) "menu" refers to the sub-frame of the top-level window named "menu".
This will load "menu.php" into the frame "menu" when the calling document loads.
Note that this is not code that goes into the frameset document, but rather into a document that is loading into one of the frames created by the frameset document.
If you want to use the "onload" event in the frameset document, use it as an attribute in one of your <frame> tags, like:
<frame name="banr" src="ad.php" onload="...">
(There is no <body> in a frameset document, except in the <noframes> section.)
Have fun! And check out: http://www.dannyg.com/javascript/quickref/index.html for a handy "document object model" reference and more valuable JavaScript info from one of the main JS gurus.