Hi all, I am using this script to hide and show divs on my webpage, but I can only get it to work with 3 divs, Im not really sure what to change to get it to work for 14 divs, I have had a go already but the 4 div onwards dont turn off when other links are clicked.

this is what I have so far: http://www.design-direction.net/portfolio/index.html
the 4th and 5th thumbs are the problem



I have this in my head section:

<script type="text/javascript">
function clearcontent() {
if (document.getElementById)
{
var style2 = document.getElementById("w1").style;
style2.display = "block";
var style3 = document.getElementById("w2").style;
style3.display = "none";
var style3 = document.getElementById("w3").style;
style3.display = "none";
var style3 = document.getElementById("w4").style;
style3.display = "none";
var style3 = document.getElementById("w5").style;
style3.display = "none";
var style3 = document.getElementById("w6").style;
style3.display = "none";
var style3 = document.getElementById("w7").style;
style3.display = "none";
var style3 = document.getElementById("w8").style;
style3.display = "none";
var style3 = document.getElementById("w9").style;
style3.display = "none";
var style3 = document.getElementById("w10").style;
style3.display = "none";
var style3 = document.getElementById("w11").style;
style3.display = "none";
var style3 = document.getElementById("w12").style;
style3.display = "none";
var style3 = document.getElementById("w13").style;
style3.display = "none";
var style3 = document.getElementById("w14").style;
style3.display = "none";
}
}
window.onload=clearcontent;

function toggleLayer(whichLayer,turnoff1,turnoff2)
{
if (document.getElementById)
{
// this is the way the standards work
var turnon = document.getElementById(whichLayer).style;
var turnoff1 = document.getElementById(turnoff1).style;
var turnoff2 = document.getElementById(turnoff2).style;
turnon.display = "block";
turnoff1.display = "none";
turnoff2.display = "none";
}
}
</script>




and I have this on each flash button that control if a div is vissable:

thumb1 -


on (release) {
getURL("javascript:toggleLayer('w1','w2','w3','w4','w5','w6','w7','w8','w9','w10','w11','w12','w13','w14');");
}


thumb2 -

on (release) {
getURL("javascript:toggleLayer('w2','w1','w3','w4','w5','w6','w7','w8','w9','w10','w11','w12','w13','w14');");
}


thumb3 -

on (release) {

getURL("javascript:toggleLayer('w3','w2','w1','w4','w5','w6','w7','w8','w9','w10','w11','w12','w13','w14');");
}




and so on



please can anyone help my figure out how to get this to work on more than 3 divs...thanks...jon