]<script>
function getBg(element)
{//author: Longbill (www.longbill.cn)
if (typeof element == "string") element = document.getElementById(element);
if (!element) return;
cssProperty = "backgroundColor";
mozillaEquivalentCSS = "background-color";
if (element.currentStyle)
var actualColor = element.currentStyle[cssProperty];
else
{
var cs = document.defaultView.getComputedStyle(element, null);
var actualColor = cs.getPropertyValue(mozillaEquivalentCSS);
}
if (actualColor == "transparent" && element.parentNode)
return arguments.callee(element.parentNode);
if (actualColor == null)
return "#ffffff";
else
return actualColor;
}
function go()
{
for(var i=1;i<=4;i++) eval("alert('div"+i+":'+getBg('div"+i+"'));");
}
</script>