

function getSales(type) {
	document.getElementById("sales").innerHTML = getChaneelHtmlByIndex(type)
	formatStyle(type)
}

function formatStyle(index) {
	for (var i = 0; i < 5; i++) {
		var obj = "sc" + i

		document.getElementById(obj).className = 'sfont';
	}
	document.getElementById("sc" + index).className = 'bfont';
}

var timer
var count = 0
function autoShwo() {
	getSales(count)

	if (count >= 4) {
		count = 0
	} else {
		count++
	}
	timer = setTimeout('autoShwo()', 6000)

}

function getChaneelHtmlByIndex(index) {
	var innerHtml = new Array()
	innerHtml[0] = document.form1.hrsg.value
	innerHtml[1] = document.form1.cwtd.value
	innerHtml[2] = document.form1.zrsp.value
	innerHtml[3] = document.form1.czk.value
	innerHtml[4] = document.form1.ytsj.value

	return innerHtml[index]
}

function getHot(channel) {

	$.ajax({
				url : path + "/saigoo/index/newAction.do",
				cache : false,
				async : false,
				data : "channel=" + channel,
				dataType : "xml",
				success : function(html) {

					$(html).find("ware").each(function(i) {
						var obj = new Number(i) + new Number(1)
						if (obj != 1) {
							$("#goods" + obj).attr("src",
									$(this).find("src").text())
							$("#sp" + obj).html($(this).find("name").text())
							$("#goods" + obj).attr("alt",
									$(this).find("name").text())
						}
					})
				}
			});
}
