link to the document that has the frameset and on the linked url include something to identify which page should be displayed on the frames, for example
<a href="frameset.htm?framethisa.htm">go to document a.htm</a>
parsing the location of the link we'll set the a.htm inside the frame. This script should be included on the main frameset to be run each time the frameset is loaded, just in case it was accessed by an external link
<script type="text/javascript">
function redirectt(){
x=window.location;
x=String(x);
y=x.search(/framethis/);
if(y>0){
x=x.substring(y+9);
window.open(x, "frameName")
};
}
<frameset rows="200px,400px" onload="redirectt();">
Finally, just notice that on this case I use on the link the "framethis" clue, and that's why we added 9 to the y, you can modify this.