<%@ include file="/includes.jsp" %>
<!DOCTYPE html>
<tiles:importAttribute />
<!-- /nationalMDT/tiles/nationalMDTTemplate.jsp -->
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<script>
			var unsavedData = ${param.unsavedData != null};
		</script>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>eMDT - <c:out value="${topHeaderMainTitle}"/> - <c:out value="${topHeaderSubTitle}"/></title>
		<link rel="icon" href="../images/emdt.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="../images/emdt.ico" type="image/x-icon" />
		<link href="../referrals/css/main.css" type="text/css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/webapp.css" type="text/css" />
		<link rel="stylesheet" href="../referrals/css/main.css" type="text/css" />
		<link rel="stylesheet" href="../css/dialog.css" type="text/css" />
		<link rel="stylesheet" href="../css/tables.css" type="text/css" />
		<link rel="stylesheet" href="../css/menu.css" type="text/css" />
		<link rel="stylesheet" href="../css/summary.css" type="text/css" />
		<link rel="stylesheet" href="../js/jquery/jquery-ui.min.css" type="text/css" />
		<script src="../js/jquery/jquery-3.7.1.min.js"></script>
		<script src="../js/jquery/jquery-ui.min.js"></script>
		<script type="text/javascript" src="../js/AJAXSupport.js" ></script>
		<script src="../js/webapp.js" type="text/javascript"></script>
		<script src="../js/notifyDataLoss.js" type="text/javascript"></script>
		</head>
	<body style="margin: 0;">
	<c:if test="${0 lt webapp.currentUser.remainingDaysPwdExpiryWarning}">
		<%@ include file="../../nationalMDT/tiles/passwordExpiryWarning.jsp" %>
	</c:if>
	<c:if test="${0 lt webapp.currentUser.remainingHrsPwdExpiryWarning}">
		<%@ include file="../../nationalMDT/tiles/passwordExpiryWarningToday.jsp" %>
</c:if>
		<table cellpadding="0" cellspacing="0" width="100%" class="HTres">
			<!-- START MODULES -->
			<tr>
				<td height="1" valign="top">
					<tiles:insertTemplate template ="/tiles/modules.jsp" />
				</td>
			</tr>
			<!-- END MODULES -->
		<tr height="99%">
				<td valign="top" class="moduleContentArea1">
					<tiles:insertTemplate template ="/nationalMDT/tiles/nationalMDTTopHeader.jsp" >
						<tiles:putAttribute name="topHeaderMainTitle" value="${topHeaderMainTitle} "></tiles:putAttribute>
						<tiles:putAttribute name="topHeaderSubTitle" value="${topHeaderSubTitle}"></tiles:putAttribute>
					</tiles:insertTemplate>		
					<tiles:insertTemplate template="${innerContent}" />	
				</td>
		</tr>
		<% java.text.SimpleDateFormat crsdf = new java.text.SimpleDateFormat ("yyyy"); %>
		<tr height="1%">
				<td align="center" class="pageFooterRef">
				
						<table width="100%">
							<tr>
								<td width="69%" align="right">
									Logged in as '<a href="../referrals/userform.form?userId=<c:out value="${webapp.currentUser.guid}"/>"><c:out value="${webapp.currentUser.username}"/></a>' | Copyright &#169; <a href="http://www.ardeo.com/" target="_blank">Ardeo Ltd.</a> 2000-<%=crsdf.format(new java.util.Date()) %> | Version: <c:out value="${webapp.version}"/>
								</td>
								<td align="right">
									<a href="../logout.form" ><img src="../images/16x16/exit.png" alt="Log out icon" border="0"/> Log out</a>&nbsp;&nbsp;&nbsp;
								</td>
							</tr>
						</table>
						
				</td>
			</tr>
		</table>
<script type="text/javascript">

	//The following checks for date input boxes and binds then to the javascript popup calendar
	var buttonFields = document.getElementsByTagName("img");
	for(var i = 0; i < buttonFields.length; i++) {
		var triggerId = buttonFields[i].id;
		var triggerIndex = triggerId.indexOf("_DateTrigger");
		if(triggerIndex != -1) {
			var inputId = triggerId.substring(0, triggerIndex);
			var dateEditBox = document.getElementById(inputId);
			if (dateEditBox && !dateEditBox.readOnly)	{
				$("#"+inputId).datepicker({
					 onSelect: function(date, obj) {
						 	var elem = document.getElementById(obj.id);
			            	elem.style.color = 'black';	// return to default style after placeholder is removed
			            	unsavedData = true;
			            	unsavedHint(buttonFields[i]);
				            return false;
				        },					 
				     changeMonth: true,
				     changeYear: true,
				     yearRange: "1900:c+10",
				     showOn: "button",
					 buttonImage: "../images/16x16/date.png",
					 buttonImageOnly: true,
					 dateFormat: "dd/mm/yy" 
				});
				// remove the old icon trigger, since JQueryUI adds its own
				document.getElementById(triggerId).style.display = 'none';
			}
		}
	}
	
	document.body.onclick = dataEntered;
</script>
	</body>
</html>
