var showIndex = 0;
var showCount;
var timeOut = 5000;
var s_img;
var s_btn;
function playchange()
{
	var btnStr='';
	s_img = document.getElementById('s_img').getElementsByTagName("a");
	s_btn = document.getElementById('s_btn').childNodes;
	showCount = s_img.length;
	for(i = 0; i < showCount; i++){
		s_img[i].onmouseover = function(){window.clearInterval(theTimer);}
		s_img[i].onmouseout  = function(){theTimer=setTimeout('change()', 1000);}
		btnStr += "<span onmouseover=\"changeIndex("+i+");window.clearInterval(theTimer);this.className='btn_on';\" onmouseout=\"theTimer=setTimeout('change()', 1000);\">"+(i+1)+"</span>";
	}
	document.getElementById('s_btn').innerHTML = btnStr;
	change();
}
function changeIndex(num)
{
	window.clearInterval(theTimer);
	showIndex = num;
	change();
}
function change()
{
	if(showIndex >= showCount) showIndex = 0;
	for(i = 0; i < showCount; i++)
	{
		s_img[i].style.display =  (i == showIndex)? "block" : "none" ;
		s_btn[i].className = (i == showIndex)? "btn_on" : "btn_off" ;
	}
	showIndex++;
	theTimer=setTimeout("change()", timeOut);
}