var sponsors_bottom=null;
var sponsors_bottom_to=null;
var maxN=0;
var width=105;
var duration_each=500;
var anim_step=1;
var bgPos=0;

$(document).ready(function(){
	sponsors_bottom=$('.sponsor_bottom');
	//for(i=0;i<sponsors_bottom.length;i++){
		//var sponsor=sponsors_bottom.ea
	//}
	/*sponsors_bottom.each(function(){
		var nparts=this.id.split('_');
		var n=nparts[nparts.length-1];
		var t=$(this);

		maxN=Math.max(maxN,n);
		//t.css('position','absolute');
		//t.css('top','0');
		//t.css('left',(width*n)+'px');
		//t.animate({
//			style:'left:-'+(width)+'px'
		//},duration_each*(n+1))

	})*/;
	sponsors_bottom_to=setTimeout(scroll_sponsors_bottom,100);

});


function scroll_sponsors_bottom(){
	/*sponsors_bottom.each(function(){
		var t=$(this);
		var l=parseInt(t.css('left'));
		if (l > -width) {
			l=l-anim_step;
		}else{
			l=(maxN*width)-anim_step;
		}
			t.css('left', l);

	});*/
	var t=$('#layout_bottom_right');
	//var l=parseInt(t.css('background-position-x'));
	//var l=bgPos;
	/*if(!l){
		l=parseInt(t.css('background-position'));
	}
	if(isNaN(l)){l=0;}
	*/
	if (bgPos > -width*nSponsors) {
		bgPos=bgPos-anim_step;
	}else{
		bgPos=(nSponsors*width)-anim_step;
	}
	t.css('background-position', bgPos+'px 0px');
	t.css('background-position-x', bgPos+'px');
	sponsors_bottom_to=setTimeout(scroll_sponsors_bottom,100);
	bgPos=bgPos;
	return true;
}
