function messendcheck()
{
	var mestype=getId("mestype");
	var title=getId("title");
	var content=getFCK("content");
	if(title.value==""){alert("信息标题不能为空！");title.focus(); return false;}
	if(content==""||content=="<br />"){	alert("请输入信息内容！");return false;}
	lock_button("Submit1","Submit2","loading","<img src=../skins/images/loading.gif> "+lan_savemes);
}

function usergradechang(obj)
{
	var mesgetusers=getId("mesgetusers");
	var mestype=getId("mestype");
	if(obj.value=="")
	{
		mesgetusers.style.display="";
	}
	else
	{
		mesgetusers.style.display="none";
	}
}

function checkgradeform()
{
	var obj1=getId("grade");
	var obj2=getId("title");
	if(isNaN(obj1.value)||obj1.value=="")
	{
		alert("错误的等级格式！");
		obj1.value="";
		obj1.focus();
		return false;
	}
	if(obj2.value=="")
	{
		alert("请认真填写！");
		obj2.focus();
		return false;
	}
}

function usersubmit(obj)
{
	lock_button("Submit1","Submit2","loading","<img src=../skins/images/loading.gif> "+lan_savemes);
	obj.form.submit();
}

function lock_notshow(userid,thetype)
{
	getId(thetype+userid).innerHTML="<img src='../skins/images/loading.gif' />";
	ajax("admin_ajax.asp","userid="+userid+"&thetype="+thetype,thetype+userid);	
}

function selectOptionText(obj,id)
{
	var objsec=getId(id);
	objsec.value=obj.options[obj.selectedIndex].text;
}

function markcheck() {
	if(getId("username").value=="")
	{
	alert("请输入用户名");
	getId("username").focus();
	return false;
	}
	if (getId("usermark").value.length<1 || getId("usermark").value.length>6 || isNaN(getId("usermark").value.length))
	{
	alert("请输入正确的格式！");
	getId("usermark").focus();
	return false;
	}
	if(getId("content").value=="")
	{
	alert("请输入说明");
	getId("content").focus();
	return false;
	}
	return confirm_do();
}

function file_edit_check(obj)
{
	if (obj.title.value=="")
	{
		alert(file_n4);
		obj.title.focus();
		return false
	}
	if (obj.FileUrl.value=="")
	{
		alert(file_n5);
		return false
	}	
	lock_button("Submit1","Submit2","loading","<img src='../skins/images/loading.gif' /> "+lan_savemes);
}

function fileio(id)
{
	var obj=getId("file"+id);
	ajax2("file_ajax.asp","id="+id);
	if(obj.innerHTML.indexOf(lang("lan_close"))>0)
	{obj.innerHTML="<u>"+lang("lan_open")+"</u>";}
	else
	{obj.innerHTML="<b>"+lang("lan_close")+"</b>";}
}

function class_check(obj)
{
	if (obj.classname.value=="")
	{
		alert(lang("class_n6"));
		obj.classname.focus();
		return false
	}
	lock_button("Submit1","Submit2","loading","<img src=../skins/images/loading.gif> "+lan_savemes);
}

function onepageck(obj)
{
	if (obj.title.value=="")
	{
		alert(onepage_err1);
		obj.title.focus();
		return false;
	}
	lock_button("Submit1","Submit2","loading","<img src=../skins/images/loading.gif> "+lan_savemes);
	obj.submit();
}

function admin_edit_check(obj)
{
	if(obj.gradename.value=="")
	{
		alert(lang("sys_pwd4"));
		obj.gradename.focus();
		return false;
	}
	if(obj.username.value=="")
	{
		alert(lang("sys_pwd5"));
		obj.username.focus();
		return false;
	}
	if(obj.password1.value!=obj.password2.value)
	{
		alert(lang("sys_pwd2"));
		obj.password1.focus();
		return false;
	}
	if(obj.password1.value!=""&&obj.password1.value!="")
	{
		if(obj.password1.value.length<3||obj.password1.value.length>15)
		{
			alert(lang("sys_pwd3"));
			obj.password1.focus();
			return false;
		}
	}
}

function admin_add_check(obj)
{
	if(obj.gradename.value=="")
	{
		alert(lang("sys_pwd4"));
		obj.gradename.focus();
		return false;
	}
	if(obj.username.value=="")
	{
		alert(lang("sys_pwd5"));
		obj.username.focus();
		return false;
	}
	if(obj.password1.value=="")
	{
		alert(lang("sys_user10"));
		obj.password1.focus();
		return false;
	}
	if(obj.password2.value=="")
	{
		alert(lang("sys_user10"));
		obj.password2.focus();
		return false;
	}
	if(obj.password1.value!=obj.password2.value)
	{
		alert(lang("sys_pwd10"));
		obj.password1.focus();
		return false;
	}
}