var Scroll = {
	obj: null,
	layer1: null,
	layer2: null,
	width: 0,
	left: 0,
	start: function(el, width, height) {
		if (!el)
			return;
		this.obj = el;

//		this.width = width;
		for (var i=0; i<this.obj.childNodes.length; i++) {
			if (!this.obj.childNodes[i].tagName)
				continue;
			if (this.obj.childNodes[i].tagName.toLowerCase()=="a") {
				for (var j=0; j<this.obj.childNodes[i].childNodes.length; j++) {
					if (!this.obj.childNodes[i].childNodes[j].tagName)
						continue;
					if (this.obj.childNodes[i].childNodes[j].tagName.toLowerCase()!="img")
						continue;
					this.width += this.obj.childNodes[i].childNodes[j].clientWidth;
				}
			}
		}
		this.obj.style.width = width+"px";
		this.obj.style.height = height+"px";
		this.obj.style.overflow = "hidden";
		
		var x = this.obj.innerHTML;

		this.layer1 = document.createElement("div");
		this.layer1.style.position = "absolute";
		this.layer1.style.left = "0px";
		this.layer1.style.top = "0px";
		this.layer1.style.width = this.width+"px";
		this.layer1.style.whiteSpace = "nowrap";
		this.layer1.innerHTML = x;
		
		this.layer2 = document.createElement("div");
		this.layer2.style.position = "absolute";
		this.layer2.style.left = this.width+"px";
		this.layer2.style.top = "0px";
		this.layer2.style.width = this.width+"px";
		this.layer2.style.whiteSpace = "nowrap";
		this.layer2.innerHTML = x;
		
		MydropAllElements(this.obj);
		this.obj.appendChild(this.layer1);
		this.obj.appendChild(this.layer2);		
		
		setInterval(function() { Scroll.update(); }, 25);
	},
	update: function() {
		this.left --;
		if (this.left<=-1*this.width)
			this.left = 0;
		this.layer1.style.left = this.left+"px";
		this.layer2.style.left = this.width+this.left+"px";
	}
}