function changemenu(name,id,total)
{
	for(var i = 1; i <= total; i++)
	{
		document.getElementById(name+i).className=name+i;
		document.getElementById(name+'_d'+i).style.display='none';
	}
	document.getElementById(name+id).className=name+id+'_on';
	document.getElementById(name+'_d'+id).style.display='block';
}
function slideLine(ul, delay, speed, lh) {
var slideBox = (typeof ul == 'string')?document.getElementById(ul):ul;
var delay = delay||1000, speed=speed||20, lh = lh||20;
var tid = null, pause = false;
var start = function() {
tid=setInterval(slide, speed);
}
var slide = function() {
if (pause) return;
slideBox.scrollTop += 1;
if (slideBox.scrollTop % lh == 0) {
clearInterval(tid);
slideBox.appendChild(slideBox.getElementsByTagName('li')[0]);
slideBox.scrollTop = 0;
setTimeout(start, delay);
}
}
slideBox.onmouseover=function(){pause=true;}
slideBox.onmouseout=function(){pause=false;}
setTimeout(start, delay);
}

var ptotal = 0;
function shownums(total)
{
	if (total == 0) return;
	ptotal = total;
	var str = '';
	for(var i = total; i > 0; i--)
	{
		str += '<a href="#" id="feat_num'+i+'" class="num" onclick="showpic('+i+')">'+i+'</a>';
	}
	document.write(str);
	showpic(1);
	setInterval("changePic()", 5000);
}
var pid = 1;
function changePic()
{
	var pid_next = pid+1;
	if (pid_next > ptotal) pid_next = 1;
	showpic(pid_next);
}
function showpic(id)
{
	var picid='feat_pic'+pid;
	var picid_next = 'feat_pic'+id;
	var textid='feat_text'+pid;
	var textid_next='feat_text'+id;
	var numid = 'feat_num'+pid;
	var num_next='feat_num'+id;
	document.getElementById(picid).style.cssText='filter:progid:dXImageTransform.Microsoft.Pixelate(maxsquare=3);';
	document.getElementById(numid).className='num';
	document.getElementById(num_next).className='numon';
	setTimeout("document.getElementById('"+picid+"').style.cssText='display:none';document.getElementById('"+picid_next+"').style.cssText='display:block';document.getElementById('"+textid+"').style.cssText='display:none';document.getElementById('"+textid_next+"').style.cssText='display:block';",200);
	pid=id;
}
