#!/usr/bin/perl
use CGI qw(:standard);

print <<eND;
Content-type: text/html

eND

$dirlocation = "/home12c/sub007/sc13648-GPVH/";
chdir($dirlocation) || print "Couldn't change directory $!<BR>\n";

$time = time;

$cookieid = "cpid";

$cookie = $ENV{"HTTP_COOKIE"};
$cookie =~ m/$cookieid\=([^;]+)/;
$id = $1;
exit unless $id;

$msgid = param("msgid");
exit unless $msgid;

$roompartial = param("roompartial");

push @togo, qq~<form method=post action="gcommheading.pl"><BR>\n~;
push @togo, qq~<br>Heading: <input type=text size=30 name=heading>\n~;
push @togo, qq~<input type=hidden name=msgid value=$msgid>~;
push @togo, qq~<center><input type=submit value="Change to this Heading"></center>\n~;

push @togo, qq~<p><a href=/conversations/cgi-bin/gcommdiscard.pl?msgid=$msgid;event=hide>Hide</a>~ unless $roompartial;
push @togo, qq~<p><a href=/conversations/cgi-bin/gcommdiscard.pl?msgid=$msgid;event=discard><span style=color:red>Discard</span></a>~ unless $roompartial;



push @togo, qq~<p><b>Explanation</b>.<ul>~;
push @togo, qq~<li>Discarding a message removes your name from the list of people who receive further additions to the message. It also removes the message from your page. Recommended for group messages you want to withdraw from.</li>~;
push @togo, qq~<li>Hiding a message removes the message from your page. It will be restored to your page if anyone adds to the message. Recommended for messages you do not want to save.</li>~;
push @togo, qq~</ul>~;
printonblankerpage(@togo);
exit;

sub printonblankerpage {
	@toprint = @_;
	print @toprint;
	exit;
}