I've got some javascript code that applies an alpha transparency. Before it does that it attempts to detect what type of transparency the browser supports and stores that in a variable for use later. Here's what the code looks like:
// figure out the browser support for opacity
if (typeof br.backImg.style.opacity != 'undefined')
opacityType = 'opacity';
else if (typeof br.backImg.filters == 'object')
opacityType = 'filter';
else
opacityType = 'none';
For Firefox and Safari, the first condition is true, for IE7 the second condition is true, but for IE6 it falls to the last condition. Why would IE6 not have a filters object? Is there a better way of detecting this?