function SwitchNewsTag(id, num, count) {
	ClearTagClass(id, count);
	document.getElementById("tagname_" + id + num).className = "active";
	document.getElementById(id + num).style.display = "";
}
function ClearTagClass(id, count) {
	for (i = 1; i <= count; i++) {
		document.getElementById("tagname_" + id + i).className = "";
		document.getElementById(id + i).style.display = "none";
	}
}

function bookmarkMe(url, title) {
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "");
}

function showDate() {
	var d = new Date();

	document.write(d.getFullYear() + "年" + (d.getMonth() + 1) + "月"
			+ d.getDate() + "日");
	document.write("&nbsp;&nbsp;");
	switch (d.getDay()) {
	case 0:
		document.write("星期日");
		break;
	case 1:
		document.write("星期一");
		break;
	case 2:
		document.write("星期二");
		break;
	case 3:
		document.write("星期三");
		break;
	case 4:
		document.write("星期四");
		break;
	case 5:
		document.write("星期五");
		break;
	case 6:
		document.write("星期六");
		break;
	}

}

function newscroll(ul, delay, speed, lineHeight) {
	var slideBox = (typeof ul == 'string') ? document.getElementById(ul) : ul;
	var delay = delay || 1000;
	var speed = speed || 20;
	var lineHeight = lineHeight || 20;
	var tid = null, pause = false;
	var start = function() {
		tid = setInterval(slide, speed);
	};
	var slide = function() {
		if (pause)
			return;
		slideBox.scrollTop += 2;
		if (slideBox.scrollTop % lineHeight == 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, 2000);
}

function objSP_Article() {
	this.ImgUrl = "";
	this.LinkUrl = "";
	this.Title = "";
}
function SlidePic_Article(_id) {
	this.ID = _id;
	this.Width = 0;
	this.Height = 0;
	this.TimeOut = 5000;
	this.Effect = 23;
	this.TitleLen = 0;
	this.PicNum = -1;
	this.Img = null;
	this.Url = null;
	this.Title = null;
	this.AllPic = new Array();
	this.Add = SlidePic_Article_Add;
	this.Show = SlidePic_Article_Show;
	this.LoopShow = SlidePic_Article_LoopShow;
}
function SlidePic_Article_Add(_SP) {
	this.AllPic[this.AllPic.length] = _SP;
}
function SlidePic_Article_Show() {
	if (this.AllPic[0] == null)
		return false;
	document
			.write("<div align='center'><a id='Url_"
					+ this.ID
					+ "' href='' target=_blank><img id='Img_"
					+ this.ID
					+ "' style='width:"
					+ this.Width
					+ "px; height:"
					+ this.Height
					+ "px; filter: revealTrans(duration=2,transition=23);' src='javascript:null' border='0'></a></div>");
	if (this.TitleLen != 0) {
		document.write("<div id='Title_" + this.ID + "' style='title'></div>");
	} else {
		document.write("");
	}
	this.Img = document.getElementById("Img_" + this.ID);
	this.Url = document.getElementById("Url_" + this.ID);
	this.Title = document.getElementById("Title_" + this.ID);
	this.LoopShow();
}
function SlidePic_Article_LoopShow() {
	if (this.PicNum < this.AllPic.length - 1)
		this.PicNum++;
	else
		this.PicNum = 0;
	if (document.all) { //ie
		this.Img.filters.revealTrans.Transition = this.Effect;
		this.Img.filters.revealTrans.apply();
		this.Img.src = this.AllPic[this.PicNum].ImgUrl;
		this.Img.filters.revealTrans.play();
	} else {
		this.Img.src = this.AllPic[this.PicNum].ImgUrl;
	}

	this.Url.href = this.AllPic[this.PicNum].LinkUrl;
	if (this.Title)
		this.Title.innerHTML = "<a href=" + this.AllPic[this.PicNum].LinkUrl
				+ " target=_blank>" + this.AllPic[this.PicNum].Title + "</a>";
	this.Img.timer = setTimeout(this.ID + ".LoopShow()", this.TimeOut);
}

function showChart() {
	var para1 = document.showChartForm.qy.value;
	var para2 = document.showChartForm.pz.value;
	var para3 = document.showChartForm.yf.value;
	// var chartName = 'fileupload/chart/' + para1 + para2 + para3 + '.gif';
	document.showChartForm.chart.value = para1 + para2 + para3;
	document.showChartForm.submit();
	// var chart = document.getElementById('chartDisplay');
	// chart.src = chartName;
}

