Ладно, в итоге получилось привинтить визибилити, но код очень громоздкий, можно ли его как-нибудь укомпактить?
<script type="text/javascript">
function find_c1() {
var f1 = document.getElementById('layer').getElementsByClassName('c1')
for (var i=0; i<f1.length; i++)
f1[i].style.visibility = "hidden";
var f2 = document.getElementById('layer').getElementsByClassName('c2')
for (var i=0; i<f2.length; i++)
f2[i].style.visibility = "visible";
var f3 = document.getElementById('layer').getElementsByClassName('c3')
for (var i=0; i<f3.length; i++)
f3[i].style.visibility = "visible";
var f4 = document.getElementById('layer').getElementsByClassName('c4')
for (var i=0; i<f4.length; i++)
f4[i].style.visibility = "visible";
}
function find_c2() {
var f1 = document.getElementById('layer').getElementsByClassName('c1')
for (var i=0; i<f1.length; i++)
f1[i].style.visibility = "visible";
var f2 = document.getElementById('layer').getElementsByClassName('c2')
for (var i=0; i<f2.length; i++)
f2[i].style.visibility = "hidden";
var f3 = document.getElementById('layer').getElementsByClassName('c3')
for (var i=0; i<f3.length; i++)
f3[i].style.visibility = "visible";
var f4 = document.getElementById('layer').getElementsByClassName('c4')
for (var i=0; i<f4.length; i++)
f4[i].style.visibility = "visible";
}
function find_c3() {
var f1 = document.getElementById('layer').getElementsByClassName('c1')
for (var i=0; i<f1.length; i++)
f1[i].style.visibility = "visible";
var f2 = document.getElementById('layer').getElementsByClassName('c2')
for (var i=0; i<f2.length; i++)
f2[i].style.visibility = "visible";
var f3 = document.getElementById('layer').getElementsByClassName('c3')
for (var i=0; i<f3.length; i++)
f3[i].style.visibility = "hidden";
var f4 = document.getElementById('layer').getElementsByClassName('c4')
for (var i=0; i<f4.length; i++)
f4[i].style.visibility = "visible";
}
function find_c4() {
var f1 = document.getElementById('layer').getElementsByClassName('c1')
for (var i=0; i<f1.length; i++)
f1[i].style.visibility = "visible";
var f2 = document.getElementById('layer').getElementsByClassName('c2')
for (var i=0; i<f2.length; i++)
f2[i].style.visibility = "visible";
var f3 = document.getElementById('layer').getElementsByClassName('c3')
for (var i=0; i<f3.length; i++)
f3[i].style.visibility = "visible";
var f4 = document.getElementById('layer').getElementsByClassName('c4')
for (var i=0; i<f4.length; i++)
f4[i].style.visibility = "hidden";
}
</script>