n=1;
state=1;
function stopg(m){
	state=0;
	n=m;
	for (i = 1; i <= 3; i++) {
		document.getElementById("gonggao-c-" + i).style.display = "none";
		document.getElementById("gonggao-t-" + i).className="gonggao-t-h";
	}
	document.getElementById("gonggao-c-" + n).style.display = "block";
	document.getElementById("gonggao-t-" + n).className="gonggao-t-s";
}

function startg() {
	state=1;
}

function gonggao(){
	if (state==1){
		for (i = 1; i <= 3; i++) {
			document.getElementById("gonggao-c-" + i).style.display = "none";
			document.getElementById("gonggao-t-" + i).className="gonggao-t-h";
		}
		document.getElementById("gonggao-c-" + n).style.display = "block";
		document.getElementById("gonggao-t-" + n).className="gonggao-t-s";
		n++;
		if (n==4){n=1};
	}
}
time1=setInterval("gonggao()",3000);

window.onload=gonggao;