//------------------------------
//create time:2011-2-28
//creater:zll,liang_0735@21cn.com,www.mwjx.com
//purpose:顶部外站广播
//------------------------------
//alert("hello");
m_top_news = {
row:3,
count:0,
i: 0,
dn:document.getElementById('top_news'),
dl: document.getElementById('top_news').getElementsByTagName('ul'),
x: function(dt) {
	//显示一行，隐藏本行前面第三行
	//alert(dt);
	//return;
	var dds = this.dn.getElementsByTagName('ul');
	dds[dt].style.display = "block";
	var a = dt - this.row;
	if(a < 0)
		a = this.count + a;
	dds[a].style.display = "none";
	//alert(dt+"="+dds[dt].style.display+";"+a+"="+dds[a].style.display);
	//dd = dd.nextSibling;
	//alert(dt.tagName+":"+dt.nodeType);
	/*var dds = this.dl.getElementsByTagName('ul');
	for (var i = 0; i < dds.length; i++) {
		dds[i].style.display = 'none';
	}
	var dd = dt;
	while ("UL" != dd.tagName) {
		dd = dd.parentNode;
	}
	dd.style.display = 'block';*/
},
init: function() {
//	alert("aa");
	//return;
	this.count = this.dl.length;
	//this.x(0);
	//this.x(1);
	//this.x(2);
	for(var i = 0;i < this.row;++i)
		this.dl[i].style.display = "block";
	//this.dl[1].style.display = "block";
	//this.dl[2].style.display = "block";
	this.i = this.row-1;
	var parse = false;
	this.dn.onmouseover = function() {parse = true};
	this.dn.onmouseout = function() {parse = false};
	//%this.count
	setInterval(function() {
		if (parse) return;
		m_top_news.x(++m_top_news.i%m_top_news.count);
	}, 4000);
//	for (var i = 0; i < this.count; i++) {
//		this.dl[i].onmouseover = function(e) {
//			var ev = !e ? window.event : e;
//			var t = ev.srcElement || e.target;
//			m_top_news.x(t);
//		}
//	}
	/*
	var dts = this.dl.getElementsByTagName('ul');
	this.count = dts.length;
	//alert(dts.length);
	var parse = false;
	this.dl.onmouseover = function() {parse = true};
	this.dl.onmouseout = function() {parse = false};
	for (var i = 0; i < dts.length; i++) {
		dts[i].onmouseover = function(e) {
			var ev = !e ? window.event : e;
			var t = ev.srcElement || e.target;
			m_top_news.x(t);
		}
	}
	this.x(dts[0]);
	this.x(dts[1]);
	this.x(dts[2]);

	setInterval(function() {
		if (parse) return;
		m_top_news.x(dts[++m_top_news.i % 6]);
	}, 4000);
	//5000
	*/
}
}
m_top_news.init();
/**/
