First of all, stop using <strong> and use a span:
Code:
<div id="div2" style="position: absolute; top: 0px; left: 200px;">
<img id="img1" src="../Pictures/RM/roster/2 Alvaro.jpg" alt="alvaro"
style="border-width: 3px; border-color: red;
border-style: solid; height: 180px; width: 140px;"
onmouseover="into(this)"
onmouseout="out(this)">
<br/>
<span style="font-weight: bold;">Alvaro Arbeloa</span>
<br/>
</div>
And then I *think* this is what you are after:
Code:
function into( targetImg )
{
targetImg.style.borderStyle = "double";
targetImg.style.borderTopColor = "blue";
targetImg.style.borderBottomColor = "red";
targetImg.style.borderLeftColor = "yellow";
targetImg.style.borderRightColor = "green";
targetImg.style.borderWidth = "8px";
targetDivNum = parseInt( targetImg.id.substring(3) ); // assumes "img3", "img17", etc.
targetDiv = document.getElementById("div"+targetDivNum);
targetSpan = targetDiv.getElementsByTagName("span")[0];
targetSpan.style.visibility = "hidden";
// now change opacities:
for ( divnum = 1; divnum < 999999999; ++divnum )
{
var div = document.getElementById("div" + divnum);
if ( div == null ) break; // quit when we don't find the div by id
div.style.opacity = ( div == targetDiv ) ? 1.0 : 0.1;
}
document.body.style.backgroundImage = bgImage[targetDivNum];
}
Is that what you mean????