	function ticker(id, timeOut, bgColor, textColor, clipWidth, clipHeight, imgWidth, target){
		this.id			= id;
		this.timeout 	= timeOut;
		this.bgColor	= bgColor;
		this.textColor	= textColor;
		this.clipWidth	= clipWidth;
		this.clipHeight	= clipHeight;
		this.imgWidth	= imgWidth;
		this.target		= target;
		this.active		= 0;
		this.count		= 0;
		
		this.texts		= new Array();
		this.hrefs		= new Array();
		this.images		= new Array();
		
		this.append		= fnAppend;
		this.ini		= fnIni;
		this.draw		= fnDraw;
		this.animate	= fnAnimate;
		
		return this
	}
	
	function fnAppend(text, href, image){
		this.texts[this.count] = text;
		this.hrefs[this.count] = href;
		if(image!="/getfile.aspx?id_file=0"){
			this.images[this.count] = image;
		}
		this.count++;
	}
	
	function fnDraw(){
		if(this.count>0){
			this.active ++
			if(this.active==this.count){
				this.active = 0
			};
			var oText = document.getElementById("ticker" + this.id);
			if(this.images.length==this.count){
				var oImg = document.getElementById("tickerimg" + this.id);
				oImg.src = this.images[this.active];
			}
			var	target = (this.target) ? (" target='" + this.target + "'") : "";
			
			oText.innerHTML	= "<a" + target + " href=\"" + this.hrefs[this.active] + "\" class=\"tickerhref" + this.id + "\">" + this.texts[this.active] + "</a>"
		}
		return
	}

	function fnIni(){
		if(this.count>0){
			var style = new String();
			style += "<style type=\"text/css\">\n"
			style += "div.ticker" + this.id + "{position:relative; padding:0px; margin:0px; left:-14px; top:2px; width:" + this.clipWidth + "px; height:" + this.clipHeight + "px; background-color:" + this.bgColor + "; color:" + this.textColor + ";}\n"
			style += "div.tickerimg" + this.id + "{position:absolute; padding:0px; margin:0px; top:-8px; left:"+(this.clipWidth-this.imgWidth-17)+"px; width:" + this.imgWidth + "px; height:" + this.imgHeight + "px;}\n";
			style += "div.tickerclip" + this.id + "{position:absolute; padding:0px; margin:0px; width:" + (this.clipWidth-this.imgWidth-20) + "px; height:" + this.clipHeight + "px; top:-8px; left:-20px;}\n";
			style += "div.tickertext" + this.id + "{position:absolute; padding:0px 0px 0px 0px; margin:0px; top:-8px; left:-20px; width:" + (this.clipWidth-this.imgWidth) + "px; height:" + this.clipHeight + "px;}\n";
			style += "a.tickerhref" + this.id + "{color:" + this.textColor + "; text-decoration:none;}\n";
			style += "</style>\n";
			var image = new String();
				image += (this.images.length==this.count) ? "<div class=\"tickerimg" + this.id + "\"><img align=\"right\" hspace=\"0\" vspace=\"0\" border=\"0\" alt=\"\" height=\"" + this.clipHeight + "\" width=\"" + this.imgWidth + "\" src=\"" + this.images[0] + "\" name=\"tickerimg" + this.id + "\" id=\"tickerimg" + this.id + "\"></div>" : "";
			
			var	target = (this.target) ? (" target='" + this.target + "'") : "";
			
			var href = new String();
				href += image + "<div class=\"tickerclip" + this.id + "\"><div class=\"tickertext" + this.id + "\" id=\"ticker" + this.id + "\"><a" + target + " href=\"" + this.hrefs[0] + "\" class=\"tickerhref" + this.id + "\">" + this.texts[0] + "</a></div></div>"; 
		
			var div = new String();
			div += "<div class=\"ticker" + this.id + "\">\n" + href + "\n</div>\n";
			//alert(style+div);
			document.write(style+div);
		}
	}
	
	function fnAnimate(){
		var oText	= document.getElementById("ticker" + this.id);
		var isEnd	= (oText.offsetLeft + oText.offsetWidth < 0);
		if(isEnd){
			oText.style.left = this.clipWidth-this.imgWidth;
			this.draw();
		}else{
			oText.style.left = oText.offsetLeft - 1 
		}
	}
