
//贴子状态,原创,转贴...
function showmessagestates(num){
	var arrmessagestates = messagestates.split(",");
	if (num>arrmessagestates.length||num<0)
	{
		return "";
	}
	else{
		document.write(" "+arrmessagestates[num]);
	}
}

//状态,置顶,推荐...
function istop(num){
	if (num==1)	{document.write(" &nbsp;<img src='images/up.gif' alt='' /> ");}
}
function isgood(num){
	if (num==1)	{document.write(" <img src='images/good.gif' alt='' /> ");}
}
function islock(num){
	if (num==1)	{document.write(" <img src='images/locked.gif' alt='' /> ");}
}
function ishot(num){
	if (num>hothist)	{document.write(" <img src='images/hot.gif' alt='' /> ");}
}
//奖励贴
function ispoint (num){
	if (num>0)	{document.write(" <img src='images/point.gif' alt='' />");document.write (num);}
}

//显示回复表单
function showreply(islock){
	if (isreply==false){
		alert("对不起,您没有在此分类发表回复的权限");
	}
	else{
		if (islock==1)
		{
			alert("这个主题已经关闭,禁止回复!");
		}
		else {
			if (getobj("reply").style.display !="block")
			{
				getobj("reply").style.display = "block";
				//getobj("showcode").innerHTML="<img id='codestr' src='getcode.asp' width='50' height='12' style='cursor:pointer; vertical-align:middle;height:12px;' onclick='refreshstrcode(this)' />";
				SoonhostEdit("content",1);
				getobj("title").focus();	
			}
			//getobj("reply").style.display="";
			//
		}	
	}
	
}

/*选打开在线编辑器,再引用*/
function track(num,user,stime,islock){

	if (islock==1)
	{
		alert("这个主题已经关闭,禁止回复!");
	}
	else {
		var str;
		var thiscontent = getobj("zoom"+num).innerHTML;
		thiscontent = thiscontent.substr(0,500);
		str = "<div class='quote'><strong>以下是引用<i>"+user+"</i>在"+stime+"的发言：</strong>"+thiscontent+"</div>";
		str = str.replace("<p>&nbsp;</p>","");
		//alert(getobj("reply").style.display=="none");
		if (getobj("reply").style.display=="none"){
			getobj("content").value=str;
			showreply();
		}
		else
		{
			InsertHTML(str);
		}
	}
}

function shownewpost(str){
	var nowtime = new Date();
	var stime = str.split(",");
	var stimenum = parseInt(stime[0]*365*24*60,10) + parseInt(stime[1]*12*24*60,10) + parseInt(stime[2]*24*60,10)+parseInt(stime[3]*60,10)+parseInt(stime[4],10);
	var nowtimenum = nowtime.getFullYear()*365*24*60 + (nowtime.getMonth()+1)*12*24*60 + nowtime.getDate()*24*60 + nowtime.getHours()*60 + nowtime.getMinutes();

	if ((nowtimenum-stimenum)<(parseInt(newpost,10)*60))
	{
		document.write ("<span class='newpost'>New !</span>");
		
	}
}

//显示头街
function showmessagetitle(num){
	var mystar=0;
	var messagetitles= messagetitlepoint.split(",");
	for (var i=0;i<messagetitles.length;i++ )
	{
		if((num+0)>(messagetitles[i]+0)){mystar=i;}			
	}
	document.write("<img src='images/"+mystar+".gif\' alt='' />");
}

//一级分类点击后不对,二级分类点击后执行
function messageclass(num,obj){
	if (num==0)
	{
		obj.href="#";
		return false;
		
	}
	else
	{
		return true;
	}

}

/*显示最后编辑人信息*/
function showedit(etime,enickname){
	if(enickname.length>0){
		document.write("<div class='editinfo'>[本贴在 "+etime+" 被 " +enickname+ "编辑过]</div>");	
	}
}

/*显示评价*/
function showmastercomman(str){
	if (str.length>0)
	{
		str=str.split("$$$")
		for (var i=0;i<str.length ;i++ )
		{
			document.write("<div class='adcomman'>"+str[i].replace("|||",":")+"</div>")
		}
	}

}


