function specThumbList()
{
	var s;
	var spec = 161;
	
	var spec_left = document.getElementById("spec_left");
	
	var spec_right = document.getElementById("spec_right");
	
	var spec_list = document.getElementById("product_list_roll");
	
	var list = spec_list.getElementsByTagName("ul")[0];
	
	
	var item = list.getElementsByTagName("li");


	var w = (item[0].offsetWidth) * item.length;
	
	list.style.width = w + "px";

	
	spec_left.onclick = function (){

		stopSpec();
		
		var list_sl = spec_list.scrollLeft;
		
		var spec_length = spec + list_sl;

		
		s = setInterval(function(){
			
			
			
			if(list_sl >= spec_length)
			{
				
				stopSpec();
			}
			else
			{
				
				list_sl += 10;
				spec_list.scrollLeft = (list_sl - 5);
			}
			
		
		},10)
		
		
	}
	
	spec_right.onclick = function (){
		
		stopSpec();
		
		var list_sl = spec_list.scrollLeft;

		var spec_length = list_sl - spec;
		
		s = setInterval(function(){

			if(list_sl <= spec_length)
			{
				stopSpec();
			}
			else
			{
				list_sl -= 10;
				spec_list.scrollLeft = (list_sl + 5);
			}
			
		},10)
	}
	
	function stopSpec()
	{
		clearInterval(s);
	}
}

function changePictureList()
{
	var handle_id = 0;
								
		var handle_list = document.getElementById("handle").getElementsByTagName("ul")[0].getElementsByTagName("li");
		
		var sports = document.getElementById("sports");
		
		var sports_ul = sports.getElementsByTagName("ul")[0];
		
		var sports_list = sports_ul.getElementsByTagName("li");
		
		var sports_desc = false;
		
		var sports_width = 0;
		
		var sports_current = 1;
		
		var is_float = /^\d*\.\d*$/;
		
		var conto;
					
		//判断最大整除数
		for(var j = sport; j > 0; j--)
		{
			if(!is_float.test(width/j))
			{
				conto = width/j;
				break;
			}
		}
		
		sport = conto;

		sports_ul.style.width = width * sports_list.length + "px";

		handle();
		
		//手动执行
		function handle()
		{
			for(var i = 0; i < handle_list.length; i++)
			{
				handle_list[i].getElementsByTagName("a")[0].onclick = function (i){ return ( function (){
					
					var id = (i + 1);

					if(sports_current == id)
					{
						return;
					}
					else if(sports_current > id)
					{
						sports_desc = true; 
					}
					else
					{
						sports_desc = false; 
					}
					
					handle_id = id;

					

					player();
					
				})}(i);
			}
		}
		
		//开始执行
		function player()
		{
			sports_width = width * (handle_id - 1);
			
			(sports_desc == true) ? desc() : asc() ;
			
			function asc()
			{
															
				var s = setInterval(function (){
					
					if(sports.scrollLeft >= sports_width)
					{
						sports_current = handle_id;
					
						clearInterval(s);
					}
					else
					{
						sports.scrollLeft += sport;
					}
				}, speed);
			}
			
			function desc()
			{
				var s = setInterval(function (){
					
					if(sports.scrollLeft <= sports_width)
					{
						sports_current = handle_id;
					
						clearInterval(s);
					}
					else
					{
						sports.scrollLeft -= sport;
					}
				}, speed);
			}

		}
}
