# $Id: cgi-style.pl,v 1.12 1999/03/24 17:29:55 max Exp $
#
# Perl routines to encapsulate various elements of HTML page style.

# For future reference, when is now?
($se,$mn,$hr,$md,$mo,$yr,$wd,$yd,$dst) = localtime(time);
$yr += 1900;
$mo += 1;
$timestamp = "$mo-$md-$yr";

# Colors for the body
$t_body = "<body text=\"#000000\" bgcolor=\"#ffffff\">";

if (!defined($hsty_base)) { 
    $hsty_base = "..";
}
if (!defined($hsty_email)) {
    $hsty_email = "www\@FreeBSD.org";
}
if (!defined($hsty_author)) {
    $hsty_author = "<a href=\"$hsty_base/mailto.html\">$hsty_email</a>";
}

$i_topbar = "<IMG SRC=\"$hsty_base/gifs/bar.gif\" ALT=\"Navigation Bar\" WIDTH=\"565\" HEIGHT=\"33\" BORDER=0 usemap=\"#bar\">
<map name=\"bar\">
<area shape=\"rect\" coords=\"1,1,111,31\" href=\"$hsty_base/index.html\" ALT=\"Top\">
<area shape=\"rect\" coords=\"112,11,196,31\" href=\"$hsty_base/ports/index.html\" ALT=\"Applications\">
<area shape=\"rect\" coords=\"196,12,257,33\" href=\"$hsty_base/support.html\" ALT=\"Support\">
<area shape=\"rect\" coords=\"256,12,365,33\" href=\"$hsty_base/docs.html\" ALT=\"Documentation\"> 
<area shape=\"rect\" coords=\"366,13,424,32\" href=\"$hsty_base/commercial/commercial.html\" ALT=\"Vendors\">
<area shape=\"rect\" coords=\"425,16,475,32\" href=\"$hsty_base/search/search.html\" ALT=\"Search\">
<area shape=\"rect\" coords=\"477,16,516,33\" href=\"$hsty_base/search/index-site.html\" ALT=\"Index\">
<area shape=\"rect\" coords=\"516,15,562,33\" href=\"$hsty_base/index.html\" ALT=\"Top\">
<area shape=\"rect\" href=\"$hsty_base/index.html\" coords=\"0,0,564,32\" ALT=\"Top\">
</map>";

if ($hsty_home eq "") {
    $hsty_home = "<a href=\"$hsty_base/\"><img src=\"$hsty_base/gifs/home.gif\"
  alt=\"FreeBSD Home Page\" border=\"0\" align=\"right\"></a>";
}

sub html_header {
    local ($title) = @_;

print <<__EOF__;
Content-type: text/html

<!-------------------------------------------------------------->
<!-- Korea FreeBSD Users Group      http://www.kr.FreeBSD.org -->
<!--                                                          -->
<!--                  Designed by 'Korea FreeBSD Users Group' -->
<!--                                webmaster\@kr.FreeBSD.org  -->
<!--                                                          -->
<!--        Copyright (c) Korea FreeBSD Users Group           -->
<!-------------------------------------------------------------->

<html>
<head>
  <title>$title</title>
  <meta name="Description" content="Korea FreeBSD Users Group">
  <meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>

<body bgcolor="white" marginwidth="30">
<table border="0" width="100%"><tr>
<td align="left">
  <a href="/"><img src="/gifs/banner-kr3.gif" border=0 alt="Korea FreeBSD Users Group"></a>
</td>
<td align="right" valign="bottom">
  <a href="/news/">News</a>,
  <a href="/internal/">Internal</a>,
  <a href="/projects/">Projects</a>,
  <a href="/">Home</a><br>
  <a href="/releases/">Software</a>,
  <a href="/support.shtml">Support</a>,
  <a href="/docs.shtml">Documentation</a><br>
</td>
</tr></table>
<center><hr width="100%" size="1" noshade></center>
<h2 align="left"><font color="#660000">$title</font></h2>
<br clear="all">
__EOF__
return "" ;
}

sub short_html_header {
    local ($title) = @_;

    return "Content-type: text/html\n\n" .
	"<html>\n<title>$title</title>\n</head>\n$t_body\n" .
        "$i_topbar";
}

sub html_footer {
print <<__EOF__;
<center>
<hr width="100%" noshade>

<!-- Tailer -->
<table width="100%"><tr>
  <td align="left" valign="top"><font size="2" face="Arial">
Copyright &copy; 1998-1999 Korea FreeBSD Users Group.<br> 
All rights reserved. <a href="mailto:webmaster\@kr.FreeBSD.org">webmaster\@kr.FreeBSD.org</a><br>
  </font></td>
  <td align="right">
    <a href="/copyright/daemon.shtml"><img src="/gifs/powerlogo.gif" border="0" alt="Powered by FreeBSD"></a>
  </td>
</tr></table>

<!-- Search -->
<table width="100%" border="0"><tr>
<td align="right">
  <form method="get" action="/search/search.shtml">
  <input type="hidden" name="mline" value="100"> <!-- Maximun record to search -->
  <input type="hidden" name="lpp"   value="10">  <!-- Display record per page -->
  <input type="hidden" name="subject" value="1">
  <input type="hidden" name="text" value="1">
  <input type="hidden" name="url" value="0">
  <input name="query" size=14 value="">
  <font size="2"><input type="submit" value="伊事"></font>
  </form>
</td>
</tr></table>

</center>
</body>
</html>
__EOF__
return "";
}

sub get_the_source {
    return if $ENV{'PATH_INFO'} ne '/get_the_source';

    open(R, $0) || do { 
	print "Oops! open $0: $!\n";  # should not reached
	exit;
    };

    print "Content-type: text/plain\n\n";
    while(<R>) { print }
    close R;
    exit;
}            

