/*
人事档案的验证脚本
*/
function checkForm() {
	var userName = document.forms[0].txtUser;
	var companyName = document.forms[0].company;
	if(document.forms[0].rdo[0].checked) {
		if(userName.value == "请输入您的姓名") {
			window.alert("个人查询请输入您的姓名！");
			userName.focus();
			return false;
		}
	} else if (document.forms[0].rdo[1].checked) {
		if(companyName.value == "" ||companyName.value == "个人查询，可以不填写企业名称") {
			window.alert("企业查询请输企业的名称！");
			companyName.focus();
			return false;
		}
	}
	return true;
}

<!--
function GetObjID(ObjName){
	for (var ObjID=0; ObjID < document.form1.elements.length; ObjID++){
    	if ( document.form1.elements[ObjID].name == ObjName){
			return(ObjID);
			break;
		}
	}
  	return(-1);
}


function ChangeOption(ObjName, DesName)
{
  //GET OBJECT VALUE, ID OF DESTINATION OBJECT
  ObjID    = GetObjID(ObjName);
  DesObjID = GetObjID(DesName);

  //CLEAR OLD OPTIONS
  document.form1.elements[DesObjID].length= 0;
  //Add NEW OPTIONS
  if ( ObjID != -1 && DesObjID != -1 )
  {  CatValue = window.form1.elements[ObjID].value.substring(0, 2);
     if ( CatValue == "00" )
        document.form1.elements[DesObjID].length=0;
     else
     {  //PARSING
        if ( ObjName == "AreaCat")
           var tt = document.form1.AreaCode.value;
        else
           var tt = document.form1.FuncCode.value;
        var SubCategory = tt.split(";");
        
        //清空下拉框
       
        //GENERATE OPTIONS
        if(CatValue != '0'){
        	document.form1.elements[DesObjID].options[0]= new Option("---请选择---", "0");
	        j=1;
	        for (var i=0; i< SubCategory.length; i++ )
	        {   pp = SubCategory[i].split(",");
	            if ( pp[0].substring(0,2) == CatValue && pp[0].substring(2,4) != "00" )
	            {  document.form1.elements[DesObjID].options[j]= new Option( pp[1], pp[0]);
	               j++;
	            }//if
	        }//for
        }else{
        	document.form1.elements[DesObjID].options[0]= new Option("---请选择---","0");
        }
     }//if
  }//if
}//function

//-->

// JavaScript Document
<!--
function GetObjID(ObjName){
	for (var ObjID=0; ObjID < document.form1.elements.length; ObjID++){
    	if ( document.form1.elements[ObjID].name == ObjName){
			return(ObjID);
			break;
		}
	}
  	return(-1);
}


function ChangeOption(ObjName, DesName)
{
  //GET OBJECT VALUE, ID OF DESTINATION OBJECT
  ObjID    = GetObjID(ObjName);
  DesObjID = GetObjID(DesName);

  //CLEAR OLD OPTIONS
  document.form1.elements[DesObjID].length= 0;
  //Add NEW OPTIONS
  if ( ObjID != -1 && DesObjID != -1 )
  {  CatValue = window.form1.elements[ObjID].value.substring(0, 2);
     if ( CatValue == "00" )
        document.form1.elements[DesObjID].length=0;
     else
     {  //PARSING
        if ( ObjName == "AreaCat")
           var tt = document.form1.AreaCode.value;
        else
           var tt = document.form1.FuncCode.value;
        var SubCategory = tt.split(";");
        
        //清空下拉框
       
        //GENERATE OPTIONS
        if(CatValue != '0'){
        	document.form1.elements[DesObjID].options[0]= new Option("---请选择---", "0");
	        j=1;
	        for (var i=0; i< SubCategory.length; i++ )
	        {   pp = SubCategory[i].split(",");
	            if ( pp[0].substring(0,2) == CatValue && pp[0].substring(2,4) != "00" )
	            {  document.form1.elements[DesObjID].options[j]= new Option( pp[1], pp[0]);
	               j++;
	            }//if
	        }//for
        }else{
        	document.form1.elements[DesObjID].options[0]= new Option("---请选择---","0");
        }
     }//if
  }//if
}//function
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
//javascript for checking input form
<!--
//验证用户登录
function chk_form() {
	var username = document.frm_login.username;
	var password = document.frm_login.password;
	var VerifyCode = document.frm_login.VerifyCode;
	if("" == username.value) {
		window.alert("请填写用户名!");
		username.focus();
		return false;
	}
	if("" == password.value) {
		window.alert("请填写密码!");
		password.focus();
		return false;
	}
	if("" == VerifyCode.value) {
		window.alert("请填写验证码!");
		VerifyCode.focus();
		return false;
	}	
	return true;
}

//验证用户名密码输入
function chk_pwd() {
	var oldpwd = document.frm_pwd.oldpwd;
	var password = document.frm_pwd.password;
	var repassword = document.frm_pwd.repassword;
	
	if(""== oldpwd.value) {
		window.alert("请填写原始密码！");
		oldpwd.focus();
		return false;
	}
	if(""== password.value) {
		window.alert("请填写新设置密码！");
		password.focus();
		return false;
	}
	if(password.value.length < 6) {
		window.alert("密码的长度不能小于6字符！");
		password.focus();
		return false;
	}
	if(password.value != repassword.value) {
		window.alert("两次输入的密码不一致！");
		repassword.focus();
		return false;
	}
	return true;
}
//验证用户详细资料
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function chk_info()
{
	if(checkspace(document.Form11.jlname.value)) {
		alert("请填写简历名称！");
		document.Form11.jlname.focus();
		return false;
	}
  if(checkspace(document.Form11.zsname.value)) {
    alert("请添写真实姓名！");
	document.Form11.zsname.focus();
	return false;
  }
  var wordAs = /[\x00-\xff]/g.test(document.Form11.zsname.value);
  if(wordAs) {
    alert("姓名必须为中文！");
	document.Form11.zsname.focus();
	return false;
  }
  if (document.Form11.zsname.value.length <2)
        {
            alert("请认真填写姓名！");
			document.Form11.zsname.focus();
			return false;
        }
	
if(checkspace(document.Form11.jzaddr.value)) {
    alert("请添写居住地址！");
	document.Form11.jzaddr.focus();
	return false;
  }

  if(checkspace(document.Form11.card.value)) {
    alert("请添写证件号码！");
	document.Form11.card.focus();
	return false;
  }
   if (document.Form11.card.value.length != 15 && document.Form11.card.value.length != 18)
        {
            alert("请认真填写身份证号！");
			document.Form11.card.focus();
			return false;
        }
  if(document.Form11.sj.value.length != 11 && document.Form11.sj.value.length != 8)
   {
    alert("请正确添写手机号码！");
	document.Form11.sj.focus();
	return false;
  }

	return true;
}
function del1() { //v3.0
	document.form111.action="modxx.asp?action=del&id=1";document.form111.target="_self";}
	
function del2() { //v3.0
	document.form111.action="modxx.asp?action=del&id=2";document.form111.target="_self";} 
function del3() { //v3.0
	document.form111.action="modxx.asp?action=del&id=3";document.form111.target="_self";}
-->
