<!DOCTYPE html>
<!-- /tiles/template.jsp -->
<%@ include file="/includes.jsp" %>
<tiles:importAttribute />
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<base/>
		<script type="text/javascript">
			var unsavedData = ${param.unsavedData != null};
		</script>
		<title>eMDT - <c:out value="${windowTitle}"/></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 rel="stylesheet" href="../css/webapp.css" type="text/css" />
		<link href="../referrals/css/main.css" type="text/css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/menu.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="../js/jquery/jquery-ui.min.css" type="text/css" />
		<link rel="stylesheet" href="../js/jquery/jquery-ui.css" type="text/css" />
		<script src="../js/ie_polyfills.js"></script>
		<script src="../js/iro.min.js"></script>
		<webapp:forEach id="module" items="${webapp.modules}">
			<c:if test="${not empty module.moduleInfo.styleSheet}">
				<link rel="stylesheet" href="<c:out value="${module.moduleInfo.styleSheet}"/>" type="text/css" />
			</c:if>
			<c:if test="${not empty module.moduleInfo.javaScript}">
				<script src="<c:out value="${module.moduleInfo.javaScript}"/>" type="text/javascript"></script>
			</c:if>
		</webapp:forEach>

		<script src="../js/jquery/jquery-3.7.1.min.js"></script>
		<script src="../js/jquery/jquery-ui.min.js"></script>
		<script src="../js/webapp.js" type="text/javascript"></script>
		<script src="../js/AJAXSupport.js" type="text/javascript"></script>
		<script src="../js/notifyDataLoss.js" type="text/javascript"></script>
		<script type="text/javascript" src="../anchorPosition.js"></script>
		<script type="text/javascript" src="../popupWindow.js"></script>
		<script type="text/javascript" src="../colorPicker2.js"></script>
	</head>
	<body style="margin: 0;">
		<c:if test="${0 lt webapp.currentUser.remainingDaysPwdExpiryWarning}">
		<%@ include file="../referrals/tiles/passwordExpiryWarning.jsp" %>
		</c:if>
		<c:if test="${0 lt webapp.currentUser.remainingHrsPwdExpiryWarning}">
		<%@ include file="../referrals/tiles/passwordExpiryWarningToday.jsp" %>
		</c:if>

		<table cellpadding="0" cellspacing="0" height="100%" width="100%">
		<c:if test="${empty param.suppressheaders}" >
			<!-- START MODULES -->
			<tr>
				<td height="1" valign="top" style="padding:0;">
					<tiles:insertTemplate template ="/tiles/modules.jsp" />
				</td>
			</tr>
			<!-- END MODULES -->
		</c:if>			
		
			<!-- CONTENT -->
			<tr>
				<td valign="top" class="moduleContentArea">
					<tiles:insertTemplate template="${content}">
						<tiles:putAttribute name="innerContent"  value="${innerContent}"/>
						<tiles:putAttribute name="pageTitle" value="${windowTitle}"/>
					</tiles:insertTemplate>
				</td>
			</tr>
			<!-- END CONTENT -->
			
			<c:if test="${empty param.noheaders}">
			<c:if test="${suppressFooter ne null && suppressFooter ne true }">
			<tr height="1">
				<td align="center" class="pageFooter" colspan="2">
						<c:set var="checked">
							<c:if test="${sessionScope.ignoreFilters == 'true'}">checked='checked'</c:if>
						</c:set>
						<% java.text.SimpleDateFormat crsdf = new java.text.SimpleDateFormat ("yyyy"); %>
								 
						Ignore&nbsp;filters&nbsp;<input type="checkbox" name="ignoreFilters" value="true" <c:out value="${checked }"/> onchange="toggleFilters(this)"/>
					 | Logged in as '<c:out value="${webapp.currentUser.username}"/>' | 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>
			</tr>
			</c:if></c:if>
		</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>
