var SoFirstTag = document.getElementById("s_news");
var SoBtn = document.getElementById("SearchBtn");
var SoForm = document.getElementById("soForm");
function ShowTag(o){
	var BtnName = "保险搜索";
	
	if(o == SoFirstTag){
 
   SoFirstTag.setAttribute("onclick","");
	
	    
		return false;
	}else {
       
		o.className = "soFocus";
		SoFirstTag.className = "soBlur";
		switch(o.id){
			case "news":
				BtnName = "新闻搜索";
				act = "http://www.szbx.net/search.asp";
				
				break;
			case "pro":
				BtnName = "险种搜索";
				act = "http://www.szbx.net/ins/research.asp";
				break;
			case "agent":
				BtnName = "精英搜索";
				act = "http://www.szbx.net/ins/dailiren.asp";
				break;
			case "com":
				BtnName = "公司搜索";
				act = "http://www.szbx.net/ins/researchic.asp";
				break;
			case "blog":
				BtnName = "博客搜索";
				act = "http://blog.szbx.net/list.asp";
				break;
			case "bbs":
				BtnName = "论坛搜索";
				act = "http://www.szbx.net/bbs/query1.asp";
				break;
 
		}
 
		SoForm.action = act;
		SoBtn.value = BtnName;
		
		
		
		SoFirstTag = o;
		
       
		
	    
		SoForm.keyword.focus();
 
		return true;
	}
}
 
function checkthis(){
 
   if(checkspace(soForm.keyword.value)) {
	soForm.keyword.focus();
    alert("您没有填写主题！");
	return false;
  }
	//form.keyWord.value = form.q.value;
	//alert(form.q.value);
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
 
function checklogin()
{
if(login.username.value=="")
{
alert ("请填写用户名！");
login.username.focus();
return false;
}
if(login.password.value=="")
{
alert ("请填写密码！");
login.password.focus();
return false;
}
 
if(login.lx.value==0)
{
alert ("请选择登陆方式");
login.lx.focus();
return false;
}
 
if(login.lx.value==1)
{
this.login.method="post";
this.login.action="http://bbs.szbx.net/login.asp?action=chk";
}
 
if(login.lx.value==2)
{
this.login.method="post";
this.login.action="http://www.szbx.net/ins/sell/checklogin_shang.asp";
}
 
if(login.lx.value==3)
{
this.login.method="post";
this.login.action="http://www.szbx.net/ins/ic/checklogin_shang.asp";
}
 
if(login.lx.value==4)
{
this.login.method="post";
this.login.action="http://www.szbx.net/fx/chklogin.asp";
}
}
 
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//合作栏目新闻滚动

var nTime = 3;
var nFocus= 0;
var bFlag = false;
var aLiTab , aDivTab;
function fAutoSwitch(){
	var n = nFocus + 1;
	if(n >=3){
		n = 0;
	}
	if(!bFlag){
		aLiTab[n].onmouseover();
		bFlag = false;
	}
}
window.onload = function(){
	var $ = function($){
		return document.getElementById($);
	};
	aLiTab = $("oUlTab").getElementsByTagName("li");//标签li数组
	
	aDivTab = [$("oDivTab1") , $("oDivTab2") , $("oDivTab3"),$("oDivTab4"),$("oDivTab5")];//对应变换的标签
	for(var i=0;i<aLiTab.length;i++){
		(function(i){
			var t = aLiTab[i];
			t.onmouseover = function(){// 鼠标移动事件
				if(nFocus != i){
					aLiTab[nFocus].className = "";
					aDivTab[nFocus].style.display = "none";
					nFocus = i;
					aLiTab[nFocus].className = "on";
					aDivTab[nFocus].style.display = "";
				}
				bFlag = true;
			};
			t.onmouseout = function(){
				bFlag = false;
			};
		})(i);
	}
	setInterval("fAutoSwitch()",nTime * 6000);
	
}

//新闻分栏显示				
					
		function ChangeNews(nav,value,box){
							
						    //alert(n);      
					 
						var aP=document.getElementById(nav);
						var aNum=aP.getElementsByTagName('li').length;
						var aB=document.getElementById(box);
						
						
						for(var i=0;i<aNum;i++){
										
							if(value==i)
							{	
								aP.getElementsByTagName('li')[i].className='nav_on';
								
								aB.getElementsByTagName('ul')[i].className = "";
									
							}
							else{								
								aP.getElementsByTagName('li')[i].className='nav_off';
								aB.getElementsByTagName('ul')[i].className = "hidden";
								
							}
							

						}
						//document.getElementById(cc).innerHTML=words; //成功刷新框架内的页面
						
		}
