function readCookie(sname) 
{
var acookie=document.cookie.split("; ");
for(var i=0;i<acookie.length;i++)
{
var arr=acookie[i].split("=");
if(sname==arr[0] && arr[1] !="")
  {
  if(arr.length>1)    
    login_1.innerHTML = "<div>用户名："+decodeURIComponent(arr[1])+"您好1，欢迎您的登录。&nbsp;<a href='http://www.bst120.com/member/'>会员中心</a>&nbsp;<a href='http://ask.bst120.com/'>在线咨询</a>&nbsp;<a href='http://ask.bst120.com/logout.asp' target='_self'>注销登陆</a><input type='hidden' name='account'><input type='hidden' name='password'><input type='hidden' name='Submit' /><input type='hidden' name='Submit2' /><input type='hidden' name='Submit5' /></div>";    
  else
    return;
  }
}
  return;
}

function so()
{
	var keyword=document.getElementById('kw');
	if(keyword.value.length==0)
	{
		alert("请输入搜索关键字！");
		keyword.focus();
		return false;
	}
	return true;
}
 
function ask()
{
	var keyword=document.getElementById('kw');
	if(keyword.value.length==0)
	{
		alert("请输入提问内容！");
		search.keyword.focus();
		return false;
	}
	window.location.href="http://ask.bst120.com/ask.asp?online_title="+escape(keyword.value);
	return true;
}

        $(function(){
            	$(".tabs").each(function(){
				// 初始化
				$(this).siblings(".tabContent").filter(":first").show();
				var $li=$(this).find("li");
				$li.filter(":first").addClass("active");
				
				$li.mouseenter(function(){
					//alert("ok");
					var $tagContent=$(this).parent().parent().siblings(".tabContent");
					var index=$li.index($(this));
					$(this).addClass("active").siblings().removeClass("active");
					$tagContent.hide().filter(":eq("+index+")").show();
					//alert(index);
				});
			});
        });

function readCookie_1(sname) 
{
var acookie=document.cookie.split("; ");
for(var i=0;i<acookie.length;i++)
{
var arr=acookie[i].split("=");
if(sname==arr[0])
  {
  if(arr.length>1 && arr[1]!='')
    login_3.innerHTML = "<div>用户名：<a title="+decodeURIComponent(arr[1])+">"+decodeURIComponent(limitL(arr[1],12))+"</a>您好，欢迎您的登录。&nbsp;<a href='http://www.bst120.com/member/'>会员中心</a>&nbsp;<a href='http://ask.bst120.com/'>在线咨询</a>&nbsp;<a href='http://www.bst120.com/member/logout.asp' target='_self'>注销登陆</a></div>";
  else
    return;
  }
}
  return;
}

function limitL(s,n){
if(s.length > n){
  return s.substring(0,n);
}
return s;
}

function G(id){
    return document.getElementById(id);
}

//删除子元素
function removeElement(ob){
	if(ob)
	ob.parentNode.removeChild(ob); 
}

// show and hide
function showMe(obj){
	if(G(obj))
		G(obj).style.display = "";
}
function hideMe(obj){
	if(G(obj))
		G(obj).style.display = "none";
}
function changeMe(obj){
	if(G(obj).style.display == "none")
		showMe(obj);
	else
		hideMe(obj);
}
    
function onTab(ulid,o)
	{
		var objLis=G(ulid).getElementsByTagName("td");
		for(var i=0;i<objLis.length;i++)
		{
			objLis[i].className="";
		}
		G(o).className="acc";
	}
