function Ticker(element, pathToPrefixImage, pathToSuffixImage, height, width) {
	height = height || '18px';
	
	this.parentElement = element;
	this.parentElement.style.position = 'relative';
	this.parentElement.style.overflow = 'hidden';
	this.parentElement.style.height = height;
	
	this.element = document.createElement('span');
	this.element.innerHTML = this.parentElement.innerHTML + this.parentElement.innerHTML;
	

	this.element.style.position = 'absolute';
	this.element.style.display = 'block';
	width = width || (+this.element.innerHTML.length * 10) + 'px';
	this.element.style.width = width;
	
	this.parentElement.innerHTML = '';
	this.parentElement.appendChild(this.element);
	
	
	if (pathToPrefixImage != '') {
		var prefixImage = new Image();
		prefixImage.src = pathToPrefixImage;
		prefixImage.style.position = 'absolute';
		prefixImage.style.left = '0px';
		prefixImage.style.zIndex = '2';
		this.parentElement.appendChild(prefixImage);
	}
	
	if (pathToSuffixImage != '') {
		var suffixImage = new Image();
		suffixImage.src = pathToSuffixImage;
		suffixImage.style.position = 'absolute';
		suffixImage.style.right = '0px';
		suffixImage.style.zIndex = '2';
		this.parentElement.appendChild(suffixImage);
	}
	
	
	var that = this;
	this.element.onmouseover = function() {
		that.paused = true;
	};
	this.element.onmouseout = function() {
		that.paused = false;
	};
}

Ticker.prototype =  {
	interval: 200,
	direction: 1,
	left: 0,
	paused:false,
	stepsize: 10,
	stop: function() {
		window.clearInterval(this.timer);
	},
	start: function() {
		if (this.timer) { this.stop(); }
		var that = this;
		window.setInterval(function() {
			if (that.paused) return;
			that.left += ((that.direction == 1) ? that.stepsize * -1 : that.stepsize);
			
			if (that.left + (that.element.offsetWidth/2) <= 0) {
				that.left = 0;
			}
			that.element.style.left = that.left + "px";
		},this.interval);
		
	}	
}



