А если несколько блоков? Надо через switch?
function doBlock(id) {
switch (id) {
case first:
{
document.getElementById(id).style.display = "block";
document.getElementById('second').style.display = "none";
document.getElementById('third').style.display = "none";
document.getElementById('fourth').style.display = "none";
}
case second:
{
document.getElementById(id).style.display = "block";
document.getElementById('first').style.display = "none";
document.getElementById('third').style.display = "none";
document.getElementById('fourth').style.display = "none";
}
case third:
{
document.getElementById(id).style.display = "block";
document.getElementById('first').style.display = "none";
document.getElementById('second').style.display = "none";
document.getElementById('fourth').style.display = "none";
}
case third:
{
document.getElementById(id).style.display = "block";
document.getElementById('first').style.display = "none";
document.getElementById('second').style.display = "none";
document.getElementById('fourth').style.display = "none";
}
}
}