/**
* @作者  <yanggw@2345.com>
* @日期  2012/12/10
* @功能  产生热门新闻
*/
T.hotNews = {
	'data' : [[{'ctitle':'京沪高铁卧铺现多只吸血臭虫','title':'京沪高铁卧铺现多只吸血臭虫','link':'http://money.163.com/api/13/0924/07/99H5FS4I00253B0H.html?2345','class':'class="fred"'},{'ctitle':'房姐今日受审：在京有41套房','title':'房姐今日受审：在京有41套房','link':'http://money.163.com/api/13/0924/07/99H6JEOB00253B0H.html?2345','class':''},{'ctitle':'油品升级消费者承担70%成本','title':'油品升级消费者承担70%成本','link':'http://money.163.com/api/13/0923/18/99FQ7NST002524SO.html?2345','class':''},{'ctitle':'报告称中国灰色收入6.2万亿','title':'报告称中国灰色收入6.2万亿','link':'http://money.163.com/api/13/0924/07/99H7LQGP00252G50.html?2345','class':''},{'ctitle':'李亚鹏亮相哽咽 称相信爱情','title':'李亚鹏亮相哽咽 称相信爱情','link':'http://money.163.com/api/13/0924/09/99HCGK1600254U80.html?2345','class':''}],[{'ctitle':'汕头海水倒灌动物园河马出逃','title':'汕头海水倒灌动物园河马出逃','link':'http://news.163.com/api/13/0924/09/99HDM08M00011229.html?2345','class':'class="fred"'},{'ctitle':'男子唯家乡不偷 称盗亦有道','title':'男子唯家乡不偷 称盗亦有道','link':'http://news.163.com/api/13/0924/07/99H7R2LU00011229.html?2345','class':''},{'ctitle':'村民发现10公斤重疑似&quot;太岁&quot;','title':'村民发现10公斤重疑似&quot;太岁&quot;','link':'http://news.163.com/api/13/0924/07/99H696DG00011229.html?2345','class':''},{'ctitle':'男子毒瘾发作 带妻坟地赏月','title':'男子毒瘾发作 带妻坟地赏月','link':'http://news.163.com/api/13/0924/05/99GVJBDG00011229.html?2345','class':''},{'ctitle':'绞死女童事故洗衣机时好时坏','title':'绞死女童事故洗衣机时好时坏','link':'http://news.163.com/api/13/0924/04/99GTRLSV00011229.html?2345','class':''}],[{'ctitle':'网曝刘嘉玲登顶娱乐圈富婆榜','title':'网曝刘嘉玲登顶娱乐圈富婆榜','link':'http://money.163.com/api/13/0924/09/99HEIDAC00254TI5.html?em','class':'class="fred"'},{'ctitle':'章子怡穿低胸裙险些走光(图)','title':'章子怡穿低胸裙险些走光(图)','link':'http://money.163.com/api/13/0924/09/99HF4UJ400254TI5.html?em','class':''},{'ctitle':'港媒曝黄晓明携baby见家长','title':'港媒曝黄晓明携baby见家长','link':'http://money.163.com/api/13/0924/10/99HGVP4100254UF3.html?em','class':''},{'ctitle':'蔡康永写77篇故事感谢男友','title':'蔡康永写77篇故事感谢男友','link':'http://money.163.com/api/13/0924/10/99HHBRI700254UF3.html?em','class':''},{'ctitle':'孙俪晒母亲年轻靓照 被赞美人','title':'孙俪晒母亲年轻靓照 被赞美人','link':'http://money.163.com/api/13/0924/10/99HHELAC00254UF3.html?em','class':''}],[{'ctitle':'两国替中国出头对日本出兵','title':'两国替中国出头对日本出兵','link':'http://bbs.miercn.com/201309/thread_229682_1.html?_2345','class':'class="fred"'},{'ctitle':'中日战机在钓岛上空血拼','title':'中日战机在钓岛上空血拼','link':'http://bbs.miercn.com/201309/thread_228093_1.html?_2345','class':''},{'ctitle':'喜马拉雅山边境发现UFO基地','title':'喜马拉雅山边境发现UFO基地','link':'http://bbs.miercn.com/201309/thread_229687_1.html?_2345','class':''},{'ctitle':'北京一票让日本陷入了绝境','title':'北京一票让日本陷入了绝境','link':'http://bbs.miercn.com/201309/thread_229679_1.html?_2345','class':''},{'ctitle':'美军司令曝：歼10曾击落F22','title':'美军司令曝：歼10曾击落F22','link':'http://bbs.miercn.com/201309/thread_229675_1.html?_2345','class':''}]],
	'tabCN': 'cur',
	'curr' : 0,
	'getIndex' : function (a)
	{
		var ret=-1,i=0,items=this.items,len=items.length;
		for(; i<len; i++)
		{
			if (a===items[i])
			{
				ret=i;
				break;
			}
		}
		return ret;
	}
	,
	'render' : function (index)
	{
		var data = this.data[index], i = 0, len = data.length, str = '', temp;
		for (; i < len; i++)
		{
			temp = data[i];
			str += '<li><a '+ temp['class']+'href="' +temp['link']+'" name="2"  title="' + temp['title'] + '">' + temp['ctitle'] + '</a></li>';
		}
		this.con.innerHTML = str;
	}
	,
	'toggleCls' :function (index)
	{
		var prevItem =  this.items[this.curr], currItem =  this.items[index];
		prevItem.className =  prevItem.className.replace(this.tabCN,'');
		this.curr = index;
		currItem.className =  currItem.className.trim()+' '+ this.tabCN;
	}
	,
	'init' : function (tab,con)
	{
		var self = this;
		this.tab = tab;
		this.items = $t('LI',this.tab);
		this.con = con;
		this.render(0);
		this.tab.onclick =  function (e)
		{
			var e = e || event,target = e.target || e.srcElement,index,p;
			if (target.nodeName === 'A')
			{
				p = target.parentNode;
				if (p.className.indexOf(self.tabCN) !== -1)
				{
					return;
				}
				index = self.getIndex(p)
					self.render(index);
				self.toggleCls(index);
				return false;
			}
		}
	}
	};
T.hotNews.init($('J_hotNews_tab'),$('J_hotNews_con'));