<?php
// Load settings
$O__fileData = O__XMLdata($O__DBpath . "/pageTypes/" . $O__PT . "/configs/settings.xml", 0, 0);
$O__screensaverSpeed = O__XMLgetData($O__fileData,"/settings/setting[@id='screensaverSpeed']/value");
unset($O__fileData);
?>

<script>
	var O__screenWidth = window.innerWidth;
	var O__screenHeight = window.innerHeight;
	
	function O__moveSaver(){
		var O__saverXPos = Math.floor(Math.random() * O__screenWidth);
		var O__saverYPos = Math.floor(Math.random() * O__screenHeight);
		document.getElementById("O__areaGeneral").style.left = O__saverXPos + "px";
		document.getElementById("O__areaGeneral").style.top = O__saverYPos + "px";
		var O__moveSaverAgain = setTimeout("O__moveSaver();", <?php echo($O__screensaverSpeed); ?> * 1000);		
	}
	
	function O__goBack() {
		history.go(-1);
	}

	document.onkeydown = O__goBack;
	document.onmousemove = O__goBack;
	document.onclick = O__goBack;
	window.addEventListener("load", function(){ document.body.setAttribute("id", "O__CSSscreensaver"); O__moveSaver(); });
</script>
