<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Slawaq" />
<title>Неназванный 1</title>
</head>
<style>
#dv1,#dv2,#dv3{width:50px;margin:20px;height:20px;float:left}
#d1,#d2,#d3{width:30px;height:10px;float:none}
</style>
<body>
<div id="dv1"><a href="#" onclick="showDv('1')">link1</a><div style="background: aqua;display:block;" id="d1"></div><div>1</div></div>
<div id="dv2"><a href="#" onclick="showDv('2')">link2</a><div style="background: red;display:none;" id="d2"></div><div>2</div></div>
<div id="dv3"><a href="#" onclick="showDv('3')">link3</a><div style="background: blue;display: none;" id="d3"></div><div>3</div></div>
<script type="text/javascript">
allDiv=3;
function showDv(n){
for(i=1;allDiv+1>i;i++){
document.getElementById('d'+i).style.display = 'none';
}
document.getElementById('d'+n).style.display = 'block';
}
</script>
</body>
</html>