

function initTransparency() {
	$$('div').each(function(el) {
		el.classNames().each(function(name, index) {
			if(name.indexOf('opacity')!=-1) {
				var opacity = name.substring(7)/100;
				var backgroundColor = Element.getStyle(el,'background-color');
				var elBackground = new Element('div');
				Element.setStyle(el, {'background':'transparent'});
				Element.setStyle(elBackground, {'background':backgroundColor});
				Element.setOpacity(elBackground, opacity);
				Element.insert(el, {before: elBackground});
				Element.absolutize(el);
				Element.absolutize(elBackground);
				Element.clonePosition(elBackground, el);
			}
		});
	});
	$$('span').each(function(el) {
		el.classNames().each(function(name, index) {
			if(name.indexOf('opacity')!=-1) {
				var opacity = name.substring(7)/100;
				var backgroundColor = Element.getStyle(el,'background-color');
				var elBackground = new Element('div');
				Element.setStyle(el, {'background':'transparent'});
				Element.setStyle(elBackground, {'background':backgroundColor});
				Element.setOpacity(elBackground, opacity);
				Element.insert(el, {before: elBackground});
				Element.absolutize(el);
				Element.absolutize(elBackground);
				Element.clonePosition(elBackground, el);
			}
		});
	});
}
Event.observe(window, 'load', initTransparency, false);


