var mindbites=function(){
	var c=0,v=false,u,z,l;
	function widget(){}
	widget.prototype.init=function(x,s,a,n){
		u=document.getElementById(x), i=u.getElementsByTagName('li'), z=s, l=i.length;
		if(a){v=true}else{document.getElementById(x).style.width=s*l+'px'} u.style.left=u.style.top=0;
		if(n){u.auto=setInterval(function(){widget.move(1,true)},n*1000)}
	}
	widget.move=function(d,a){
		var t=c+(1*d); t=t<0?l-1:t>l-1?0:t; var f=t>c?1:-1, o=t*z; c=t;
		if(!a){clearInterval(u.auto)} clearInterval(u.int);
		if(v){u.int=setInterval(function(){widget.top(o*-1,f)},20)}
		else{u.int=setInterval(function(){widget.left(o*-1,f)},20)}
	}
	widget.left=function(t,d){
		var o=parseInt(u.style.left);
		if(o==t){clearInterval(u.int)}else{u.style.left=o-Math.ceil(Math.abs(t-o)/10)*d+'px'}
	}
	widget.top=function(t,d){
		var o=parseInt(u.style.top);
		if(o==t){clearInterval(u.int)}else{u.style.top=o-Math.ceil(Math.abs(t-o)/10)*d+'px'}
	}
	return{widget:widget}
}();
