//show focus
function showFocus(num)
{
	for (var id = 1; id <= 5; id++)
	{
		var fpid="focusPic"+id;
		var fcid="focusContent"+id;
		var fnid="focusNav"+id;
		if (id == num)
		{
			try{document.getElementById(fpid).style.display="block"}
			catch(e){};
			try{document.getElementById(fcid).style.display="block"}
			catch(e){};
			try{document.getElementById(fnid).className="active"}
			catch(e){};
		}
		else
		{
			try{document.getElementById(fpid).style.display="none"}
			catch(e){};
			try{document.getElementById(fcid).style.display="none"}
			catch(e){};
			try{document.getElementById(fnid).className="normal"}
			catch(e){};
		}
	}
}

focusNum = 0;
function autoShowFocus()
{
	focusNum = focusNum % 5 + 1;
	showFocus(focusNum)
	setTimeout("autoShowFocus()", 4000);
}

//scroll
function scrollUlByControl(ul, delay)
{
	try
	{
		slideLine(ul,delay,10,0);
	}
	catch(e){}
}

function slideLine(ul,delay,speed,lh)
{
	var slideBox=(typeof ul == "string") ? document.getElementById(ul) : ul;
	var delay=delay,speed=speed,lh=lh, n = 0;
	var tid=null,pause=false;
	var start=function()
	{
		tid=setInterval(slide,speed);
	};
	var slide=function()
	{
		if (pause) return;
		n += 1;
		if (lh > 0) slideBox.scrollTop += 1;
		if (slideBox.scrollTop % lh == 0 || n >= lh)
		{
			clearInterval(tid);
			for (var i=0;i<1;i++)
			{
				slideBox.appendChild(slideBox.getElementsByTagName("li")[0]);
			}
			setTimeout(start,delay);
			slideBox.scrollTop=0;
			n = 0;
		}
	};
	slideBox.onmouseover=function()
	{
		pause=true;
	};
	slideBox.onmouseout=function(){
		pause=false;
	};
	setTimeout(start, delay);
}