Professional Documents
Culture Documents
MH
MH
<head>
<style type="text/css">
#porthole {
width:100px;
height:100px;
background-color: black;
}
</style>
<script type="text/javascript">
function soundHorn()
{
window.open("https://mousehuntgame.com/turn.php", "_blank");
var duration = 15 * 60;
var timer = duration, minutes, seconds;
setInterval(function() {
minutes = parseInt(timer/60, 10);
seconds = parseInt(timer%60, 10);
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
document.getElementById('timer-minutes').innerHTML = minutes
;
document.getElementById('timer-seconds').innerHTML = seconds
;
if (--timer < 0) {
timer = duration;
}
}, 1000);
}
</script>
</head>
<body>
<div id='timer'>
<span id='timer-minutes'>15</span> minutes
<span id='timer-seconds'>0</span> seconds
</div>
<div id='form'>
<button onClick="soundHorn()">Sound the Horn!</button>
</div>
</body>
</html>