
<%
/************************************************************@@
  * Program Name	: group_add.jsp
  * Description			: 사용자정의 그룹등록
  * Author					: 구경모
  * Create Date		: 2008-03-08
  * History				:
@@************************************************************/
%>

<%@ page contentType="text/html; charset=UTF-8"
	import="kr.co.kihyun.moumi.Moumi" import="kr.co.kihyun.lang.MString"
	import="kr.co.kihyun.lang.Encoder" import="kr.co.kihyun.lang.MInteger"
	import="kr.co.kihyun.lang.MLong" import="java.net.URLEncoder"
	import="java.net.URLDecoder"
	import="kr.co.kihyun.beans.user.HttpSSOLogin"
	import="kr.co.kihyun.beans.user.UserGroup"
	import="kr.co.kihyun.lang.Encoder"%>

<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>

<%
try{

	/********** session내의 userId **********/
	String usID = HttpSSOLogin.getLoginID(request);

	/****** Parameter ******/
	Long docID = MLong.parseLong(request.getParameter("docID"),-1L);
	String choice = clearXSS(request.getParameter("choice"),"");
	String deptIDs = clearXSS(Encoder.toJava(MString.checkNull(request.getParameter("deptIDs"))),"");
	String deptNames = clearXSS(Encoder.toJava(MString.checkNull(request.getParameter("deptNames"))),"");
	String userIDs = clearXSS(Encoder.toJava(MString.checkNull(request.getParameter("userIDs"))),"");
	String userNames = clearXSS(Encoder.toJava(MString.checkNull(request.getParameter("userNames"))),"");

	/****** Parameter *******/
	String partID = request.getParameter("partID");
	String partName = clearXSS(Encoder.toJava(request.getParameter("partName")),"");

	UserGroup ugroup = new UserGroup();

	//부서리스트 가져오기
	String[] idList = null;
	String[] nameList = null;

	idList = ugroup.getDeptID(partID);
	nameList = ugroup.getDeptName(partID);
	if(idList != null){
		for(int i=0; i < idList.length; i++){
			if( i == 0 ){
				deptIDs = deptIDs + idList[i];
			}else{
				deptIDs = deptIDs + "," + idList[i] ;
			}
		}

		for(int j=0; j < nameList.length; j++){
			if( j == 0){
				deptNames = deptNames + nameList[j];
			}else{
				deptNames = deptNames + "," + nameList[j] ;
			}
		}
	}

	//개인리스트 가져오기
	ugroup.userSetting(partID);
	String[] userUserID = ugroup.getUserUserID();
	String[] userUserName = ugroup.getUserUserName();
	String[] userDeptID = ugroup.getUserDeptID();
	if(userUserID != null){
		for(int i=0; i<userUserID.length; i++){
			if(i==0){
				userIDs = userUserID[i]+"/"+userDeptID[i];
				userNames = userUserName[i];
			}else{
				userIDs += ","+ userUserID[i]+"/"+userDeptID[i];
				userNames += ","+userUserName[i];
			}
		}
	}

	StringBuffer setListBuff = new StringBuffer();
	setListBuff.append("nameList = '"+deptNames+"';\n");
	setListBuff.append("idList = '"+deptIDs+"';\n");
	setListBuff.append("unameList = '"+userNames+"';\n");
	setListBuff.append("uidList = '"+userIDs+"';\n");
%>

<HTML>
<HEAD>
<TITLE><%=Moumi.getTitle()%></TITLE>
<link rel="stylesheet" href="/totsys/common/css/text.css"
	type="text/css">
<link rel="StyleSheet" href="/totsys/common/css/dtree.css"
	type="text/css">
<link rel="stylesheet" href="/totsys/common/css/kecttep.css"
	type="text/css">
<script type="text/javascript" src="/totsys/common/js/dtree.js"></script>
<script src="/totsys/common/js/rollover.js"></script>





<script language="javascript">
			var tstate = false;
			var delstate = false;

			var nameList='';
			var idList='';

			var idAll='';

			var selid='';

			var unameList='';
			var uidList='';

			var idUpper = false; // 상위 디렉토리 여부지정 변수
			var userGroup = false; // 사용자정의 그룹인지 여부지정 변수

			<%= setListBuff.toString() %>//자바에서가져온 값을 자바스크립트변수로 사용


			function toRightFrame(){
				if(tstate == true){
					leftFrame.movelist();
				}
				delstate = true;
			}

			function toLeftFrame(){
				rightFrame.movelist();
				if(delstate == true){
					//tstate = false;
				}
				if(nameList == '' && idList == '')
					delstate = false;
			}

			function AllRightSelect(){
				if(selid != ''){
					rightFrame.AllSelect();
				}
			}

			function AllDeptSelect(){
				if(idList != ''){
					deptFrame.AllSelect();
				}
			}

			function AllUserSelect(){
				if(uidList != ''){
					userFrame.AllSelect();
				}
			}

			function AllCancel(){
				if(tstate == true){
					leftFrame.AllCancel();
				}
			}

			function leftAllAdd(){
				var id = idAll;
				if(id==''){
					return;
				}
				if(	idList == '' ){
					document.list.idList.value = idList = id;
					idList=idList+"";
				}
				document.listAll.idList.value = idList;
				document.listAll.topid.value = id;
				document.listAll.submit();
			}

			function userList(id){
				idAll=id;
				selid = id;
				idUpper = false;
				userGroup = false;

				document.userlist.id.value = id;
				document.userlist.target="rightFrame";
				document.userlist.selectType.value="right";
				document.userlist.didList.value = idList;

				document.userlist.submit();
			}

			//사용자정의 조직도 부서선택
			function userTopList(id){
				idUpper = true;
				idAll = id;
				selid = id;
				userGroup = true;
			}

			function userDeptList(id){
				idAll=id;
				selid = id;
				idUpper = false;
			}

			// 부서 추가 버튼을 눌렀을시 실행
			function deptConfirm(){
				if (idUpper == false) { // idUpper값은 HttpDeptList에서 최상위부서라면 이 문서의 noneList 메서드에 의해 true값이 들어간다.
					deptSelect(); // 최상위 부서가 아니라면 추가 시키는 메서드로 이동
				}
				else // 최상위부서라면
				{
					alert("하위 부서를 선택해주세요");
				}
			}

			function deptSelect(){
				if(selid == '' ){
					alert("부서를 먼저 선택해주세요");
				}else{
					id = selid;

					if(	idList == '' ){
						document.list.idList.value = idList = id;
						idList=idList+"";
					}else{
						listAdd(idList, id);
						document.list.idList.value = idList;
					}

					document.list.uidList.value = uidList;
					document.list.submit();
				}
			}

			function noneList(id){ // 최상위 부서라면 true값으로 리턴해준다
				idUpper = true;
				idAll = id;
				selid = id;
				userGroup = false;

				document.userlist.id.value = id;
				document.userlist.target="rightFrame";
				document.userlist.selectType.value="right";
				document.userlist.didList.value = idList;

				document.userlist.submit();

			}

			function deptAllSelect(){
				if(selid == '' ){
					alert("부서를 먼저 선택해주세요");
 				}else{
					id = selid;
					if(	idList == '' ){
						document.listAll.idList.value = idList="";
						idList=idList+"";
					}else{
						//listAdd(idList, id);
						document.listAll.idList.value = idList;
					}

					if(userGroup == true){
						document.listAll.userGroup.value = "true";
					}else{
						document.listAll.userGroup.value = "false";
					}

					document.listAll.topid.value = id;
					document.listAll.uidList.value = uidList;
					document.listAll.submit();
				}
			}

			function userSelect(){
				if(selid != '' ){
					rightFrame.movelist();

					document.userlist.didList.value = idList;
					document.userlist.submit();
				}
			}

			function userAllSelect(){
				if(selid != '' ){
					if(userGroup == true){
						document.userAlllist.userGroup.value = "true";
					}else{
						document.userAlllist.userGroup.value = "false";
					}

					document.userAlllist.id.value = selid;
					document.userAlllist.nameList.value = unameList;
					document.userAlllist.idList.value = uidList;
					document.userAlllist.didList.value = idList;

					document.userAlllist.target="userFrame";
					document.userAlllist.selectType.value="user";
					document.userAlllist.submit();
				}
			}


			function deptDelete(){
				if(idList != '' ){
					deptFrame.movelist();

					document.list.uidList.value = uidList;
					document.list.submit();
				}
			}

			function userDelete(){
				if(uidList != '' ){
					userFrame.movelist();

					document.userlist.didList.value = idList;
					document.userlist.submit();
				}
			}

			function AllDelete(){
				if(idList != '' ){
					deptFrame.alldeletelist();

					document.list.uidList.value = uidList;
					document.list.submit();
				}

				if(uidList != '' ){
					userFrame.alldeletelist();

					document.userlist.didList.value = idList;
					document.userlist.submit();
				}
			}

			function listAdd(idList1, idList2){

				var arrayID1 = idList1.split(",");

				var isEquals = false;

				if(idList1 == ''){
					idList = idList1;
					return;
				}

				//list1의 내용과 list2의 값이 같은게 있다면 루프를 나가라
				isEquals = true;
				for(var i=0; i < arrayID1.length; i++){
					if(idList2 == arrayID1[i]){
						isEquals = false;
						break;
					}
				}

				if(isEquals){
					idList1 += ","+idList2;
				}

				idList = idList1;
				return;
			}

			//사용자 리스트에 사용자 추가
			function userFrameAdd(name, id){

				name = lastStrDel(name, ",");
				id = lastStrDel(id, ",");

				if(unameList == '' && uidList == ''){
					document.userlist.nameList.value = unameList = name;
					document.userlist.idList.value = uidList = id;

				}else{
					//사용자의 ID와 Name추가(전역번수 uidList, unameList)
					uaddList(uidList, id, unameList, name);
					document.userlist.nameList.value = unameList;
					document.userlist.idList.value = uidList;
				}

				tstate = true;

				document.userlist.didList.value = idList;
				document.userlist.target="userFrame";
				document.userlist.selectType.value="user";
				document.userlist.submit();
				return;
			}

			//사용자 리스트에 사용자 삭제
			function userFrameDel(name, id){
				name = lastStrDel(name, ",");
				id = lastStrDel(id, ",");

				if(unameList == '' && uidList == ''){
					document.userlist.nameList.value = unameList = name;
					document.userlist.idList.value = uidList = id;

				}else{
					udelList(id, name);
					document.userlist.nameList.value = unameList;
					document.userlist.idList.value = uidList;
				}

				tstate = true;

				document.userlist.didList.value = idList;
				document.userlist.target="userFrame";
				document.userlist.selectType.value="user";
				document.userlist.submit();
				return;
			}

			//추가 리스트에 기관/부서 추가
			function leftFrameAdd(name, id){
				name = lastStrDel(name, ",");
				id = lastStrDel(id, ",");

				if(nameList == '' && idList == ''){
					document.list.nameList.value = nameList = name;
					document.list.idList.value = idList = id;

				}else{
					//기관/부서의 ID와 Name추가(전역번수 idList, nameList)
					addList(idList, id, nameList, name);
					document.list.nameList.value = nameList;
					document.list.idList.value = idList;
				}

				tstate = true;

				document.list.uidList.value = uidList;
				document.list.submit();
				return;
			}

			//추가 리스트에 기관/부서 삭제
			function leftFrameDel(name, id){
				name = lastStrDel(name, ",");
				id = lastStrDel(id, ",");

				if(nameList == '' && idList == ''){
					document.list.nameList.value = nameList = name;
					document.list.idList.value = idList = id;

				}else{
					delList(id, name);
					document.list.nameList.value = nameList;
					document.list.idList.value = idList;
				}

				tstate = true;

				document.list.uidList.value = uidList;
				document.list.submit();
				return;
			}

			function addList(idList1, idList2, naList1, naList2){

				var arrayID1 = idList1.split(",");
				var arrayID2 = idList2.split(",");
				var arrayNa2 = naList2.split(",");

				var idList3 = '';
				var naList3 = '';
				var isEquals = false;

				if(idList1 == ''){
					nameList = naList1;
					idList = idList1;
					return;
				}

				for(var j=0; j < arrayID2.length; j++){
					//list1의 내용과 list2의 값이 같은게 있다면 루프를 나가라
					isEquals = true;
					for(var i=0; i < arrayID1.length; i++){
						if(arrayID2[j] == arrayID1[i]){
							isEquals = false;
							continue;
						}
					}

					if(isEquals){
						idList3 += ","+arrayID2[j];
						naList3 += ","+arrayNa2[j];
					}
				}

				idList = idList1+idList3;
				nameList = naList1+naList3;
				return;
			}

			function delList(idList1, naList1){
				idList = idList1;
				nameList = naList1;
				return;
			}

			function uaddList(idList1, idList2, naList1, naList2){

				var arrayID1 = idList1.split(",");
				var arrayID2 = idList2.split(",");
				var arrayNa2 = naList2.split(",");


				var idList3 = '';
				var naList3 = '';
				var isEquals = false;

				if(idList1 == ''){
					unameList = naList1;
					uidList = idList1;
					return;
				}

				for(var j=0; j < arrayID2.length; j++){
					//list1의 내용과 list2의 값이 같은게 있다면 루프를 나가라
					isEquals = true;
					for(var i=0; i < arrayID1.length; i++){
						if(arrayID2[j] == arrayID1[i]){
							isEquals = false;
							continue;
						}
					}

					if(isEquals){
						idList3 += ","+arrayID2[j];
						naList3 += ","+arrayNa2[j];
					}
				}

				uidList = idList1+idList3;
				unameList = naList1+naList3;
				return;
			}


			function udelList(idList1, naList1){
				uidList = idList1;
				unameList = naList1;
				return;
			}

			function getDelNameList(list1, list2){
				var array1 = list1.split(",");
				var array2 = list2.split(",");

				var list3 = '';
				var isEquals = false;

				if(list1 == ''){
					return list1;
				}

				for(var i=0; i < array1.length; i++){

					isEquals = true;
					for(var j=0; j < array2.length; j++){
						if(array1[i] == array2[j]){
							isEquals = false;
							continue;
						}
					}

					if(isEquals){
						list3 += array1[i]+",";
					}
				}

				return lastStrDel(list3, ",");
			}

			function getDelIDList(list1, list2){
				var array1 = list1.split(",");
				var array2 = list2.split(",");

				var list3 = '';
				var isEquals = false;

				if(list1 == ''){
					return list1;
				}

				for(var i=0; i < array1.length; i++){

					isEquals = true;
					for(var j=0; j < array2.length; j++){
						if(array1[i] == array2[j]){
							isEquals = false;
							continue;
						}
					}

					if(isEquals){
						list3 += array1[i]+",";
					}
				}

				return lastStrDel(list3, ",");
			}

			//마지막 끝에 붙은 ","삭제 하기
			function lastStrDel(str, delStr){
				var lastStr = str.lastIndexOf(delStr);
				return str.substring(0, lastStr);
			}

			function AllDataRemove(){
				nameList.value='';
				idList.value='';
			}

			function sessDeptsInit(){
				//var idL = opener.docForm.deptIDs.value;
				//var nameL = opener.docForm.deptNames.value;
				var idL = "<%= deptIDs %>";
				var nameL = "<%= deptNames %>";
				if("<%= deptIDs %>" != '' && "<%= deptNames %>" != '' && idL != '' && nameL != ''){
					addList(idL, "<%= deptIDs %>", nameL, "<%= deptNames %>");
				}else if("<%= deptIDs %>" != '' && "<%= deptNames %>" != ''){
					idL = "<%= deptIDs %>";
					nameL = "<%= deptNames %>";
				}

				ButtonTrueOpener(nameL, idL);
				list.submit();
			}

			function ButtonTrueOpener(name, id){
				delstate = true;

				if(nameList == '' && idList == ''){
					document.list.nameList.value = nameList = name;
					document.list.idList.value = idList = id;
				}else{
					//기관/부서의 ID와 Name추가(전역번수 idList, nameList)
					addList(idList, id, nameList, name);
					document.list.nameList.value = nameList;
					document.list.idList.value = idList;
				}
				document.list.uidList.value = uidList;
				document.list.submit();
				return;
			}

			function sessUsersInit(){
				//var idL = opener.docForm.userIDs.value;
				//var nameL = opener.docForm.userNames.value;
				var idL = "<%= userIDs %>";
				var nameL = "<%= userNames %>";
				if("<%= userIDs %>" != '' && "<%= userNames %>" != '' && idL != '' && nameL != ''){
					uaddList(idL, "<%= userIDs %>", nameL, "<%= userNames %>");
				}else if("<%= userIDs %>" != '' && "<%= userNames %>" != ''){
					idL = "<%= userIDs %>";
					nameL = "<%= userNames %>";
				}

				UButtonTrueOpener(nameL, idL);
				userlist.submit();
			}

			function UButtonTrueOpener(name, id){
				delstate = true;

				if(unameList == '' && uidList == ''){
					document.userlist.nameList.value = unameList = name;
					document.userlist.idList.value = uidList = id;
				}else{
					//기관/부서의 ID와 Name추가(전역번수 idList, nameList)
					uaddList(uidList, id, unameList, name);
					document.userlist.nameList.value = unameList;
					document.userlist.idList.value = uidList;
				}
				document.userlist.didList.value = idList;
				document.userlist.selectType.value="user";
				document.userlist.target="userFrame";
				document.userlist.submit();
				return;
			}

			function select(sel){
				//location.reload("./popup_dept_list.jsp?docID='<%=docID%>'&choice="+sel+"&deptIDs="+list.idList.value+"&deptNames="+list.nameList.value);
				location.reload("./popup_dept_list.jsp?docID=<%=docID%>&choice="+sel+"&deptIDs="+idList+"&deptNames="+nameList);
			}

			function groupAdd(){
				if(group.groupName.value == null || group.groupName.value == ""){
					alert("그룹명을 입력하세요!");
					group.groupName.focus();
				}else if(idList == '' && uidList == ''){
					alert("선택된 부서 및 사용자가 없습니다.");
				}else{
					document.group.deptIDs.value = idList;
					document.group.deptNames.value = nameList;
					document.group.userIDs.value = uidList;
					document.group.userNames.value = unameList;
					document.group.submit();
				}

			}


		</script>



</HEAD>

<form name="list" method="post"
	action="/servlet/kr.co.kihyun.beans.user.HttpDeptList"
	target="deptFrame"><input type="hidden" name="nameList">
<input type="hidden" name="idList"> <input type="hidden"
	name="uidList"></form>
<form name="userlist" method="post"
	action="/servlet/kr.co.kihyun.beans.user.HttpUserList"
	target="rightFrame"><input type="hidden" name="id"> <input
	type="hidden" name="nameList"> <input type="hidden"
	name="didList"> <input type="hidden" name="idList"> <input
	type="hidden" name="selectType"></form>
<form name="listAll" method="post"
	action="/servlet/kr.co.kihyun.beans.user.HttpDeptAllList"
	target="deptFrame"><input type="hidden" name="topid"> <input
	type="hidden" name="nameList"> <input type="hidden"
	name="idList"> <input type="hidden" name="uidList"> <input
	type="hidden" name="userGroup"></form>
<form name="userAlllist" method="post"
	action="/servlet/kr.co.kihyun.beans.user.HttpUserAllList"
	target="rightFrame"><input type="hidden" name="id"> <input
	type="hidden" name="nameList"> <input type="hidden"
	name="didList"> <input type="hidden" name="idList"> <input
	type="hidden" name="selectType"> <input type="hidden"
	name="userGroup"></form>

<body style='' BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0
	MARGINHEIGHT=0>
<table width="100%" height="70" border="0" cellpadding="0"
	cellspacing="0">

	<tr>
		<td nowrap width="0"></td>
		<td valign="top">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">

			<!--스타일시트-->
			<link rel="stylesheet" href="/totsys/common/css/kecttep.css"
				type="text/css">

			<!-- 뉴타이틀 -->
			<jsp:include page="/totsys/common/inc/title/title.jsp" flush="true" />
			<!-- 뉴타이틀 -->

			<!----  topbar  버튼 시작---->
			<tr>
				<td>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="537"><a
							href="/totsys/login/envsetting/group/group_setup.jsp"><img
							src="images/bt_doc_list.gif"></a></td>
						<td align="right">
						<table border="0" cellspacing="0" cellpadding="0">
							<tr>
								<!--td><a href="#" onclick="javascript:group();"><img src="images/bt_group_reg.gif" border="0"></a></td-->
								<!--td><a href="/totsys/login/envsetting/group/group_add.jsp"><img src="images/bt_group_reg.gif" border="0"></a></td-->
							</tr>
						</table>
					</tr>
				</table>
				</td>
			</tr>
			<!----  topbar  버튼 끝---->

			<!--1픽셀 띄우기-->
			<tr>
				<td height="1"></td>
			<tr>

				<!--파란색 밑줄-->
			<tr>
				<td bgcolor="6891cb" height="2"></td>
			</tr>

			<!--1픽셀 띄우기-->
			<tr>
				<td height="1"></td>
			<tr>


				<!----  topbar  버튼 시작---->
			<tr>
				<td>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="537"></td>
						<td align="right">
						<table border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td><a href="#"
									onclick="window.open('./popup_form_list.jsp','makepoll','width=800,height=480,scrollbars=yes,resizable=yes');"><img
									src="images/search_form.gif"></a></td>
							</tr>
						</table>
					</tr>
				</table>
				</td>
			</tr>
			<!----  topbar  버튼 끝---->
			<tr>
				<td height="10"></td>
			<tr>






				<form name="group" method="post"
					action="/servlet/kr.co.kihyun.beans.user.HttpUserGroupModify">
				<!--세미타이틀-->
				<tr>
					<td height="10"></td>
				</tr>
				<tr>
					<td colspan="4">
					<table border="0" width="100%" cellpadding="0" cellspacing="0">
						<tr>
							<td style="padding-left: 10"><img
								src="/totsys/common/web/report_dept/images/ico_1.gif"></td>
							<td class="kecttep_title" style="padding-left: 5" align="left"
								nowrap>그룹명 :&nbsp;</td>
							<td width="100%"><input name="groupName" type="text"
								value='<%=partName%>' size="30" maxlength="20" class="inputtxt"></td>
						</tr>
						<tr>
							<td height="3"></td>
						</tr>
					</table>
					</td>
				</tr>
				<input type="hidden" name="deptIDs"> <input type="hidden"
					name="deptNames"> <input type="hidden" name="userIDs">
				<input type="hidden" name="userNames"> <input type="hidden"
					name="userID" value="<%=usID%>"> <input type="hidden"
					name="partID" value="<%=partID%>"></form>
			<tr>
				<td height="9"></td>
			</tr>
			<tr>
				<td height="66" valign="top" align="center">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="10">&nbsp;</td>
						<td valign="top" height="24">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<!--세미타이틀-->
							<tr>
								<td colspan="4">
								<table border="0" width="100%" cellpadding="0" cellspacing="0">
									<tr>
										<td style="width: 14"><img
											src="/totsys/common/web/report_dept/images/ico_1.gif"></td>
										<td class="kecttep_title" style="padding-left: 5" align="left"
											width="340">조직도</td>
										<td style="width: 14"><img
											src="/totsys/common/web/report_dept/images/ico_1.gif"></td>
										<td class="kecttep_title" style="padding-left: 5" align="left">제출요청
										부서/개인</td>
									</tr>
									<tr>
										<td height="3"></td>
									</tr>
								</table>
								</td>
							</tr>

							<tr>
								<td width="250">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td>
										<table border="1" bordercolor="#abbddd" cellspacing="0"
											cellpadding="0">
											<tr>
												<td>
												<table border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td>
														<table width="100%" border="0" cellspacing="0"
															cellpadding="0">
															<!---- 기관선택리스트 아이프레임 ---->
															<tr>
																<td><iframe name="part"
																	src="/totsys/common/web/report_dept/iframe/part_list.jsp"
																	width="250" height="148" frameborder="0"></iframe></td>
															</tr>
															<!--파란색 밑줄-->
															<tr>
																<td bgcolor="6891cb" height="1"></td>
															</tr>
														</table>
														</td>
													</tr>

													<tr>
														<td>
														<table width="100%" border="0" cellspacing="0"
															cellpadding="0">
															<!---- 부서 선택리스트 아이프레임 ---->
															<tr>
																<td valign="top"><iframe name="leftFrame"
																	src="/totsys/common/web/report_dept/iframe/left_list.html"
																	width="250" height="200" frameborder="0"></iframe></td>
															</tr>
															<!--파란색 밑줄-->
															<tr>
																<td bgcolor="6891cb" height="1"></td>
															</tr>
														</table>
														</td>
													</tr>

													<tr>
														<td>
														<table width="100%" border="0" cellspacing="0"
															cellpadding="0">
															<!---- 사용자 선택리스트 아이프레임 ---->
															<tr>
																<td valign="top"><iframe name="rightFrame"
																	src="/totsys/common/web/report_dept/iframe/right_list.html"
																	width="250" height="82" frameborder="0"></iframe></td>
															</tr>
														</table>
														</td>
													</tr>
												</table>
												</td>
											</tr>
										</table>
										</td>
									</tr>
									<tr>
										<td>
										<table border="0" cellspacing="0" cellpadding="0">
											<!--세미타이틀-->
											<tr>
												<td height="10"></td>
											</tr>
											<tr>
												<td colspan="4">
												<table border="0" width="100%" cellpadding="0"
													cellspacing="0">
													<tr>
														<td style="width: 14"><img
															src="/totsys/common/web/report_dept/images/ico_1.gif"></td>
														<td class="kecttep_title" style="padding-left: 5"
															align="left" width="100%">사용자정의 조직도</td>
													</tr>
													<tr>
														<td height="3"></td>
													</tr>
												</table>
												</td>
											</tr>
											<tr>
												<td>
												<table border="1" bordercolor="#abbddd" cellspacing="0"
													cellpadding="0">
													<tr>
														<!--사용자정의 조직도-->
														<td><iframe name="use"
															src="/totsys/common/web/report_dept/iframe/use_list.jsp"
															width="250" height="68" frameborder="0"></iframe></td>
													</tr>
												</table>
												</td>
											</tr>
										</table>
										</td>
									</tr>
								</table>
								</td>

								<td align="center" width="105">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><!--부서추가--> <A href="javascript:deptConfirm();"
											border="0"><img
											src="/totsys/common/web/report_dept/images/bt_bus_add.gif"></a>
										</td>
									</tr>
									<tr>
										<td><!--개인추가--> <A href="javascript:userSelect();"
											border="0"><img
											src="/totsys/common/web/report_dept/images/bt_user_add.gif"></a>
										</td>
									</tr>
									<tr>
										<td height="10"></td>
									</tr>
									<tr>
										<td><!--전체부서-선택부서의 하위부서 전체 추가--> <A
											href="javascript:deptAllSelect();" border="0"><img
											src="/totsys/common/web/report_dept/images/bt_bus_addall.gif"></a>
										</td>
									</tr>
									<tr>
										<td><!--전체개인-선택부서 사용자 모두 추가--> <A
											href="javascript:userAllSelect();" border="0"><img
											src="/totsys/common/web/report_dept/images/bt_user_addall.gif"></a>
										</td>
									</tr>


									<tr>
										<td height="10"></td>
									</tr>
									<tr>
										<td><!--부서삭제--> <A href="javascript:deptDelete();"
											border="0"><img
											src="/totsys/common/web/report_dept/images/bt_bus_del.gif"></a>
										</td>
									</tr>
									<tr>
										<td><!--개인삭제--> <A href="javascript:userDelete();"
											border="0"><img
											src="/totsys/common/web/report_dept/images/bt_user_del.gif"></a>
										</td>
									</tr>
									<!--
														전체삭제
														<tr>
															<td>
																<A href="javascript:AllDelete();" border="0"><img src="/totsys/common/web/report_dept/images/bt_all_del.gif"></a>
															</td>
														</tr>
														-->
								</table>
								</td>

								<td>
								<table border="0" cellpadding="0" cellspacing="0">

									<tr>
										<td>
										<table border="1" bordercolor="#abbddd" cellspacing="0"
											cellpadding="0">
											<tr>
												<td>
												<table border="0" cellspacing="0" cellpadding="0">

													<tr>
														<!---- 선택된 부서리스트 아이프레임 ---->
														<td valign="top"><iframe name="deptFrame"
															src="/totsys/common/web/report_dept/iframe/dept_list.jsp"
															width="270" height="530" frameborder="0"></iframe></td>

														<!---- 선택된 사용자리스트 아이프레임 ---->
														<td valign="top"><iframe name="userFrame"
															src="/totsys/common/web/report_dept/iframe/user_list.jsp"
															width="100%" height="530" frameborder="0"></iframe></td>
													</tr>
													<!--<tr>
																					<td valign="top" align="center"><A href="javascript:AllDeptSelect();" border="0"><IMG src="/totsys/common/web/report_dept/images/bt_all.gif" border="0"></A>&nbsp;&nbsp;&nbsp;<A href="javascript:deptDelete();" border="0"><IMG src="/totsys/common/web/report_dept/images/bt_delete.gif" border="0"></A></td>
																				</tr>
																				-->

													<!--tr>
																					<td valign="top" align="center"><A href="javascript:AllDelete();" border="0"><IMG src="/totsys/common/web/report_dept/images/bt_all.gif" border="0"></A>&nbsp;&nbsp;&nbsp;<A href="javascript:userDelete();" border="0"><IMG src="/totsys/common/web/report_dept/images/bt_delete.gif" border="0"></A></td>
																				</tr-->
												</table>
												</td>
											</tr>
										</table>
										</td>
									</tr>
								</table>
								</td>
							</tr>



						</table>
						</td>
					</tr>





					<tr>
						<td height="10"></td>
					</tr>
					<tr>
						<td width="7">&nbsp;</td>
						<td valign="top" align="left">
						<table width="100%" border="0" cellspacing="0" cellpadding="0"
							align="center">
							<!----  확인,취소 버튼 ---->
							<tr align="left">
								<td width="280"></td>
								<td width="50"><a href="#" onclick="groupAdd()"><img
									src="images/bt_enter.gif"></a></td>
								<td width="3"></td>
								<td><a
									href="/totsys/login/envsetting/group/group_setup.jsp"><img
									src="images/bt_cancel3.gif"></a></td>
								<td></td>
							</tr>
						</table>
						</td>
						<td width="7">&nbsp;</td>
					</tr>



				</table>
				</td>
			</tr>

			<script>
		//조직도 로딩
		sessDeptsInit();
		sessUsersInit();
	</script>

		</table>
		</td>
		<td nowrap width="10"></td>
	</tr>
	<!------------------------------- top menu start ------------------------------->
	<%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
	<!------------------------------- top menu end ------------------------------->
</table>
</BODY>
</HTML>
<%
}catch(Exception ex){
	ex.printStackTrace();
	out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';"));
}
%>
