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

#
# Process Main Topic List -- in users/gcf
$in= "topicareas/Simple/FulllistbytopicPage.html";
$out = "../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%../../%%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/oldbyarea0.html">Simple version without tables</a> is also available<br>
<a href="http://www.npac.syr.edu/users/gcf/SimpleFulllistbytopic1Page.html">All topics and Foilsets in One Page</a><br>
See also <a href="http://www.npac.syr.edu/users/gcf/summary0.html">The list without division into topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/scriptedfoilsetparm.html" >On PlayLists (Scripted Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
# Process Main Topic List -- in users/gcf/topicareas
$in= "topicareas/Simple/FulllistbytopicPage.html";
$out = "../topicareas/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%../../%../%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/oldbyarea0.html">Simple version without tables</a> is also available<br>
<a href="http://www.npac.syr.edu/users/gcf/SimpleFulllistbytopic1Page.html">All topics and Foilsets in One Page</a><br>
See also <a href="http://www.npac.syr.edu/users/gcf/summary0.html">The list without division into topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/scriptedfoilsetparm.html" >On PlayLists (Scripted Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
#	Main topic list in users/gcf with Complete Page
$in= "topicareas/Simple/Fulllistbytopic1Page.html";
$out = "../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%../../%%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/oldbyarea0.html">Simple version without tables</a> is also available<br>
See also <a href="http://www.npac.syr.edu/users/gcf/summary0.html">The list without division into topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/scriptedfoilsetparm.html" >On PlayLists (Scripted Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
$in= "topicareas/Simple/FullListPage.html";
$out = "../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%../../%%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/oldsummary0.html" >Simple version without tables</a> is also available<br>
See also <a href="http://www.npac.syr.edu/users/gcf/byarea0.html" >The list divided by topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/basicfoilsetparm.html" >Some Organizational Detail on Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/scriptedfoilsetparm.html" >On PlayLists (Scripted
Foilsets)</a>
<br>
EOF
}
}
close(PUBINDATA);
close(PUBFOILS);
#
$source = "topicareas/Simple";
opendir(ORG,$source) || die("\nSorry Could not open ",$source," \n");

while( $name=readdir(ORG))      {
        next if( $name eq '.' || $name eq '..' );
	$out = "../topicareas/$name";
	$in = "topicareas/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%../../%../%g;
		$line =~ s/$pleaselink//g;
		$line =~ s%href="search/%href="../wisdom/topicareas/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/oldsummary0.html" >Simple version without tables</a> is also available<br>
See also <a href="http://www.npac.syr.edu/users/gcf/byarea0.html" >The list divided by topics</a>
<br>
There is also <a href="http://www.npac.syr.edu/users/gcf/basicfoilsetparm.html" >Some Organizational Detail on
Foilsets</a>
<br>
And Further Information <a href="http://www.npac.syr.edu/users/gcf/scriptedfoilsetparm.html" >On PlayLists (Scripted
Foilsets)</a>
<br>
EOF
		}
	}
	close(PUBINDATA);
	close(PUBFOILS);
}
