<script>
var active;
var color = {
'#one': '#66FF66',
'#two': '#FFCC00',
'#three': '#FFFF00'
};
window.onload = function () {
var tabs = document.querySelector('div.tabs');
var custom = document.getElementById('custom');
tabs.onclick = function (e) {
var el = e ? e.target : window.event.srcElement;
if (el.tagName != "A") return;
active && (active.style.backgroundColor = '');
el.style.backgroundColor = color[el.hash];
custom.style.backgroundColor = color[el.hash];
active = el;
}
}
</script>
<body>
<div class="menu">
<div class="tabs">
<a href="#one">Дом</a>
<a href="#two">Дом</a>
<a href="#three">Дом</a>
</div>
<div id="custom">Другой блок</div>
</div>
</body>