<html>
	<head>
		<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'/>
		<link rel='stylesheet' href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"/>
	</head>
	<body style='height:100%'>
		<div class='container text-center'>
			
		</div>
		<div class='container-fluid' style='background-color: #DD0C0A; height:70%'>
			<div id='failure-message-box' class='text-center' style='margin: 60px auto; color: #fff;' class='row'>
				<p id='failure-message' style='font-size: 4em; font-weight: 100; max-width: 60%; margin: auto;'></p>
			</div>
		</div>
		
		
		<div class='container-fluid' style='background-color: #ddd; height:20%'>
			<div>
				<p style='font-size: 2em; font-weight: 100; padding: 40px; color: #fff; text-align: center; max-width: 60%; margin: auto;'>Reload automatico in <span id='reload-seconds' style='font-weight: 300;'></span> seconds</p>
			</div>
		</div>

		<div class='container-fluid text-center' style='height:10%'>
			<span style='bottom: 15px;left: 0;position: absolute; vertical-align: middle; width: 100%;'>Copyright &copy; MomaPIX - Tutti i diritti sono riservati.</span>
		</div>
	
		<script>
		(function(){
			var seconds_left = 30;
		
			
			var browser_language = window.navigator.userLanguage || window.navigator.language;
			browser_language = browser_language.substring(0, 2);

			var failure_messages = {
				'it': {
					'main': 'Il sito &egrave; <strong style="font-weight: 300;">temporaneamente</strong> non disponibile, ritorner&agrave; online a breve.'
					},
				'en': {
					'main': 'The site is <strong style="font-weight: 300;">temporary</strong> down,<br/>we will be back shortly.'
				}
			};

			switch(browser_language) {
				case 'it':
					document.getElementById('failure-message').innerHTML = failure_messages.it.main;
					break;
				default:
					document.getElementById('failure-message').innerHTML = failure_messages.en.main;
					break;
			}

			var intervalHandler =  setInterval(function() {
				if(seconds_left == 0){
					clearInterval(intervalHandler);
					location.reload(); 
				} else {
					document.getElementById('reload-seconds').innerHTML = seconds_left;
					seconds_left--;
				}
			}, 1000);
				

		}());
		</script>
	</body>
</html>

