Could you use something like:
PHP Code:
function change_font(what){
var allSpans = document.getElementById("yr").getElementsByTagName("span");
for(i=0; i < allSpans.length; i++)
{
allSpans.item(i).style.fontSize = "30";
}
document.getElementById(what).style.fontSize = "10";
document.getElementById(what).style.fontWeight = "bold";
document.getElementById(what).style.color = "#990000";
}
PHP Code:
<div id="yr">
<span id='yr123'>text</span>
<span id='yr1234'>text</span>
<span id='yr46545'>text</span>
<span id='yr897822'>text</span>
</div>
This will reset the styles of all spans, and then set the one chosen....or did I misunderstand what you're trying to do?