#!/usr/bin/perl -w

$potdfolder = "http://www.webgoonies.com/blog/potd";

$date = `date +"%F".jpg`; chop($date);
$date2 = `date +"%B %e,%G"`; chop($date2);


print "Content-type: text/html\n\n";
print "<html>";
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.webgoonies.com/blog/scripts/potd.css\"> ";
print "<body bgcolor=ECF7D5 LINK=999999 ALINK=999999 VLINK=999999>";
print "<SCRIPT LANGUAGE=\"JavaScript\">\n";
print "<!-- Begin\n";
print "function Start(page) {\n";
print "OpenWin = this.open(page, \"POTD\", \"toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=685,height=510,status=0\");\n"; 
print "}\n";
print "// End -->\n";
print "</SCRIPT>\n";

print "<center><table border=0 cellpadding=0 cellspacing=0><tr><td style=\"vertical-align: bottom\" align=center width=160>";
if (-e "/home/threepts/public_html/blog/potd/$date")
  {
  print "<center><a alt=\"Photo of the Day - $date2\" href=\"javascript:Start('$potdfolder/$date')\";><img style=\"display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 150px;\" src=\"$potdfolder/t_$date\" class=\"potdimg\" border=\"0\" alt=\"Photo of the day - $date2\" /></a>";
  }
  else { print "<center><img src=$potdfolder/nopotd.jpg>"; 
}
print "</td></tr><tr><td align=center width=160>$date2</td></tr></table></center>";

print "<html><body bgcolor=EEEEEE>";
print "<SCRIPT LANGUAGE=\"JavaScript\">\n";
print "<!-- Begin\n";
print "function Start2(page) {\n";
print "OpenWin = this.open(page, \"POTD\", \"toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=515,height=500,status=0\");\n"; 
print "}\n";
print "// End -->\n";
print "</SCRIPT>\n";

# print "<font size=2>";
# print "<center><a alt=\"Photo of the Day Archives\" href=\"javascript:Start2('http://www.webgoonies.com/blog/scripts/potd_archive.pl')\";>Archived Photos</a></center>\n"; print "</font>";

print "</body></html>";
