var Fx = {
	
	speed : 60,
	position : 0,
	element: null,
	timer: null,
	
	fadeIn : function(id) {
		this.element = id;
		this.position = 0;
		this.timer = setInterval("Fx.stepIn();", this.speed);
	},
	
	stepIn : function() {
		this.set( this.position );
		this.position++;
		if( this.element.style.display == "none" ) this.element.style.display = "block";
		if( this.position > 9 ) {
			clearInterval(this.timer);
		}	
	},
	
	fadeOut : function(el) {
		if( !this.el(id) ) return;
		this.element = this.el(id);
		this.position = 9;
		this.timer = setInterval("Fx.stepOut();", this.speed);
	},
	
	stepOut : function() {
		this.set( this.position );
		this.position--;
		if( this.element.style.display == "none" ) this.element.style.display = "block";
		if( this.position < 1 ) {
			clearInterval(this.timer);
			this.element.style.display = "none";
		}	
	},
	
	set : function(v) {
		var value = ( v > 9 ) ? "1.0" : "0." + v ;
		if (window.ActiveXObject) {
			this.element.style.filter = "alpha(opacity=" + ( value * 100 ) + ")";
		}
		this.element.style.opacity = value;
	}
}
