function $$$$(item){
	return document.getElementById(item);
}
//document.domain='xunlei.com';
function c_getCookie(sName){
	var sSearch = sName + "=";
	var iOffset = document.cookie.indexOf(sSearch);
	if (iOffset != -1) {
		iOffset += sSearch.length;
		var iEnd = document.cookie.indexOf(";", iOffset);
		if (iEnd == -1)
			iEnd = document.cookie.length;
		return unescape(document.cookie.substring(iOffset, iEnd));
	}else 
		return "";
}
function c_setCookie(sName,sValue,sHours){
	if(arguments.length>2){
		var expireDate=new Date(new Date().getTime()+sHours*3600000);
		document.cookie = sName + "=" + escape(sValue) + "; path=/; domain=xunlei.com; expires=" + expireDate.toGMTString();
	}else
		document.cookie = sName + "=" + escape(sValue) + "; path=/; domain=xunlei.com"; 
}

function setCookies(cookieName,cookieValue, expirehours)
{
  var today = new Date();
  var expire = new Date();
  expire.setTime(today.getTime() + 3600000 * 356 * 24);
  document.cookie = cookieName+'='+escape(cookieValue)+ ';path=/;expires='+expire.toGMTString();
}

function ReadCookies(cookieName)
{
	var theCookie=''+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=='') return ''; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length;
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function LAST_READ_SET(bid, tid, booktitle, texttitle)
{
	if(texttitle=="") {
		texttitle = '首页';
	}
	var LRRead = bid+"#"+tid+"#"+booktitle+"#"+texttitle;
	setCookies("YCBLR", LRRead);
}

function LAST_LOOK_SET(bid,title,tid)
{
	tid = parseInt(tid);
	while(title.indexOf('#')>=0)
	{
		title = title.replace('#','');
	}
	while(title.indexOf('||')>=0)
	{
		title = title.replace('||','');
	}
	var CLASTREADVALUE = ReadCookies("YCLASTREADS");
	if (CLASTREADVALUE == '')
	{
		CLASTREADVALUE = ReadCookies("LASTREADS");
	}
	var NEWCOOK = bid + '#' + title + '#' + tid + '||';

	var CLARRS = CLASTREADVALUE.split("||");

	var CLASTREADVALUE_TMP = '';
	var TMP_NUM = 0;
	for(i=0;i<CLARRS.length;i++)
	{
		var LLA = CLARRS[i].split("#");
		if (LLA[0]==bid || LLA[0]=="") 
		{
			continue;
		}
		else
		{
			CLASTREADVALUE_TMP = CLASTREADVALUE_TMP + CLARRS[i]+ '||';
			TMP_NUM = TMP_NUM +1;
		}
		
		if (TMP_NUM>8) break;
	}

	CLASTREADVALUE = NEWCOOK + CLASTREADVALUE_TMP ;

	if(CLASTREADVALUE != ""){
		setCookies("LASTREADS", CLASTREADVALUE);
		setCookies("YCLASTREADS", CLASTREADVALUE);
	}
}
function movie_point(){	}
function movie_draw(){	}
function movie_draw_init(){	}
	

function c_login(u){
	top.location='http://i.xunlei.com/account/login.html?url='+encodeURIComponent(u);
}
function c_logout(o){
	c_setCookie("sessionid","");
	o.innerHTML='<a href="javascript:c_login(top.location);"> 登录 </a><a href="javascript:c_regist(top.location);"> 注册 </a>';
}
function c_regist(u){
	top.location='http://i.xunlei.com/account/signup2.shtml?url='+encodeURIComponent(u);
}
function c_verfySession(o){
	if(c_getCookie('sessionid')!=''){
		o.innerHTML='<a href="javascript:;">'+c_getCookie('nickname')+'('+c_getCookie('usrname')+')</a><a  href="javascript:c_logout('+o.id+');" >退出  </a>';
	}
}
//页面登录信息初始化
function initLogininfo()
{
	 var headDiv = $$$$("div_userinfo");
	 if(headDiv){
		c_verfySession(headDiv);
	 }
}
function doLoginOut(){
	 var headDiv = $$$$("div_userinfo");
	 if(headDiv){
		c_logout(headDiv);
	 }
}
//向左滚动
ScrollCrossLeft={interval:0,count:0,duration:0,step:0,srcObj:null,callback:null};
ScrollCrossLeft.doit=function(obj,b,c,d){
	var s=ScrollCrossLeft;
	obj.style.marginLeft=cpu(s.count,b,c,d)+'px';
	s.count++;
	if(s.count==d){
		clearInterval(s.interval);
		s.count=0;
		obj.style.marginLeft=b+c+'px';
		s.callback();
	}
	function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;};
}
ScrollCrossLeft.scroll=function(obj,step,span,beign,callback,duration){
	var s=ScrollCrossLeft;
	s.duration=duration;
	s.callback=callback;
	s.interval=setInterval(function(){s.doit(obj,beign,step*span,duration)},10);
}
function killErrors() {
return true;
}
window.onerror = killErrors;
var topstr='<DIV class=i-top><DIV class=site-server id=user_status><a href="/login.php?action=">登录</a><SPAN>|</SPAN><A href="/register.php">注册</A><SPAN>|</SPAN><A href="/getpass.php">忘记密码</A><SPAN>|</SPAN><A href="#">帮助中心</A></DIV><DIV class=xl-page><A href="#">VIP会员</A> <A href="/modules/article/applywriter.php">申请作家</A> <A href="/bookcase.php">我的书架</A> <A onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.xsguan.com/\');return(false)" href="javascript://" target=_self>设为首页</A> <A onClick="window.external.AddFavorite(\'http://www.xsguan.com\',\'小说馆\');" href="javascript://" target=_self>加入收藏</A></DIV></DIV><div class=menu>  <div class=logo><a href="/"><img src="/Image/Logo.gif" /></a></div>  <div  style="float:left; margin-left:50px;">  <img src="/Image/AD3.gif" height="60" width="740" />  </div></div><DIV class=channel-top><div style="float:left; margin-left:5px;"><B>推荐</B> -   <A href="/BookInfo_2992.html" blockid="2025">凡人修仙传</A></div><DL>  <DT>热门 -  <DD><A class=hotA  href="123">《仙人传奇》</A>  <A href="#">《魔法学徒》</A> <A href="#">《铁器时代》</A> <DT>推荐 -  <DD><A href="/bookInfo_540.html" blockid="2025">盘龙后传</A> </DD></DL></DIV>';
var footstr='<DIV class=footer><DIV class=f-nav><A href="#">关于小说馆</A><SPAN>|</SPAN><A href="#">网站地图</A><SPAN>|</SPAN><A href="#">联系我们</A><SPAN>|</SPAN><A href="#">广告服务</A><SPAN>|</SPAN><A href="#">友情链接</A><SPAN>|</SPAN><A href="#">帮助中心</A><SPAN>|</SPAN><A href="#">免责声明</A></DIV><DIV class=copyright>  <div>如果版权人认为在本站放置您的作品有损您的利益，请指出，本站确认后将会立即删除。  <br />  感谢大家对小说馆一贯的支持和厚爱。本站会继续做好，给各位书友提供一个免费舒适的看书平台 小说推荐:<a href="http://www.xsguan.com" target="_blank">斗罗大陆最新章节</a><br /></strong>Copyright &copy; 2009-2010 <strong><a href="http://www.xsguan.com">小说馆</a></strong> 版权所有 <font color="#016a9f">业务QQ:82992460 &nbsp; 154424601</font> &nbsp; ';
var gonggao='<div class="SB2" style=" height:135px; margin-top:45px; _margin-top:10px; overflow:hidden;"><div class="SBT2"><div class="TDiv TDBgOn FB">本站公告</div></div><div class="Box06" style="height:100px;">  <ul>  <li style="width:700px; height:22px;"><strong>[02月13日]</strong> 推荐每次增加积分2点，发表书评增加1积分，精华书评为每次增加积分20点,其他积分方式请参考<a href="#" >积分规则</a>.</li>   <li style="width:700px; height:22px;"><strong>[07月03日]</strong> 小说馆作家注意,转载作品必须要在作者栏目内填写原作者名称,没有填写的请在48小时内作出修改,否则将严肃处理.</li>   <li style="width:700px; height:22px;"><strong>[07月01日]</strong> 小说馆今日网站升级成功,增加分组书架,评论回复等实用功能。</li>  <li style="width:700px; height:22px;"><strong>[06月09日]</strong> 小说馆严禁书评灌水，发广告，违者将直接封杀ID!不再警告!</li>  </ul></DIV></div>';