﻿function bbslogin(obj)
{
	var form=obj.form;
	if(form.username.value=="")
	{
		alert("请输入用户名！");	
		form.username.focus();
		return false;
	}
	if(form.PWD.value=="")
	{
		alert("请输入密码！");	
		form.PWD.focus();
		return false;
	}
}

function bbsding(db,id)
{
	var sec=ajax("fun/bbs/ding.asp","db="+db+"&id="+id);
	var obj=getId("ding_"+db+"_"+id);
	var oldnums=parseInt(obj.innerText);
	if(sec==1){obj.innerHTML=oldnums+1;}else{alert("您已经支持过了！");}
}

function bbssave(obj,thecase)
{
	var savesec=getId("savesec");
	var title=getId("title");
	if((thecase==1||thecase==2)&&title.value=="")
	{
		savesec.innerHTML="<b><img src='images/alz_check_error.gif' /> 请输入标题！</b>";
		title.focus();
		return false;
	}
	if(getId("eWebEditor1")){var html = eWebEditor1.getHTML();}else{var html = getId("content").value;}
	if(html=="")
	{
		savesec.innerHTML="<b><img src='images/alz_check_error.gif' /> 请输入内容！</b>";
		return false;
	}
	else
	{
		var classid=getId("classid").value;
		var id=getId("id").value;
		var id2=getId("id2").value;
		var page=getId("page").value;
		var face=getRadio("face");
		var title=getId("title").value;
		var xmlhttp = ajax_driv();	
		xmlhttp.open("post","fun/bbs/alz_bbs_save.asp",true);	
		xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState < 4 && savesec){	savesec.innerHTML="<u><img src='images/alz_check_right.gif' /> 操作成功，资料保存中，请稍侯……</u>";}		
			if (xmlhttp.readyState == 4)
			{
				var response = xmlhttp.responseText;
				if(thecase==1||thecase==2||thecase==3)
				{
					gotourl="?classid="+classid+"&id="+id+"&page="+page
					sucgoto(response,gotourl,111);	
				}
				else
				sucgoto(response,0,1);
			}
		};
		title=escape(title);
		html=escape(html);
		xmlhttp.send("thecase="+thecase+"&title="+title+"&content="+html+"&face="+face+"&classid="+classid+"&id="+id+"&id2="+id2);
	}
}

function adminOnebbs(text,id,db,dostr)
{
	if(confirm("确定对此贴进行"+text+"操作吗？"))
	{
		var sec=ajax("fun/bbs/alz_bbs_admin.asp","caseid=1&dostr="+dostr+"&db="+db+"&idstr="+id);
		if(sec!="")sucgoto(sec,0,1);
	}
}

function bbsadmin(obj)
{
	var dostr=obj.value;
	var str=obj.options[obj.selectedIndex].innerText;
	var idstr=getCheckbox("ids");
	if(dostr!=""&&idstr!=""&&confirm("您确定对选中贴子进行"+str+"操作吗？"))
	{
		var sec=ajax("fun/bbs/alz_bbs_admin.asp","caseid=2&str="+escape(str)+"&dostr="+dostr+"&idstr="+idstr);
		if(sec!="")sucgoto(sec,0,3);
	}
	else
	{
		obj.selectedIndex=0;
	}
}
