// #require mootools.js ver. >=1.2.0
Element.Properties.opacity.set = function (opacity, novisibility) {
	if (!novisibility){
		if (opacity == 0) {
			if (this.style.visibility != 'hidden') this.style.visibility = 'hidden';
		} else {
			if (this.style.visibility != 'visible') this.style.visibility = 'visible';
		}
	}
	if (!this.currentStyle || !this.currentStyle.hasLayout) this.style.zoom = 1;
	if (Browser.Engine.trident) {
		if (opacity == 1) {
			this.style.filter = this.style.filter.replace(/alpha\(opacity=[0-9\.]+\)/, '').clean();
		} else {
			try {
				if (this.filters && this.filters['alpha']) {
					this.filters['alpha'].opacity = opacity * 100;
				} else {
					this.style.filter = (this.style.filter + ' alpha(opacity=' + opacity * 100 + ')').clean();
				}
			} catch (ex) {
				// When this element is not injected inside DOM.
				this.style.filter = (this.style.filter + ' alpha(opacity=' + opacity * 100 + ')').clean();
			}
		}
	}
	this.style.opacity = opacity;
	this.store('opacity', opacity);

};
