function tl(){
	var lginfo = '';
	var New='';
	if($.cookie("userid")) {
		var nickname = decodeURIComponent($.cookie("nickname"));
		var userid = $.cookie("userid");
		var New = $.cookie("msgcount");
		lginfo='<span id="time_good">早上好，</span><a href="http://shop.zhubajie.com/'+$.cookie("userid")+'" target="_blank" class="blue2">'+$.cookie("nickname")+'</a><span>欢迎来到猪八戒网！</span>';
		lginfo+='<a href="http://u.zhubajie.com/login/dologout">退出</a>';
		if(New > 0) {
			lginfo+="<a href=\"http://u.zhubajie.com/message/system\" target=\"_blank\">站内信[<b><font color=red>New</font></b>]</a>";
		}else{
			lginfo+="<a href=\"http://u.zhubajie.com/message/system\" target=\"_blank\">站内信</a>";
			}
	} else {
		lginfo+='<span>您好，欢迎来到猪八戒网！</span><a href=\"http://u.zhubajie.com/login\" class=\"blue2\">请登录</a>&nbsp;<a href=\"http://u.zhubajie.com/register\" class=\"blue2\">免费注册</a>';
	}
	$("#loginstate").html(lginfo);
	
	//同步登陆
	var activekey=$.cookie("activekey");
	if(activekey) {		
		//document.writeln("<iframe src=\""+$.cookie("activekey")+"\" width=\"0\" height=\"0\" scrolling=\"no\"><\/iframe>");
		var frame=$(document.createElement("iframe"));
		frame.attr("style","width:0;height:0;");
		frame.attr("src",activekey);
		$(document.body).append(frame);
		$.cookie('activekey', null, {path: '/',expires:-1,domain:'.zhubajie.com' });
	}
	
	/*通栏导航*/
	var myzbj=$("#tl_myzbj"),
		myzbjc=$("#tl_myzbj .more_con"),
		tl_nav=$("#tl_nav"),
		tl_navlist=$("#tl_nav .more_nav"),
		time_good=$("#time_good");
	myzbj.hover(function(){
		myzbjc.show();
	},function () {
		myzbjc.hide();
	});
	
	tl_nav.hover(function(){
		tl_navlist.show();
	},function () {
		tl_navlist.hide();
	});
	
	now = new Date(),hour = now.getHours();
	if(hour < 6){time_good.text("凌晨好！")}
	else if (hour < 9){time_good.text("早上好,")}
	else if (hour < 12){time_good.text("上午好,")}
	else if (hour < 14){time_good.text("中午好,")}
	else if (hour < 17){time_good.text("下午好,")}
	else if (hour < 19){time_good.text("傍晚好,")}
	else if (hour < 22){time_good.text("晚上好,")}
	else {time_good.text("夜里好,")}
}
tl();