#!/usr/bin/python

import random
import string
import os

DATA_DIR = 'data'

if os.environ.has_key ('DOCUMENT_ROOT'):
	baseDir = os.environ['DOCUMENT_ROOT']
else:
	baseDir = '/tmp'

dataDirPath = os.path.join (baseDir, DATA_DIR)
if not os.path.exists (dataDirPath):
	os.mkdir (dataDirPath)

def googleLeaderboard ():
	result = ''
	result += '<br />' * 3
	result += '<div id="leaderboard">'
	result += '<script type="text/javascript" src="/annons/g-lboard.js"></script>'
	result += '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'
	result += '</div>'
	return result


def extraStuff ():
	result = ''
	result = result + '<a href="http://staging.rollover.com/">PRESS THIS</a><br/>'
	keys = os.environ.keys ()
	keys.sort ()
	for key in keys:
		value = os.environ[key]
		result = result + '<pre>%s: %s</pre>' % (key, value)
	return result

openStr = """<html>
<head>
	<title>Rollover Consulting</title>
	<link href="styles.css" media="all" type="text/css" rel="stylesheet" />
</head>
<body>
&nbsp;<br/>
&nbsp;<br/>
&nbsp;<br/>
<div id="title">
<img src="images/logo.gif"><br/>
<font size="+3">C O N S U L T I N G</font><br/>
</div>
"""

bottomStr = """
<div id="contact">
<p><a href="mailto:info@rollover.com">contact</a></p>
</div>
<br />
<div id="information">

<p>Rollover Consulting is a private consulting firm specializing in
technical architecture and systems analysis.  It got its name from our
realization, in 1996, of what later became widely known as the "Year
2000 Problem."  Although this problem is in the past for us now, we
retain the name as a reminder that complex systems often have
surprising lacunae.  We are not looking for new business at this time,
as all of our capacity is spoken for by existing clients.</p>

<p>A large number of visitors to this site are here for information
about 401(k) rollovers, IRA rollovers, SUV rollovers, or chicken
rollovers.  We are not experts about those topics.</p>

</div>
"""


closeStr = """
</body>
</html>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-361106-1";
urchinTracker();
</script>
"""

print "Content-Type: text/html"
print ""
print openStr
#print extraStuff ()
#print imageStr
#print mottoStr
print bottomStr
print googleLeaderboard ()
print closeStr
