<script language="JavaScript"> function setVisibility(id1,id2) { if(document.getElementById('bt1').value=='Hide Layer'){ document.getElementById('bt1').value = 'Show Layer'; document.getElementById(id1).style.display = 'none'; document.getElementById(id2).style.display = 'none'; }else{ document.getElementById('bt1').value = 'Hide Layer'; document.getElementById(id1).style.display = 'inline'; document.getElementById(id2).style.display = 'inline'; } } </script>
<input type=button name=type id='bt1' value='Show Layer' onclick="setVisibility('sub3','sub4');";> <div id="sub3">Message Box 3</div> <br><br><br> <div id="sub4">Message Box 4</div>
<style type="text/css"> #sub3,#sub4 { position: relative; left: 250px; top: 50px; background-color: #f1f1f1; width: 280px; padding: 10px; color: black; border: #0000cc 2px dashed; display: none; } </style>