/**
 *检查表单输入是否合法
 */
function checkForm()
{				
	if(getStrCharLen(document.thisForm.oldpassword.value) > 20 || getStrCharLen(document.thisForm.oldpassword.value) < 6 ||  !isStr(document.thisForm.oldpassword.value))
	{
		alert("对不起,密码必须为英文字母、数字或下划线，长度为6~20。");
		document.thisForm.oldpassword.focus();
		return false;
	}
	if(document.thisForm.oldpassword.value.indexOf("'")!="-1")
	{
		alert("对不起,密码资料中含有特殊字符,请重新输入!");
		document.thisForm.oldpassword.focus();
		return false;
	}
	
	if(getStrCharLen(document.thisForm.password.value) > 20 || getStrCharLen(document.thisForm.password.value) < 6 || !isStr(document.thisForm.password.value))
	{
		alert("对不起,密码必须为英文字母、数字或下划线，长度为6~20。");
		document.thisForm.password.focus();
		return false;
	}
	if(document.thisForm.password.value.indexOf("'")!="-1")
	{
		alert("对不起,密码资料中含有特殊字符,请重新输入!");
		document.thisForm.password.focus();
		return false;
	}

	if (document.thisForm.password.value != document.thisForm.confirmpassword.value)
	{
		alert("对不起,密码与重复密码不一致!");
		document.thisForm.confirmpassword.focus();
		return false;
	}
	
	document.thisForm.submit();
}

function form_onkeydown(varObj)
{
	if(window.event.keyCode==13)
	{
		checkForm();
	}
}
