JS refresh from greybox

I have my login form set to load with greybox. I then have a thanks for logging in page as the landing page once logged in. I need a script for the thanks page that will wait say three seconds then refresh the parent page, removing the greybox and reloading the main page to a logged in status.

How would I write this?

The problem I am having is that greybox is an iframe within the page so trying to select the document at it’s root doesn’t seem to be working. I need to refresh the parent page as the greybox is like a child page if that makes sense…?

I have this so far but not sure what this is doing. One thing I know is that it is not working.

<script language=" JavaScript" ><!–
function MyReload()
{
window.parent.document.reload(3000);
return false;
}
//–></script>

</head>
<body onload=“MyReload()”>

Any idea why this doesn’t work.

<script language=" JavaScript" ><!–
function MyReload()
{
window.top.reload();

}
//–></script>

</head>
<body onload=“MyReload()”>