title: Redirect out of frame page to specific frame in index.htm
body: <p>I am using frames on index.html file. On every page of  the frame I have a code which checks if page is in frame, and if not, then redirect to index.html.</p>
  
  <p>Now. I want to not only check if page is in frame and redirect to index.html, but also I want to open the page in one of the frames on index.html.</p>
  
  <p>I have embedded the JS file with this code as of right now:</p>
  
  <pre><code>if (top.location == self.location)
  {
      top.location = 'index.html'
  } 
  </code></pre>
  
  <p>Is there any scripts you might know of?</p>