<html>
<head>
	<title translate="yes" data-res="TERMINATE_CONFIRM.TITLE"></title>
	<!--MqRelPath--><link rel="stylesheet" href="../../theme/css/censusmain.css" type="text/css" /><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" href="<BASE_VD>/theme/css/censusmain.css" type="text/css" /></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/images.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/images.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/cmqsysmsg.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/cmqsysmsg.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/mqsysutils.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqsysutils.js"></script></MqAbsPath-->
	
	<script type="text/javascript">
		// always define this object for the system messages
		var objSysMsg = new CMqSysMsg;
		var m_objMqButton=new MqButton();
		
		var mlngIssueID=g_MqRef.MqStr.GetQueryStringValue(location.search, "nID");
		var mstrUserName=g_MqRef.MqStr.GetQueryStringValue(location.search, "Name");
		var m_objRef;
		var SUCCESS_SAVE=-3;
		
		if(parent){
			m_objRef=parent;
		}			
		
		function TerminateEmployee()
		{
			if(m_objRef){
				
				var strUpdate="90=3;76=%1;91=%2";
				
				var strURL="HRIT.asp?WCI=wciTerminateEmp&nID="+mlngIssueID + "&UD=" + g_MqRef.MqStr.MqEncodeURIComponent(strUpdate);
						
				var objRequest=m_objRef.objRequest;
				if(objRequest){
					var strReturn=objRequest.Get(strURL);
				
					if (strReturn!=m_objRef.CANCEL_PROCESS){
						if (Number(strReturn)!=SUCCESS_SAVE) {
							alert(strReturn);
						}else{
							if(m_objRef.objFrames){
							    var winSL=m_objRef.objFrames.GetFrameWindow(m_objRef.SUMMARY_LIST_FRAME_ID);
							    if (winSL){
							        // Refresh to update the data 
							        winSL.location.reload();
							    }
							}
							ClosePopup();
						}
					}	
				}
			}
		}
		
		function ClosePopup()
		{
			if(m_objRef){
				m_objRef.CloseModalWindow();
			}
		}
		
		function Form_OnLoad()
		{
			g_MqRef.ResMgr.ProcessAll(document);		
			var objMsg=document.getElementById("confirmMsg");

			if(objMsg){
				objMsg.innerHTML=g_MqRef.MqStr.Format( g_MqRef.RESX["TERMINATE_CONFIRM.MSG"] ,mstrUserName);
			}
		}
	</script>
</head>

<body class="mainBody" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" onload="Form_OnLoad()">
	<div class="DialogLabel" style="padding-top:20px;padding-bottom:20px; text-align:center" id="confirmMsg"></div>
	
<table width="100%" align="center">
    <tr>
		<td align="center">
				<table>
					<tr>
						<td  width="50%">
							<script type="text/javascript">
								<!--
								m_objMqButton.WriteButtonHTML("Yes","TerminateEmployee();","Yes",false,m_objMqButton.STATE_1,"Yes");
								//-->
							</script>
						</td>
						<td width="50%">
							<script type="text/javascript">
								<!--
								m_objMqButton.WriteButtonHTML("No","ClosePopup();","No",false,m_objMqButton.STATE_1,"No");
								//-->
							</script>				
						</td>
					</tr>
				</table>
		</td>
    </tr>
</table>

</body>
</html>

