<!DOCTYPE html>
<html lang="en">

	<div th:fragment="banner" class="well" >
		<script>
			console.log('Hello')
			// Function to check if a file exists using AJAX
			function fileExists(filePath, callback) {
				var xhr = new XMLHttpRequest();
				xhr.onreadystatechange = function() {
					if (xhr.readyState === 4) {
						callback(xhr.status === 200);
					}
				};
				xhr.open("HEAD", filePath, true);
				xhr.send();
			}

			// Replace content if static/welcome.html exists
			fileExists("content/custom/welcome.html", function(exists) {
				if (exists) {
					loadFile("content/custom/welcome.html", function(content) {
						var replacementContainer = document.getElementById("replacementWelcome");
						replacementContainer.innerHTML = content;
					});
				}
			});

			// Function to load file content using AJAX
			function loadFile(filePath, callback) {
				var xhr = new XMLHttpRequest();
				xhr.onreadystatechange = function() {
					if (xhr.readyState === 4 && xhr.status === 200) {
						callback(xhr.responseText);
					}
				};
				xhr.open("GET", filePath, true);
				xhr.send();
			}
		</script>
		<div class="panel-body">
			<div id="replacementWelcome">
				<p>
					This server provides a complete implementation of the FHIR Specification
					using a 100% open source software stack.
				</p>
				<p>
					This server is built
					from a number of modules of the
					<a href="https://github.com/hapifhir/hapi-fhir/">HAPI FHIR</a>
					project, which is a 100% open-source (Apache 2.0 Licensed) Java based
					implementation of the FHIR specification.
				</p>
			</div>
		</div>
	</div>

</html>