
//新闻模式分类显示菜单
function NewsSpanBar(){
	this.f=1;
	this.event = "click"
	this.titleid = "";
	this.bodyid="";
	this.class_dis = "dis";
	this.class_undis = "undis";
	this.class_hiton = "tab_search_on";
	this.class_hitno = "tab_search";

	var Tags,TagsCnt,len,flag;
	var BClassName;
	this.load=function(){
		if (!document.getElementById(this.titleid)||!document.getElementById(this.bodyid))
		{
			return false;
		}
		flag = this.f;
		BClassName = [this.class_dis,this.class_undis,this.class_hiton,this.class_hitno];
		Tags=document.getElementById(this.titleid).getElementsByTagName('p'); 
		TagsCnt=document.getElementById(this.bodyid).getElementsByTagName('dl'); 
		len=Tags.length;
		for(var i=0;i<len;i++){
			Tags[i].value = i;
			if (this.event!='click'){
				Tags[i].onmouseover=function(){changeNav(this.value)};
			}else{
				Tags[i].onclick=function(){changeNav(this.value)};
			}
			TagsCnt[i].className=BClassName[1];
		}
		Tags[flag].className=BClassName[3];
		TagsCnt[flag].className=BClassName[0];
	}
	function changeNav(v){
		Tags[flag].className=BClassName[2];
		TagsCnt[flag].className=BClassName[1];
		flag=v;
		Tags[v].className=BClassName[3];
		TagsCnt[v].className=BClassName[0];
	}
}
/*user_login_register
function tips(e,str)
{
	var l=e.offsetLeft+120;
	var t=e.offsetTop;
	var tip=document.getElementById("tips");
	tip.innerHTML="提示："+str;
	if(e=e.offsetParent)
	{
		l+=e.offsetLeft;
		t+=e.offsetTop;		
	}
	tip.style.left=l+"px";
	tip.style.top=t+"px";	
	tip.style.display="";
}
function outtips(){
    document.getElementById("tips").style.display='none';
}*/

function loadRightMenu(){
	//右边搜索切换
	var new1 = new NewsSpanBar();
	new1.f=0;
	new1.titleid = "search_bot";
	new1.bodyid = "searchbody";
	new1.class_hiton = "tabgroup_on";
	new1.class_hitno = "tabgroup";
	new1.load();
	//首页调用帖子列表切换
	var new_index = new NewsSpanBar();
	new_index.f=0;
	new_index.titleid = "index_topic_bot";
	new_index.bodyid = "index_topicbody";
	new_index.class_hiton = "index_tabgroup_on";
	new_index.class_hitno = "index_tabgroup";
	new_index.load();
	//右边帖子列表切换
	var new3 = new NewsSpanBar();
	new3.f=0;
	new3.titleid = "topic_bot";
	new3.bodyid = "topicbody";
	new3.class_hiton = "tabgroup_on";
	new3.class_hitno = "tabgroup";
	new3.load();
	//底部友情链接和在线统计切换
	var new_link = new NewsSpanBar();
	new_link.f=0;
	new_link.titleid = "bot_link";
	new_link.bodyid = "body_link";
	new_link.class_hiton = "link_on";
	new_link.class_hitno = "link";
	new_link.load();
}

function setTab(name,cursel,n,t){
	for(var i=1;i<=n;i++){	
		var menu=document.getElementById(name+i);
		if(!menu){
			if (t==0)cursel++;
			continue;
		}
		var con=document.getElementById("con_"+name+"_"+i);
		menu.className=(i==cursel?"hover":"");
		con.style.display=(i==cursel?"block":"none");
	}
}
