getElementsByClassName - for multiple classes (e.g class="foo bar")

that just makes the whole page fade :frowning:
(although it DOES work in IE! haha)

right THIS works in FF, but not IE, and this is closer to what i need to happen. that on hover, all elements with a class defined on the <li> we are hovering over become fully visible:

<script language=“Javascript”>
function hasClass(el, cl) {
class = cl.toLowerCase()
var classNames = el.className.toLowerCase();
classNames = classNames.split(" “);
for (var i = 0; i < classNames.length; i++) {
if (class == classNames[i]) return true;
}
return false;
}
function fade(cl, fadeIn) {
var els = document.getElementsByTagName(”*");
for (var i = 0; i < els.length; i++) {
if (hasClass(els[i], cl)) {
els[i].style.opacity = fadeIn ? ‘1.0’ : ‘0.5’;
}
}
}
</script>

ideally what i actually need now, is:

by default: opacity = 0.5
on hover: opacity = 1
on hover of ANOTHER div class, previous element becomes 0.5, new element becomes 1.
on click: opacity =1 and stays 1, until you hover over the next div.

does that make sense?