#!/usr/bin/env python

import random
password = str(random.randrange(100,1000))

print "Content-Type: text/html\n"
print """<html>
<head><title>Mike Mintz [cgijabber.py]</title></head>
<body>
<h1>Mike Mintz [cgijabber.py]</h1>
<h2>Instructions</h2>
<ul>
<li>Type the red number into the text box and click Submit (this prevents crawlers and people from accidentally initiating the script).</li>
<li>On the new page, you may type messages in the box at the bottom and send them by pressing Enter.</li>
<li>If I am online, it will display my status as soon as it connects.</li>
<li>If I am offline, I will receive your messages the next time I am online. In that case, you are probably better off contacting me with the form on the previous page. If you do send me offline messages using this interface, please try to put everythng in one message, and include your name and contact information if you want a reply.</li>
<li>Pressing Enter without a message in the box will cause the screen to scroll down.</li>
<li>The connection will automatically close 60 seconds after your send your last message.</li>
</ul>
<p><i><b>Note:</b> I don't think this works with Safari yet. It works fine with Mozilla and Firefox so far, and it is functional in Internet Explorer (although it doesn't display anything until you send a message). I will try to fix these problems when I get time.</p>
<p><font color="#FF0000"><b>""" + password + """</b></font></p>
<form action="cgijabber.py" method="post">
<input type="hidden" name="pw1" value=\"""" + password + """\" />
<input type="text" name="pw2" />
<input type="submit" value="Submit" />
</form>
<p><a href="http://www.mikemintz.com/">Return to mikemintz.com</a></p>
</body>
</html>"""

