Hiding a div

ok I’m eventually gonna use this code for one of those fancy flash pop adverts we see so much of nowadays, the ones we’ve all grown to love :love:

don’t worry though this one will only pester people at my office (intranet)

Anyway heres the code

<script language="javascript">
<!--
function MM_HideTheAd(){
var theadvert;

	theadvert = document.getElementByID("thead");
	theadvert.style.display = "none";
	theadvert.style.visibility = "hidden";
}

function MM_ShowTheAd(){
var theadvert;

	theadvert = document.getElementByID("thead");
	theadvert.style.display = "block";
	theadvert.style.visibility = "visible";
}
//-->
</script>
</head>

<body onload="MM_HideTheAd">
<div id="thead" style="display:none;">
HELP YOU CAN SEE ME!!!
</div>
<br />
<a href="JavaScript:MMShowTheAd()">switch</a>
</body>
</html>

it doesn’t seem to be paying attention to the javascript code because if I remove the style=“display:none;” from the div tag then I can see the div, even though the js function is supposedly turning it off

any helps appreciated :frowning: