@dani: He isn't using the display attribute, he is using the visibility attribute of style which does contain hidden and visible.
@paulchwd: I am not sure what is wrong, but from the looks of it, it is exactly what I did below and it works for me.
http://www.kylekonline.com/test/visible.html <= if you want to see it working.
<html>
<head>
<title>Test Javascript</title>
<script type="text/javascript" language="javascript">
function showFirst()
{
var xx;
xx = document.getElementById('xx');
xx.style.visibility = 'visible';
}
function hideFirst()
{
var xx;
xx = document.getElementById('xx');
xx.style.visibility = 'hidden';
}
function showSecond()
{
var yy;
yy = document.getElementById('yy');
yy.style.display = 'block';
}
function hideSecond()
{
var yy;
yy = document.getElementById('yy');
yy.style.display = 'none';
}
</script>
</head>
<body>
<a href="javascript:;" onClick="showFirst()">Show First Div</a><br />
<a href="javascript:;" onClick="hideFirst()">Hide First Div</a><br />
<div id="xx">This is the first div called xx</div>
<br /><br />
<a href="javascript:;" onClick="showSecond()">Show Second Div</a><br />
<a href="javascript:;" onClick="hideSecond()">Hide Second Div</a><br />
<div id="yy">This is the second div called yy</div>
</body>
</html>