#!/usr/bin/perl -w
use strict;

#Footinator, copyright 2004, Tom Boutell. Do what you like with this code.
#Crazy go nuts.

my $data;

while (read(STDIN, $data, 65536, length($data)) > 0) {
}

my @items = split(/(\<a .*?\>.*?\<\/a\>)/i, $data);

my $count = 1;

my %ltc;
my %ctl;

print "<CENTER>For an up to date copy of this page, please visit <TT>http://monkeydyne.com/bushresume/forward.html</TT><HR></CENTER>\n";

for my $i (@items) {
	if ($i =~ /\<a href=\"(.*?)\"\>(.*?)\<\/a\>/i) {
		my($link, $text) = ($1, $2);
		if (!$ltc{$link}) {
		    $ctl{$count}=$link;
		    $ltc{$link}=$count;
		    $count++;
		}
		print "$text<a href=\"$link\">[$ltc{$link}]</a>";
	} else {
		print "$i";
	}
}

print "\n<HR>\n";
print "<B>FOOTNOTES:</B><P>\n";

for (my $i = 1; ($i < $count); $i++) {
	print "[$i] <a href=\"$ctl{$i}\">$ctl{$i}</a><br>\n";
}

