I believe we are dealing with just one browser window, so having said that, I would do something like this:
Where ever my logout link is (This doesn't matter if the link is somewhere within the frameset), I would do something like:
<a href="logout.php" target="_top">Logout</a>
This would remove the frameset, and load the logout page into the browser.
In the logout.php page, I would destroy the session (assuming you are using sessions), and then put a redirect back to the home page using:
<?
session_start();
header("Cache-control: private"); // IE 6 Fix.
session_destroy();
header("Location: http://www.yourdomain.com/homepage.php");
?>