$topic = param('topic');
$help_file = $helpdir . $topic;
$topic_found = 0;
@helptopics = ();

$comment_string = "^#";
open ( HELPTOPICS, "<$help_topics_list" ) || file_error("$help_topics_list");
while (<HELPTOPICS>)
{
	if ( !(/$comment_string/) )
	{
		push @helptopics, $_;
	}
}
close (HELPTOPICS);

if ( $topic eq "" )
{
	print_header ("IE Internet Control panel help");
	print "
	Please choose a help topic from the list below:
	<form action=help.pl method=post>
	<select class=text name=topic>
	";
	for $_ (@helptopics)
	{
		($topic, $topicname) = split ( /,/, $_);
		print "<option value=$topic>$topicname\n";
	}
	print "</select>";
	print_end_of_form();
} else {
	if ( $topic =~ /\?/ )
	{
		( $topic, $topic_item ) = split ( /\?/, $topic );
	}

	$search_string = "^$topic";
	for $_ (@helptopics)
	{
		if (/$search_string/)
		{
			($topic_script, $topicname) = split ( /,/, $_);
			$topic_found = 1;
			break;
		}
	}

	if ( $topic_found == 0 )
	{
		print_header ("IE Internet Control panel help");
		print "Sorry, but you haven't chosen a valid help topic.<BR><BR>";
		print_support_contact_information();
	} else {
		if ( defined ($topic_item) )
		{
			( $topic_type, $topic_description) = split (/=/, $topic_item);
			# This means that we have to define the help file defined by the parameter passed 
			if ( $topic_description eq "von" )
			{
				$topic_content_file = $helpdir . "virus_filetype_scanning_turn_on.pl";
			} elsif ( $topic_description eq "voff" ) {
				$topic_content_file = $helpdir . "virus_filetype_scanning_turn_off.pl";
			} elsif ( $topic_description eq "son" ) {
				$topic_content_file = $helpdir . "spam_filetype_scanning_turn_on.pl";
			} elsif ( $topic_description eq "soff" ) {
				$topic_content_file = $helpdir . "spam_filetype_scanning_turn_off.pl";
			}			
		} else {
			$topic_content_file = $helpdir . $topic_script;
		}
		print_header ("IE Internet Control panel help: $topicname");
		open ( HELPFILE , "<$topic_content_file") || file_error("$topic_content_file");
		while (<HELPFILE>)
		{
			print $_;
		}
		close (HELPFILE);
		print "<BR><BR>";
	}
}


