<div id="Layer1" style="position:absolute;
left:186px;
top:96px;
width:376px;
height:295px;
background-color: #CCCCCC;"></div>
<div id="Layer2" style="position:absolute;
left:294px;
top:34px;
width:407px;
height:315px;
background-color: #0066FF;"></div>
<a href="#" onClick="changes('Layer1')">链接1</a> <a href="#" onClick="changes('Layer2')">链接1</a>
<script type="text/javascript">
var es = 1;
function changes(ts){
var obj = document.getElementById(ts);
obj.style.zIndex = es;
es++ ;
}
</script>