function chkDateTime1(valueSearch){
	var tmpval="";
	with(document.cscform){
		var valueSearch1=valueSearch.split("-");
		if(valueSearch1.length==3){
			if(valueSearch1[1].length==1){
				valueSearch1[1]="0"+valueSearch1[1];
			}
			if(valueSearch1[0].length==1){
				valueSearch1[0]="0"+valueSearch1[0];
			}
			valueSearch1[2]=parseInt(valueSearch1[2]);
			return valueSearch=valueSearch1[2]+"-"+valueSearch1[1]+"-"+valueSearch1[0];
		}
	}
}

function addOption(objOption,objList) {
	//alert(">>>>>"+objOption+":"+objList);
   	addToOption(objOption,objList) ;
} // End of addOption()

function addToOption(objOption,destList) {
	//alert(objOption+":"+destList);
  	var lengthAll = parseInt(objOption.length)+parseInt(destList.options.length);
	newDestList = new Array(lengthAll);
	var clen=0;
	for(len=0; len<destList.options.length; len++) {
		if (destList.options[len] != null) {
			newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
			clen++;
		}
	}

	for ( var j = 0 ; j < objOption.length; j++ ) {
		if ( objOption[ j ] != null ) {
			newDestList[ clen ] = objOption[ j ];
			clen++;
		}
	}

	//newDestList.sort( compareOptionValues );
	for( var i = destList.options.length - 1; i >= 0; i-- )  {
		if ( destList.options[i] != null  ) {
			destList.options[i]  = null;
		}
	}

	for ( var j = 0; j < newDestList.length; j++ )  {
		if ( newDestList[ j ] != null ) {
			destList.options[ j ] =new Option(newDestList[ j ].text,newDestList[ j ].value);
		}
	}
} // End of addToOption()

function findKey(objOption,myList){
	//alert("in findKey:>"+objOption+":"+myList);
	for ( var j = 0 ; j < objOption.length; j++ ) {
		for(var i=0;i < myList.length;i++){
			if(objOption[j].value == myList.options[i].value){
				alert(myList.options[i].value+" "+MyCode[83]);
				return true;
			}//if
		}//for
	}	//for
	return false;
}

function goHelp(helpName,inputName,listName){
	var helpReturn;
	var key;
	var tdesc="tdesc",edesc="edesc";

	if (listName=='') {
		helpReturn = inputName+":employeeid"
		linkHelp_Return(helpName,helpReturn,"");
	} else {
		if (inputName=="bu1" ) {
			helpReturn="bu1";
			key="bu1id";
		} else if (inputName=="bu2" ) {
			helpReturn="bu2";
			key="bu2id";
		} else if (inputName=="bu3" ) {
			helpReturn="bu3";
			key="bu3id";
		} else if (inputName=="bu4" ) {
			helpReturn="bu4";
			key="bu4id";
		} else if (inputName=="bu5" ) {
			helpReturn="bu5";
			key="bu5id";
		} else if (inputName=="branch" ) {
			helpReturn="branch";
			key="branchid";
		} else if (inputName=="position" ) {
			helpReturn="position";
			key="positionid";
		} else if (inputName=="salatype" ) {
			helpReturn="salatype";
			key="codeid";
		} else if (inputName=="workarea" ) {
			helpReturn="workarea";
			key="workareaid";
		} else if (inputName=="emp_level" ) {
			helpReturn="emp_level";
			key="levelid";
		} else if (inputName=="time0" ) {
			helpReturn="time0";
			key="time0id";
		} else if (inputName=="employee" ) {
			helpReturn="employeeid";
			key="employeeid";
			tdesc="fullname";
			edesc="efullname";
		}else if (inputName=="pl" ) {
			helpReturn="pl";
			key="plid";
		}else if (inputName=="aps" ) {
			helpReturn="aps";
			key="apsid";
		}
		with(document.cscform){
			if (__fixCon.value!="")
				__fixCon.value=__fixCon.value;
			var param="PRU086.jsp?__helpName="+helpName+"&__helpReturn="+helpReturn
			+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off"
			+"&__listName="+listName+"&__key="+key+"&__tdesc="+tdesc+"&__edesc="+edesc+"&__astype="+__astype.value;
			window.open(param,"Help","left=50,top=70,width=920,height=680,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
		}
	}
}

function listDblClick(objmyList){
	for(i=objmyList.length;i > 0;i--){
		if(objmyList.options[i-1].selected==true){
			bCon=confirm(MyCode[84]+" "+objmyList.options[i-1].text+" ?");
			if (bCon==true){
				objmyList.options[i-1]  = null;
			}
		}
	}
}

// Ref : TA/JS/PROCESS.js