	
	TextScroll = Class.create();
	
	TextScroll.prototype = { 
		wrapper: false,
		content: false,
		fps: false,
		
		initialize: function(wrapper, scrollElt, fps, instanceName) {
		
			if(!$(wrapper))   { alert("Cannot find element : "+wrapper); return false; }
			if(!$(scrollElt)) { alert("Cannot find element : "+scrollElt); return false; }
			this.w = wrapper;
			this.c = scrollElt;
			
			this.wrapper = $(wrapper);
			this.content = $(scrollElt);
			this.fps     = fps;
			this.instanceName = instanceName;
			
			if(this.wrapper.style.position == 'static') {
				this.wrapper.style.position = "relative";
			}
			this.content.style.position = "absolute";
			this.content.style.bottom   = "-" + this.content.getHeight() + "px";
			
			this.startPos = -(this.content.getHeight());
			this.position = this.startPos;
			
			//this.start();
		},
		process: function() {
			try {
				if(this.position > this.wrapper.offsetHeight) {
					this.position =   (-this.content.getHeight());
				}
				else {
					this.position += 1;
				}
				this.content.style.bottom = this.position+"px";
			} catch(e) {
				alert(this);
				throw(e);
				this.pause();
			}
		},
		start: function() { 
			alert(this.instanceName); //return false;
			this.clockT = setInterval(this.instanceName+".process()", this.fps); 
		},
		pause: function()  { 
			clearInterval(this.clockT); 
		}
	}
	
	
