// JavaScript Document
document.writeln('<scr'+''+'ipt type="text/javasc'+''+'ript" src="/Ajax/Ajax.js"></script>');
function initialize(){
	Ajax("","/Ajax/disposeSort.asp","",false);	
	setKeyWord();
}
function AjaxShowResult(xmlResult,target) {
	var result=new Array();
	result=xmlResult.split("'");
    // 显示搜索结果
	if(xmlResult.Trim().length>0){
		if(result[0]==""){
			document.getElementById("loginArea").innerHTML='<span class="Black02">您还没有登陆，请 </span><a href="javascript:LoginDialog(\'登录\',window.strContent1);" target="_top"><font color="#FF0000"><b>登录</b></font></a> | <a href="/member/reg1.html" target="_blank">注册</a> | <a href="/member/rechargemode.asp" target="_blank">充值</a>';
		}else{
			var GetUrl=window.location.href.toLowerCase();
			if(GetUrl.indexOf("dushi") == -1)
				document.getElementById("loginArea").innerHTML='原文欢迎您！<a href="/MyOffice/manage.asp">'+result[0]+'</a> <a href="/MyOffice/inbox.asp"><img src="/images/iecool.gif" /><span id="Num_Mail"></span></a>| <a href="/member/rechargemode.asp" target="_blank">充值</a> | <a href="/4399/index.asp" target="_blank">玩游戏</a> | <a href="/member/logout.asp" target="_top">退出</a>';
			else
				document.getElementById("loginArea").innerHTML='原文欢迎您！<a href="/MyOffice/manage.asp">'+result[0]+'</a> <a href="/MyOffice/inbox.asp"><img src="/dushi/images/iecool.gif" /><span id="Num_Mail"></span></a>| <a href="/member/rechargemode.asp" target="_blank">充值</a> | <a href="/4399/index.asp" target="_blank">玩游戏</a> | <a href="/member/logout.asp" target="_top">退出</a>';
		}
		if(document.getElementById("Num_Mail"))document.getElementById("Num_Mail").innerHTML=result[1];
	}
}
//重点推荐
var leftX=true;
var speed=15; 
var havescroll=0;
var Mar=new Array()
var direction;
var scrollPX=9;
function scrollCommend(){
	if(window.direction=="left"){
		document.getElementById("scrollCommend").scrollLeft=document.getElementById("scrollCommend").scrollLeft+scrollPX;
		window.havescroll=window.havescroll+scrollPX;
		scrollPX=9-parseInt(window.havescroll/26)+1;
		if(window.havescroll>=260){	
			scrollPX=9;
			clearInterval(Mar[0]);
		}
	}else{
		document.getElementById("scrollCommend").scrollLeft=document.getElementById("scrollCommend").scrollLeft-scrollPX;
		window.havescroll=window.havescroll-scrollPX;		
		scrollPX=parseInt(window.havescroll/26)+1;
		if(window.havescroll<=0){
			scrollPX=9;
			clearInterval(Mar[0]);
		}
	}
}
function startScroll1(direction){
	window.direction=direction;
	if(!leftX){	
		clearInterval(Mar[0]);
		Mar[0]=setInterval("scrollCommend()",window.speed);
		if(window.direction=="left"){
			document.getElementById("scrollTitle2").className ="bt2";
			document.getElementById("scrollTitle1").className ="bt1b";
		}else{
			document.getElementById("scrollTitle2").className ="bt2b";
			document.getElementById("scrollTitle1").className ="bt1";
		}
		leftX=!leftX;
	}
} 
function startScroll2(direction){
	window.direction=direction;
	if(leftX){	
		clearInterval(Mar[0]);
		Mar[0]=setInterval("scrollCommend()",window.speed);
		if(window.direction=="left"){
			document.getElementById("scrollTitle2").className ="bt2";
			document.getElementById("scrollTitle1").className ="bt1b";
		}else{
			document.getElementById("scrollTitle2").className ="bt2b";
			document.getElementById("scrollTitle1").className ="bt1";
		}
		leftX=!leftX;
	}
} 
//公告
function Marquee(){
	if(document.getElementById("gonggao2").offsetHeight-document.getElementById("gonggao").scrollTop <=0){
		document.getElementById("gonggao").scrollTop-=document.getElementById("gonggao1").offsetHeight; 
		document.getElementById("gonggao").scrollTop++;
	}else{ 
		document.getElementById("gonggao").scrollTop++;
	} 
	havescroll--;
	if(havescroll<=0){
		clearInterval(Mar[1]);
		havescroll=22;
	}
}
function setMarquee(){
	clearInterval(Mar[1]);
	Mar[1]=setInterval("Marquee()",speed);
}
//原文灯塔
function Marquee0(){ 
  if(document.getElementById("demo02").offsetWidth-document.getElementById("demo0").scrollLeft <=0) 
	  document.getElementById("demo0").scrollLeft-=document.getElementById("demo01").offsetWidth; 
  else{ 
	 document.getElementById("demo0").scrollLeft++;
  } 
} 
//滑动菜单
var slideX,id,odlid;
id=1;
oldid=0
var heightX;
heightX=0;
function slide(slideid){
	if(window.id!=slideid){
		window.oldid=window.id;
		window.id=slideid;
		clearInterval(window.slideX);
		if(window.oldid>0)document.getElementById("slide"+window.oldid).style.overflow="hidden";
		window.slideX=setInterval("sliding()",15);
	}
}
function sliding(){
	window.heightX+=20;
	if(window.heightX>210)window.heightX=210;
	if(window.oldid>0)document.getElementById("slide"+window.oldid).style.height=(210-window.heightX)+"px";
	document.getElementById("slide"+window.id).style.height=window.heightX+"px";
	if(window.heightX >= 210){
		window.heightX=0;
		document.getElementById("slide"+window.id).style.overflow="auto";
		clearInterval(window.slideX);
	}
}
function showCommend(id){
	if(id==1){
		document.getElementById("divImport").style.display="block";
		document.getElementById("divICover").style.display="none";
		//document.getElementById("divaffice").style.display="none";
		document.getElementById("spanImport").className="hover_b";
		document.getElementById("spanICover").className="";
		//document.getElementById("spanaffice").className="";
	}else if(id==2){
		document.getElementById("divImport").style.display="none";
		document.getElementById("divICover").style.display="block";
		//document.getElementById("divaffice").style.display="none";
		document.getElementById("spanImport").className="";
		document.getElementById("spanICover").className="hover_b";
		//document.getElementById("spanaffice").className="";
	}/*else if(id==3){
		document.getElementById("divImport").style.display="none";
		document.getElementById("divICover").style.display="none";
		document.getElementById("divaffice").style.display="block";
		document.getElementById("spanImport").className="";
		document.getElementById("spanICover").className="";
		document.getElementById("spanaffice").className="hover_b";
	}*/
}
function showLogin(){
	var strLogin="";
	strLogin=strLogin+'<form name="login" method="post" style="margin:0 0 0 0;" action="/Member/login.asp" arget="_self">';
    strLogin=strLogin+'  <dl><span class="an">用户登录</span>';
    strLogin=strLogin+'  	<dd class="dd_a">原文给你最好看的原创小说</dd>';
    strLogin=strLogin+'    <dd>';
	strLogin=strLogin+'		<div class="login_div">';
    strLogin=strLogin+'          <table width="180" border="0" cellspacing="0" cellpadding="0">';
    strLogin=strLogin+'            <tr>';
    strLogin=strLogin+'              <td>账号：</td>';
    strLogin=strLogin+'              <td><input name="name" type="text" class="textb" id="name" size="12" maxlength="16" tabindex="1" /></td>';
    strLogin=strLogin+'              <td><input type="image" name="submit" id="submit" src="images/login_an.gif" tabindex="3" /><input name="action" type="hidden" id="action" value="login"/></td>';
    strLogin=strLogin+'            </tr>';
    strLogin=strLogin+'            <tr>';
    strLogin=strLogin+'              <td>密码：</td>';
    strLogin=strLogin+'              <td><input name="pwd" type="password" class="textb" id="pwd" size="12" maxlength="20" tabindex="2" /></td>';
    strLogin=strLogin+'              <td class="login_red"><a href="/member/getpass.html" target="_blank" tabindex="4">找回密码</a></td>';
    strLogin=strLogin+'            </tr>';
    strLogin=strLogin+'          </table>';
    strLogin=strLogin+'        </div>';
    strLogin=strLogin+'     </dd>';
    strLogin=strLogin+'    <dd class="dd_b">登录即可获得YD积分哦！</dd>';
    strLogin=strLogin+'  </dl>';
	strLogin=strLogin+'</form>';
	document.getElementById("login").innerHTML=strLogin;
}
function SelectCN(v)
{
	if(v==1)
	{
		document.getElementById("ccn1").className="h_left";
		document.getElementById("cn1").style.display='block';
		document.getElementById("ccn2").className="h2_left";
		document.getElementById("cn2").style.display='none';
		document.getElementById("ccn3").className="h2_left";
		document.getElementById("cn3").style.display='none';
	}
	if(v==2)
	{
		document.getElementById("ccn1").className="h2_left";
		document.getElementById("cn1").style.display='none';
		document.getElementById("ccn2").className="h_left";
		document.getElementById("cn2").style.display='block';
		document.getElementById("ccn3").className="h2_left";
		document.getElementById("cn3").style.display='none';
	}
	if(v==3)
	{
		document.getElementById("ccn1").className="h2_left";
		document.getElementById("cn1").style.display='none';
		document.getElementById("ccn2").className="h2_left";
		document.getElementById("cn2").style.display='none';
		document.getElementById("ccn3").className="h_left";
		document.getElementById("cn3").style.display='block';
	}
}