// JavaScript Document
function addlink_check(theForm)      //添加友情连接时检查
{

   if (theForm.linkname.value == "")
  {
    alert("请输入友链名称!");
    theForm.linkname.focus();
    return (false);
  }

   if (theForm.linkurl.value == "")
  {
    alert("请输入友链地址!");
    //theForm.content.focus();
	theForm.linkurl.focus();
    return (false);
  }

  if (theForm.linktype.value=="0")
    {
    alert("请选择友链类型!");
    theForm.linktype.focus();
    return (false);
  }
	return true;
}

function textarea2html(f)    //从texteare传到html编辑器
{
	f.HTML.value=f.content.value;
}

function html2textarea(f)       //html编辑器数据传textarea
{
	f.content.value=f.HTML.value;
}

function addarticle_check(theForm)         //检查添加文章表单
{

   if (theForm.title.value == "")
  {
    alert("请输入标题!");
    theForm.title.focus();
    return (false);
  }

	return true;
}

	function search_check(form) //搜索表单检查
	{
		if (form.keyword.value=="")
		{
			alert("请输入要检索的关键字!");
			form.keyword.focus();
			return false;
		}
		return true;
	}
	
	function addmenu_check(form)     //添加二级目录检查
	{
		if (form.menuname.value=="")
		{
			alert("请输入要添加的栏目名称!");
			form.menuname.focus();
			return false;
		}
		return true;
	}	
	
	function login_check(form)    //管理员登陆表单检查
	{
		if (form.username.value=="")
		{
			alert("请输入用户名!");
			form.username.focus();
			return false;
		}
		if (form.userpassword.value=="")
		{
			alert("请输入密码!");
			form.userpassword.focus();
			return false;
		}
		if (form.userrand.value=="")
		{
			alert("请输入验证码!");
			form.userrand.focus();
			return false;
		}	
		if (form.userrand.value.length<4||form.userrand.value.length>4)
		{
			alert("验证码为四位数字!");
			form.userrand.focus();
			return false;
		}			
		return true;
	}
	
	function password_check(form)  //检查修改密码表单
	{
		if(form.oldpassword.value=="")
		{
			alert("请输入旧密码!");
			form.oldpassword.focus();
			return false;		
		}		
		if(form.newpassword.value=="")
		{
			alert("请输入新密码!");
			form.newpassword.focus();
			return false;		
		}
		if(form.repassword.value=="")
		{
			alert("请确认新密码!");
			form.repassword.focus();
			return false;		
		}
		if(form.newpassword.value!=form.repassword.value)
		{
			alert("两次输入的新密码不一致!");
			form.newpassword.focus();
			return false;		
		}						
		return true;
	}
	
	function addtopic_check(form)  //检查发表论坛主题
	{
		if (form.topic.value=="")
		{
			alert("请输入主题!");
			form.topic.focus();
			return false;
		}
		if (form.content.value=="")
		{
			alert("请输入要发表的内容!");
			form.content.focus();
			return false;
		}		
		return true;
	}
	
	function replytopic_check(form)  //检查回复主题
	{
		if (form.content.value=="")
		{
			alert("请输入要回复的内容!");
			form.content.focus();
			return false;
		}		
		return true;
	}	
	
	function addbbs_ban_check(form)  //检查添加论坛版块
	{
		if (form.title.value=="")
		{
			alert("请输入论坛版块标题!");
			form.title.focus();
			return false;
		}
		if (form.intro.value=="")
		{
			alert("请输入论坛版块简介!");
			form.intro.focus();
			return false;
		}		
		return true;
	}	
	
	function memberlogin_check(form)
	{
		if(form.username.value=="")
		{
			alert("请输入用户名!");
			form.username.focus();
			return false;
		}
		if(form.password.value=="")
		{
			alert("请输入密码!");
			form.password.focus();
			return false;			
		}
		return true;
	}
	
	function picupload_check(form)
	{
		if(form.picture.value=="")
		{
			alert("请选择要上传的图片!");
			form.picture.focus();
			return false;
		}
		return true;
	}	
	
	function votepinglun_check(form)
	{
		if(form.review_content.value=="")
		{
			alert("请输入内容!");
			form.review_content.focus();
			return false;
		}
		return true;
	}		
	