<?php

date_default_timezone_set('America/Los_Angeles');
error_reporting(E_ALL);

// Use the same method as the app to identify who this is based on their IP address. If they are recognized they will be shown special content.

// TO DO: CACHE THESE OUTPUTS LIKE WE DO THE PLIST.

require_once('classes/class.housekeeping.php');

$u = housekeeping::get('u');
$w = housekeeping::get('w');
$h = housekeeping::get('h');
$t = housekeeping::get('t');

$spinnerTop = (integer) (($h-32) / 2);
$spinnerLeft= (integer) (($w-32) / 2);

if (0 === strpos($u, '/images/'))
{
	$u = 'http://launch.karelia.com' . $u;
}

?>
<!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" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<meta name="robots" content="noindex,nofollow" />
		<title><?php echo htmlspecialchars($t); ?></title>
		<style type="text/css">
			* { margin:0; padding:0; }
		</style>
	</head>
	<body>
		<div style="position:absolute; left:<?php echo $spinnerLeft; ?>px; top:<?php echo $spinnerTop; ?>px; z-index:-99;">
			<img src="/images/roller.gif" width="32" height="32" />
		</div>
		<div>
			<img src="<?php echo htmlspecialchars($u); ?>" width="<?php echo htmlspecialchars($w); ?>" height="<?php echo htmlspecialchars($h); ?>" onclick="javascript:window.close();" />
		</div>
	</body>
</html>
