You can see my problem on with IE7

For some reason when you click "Go" on IE7 for to go to the actual address, the page loads perfectly.

Yet, when I fresh only the background is shown.

It started happening after I put in this code:
<script language="javascript" type="text/javascript">
function lgo(x)
	if (x == 1) var y = '<form action="index.php" method="post">Username:<input class="input1" name="username" type="text" /> Password:<input class="input1" name="password" type="password" /> <input value="Login" name="login" type="submit" /> <a href="javascript:lgo(2);">back &gt;</a></form>';
	if (x == 2) var y = '<a href="javascript: lgo(1);">Sign In</a> | <a href="recovery.php">Forget your password?</a> | <a href="register.php">Register</a>';
	z = document.getElementById("lgon");
	z.innerHTML = y;
This script is NOT run automatically... only when the user clicks a link.
I did this to simplify the page a little. When the page first loads, if the user isn't logged in, a link to log in is displayed. When the user clicks on "sign in", this javascript is triggered and a form to signin is showed.

I really don't get why refreshing is messing up the page. Where I put that javascript doesn't matter. If I take out the script, the page loads fine. In Firefox it works perfectly.

I even tried saving the source of the blank page to a local HTML file. It displayed fine (though IE warned me of an ActiveX control trying to run).

This is driving me nuts!