﻿function GetCookie(name){
	var tmp, reg = new RegExp("(^| )"+name+"=([^;]*)(;|$)","gi");
	if( tmp = reg.exec( unescape(document.cookie) ) )
		return(tmp[2]);
	return null;
}
function ISLogin() {
    if (GetCookie("dnt")!=null && GetCookie("dnt")!="" && GetCookie("dnt")!="null")
    return true;
}
function LoginForm() 
{
	var str = '<a href="http://bbs.txtbook.com.cn/userregister.aspx?reurl=';
        var str1='" target=_blank>注册</a>   <a href="http://bbs.txtbook.com.cn/login.aspx?reurl=';
        var url=document.location;
        
	document.write(str);
        document.write(url);
        document.write(str1);
        document.write(url);
        document.write("\" target=_blank>登陆</a>");
};

function LoginOk()
{
	document.write("<div class=\"login\"><a href=\"http://share.txtbook.com.cn/upload.aspx\" target=_blank>我要共享</a>   <a href=\"http://hi.txtbook.com.cn/space.aspx\" target=_blank>我的空间</a>   <a href=\"http://hi.txtbook.com.cn/\" target=_blank>书友乐园</a>    <a href=\"http://u.txtbook.com.cn/\" target=_blank>我的读书坊</a>    <a href=\"http://bbs.txtbook.com.cn\" target=_blank>进入论坛</a></div>");
	}
function ShowState()
{
	if (ISLogin())
	{
		LoginOk();
	}
	else
	{
		LoginForm();
	}
	}
ShowState();
