// JavaScript Document

function setOpacity(obj, opacity) {
	opacity = (opacity == 100) ? 99.999 : opacity;
  
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
  
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
  
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
  
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

function getCurrentStyle(obj, prop) {

	if (document.defaultView && document.defaultView.getComputedStyle && document.body) {
		var computedStyle = document.defaultView.getComputedStyle(obj, null);
		return computedStyle.getPropertyValue(prop);
	}
	else if (obj && obj.currentStyle) {
		return obj.currentStyle.backgroundColor;
	}
}

function findOpaqueImgClass(classname) {
	var alltags = document.all ? document.all : document.getElementsByTagName("img");

	for (i=0; i<alltags.length; i++) {
		if (alltags[i].className == classname) {
			//alert(getCurrentStyle(alltags[i].parentNode, 'background-color'));
			if ((getCurrentStyle(alltags[i].parentNode, 'background-color') == "#eee") || (getCurrentStyle(alltags[i].parentNode, 'background-color') == 'rgb(238, 238, 238)')) {	
				setOpacity(alltags[i], 30)
			}
		}
	}
}