WELEXP003C2.jsp 41.7 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
<%@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.ManageDocumentService"%>
<%@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.*"%>
<%@page import="com.csc.library.components.*,com.csc.library.report.ReportUDF"%>

<%request.setCharacterEncoding("UTF-8");%>
<jsp:useBean id="welexp003c1" class="com.csc.library.system.Task" scope="page"/>
<jsp:setProperty name="welexp003c1" property="appname" value="WELFARE" />
<jsp:setProperty name="welexp003c1" property="classauthen" value="WorkflowUIAuthen" />
<%
welexp003c1.setChannel(request,response);
welexp003c1.checkProfile();
if( welexp003c1.getUProfile() != null ){
	DbRecord borrow_emp=new InitialRecord(welexp003c1.getUProfile()).getDbRecord("texpend_summary_emp");
	DbRecord borrow_emp_date=new InitialRecord(welexp003c1.getUProfile()).getDbRecord("Texpend_summary_emp_date");
	ReportUDF rf=new ReportUDF();
	CheckNull chkNull = new CheckNull();
	String collaborator=chkNull.chkNullString(request.getParameter("collaborator")); 
	String pedestalstatus[]=rf.getSystemCode("PEDESTAL_TYPE",welexp003c1.getUProfile().get("lang"));		
	boolean isstep1=Boolean.parseBoolean(java.net.URLDecoder.decode(chkNull.chkNullString(request.getParameter("isstep1"))));		
	String keyvalue[];										
	/*				for(int n=0;n<module.length;n++){
							keyvalue=module[n].split(",");
							pedestalstatus+= "<option value='"+keyvalue[0]+"'>"+keyvalue[1]+"</option>";	
					}*/
	String vehiclestatus[]=rf.getSystemCode("EXPEND_STAT",welexp003c1.getUProfile().get("lang"));	

					
%>
<HTML>
	<HEAD>
		<TITLE>myNOTE : Business Process Management Service</TITLE>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
		<LINK HREF="../CSS/MYNOTE.css" REL="stylesheet" TYPE="text/css">
		<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/SearchDWR.js'></script>  	   
	   <script type='text/javascript' src='/hr/dwr/interface/ExchangerateCtrl.js'></script>		
       <script type='text/javascript' src='/hr/dwr/interface/CheckExpendDwr.js'></script>	   	   
	   <script type='text/javascript' src='/hr/dwr/interface/Summary_emp_dateCtrl.js'></script>		
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/VIEWCALENDAR.js'></SCRIPT>
		<SCRIPT LANGUAGE="JavaScript">setLang('<%=welexp003c1.getUProfile().get("lang")%>');</SCRIPT>
		<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
		ThaiCode[311]="ข้อมูลไม่ถูกต้อง วันที่ต้องอยู่ในช่วง ";
		EngCode[311]="invalid date between ";		
		ThaiCode[312]="กรุณาระบุ หมายเลขเอกสารการคืนเงิน";
		EngCode[312]="invalid document no ,please insert document no ";		

		
			var empdateCache = { };
			var reqArray=new Array(11);
			var msg="";
			
		  function saveValue(flag) {
		  
		 if(checkPeriodDate()&&checkValid()){
				  var summary_emp_date ={}
					hiddenDiv();
					dwr.engine.beginBatch();
					 for(key in empdateCache){
							summary_emp_date=empdateCache[key];
							Summary_emp_dateCtrl.setEmpdate(summary_emp_date);
					 }
					filldate();
					setItemvalue();
					CheckExpendBean(reqArray,allItem);	
					
					var summary_emp ={expendid:null , employeeid:null , companyid:null , collaborator:null , collaboratordesc:null , startdate:null , enddate:null , starttime:null , endtime:null , costcenter:null , budget:null , costcenterdesc:null , budgetdesc:null , borrowid:null , borrowid_account:null , 	borrowcost:null , refundno:null , 	 refundcost:null , 	 daycount:null , 	 allowday:null , 	 allowcost:null , 	 vehiclecost:null , remarks:null ,pedestalcost:null ,moneytype:null}
					dwr.util.getValues(summary_emp);
					window.opener.writeSummaryemp(summary_emp);
					 dwr.engine.endBatch({
									async:false
									});			  
					displayDiv();
					if(flag)
								window.close();
				}
			}			
						
		function CheckExpendBean(reqArray,allItem){
  			   CheckExpendDwr.checkAllItems(reqArray,allItem);					   
		}

		function setItemvalue(){
			var exptype=window.opener.document.cscform.__wf__exp_type.value;
			var provinceid=window.opener.document.cscform.__wf__provinceid.value;
			var countryid=window.opener.document.cscform.__wf__countryid.value;
			var locationtype=window.opener.document.cscform.__wf__location_type.value;
			var trav_by=window.opener.document.cscform.__wf__trav_by.value;
			var trav_type=window.opener.document.cscform.__wf__trav_type.value;
			var stdate=window.opener.document.cscform.__wf__startdate.value;
			var endate=window.opener.document.cscform.__wf__enddate.value;
			with(document.cscform){	
							reqArray[0]="301#"+collaborator.value+"#0# #"+stdate+"#"+exptype+"#"+locationtype+"#"+provinceid+"#"+countryid+"#"+endate+"#"+trav_by+"#"+trav_type+"# # # #"+parseFloat(allowday.value);
							reqArray[1]="302#"+collaborator.value+"#0# #"+stdate+"#"+exptype+"#"+locationtype+"#"+provinceid+"#"+countryid+"#"+endate+"#"+trav_by+"#"+trav_type;
							reqArray[2]="304#"+collaborator.value+"#0# #"+stdate+"#"+exptype+"#"+locationtype+"#"+provinceid+"#"+countryid+"#"+endate+"#"+trav_by+"#"+trav_type;
			}			
		}
						
						
		var allItem = function(data1){
		 msg="";
			for(var i=0;i<data1.length;i++){
					if(data1[i]!=null){						
							var vdata=data1[i].split('#');
							setValueExpend(vdata);
					}
			}
		}		
		
			function setValueExpend(data){
				with(document.cscform){	
						if(data[8]=="301"){
								var exch=parseFloat(exrate[moneytype.options[moneytype.selectedIndex].value]);
								allowcost.value=formatCurrency(data[5]*exch);	
						}else if(data[8]=="302"){ 
							pedestalcost.value=data[5]*parseFloat(pedestalday.value);
						}else if(data[8]=="304"){
							vehiclecost.value=data[5]*parseFloat(vehicleday.value);
						}
				}
			}
						
								
		function goHelp(helpName,inputName){
				with(document.cscform){
				var helpReturn="",fcon="";
				var temp = __fixCon.value;
					if(inputName == "collaborator"){
						var emplist=window.opener.document.cscform.__wf__texpend_summary_emp_list.value.split(",");
						var empfilter=""; 
							if(emplist.length>0){
									empfilter=" and employeeid not in(";
									for(var k=0;k<emplist.length;k++){
											empfilter+="'"+emplist[k]+"'"
											if(k<emplist.length-1){
													empfilter+=",";
											}
									}
									empfilter+=") ";
							}
							if(parseFloat(borrowcost.value.replace(","))==0){
							__fixCon.value="employeeid in (select  employeeid from texpend_emp where expendid='"+expendid.value+"' and rstatus!='1' and bstatus !='1')"+empfilter;
							}else{
							__fixCon.value="employeeid in (select  employeeid from texpend_emp where expendid='"+expendid.value+"' and employeeid ='"+employeeid.value+"')"+empfilter;
							}
						helpReturn="collaborator:employeeid,collaboratordesc:fullname";
						linkHelp_Return_search(helpName,helpReturn);
					}if(inputName == "costcenter"){
						helpReturn="costcenter:costcenterid,costcenterdesc:tdesc";
						linkHelp_Return_search(helpName,helpReturn);
					}else if(inputName == "budget"){
									if(costcenter.value.length>0){
												temp = __fixCon.value;
												__fixCon.value = "costcenterid='"+costcenter.value+"'";
												helpReturn="budget:budgetid,budgetdesc:tdesc";
												linkHelp_Return(helpName,helpReturn);
												__fixCon.value=temp;								
										}else{
												alert(MyCode[0]);
												costcenter.focus();
										}						
					}else if(inputName == "locate_from"){
						helpReturn="locate_from:tranid,locate_fromdesc:tdesc";
						linkHelp_Return(helpName,helpReturn);
					}
					__fixCon.value=temp;	
					}				
			}		
						
			function linkHelp_Return(help,input){
				with( document.cscform ){
					var param="EMV_PRU084.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 loadFromParent(keyid){
				dwr.engine.beginBatch();
					var obj=window.opener.loadDataEmp(keyid);
					dwr.util.setValues(obj);
					filldate();
					 dwr.engine.endBatch();
			}
			
			function gendate(){
				with(document.cscform){
						if(checkPeriodDate()&&checkValid()){
						empdateCache = { };
						dwr.engine.beginBatch();
						Summary_emp_dateCtrl.generate(collaborator.value,startdate.value,enddate.value);
						filldate();				
						calculateDate();		
  					   dwr.engine.endBatch();
					   }
				}
			}
			
			function checkValid(){
					with(document.cscform){
						if(collaborator.value.length==0){
								alert(MyCode[0]);
								collaborator.focus();
								return false;
						}else if(parseFloat(refundcost.value)>0 && refundno.value.length==0){
								alert(MyCode[312]);								
								refundno.focus();		
								return false;						
						}
						return true;
					}
			}
			
			function checkPeriodDate(){
				var bdate=$("enddate").value.split("-");
				var cdate=new Date(bdate[2],bdate[1]-1,bdate[0]);
						bdate=window.opener.document.cscform.__wf__startdate.value.split("-");
				var stdate=new Date(bdate[2],bdate[1]-1,bdate[0]);
						bdate=window.opener.document.cscform.__wf__enddate.value.split("-");
				var endate=new Date(bdate[2],bdate[1]-1,bdate[0]);
				var st=Math.ceil(stdate.getTime());
				var cu=Math.ceil(cdate.getTime());
				var en=Math.ceil(endate.getTime());	
				if(cu<st || cu>en){
						//alert(MyCode[311]+" "+window.opener.document.cscform.__wf__startdate.value +"  -   "+window.opener.document.cscform.__wf__enddate.value);
						//return false;
						window.opener.document.cscform.__wf__outoflimit.value="1";
				}
				return true;
		}
			
			function calculateDate(){
				with(document.cscform){
				 		var day=1000*60*60;
						var bdate=startdate.value.split("-");
						var stdate=new Date(bdate[2],bdate[1]-1,bdate[0]);
								stdate.setHours(parseFloat(starttime.value.substring(0,starttime.value.indexOf("."))));
								stdate.setMinutes(parseFloat(starttime.value.substring(starttime.value.indexOf("."),starttime.value.length)));
						var bdate=enddate.value.split("-");
						var endate=new Date(bdate[2],bdate[1]-1,bdate[0]);
								endate.setHours(parseFloat(endtime.value.substring(0,endtime.value.indexOf("."))));
								endate.setMinutes(parseFloat(endtime.value.substring(endtime.value.indexOf("."),endtime.value.length)));
						var st=Math.ceil(stdate.getTime());
						var en=Math.ceil(endate.getTime());	
						var diff=(en-st)/day;
						var diffday=diff/24;
						var diffhour=diff%24;
						var dd=parseInt(diffday)+1;
								if(diffhour>12)
								      dd=parseFloat(dd)+1;
								else if(diffhour>6)
										dd+=".50";
										else 
											dd+=".00";
								
						daycount.value=formatCurrency(dd);
					}
			}
			
			function changeValue(indexkey,changename,owner){
					var obj=empdateCache[indexkey];					
					eval("obj.	"+changename+"="+owner.value);							
					if(changename=="pedestalstatus"){		
						if(owner.value!="0"){
								$("allowancestatus"+indexkey).disabled=true;
								$("allowancestatus"+indexkey).value="0";
								eval("obj.allowancestatus=0");
						}else{
							$("allowancestatus"+indexkey).disabled=false;
						}
					}
					empdateCache[indexkey]=obj;
			}
			
			
			function filldate() {
					empdateCache = { };
			  		Summary_emp_dateCtrl.getEmpdate(function(empdatectrl) {
						dwr.util.removeAllRows("empdate_body", { filter:function(tr) { 
						  return (tr.id != "empdate_pattern");
						}
						
						}); 
					
						var empdate, id; 
						var alcount=0,vcount=0,pcount=0;
						empdatectrl.sort(function(p1, p2) { return p1.dateid.localeCompare(p2.dateid); });	
						var disabled="<%=(isstep1)?"":" disabled "%>";						
						for (var i = 0; i < empdatectrl.length; i++) {
						  empdate = empdatectrl[i];
						  id = empdate.dateid;
						  dwr.util.cloneNode("empdate_pattern", { idSuffix:id });
						  dwr.util.setValue("empdate_dateid"+id,empdate.dateid); 
						  dwr.util.setValue("dateid"+id,empdate.dateid); 
						  var pse="",chk=" selected ";						  
						  <%
						  for(int n=0;n<pedestalstatus.length;n++){
							keyvalue=pedestalstatus[n].split(",");
						   %>
						   if(empdate.pedestalstatus=="<%=keyvalue[0]%>")
						   	pse+= "<option value='<%=keyvalue[0]%>' "+chk+"><%=keyvalue[1]%></option>";	
						   else
							pse+= "<option value='<%=keyvalue[0]%>'><%=keyvalue[1]%></option>";	
						<%
							}
						  %>						  
 						  $("empdate_pedestalstatus"+id).innerHTML="<select id=\"pedestalstatus"+id+"\" onchange=\"changeValue('"+empdate.dateid+"','pedestalstatus',this) \""+disabled+">"+pse+"</select>";
						  dwr.util.setValue("pedestalstatus"+id,empdate.pedestalstatus); 
						  pse="";
						  <%
						  for(int n=0;n<vehiclestatus.length;n++){
							keyvalue=vehiclestatus[n].split(",");
						   %> 
						   if(empdate.vehiclestatus=="<%=keyvalue[0]%>")
						   	pse+= "<option value='<%=keyvalue[0]%>' "+chk+"><%=keyvalue[1]%></option>";	
						   else
							pse+= "<option value='<%=keyvalue[0]%>'><%=keyvalue[1]%></option>";	
						<%
							}
						  %>						  
						  $("empdate_vehiclestatus"+id).innerHTML="<select id=\"vehiclestatus"+id+"\" onchange=\"changeValue('"+empdate.dateid+"','vehiclestatus',this) \""+disabled+">"+pse+"</select>";
						  dwr.util.setValue("vehiclestatus"+id,empdate.vehiclestatus);
						  var pse="";
						  <%
						  for(int n=0;n<vehiclestatus.length;n++){
							keyvalue=vehiclestatus[n].split(",");
						   %>
						   if(empdate.allowancestatus=="<%=keyvalue[0]%>")
						   	pse+= "<option value='<%=keyvalue[0]%>' "+chk+"><%=keyvalue[1]%></option>";	
						   else
							pse+= "<option value='<%=keyvalue[0]%>'><%=keyvalue[1]%></option>";	
						<%
							}
						  %>	
						  var tmpdis=disabled; 
						  if(disabled.length==0){
						  		if(empdate.pedestalstatus!="0"){
										disabled=" disabled ";
								}
						  }					  
						  $("empdate_allowancestatus"+id).innerHTML="<select id=\"allowancestatus"+id+"\" onchange=\"changeValue('"+empdate.dateid+"','allowancestatus',this) \""+disabled+">"+pse+"</select>";
						  dwr.util.setValue("allowancestatus"+id,empdate.allowancestatus);					  
						  if(empdate.allowancestatus=="1") alcount+=1;
						  if(empdate.vehiclestatus=="1") vcount+=1;
						  if(empdate.pedestalstatus!="0") pcount+=1;					   
						 document.getElementById("empdate_pattern" + id).style.display = "";  // officially we should use table-row, but IE prefers "" for some reason
						 empdateCache[id] = empdate;
						 
						 disabled=tmpdis;						 
						}
						with(document.cscform){
								allowday.value=alcount;
								vehicleday.value=vcount;
								pedestalday.value=pcount;
						}

			  });
			}
			
var exrate={};
		
		function fillExchange(types){
		  ExchangerateCtrl.getExchange(function(exchangectrl) {
		
			var exchange, id;
			exchangectrl.sort(function(p1, p2) { return p1.exchangeid.localeCompare(p2.exchangeid); });
			var isstep1="<%=isstep1%>";			
			var str="<select id=\"moneytype\" disabled>";
				if(isstep1=="true"){
					str="<select id=\"moneytype\">";		
				}
			for (var i = 0; i < exchangectrl.length; i++) {
			  exchange = exchangectrl[i];		
			  str+="<option value=\""+exchange.exchangeid+"\"";
			  if(exchange.exchangeid==types)
			  	str+=" selected ";
			  str+=">"+exchange.exchangedesc+"</option>";
			 exrate[exchange.exchangeid]=exchange.amount;
			}
			 $("__moneytype").innerHTML=str;
		  });
		  
		}			
			
			function hiddenDiv(){
				with(document.cscform){
					 msg="";
					 reqArray=new Array(11);
					 btsubmit.style.display="none";
					 showtxt.innerHTML="<p align='center'><img src='./IMAGES/WAITING.gif'><BR><font color='red' ><B>"+MyCode[210]+"</H3></font><p>";
				}
			}
			
			function displayDiv(){
						with(document.cscform){
								 btsubmit.style.display="";
								 showtxt.innerHTML="";
							}	
			}					
			
			function postReturn(){
					getBorrowed();
					searchCostcenter();
			}
			
			function getBorrowed(){
			with(document.cscform){
			SearchDWR.searchDBXMLAll(new Array("TEXPEND_EMPHELP", "texpend_emp.borrow_cost", "texpend_emp:employeeid = '"+collaborator.value+"' and expendid='"+expendid.value+"'", "false", "langOn"), function(data){
							if(data.length>0){ 
									borrowcost.value=data[0][0];
							}
					});
				}
			}
			
			function formatCurrency(num) {
					num = num.toString().replace(/\|\,/g,'');
					if(isNaN(num))
						num = "0";
						sign = (num == (num = Math.abs(num)));
						num = Math.floor(num*100+0.50000000001);
						cents = num%100;
						num = Math.floor(num/100).toString();
					if(cents<10)
						cents = "0" + cents;
					for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
						num = num.substring(0,num.length-(4*i+3))+','+
						num.substring(num.length-(4*i+3));
						return (((sign)?'':'-') +  num + '.' + cents);
			}			
			
			
			function searchCostcenter(){
				with(document.cscform){			
						SearchDWR.searchDBXMLAll(new Array("MBUDGET_PTTHELP", "mbudget_ptt.budgetid,mbudget_ptt.tdesc", "mbudget_ptt:costcenterid = '"+costcenter.value+"'", "false", "langOn"), function(data){
										if(data.length>0){  
													budget.value=data[0][0];
													budgetdesc.value=data[0][1];
										}else{
													budget.value="";
													budgetdesc.value="";
										}
								});						
					}
			}
					
			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_search(help,input){
				with( document.cscform ){
					var param="BROWSE_WELFAREHELP.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="EMV_PRU084.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='<%=welexp003c1.getUProfile().get("actor")%>' and (wf_status<>'4' and wf_status<>'6' and wf_status<>'3' and wf_status<>'8' and wf_status<>'A' and wf_status<>'B')";
					var param="EMV_PRU084.jsp?__helpName="+help+"&__fieldSearch="+input+"&__pageCall="+__screen.value+"&__fixCon="+fix;
					alert("param is:"+param);
					window.open(param,"Help","left=150,top=150,width=530,height=370,resizable=yes,scrollbars=yes,toolbar=no,status=yes");
					__fixCon.value = temp;
				}
			}		
			
		function chkInputDate(obj) {
		var temp = obj.value;
		var tempdate = obj.value.split("-");
		var chk = true;
		//ตรวจสอบดูว่าพิมเป็นตัวอักษรหรือไม่
		if (!chkIntNotChar (temp)) {
			alert(MyAlert[30]); 
			obj.value = datePresent(); 
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ากรอกตัวเลขครบแปดหลักแล้วหรือไม่
		else if ((obj.value.length < 8) && (obj.value.length > 0)) { 
			alert(MyAlert[31]); 
			obj.value = datePresent();
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่าถ้ากรอกวันที่ครบแปดตัวเลขแล้ว กรอก วัน เดือน ปี ถูกต้องหรือไม่ ( โดยเรียก script checkTrueDay(str) )
		else if ( (tempdate[0].length == 2) && (tempdate[1].length == 2) && (tempdate[2].length == 4) && (temp.length > 0 ) && (!checkTrueDay(delWordDate(temp))) ) {
			alert(MyAlert[31]);
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ากรอก วันเป็นเลขสองหลัก เดือนเป็นเลขสองหลัก และปีเป็นเลขสี่หลักหรือป่าว
		else if ( (tempdate[0].length != 2 || tempdate[1].length != 2 || tempdate[2].length != 4) && temp.length > 0  ) {
			alert(MyAlert[31]);
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ากรอกวันเกินสิบตัวเลขหรือไม่ ( กรณีที่เกิดคือ copy คำมาแปะอาจเป็นภาษาไทย หรือ อักษร )
		else if ( (temp != delWordDate(obj.value)) && (temp.length > 10) ) {
			obj.value = datePresent(); 
			alert(MyAlert[31]); 
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ารูปแบบวันที่อยู่ในรูปของ ddmmyyyy หรือ dd-mm-yyyy แล้วหรือยัง
		else if ( tempdate.length != 3 ) 	{
			obj.value = datePresent();
			alert(MyAlert[31]); 
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่า วันที่กรอกเป็นเลขสองหลัก เดือนเป็นเลขสองหลัก และปีเป็นเลขสี่หลักหรือไม่
		else if (  (tempdate[0].length != 2) && (tempdate[1].length != 2) && (tempdate[2].length != 4)  )   {
			obj.value = datePresent();
			alert(MyAlert[31]); 
			obj.select();
			chk = false;
		}
		return chk; //ถ้ากรอกวันที่ถูกต้องตามเงื่อนไขแล้วจะ retrun เป็น true
	}		
					
					
		function transferRate(res,des){
				with(document.cscform){
						var rate =parseFloat(exrate[moneytype.options[moneytype.selectedIndex].value]);
						des.value=formatCurrency(parseFloat(res.value)*rate);
				}
		}
											
</script>
		<STYLE TYPE="text/css">
		<!--
			.style1 {
			color: #FFFFFF;
			font-weight: bold;
			}
		-->
		</STYLE>
	</HEAD>
	<BODY onLoad="MM_preloadImages('../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif')">
		<FORM NAME="cscform" METHOD="post" ACTION="WELEXP003C2.jsp">
			<INPUT TYPE="hidden" NAME="__screen" VALUE="WELEXP003C2">
			<INPUT TYPE="hidden" NAME="__cmd" VALUE="">
			<INPUT TYPE="hidden" NAME="__fixCon" VALUE="">
			<INPUT TYPE="hidden" NAME="__help" VALUE="">
			<INPUT TYPE="hidden" NAME="__language" VALUE="<%=welexp003c1.getUProfile().get("lang")%>">
			<INPUT TYPE="hidden" NAME="__companyid" VALUE="<%=welexp003c1.getUProfile().get("companyid")%>">
			<INPUT TYPE="hidden" NAME="companyid"  id="companyid" VALUE="<%=welexp003c1.getUProfile().get("companyid")%>">
			<INPUT TYPE="hidden" NAME="__calendar" VALUE="">
			<INPUT TYPE="hidden" NAME="expendid" id="expendid" VALUE="<%=request.getParameter("expendid")%>">
			<INPUT TYPE="hidden" NAME="employeeid"  id="employeeid" VALUE="<%=request.getParameter("employeeid")%>">
			<INPUT TYPE="hidden" NAME="vehicleday"  id="vehicleday" VALUE="">
			<INPUT TYPE="hidden" NAME="pedestalday"  id="pedestalday" VALUE="">
			<INPUT TYPE="hidden" NAME="__server_date"  id="__server_date" VALUE="<%=new CscCalendar().getDDMMYYYY()%>">
			<SCRIPT LANGUAGE="JavaScript">getInputFormatDate();</SCRIPT>			

			<TABLE WIDTH="580" 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"><FONT COLOR="#FFFFFF"></FONT></TD>
    				<TD >
      					<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01">
      						<td width="34%">
							<TR BGCOLOR="#EFF7FA">
							<TD  COLSPAN="2" class="column-title"><DIV ALIGN="CENTER"><B><script language="javascript">swapLang("รายละเอียดผู้เดินทางและร่วมเดิมทาง");</script></B></DIV></TD>
							</TR>
													<TR>
													<TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("collaborator").getDescription()%></td>
													<TD width="66%" NOWRAP="nowrap" CLASS="desc"><DIV ALIGN="left"><INPUT TYPE="text" NAME="collaborator" id="collaborator"  size="10" VALUE="" ><%if(isstep1){%><A HREF="javascript:goHelp('MEMPLOYEEHELP','collaborator')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="employee_image2" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A><%}%>
													    <INPUT TYPE="text" SIZE="50" NAME="collaboratordesc" id="collaboratordesc"  VALUE="" class="disabled" readonly></DIV></TD>
													</TR>
													<TR>
                                                      <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("startdate").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><DIV ALIGN="left">
													    <INPUT TYPE="text" NAME="startdate" id="startdate" VALUE="<%=new CscCalendar().getDDMMYYYY()%>" SIZE="10" MAXLENGTH="10" ONKEYPRESS="chkInteger();" ONBLUR="chkInputDate(this);" ONKEYUP="formatDate(this);" ONFOCUS="this.select();"  >
                                                        <%if(isstep1){%><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="calendar" name="Image1" border="0" align="absmiddle" id="Image1" onClick="viewCal('startdate')"></a><%}%><script language="javascript">swapLang('Time');</script>
                                                        <INPUT TYPE="text" NAME="starttime" id="starttime" VALUE="0.00" MAXLENGTH="5" SIZE="5"  class="numeric" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);">
													  </DIV></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("enddate").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="enddate" id="enddate" VALUE="<%=new CscCalendar().getDDMMYYYY()%>" SIZE="10" MAXLENGTH="10" ONKEYPRESS="chkInteger();" ONBLUR="chkInputDate(this);" ONKEYUP="formatDate(this);" ONFOCUS="this.select();">
                                                        <%if(isstep1){%><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="calendar" name="Image11" border="0" align="absmiddle" id="Image11" onClick="viewCal('enddate')"></a><%}%><script language="javascript">swapLang('Time');</script>
                                                      <INPUT TYPE="text" NAME="endtime" id="endtime" VALUE="0.00" MAXLENGTH="5" SIZE="5"  class="numeric" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);"></TD>
						  </TR>
						  							<%if(isstep1){%>
													<TR>
													  <TD align="right" nowrap  class="column-label"><script language="javascript">swapLang('Display date');</script></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><a href="#"><IMG HEIGHT=37 SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_GEN.gif" WIDTH=89 BORDER=0 onClick="gendate()"></a></TD>
						  							</TR>
						  							<%}%>
													<TR>
													  <TD colspan="2" nowrap  class='column-title'><div align="left"><script language="javascript">swapLang('Travel date')</script></div></td>
						  </TR>
													<TR>
													  <TD colspan="2" align="right" nowrap  class="column-input"><TABLE WIDTH="100%" 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" ID="tbChild">
                                                              <TR class="row-header">
                                                                <TD width="20%" ><%=borrow_emp_date.getField("dateid").getDescription()%></TD>
                                                                <TD width="23%" class="column-header" ><%=borrow_emp_date.getField("pedestalstatus").getDescription()%></TD>
                                                                <TD width="29%" class="column-header"><%=borrow_emp_date.getField("vehiclestatus").getDescription()%></TD>
                                                                <TD width="28%" class="column-header"><%=borrow_emp_date.getField("allowancestatus").getDescription()%></TD>
                                                              </TR>
                                                              <tbody id="empdate_body">
                                                                <tr id="empdate_pattern" style="display:none;">
                                                                  <td class="columnobject1"><span id="empdate_dateid"></span></td>
                                                                  <td class="columnobject1"><span id="empdate_pedestalstatus"></span></td>
                                                                  <td class="columnobject1"><span id="empdate_vehiclestatus"></span></td>
                                                                  <td class="columnobject1"><span id="empdate_allowancestatus"></span></td>
																   <input type="hidden" id="dateid" >
                                                                </tr>
                                                              </tbody>
                                                          </TABLE></TD>
                                                          <TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/R2.gif"></TD>
                                                        </TR>
                                                        <TR>
                                                          <TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/L2.gif"></TD>
                                                          <TD CLASS="column-data" align="center"><BR>
                                                              <div align="center"></div></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></td>
						  </TR>
													<TR>
                                                      <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("costcenter").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><DIV ALIGN="left">
													    <INPUT TYPE="text" NAME="costcenter" id="costcenter"  size="10" VALUE="" >
													    <%if(isstep1){%><A HREF="javascript:goHelp('MCOSTCENTER0HELP','costcenter')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="employee_image2" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A><%}%>
                                                          <INPUT TYPE="text" SIZE="50" NAME="costcenterdesc" id="costcenterdesc"  VALUE="" readonly class="disabled">
													    </DIV></TD>
						  </TR>
													<TR>
                                                      <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("budget").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><DIV ALIGN="left">
													    <INPUT TYPE="text" NAME="budget" id="budget"  VALUE="" size="10" >
													    <%if(isstep1){%><A HREF="javascript:goHelp('MBUDGET_PTTHELP','budget')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="employee_image2" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></A><%}%>
                                                          <INPUT TYPE="text" SIZE="50" NAME="budgetdesc" id="budgetdesc"  VALUE="" readonly class="disabled">
													    </DIV></TD>
						  </TR>
													
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("borrowid").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="borrowid" id="borrowid"  size="30" VALUE=""  class="disabled" readonly></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("borrowid_account").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="borrowid_account" id="borrowid_account"  size="30" VALUE="" ></TD>
						  </TR>
													<TR>
                                                      <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("borrowcost").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="borrowcost" size="10" maxlength="10" value="0.00"  class="numeric"  disabled/>
													  </span>
												      <script language="javascript">swapLang("Baht");</script></TD>
						  </TR>
													<TR>
                                                      <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("refundno").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="refundno" id="refundno"  size="30" VALUE="" ></TD>
						  </TR>
													<TR>
                                                      <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("refundcost").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="refundcost" size="10" maxlength="10" value="0.00"  class="numeric" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);"/>
													  </span>
													    <script language="javascript">swapLang("Baht");</script></TD>
						  </TR>
													
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("daycount").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="daycount" id="daycount" size="5" maxlength="5" value="0" disabled  class="numeric"/>
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("moneytype").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span id="__moneytype"></span></TD>
						  </TR>
						  
						  							<%if(isstep1){%>
													<TR>
													  <TD align="right" nowrap  class="column-label"><script language="javascript">swapLang('Calculate allowance')</script></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><a href="javascript:saveValue(false);"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_CALCULATE.gif" WIDTH="101" HEIGHT="37" BORDER="0" ALT="Add"></a></TD>
												  </TR>
												  <%}%>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("allowday").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="allowday" id="allowday" size="5" maxlength="5" value="0"  class="numeric" disabled/>
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("allowcost").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="allowcost" id="allowcost" size="10" maxlength="10" value="0.00" disabled class="numeric"/>
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("vehiclecost").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="vehiclecost"  id="vehiclecost" size="10" maxlength="10" value="0.00" disabled  class="numeric"/>
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("pedestalcost").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="pedestalcost"  id="pedestalcost" size="10" maxlength="10" value="0.00" disabled  class="numeric"/>
													  </span></TD>
											  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("remarks").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    				<textarea NAME='remarks' id="remarks" COLS='80' ROWS='4' onKeyPress="chkSpecialStr(event);" onKeyUp="chkLimitTextArea(this,1000);sysIsEdit();" onBlur="trimValue(this);" ></textarea>
													  </span></TD>
						  </TR>
      				  </TABLE>
    				</FONT></TD>
    				<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/R2.gif"><FONT COLOR="#FFFFFF"></FONT></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>
			<BR>
			<TABLE WIDTH="500"  BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" CLASS="thai03">
  				<TR>
    				<TD><SPAN id="showtxt"></SPAN><DIV ALIGN="right"  id="btsubmit"> <%if(isstep1){%><A HREF="JavaScript:saveValue(true);"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_SUBMIT.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A><%}%><A HREF="JavaScript:window.close();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_CANCEL.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
  				</TR>
			</TABLE>
			<%
				if(collaborator.length()>0){
				%>
				<script language="javascript">
				loadFromParent("<%=collaborator%>");
				getBorrowed();
				</script>
				<%		
				}else{
			%>
				<script language="javascript">
						document.cscform.costcenter.value=window.opener.document.cscform.__wf__costcenter.value;
						document.cscform.budget.value=window.opener.document.cscform.__wf__budget.value;				
						document.cscform.costcenterdesc.value=window.opener.document.cscform.mcostcenter0_tdesc.value;
						document.cscform.budgetdesc.value=window.opener.document.cscform.budgetdesc.value;										
				</script>			
			<%}%>
				<script language="javascript">
				         fillExchange();
						document.cscform.startdate.value=window.opener.document.cscform.__wf__startdate.value;
						document.cscform.enddate.value=window.opener.document.cscform.__wf__enddate.value;
						document.cscform.borrowcost.value=window.opener.document.cscform.__wf__borrow_cost.value;
						document.cscform.borrowid.value=window.opener.document.cscform.__wf__expendid.value;						
				</script>
			<%if(!isstep1){%>
			<script language="javascript">setDisabled(true);</script>		
			<%}%>
			
    </FORM>
</BODY>
</HTML>
<%}%>