var BbsElse = {
	/*
	*直接快速回复帖子
	*/
	"postreply" : function () {
		 var else_cs=$("Hidden1").value.split(',');
       	 if (getCookie()=="") Bbs.showLoginDialog(true);
		 else
		 {		
		 	 if (else_cs[3].Trim()=="1") {alert("该文已被锁定，禁止回复！！");return false;}
		 	 IframeID=$("HtmlEditor").contentWindow;
			 reply_nr=IframeID.document.body.innerHTML;
			 if (reply_nr.length<10) {alert("回复内容不能少于10个字符！！");return false;}
			 var xhttp=makeRequest();
			 var str="l=1&n="+encodeURI(encodeURI(reply_nr))+"&t="+else_cs[1];
			 //str=escape(str);
			 $("post_d1").style.display="";
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						alert("提交回复成功！！");
						window.self.location = "bbs_else.aspx?bm="+else_cs[0]+"&id="+else_cs[1]+"&pg=0&#end";
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsPost.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		 }
    }
	/*
	*高级回复
	*/
    ,"newspost":function(bid,tid){
		var else_cs=$("Hidden1").value.split(',');
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else if (else_cs[5]=="1") BbsAdmin.reply(-1,'');
		else
		{
			window.self.location="bbs_post.aspx?lx=post&id="+bid+"&tid="+tid;
		}
	}
	/**
     *  送鲜花或扔鸡蛋
     */
	,"vote_dh":function (a,b,c,d){
			if (getCookie()=="") Bbs.showLoginDialog(true);
			else
			{
				var str="l=1&cs="+b+","+a+",0,"+d+",3";
				var xhttp=makeRequest();
				xhttp.onreadystatechange=function(){
					if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
					{
						Dialog.close();
						var fhjg=xhttp.responseText.Trim();
						if (fhjg=="") 
						{
							if (b==0) {$("xh_"+c).innerHTML=parseInt($("xh_"+c).innerHTML)+1;alert("谢谢你给我送花^_^");}
							else {$("jd_"+c).innerHTML=parseInt($("jd_"+c).innerHTML)+1;alert("臭鸡蛋真的好臭啊 ");}
						}
						else {alert(fhjg); return false;}
					}
				}
				xhttp.open("POST","JsVote.aspx",true);
				xhttp.setRequestHeader("Content-Length",str.length);     
				xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
				xhttp.send(str);
			}
	}
	/*
	**普通回复
	*/
	 ,"reply":function(lou, nickname) {
		 if (getCookie()=="") Bbs.showLoginDialog(true);
		 else
		 {
			 var content="";
			 if (lou==-1) content = "【回复 <font color=red>楼主</font> "+nickname+"】:<br>";
			 else content = "【回复 <font color=red>"+(lou+1)+" </font>楼 "+nickname+"】:<br>";
			 IframeID=$("HtmlEditor").contentWindow;
			 IframeID.focus();
			 IframeID.document.body.innerHTML=content;
		 }
	 }
	  /*
	**引用回复
	*/
	 ,"YYreply":function(lou, nickname,tzid) {
		 if (getCookie()=="") Bbs.showLoginDialog(true);
		 else
		 {
			 var str="l=2&cs="+lou+","+tzid;
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
					}
					else {
						var content="<TABLE style='BORDER-RIGHT: #cccccc 1px dotted; TABLE-LAYOUT: fixed; BORDER-TOP: #cccccc 1px dotted; BORDER-LEFT: #cccccc 1px dotted; BORDER-BOTTOM: #cccccc 1px dotted' cellSpacing=0 cellPadding=6 width='95%' align=center border=0><TBODY><TR><TD style='WORD-WRAP: break-word;' bgColor=#f3f3f3>";
			 if (lou==-1) content += "【<font color=red>楼主</font> "+nickname+"】提到:";
			 else content += "【<font color=red>"+(lou+1)+"</font>楼 "+nickname+"】提到:";
			 content +="<BR>"+fhjg+"</TD></TR></TBODY></TABLE><br><br>";
			 IframeID=$("HtmlEditor").contentWindow;
			 IframeID.focus();
			 IframeID.document.body.innerHTML=content;
						}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		 }
	 }
	 /**
	* 编辑帖子
	* 版面ID，帖子ID，回复ID
	**/
	,"newsedit":function (bid,tid,hid){
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{
			var str="l=5&cs="+bid+","+tid+","+hid;
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						window.self.location="bbs_edit.aspx?lx=post&id="+bid+"&tid="+tid+"&hid="+hid;
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		}
	}	
	/**
	* 管理选项判断
	* 管理方式，"版ID，帖ID，文ID，回ID,楼层"
	**/
	,"AdminGM":function (fs,idcs){
		if (fs=="") return false;
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{
			var AdminGM_lx="";
			switch (fs)
			{
				case "dtpb":AdminGM_lx="屏蔽.审核";break;
				case "zjda":AdminGM_lx="最佳答案";break;
				case "sdtz":AdminGM_lx="锁定.审核";break;
				case "tstz":AdminGM_lx="提升.下沉";break;
				case "sczt":AdminGM_lx="删除主题";break;
				case "ydbm":AdminGM_lx="移动版面";break;
				case "sxbj":AdminGM_lx="属性编辑";break;
				case "gdcz":AdminGM_lx="固顶操作";break;
				case "btxm":AdminGM_lx="标题醒目";break;
				case "fzzy":AdminGM_lx="跨站复制";break;
				case "ts":AdminGM_lx="投诉帖子";break;
			}
			if (AdminGM_lx=="") {alert("参数错误！！");return false;}
			var AdminGM_Val = new Array();
			AdminGM_Val=idcs.split(',');
			if (fs=="btxm") Dialog.show(AdminGM_lx, '/cmzxw/images2/inc/JS_cocor.aspx?lx='+fs+'&bid='+AdminGM_Val[0]+'&tid='+AdminGM_Val[1]+'&wid='+AdminGM_Val[2]+'&hid='+AdminGM_Val[3]+'&lou='+AdminGM_Val[4],false,false);
			else if (fs=="ydbm") Dialog.show(AdminGM_lx, '/cmzxw/images2/inc/JS_board.aspx?lx='+fs+'&bid='+AdminGM_Val[0]+'&tid='+AdminGM_Val[1]+'&wid='+AdminGM_Val[2]+'&hid='+AdminGM_Val[3]+'&lou='+AdminGM_Val[4],false,false);			
			else if (fs=="fzzy") Dialog.show(AdminGM_lx, '/cmzxw/images2/inc/JS_kzfz.aspx?lx='+fs+'&bid='+AdminGM_Val[0]+'&tid='+AdminGM_Val[1]+'&wid='+AdminGM_Val[2]+'&hid='+AdminGM_Val[3]+'&lou='+AdminGM_Val[4],false,false);
			else 
			{
				Dialog.show(AdminGM_lx, '/cmzxw/AjaxJS.aspx?lx='+fs+'&bid='+AdminGM_Val[0]+'&tid='+AdminGM_Val[1]+'&wid='+AdminGM_Val[2]+'&hid='+AdminGM_Val[3]+'&lou='+AdminGM_Val[4],false,false);
			}
			Dialog.setWidth(400);
		}
	}
	/**
	* 属性编辑
	**/
	,"EditSx":function (tid,bid,hid,sx,ly){
		//alert(tid+","+bid+","+hid+","+sx+","+ly);
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{
			var str="l=6&cs="+tid+","+bid+","+hid+","+sx+"&ly="+encodeURI(encodeURI(ly));
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						Dialog.close();
						alert("操作成功！！");
						window.location.reload();
						//window.self.location="bbs_edit.aspx?lx=post&id="+bid+"&tid="+tid+"&hid="+hid;
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		}
	}
	/**
	* 移动版面
	**/
	,"TopGet":function (tid,bid,bid2,ly){
		//alert(tid+","+bid+","+hid+","+sx+","+ly);
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{
			var str="l=7&cs="+tid+","+bid+","+bid2+"&ly="+encodeURI(encodeURI(ly));
			alert(str);
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						Dialog.close();
						alert("操作成功！！");
						window.location.reload();
						//window.self.location="bbs_edit.aspx?lx=post&id="+bid+"&tid="+tid+"&hid="+hid;
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		}
	}
	/**
	* 更改属性 是否精华 图片帖 推荐 导读 询问帖
	**/
	,"EditSx2":function (tid,bid,isbest,tp,tj,ly){
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{
			var str="l=8&cs="+tid+","+bid+","+isbest+","+tp+","+tj+"&ly="+encodeURI(encodeURI(ly));
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						Dialog.close();
						alert("操作成功！！");
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		}
	}
	/**
	* 固顶操作
	**/
	,"IsTop":function (tid,bid,zt,ly){
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{
			var str="l=9&tid="+tid+"&bid="+bid+"&zt="+zt+"&ly="+encodeURI(encodeURI(ly));
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						Dialog.close();
						alert("操作成功！！");
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		}
	}
	/**
	* 修改标题颜色
	**/
	,"TopColor":function (c,tid){
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{
			var str="l=10&tid="+tid+"&c="+encodeURI(encodeURI(c));
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						Dialog.close();
						alert("操作成功！！");
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		}
	}
	/**
	* 跨站复制
	**/
	,"TopKzfz":function (cs,ly){
		if (getCookie()=="") Bbs.showLoginDialog(true);
		else
		{alert(cs+"-"+ly);
			var str="l=11&cs="+cs+"&ly="+encodeURI(encodeURI(ly));
			var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{
					var fhjg=xhttp.responseText.Trim();
					if (fhjg=="") 
					{
						Dialog.close();
						alert("操作成功！！");
					}
					else {alert(fhjg); return false;}
				}
			}
			xhttp.open("POST","JsVote.aspx",true);
			xhttp.setRequestHeader("Content-Length",str.length);     
			xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
			xhttp.send(str);
		}
	}
	/**
     * 查看IP
     * @param boardid 版面ID
     * @param articleid 帖子ID
     */
    ,"showIP":function(boardid, articleid) {
       Dialog.show('查看IP', '/cmzxw/AjaxJS.aspx?lx=showIP&fs='+boardid+'&bid='+articleid,false,false);
	   Dialog.setWidth(400);
    }
}
		function vote_qz(a)
		{
			return AjaxVote.openinc("test.html").value;
		}
 
 
		function zd(a)
		{
			var else_cs=$("Hidden1").value.split(',');
			var zgpg1=parseInt($("zgpg").innerHTML);
		var dqpg1=parseInt($("dqpg").innerHTML);
			newpg=1;
			if (a==-1)
			{
				if (dqpg1==1) {alert("当前已为第一页");return;}
				newpg=1;
			}
			else if (a==-2)
			{
				if (dqpg1==1) {alert("当前已为第一页");return;}
				newpg=dqpg1-1;
			}
			else if (a==-3)
			{
				if (dqpg1==zgpg1) {alert("当前已为最后一页");return;}
				newpg=dqpg1+1;
			}
			else if (a==-4)
			{
				if (dqpg1==zgpg1) {alert("当前已为最后一页");return;}
				newpg=zgpg1;
			}
			else 
			{
				if (a=="") {alert("请输入有效页码");return;}
				else if (a<1) {alert("页码必须大于1");return;}
				else if (a>zgpg1) {alert("页码超出了当前最大页");return;}
				newpg=a;
			}
			window.self.location="bbs_else.aspx?id="+else_cs[1]+"&bm="+else_cs[0]+"&pg="+newpg;
		}
