	function bindLoginAjax(){
		u=$("#tbUserNo").val();
		p=$("#tbUserPwd").val();
		if($.trim(u)=="" || p==""){
			alert("请输入完整的用户名或密码!");
			return false;
			}
		c=0;
		if($("#chkRemember").attr("checked")==true){c=1}
		$.post("/index/loginajax.htm",{user:u,pwd:p,rmb:c},function(data){
			if(data.indexOf("用户名或密码错误")==-1){
			$(".toplogin").html(data);
			}else{
				$("#tbUserPwd").val('');
				alert("用户名或密码错误!");
				}
			})
		}
	function logout(){
		$.post("/index/loginajax.htm",{logout:"exit"},function(data){
			$(".toplogin").load("/index/loginchk.htm");
			})
		}
	function dodownload(aid,mc){
		$.getScript("/articles/dl.htm?id="+aid+"&mc="+mc,function(){
			if(dl["st"]=="0"){
				location.href='/articles/down.htm?id='+aid+"&key="+dl["key"];
				return;
				} 
			if(dl["st"]=="2"){
			//	alert("未注册用户下载将在需要等待40秒钟.\n\n建议:注册用户无需等待，注册只要3秒!");
				$("#download").html("距自动下载开始还有 <span id='jsq'>40</span> 秒,请稍候!  <a href='' target='_blank' onclick='fckads()' class='reda' id='fhyxz'>非会员立即下载</a>&nbsp; &nbsp; <a href='/user/register.htm' target='_blank'>会员下载通道</a>");
			
			
			$(function(){
				  var count = 40;
				  var cc=0;
				  countdown = setInterval(function(){
					cc=$("#jsq").html();
					cc==""?cc=0:cc=cc*1;
					if(cc==1 && count>cc) count=cc;
					$("#jsq").html(count);
					if (count == 0) {
					  //window.location = 'http://google.com';
					  clearTimeout(countdown);
					  $.getScript("/articles/dl.htm?id="+aid+"&mc="+mc+"&do=getkey",function(){
							if(dl["st"]=="0"){
								rurl='/articles/down.htm?id='+aid+"&key="+dl["key"];
								$("#download").html("如果没有自动下载，请点击：<a href='"+ rurl +"'>重新下载</a>");
								location.href=rurl;
								return;
								} 
						  })
					}
					count--;
				  }, 1000);
				});
			 
				}
			
			})
		}
	function fckads(){
		var fs=new Array("/user/register.htm","http://www.kanzp.com","http://www.dushu520.com");
		var jn=Math.random();
		jn=parseInt(jn*3);
		var cc=$.cookie('clickads');
		var ads="http://www.100tuan.com/?urstid=47158";
		if(cc==null){
			$("#fhyxz").attr("href",ads);
			$.cookie('clickads', '100tuan', {expires: 1,path : '/'});
		 	clearjsq()
			return true
		}else{
			ads=fs[jn];
			$("#fhyxz").attr("href",ads).attr("target","self");
			return true;
		}
	}		 	   

		
 function clearjsq(){
				$("#jsq").html(1);
				$.ajax({url:"/index/aclicks.htm?as=1"}); 
				return;
				}
