package template;

sub connect_db {
  my $conn = 'DSN=tomato;UID=IUSER;PWD=webbrowser;';
  my $db;
  if (!($db = new Win32::ODBC("DSN=tomato;UID=IUSER;PWD=webbrowser;"))) {
    print "Error connecting to ODBC ($conn)<BR>";
    print "Error: " . Win32::ODBC::Error() . "\n";
    exit;
  }  
  return $db;
}

sub disconnect_db {
  my ($db) = @_;
  $db->Close();
}
  

sub print_header {
  my ($title) = @_;
print <<HEADER
Content-Type: text/html\n\n
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 
<HTML>
<HEAD>
  <TITLE>$title</TITLE>
<STYLE type="text/css">

A {
 font-family: arial, helvetica, sans-serif;
 font-weight: 200;
 font-size: 10px;
 color: rgb(0, 0, 0);
 word-spacing: 0.7em;
 letter-spacing: 0;
 align=left
}



BODY, TD {
 font-family: arial, helvetica, sans-serif;
 font-weight: 500;
 font-size: 10px;
 color: rgb(0, 0, 0);
 word-spacing: 0.2em;
 letter-spacing: 1; 
 text-indent: 0; 
}


IMG {
  border:0px;
}
</STYLE>
</HEAD>
<BODY>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=800>
<TR ALIGN=LEFT>
  <TD ALIGN=LEFT>
    <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=800>
    <TR ALIGN=LEFT>
      <TD ALIGN=LEFT><IMG WIDTH=25 HEIGHT=60 SRC="http://tomatillo.cit.cornell.edu/images/title_left.gif" ALT="Left Title Image"></TD>
      <TD WIDTH=100% BGCOLOR="#0086B3" ALIGN=LEFT style="font-size:14px;text-align:left;color: rgb(255, 255, 255)">Cornell University<BR>Solanaceae<BR>Genome Network</TD>
      <TD BGCOLOR="#0086B3" ALIGN=LEFT style="font-size:18px;text-align:right;color:rgb(255, 255, 255)">tomatillo.cit.cornell.edu&nbsp</TD>
      <TD ALIGN=LEFT><IMG WIDTH=25 HEIGHT=60 SRC="http://tomatillo.cit.cornell.edu/images/title_right.gif" ALT="Right Title Image"></TD>
    </TR>
    </TABLE>
  </TD>
</TR>
<TR ALIGN=LEFT>
  <TD ALIGN=LEFT>
    <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 VALIGN=TOP>
    <TR>
      <TD VALIGN=TOP>
        <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=120 ALIGN=LEFT BGCOLOR="#929292" VALIGN=TOP>
        <TR>
          <TD ALIGN=LEFT style="font-size:10px;text-align:left">&nbsp<A HREF="http://tomatillo.cit.cornell.edu/tomatoESTSQL.html">About</A></TD>
        </TR>
        <TR>
          <TD ALIGN=LEFT style="font-size:10px;text-align:left">&nbsp<A HREF="http://tomatillo.cit.cornell.edu/cgi-bin/tomato/tomatoESTSearch.pl">EST Search</A></TD>
        </TR>
        <TR>
          <TD ALIGN=LEFT style="font-size:10px;text-align:left">&nbsp<A HREF="http://scylla.tc.cornell.edu/cgi-bin/tomato/SearchMarkers.pl">Marker Search</A></TD>
        </TR>
        <TR>
          <TD ALIGN=LEFT style="font-size:10px;text-align:left">&nbsp<A HREF="http://tomatillo.cit.cornell.edu/cgi-bin/tomato/BlastSearch.pl">Local Blast Search</A></TD>
        </TR>
        <TR>
          <TD ALIGN=LEFT style="font-size:10px;text-align:left">&nbsp<A HREF="http://tomatillo.cit.cornell.edu/tomatoESTSQL.html">Manage Database</A></TD>
        </TR>
        <TR>
          <TD ALIGN=LEFT style="font-size:10px;text-align:left">&nbsp<A HREF="http://tomatillo.cit.cornell.edu/tomatoESTSQL.html">Contact Info</A></TD>
        </TR>
        <TR>
          <TD ALIGN=LEFT><IMG WIDTH=120 HEIGHT=15 SRC="http://tomatillo.cit.cornell.edu/images/menu_bottom.gif" ALT="Bottom Menu Image"></TD>
        </TR>
        </TABLE>
      </TD>
      <TD WIDTH=100% style="font-size:12px;text-align:left;color:rgb(255,255,255)" VALIGN="TOP">
        <TABLE CELLSPACING=10 CELLPADDING=4 BORDER=0 WIDTH=630 ALIGN=CENTER VALIGN=TOP>
        <TR VALIGN=TOP>
          <TD BGCOLOR="#0086B3" WIDTH=500 VALIGN=TOP style="font-size:12px;text-align:left;color:rgb(255,255,255)">$title</TD>
        </TR>
        <TR>
          <TD WIDTH=500>
HEADER
}

sub print_footer {
print <<FOOTER
          </TD>
        </TR>
        </TABLE>
      </TD>
    </TR>
    </TABLE>
  </TD>
</TR>
</TABLE>
</BODY>
</HTML>
FOOTER
}

return 1;