var oldObj,ObjGroup,cNum,topicTimer;
cNum=0;

function topicHomeMove(i,obj) {
	oldObj.className="";
	obj.className="current"
	document.getElementById("topicHome").innerHTML="<a href=\""+topicHomePicLink[i]+"\"><img src=\""+topicHomePic[i]+"\" /></a>";
	oldObj=obj;
}
function topicInit() {
	var topicHTML="";
	for (var j=1;j<6;j++) {
		topicHTML=topicHTML+"<img src=\""+topicHomePic[j]+"\">";
	}
	document.getElementById('InitImg').innerHTML=topicHTML;

	ObjGroup=document.getElementById('topicHomeControl').getElementsByTagName("a");
	oldObj=ObjGroup[0];

	topicTimer=setInterval("topicLoop()",2000);
}
function topicLoop() {
	cNum=cNum+1;
	if (cNum>5) cNum=1
	topicHomeMove(cNum,ObjGroup[cNum-1]);
}
function clickCtrl(i,obj) {
	clearInterval(topicTimer)
	topicHomeMove(i,obj);
	cNum=i;
	topicTimer=setInterval("topicLoop()",2000);
}