firstly if you are going to do lots of js, use a library (i use jquery)
next
i normally use stylesheets to help me out
i have given you a start here
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>tabs</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="no password">
<!-- Date: 2009-04-21 -->
<style type="text/css" media="screen">
.show {
display:block;
}
.hide{
display:none;
}
</style>
</head>
<body>
<a href="#" onclick="testme();return false;">1st Div</a>
<a href="#">2nd Div</a>
<a href="#">3rd Div</a>
<div id="topdiv1" class="hide">1st Div</div>
<div id="topdiv2" class="hide">2nd Div</div>
<div id="topdiv3" class="hide">3rd Div</div>
<script type="text/javascript" charset="utf-8">
var mydivs = document.getElementsByTagName('div');
var divlen = mydivs.length;
alert(divlen);
function testme(){
for (var i=0;i<divlen;i++) {
mydivs[i].className ='show';
}
}
</script>
</body>
</html>
by the way in my example above script goes at bottom of page