[Solved] Help with turning this VBscript to Javascript?

Okay everyone I have an issue that I am trying to work on i need to turn this code

onclick='frames(0).document.frames(0).document.forms(0).prc.value="S": frames(0).document.frames(0).document.forms(0).submit:tabs.tid.value="2":tabs.submit'

into javascript i can't seem to figure how how to get down into the frames using javascript any help would be appreciated.

This is to change the page inside an iframe(holds the nav buttons) inside an iframe(holding location of content) inside an iframe (src webpage).

prc and tid are hidden fields on the pages.

btw I didnt make this site i just need to update it.

or if you know how you access nested frames that should be able to point me in the direction i need.

edit i figured it out its

window.frames[0].frames[0].formName.hiddenFieldName.value="value";