How do you call a function from another frame?

How do you call a function from another frame?

This seems straightforward, but I can't talk Google into telling me the answer. What's the jquery equivalent of this:
top.frames['MainFrame'].DoSomething()

I tried $(document,window.top.MainFrame.document).DoSomething() since similar syntax works for referencing elements, but no such luck with a function.