FadingPicSwitcher = FS.Object.extend({
	className: "FadingPicSwitcher",
	src: null,
	pendingsrc: null,
	b: {x:0,y:0,X:32,Y:32},
	zIndex:1,
	init: function() {
		arguments.callee.base.call(this);
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+";";
		this.container.style.border= "1px dashed grey";
		this.container.style.background = "#224444";
		this.primary = document.createElement('img');
		this.secondary = document.createElement('img');//secondary is the one that fades.
		var src = this.src;
		this.src = null;
		this.setSrc(src);
		this.setSRC = this.setSrc;
	},
	setSrc: function(src) {
		if(!src) return;
		this.pendingsrc = src;
	},
	render: function() {
		if(!this.src) {
			this.clear();
			return;
		}
	},
	clear: function() {
		while(this.container.firstChild) this.container.removeChild(this.container.firstChild);
	}
	
});







FloatyImage = FS.Object.extend({
	className: "FloatyImage",
	src: "images/spacer.gif",
	b: {x:0,y:0,X:32,Y:32},
	zIndex: 1,
	init: function() {
		arguments.callee.base.call(this);
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+"; overflow:visible;";
		this.image = document.createElement('img');
		this.image.src = this.src;
		this.image.style.cssText = "position:absolute; left:0px; top:0px; width:100%; z-index:1; "+(FS.isIE?"height:100%;":"");
		this.container.appendChild(this.image);
		this.image.onmouseup = this.up.bind(this);
		this.T = this.image.cloneNode(true); this.T.style.zIndex = 2;
		this.L = this.image.cloneNode(true); this.L.style.zIndex = 3;
		this.B = this.image.cloneNode(true); this.B.style.zIndex = 4; this.B.style.left = ""; this.B.style.top = "";
		this.R = this.image.cloneNode(true); this.R.style.zIndex = 5; this.R.style.left = ""; this.R.style.top = "";
		this.container.appendChild(this.T);
		this.container.appendChild(this.L);
		this.container.appendChild(this.B);
		this.container.appendChild(this.R);
		this.updateToBounds();
	},
	updateToBounds: function() {
		var s = this.container.style;
		var t = this.b.y, l = this.b.x, b = this.b.Y, r = this.b.X;
		var fl = Math.floor, cl = Math.ceil, setO = FS.setOpacity;
		s.top = fl(t)+"px";
		s.left = fl(l)+"px";
		s.width = cl(r)-fl(l)+"px";
		s.height = cl(b)-fl(t)+"px";
		// s.border="1px dashed gray";
		var tO = 1-(t-fl(t)), lO = 1-(l-fl(l)), bO = 1-(cl(b)-b), rO = 1-(cl(r)-r);
		var intw = fl(r) - cl(l), inth = fl(b) - cl(t);
		this.T.style.top = "0px"; this.T.style.left = 1-fl(lO)+"px"; this.T.style.width = intw+"px"; this.T.style.height = inth+1-fl(tO)+"px"; setO(this.T,tO); this.T.style.display = (tO==1 || tO==0)?"none":"";
		this.L.style.top = 1-fl(tO)+"px"; this.L.style.left = "0px"; this.L.style.width = intw+1-fl(lO)+"px"; this.L.style.height = inth+"px"; setO(this.L,lO); this.L.style.display = (lO==1 || lO==0)?"none":"";
		this.B.style.bottom = "0px"; this.B.style.right = 1-fl(rO)+"px"; this.B.style.width = intw+"px"; this.B.style.height = inth+1-fl(bO)+"px";  setO(this.B,bO); this.B.style.display = (bO==1 || bO==0)?"none":"";
		this.R.style.bottom = 1-fl(bO)+"px"; this.R.style.right = "0px"; this.R.style.width = intw+1-fl(rO)+"px"; this.R.style.height = inth+"px";  setO(this.R,rO); this.R.style.display = (rO==1 || rO==0)?"none":"";
		this.image.style.width = intw+"px"; this.image.style.height = inth+"px";
		this.image.style.left = 1-fl(lO)+"px"; this.image.style.top = 1-fl(tO)+"px";
		s.zIndex = this.zIndex;
	},
	moveTo: function(x,y) {
		this.b.setBounds({x:10,y:10,X:x,Y:y});
		this.updateToBounds();
	},
	up: function() {
		//override this function; it will be called when the image is clicked.
	}
});





























MemberView = FS.Object.extend({
	className: "MemberView",
	member: null,
	b: {x:0, y:0, X:600, Y:400},
	zIndex: 1,
	init: function() {
		arguments.callee.base.call(this);
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+";";
		this.container.style.background="";
		// FS.setOpacity(this.container,0.5);
		
		this.updateToMember();
	},
	
	updateToBounds: function() {
		var s = this.container.style;
		if(s.top!=this.b.y+"px") s.top = this.b.y+"px";
		if(s.left!=this.b.x+"px") s.left = this.b.x+"px";
		if(s.width!=this.b.w+"px") s.width = this.b.w+"px";
		if(s.height!=this.b.h+"px") s.height = this.b.h+"px";
	},
	
	updateToMember: function() {
		if(!this.member) {
			this.container.innerHTML = "<table cellspacing=0 cellpadding=0 border=0 width=100% height=100%><tr><td align=center valign=center>No Member Selected.</td></tr></table>";
			return;
		}
		this.container.innerHTML = "<table cellspacing=0 cellpadding=0 border=0 width="+(this.b.w/2)+" height="+this.b.h+"><tr><td align=center valign=center width=50% height=100%><img src=\""+this.member.src+"\" width=100%></td></tr></table>";
		this.container.style.overflow="hidden";
		var contentNode = document.createElement('div');
		this.container.appendChild(contentNode);
		contentNode.style.cssText = "position:absolute; left:"+(this.b.w/2+10)+"px; top:10px; width:"+(this.b.w/2-20)+"px; height:"+(this.b.h-20)+"px;";
		contentNode.style.color="white";
		contentNode.style.fontSize="20px";
		var ih = "<center>"+this.member.name+"</center><table cellspacing=0 cellpadding=3 border=0 height="+(this.b.h-50)+" width=100%>";
		var objstuff = []; for(var i in FS.Object) objstuff[objstuff.length] = i;
		var exceptions = ["src","iid","fsoid"];
		for(var i in this.member) {
			if(!objstuff.has(i) && !exceptions.has(i)) {
				ih+="<tr><td align=right style=\"font-size:11px; color:white;\"><B>"+i+":</B></td><td align=left style=\"font-size:11px; color:white;\">"+this.member[i]+"</td></tr>";
			}
		}
		ih+="</table>";
		contentNode.innerHTML = ih;
	}
});

MembersScroller = FS.Tracker.extend({
	className: "MembersScroller",
	b: {x:0, y:0, X:800, Y:400},
	zIndex: 1,
	f: [{sp:10, headStart:2},{sp:10, headStart:2},{sp:10, headStart:2},{sp:10, headStart:2},{sp:10, headStart:2},{sp:10, headStart:2},{sp:10, headStart:2}],
	f0: null,
	fn: null,
	members: null,
	spacing: 50,
	init: function() {
		arguments.callee.base.call(this);
		if(!this.members) return;
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+";";
		this.scroller = document.createElement('div');
		this.scroller.style.cssText = "position:absolute; left:0px; top:0px; width:0px; height:100%; z-index:1;";
		this.container.appendChild(this.scroller);
		var runningX = 0;
		for(var i = 0; i<this.members.length; i++) {
			this.members[i] = MemberView.create({member: members[i]});
			this.members[i].b.setTopLeft(runningX,0);
			runningX+=this.members[i].b.w+this.spacing;
			this.members[i].updateToBounds();
			this.scroller.appendChild(this.members[i].container);
		}
		this.scroller.style.width=runningX-this.spacing+"px";
		
		this.f0 = this.f[0];
		this.fn = this.f[this.f.length-1];
	},
	render: function() {
		this.f[1].t = this.f[0].c;
		this.f[2].t = this.f[1].c;
		this.f[3].t = this.f[2].c;
		if(this.scroller.style.left!=this.f[3].c+"px") this.scroller.style.left = this.f[3].c+"px";
	},
	updateToBounds: function() {
		var s = this.container.style;
		if(s.top!=this.b.y+"px") s.top = this.b.y+"px";
		if(s.left!=this.b.x+"px") s.left = this.b.x+"px";
		if(s.width!=this.b.w+"px") s.width = this.b.w+"px";
		if(s.height!=this.b.h+"px") s.height = this.b.h+"px";
	},
	scrollTo: function(n) {
		this.f0.t = 0-this.members[n].b.c.x+this.b.w/2;
	}
});

ClickableSquareImage = FS.Object.extend({
	className: "ClickableSquareImage",
	src: "images/spacer.gif",
	b: {x:0,y:0,X:32,Y:32},
	zIndex: 1,
	res: 100,	//canvas resolution
	refHeight: 1.5,
	init: function() {
		arguments.callee.base.call(this);
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+"; overflow:hidden;";
		this.image = document.createElement('img');
		this.image.src = this.src;
		this.image.style.cssText = "position:absolute; left:0px; top:0px; width:100%; z-index:1; "+(FS.isIE?"height:100%;":"");
		if(!noCanvas) {
			this.refpxHeight = Math.floor((this.refHeight-1)*this.res);
			this.image = document.createElement('canvas');
			this.con = this.image.getContext('2d');
			this.container.style.overflow="visible";
			this.image.style.cssText = "position:absolute; left:0px; top:0px; width:100%; height:100%; z-index:1; "+(FS.isIE?"height:100%;":"");
			this.image.width = this.res; this.image.height = this.res+this.refpxHeight;
			this.loader = useLoadee({
				url: this.src,
				onload: this.paint.bind(this)
			},downer.group);
			this.paint();
		}
		this.container.appendChild(this.image);
		this.image.onmouseup = this.up.bind(this);
	},
	paint: function() {
		if(noCanvas) return;
		if(!this.loader.completed) {
			var g = this.con.createRadialGradient(this.image.width/2,this.image.width/10,0,this.image.width/2,this.image.width/10,this.image.width*1.414);
			g.addColorStop(0,"#282828"); g.addColorStop(1,"#111111");
			this.con.fillStyle = g;
			this.con.fillRect(0,this.image.width,this.image.width,this.image.height);//paint in the bottom chunk
			this.maskReflection(0.8);	
			this.con.fillStyle = g;												 //alphatize me, cap'n!
			this.con.fillRect(0,0,this.image.width,this.image.width);				 //paint in the square chunk
			return;			
		} 
		this.loader.image.style.visibility="hidden";
		document.body.appendChild(this.loader.image);
		var w = this.loader.image.offsetWidth, h = this.loader.image.offsetHeight;
		document.body.removeChild(this.loader.image);
		this.con.save();
		this.con.scale(1,-1);
		this.con.translate(0,0-2*this.image.width);
		this.con.drawImage(this.loader.image,0,0,this.loader.image.width,this.loader.image.width,0,0,this.image.width,this.image.width);	//draw reflection
		this.con.restore();
		this.maskReflection(0.3);
		this.con.drawImage(this.loader.image,0,0,this.loader.image.width,this.loader.image.width,0,0,this.image.width,this.image.width);	//draw main square
		return;
	},
	maskReflection: function(opacity) {
		var g = this.con.createLinearGradient(0,this.image.width,0,this.image.height);
		g.addColorStop(0,"rgba(0,0,0,"+opacity+")"); g.addColorStop(1,"rgba(0,0,0,0)");
		this.con.fillStyle = g;
		var old = this.con.globalCompositeOperation;
		this.con.globalCompositeOperation = "destination-in";
		this.con.fillRect(0,this.image.width,this.image.width,this.image.height);															//mask reflection
		this.con.globalCompositeOperation = old;
	},
	updateToBounds: function() {
		if(this.b.w!=this.b.h) {
			var dim = Math.min(this.b.w,this.b.h);
			this.b.setRange(dim,dim);
		}
		var s = this.container.style;
		if(s.top!=this.b.y+"px") s.top = this.b.y+"px";
		if(s.left!=this.b.x+"px") s.left = this.b.x+"px";
		if(s.width!=this.b.w+"px") s.width = this.b.w+"px";
		var desH = Math.floor(this.b.h*(noCanvas?1:this.refHeight));
		if(s.height!=desH+"px") s.height = desH+"px";
		s.zIndex = this.zIndex;
	},
	up: function() {
		//override this function; it will be called when the image is clicked.
	}
});

MembersPicker = FS.Tracker.extend({
	className: "MembersPicker",
	b: {x:0, y:0, X:800, Y:100},
	zIndex: 1,
	f: {headStart: .1, sp:3, a:0},
	h: null,
	members: null,
	spacing: 5,
	scale: null,
	humpT: 0.5,
	maxScale: 50,
	maxZoom: 100,
	usedWidth: 0,
	init: function() {
		arguments.callee.base.call(this);
		if(!this.members) return;
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+";";
		this.contents = document.createElement('div');
		this.contents.style.cssText = "position:absolute; left:0px; top:0px; width:100%; height:100%; z-index:1;";
		this.container.appendChild(this.contents);
		this.sensor = document.createElement('div');
		this.sensor.style.cssText = "position:absolute; left:0px; top:0px; width:100%; height:100%; z-index:2; cursor:pointer;";
		if(FS.isIE) {this.sensor.style.background="blue"; FS.setOpacity(this.sensor,0);}
		this.container.appendChild(this.sensor);
		this.sensor.onmousemove = this.mousemove.bind(this);
		this.sensor.onmouseout = this.mouseout.bind(this);
		this.sensor.onmouseup = this.mouseup.bind(this);
		
		for(var i=0; i<this.members.length; i++) {
			this.members[i] = ClickableSquareImage.create({
				src: this.members[i].src,
				ind: i,
				owner: this,
				up: function() {
					this.owner.choose(this.ind);
				}
			});
		}
		this.redistribute();
		for(var i=0; i<this.members.length; i++) this.contents.appendChild(this.members[i].container);
		this.h = this.f[0];
	},
	redistribute: function() {
		var space = (this.members.length-1)*this.spacing;
		var coverage = this.b.w - space;
		this.scale = Math.min(this.maxScale,Math.floor(coverage/this.members.length));
		coverage = this.scale*this.members.length;
		this.usedWidth = coverage+space;
		var leftComp = (this.b.w-this.usedWidth)/2;
		var runningX = 0;
		for(var i=0; i<this.members.length; i++) {
			this.members[i].b.setCenter(leftComp+runningX+Math.floor(this.scale/2),this.b.h/2);
			this.members[i].b.setRange(this.scale,this.scale);
			runningX+=this.scale+this.spacing;
			this.members[i].updateToBounds();
			this.members[i].equiCenter = this.members[i].b.c.clone();
		}
	},
	render: function() {
		for(var i=0; i<this.members.length; i++) {
			var r = (i+0.5)/this.members.length;
			var dist = Math.abs(r-this.humpT);
			var growFactor = 1/(dist*dist*this.members.length*4+1);
			growFactor = Math.max(0,growFactor*1.1 - 0.1);
			growFactor*=this.h.c;
			var newDim = this.scale + (this.maxZoom-this.scale)*growFactor;
			if(this.members[i].className == "ClickableSquareImage") newDim = Math.round(newDim/2)*2;
			this.members[i].b.setRange(newDim,newDim);
			this.members[i].zIndex = Math.floor(newDim*1000);
			// this.members[i].b.setCenter(this.members[i].equiCenter.x+growFactor*this.scale*((r-this.humpT>0)?1:-1),this.b.h/2);
		}
		for(var i=0; i<this.members.length; i++) {
			this.members[i].updateToBounds();
		}
	},
	mousemove: function() {
		var x = FSHost.mouse.x - FS.getPosition(this.sensor,1);
		var y = FSHost.mouse.y - FS.getPosition(this.sensor,2);
		this.humpT = (x-(this.b.w-this.usedWidth)/2) / this.usedWidth;
		this.h.t = 1;
	},
	mouseout: function() {
		this.h.t = 0;
	},
	mouseup: function() {
		var x = FSHost.mouse.x - FS.getPosition(this.sensor,1);
		var y = FSHost.mouse.y - FS.getPosition(this.sensor,2);
		var clicked = [];
		for(var i=0; i<this.members.length; i++)
			if(this.members[i].b.contains(x,y,2)) clicked[clicked.length] = i;
		var max = -1;
		var winner = null;
		for(var i=0; i<clicked.length; i++)
			if(this.members[clicked[i]].zIndex>max) {
				max = this.members[clicked[i]].zIndex;
				winner = this.members[clicked[i]];
			}
		if(winner) winner.up();
	},
	updateToBounds: function() {
		var s = this.container.style;
		if(s.top!=this.b.y+"px") s.top = this.b.y+"px";
		if(s.left!=this.b.x+"px") s.left = this.b.x+"px";
		if(s.width!=this.b.w+"px") s.width = this.b.w+"px";
		if(s.height!=this.b.h+"px") s.height = this.b.h+"px";
	},
	choose: function(n) {
		//override this function; it will be called when a member is clicked.
	}
});































SponsorButton = FS.Object.extend({
	className: "SponsorButton",
	container: null,
	zIndex: 1,
	src: "images/sponsors/bikereligion.png",
	href: "http://www.bikereligion.com/",
	b: {x:0, y:0, X:100, Y:30},
	init: function() {
		arguments.callee.base.call(this);
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+";";
		this.container.innerHTML = '<img src="'+this.src+'" style="position:absolute; left:0px; top:0px; z-index:10;">';
		this.image = this.container.childNodes[0];
		this.image.onload = this.onload.bind(this);
		if(!FS.isIE6) {
			this.glow = requiredImages[12].cloneNode(true);
			this.glow.style.cssText = "z-index:1; position:absolute; left:-50%; bottom:-15px; width:200%; height:100%; visibility:hidden; opacity:0;";
			this.container.appendChild(this.glow);
		}
		this.image.onmouseover = this.over.bind(this);
		this.image.onmouseout = this.out.bind(this);
		this.image.onmouseup = this.up.bind(this);
		FS.setOpacity(this.glow,0);
	},
	onload: function() {
		this.autoSize();
		if(FS.isIE6) {
			this.container.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.image.src+"', sizingMethod='image')";
			this.image.style.visibility = "hidden";
		}
	},
	moveTo: function(x,y) {
		x = Math.round(x);
		y = Math.round(y);
		this.b.setTopLeft(x,y);
		this.container.style.left = x+"px";
		this.container.style.top = y+"px";
	},
	over: function() {
		if(this.glow) FS.fade(this.glow,1,5);
	},
	out: function() {
		if(this.glow) FS.fade(this.glow,0,1);
	},
	up: function() {
		window.open(this.href);
	},
	autoSize: function() {
		this.b.setBounds({
			X:this.b.x+this.image.width,
			Y:this.b.y+this.image.height
		});
		this.image.style.width = this.image.width+"px";
		this.image.style.height = this.image.height+"px";
		this.container.style.width = this.b.w+"px";
		this.container.style.height = this.b.h+"px";
		if(this.owner) this.owner.fixSizes();
	}
});

SponsorsRow = FS.Object.extend({
	className: "SponsorsRow",
	sponsors: null,
	infos: null,
	PADDING: 10,
	b: {x:0, y:0, X:100, Y:30},
	zIndex: 1,
	init: function() {
		arguments.callee.base.call(this);
		if(!this.sponsors) this.sponsors = [];
		if(!this.infos || !this.infos.length) return;
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+";";
		this.sensor = document.createElement('div');
		this.sensor.style.cssText = "position:absolute; left:0px; top:0px; width:100%; height:100%; z-index:10000000; cursor:pointer;";
		if(FS.isIE) {this.sensor.style.background="blue"; FS.setOpacity(this.sensor,0);}
		this.container.appendChild(this.sensor);
		this.sensor.onmousemove = this.mousemove.bind(this);
		this.sensor.onmouseout = this.mouseout.bind(this);
		this.sensor.onmouseup = this.mouseup.bind(this);
		for(var i=0; i<this.infos.length; i++) {
			this.infos[i].owner = this;
			this.infos[i].zIndex = i;
			this.sponsors[i] = SponsorButton.create(this.infos[i]);
			this.container.appendChild(this.sponsors[i].container);
		}
		this.fixSizes();
		// this.container.style.border="1px dotted #880000";
	},
	fixSizes: function() {
		var runningL = 0;
		var maxH = 0;
		for(var i=0; i<this.sponsors.length; i++) {
			this.sponsors[i].moveTo(runningL,0);
			runningL+=this.sponsors[i].b.w+this.PADDING;
			if(maxH<this.sponsors[i].b.h) maxH = this.sponsors[i].b.h;
		}
		this.b.setBounds({
			X:runningL+this.b.x,
			Y:maxH+this.b.y			
		});
		this.container.style.width = this.b.w+"px";
		this.container.style.height = this.b.h+"px";
		if(this.owner) this.owner.fixSizes();
	},
	mousemove: function() {
		for(var i=0; i<this.sponsors.length; i++) {
			if(this.sponsors[i].b.contains(FSHost.mouse.x - FS.getPosition(this.container,1),FSHost.mouse.y - FS.getPosition(this.container,2))) {
				if(!this.sponsors[i].isOver) {
					this.sponsors[i].over();
					this.sponsors[i].isOver = true;
				}
			}
			else if(this.sponsors[i].isOver) {
				this.sponsors[i].isOver = false;
				this.sponsors[i].out();
			}
		}
		if(this.copyOwner) this.copyOwner.scrolling = false;
		if(this.owner) this.owner.scrolling = false;
	},
	mouseout: function() {
		for(var i=0; i<this.sponsors.length; i++) {
			if(this.sponsors[i].isOver) {
				this.sponsors[i].isOver = false;
				this.sponsors[i].out();
			}
		}
		if(this.copyOwner) this.copyOwner.scrolling = true;
		if(this.owner) this.owner.scrolling = true;
	},
	mouseup: function() {
		for(var i=0; i<this.sponsors.length; i++)
			if(this.sponsors[i].b.contains(FSHost.mouse.x - FS.getPosition(this.container,1),FSHost.mouse.y - FS.getPosition(this.container,2)))
				this.sponsors[i].up();
	},
	moveTo: function(x,y) {
		x = Math.round(x);
		y = Math.round(y);
		this.b.setTopLeft(x,y);
		this.container.style.left = x+"px";
		this.container.style.top = y+"px";
	}
});

SponsorsTicker = FS.Object.extend({
	className: "SponsorsTicker",
	b: {x:0, y:0, X:800, Y:30},
	zIndex: 1,
	row: null,
	copy: null,
	scrolling: true,
	init: function() {
		arguments.callee.base.call(this);
		if(!this.row) return;
		this.row.owner = this;
		if(this.b.className!="BoundedArea") this.b = FS.BoundedArea.create(this.b);
		this.container = document.createElement('div');
		this.container.style.cssText = "position:absolute; left:"+this.b.x+"px; top:"+this.b.y+"px; width:"+this.b.w+"px; height:"+this.b.h+"px; z-index:"+this.zIndex+";";
		this.scroller = document.createElement('div');
		this.scroller.style.cssText = "position:absolute; left:0px; top:0px; width:20000px; height:100%; z-index:1;";
		this.container.appendChild(this.scroller);
		this.scroller.appendChild(this.row.container);
		this.copy = SponsorsRow.create({
			copyOwner: this,
			infos: this.row.infos
		});
		this.fixSizes();
		this.tracker = FS.Tracker.create({
			name: "Tracker for "+this.name,
			w: null,
			owner:this,
			f:{sp:2,headStart:3},
			init: function() {
				arguments.callee.base.call(this);
				this.w = this.f[0];
			},
			render: function() {
				this.owner.scroller.style.left = 0-this.w.c%(20+this.owner.row.b.w)+"px";
				if(this.owner.scrolling) this.w.t += .04*FS.lastFrameTime*FS.spA;
			}
		}).start();
	},
	fixSizes: function() {
		while(this.scroller.firstChild) this.scroller.removeChild(this.scroller.firstChild);
		this.row.moveTo(0,0);
		this.scroller.appendChild(this.row.container);
		this.copy.moveTo(this.row.b.X+20,0);
		this.scroller.appendChild(this.copy.container);
	},
	moveTo: function(x,y) {
		x = Math.round(x);
		y = Math.round(y);
		this.b.setTopLeft(x,y);
		this.container.style.left = x+"px";
		this.container.style.top = y+"px";
	}
});