<?php
class harvestPage
{
   var 
$topic;
   var 
$content;
   var 
$title "Illinois State Museum--Harvesting the River";
   var 
$keywords "Illinois State Museum, Harvesting the River, Illinois River, history, culture, fishing, 
hunting, clams, mussels"
;
   var 
$ISMsubject '';
     var 
$description '';

function 
harvestPage(){
  
$this->setTopic();
}

function 
displayHead () {
//  $this->showComment("Start displayHead ()");
  
$this->headTipTop();
  
$this->headJavaScript();
  
$this->headMeta();
  
$this->headKeywords();
    
$this->headTitle();
  
$this->javascriptPopUp();
  
$this->showComment("End displayHead ()");
}  

function 
displayBody (){
  
$this->showComment("Start displayBody ()");
  
$this->bodyStart();
  
$this->bodyMainHeader();
//  $this->harvestBreadCrumb();
  
$this->bodyStartMainBody();
  
$this->bodyNavigation($topic);
  
$this->showComment("End displayBody ()");
}

function 
endBody () {
  
$this->showComment("Start endBody ()");
  echo 
"</td>\n";
  echo 
"</tr>\n";
  echo 
"</table>\n";
    
$this->bodyFooter();
  echo 
"</body>\n";
  echo 
"</html>\n";
  
$this->showComment("End endBody ()");

}

function 
headTipTop () {
//  $this->showComment("Start headTipTop ()");
  
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
    \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"https://www.w3.org/1999/xhtml\">
<head>\n"
;
  
$this->showComment("End headTipTop ()");
}

function 
headTitle () {
  
$this->showComment("Start headTitle ()");
    if (!empty (
$this->pagetitle)) {
      
$this->title="Harvesting the River: ".$this->topic.": ".$this->subtopic.": ".$this->pagetitle;  
    }
  echo 
"<title> $this->title -- Illinois State Museum </title>";
  
$this->showComment("End headTitle ()");
}

function 
headJavaScript() {
print 
"
<script language=\"JavaScript\">

<!--

        if (document.images) {            // Active Images
            img1on = new Image();      
            img1on.src = \"
$GLOBALS[imagehome]/top/harvest_button_on.gif\"; 
            img2on = new Image(); 
            img2on.src = \"
$GLOBALS[imagehome]/top/transport_button_on.gif\";
            img3on = new Image(); 
            img3on.src = \"
$GLOBALS[imagehome]/top/history_button_on.gif\"; 
             
            img1off = new Image(); 
            img1off.src = \"
$GLOBALS[imagehome]/top/harvest_button_off.gif\"; 
            img2off = new Image();          
            img2off.src = \"
$GLOBALS[imagehome]/top/transport_button_off.gif\";
            img3off = new Image();          
            img3off.src = \"
$GLOBALS[imagehome]/top/history_button_off.gif\"; 
             
        }

// Function to 'activate' images.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + \"on.src\");
        }
}

// Function to 'deactivate' images.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + \"off.src\");
        }
}

// -->

</script>


"
//end of print statement

//end of headJavaScript

function headMeta () {
  
$this->showComment("Start headMeta ()");
echo 
"<meta http-equiv=\"PICS-Label\" content=\"(PICS-1.1 https://www.weburbia.com/safe/ratings.htm l r (s 0))\" />
<meta name=\"resource-type\" content=\"document\" />
<meta name=\"generator\" content=\"VI\" />
<meta name=\"revisit-after\" content=\"30 days\" />
<meta name=\"classification\" content=\"Education\" />
<meta name=\"distribution\" content=\"Global\" />
<meta name=\"rating\" content=\"Safe For Kids\" />  
<meta name=\"ROBOTS\" content=\"index,follow\" />
<meta name=\"copyright\" content=\"Illinois State Museum Society\" />
<meta http-equiv=\"reply-to\"
content=\"webmaster@museum.state.il.us\" />
<meta name=\"language\" content=\"English\" />"
;
  
$this->showComment("End headMeta ()");
}

function 
headKeywords () {
  
$this->showComment("Start headKeywords ()");
    echo 
"<meta name=\"keywords\" content=\"$this->keywords\" />\n";
  
$this->showComment("End headKeywords ()");
}

function 
headISMsubject () {
  
$this->showComment("Start headISMsubject () ");
    if (!empty(
$this->ISMsubject)) {
    
$ISMsubs explode(":"$this->ISMsubject);
        for (
$i 0$i count ($ISMsubs);$i++ ) {
        echo 
"<meta name=\"ISMsubject\" content=\"".$ISMsubs[$i]."\" />\n";
        }
    }
  
$this->showComment("End headISMsubject ()");

}

function 
headDescription () {
  
$this->showComment("Start headDescription () ");
    if (!empty(
$this->description)) {
        echo 
"<meta name=\"description\" content=\"".$this->description."\" />\n";
    }
  
$this->showComment("End headDescription ()");

}

function 
bodyStart () {
  
$this->headISMsubject();
    
$this->headDescription();
  
$this->showComment("Start bodyStart ()");

echo 
"</head>\n <body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"
background = \"
$GLOBALS[imagehome]/general/back.jpg\" bgcolor=\"#FFFFFF\" text=\"#330066\"
link = \"#3366CC\" vlink = \"#6699CC\" alink = \"#FFCC00\">"
;

  
$this->showComment("End bodyStart ()");

}

function 
bodyMainHeader () {
  
$this->showComment("Starting bodyMainHeader");
//Now, this begins the real main header, just a big echo statement
//not exactly elegant
echo "

<table width=\"640\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
        <tr>
                <td valign=\"top\"><a href=\"
$GLOBALS[home]/index.html\"><img src=\"$GLOBALS[imagehome]/top/topleft.gif\" alt=\"Harvesting the River\" width=\"249\" height=\"111\" border=\"0\" /></a></td>
                <td valign=\"top\">
                        <table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
                                <tr>
                                        <td colspan=\"3\" height=\"86\" align=\"right\">
                                        
                                        <form method=\"POST\" action=\"/cgi-bin/htsearch\">
<input type=\"hidden\" name=\"restrict\" value=\"/RiverWeb/harvesting/\" />
        
                <input type=\"text\" size=\"20\" name=\"words\" value=\"\" />


        <input type=submit value=\"Search\" /> 
        </form>
                                        
                                        
                                        </td>
                                </tr>
                                <tr>
                                  <td align = left>
                   <a href = \"
$GLOBALS[home]/harvest/index.html\" onMouseOver = \"imgOn('img1')\" onMouseOut = \"imgOff('img1')\">
                   <img src=\"
$GLOBALS[imagehome]/top/harvest_button_off.gif\" alt=\"Harvest\" width=\"132\" height=\"25\" border=\"0\" name = \"img1\" />
                   </a></td>
                                  <td align = left>
                   <a href = \"
$GLOBALS[home]/transportation/index.html\" onMouseOver = \"imgOn('img2')\" onMouseOut = \"imgOff('img2')\">
                   <img src=\"
$GLOBALS[imagehome]/top/transport_button_off.gif\" alt=\"Transport\" width=\"163\" height=\"25\" border=\"0\" name = \"img2\" />
                   </a></td>
                                  <td align = left>
                   <a href = \"
$GLOBALS[home]/history/index.html\" onMouseOver = \"imgOn('img3')\" onMouseOut = \"imgOff('img3')\">
                   <img src=\"
$GLOBALS[imagehome]/top/history_button_off.gif\" alt=\"History\" width=\"99\" height=\"25\" border=\"0\" name = img3 />
                   </a></td>
                                </tr>
                        </table>
                
                
                </td>
        </tr>
</table>


<p></p>

"
//this is the end of the top navigation header


  
$this->showComment("End bodyMainHeader");
}

function 
bodyStartMainBody() {
  
$this->showComment("Start bodyStartMainBody()");
  echo 
"<table width=\"640\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"This table contains the main text of the page on the left, and another tree-style navigation on the right\">\n";
  echo 
"<tr>\n";
  echo 
"<td width=\"490\" valign=\"top\">\n";
  echo 
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"This small table contains the breadcrumb-style navigation for $this->topic\">\n";
  echo 
"<tr>\n";
  
$this->showComment("End bodyStartMainBody()");
}

function 
bodyNavigation($topic) {
  
$this->showComment("Start bodyNavigation(\$topic) for topic $this->topic");
  echo 
"<td colspan=\"2\">\n";
//  $this->harvestTopicButton("$this->topic");
  
echo "\n</td>";
  echo 
"</tr>\n";
  echo 
"<tr>\n";
  echo 
"<td width=\"131\" align=\"center\">\n";
  echo 
"</td>\n";
  echo 
"<td align=\"left\" width=\"362\"><font face=\"verdana, arial, helvetica\"
size=\"-1\">\n"
;
  
$this->harvestBreadCrumb();
  echo 
"</font></td></tr>\n";
  echo 
"</table>\n";
  echo 
"<p></p>\n";

  echo 
"<table width = \"490\" border=\"0\" cellpadding=\"0\">\n";
  echo 
"<tr>\n";
  echo 
"<td width=\"10\">&nbsp;</td>\n";
  echo 
"<td><font face=\"verdana, arial, helvetica\" size=\"-1\">\n";
  
$this->showComment("End bodyNavigation(\$topic) for topic $this->topic");
}

function 
bodyEndContent () {
  
$this->showComment("Start bodyEndContent ()");
  echo 
"</font></td>\n";
  echo 
"</tr>\n";
  echo 
"</table>\n";
  echo 
"</td>\n";
  
$this->showComment("End bodyEndContent ()");

}

function 
bodyBeginNavCell (){
  
$this->showComment("Start bodyBeginNavCell ()");
echo 
"<td width=\"150\" valign=\"top\">
 <table width=\"160\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"This table contains a tree-style navigation and links to the archives\">
 <tr>
 <td><a href=\"
$GLOBALS[home]/archives/images/\"><img src=\"$GLOBALS[imagehome]/av/images.gif\" alt=\"Images\"
  width=\"52\" height=\"29\" border=\"0\" /></a></td>
 <td><a href=\"
$GLOBALS[home]/archives/video/\"><img src=\"$GLOBALS[imagehome]/av/video.gif\" alt=\"Videos\"
 width=\"45\" height=\"29\" border=\"0\" /></a></td>
 <td><a href=\"
$GLOBALS[home]/archives/audio/\"><img src=\"$GLOBALS[imagehome]/av/audio.gif\" alt=\"Audio clips\"
 width=\"53\" height=\"29\" border=\"0\" /></a></td>
</tr>
</table>
<p></p>
<table border = 0 cellpadding = 8 cellspacing = 0 width = 250>
 <tr>
 <td>
 <font face = \"verdana, arial, helvetica\" size =-1>"

//end echo statement

  
$this->showComment("End bodyBeginNavCell ()");
}

function 
bodyEndNavCell () {
  
$this->showComment("Start bodyEndNavCell ()");
  echo 
"</tr>\n";
  echo 
"</table>\n";
  
$this->showComment("End bodyEndNavCell ()");

}

function 
bodyFooter (){
  
$this->showComment("Start bodyFooter ()");
//  echo "<hr>\n";
  
include "/local/php/ismsite/harvesting/footer.php";
  
$this->showComment("End bodyFooter ()");
}

function 
setTopic ($newtopic="") {
// Define the names you want given to each of the directories
$label =  array("archives"=>"Archives",
        
"harvest"=>"Harvesting",
        
"history"=>"History",
        
"photogallery"=>"Archives",
        
"boats"=>"Boats",
        
"plankroad"=>"Plank Roads",
        
"trains"=>"Trains",
        
"fish"=>"Fish",
        
"history"=>"History",
        
"species"=>"Species",
        
"ice"=>"Ice",
        
"mussels"=>"Freshwater Mussels",
        
"musseling"=>"Musseling",
        
"waterfowl"=>"Waterfowl",
        
"hunting"=>"Hunting",
        
"river"=>"The Illinois River",
        
"settlement"=>"Settlement",
        
"images"=>"Images and Photographs",
        
"tools_techniques"=>"Tools and Techniques",
        
"decoys"=>"Decoys",
        
"audio"=>"Audio Clips",
        
"video"=>"Video Clips",
        
"transportation"=>"Transportation");
  if (!empty(
$newtopic)) 
  {
    
$this->topic $newtopic;
  }
  else
  {
    
$str $GLOBALS[PHP_SELF];
    
ereg("^(.+)/.+\\..+$"$str$part);
    
$str $part[1];
    
$str substr($str1);
    
$arr split("/"$str);
    
$num count($arr);
    
$this->topic $label[$arr[2]];
        
$this->subtopic $label[$arr[3]];
  }
}

function 
setSubTopic ($newsubtopic='') {
  if (!empty(
$newsubtopic)) 
  {
    
$this->subtopic $newsubtopic;
  }
  else
  {
    
$str $GLOBALS[PHP_SELF];
    
ereg("^(.+)/.+\\..+$"$str$part);
    
$str $part[1];
    
$str substr($str1);
    
$arr split("/"$str);
    
$num count($arr);
    
$this->subtopic $arr[3];
  }
}

function 
harvestBreadCrumb () {
  
$this->showComment("Start harvestBreadCrumb ()");
$str $GLOBALS[PHP_SELF];
ereg("^(.+)/.+\\..+$"$str$part);
$str $part[1];
$str substr($str1);
$filename basename($PHP_SELF);
// Define the names you want given to each of the directories
$label =  array("archives"=>"Archives",
        
"harvest"=>"Harvesting",
        
"history"=>"History",
        
"transportation"=>"Transportation",
        
"boats"=>"Boats",
        
"plankroad"=>"Plank Roads",
        
"trains"=>"Trains",
        
"fish"=>"Fish",
        
"history"=>"History",
        
"species"=>"Species",
        
"ice"=>"Ice",
        
"mussels"=>"Freshwater Mussels",
        
"musseling"=>"Musseling",
        
"waterfowl"=>"Waterfowl",
        
"hunting"=>"Hunting",
        
"river"=>"The Illinois River",
        
"settlement"=>"Settlement",
        
"images"=>"Images and Photographs",
        
"audio"=>"Audio Clips",
        
"video"=>"Video Clips",
        
"tools_techniques"=>"Tools",
        
"decoys"=>"Waterfowl Decoys",
        
"guns"=>"Firearms",
        
"industry"=>"Industry");
if (
ereg("/"$str)){
$arr split("/"$str);
$num count($arr);
$pathstring "";
//echo("<a href=\"https://".$HTTP_HOST."\">ISM Home</a>");
    
for($i=0$i $num; ++$i){
    
$pathstring $pathstring."/".$arr[$i];
      if (isset (
$label[$arr[$i]])) {
      echo(
" > <a href=\"https://".$GLOBALS[HTTP_HOST].$pathstring."\" target=\"_top\">".$label[$arr[$i]]."</a>");
      }
    }
}elseif (
ereg("[a-zA-Z_]{1,}$",$str)){
$arr $str;
echo(
" > <a href=\"https://".$HTTP_HOST."/".$arr."\" target=\"\">".$label[$arr]."</a>\n");
}else{
echo(
"");
}
if (!empty (
$this->pagetitle)) {
  echo(
"> <b>$this->pagetitle</b>");
} else echo(
"> <b>$this->title</b>");
  
$this->showComment("End harvestBreadCrumb ()");
//end harvestBreadCrumb

function harvestTopicButton ($text) {
  
$this->showComment("Start harvestTopicButton ($text)");
  
$home $GLOBALS[home];
  
$buttontext ereg_replace(" ","+",$text);
  echo 
"<img src=\"$home/include/buttonttf.php?s=24&text=$buttontext&width=493\" alt=\"$text\" />\n";
  
$this->showComment("End harvestTopicButton ($text)");
}

function 
harvestSubTopicButton ($text) {
  
$this->showComment("Start harvestSubTopicButton ($text)");
  
$home $GLOBALS[home];
  
$buttontext ereg_replace(" ","+",$text);
  echo 
"<img src=\"$home/include/buttonttf.php?s=24&text=$buttontext\" alt=\"$text\" />\n";
  
$this->showComment("End harvestSubTopicButton ($text)");
}

//used to help identify the genisis of the html code
function showcomment ($comment=''){
  if (!empty(
$comment)) {
    echo 
"\n<!-- $comment -->\n";
  }
}

function 
javascriptPopUp () {
print  (
"
<script language=\"javascript\">
<!--
function popUp(sourcefile, width, height, top, left){
     window.open(sourcefile,\"popup\",\"width=\"+width+\",height=\"+height+\",screenx=\"
+ left + \",screeny=\" + top + \",left=\" + left + \",top=\" + top +
\",scrollbars=yes,resizable=yes\");
}
//-->
</script>"
);

//end javascriptpopup 

function imbedimage($rollID,$frameID,$alt,$caption,$align="right",$key=" ") {
/*
Example for calling:
<?
    $thisHarvestPage->imbedimage("RollID","FrameID","Alt","Caption");
?>

*/
$zoomImage "<img src=\"$GLOBALS[navhome]/zoom.gif\" width=\"13\" height=\"15\" hspace=\"0\" vspace=\"0\" alt=\"Zoom in on $alt\" align = \"right\" border=\"0\" />";
$thisimage $frameID."-p.jpg";

print 
"<table align=\"$align\" border =\"0\" cellpadding =\"5\" cellspacing =\"0\" summary=\"This table, and an associated imbedded table, contains an image of $alt, and a link to a full-size version of the image.\">\n";
//print "<caption align=\"bottom\">$caption</caption>";
print "<tr><td>\n";

print 
"<table align = left border =\"0\" cellpadding =\"1\" cellspacing =\"0\">\n";
print 
"<tr><td colspan=\"2\">\n";
print 
"<img src=\"$GLOBALS[home]/archives/images/$rollID/$thisimage\" alt=\"$alt\" />\n";
print 
"</td></tr>\n";
print 
"<tr><td valign = top>\n";
print 
"<font face = \"verdana, arial, helvetica\" size = -3 color = \"#FF6600\">$caption\n";
print 
"</td><td valign=\"top\"><a href=\"javascript:popUp('$GLOBALS[home]/archives/images/zoom.php?RollID=$rollID&FrameID=$frameID',640,480,1,1)\">";
/* This allows non javascript to work */
print "<noscript> 
<a href=\"
$GLOBALS[home]/archives/images/index.html?RollID=$rollID&FrameID=$frameID\">
</noscript>"
;
print 
"$zoomImage</a>\n";
print 
"</td></tr></table>\n";
print 
"</td></tr></table>\n";
//end of function imbedimage()

function imagepopup($rollID,$frameID,$alt,$key=" ") {
/*
Example:
<?
  $thisHarvestPage->imagepopup("RollID","FrameID","Alt","keyword"); //keyword is optional
?>
*/
$imageicon "<img src=\"$GLOBALS[navhome]/key/images_icon.gif\" alt=\"Go to image of $alt\" width=\"14\" border=\"0\" height=\"14\" />";
$popupscript "$GLOBALS[home]/archives/images/popup.php?roll=$rollID&img=$frameID";
if (
$key != " ") {
  
$popupscript $popupscript."&key=$key";
}
print 
"<a href=\"javascript:popUp('$popupscript',326,350,200,300)\">\n";
print 
"<noscript> 
<a href=\"
$GLOBALS[home]/archives/images/index.html?RollID=$rollID&FrameID=$frameID\">
</noscript>"
;
print 
"$imageicon";
print 
"</a>\n";

//end of function imagepopup

function videopopup($VideoID,$FileID,$alt,$key=" ") {
/*
Example:
<?
  $thisHarvestPage->videopopup("RollID","FrameID","Alt","keyword"); //keyword is optional
?>
*/
$videoicon "<img src=\"$GLOBALS[navhome]/key/video_icon.gif\" alt=\"Go to video of $alt\" width=\"14\" border=\"0\" height=\"14\" />";
$popupscript "$GLOBALS[home]/archives/video/popup.html?VideoID=$VideoID&FileID=$FileID";
if (
$key != " ") {
  
$popupscript $popupscript."&key=$key";
}
print 
"<a href=\"javascript:popUp('$popupscript',326,350,200,300)\">\n";
print 
"<noscript> 
<a href=\"
$GLOBALS[home]/archives/video/index.html?VideoID=$VideoID&FileID=$FileID\">
</noscript>"
;
print 
"$videoicon";
print 
"</a>\n";

//end of function videopopup

function audiopopup($AlbumID,$FileID,$alt,$key=" ") {
/*
Example:
<?
  $thisHarvestPage->audiopopup("RollID","FrameID","Alt","keyword"); //keyword is optional
?>
*/
$audioicon "<img src=\"$GLOBALS[navhome]/key/audio_icon.gif\" alt=\"Go to audio of $alt\" width=\"14\" border=\"0\" height=\"14\" />";
$popupscript "$GLOBALS[home]/archives/audio/popup.html?AlbumID=$AlbumID&FileID=$FileID";
if (
$key != " ") {
  
$popupscript $popupscript."&key=$key";
}
print 
"<a href=\"javascript:popUp('$popupscript',326,350,200,300)\">\n";
print 
"<noscript> 
<a href=\"
$GLOBALS[home]/archives/audio/index.html?AlbumID=$AlbumID&FileID=$FileID\">
</noscript>"
;
print 
"$audioicon";
print 
"</a>\n";

//end of function audiopopup

//end of class harvestPage
?>