#!/usr/local/bin/perl5 -w
#
$pleaselink = quotemeta  'onMouseOver="top.bigboss.maybedontclick();" onclick="top.bigboss.pleasedontclick(self);" ';

#
# Process Main Topic List -- in users/gcf/familyphotos
$in= "phototopicareas/Simple/FulllistbytopicPage.html";
$out = "../familyphotos/SimpleFulllistbytopicPage.html";
open(PUBINDATA,$in) || die("\nSorry couldnt Open",$in, "\n");
open(PUBFOILS,">".$out) || die("\nSorry couldnt Create",$out, "\n");
#
$num=1;
while( $line=<PUBINDATA> )	{
chomp($line);
$line =~ s%\.\./\.\./01/familyphotos%%g;
$line =~ s%\.\./\.\./familyphotos%%g;
$line =~ s/$pleaselink//g;
$line =~ s%wisdomhtmloverview.html%index.html%g;
print PUBFOILS  $line,"\n";
if($line =~ m%<h2>FoilWorld% )	{
print PUBFOILS <<EOF;
<br><a href="http://www.npac.syr.edu/users/gcf/familyphotos/oldbyarea0.html">Simple version without tables</a> is also available<br>
<a href="http://www.npac.syr.edu/users/gcf/familyphotos/SimpleFulllistbytopic1Page.html">All topics and Foilsets in One Page</a><br>
See also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/summary0.html">The list without division into topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/familyphotos/scriptedfoilsetparm.html" >On PlayLists (Scripted Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
# Process Main Topic List -- in users/gcf/familyphotos/phototopicareas
$in= "phototopicareas/Simple/FulllistbytopicPage.html";
$out = "../familyphotos/phototopicareas/index.html";
open(PUBINDATA,$in) || die("\nSorry couldnt Open",$in, "\n");
open(PUBFOILS,">".$out) || die("\nSorry couldnt Create",$out, "\n");
#
$num=1;
while( $line=<PUBINDATA> )	{
chomp($line);
$line =~ s%\.\./\.\./01/familyphotos/%../%g;
$line =~ s%\.\./\.\./familyphotos/%../%g;
$line =~ s/$pleaselink//g;
$line =~ s%wisdomhtmloverview.html%index.html%g;
print PUBFOILS  $line,"\n";
if($line =~ m%<h2>FoilWorld% )	{
print PUBFOILS <<EOF;
<br><a href="http://www.npac.syr.edu/users/gcf/familyphotos/oldbyarea0.html">Simple version without tables</a> is also available<br>
<a href="http://www.npac.syr.edu/users/gcf/familyphotos/SimpleFulllistbytopic1Page.html">All topics and Foilsets in One Page</a><br>
See also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/summary0.html">The list without division into topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/familyphotos/scriptedfoilsetparm.html" >On PlayLists (Scripted Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
#	Main topic list in users/gcf/familyphotos with Complete Page
$in= "phototopicareas/Simple/Fulllistbytopic1Page.html";
$out = "../familyphotos/SimpleFulllistbytopic1Page.html";
open(PUBINDATA,$in) || die("\nSorry couldnt Open",$in, "\n");
open(PUBFOILS,">".$out) || die("\nSorry couldnt Create",$out, "\n");
#
$num=1;
while( $line=<PUBINDATA> )	{
chomp($line);
$line =~ s%\.\./\.\./01/familyphotos/%%g;
$line =~ s%\.\./\.\./familyphotos/%%g;
$line =~ s/$pleaselink//g;
$line =~ s%wisdomhtmloverview.html%index.html%g;
print PUBFOILS  $line,"\n";
if($line =~ m%<h2>FoilWorld% )	{
print PUBFOILS <<EOF;
<br><a href="http://www.npac.syr.edu/users/gcf/familyphotos/oldbyarea0.html">Simple version without tables</a> is also available<br>
See also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/summary0.html">The list without division into topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/familyphotos/scriptedfoilsetparm.html" >On PlayLists (Scripted Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
$in= "phototopicareas/Simple/FullListPage.html";
$out = "../familyphotos/SimpleFullListPage.html";
open(PUBINDATA,$in) || die("\nSorry couldnt Open",$in, "\n");
open(PUBFOILS,">".$out) || die("\nSorry couldnt Create",$out, "\n");
#
$num=1;
while( $line=<PUBINDATA> )      {
chomp($line);
$line =~ s%\.\./\.\./01/familyphotos/%%g;
$line =~ s%\.\./\.\./familyphotos/%%g;
$line =~ s/$pleaselink//g;
$line =~ s%wisdomhtmloverview.html%index.html%g;
print PUBFOILS  $line,"\n";
if($line =~ m%<h2>FoilWorld% ) {
print PUBFOILS <<EOF;
<br>
A <a href="http://www.npac.syr.edu/users/gcf/familyphotos/oldsummary0.html" >Simple version without tables</a> is also available<br>
See also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/byarea0.html" >The list divided by topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/familyphotos/scriptedfoilsetparm.html" >On PlayLists (Scripted
Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
$source = "phototopicareas/Simple";
opendir(ORG,$source) || die("\nSorry Could not open ",$source," \n");

while( $name=readdir(ORG))      {
        next if( $name eq '.' || $name eq '..' );
	$out = "../familyphotos/phototopicareas/$name";
	$in = "phototopicareas/Simple/$name";
	open(PUBINDATA,$in) || die("\nSorry couldnt Open",$in, "\n");
	open(PUBFOILS,">".$out) || die("\nSorry couldnt Create",$out, "\n");
#
	$done=0;
	while( $line=<PUBINDATA> )      {
		chomp($line);
		$line =~ s%\.\./\.\./01/familyphotos/%../%g;
		$line =~ s%\.\./\.\./familyphotos/%../%g;
		$line =~ s/$pleaselink//g;
		$line =~ s%href="search/%href="http://www.npac.syr.edu/users/gcf/wisdom/phototopicareas/search/%;
		$line =~ s%wisdomhtmloverview.html%index.html%g;
		print PUBFOILS  $line,"\n";
		if(($done == 0 ) && ($line =~ m%<h2>%) ) {
			$done=1;
			print PUBFOILS <<EOF;
<br>
A <a href="http://www.npac.syr.edu/users/gcf/familyphotos/oldsummary0.html" >Simple version without tables</a> is also available<br>
See also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/byarea0.html" >The list divided by topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/familyphotos/basicfoilsetparm.html" >Some Organizational Detail on
Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/familyphotos/scriptedfoilsetparm.html" >On PlayLists (Scripted
Foilsets)</a>
<br>
EOF
		}
	}
	close(PUBINDATA);
	close(PUBFOILS);
}
