Layer 1 Layer 2 Layer 3 Layer 4
<script type="text/javascript">
var lastID="yourID_One"
function swapLayer(id){
if(id!=lastID){
document.getElementById(id).style.display="block"
if(lastID!=""){
document.getElementById(lastID).style.display="none"
}
}
lastID=id
}
</script>
<DIV style="position:absolute; left:270; top:115; width:350px; height:260px">
<div id="yourID_One" style="display:block">Layer 1 Contents</div>
<div id="yourID_Two" style="display:none">Layer 2 Contents</div>
<div id="yourID_Three" style="display:none">Layer 3 Contents</div>
<div id="yourID_Four" style="display:none">Layer 4 Contents</div>
</DIV>
<a href="#null" onclick="swapLayer('yourID_One')">Layer 1</a>
<a href="#null" onclick="swapLayer('yourID_Two')">Layer 2</a>
<a href="#null" onclick="swapLayer('yourID_Three')">Layer 3</a>
<a href="#null" onclick="swapLayer('yourID_Four')">Layer 4</a>
Show Green Show Yellow
Show Red Show Blue
<script type="text/javascript">
function swapLyr(num) {
idCount=0
while(document.getElementById("mydiv"+idCount)){
el=document.getElementById("mydiv"+idCount)
if(idCount != num){
el.style.display="none"
}
else{
el.style.display="block"
}
idCount++
}
}
</script>
<a href="#null" onclick="swapLyr(0)">Show Green</a> <a href="#null" onclick="swapLyr(1)">Show Yellow</a>
<a href="#null" onclick="swapLyr(2)">Show Red</a> <a href="#null" onclick="swapLyr(3)">Show Blue</a>
<div id="mydiv0" style="display:none;background-color:#00AA00;width:350px; height:260px">Green</div>
<div id="mydiv1" style="display:none;background-color:#AAAA00;width:350px; height:260px">Yellow</div>
<div id="mydiv2" style="display:none;background-color:#AA0000;width:350px; height:260px">Red</div>
<div id="mydiv3" style="display:none;background-color:#0000AA;width:350px; height:260px">Blue</div>