// JavaScript Document
$("#itemName01").html("股 友");
$("#itemName02").hide();
$("#itemName03").html("经纪人");

//文章投票
function artVote(artID,N){ //N = 1 / -1
	var cents = N;
	if (cents>0) {cents=1;} else if (cents<0) {cents=-1;} else { return; }
	$.get("/include/ajax.asp?act=artVote&articleID="+ artID +"&cents="+ cents +"",function(data){
		if (data.indexOf("successful")>=0) {
			var cents2 = (parseInt($(".art_ding_num").html()) + cents).toString();
			$(".art_ding_num").html(cents2);
		}
	});
	return false;
}


//评论翻页
function replyPage(N){
	
}

//加减账户
var typeKey = "";
if (_kindid=="16000000") {	typeKey = "lookTopview";}
else if (_kindid=="10000000") {	typeKey = "lookTrace";}
else {	typeKey = "readArticle";}
if (typeKey) {
	$.get("/include/ajax.asp?act=deCents&typeKey="+ typeKey +"&articleID="+ _articleID +"&authorID="+ _authorID +"",function(data){
		if (typeKey != "readArticle") {  $(".art_cont").hide();
			if (data.indexOf("Err:notLogin")>=0) { alert("您还未登录，请先登录!"); location.href="/members/?ref="+ window.location.href +"";}
			else if (data.indexOf("Err:noCents")>=0) { alert("您的账户余额不足！"); window.close();history.back();}
			else {$(".art_cont").show();}
		}
	});
}

//加载文章相关信息
	var userName = GetCookie("usernameJS");
	if (userName) {
		$(".head_member").html('您好，'+ userName +' <a href="/members/msgBox.asp" target="_blank">短信<span class="msgNewNum"></span></a> | <a href="/members/control.asp" target="_blank">会员中心</a> | <a href="/user/'+ userName +'/" target="_blank">个人主页</a>');
		$("#replyUsername").val(userName);
		$("#replyUserpass").val("******");
	} else {
		$(".head_member").html('<a href="/members/" target="_blank">登录</a>');
		$("#replyUsername").val("游客");
		$("#replyUserpass").val("");
	}
	//短信数量
	if (GetCookie("usernameJS")) {$.get("/include/ajax.asp?act=msgNewNum&username="+ GetCookie("usernameJS") +"&"+ Math.random() +"",function(data){
		if (data) {//alert(data);
			$(".msgNewNum").html(data);
		}
		});
	}
	
	//支持数和评论数等更新
	$.ajax({url:"/include/ajax.asp?act=artShow&type=article&articleID="+ _articleID +"", type:"GET", dataType:"xml", timeout:8000, 
		success:function(xml){//alert(xml);
		if (xml) {
			var voteNum = $(xml).find("item:first").find("voteNum").text();
			var hitNum = $(xml).find("item:first").find("hitNum").text();
			var replyNum = $(xml).find("item:first").find("replyNum").text();
			var userImg = $(xml).find("item:first").find("userImg").text();
			$(".art_ding_num").html(voteNum.toString());
			$(".art_reply_num").html(replyNum.toString());
			$(".art_hit_num").html(hitNum.toString());
			if (userImg) { $(".art_auImg").attr("src","/UploadFile/userPic/"+userImg);}
		}//End if
		}//End function
	});

	$.get("/include/ajax.asp?act=art_reply_list&type=article&articleID="+ _articleID +"&preUrl="+ _ug +"",function(data){
		if (data) {	$(".replys").html(data);	}
	});
	//$(".art_cont_ad");
	//$(".art_inc1").html("");
	//$(".art_inc2").html("");
	
	$.getScript('/members/StaticXmlhttpUpdate.asp?fileType=js');
	$.getScript('/members/getInfoNow.asp?fileType=js');
	$.getScript('/members/updateTV.asp?act=superview_date&fileType=js');
	//$.getScript('/members/updateTV.asp?act=rank&fileType=js');
	//$.getScript('/members/getInfo_4paper.asp?infoID=1&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=6&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=8&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=9&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=18&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=19&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=22&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=25&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=30&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=31&fileType=js');
	$.getScript('/members/getInfo_4paper.asp?infoID=32&fileType=js');
	
	
$(function(){

});

