$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 {
	$search_string = "^$topic";
	for $_ (@helptopics)
	{
		if (/$search_string/)
		{
			($topic, $topicname) = split ( /,/, $_);
			$topic_found = 1;
			break;
		}
	}

#%help_topics_array = (
#	"view_email_setup.pl" => "Viewing your email set-up",
#	"create_user.pl" => "Creating a new email user",
#	"delete_user.pl" => "Deleting an email user",
#	"reset_password.pl" => "Changing a user's password",
#	"create_address.pl" => "Creating a new email address",
#	"delete_address.pl" => "Deleting an email address",
#	"create_multidrop.pl" => "Creating a multidrop email account",
#	"delete_multidrop.pl" => "Deleting a multidrop email account",
#	"view_forwarding.pl" => "Viewing your email forwarding set-up",
#	"create_forwarding.pl" => "Creating a forwarded email address",
#	"spam_turn_on.pl" => "Turning on spam protection",
#	"spam_turn_off.pl" => "Turning off spam protection",
#	"virus_turn_on.pl" => "Turning on virus protection",
#	"virus_turn_off.pl" => "Turning off virus protection",
#	"quarantine_management_1.pl" => "Managing your quarantine",
#	"spam_trap_turn_on.pl" => "Turning on your spam trap",
#	"spam_trap_turn_off.pl" => "Turning off your spam trap",
#	"spam_whitelist-turn_on.pl" => "Turning on your spam whitelist",
#	"spam_whitelist-turn_off.pl" => "Turning off your spam whitelist",
#	"create_out_of_office.pl" => "Creating an 'out-of-office' email reply",
#	"delete_out_of_office.pl" => "Deleting an 'out-of-office' email reply",
#	"view_ftp_users.pl" => "Viewing your FTP set-up",
#	"create_ftp_user.pl" => "Creating an FTP user",
#	"delete_ftp_user.pl" => "Deleting an FTP user",
#	"perlchecker.pl" => "Checking the syntax of a perl script",
#	"backup_website.pl" => "Backing up your website",
#	"view_statistics.pl" => "Viewing your website's statistics",
#	"show_smtp_forwarding.pl" => "Displaying your SMTP set-up",
#	"reset_smtp_forwarding.pl" => "Changing your SMTP forwarding IP address",
#);
#
#$user2group{"arnie"} = 199;
#	print "The topic is $help_topics_array{"$topic"}<BR><BR><BR>";

	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 {
		$topic_content_file = $helpdir . $topic;
		print_header ("IE Internet Control panel help: $topicname");
		open ( HELPFILE , "<$topic_content_file") || file_error("$topic_content_file");
		while (<HELPFILE>)
		{
			print $_;
		}
		close (HELPFILE);
		print "<p class=text>To proceed with this feature, please click on the button below:<BR><BR>";
		print qq!
			<form action=/$script_bin/$topic method=post>
			<input type=image src=/vpanel/images/button_next.gif alt='Go to this option'>
			</form>
		!;
	}
}


