<script type="text/javascript">//<!--
window.onload=(function(){
function $(a){return document.getElementById(a);}
ID=['d1','d2','d3','d4'];
for(k in ID){$(a=ID[k]).onclick=(function(){for(k in ID){(a=$(ID[k]))!=this?a.style.display='none':'';}});}
});//-->
</script>
<div id="d1">click1</div><div id="d2">click2</div><div id="d3">click3</div><div id="d4">click4</div>