#!/usr/bin/perl
#
#Copyright (C) 2003: Christian A. Bråthe
#For: Christian A. Bråthe, Jan Steinar Kvilesjø, Lars Martin Dobbe
#
use CGI qw(:standard :escapeHTML);
 
print "Content-type: text/html\n\n";
 
#START
 
$pictureName = param("picName");
$comingFrom = param("from");
 
sub create_html_top
{
    print "<html>";
    print "<head>";
    print "<title>E.L.F.O Recieved Pictures - Showing: $pictureName</title>";
    print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">";
    print "<link href=\"stylesheet.css\" rel=\"stylesheet\" type=\"text/css\">";
    print "</head>";
 
    print "<body>";
}

sub create_header_table
{ 
    print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr>"; 
    print "<td width=\"57%\" class=\"header\">E.L.F.O. Picture: SELECTED PICTURE</td>"; 
    print "<td width=\"43%\" class=\"header\" align=\"right\">www.hessdalen.org</td>";
    print "</tr>"; 
    print "<tr>"; 
    print "<td height=\"20\"></td>";
    print "</tr>";   
    print "</table>";
}

sub picture_table
{
    print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr>"; 
    print "<td>Picture name: $pictureName</td>";
    print "</tr>";
    print "<tr>"; 
    print "<td><img src=\"$pictureName\"></img></td>";
    print "</tr>";

}    

sub create_footer_table
{
    print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr>";
    print "<td height=\"20\" colspan=\"2\"></td>"; 
    print "</tr>"; 
    print "<tr>"; 
    print "<td width=\"73%\" class=\"footer\">Created 2003: Christian A. Bråthe, Jan Steinar Kvilesjø,";
    print "Lars Martin Dobbe</td>";
    print "<td width=\"27%\" class=\"footer\" align=\"right\"><a ";
    print "href=\"showDir.cgi?dirName=$comingFrom\">Back to the file index</a></td>";
    print "</tr>"; 
    print "</table>";
}


create_html_top();
create_header_table();
picture_table();
create_footer_table();
