BlendTransition = function() {
	var ObjId;
	var opacStart;
	var opacEnd;
	var milliSec;
	
	this.ObjId = null;
	this.opacStart = 100;
	this.opacEnd = 0;
	this.milliSec = 300;
	
	this.onCompletion = function() { };
}

BlendTransition.prototype = {
	opacity : function() {
		if (this.ObjId) {
			try {
				this.ObjId = (!jsGetObject(this.ObjId)) ? this.ObjId : jsGetObject(this.ObjId);
				if (this.ObjId.id == "") {
					jsShowErrors("BlendTransition:opacity", "El Objeto debe tener un Id para identificarlo.");
					return false;
				}
				
				var speed = Math.round(this.milliSec / 100);
				var timer = 0;
				
				window.refToThisBlendTrans = this;
				
				if(this.opacStart > this.opacEnd) {
					for(i = this.opacStart; i >= this.opacEnd; i--) {
						setTimeout("window.refToThisBlendTrans.changeOpac(" + i + ")",(timer * speed));
						timer++;
					}
				} else if(this.opacStart < this.opacEnd) {
					for(i = this.opacStart; i <= this.opacEnd; i++) {
						setTimeout("window.refToThisBlendTrans.changeOpac(" + i + ")",(timer * speed));
						timer++;
					}
				}
			} catch(err) {
				jsShowErrors("BlendTransition:opacity", err);
			}
		}
	}
	,
	changeOpac : function(opacity) {
		this.ObjId.style.opacity = (opacity / 100);
		this.ObjId.style.MozOpacity = (opacity / 100);
		this.ObjId.style.KhtmlOpacity = (opacity / 100);
		this.ObjId.style.filter = "alpha(opacity=" + opacity + ")";
		if (opacity <= 0) {
			this.onCompletion();
		}
	}
}