<!-------------------用户选择开始---------------->
<%
    SzLogin login_LOGIN = new SzLogin();
    SzLoginInfo loginInfo_LOGIN = null;
    String sCond_LOGIN = "DLGSID=" + szCOMPANY_SESSION + " AND DLID NOT IN (" + sDLID_selected + ")";
    Iterator iter_LOGIN = login_LOGIN.getArrayList_2(sCond_LOGIN, "").iterator();

    //2012-1-4
    SzDepartInfo szDepartInfo_DEPART = null;
    Iterator iter_DEPART = null;
%>

<table width="350" align="left">
  <tr>
    <td colspan="3">
      <select name="DepartSelecting" style="width:200;" OnClick="javascript:SelectDepart();">
        <option value="0">=====请选择部门=====</option>
<%
    iter_DEPART = SzUserHelp.getDepartStaticList(szCOMPANY_SESSION).iterator();
    while (iter_DEPART!=null && iter_DEPART.hasNext()) {
        szDepartInfo_DEPART = (SzDepartInfo)iter_DEPART.next();
%>
        <option value="<%=szDepartInfo_DEPART.getBMID()%>"><%=SzLevelNumber.getLevelSpace(szDepartInfo_DEPART.getBMBH())%><%=szDepartInfo_DEPART.getBMMC()%></option>
<%
    }
%>
      </select>
	查找：<input type="text" name="txtLoginSelecting" class="txtClass1"><input type="button" class="btnClassShort" value="确定" OnClick="SearchOption(formUpdate.LoginSelecting, formUpdate.LoginSelected, formUpdate.txtLoginSelecting.value);">
    </td>
  </tr>
  <tr>
    <td width="150" align="right">
      <select name="LoginSelecting" size="20" multiple style="width:200;" OnDblClick="MoveSelectedOption(formUpdate.LoginSelecting, formUpdate.LoginSelected);">
      </select>
    </td>
    <td width="50">
      <table>
        <tr><td><input type="button" name="btnToRight" value=">>" OnClick="MoveAllOption(formUpdate.LoginSelecting, formUpdate.LoginSelected);"></td></tr>
        <tr><td><input type="button" name="btnToRight" value=" >"  OnClick="MoveSelectedOption(formUpdate.LoginSelecting, formUpdate.LoginSelected);"></td></tr>
        <tr><td><input type="button" name="btnToLeft"  value=" <"  OnClick="MoveSelectedOption(formUpdate.LoginSelected, formUpdate.LoginSelecting);"></td></tr>
        <tr><td><input type="button" name="btnToLeft"  value="<<" OnClick="MoveAllOption(formUpdate.LoginSelected, formUpdate.LoginSelecting);"></td></tr>
      </table>
    </td>
    <td width="150" align="left">
      <select name="LoginSelected" size="20" multiple style="width:200;" OnDblClick="MoveSelectedOption(formUpdate.LoginSelected, formUpdate.LoginSelecting);">
      </select>
    </td>
  </tr>
</table>
<!-------------------用户选择结束---------------->
<script language="javascript">
  //将全体员工放进LoginSelecting
  function ShowAllLogin_sms() {
    formUpdate.LoginSelecting.length = 0;
    for (var i=0; i<userPostCount_JS; i++) {
      if (userPostArray_JS[i][5] == "") {
	continue;
      }
      formUpdate.LoginSelecting.options[formUpdate.LoginSelecting.length]
      = new Option(userPostArray_JS[i][2] + " " + userPostArray_JS[i][5], userPostArray_JS[i][1]);
    }
  }
  //选择部门
  function SelectDepart() {
    //获取选择的部门
    var vBMID = 0;
    vBMID = formUpdate.DepartSelecting.value;
    //将部门下的员工放进LoginSelecting
    formUpdate.LoginSelecting.length = 0;
    //========显示部门的全体人员========
    if (vBMID > "0") {
      //如果选择了部门，或者选择了没有部门的
      for (var i=0; i<userPostCount_JS; i++) {
        //如果是同一个部门的，就放进去
        //因为员工是按照部门排序的，所以这里可以加一个变量，如果已经加完同一部门的，就跳出循环。
        if (userPostArray_JS[i][0] == vBMID) {
          formUpdate.LoginSelecting.options[formUpdate.LoginSelecting.length]
          = new Option(userPostArray_JS[i][2] + " " + userPostArray_JS[i][5], userPostArray_JS[i][1]);
        }
      } //for
    } else {
	ShowAllLogin_sms();
    }
  }
  ShowAllLogin_sms();
</script>