Get highest frame that still is on domain
<p>I have a session function that works well on the same domain, but when it is used through our api on another site, it doesn't work because we are setting and calling from top frame (top.functionName, top.variable).  What I am looking for is a way to set variables and call functions from the highest frame that still remains on the domain.  For example, top frame might be externaldomain.com, frame within that might be ourdomain.com and frame within that might be ourdomain.com/somepage and so on.  How would we loop through the frames to get the closest to the top that is still on the same domain?</p>

<p>Thanks,  </p>
