function Fadable(id, msec, fps) {
//
// Members
//
	this.objRef = document.getElementById(id);
	if(!this.objRef)
		return null;
	this.id = "g";
	var arr = id.split("_");
	for(i = 0; i < arr.length; i++)
		this.id += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
	this.styleRef = this.objRef.style;
	//this.styleProp = this.chooseProperty;
	if(this.styleRef.opacity != undefined)
		this.styleProp = "opacity";
	else if(this.styleRef.MozOpacity != undefined)
		this.styleProp = "MozOpacity";
	else if(this.styleRef.KhtmlOpacity != undefined)
		this.styleProp = "KhtmlOpacity";
	else if(this.styleRef.filter != undefined)
		this.styleProp = "filter";
	else {
		this.id = undefined;
		this.styleRef = undefined;
		return this;
	}
	this.delay = (1000 / fps || 25);	// 25 mspf == 40fps
	this.maxTime = (msec || 500);
	this.invFrame = this.delay / this.maxTime;
	//this.DEBUG = document.getElementById("debug");
//
// Methods
//
	/*this.chooseProperty = function() {
		var s = this.styleRef;
		if(s.opacity != undefined)
			return "opacity";
		else if(s.MozOpacity != undefined)
			return "MozOpacity";
		else if(s.KhtmlOpacity != undefined)
			return "KhtmlOpacity";
		else if(s.filter != undefined)
			return "filter";
		return false;
	}*/
	this.fade = function(start, stop) {
		var step = (stop - start) * this.invFrame;
		var opacity = start + step;
		var time = 0;

		while(time < this.maxTime) {
			if(opacity > 100 || opacity < 0)
				break;
			setTimeout(this.id + ".setOpacity(" + opacity + ")", time);
			opacity += step;
			time += this.delay;
		}
	}
	this.setOpacity = function(alpha) {
		if(this.styleProp != "filter")
			this.styleRef[this.styleProp] = alpha / 100;
		else {
			if(alpha == 100)
				this.styleRef.filter = "";
			else
				this.styleRef.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + alpha + ")";
		}
		(alpha == 0) ? this.styleRef.visibility = "hidden" : this.styleRef.visibility = "visible";
	}
}