﻿(function($)
{
	var pause=false;
	var ul=$("#ulDistributors");
	window.setInterval(function()
	{
		if(pause==true)
			return;
		ul[0].scrollTop+=1;
		if(ul[0].scrollTop>=48)
		{
			ul.append(ul.find(">li:first"));
			ul[0].scrollTop=0;
		}
	},10);
	ul.hover(function(){pause=true;},function(){pause=false;});
	var list=ul.find(">li");

	list.each(function()
	{
		var sender=$(this);
		this.text=sender.text();
	});
	list.sort(function(a,b)
	{
		var v=0;
		if(a.text<b.text)
			v= -1;
		else if(a.text>b.text)
			v= 1;
		else
			v=0;
		return v;
	});
	list.each(function()
	{
		ul.append(this);
	});
})($);