//一级栏目标签切换
function getCurrentChannel(){
	var obj=document.getElementById('JiabooIndex_Guide');
	var PathFlg='';
	var PathFlgTemp;
	var Result=-1;
	var Reg;
	var TrunNum=0;
	//PathFlg+='//[a-zA-Z0-9.]+/$|||';
	PathFlg+='/index.shtml$$/about$$/JiabooSubject$$/UserCenter$$/search.asp|||';//首页
	PathFlg+='/zixun$$/Others$$/health/$$/lecture$$/campaign$$/Selection$$/tips$$/Tricks$$/diy-tips$$/maintenance-tips$$/Design-Tricks$$/QC-Std$$/qc%2Dstd$$/law$$/Tech-term$$/Yellow-Page$$/calling-info$$/information$$/scheme$$/Living-Room$$/bedroom$$/dinning-room$$/kitchen$$/study-room$$/toilet$$/general-tips$$/foyer$$/child-room$$/balcony$$/decoration$$/color$$/other-tips$$iClass=0782011240220061$$/System$$/Sale$$/DownLoad$$/design-witkey$$/Witkey_fs$$entironment-problem|||';//资讯
	PathFlg+='/shop(?!/brand.asp|/usercenter)$$/shop/index\.shtml$$/search(?!/ClassID_nin)|||';//建材城
	PathFlg+='/diy$$/diy/$$/builder_self$$/hetong|||';//装修快线
	PathFlg+='/promotion/$$/storenews|||';//特价专区
	PathFlg+='/fengshui$$/geomancynews$$/homegeomancy$$/geomancylivingroom$$/geomancybedroom$$/geomancykitchen$$/geomancybathroom$$/officegeomancy$$/geomancytips$$/fatten$$/love$$/geomancyperson$$/geomancytips$$/geomancytips$$/geomancytips$$iClass=078201147032149|||';//风水
//	PathFlg+='/design-witkey$$/Witkey_fs|||';
//	PathFlg+='/hospital|||';
    
//	PathFlg+='/design-witkey/$$/Witkey_fs/$$/club|||';//装修社区
	PathFlg+='|||';//正则表达式
	PathFlg+='/sun/$$/space/$$/sun$$/blog$$/space3$$index.aspx|||';//正则表达式             //阳光行动
	PathFlg+='/fun/$$/fun$$/fun/news/|||';//正则表达式             //会员卡频道
	PathFlg=PathFlg.replace('/','\/');
	var url=location.href;
	var urlx;
	var NumUrlx;
	url=url.toLowerCase();
	PathFlgs=PathFlg.split('|||');
	for(var n=0;n<PathFlgs.length;n++){
		PathFlgTemp=PathFlgs[n].split('$$');
		for(var i=0;i<PathFlgTemp.length;i++){
			Reg=new RegExp(PathFlgTemp[i],"gi"); //不区分大小写
			if(url.search(Reg)>0){ 
				Result=n;
				break;
			}
		}
		if(Result!=-1)break;
	}
	//alert(Result);
	//alert(obj.childNodes.length);
	if(Result==-1)
	{
		Result=0;	
	}
	if(Result>=0)
	{	//计算真实标签位置
			for(var n=0;n<obj.childNodes.length;n++)
			{
				if(obj.childNodes[n].id!=undefined)
				{
					var searchtype=document.getElementById("searchtype");//隐藏域
					searchtype.value=Result;
					if(TrunNum==Result)
					{
						//调整图片
						var Image_left_img=document.getElementById("Image_left_img");//左边图
						var Image_right_img=document.getElementById("Image_right_img");//右边图
						var div_backcolor=document.getElementById("div_backcolor");//背景图div
						
						//控制是否显示
						var div_submenu=document.getElementById("div_submenu");//导航上面的二级导航
						var div_index_mess=document.getElementById("div_index_mess");//首页链接论坛
						var div_sub_searchkey=document.getElementById("div_sub_searchkey");//二级子栏目的搜索关键字
						var div_index_searchkey=document.getElementById("div_index_searchkey");//首页搜索关键字
						var div_search_title=document.getElementById("div_search_title");//搜索名称
						var subsearchkey=document.getElementById("subsearchkey");
						if(Result==0)
						{
							div_submenu.style.display="none";
							div_sub_searchkey.style.display="none";
							
						}
						else
						{
							if(Result!=2 && Result!=4)
							{
								//搜索选项不显示
								var div_searchselect=document.getElementById("div_searchselect");
								div_searchselect.style.display="none";
								
							}
							//控制二级导航和二级搜索关键字
							var li_submenu=document.getElementById("li_submenu"+Result);
							var li_subkey=document.getElementById("li_subkey"+Result);
							if(li_submenu)
							{
								li_submenu.style.display="block";
								
							}
							if(li_subkey)
							{
								li_subkey.style.display="block";
								
							}
							
							Image_left_img.src="/images/index/top_left_up.gif";
							Image_right_img.src="/images/index/top_right_up.gif";
							div_backcolor.className="Navigation_backImage_up";	
							if(Result!=8)
							{
								div_index_searchkey.style.display="none";
								div_index_mess.style.display="none";
								
							}
							div_submenu.style.display="block";
						}
						//处理搜索名称 并记录搜索类弄
						var titlevalue="";
						switch(Result)
						{
							case 0:
								titlevalue="商城搜索";
								
								break;
							case 1:
								titlevalue="资讯搜索";
								break;
							case 2:
								titlevalue="商城搜索";
								break;
							case 3:
								titlevalue="快线搜索";
								break;
							case 4:
								titlevalue="商城搜索";
								break;
							case 5:
								titlevalue="风水搜索";
								break;
							case 6:
								titlevalue="论坛搜索";
								div_search_title.style.color="#9A0000";
								break;
							case 7:
								var div_search=document.getElementById("div_search");
								div_search.style.display="none";
								titlevalue="装修日记搜索";
								break;
							case 8:
								var div_search=document.getElementById("div_search");
								div_search.style.display="none";
								titlevalue="啦啦啦搜索";
								break;
						}
						var div_search_title=document.getElementById("div_search_title");
						div_search_title.innerHTML=titlevalue+"&nbsp;";
						//处理搜索名称
						obj.childNodes[n].className="li1";
						obj.childNodes[n].onclick=function(){location.href=obj.childNodes[n].getAttribute('link');};
						obj.childNodes[n].style.cursor='pointer';
						break;
					}

					TrunNum++;
				}
			}
	}
}





//网站顶部，会员功能按钮
function Top_UserCenterDomain(){
	var Url=location.href;
//	if(Url.toLowerCase().indexOf('jiabooshoppingstepa.asp')!=-1 || Url.toLowerCase().indexOf('usercenter')!=-1){
//		document.write('&nbsp;家宝网欢迎您的光临！');
//		return false;
//	}
	document.write('<div id="UserLoginFrameX"><div id="login" class="UserCenter"></div></div>');

	var objx=document.getElementById('login');
	var c=new Cookie();
	var Result=c.GetUrlCookie('UserName')+'|$|'+c.GetUrlCookie('User_ID')+'|$|'+c.GetUrlCookie('PicsId')+'|$|'+''+'|$|'+c.GetUrlCookie('UserMsgCount');
	Results=Result.split('|$|');
	if(Results[0]!='' && Results[1]!='' && Results[4]!=''){//已登录
			LoginedHTML='<span style="float:left">'+Results[0]+'， 欢迎光临家宝网！ |&nbsp;</span> '
			+'<div id="myUsercenterMenu" class="jqueryslidemenu">'
			+'<ul><li><a href="/UserCenter"> &nbsp;会员中心 <img src="/system/images/arrow_down.gif" align="absmiddle" style="border:0;padding:1px 8px 7px 3px;" /> </a>'
			+'<ul style="border:1px #999 solid;"><li><a href="/UserCenter/?id=4&frameurl=User_MyInfos.asp">&middot;个人信息修改&nbsp; &nbsp; &nbsp; &nbsp;</a></li>'
			+'<li><a href="/UserCenter/?id=4&frameurl=User_RePassword.asp">&middot;修改密码&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</a></li>'
			+'<li><a href="/UserCenter/?id=4&frameurl=User_Order.asp">&middot;我的订单&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</a></li>'
			+'<li><a href="/UserCenter/?id=4&frameurl=User_CardProfile.asp">&middot;我的分FUN卡 &nbsp; &nbsp; &nbsp; &nbsp; </a></li>'
			+'<li><a href="/UserCenter/?id=4&frameurl=User_Msg_Frm.asp?l=0">&middot;短消息（收件箱）&nbsp; &nbsp;</a></li>'
			+'<li><a href="/UserCenter/?id=4&frameurl=Complaint_list.asp">&middot;监管投诉&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</a></li>'
			+'</ul></li></ul></div>';
		if(Results[4]!='0'){
			LoginedHTML+='<img src="/Images/email.gif" border="0"><a href="/UserCenter/?id=4&frameurl=User_Message.asp">('+Results[4]+')</a>';
		}
		
		
		if(Results[3]!='')
		{
			LoginedHTML+='<a href="/UserCenter/index.asp?id=5&frameurl=product_manage_purview.asp" style="color:red"><b>商品管理</b></a> | ';
		}
		if(Results[2]=='0'){
			 LoginedHTML+=' | <a href="/UserCenter/space3_register.asp" style="color:red"><b>激活我的空间</b></a> | ';
		}
		else{
			LoginedHTML+=' | <a href="/sun/space3/user/index.aspx?id='+Results[2]+'" style="color:red"><b>我的大赛空间</b></a> | ';
		}

		LoginedHTML+='<a href="/shejishi/stylistreg.aspx" style="color:red"><b>设计师大赛</b></a> | ';

		LoginedHTML+='<a href="javascript:JiaBooShoppingCart_Display(0,0);" style="color:#9A0000">购物车</a> | ';

		LoginedHTML+='<span onclick="Logout(this,\'history.go(0)\');" style="cursor:pointer;color:#666666;">[退出]</span>';
		objx.innerHTML=LoginedHTML;

		//会员中心下拉菜单
		arrowimages=undefined;
		jqueryslidemenu.buildmenu("myUsercenterMenu", arrowimages);
		
	}else{//未登录
		JiabooLoginWindow('Top_FastLogin.htm','Top_FastLogin_Succeed.htm','location.href=location.href;');
	}
	
}

function Top_ClassDTBX_Open(){
	if(document.getElementById('Top_ClassDTBX').innerHTML!=''){
		if(document.getElementById('Top_ClassDTBX').style.display=='block'){ 
				document.getElementById('Top_ClassDTBX').style.display='none';
				document.getElementById('Top_ClassDTBX_Open_Ico').src='/images/down_index_ico.gif';
				//document.getElementById('Top_ClassDTBX_Open_BT').onclick=Top_ClassDTBX_Close;
		   }
		else{
		   
			  document.getElementById('Top_ClassDTBX').style.display='block';
			  document.getElementById('Top_ClassDTBX_Open_Ico').src='/images/up_index_ico.gif';
		}
	}else{
		loadTopClassList();
	}
	
}

function showdiv_link()
{	var obj=document.getElementById('Top_ClassDTBX');
	if(obj.innerHTML!=''){
		if(obj.style.display=='none'){
			obj.style.display='block';
			document.getElementById('Top_ClassDTBX_Open_Ico').src='/images/up_index_ico.gif';
			return false;
		}else{
			return true;
		}
	}else{
		loadTopClassList();
		return false;
	}
}

function loadTopClassList(){	
	var ajax=new AJAXRequest;
	var url='/JiabooInc/Top_ShopProduct_Class1.asp';
	ajax.get(url,function(obj){
		var objx=document.getElementById('UserLoginFrameX');
		var Result=obj.responseText;
		document.getElementById('Top_ClassDTBX').innerHTML=Result;
		Top_ClassDTBX_Open();
	});	
}

function AdvSearch()
{
	if(document.getElementById('search1').style.display=='block')
	{
		document.getElementById('search1').style.display='none';
		document.getElementById('sou_img').src='/images/sou_block.gif';
	}
	else if(document.getElementById('search1').style.display=='none')
	{
		document.getElementById('search1').style.display='block';
		document.getElementById('sou_img').src='/images/sou_none.gif';
	}
}

//function Top_ClassDTBX_Close(){
//	document.getElementById('Top_ClassDTBX').style.display='none';
//	document.getElementById('Top_ClassDTBX_Open_Ico').src='/images/down_index_ico.gif';
//	document.getElementById('Top_ClassDTBX_Open_BT').onclick=Top_ClassDTBX_Open;
//}
//function Top_ClassDTBX_Open(){
//	 
//	document.getElementById('Top_ClassDTBX').style.display="";
//	document.getElementById('Top_ClassDTBX_Open_Ico').src='/images/up_index_ico.gif';
//	document.getElementById('Top_ClassDTBX_Open_BT').onclick=Top_ClassDTBX_Close;
//}
//function Top_ClassDTBX_Close(){
//	document.getElementById('Top_ClassDTBX').style.display='none';
//	document.getElementById('Top_ClassDTBX_Open_Ico').src='/images/down_index_ico.gif';
//	document.getElementById('Top_ClassDTBX_Open_BT').onclick=Top_ClassDTBX_Open;
//}

//<span style="cursor:pointer" onClick="JiaBooShoppingCart_Display(0,0)">购物车</span>
//<a href="/UserCenter/Login.shtml">登陆</a> | 
//<a href="/UserCenter/AllReg_step1.asp">注册</a> |
//<a href="/UserCenter">我的帐户</a> |
//<a href="/about/help.shtml">帮助</a> |
//文章转帖功能
function delHtmlTag(str){ return str.replace(/<[^>]+>/g,""); };function cli(obj){var con = obj.id;var a = delHtmlTag(document.getElementById("artibodyTitle").innerHTML);
var b = "点击浏览内容详情...";/*if (document.getElementById("abstr")){b =  delHtmlTag(document.getElementById("abstr").innerHTML);}else{b = "点击浏览内容详情..."}*/if(con=="btn_kx"){var u='http://www.kaixin001.com/repaste/share.php?rtitle='+encodeURIComponent(a)+'&rurl='+encodeURIComponent(location.href)+'&rcontent='+encodeURIComponent(b);window.open(u,"kaixin");}else if(con=="btn_xn"){var u='http://share.xiaonei.com/share/buttonshare.do?link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(a);window.open(u,"xiaonei");}else if(con=="btn_db"){var u='http://www.douban.com/recommend/?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(a);window.open(u,"douban");}else if(con=="btn_fb"){var u='http://www.facebook.com/share.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(a)+'&rurl='+encodeURIComponent(location.href)+'&rcontent='+encodeURIComponent(b);window.open(u,"btn_fb");}else if(con=="btn_tt"){var u='http://twitter.com/home?status='+encodeURIComponent(a) + encodeURIComponent(location.href) +'&content'+ encodeURIComponent(location.href);window.open(u,"btn_tt");}else if(con=="btn_ff"){var u='http://fanfou.com/share.new?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(a)+'&d='+ encodeURIComponent(b);window.location.href = u;}else if(con=="btn_qq"){u='http://shuqian.qq.com/post?from=3&title='+encodeURIComponent(a)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1';window.open(u,"btn_qq");}else{ return false}}
