<?php
//enable visitors to see the PHP source code of current file
$me basename($_SERVER['PHP_SELF']);
if(isset(
$_GET['showPHP'])){
    
show_source("$me");    
    die();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="assets/stylesheet.css" type="text/css" rel="stylesheet"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Flash clock and JavaScript date</title>
<?php 
include("includes/header.inc.php");
?>

<!--This meta element defines a description of my page:-->
<meta name="description" content="Nice flash clock with a 3d spinning globe" /> 

<!--This meta element defines keywords for my page:-->
<meta name="keywords" content="clock, 3d, Spinning, Globe, date" /> 

<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
    var flashvars = {};
    var params = {};
    params.wmode = "transparent";
    swfobject.embedSWF("flash.swf", "minFlash", "360", "300", "9.0.0", "expressInstall.swf", flashvars, params);
    swfobject.embedSWF("swf/3d-clock.swf", "3d-clock", "400", "400", "9.0.0", "expressInstall.swf", flashvars, params);
</script>

<script type="text/javascript"><!--
var now = new Date();
var hours = now.getHours();

document.write('It\'s now: ', hours, '<br><br>');
document.bgColor="#CC9900";

//18-19 night
if (hours > 17 && hours < 20){
document.write ('<body style="background-color: orange">');
}
//20-21 night
else if (hours > 19 && hours < 22){
document.write ('<body style="background-color: orangered">');
}
//22-4 night
else if (hours > 21 || hours < 5){
document.write ('<body style="background-color: #C0C0C0;">');
}
//9-17 day
else if (hours > 8 && hours < 18){
document.write ('<body style="background-color: #616D7E">');
}
//7-8 day
else if (hours > 6 && hours < 9){
document.write ('<body style="background-color: skyblue">');}
//5-6 day
else if (hours > 4 && hours < 7){
document.write ('<body style="background-color: #111">');
}
else {
document.write ('<body style="background-color: white">');
}
// --></script>

</head>
<body>
<div id="wrapper">
<?php 
include("includes/top-navigation.inc.php");
?>

    <div id="center-box">
<?php 
include("includes/header_img.inc.php");
?>
        <div id="left-right-padding">
<?php 
include("includes/navigation.inc.php");
?>
            <div style="clear: left;"></div>
            <h1>Flash clock </h1>
            <font size="-1">
            <h2>The date is displayed dynamically with JavaScript.</h2>
            </font>
            <p>&nbsp;</p>
            
            
            <!--The example below writes the current date into an existing <p> element when the page loads:-->
        <p id="date"></p>
    
            <script type="text/javascript">
                document.getElementById("date").innerHTML=Date();
            </script>
            <!--http://www.w3schools.com/js/js_whereto.asp-->

      </div>
        <div id="left-right-padding" align="center">
            <div id="3d-clock">
                <h1>Alternative content</h1>
                <p><a href="http://www.adobe.com/go/getflashplayer">
                <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" 
                alt="Get Adobe Flash player" /></a></p>
            </div>
        </div>
        <div align="center"><br/>
          <br/>
        </div>
        <br/>
        <br/>
<?php 
include("includes/footer.inc.php");
?>

    </div>
</div>
</body>
</html>