#!/usr/bin/perl
# program that prints activation page.
#process information for transfer
require './cgi-lib.pl';
&ReadParse(*form);
$mappage = "/home/www/htdocs/bbd/map.html";
open (FILE,"$mappage") || die "Can't open $mappage: $!\n";
@lines = <FILE>;
$size = @lines;
print "Content-type: text/html\n\n";
#print the script activation page that will call the script to draw the image.
for ($i=0; $i <= $size ; $i++) {
$_ = $lines[$i];
#find where clickable is and replace it with business name and mapped below in blue
if (/<!-- replace clickable begin -->/) {
#advance until you have gone through the current image
$i++;
$_ = $lines[$i];
unless (/<!-- replace clickable end -->/) {
$i++;
$_ = $lines[$i];
}
print "<!-- begin specific info to business being mapped -->\n";
print "<H3>Scroll Down to see<BR> <FONT SIZE=+1 COLOR=\"#FF0000\">$form{'busname'}</FONT> located on the map</H3>\n";
print "Look for the <FONT SIZE=+2 COLOR=\"#0000FF\">blue</FONT> block.\n";
print "<!-- end specific info to business being mapped -->\n";
$_ = "";
}
#check to see if the line starts the existing image part.
if (/<!-- map image begin -->/) {
#advance until you have gone through the current image
$i++;
$_ = $lines[$i];
unless (/<!-- map image end -->/) {
$i++;
$_ = $lines[$i];
}
print "<!-- begin activation image -->\n";
print "<IMG SRC=\"http://www.brie.com/cgi-bin/generatepicture.pl?region=$form{'locatenum'}\ ALT=\"Location of $form{'busname'}\" WIDTH=633 HEIGHT=449 HSPACE=5 VSPACE=5 ISMAP>";
print "<!-- end activation image -->\n";
$_ = "";
}
print "$_";
}