<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="java.util.*,java.io.*"%>
<%@page import="com.csc.library.util.download.*"%>
<%@page import="com.csc.library.util.ManageDocumentPG"%>
<%@page import="com.csc.library.databean.util.FileUtil"%>
<%@page import="com.csc.library.approve.*,com.csc.library.databean.*"%>
<%@page import="com.csc.library.entry.*,com.csc.library.utilities.*"%>
<%@page import="com.csc.library.session.*"%>

<%request.setCharacterEncoding("UTF-8");%>

<!-- Begin useBean -->

<jsp:useBean id="TEMPLATE_WORKFLOW" class="com.csc.library.system.Task" scope="page"/>
<jsp:setProperty name="TEMPLATE_WORKFLOW" property="classauthen" value="WorkflowUIAuthen" />

<%
TEMPLATE_WORKFLOW.setChannel(request,response);
TEMPLATE_WORKFLOW.checkProfile();
if( TEMPLATE_WORKFLOW.getUProfile() != null ){
	TEMPLATE_WORKFLOW.getUProfile().set("appname","PERSONAL");
	UIManager screenSingle = (UIManager) TEMPLATE_WORKFLOW.process("SingleEntry","TEMPLATE_WORKFLOW");
	
/*	boolean isStep1 = false;
	boolean isStep2 = false;
	boolean isStep3 = false;
	boolean isStepCancel = false;
	boolean isStepComment = false;
	boolean isStepReturn = false;
	boolean isStepCopy = false;*/
	
	String wf = null;
	CheckNull chkNull = new CheckNull();
	Organization og = new Masfactor(screenSingle.getUProfile());
	String subject = null;
	String remark = null;
	String step_type = null;
	CscCalendar calendar = new CscCalendar();
	long attach_time = Long.parseLong(chkNull.chkNullString(request.getParameter("attach_time"),String.valueOf(calendar.getTimeInMillis())));
	ManageDocumentPG md = new ManageDocumentPG();
	md.setUProfile(screenSingle.getUProfile());
	md.setRequest(request);
	md.setScreen(screenSingle);

	if( !chkNull.chkNullString(request.getParameter("__cmd")).equals("save") ){
		subject = chkNull.chkNullString(request.getParameter("subject"));
		remark = chkNull.chkNullString(request.getParameter("__remark"));
	}else if( chkNull.chkNullString(request.getParameter("__cmd")).equals("save") ){
	/*	if( chkNull.chkNullString(request.getParameter("__checkPage")).equals("true") ){
			response.sendRedirect("../MYNOTE/SENT_COMPLETE.jsp");
		}else{
			response.sendRedirect("../MYNOTE/INBOX.jsp");
		}*/
	if(chkNull.chkNullString(request.getParameter("isAdminEdit")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_EDIT.jsp");
		}else if(chkNull.chkNullString(request.getParameter("isAdminCancel")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_CANCEL.jsp");
		}else	if(chkNull.chkNullString(request.getParameter("isAdminClean")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_CLEAN.jsp");
		}else if(chkNull.chkNullString(request.getParameter("isAdminDelete")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_DELETE.jsp");
		}else{
			response.sendRedirect("../MYNOTE/SENT_COMPLETE.jsp");
		}
		//response.sendRedirect("../MYNOTE/SENT_COMPLETE.jsp");
	}else{
		subject = "";
		remark = "";
	}

	//WF_STATUS 1 = รอการอนุมัติ
	//          3 = ยกเลิกการอนุมัติ
	//          4 = อนุมัติแล้ว
	//          5 = ไม่อนุมัติ
	//          6 = แก้ไขโดย HR
	//          7 = ส่งกลับ
	//          8 = ยกเลิกเอกสาร
	//          9 = ประวัติ

	if( (request.getParameter("__runno") == null || request.getParameter("__runno").equals("")) && 
		(request.getParameter("__help") == null || request.getParameter("__help").equals("")) ){
		screenSingle.clean();
	}

	if( (!screenSingle.getDataLabel("WF_STATUS").equals("1")) && (!screenSingle.getDataLabel("WF_STATUS").equals("4")) &&
		(!screenSingle.getDataLabel("WF_STATUS").equals("7")) ){
		wf = "false";
	}else{
		wf = "true";
	}

	if( request.getParameter("downfile") != null ){
		ThaiUtilities tu = new ThaiUtilities();
		String filePath = request.getParameter("downfile");
		File f = new File(tu.ASCII2Unicode(filePath));
		String fileName = f.getName();
		String fileType = fileName.substring(fileName.indexOf(".")+1,fileName.length());
		if ( f.exists() && f.canRead() ) {			
			response.setContentType("application/octet-stream");
			response.setHeader("Content-Disposition", "attachment; filename="+tu.Unicode2ASCII(f.getName()));
			response.setHeader("cache-control", "no-cache");
			response.setContentLength((int) f.length());
			BufferedInputStream fileInput = new BufferedInputStream(new FileInputStream(f));
			byte buffer[] = new byte[8 * 1024];
			out.clearBuffer();
			OutputStream out_s = response.getOutputStream();
			CopyStreams.copyStreamsWithoutClose(fileInput, out_s, buffer);
			out_s.flush();
			out_s.close();
			fileInput.close();
		}
	}
%>
<!-- End useBean -->
<%
	String[] costType = {"","DL","IDL","MANAGEMENT"};
%>
<HTML>
<HEAD>
		<TITLE>myNOTE : Business Process Management Service</TITLE>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
		<!-- Begin Link -->
		<LINK HREF="../CSS/MYNOTE.css" REL="stylesheet" TYPE="text/css">
		<LINK HREF="../CSS/MYNOTE_MENU.css" REL="stylesheet" TYPE="text/css">
		<!-- End Link -->
		<!-- Begin Import Script -->
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_MENU.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/DATEINPUT.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/VIEWCALENDAR.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/ICONSMENU.js'></SCRIPT>
		
		<SCRIPT LANGUAGE="JavaScript">setLang('<%=screenSingle.getUProfile().get("lang")%>');</SCRIPT>
		<script type='text/javascript' src='/hr/dwr/interface/SearchDWR.js'></script>
        <script type='text/javascript' src='/hr/dwr/engine.js'></script>
        <script type='text/javascript' src='/hr/dwr/util.js'></script>
        <script type="text/javascript" src="/hr/dwr/interface/SystemCode.js"></script>
        <script type="text/javascript" src="/hr/dwr/interface/CscCalendar.js"></script>          
		<!-- End Import Script -->
<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
		<!--
			function goHelp(helpName,inputName,condition,obj1,obj2){
				with( document.cscform ){
					var helpReturn;
					var temp;
					if( inputName == "sendto" ){
						temp = __fixCon.value;
						//__fixCon.value="job='"+condition+"'";
						if( condition.indexOf(",") > -1 ){
							condition = condition.replace(/,/g,"','");
						}
						__fixCon.value="EMPLOYEEID IN ('"+condition+"')";
					 	helpReturn="wf_next_actor:EMPLOYEEID,sendto:MEMPLOYEE@FULLNAME";
						linkHelp_SendToReturn(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "cc" ){
						temp = __fixCon.value;
						helpReturn="wf_cc_actor:EMPLOYEEID,cc:MEMPLOYEE@FULLNAME";
						linkHelp_SendToReturn(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "__wf__employeeid" ){
						temp = __fixCon.value;
						helpReturn="__wf__employeeid:employeeid,__wf__fullname:fullname";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "__wf__adj_reason"){
						temp = __fixCon.value;
						helpReturn="__wf__adj_reason:adjreasonid,adj_reason:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "__wf__emp_position"){
						temp = __fixCon.value;
						helpReturn="__wf__emp_position:positionid,emp_position:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "__wf__bu1"){
						temp = __fixCon.value;
						helpReturn="__wf__bu1:bu1id,bu1:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "__wf__bu2"){
						temp = __fixCon.value;
						helpReturn="__wf__bu2:bu2id,bu2:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "__wf__workarea"){
						temp = __fixCon.value;
						helpReturn="__wf__workarea:workareaid,workarea:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}else if( inputName == "__wf__time0"){
						temp = __fixCon.value;
						helpReturn="__wf__time0:time0id,time0:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}
					else if( inputName == "__wf__job"){
						temp = __fixCon.value;
						helpReturn="__wf__job:jobcodeid,job:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}
					else if( inputName == "__wf__costcenter"){
						temp = __fixCon.value;
						helpReturn="__wf__costcenter:costcenterid,costcenter:tdesc";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}
					else if( inputName == "__wf__newbossid" ){
						temp = __fixCon.value;
						helpReturn="__wf__newbossid:employeeid,newbossfullname:fullname";
						linkHelp_Return(helpName,helpReturn);
						__fixCon.value=temp;
					}
				}
			}
			
			function linkHelp_SendToReturn(help,input){
				with( document.cscform ){
					var param = "BROWSE_USER.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off";
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}

			function linkHelp_Return(help,input){
				with( document.cscform ){
					var param="BROWSE_HELP.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off";
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}
			
			function linkHelpWF(help,input){
				with(document.cscform){
					var temp = __fixCon.value;
					var fix = "wf_id='"+wf_id.value+"' and wf_ver='"+wf_ver.value+"' and initiator='<%=screenSingle.getUProfile().get("actor")%>' and (wf_status<>'6' and wf_status<>'3' and wf_status<>'8' and wf_status<>'A' and wf_status<>'B' and wf_status<>'')";
					var param="BROWSE_HELP.jsp?__helpName="+help+"&__fieldSearch="+input+"&__pageCall="+__screen.value+"&__fixCon="+fix;
					window.open(param,"Help","left=150,top=150,width=530,height=370,resizable=yes,scrollbars=yes,toolbar=no,status=yes");
					__fixCon.value = temp;
				}
			}
			
			function openHelp(){
				with( document.cscform ){
					window.open("","Help","left=150,top=150,width=700,height=570,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}
var init = null;
var Temp="";
var costType = new Array("","DL","IDL","MANAGEMENT");

function initialization(empid) {
	Temp=empid;
  	if (init) clearTimeout(init);
 	init = setTimeout("searchEmp()", 1000);
}
function initialization2(empid) {
	DWREngine.beginBatch();
	Temp=empid;
  	if (init) clearTimeout(init);
 	init = searchEmp();
	DWREngine.endBatch({	
	  async:true,
	   timeout:1000
	});
}

function searchEmp(){
	SearchDWR.searchDBXMLAll(new Array("PSNWF001","memployee.employeeid,memployee.fullname,memployee.bossid,sim1memployee.fullname,memployee.emp_position,mposition.tdesc,memployee.bu1,mbu1.tdesc,memployee.bu2,mbu2.tdesc,memployee.workarea,mworkarea.tdesc,memployee.salatype,msalatype0.tdesc,memployee.cost_type,memployee.cost_type,memployee.time0,mtime0.tdesc,memployee.job,mjobcode.tdesc,memployee.costcenter,mcostcenter0.tdesc,memployee.salary,memployee.emp_every,memployee.emp_every,memployee.emp_type","memployee:employeeid = '"+Temp+"'","false","langon"),showEmp);
}			

var showEmp = function(data){
	var s = new Array("__wf__employeeid","__wf__fullname","__wf__old_bossid","old_bossfullname","__wf__old_emp_position","old_position","__wf__old_bu1","old_bu1","__wf__old_bu2","old_bu2","__wf__old_workarea","old_workarea","__wf__old_salatype","old_salatype","__wf__old_cost_type","old_cost_type","__wf__old_time0","old_time0","__wf__old_job","old_job","__wf__old_costcenter","old_costcenter");	
	if(data.length>0){		
		for(i=0;i<s.length;i++){
			if(i==15){
				DWRUtil.setValue(s[i],costType[data[0][i]]);	
			}else
				DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
	/*if(document.cscform.__wf__old_emp_type.value != ""){
		setEmpType(document.cscform.__wf__old_emp_type.value);
		}*/
}	

function setEmpType(cde){
	SystemCode.getValueDWR(new Array("EMPTYPE",cde,document.cscform.__language.value),function(data){
		DWRUtil.setValue("old_emp_type",data);
	});
}

function initializationReason(reason) {
	Temp = reason;
  	if (init) clearTimeout(init);
  	init = setTimeout("searchAdjReason()", 1000);
}
function initializationReason2(reason) {
	DWREngine.beginBatch();
	Temp = reason;
  	if (init) clearTimeout(init);
  	init = searchAdjReason();
	DWREngine.endBatch({	
	  async:true,
	   timeout:1000
	});
}

function searchAdjReason(){
	SearchDWR.searchDBXMLAll(new Array("MADJREASONHELP","madjreason.adjreasonid,madjreason.tdesc","madjreason:adjreasonid = '"+Temp+"'","false","langon"),showRes);
}			

var showRes = function(data){
	var s = new Array("__wf__adj_reason","adj_reason");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}

//Start for To: Area
//boss
function initializationBoss(boss) {
	Temp = boss;
  	if (init) clearTimeout(init);
  	init = setTimeout("searchBoss()", 1000);
}

function searchBoss(){
	SearchDWR.searchDBXMLAll(new Array("MEMPLOYEEHELP","memployee.employeeid,memployee.fullname","memployee:employeeid = '"+Temp+"'","false","langon"),showBoss);
}			

var showBoss = function(data){
	var s = new Array("__wf__newbossid","newbossfullname");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//position
function initializationPosition(pos) {
	Temp = pos;
  	if (init) clearTimeout(init);
  	init = setTimeout("searchPosition()", 1000);
}
function initializationPosition2(pos) {
	DWREngine.beginBatch();
	Temp = pos;
  	if (init) clearTimeout(init);
  	init = searchPosition();
	DWREngine.endBatch({	
	  async:false,
	   timeout:1000
	});
}

function searchPosition(){
	SearchDWR.searchDBXMLAll(new Array("MPOSITIONHELP","mposition.positionid,mposition.tdesc","mposition:positionid = '"+Temp+"'","false","langon"),showPosition);
}			

var showPosition = function(data){
	var s = new Array("__wf__emp_position","emp_position");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//bu1
function initializationBu1(bu1) {
	Temp = bu1;
  	if (init) clearTimeout(init);
  	init = setTimeout("searchBu1()", 1000);
}
function initializationBu12(bu1) {
	DWREngine.beginBatch();
	Temp = bu1;
  	if (init) clearTimeout(init);
  	init = searchBu1();
	DWREngine.endBatch({	
	  async:false,
	   timeout:1000
	});
}

function searchBu1(){
	SearchDWR.searchDBXMLAll(new Array("MBU1HELP","mbu1.bu1id,mbu1.tdesc","mbu1:bu1id = '"+Temp+"'","false","langon"),showBu1);
}			

var showBu1 = function(data){
	var s = new Array("__wf__bu1","bu1");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//bu2
function initializationBu2(bu2) {
	Temp = bu2;
  	if (init) clearTimeout(init);
  	init = setTimeout("searchBu2()", 1000);
}
function initializationBu22(bu2) {
	DWREngine.beginBatch();
	Temp = bu2;
  	if (init) clearTimeout(init);
  	init = searchBu2();
	DWREngine.endBatch({	
	  async:false,
	   timeout:1000
	});
}

function searchBu2(){
	SearchDWR.searchDBXMLAll(new Array("MBU2HELP","mbu2.bu2id,mbu2.tdesc","mbu2:bu2id = '"+Temp+"'","false","langon"),showBu2);
}			

var showBu2 = function(data){
	var s = new Array("__wf__bu2","bu2");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//Workarea
function initializationWorkArea(wa) {
	Temp = wa;
  	if (init) clearTimeout(init);
  	init = setTimeout("searchWorkarea()", 1000);
}
function initializationWorkArea2(wa) {
	DWREngine.beginBatch();
	Temp = wa;
  	if (init) clearTimeout(init);
  	init = searchWorkarea();
	DWREngine.endBatch({	
	  async:false,
	   timeout:1000
	});
}

function searchWorkarea(){
	SearchDWR.searchDBXMLAll(new Array("MWORKAREAHELP","mworkarea.workareaid,mworkarea.tdesc","mworkarea:workareaid = '"+Temp+"'","false","langon"),showWorkarea);
}			

var showWorkarea = function(data){
	var s = new Array("__wf__workarea","workarea");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//Time0
function initializationTime0(time) {
	Temp = time;
  	if (init) clearTimeout(init);
  	init = setTimeout("searchTime0()", 1000);
}
function initializationTime02(time) {
	DWREngine.beginBatch();
	Temp = time;
  	if (init) clearTimeout(init);
  	init = searchTime0();
	DWREngine.endBatch({	
	  async:false,
	   timeout:1000
	});
}

function searchTime0(){
	SearchDWR.searchDBXMLAll(new Array("MTIME0HELP","mtime0.time0id,mtime0.tdesc","mtime0:time0id = '"+Temp+"'","false","langon"),showTime0);
}			

var showTime0 = function(data){
	var s = new Array("__wf__time0","time0");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//Employee Type
function getEmpType(){
	SystemCode.getContentDWR(new Array("EMPTYPE",document.cscform.__language.value),function(data){
		var list="";
		for(i=0;i<data.length;i++){
			list=list+"<option value=\""+data[i][0]+"\">"+data[i][1]+"</option>";
		}
		DWRUtil.setValue("emp_type","<select  name=\"__wf__emp_type\" class=\"txt01\"><option value=\"\"></option>"+list+"</select>");
	});
}
//Salary Type
function getSalaType(){
	SearchDWR.searchAll(new Array("Msalatype0","codeid,tdesc,edesc","","","langon"),function(data){
		var list="";
		for(i=0;i<data.length;i++){
			list=list+"<option value=\""+data[i][0]+"\">"+data[i][1]+"</option>";
		}
		DWRUtil.setValue("salatype","<select  name=\"__wf__salatype\" class=\"txt01\"><option value=\"\"></option>"+list+"</select>");
	});
}
//Job
function initializationJob(job) {
	Temp = job;
  if (init) clearTimeout(init);
  init = setTimeout("searchJob()", 1000);
}
function initializationJob2(job) {
	DWREngine.beginBatch();
	Temp = job;
  	if (init) clearTimeout(init);
  	init = searchJob();
 	 DWREngine.endBatch({	
	 	async:false,
		timeout:1000
	});
}

function searchJob(){
	SearchDWR.searchDBXMLAll(new Array("MJOBCODEHELP","mjobcode.jobcodeid,mjobcode.tdesc","mjobcode:jobcodeid = '"+Temp+"'","false","langon"),showJob);
}			

var showJob = function(data){
	var s = new Array("__wf__job","job");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//Costcenter
function initializationCost(cost) {
	Temp = cost;
  if (init) clearTimeout(init);
  init = setTimeout("searchCost()", 1000);
}
function initializationCost2(cost) {
	DWREngine.beginBatch();
	Temp = cost;
	if (init) clearTimeout(init);
	init = searchCost();
	DWREngine.endBatch({	
	  async:false,
	   timeout:1000
	});
}

function searchCost(){
	SearchDWR.searchDBXMLAll(new Array("MCOSTCENTER0HELP","mcostcenter0.costcenterid,mcostcenter0.tdesc","mcostcenter0:costcenterid = '"+Temp+"'","false","langon"),showCost);
}			

var showCost = function(data){
	var s = new Array("__wf__costcenter","costcenter");
if(data.length>0){		
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],data[0][i]);			
		}
	}
else{
		for(i=0;i<s.length;i++){
			DWRUtil.setValue(s[i],"");
		}
	}	
}
//End for To: Area

function ChkValue(){	
	with(document.cscform){
		if(__wf__employeeid.value == ""){
			alert(MyCode[15]);
			__wf__employeeid.focus();
		}else{
			GoWF();
		}
	}
}

function chkRequreType(){
	with(document.cscform){
		if(getRadioValue(__wf__adj_type) == '1')
				pro.style.display = "";
		else
			pro.style.display = "none";
	}
}

function openPopUp(page,puname,op){
	window.open(page+"?employeeid="+document.cscform.__wf__employeeid.value,puname,op);
}
		-->
		</SCRIPT>
</HEAD>
	<BODY BGCOLOR=#FFFFFF>
	<!-- ImageReady Slices (02.psd) -->
	<FORM NAME="cscform" METHOD="post" ACTION="PWF007_SV.jsp">
	  <INPUT TYPE="hidden" NAME="__screen" VALUE="PWF007_SV">
			<INPUT TYPE="hidden" NAME="__cmd" VALUE="">
			<INPUT TYPE="hidden" NAME="__help" VALUE="">
			<INPUT TYPE="hidden" NAME="__fixCon" VALUE="">
			<INPUT TYPE="hidden" NAME="__notNull" VALUE="<%=screenSingle.getRequire()%>">
			<INPUT TYPE="hidden" NAME="__language" VALUE="<%=screenSingle.getUProfile().get("lang")%>">
			<INPUT TYPE="hidden" NAME="__companyid" VALUE="<%=screenSingle.getUProfile().get("companyid")%>">
			<INPUT TYPE="hidden" NAME="__calendar" VALUE="">
			
	  <SCRIPT LANGUAGE="JavaScript">getInputFormatDate();</SCRIPT>

	  <INPUT TYPE="hidden" NAME="wf_id" VALUE="2007">
	  <INPUT TYPE="hidden" NAME="__wf_id" VALUE="2007">
	  <INPUT TYPE="hidden" NAME="wf_ver" VALUE="<%=chkNull.chkNullString(request.getParameter("wf_ver"),"1")%>">
	  <INPUT TYPE="hidden" NAME="__wf_ver" VALUE="<%=chkNull.chkNullString(request.getParameter("__wf_ver"),"1")%>">
			<INPUT TYPE="hidden" NAME="wf_seq_no" VALUE="<%=chkNull.chkNullString(request.getParameter("wf_seq_no"),"0")%>">

			<INPUT TYPE="hidden" NAME="step_id" VALUE="<%=chkNull.chkNullString(request.getParameter("step_id"),"0")%>">
			<INPUT TYPE="hidden" NAME="step_seq_no" VALUE="<%=chkNull.chkNullString(request.getParameter("step_seq_no"),"0")%>">
			<INPUT TYPE="hidden" NAME="wf_return_actor" VALUE="IINIT">
			<INPUT TYPE="hidden" NAME="__oldDocumentID" VALUE="<%=chkNull.chkNullString(request.getParameter("__oldDocumentID"),screenSingle.getDataLabel("DOC_NO"))%>">
			<INPUT TYPE="hidden" NAME="__oldWF" VALUE="<%=chkNull.chkNullString(request.getParameter("__oldWF"),screenSingle.getDataLabel("WF_STATUS"))%>">
			
			<INPUT TYPE="hidden" NAME="__wf" VALUE="<%=wf%>">
			<INPUT TYPE="hidden" NAME="__wfcmd" VALUE="false">
			
			<INPUT TYPE="hidden" NAME="remark" VALUE="<%=remark%>">
			<INPUT TYPE="hidden" NAME="draft_cmd" VALUE="">              
			<INPUT TYPE="hidden" NAME="draft_no" VALUE="<%=chkNull.chkNullString(request.getParameter("draft_no"),"0")%>">               
			<INPUT TYPE="hidden" NAME="admin_cmd" VALUE="">		
			<INPUT TYPE="hidden" NAME="__checkPage" VALUE="true">

			<!-- Redirect Page -->
			 <INPUT TYPE="hidden" NAME="isAdminEdit" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminEdit"))%>">
			 <INPUT TYPE="hidden" NAME="isAdminCancel" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminCancel"))%>">
			 <INPUT TYPE="hidden" NAME="isAdminClean" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminClean"))%>">
			 <INPUT TYPE="hidden" NAME="isAdminDelete" VALUE="<%=chkNull.chkNullString(request.getParameter("isAdminDelete"))%>">
			<%=screenSingle.InitialVariable()%>
			
			<DIV ID="toolTipLayer" STYLE="position:absolute; visibility: hidden"></DIV>
	  <SCRIPT LANGUAGE="JavaScript">initToolTips();</SCRIPT>
			
			<TABLE WIDTH=950 BORDER=0 ALIGN="center" CELLPADDING=0 CELLSPACING=0 id="wrapper">
				<jsp:include page="MYNOTE_HEAD.jsp" flush="true"/>
						<DIV ALIGN="right">

<%=md.getStepDocument("2007","1")%>
<%=md.getHeadDocument()%>
                      <BR>
<%=md.getHelpDocument("Reques for Personal Action")%>
                      <BR>
<%=md.getSendToDocument("Reques for Personal Action")%>
					  <BR>						
						<!-- Begin Code -->
					  <TABLE WIDTH="95%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">
								<TR>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-T-L.gif" WIDTH="5" HEIGHT="5"></TD>
									<TD HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/T.gif" WIDTH="100%" HEIGHT="5"></TD>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-T-R.gif" WIDTH="5" HEIGHT="5"></TD>
								</TR>
								<TR>
									<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/L2.gif"></TD>
									<TD VALIGN="middle"><table width="100%" border="0" cellpadding="0" cellspacing="1" class="txt01">
                        <!-- Begin User Code -->
                        <tr bgcolor="#FFFFFF">
                          <td width="25%" class="column-label"><script language=JavaScript>swapLang("Employee")</script></td>
                          <td width="75%" class="column-input">
                          	<input type="text" size="10" name="__wf__employeeid" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__employeeid"),"") %>" onKeyUp="initialization(this.value)"><A href="javascript:goHelp('MEMPLOYEEHELP','__wf__employeeid');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image01','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image01" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
							<input size="30" type="text" name="__wf__fullname" class="disabled" value="<%=chkNull.chkNullString(request.getParameter("__wf__fullname"),md.getWFDataValue("__wf__fullname")) %>" readonly>
                          </td>
                        </tr>
                        <tr bgcolor="#FFFFFF">
                          <td colspan="2" class="column-title"><script language=JavaScript>swapLang("Request For Personal Action")</script></td>
                        </tr>
                        <tr bgcolor="#FFFFFF">
                          <td width="25%" class="column-label"><script language=JavaScript>swapLang("Adjust type")</script></td>
                          <td width="75%" class="column-input"><div><input type="radio" name="__wf__adj_type" id="__wf__adj_type" value="0" onClick="chkRequreType();"><script language=JavaScript>swapLang("Transfer")</script><input type="radio" name="__wf__adj_type" id="__wf__adj_type" value="1" onClick="chkRequreType();"><script language=JavaScript>swapLang("Promote")</script></div></td>
                        </tr>
                        <tr bgcolor="#EFEFEF">
                          <td colspan="2" bgcolor="#EFEFEF" class="txt01"><table width="100%" border="0" cellspacing="1" class="txt01">
                            <tr height="20" class="row-header">
                              <td><script language=JavaScript>swapLang("Description")</script></td>
                              <td><script language=JavaScript>swapLang("Old")</script></td>
                              <td><script language=JavaScript>swapLang("New")</script></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("Work Area")</script></td>
                              <td><input name="__wf__old_workarea" type="text" class="txt01" size="10" readOnly value="<%=chkNull.chkNullString(request.getParameter("__wf__old_workarea"),"") %>">
                              &nbsp;
                              <input type="text" size="30" name="old_workarea" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_workarea"),"") %>" readonly></td>
                              <td><input type="text" size="10" name="__wf__workarea" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__workarea"),"") %>" onKeyUp="initializationWorkArea(this.value)"><A href="javascript:goHelp('MWORKAREAHELP','__wf__workarea');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image02','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image02" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
							  <input size="30" type="text" name="workarea" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("workarea"),md.getWFDataValue("workarea")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("Position")</script></td>
                              <td><input name="__wf__old_emp_position" type="text" class="txt01"  size="10" readOnly  value="<%=chkNull.chkNullString(request.getParameter("__wf__old_emp_position"),"") %>">
                              &nbsp;
                              <input type="text" size="30" name="old_position" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_position"),"") %>"  readonly></td>
                              <td><input type="text" size="10" name="__wf__emp_position" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__emp_position"),"") %>" onKeyUp="initializationPosition(this.value)"><A href="javascript:goHelp('MPOSITIONHELP','__wf__emp_position');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image03','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image03" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
							  <input size="30" type="text" name="emp_position" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("emp_position"),md.getWFDataValue("emp_position")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("Cost Type")</script></td>
                              <td><input name="__wf__old_cost_type" type="hidden" value="<%=chkNull.chkNullString(request.getParameter("__wf__old_cost_type"),"") %>"><input type="text" size="15" name="old_cost_type" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_cost_type"),"")%>" readonly>
                          </td>
                              <td><select  name="__wf__cost_type" class="txt01">
                              <%
							  		for( int i=0 ; i<=3 ;i++ ){
										if(i==0)
											out.print( "<option value=\"\">"+costType[i]+"</option>" );
										else
											out.print( "<option value=\""+i+"\">"+costType[i]+"</option>" );
									}
							  %>
                              </select></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("Cost Center")</script></td>
                              <td><input name="__wf__old_costcenter" type="text" class="txt01"  size="10" readOnly value="<%=chkNull.chkNullString(request.getParameter("__wf__old_costcenter"),"") %>">
                              &nbsp;
                              <input type="text" size="30" name="old_costcenter" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_costcenter"),"") %>" readonly></td>
                              <td><input type="text" size="10" name="__wf__costcenter" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__costcenter"),"") %>" onKeyUp="initializationCost(this.value)"> <A href="javascript:goHelp('MCOSTCENTER0HELP','__wf__costcenter');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image04','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image04" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
							  <input size="30" type="text" name="costcenter" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("costcenter"),md.getWFDataValue("costcenter")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("BU_2")</script></td>
                              <td><input name="__wf__old_bu2" type="text" class="txt01"  size="10" readOnly  value="<%=chkNull.chkNullString(request.getParameter("__wf__old_bu2"),"") %>">
                              &nbsp;
                                <input type="text" size="30" name="old_bu2" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_bu2"),"") %>" readonly></td>
                              <td><input type="text" size="10" name="__wf__bu2" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__bu2"),"") %>" onKeyUp="initializationBu2(this.value)"><A href="javascript:goHelp('MBU2HELP','__wf__bu2');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image05','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image05" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
								<input size="30" type="text" name="bu2" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("bu2"),md.getWFDataValue("bu2")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("BU_1")</script></td>
                              <td><input name="__wf__old_bu1" type="text" class="txt01"  size="10" readOnly  value="<%=chkNull.chkNullString(request.getParameter("__wf__old_bu1"),"") %>">
                              &nbsp;
                                <input type="text" size="30" name="old_bu1" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_bu1"),"") %>" readonly ></td>
                              <td><input type="text" size="10" name="__wf__bu1" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__bu1"),"") %>" onKeyUp="initializationBu1(this.value)"><A href="javascript:goHelp('MBU1HELP','__wf__bu1');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image06','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image06" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
								<input size="30" type="text" name="bu1" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("bu1"),md.getWFDataValue("bu1")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("Shift_")</script></td>
                              <td><input type="text" size="10" name="__wf__old_time0" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__old_time0"),"") %>" readonly>
                                &nbsp;
                                <input type="text" size="30" name="old_time0" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_time0"),"") %>" readonly></td>
                              <td><input type="text" size="10" name="__wf__time0" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__time0"),"") %>" onKeyUp="initializationTime0(this.value)"><A href="javascript:goHelp('MTIME0HELP','__wf__time0');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image07','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image07" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
								<input size="30" type="text" name="time0" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("time0"),md.getWFDataValue("time0")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("Job Description")</script></td>
                              <td><input name="__wf__old_job" type="text" class="txt01"  size="10" readOnly  value="<%=chkNull.chkNullString(request.getParameter("__wf__old_job"),"") %>">
                              &nbsp;
                                <input type="text" size="30" name="old_job" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_job"),"") %>" readonly></td>
                              <td><input type="text" size="10" name="__wf__job" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__job"),"") %>" onKeyUp="initializationJob(this.value)">
                                <A href="javascript:goHelp('MJOBCODEHELP','__wf__job');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image08','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image08" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
								<input size="30" type="text" name="job" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("job"),md.getWFDataValue("job")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td ><script language=JavaScript>swapLang("Boss")</script></td>
                              <td><input type="text" size="10" name="__wf__old_bossid" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__old_bossid"),"") %>" readonly>
                                &nbsp;
                                <input size="30" type="text" name="old_bossfullname" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_bossfullname"),md.getWFDataValue("old_bossfullname")) %>" readonly></td>
                              <td><input type="text" size="10" name="__wf__newbossid" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__newbossid"),"") %>" onKeyUp="initializationBoss(this.value)">
                                <A href="javascript:goHelp('MEMPLOYEEHELP','__wf__newbossid');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image09','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image09" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
								<input size="30" type="text" name="newbossfullname" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("newbossfullname"),md.getWFDataValue("newbossfullname")) %>" readonly></td>
                            </tr>
                            <tr class="row-data">
                              <td><script language=JavaScript>swapLang("Salary Type")</script></td>
                              <td><input name="__wf__old_salatype" type="hidden" value="<%=chkNull.chkNullString(request.getParameter("__wf__old_salatype"),"") %>"><input type="text" size="15" name="old_salatype" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("old_salatype"),"") %>" readonly></td>
                              <td><span id="salatype"></span></td>
                            </tr>
                          </table></td>
                          </tr>
                        <tr bgcolor="#FFFFFF">
                          <td width="25%" class="column-label"><script language="JavaScript">swapLang("Adjust reason");</script></td>
                          <td width="75%" class="column-input"><input type="text" size="10" name="__wf__adj_reason" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("__wf__adj_reason"),"") %>" onKeyUp="initializationReason(this.value)">
                              <A href="javascript:goHelp('MADJREASONHELP','__wf__adj_reason');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image10','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="image10" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A>
                            <input size="30" type="text" name="adj_reason" class="txt01" value="<%=chkNull.chkNullString(request.getParameter("adj_reason"),md.getWFDataValue("adj_reason")) %>" readonly></td>
                        </tr>
                        <tr bgcolor="#FFFFFF" id="pro" style="display:none">
                          <td width="25%" class="column-label"><script language="JavaScript">swapLang("Data for adjudicate");</script> :<br>
                          (<script language="JavaScript">swapLang("Promote only");</script>)</td>
                          <td width="75%" class="column-input"> 
						  <div>
						  <a href="JavaScript:;" onClick="openPopUp('PSNWF004_1.jsp','POPUP','SCROLLBARS=yes,STATUS=yes,RESIZABLE=yes,WIDTH=550,HEIGHT=300')"><script language="JavaScript">swapLang("Leave statistic data");</script></a>
						  </div>
						  <div>
						  <a href="JavaScript:;" onClick="openPopUp('PSNWF004_2.jsp','POPUP','SCROLLBARS=yes,STATUS=yes,RESIZABLE=yes,WIDTH=550,HEIGHT=300')"><script language="JavaScript">swapLang("Review Grade and Appraisal");</script></a>
						  </div>
						  <div>
						  <a href="JavaScript:;" onClick="openPopUp('PSNWF004_3.jsp','POPUP','SCROLLBARS=yes,STATUS=yes,RESIZABLE=yes,WIDTH=850,HEIGHT=300')"><script language="JavaScript">swapLang("Goodness or Badness Detail");</script></a>
						  </div>
						  <div>
						  <a href="JavaScript:;" onClick="openPopUp('PSNWF004_4.jsp','POPUP','SCROLLBARS=yes,STATUS=yes,RESIZABLE=yes,WIDTH=550,HEIGHT=300')"><script language="JavaScript">swapLang("Adjustment_data");</script></a>
						  </div>
						  </td>
                        </tr>
                        <!--tr bgcolor="#FFFFFF">
                          <td width="30%" bgcolor="#0099cc" class="txt01"><div align="right">
                            <script language=JavaScript>swapLang("Prepared Date")</script>
                            : </div></td>
                          <td width="75%" bgcolor="#EFEFEF" class="txt01"><input type='text' name='__wf__adj_date' size='10' maxlength='10' value=''  onClick="" onChange="" onMouseOver="toolTip('วันที่ปรับตำแหน่ง(DDMMYYYY)')" onMouseOut="toolTip()" onKeyPress="chkIntegerOfDate(this.value);" onKeyUp="formatDate(this);sysIsEdit();" dir="" onBlur="chkInputDate(this);" onFocus="this.select();" class="txt01" alt="วันที่ปรับตำแหน่ง"  >
                            <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)" onClick="viewCal('__wf__adj_date')"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="Image12" width="20" height="20" border="0" align="absmiddle" id="Image12"></a></td>
                        </tr-->
                        <input type='hidden' name='__wf__adj_date' size='10' maxlength='10' value=''>
                        <tr bgcolor="#FFFFFF">
                          <td width="25%" class="column-label"><script language=JavaScript>swapLang("Effective Date")</script></td>
                          <td width="75%" class="column-input"><input type='text' name='__wf__eff_date' size='10' maxlength='10' value=''  onClick="" onChange="" onMouseOver="toolTip('วันที่เริ่มใช้(DDMMYYYY)')" onMouseOut="toolTip()" onKeyPress="chkIntegerOfDate(this.value);" onKeyUp="formatDate(this);sysIsEdit();" dir="" onBlur="chkInputDate(this);" onFocus="this.select();" class="txt01" alt="วันที่เริ่มใช้"  >
                            <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)" onClick="viewCal('__wf__eff_date')"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="Image13" width="20" height="20" border="0" align="absmiddle" id="Image13"></a></td>
                        </tr>
                        <!-- End User Code -->
                        <tr bgcolor=#EFEFEF>
                          <td width="25%" class="column-label"><script language="JavaScript">swapLang("Priority");</script></td>
                          <td width="75%" class="column-input"><input type="radio" name="priority" value="0" checked>
                              <script language="JavaScript">swapLang("Normal")</script>
                              <input type="radio" name="priority" value="1">
                              <script language="JavaScript">swapLang("High")</script>
                              <input type="radio" name="priority" value="2">
                              <script language="JavaScript">swapLang("Highest")</script></td>
                        </tr>
                      </table></TD>
									<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/R2.gif"></TD>
								</TR>
								<TR>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-B-L.gif" WIDTH="5" HEIGHT="5"></TD>
									<TD HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/B.gif" WIDTH="100%" HEIGHT="5"></TD>
									<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-B-R.gif" WIDTH="5" HEIGHT="5"></TD>
								</TR>
						  </TABLE>
                            <!-- End Code -->
                            <BR>
					  <br>
<%=md.getRemarkDocument()%>
                      <br>
<%=md.getWorkflowCommandDocument()%>
					<br>
<%=md.getReferenceNoteDocument()%>
					<br>
<%=md.getAttachFileDocument()%>
					<br>
<%=md.getWorkflowButtonDocument("GoWF")%>
					<br>
<%=md.getRoutingDocument()%>
					<br>
<%=md.getCommentDocument()%>
						<!-- Begin Set Value -->
           				<%
           				
           				if(md. isStep1 ){
           				%>
           					<!-- Begin Set Value Step1 -->
       					  <SCRIPT LANGUAGE="JavaScript">
           						getSalaType();
								setValue('__wf__old_cost_type','<%=chkNull.chkNullString(request.getParameter("__wf__old_cost_type"))%>');
								setValue('old_cost_type','<%=costType[new Integer(chkNull.chkNullString(request.getParameter("__wf__old_cost_type"),"0")).intValue()]%>');
								setTimeout("setValue('__wf__salatype','<%=chkNull.chkNullString(request.getParameter("__wf__salatype"))%>')",500);
								setValue('__wf__adj_type','<%=request.getParameter("__wf__adj_type")%>');
								chkRequreType();
								setValue('__wf__cost_type','<%=request.getParameter("__wf__cost_type")%>');
								setValue('__wf__adj_date','<%=chkNull.chkNullString(request.getParameter("__wf__adj_date"), new CscCalendar().getDDMMYYYY())%>');
								setValue('__wf__eff_date','<%=chkNull.chkNullString(request.getParameter("__wf__eff_date"), new CscCalendar().getDDMMYYYY())%>');								
								setValue('priority','<%=chkNull.chkNullString(request.getParameter("priority"),"0")%>');
           					</SCRIPT>
           					<!-- End Set Value Step1 -->
           				<%
           				}else if(md.isStep2 || md.isStepCancel || md.isStepComment || md.isStepReturn || md.isStepCopy || md.isDraft){
           				%>
           					<!-- Begin Set Value Step2 -->
       					  <SCRIPT LANGUAGE="JavaScript">
           						hideSendTo('<%=step_type%>');
								getSalaType();
								initialization2('<%=md.getWFDataValue("__wf__employeeid")%>');
								setValue('__wf__old_cost_type','<%=md.getWFDataValue("__wf__old_cost_type")%>');
								setValue('old_cost_type','<%=md.getWFDataValue("old_cost_type")%>');
								//setValue('__wf__old_emp_every','<%//=md.getWFDataValue("old_emp_every")%>');
								//setValue('old_emp_every','<%//=md.getWFDataValue("old_emp_every")%>');
								setValue('__wf__adj_type','<%=md.getWFDataValue("__wf__adj_type")%>');
								chkRequreType();
								setTimeout("setValue('__wf__emp_type','<%=md.getWFDataValue("__wf__emp_type")%>')",500);
								setValue('__wf__cost_type','<%=md.getWFDataValue("__wf__cost_type")%>');
								//setValue('__wf__salatype','<%//=md.getWFDataValue("__wf__salatype")%>');
								setValue('__wf__adj_reason','<%=md.getWFDataValue("__wf__adj_reason")%>');
								initializationReason2('<%=md.getWFDataValue("__wf__adj_reason")%>');
								setValue('__wf__emp_position','<%=md.getWFDataValue("__wf__emp_position")%>');
								initializationPosition2('<%=md.getWFDataValue("__wf__emp_position")%>');
								setValue('__wf__bu1','<%=md.getWFDataValue("__wf__bu1")%>');
								initializationBu12('<%=md.getWFDataValue("__wf__bu1")%>');
								setValue('__wf__bu2','<%=md.getWFDataValue("__wf__bu2")%>');
								initializationBu22('<%=md.getWFDataValue("__wf__bu2")%>');
								setValue('__wf__workarea','<%=md.getWFDataValue("__wf__workarea")%>');
								initializationWorkArea2('<%=md.getWFDataValue("__wf__workarea")%>');
								setValue('__wf__time0','<%=md.getWFDataValue("__wf__time0")%>');
								initializationTime02('<%=md.getWFDataValue("__wf__time0")%>');
								setValue('__wf__emp_type','<%=md.getWFDataValue("__wf__emp_type")%>');
								setValue('__wf__job','<%=md.getWFDataValue("__wf__job")%>');
								initializationJob2('<%=md.getWFDataValue("__wf__job")%>');
								setValue('__wf__costcenter','<%=md.getWFDataValue("__wf__costcenter")%>');
								initializationCost2('<%=md.getWFDataValue("__wf__costcenter")%>');
								//setValue('__wf__salary','<%//=md.getWFDataValue("__wf__salary")%>')
								setValue('__wf__costcenter','<%=md.getWFDataValue("__wf__newbossid")%>');
								initializationBoss('<%=md.getWFDataValue("__wf__newbossid")%>');
								setValue('__wf__adj_date','<%=chkNull.chkNullString(md.getWFDataValue("__wf__adj_date"), new CscCalendar().getDDMMYYYY())%>');
								setValue('__wf__eff_date','<%=chkNull.chkNullString(md.getWFDataValue("__wf__eff_date"), new CscCalendar().getDDMMYYYY())%>');
								
								
								setValue('priority','<%=screenSingle.getDataLabel("VW_INCIDENT","PRIORITY")%>');
							<%
								if(!md.isDraft){
							%>
								setTimeout("setDisabled(true)",1000);
							<%
								}else{
							%>
								setValue('__checkPage','false');
							<%
							}
							%>
           					</SCRIPT>
           					<!-- End Set Value Step2 -->
           				<%
           				}else if( md.isStep3 || md.isAdminEdit || md.isAdminCancel || md.isAdminDelete || md.isAdminClean || md.isArchive ){
           				%>
           					<!-- Begin Set Value Step3 -->
       					  <SCRIPT LANGUAGE="JavaScript">
           						getSalaType();
								initialization2('<%=md.getWFDataValue("__wf__employeeid")%>');
								setValue('__wf__old_cost_type','<%=md.getWFDataValue("__wf__old_cost_type")%>');
								setValue('old_cost_type','<%=md.getWFDataValue("old_cost_type")%>');
								//setValue('__wf__old_emp_every','<%//=md.getWFDataValue("old_emp_every")%>');
								//setValue('old_emp_every','<%//=md.getWFDataValue("old_emp_every")%>');
								setValue('__wf__adj_type','<%=md.getWFDataValue("__wf__adj_type")%>');
								chkRequreType();
								setTimeout("setValue('__wf__emp_type','<%=md.getWFDataValue("__wf__emp_type")%>')",500);
								setValue('__wf__cost_type','<%=md.getWFDataValue("__wf__cost_type")%>');
								//setValue('__wf__salatype','<%//=md.getWFDataValue("__wf__salatype")%>');
								setValue('__wf__adj_reason','<%=md.getWFDataValue("__wf__adj_reason")%>');
								initializationReason2('<%=md.getWFDataValue("__wf__adj_reason")%>');
								setValue('__wf__emp_position','<%=md.getWFDataValue("__wf__emp_position")%>');
								initializationPosition2('<%=md.getWFDataValue("__wf__emp_position")%>');
								setValue('__wf__bu1','<%=md.getWFDataValue("__wf__bu1")%>');
								initializationBu12('<%=md.getWFDataValue("__wf__bu1")%>');
								setValue('__wf__bu2','<%=md.getWFDataValue("__wf__bu2")%>');
								initializationBu22('<%=md.getWFDataValue("__wf__bu2")%>');
								setValue('__wf__workarea','<%=md.getWFDataValue("__wf__workarea")%>');
								initializationWorkArea2('<%=md.getWFDataValue("__wf__workarea")%>');
								setValue('__wf__time0','<%=md.getWFDataValue("__wf__time0")%>');
								initializationTime02('<%=md.getWFDataValue("__wf__time0")%>');
								setValue('__wf__emp_type','<%=md.getWFDataValue("__wf__emp_type")%>');
								setValue('__wf__job','<%=md.getWFDataValue("__wf__job")%>');
								initializationJob2('<%=md.getWFDataValue("__wf__job")%>');
								setValue('__wf__costcenter','<%=md.getWFDataValue("__wf__costcenter")%>');
								initializationCost2('<%=md.getWFDataValue("__wf__costcenter")%>');
								setValue('__wf__costcenter','<%=md.getWFDataValue("__wf__newbossid")%>');
								initializationBoss('<%=md.getWFDataValue("__wf__newbossid")%>');
								//setValue('__wf__salary','<%//=md.getWFDataValue("__wf__salary")%>')
								setValue('__wf__adj_date','<%=chkNull.chkNullString(md.getWFDataValue("__wf__adj_date"), new CscCalendar().getDDMMYYYY())%>');
								setValue('__wf__eff_date','<%=chkNull.chkNullString(md.getWFDataValue("__wf__eff_date"), new CscCalendar().getDDMMYYYY())%>');
								setValue('__checkPage','false');								
								setValue('priority','<%=screenSingle.getDataLabel("VW_INCIDENT","PRIORITY")%>');
							<%
								if(!md.isAdminEdit){
							%>
								setTimeout("setDisabled(true)",1000);
							<%}%>
           					</SCRIPT>
           					<!-- End Set Value Step3 -->
           				<%
           				}
           				%>
           				<!-- End Set Value -->
						</DIV>
	  </TD>
					<TD VALIGN="top" BACKGROUND="../IMAGES/MYNOTE/BPM_07.jpg">&nbsp;</TD>
			  </TR>
				<TR>
					<TD COLSPAN="2" HEIGHT="20" BACKGROUND="../IMAGES/MYNOTE/BPM_09.jpg"><DIV ALIGN="center"><SPAN CLASS="txt02">&nbsp;</SPAN></DIV></TD>
				</TR>
			</TABLE>
			<%=screenSingle.endJSP()%>
	</FORM>
	</BODY>
</HTML>
<%
}
%>