En fortsättning:
<script type="text/javascript">
var divs = ["div_1", "div_2"];
var checked = new Object;
function mclick(id){
for(var i=0; i<divs.length; i++){
if(divs[i]!=id){
checked[divs[i]] = false;
document.getElementById(divs[i]).style.background ="#FFFFFF";
}
}
checked[id] = !checked[id];
if(checked[id])
document.getElementById(id).style.background = '#999999';
else
document.getElementById(id).style.background = '#CCCCCC';
}
function mover(id){
if(!checked[id])
document.getElementById(id).style.background = '#CCCCCC';
}
function mout(id){
if(!checked[id])
document.getElementById(id).style.background = '#FFFFFF';
}
</script>
...
<div id="div_1" onclick="mclick(this.id)" onmouseover="mover(this.id)" onmouseout="mout(this.id)">>Ett</div>
<div id="div_2" onclick="mclick(this.id)" onmouseover="mover(this.id)" onmouseout="mout(this.id)">>Två</div>

