echo `<script language=javascript>`;
echo `function BackUp()`;
echo `{`;
echo `//  alert("in BackUp");
`;
$sql="select fFormat from Forms where fID=`CS_Process_Edit`";
$fmt=ShowQueryResultScalar($sql);
$CaseId=$_SESSION[`CaseId`];
echo "window.parent.SetInstanceCaseForm(`0`,`$CaseId`,`CS_Process_Edit`,`$fmt`)";
echo `}`;
echo `</script>`;

echo "<br><h3>Process: <i>", 
$_SESSION[`CS_Proc_Desc`], "</i></h3><br>";
global $TABLEBGCOLOUR;
global $TABLEFGCOLOUR;
global $CELLBGCOLOUR;
global $CELLFGCOLOUR;
global $TABLEBORDER;
global $CELLPADDING;
global $CELLSPACING;
global $HEADFONTSIZE;
global $BODYFONTSIZE;
global $LINENUMBERS;
$TABLEBGCOLOUR="#0080C0";
$TABLEFGCOLOUR="WHITE";
$CELLBGCOLOUR="#fffff8";
$CELLFGCOLOUR="BLACK";
$TABLEBORDER=6;
$CELLPADDING=2;
$CELLSPACING=1;
$HEADFONTSIZE=1;
$BODYFONTSIZE=1;
$LINENUMBERS=0;
global $NOSORT;
$NOSORT=1;
if ($prm==`CS_Event_Delete`)
{
  $sql="update Responses set isDeleted=1 where substring(qID,1,8)=`CS_Event` and CaseID=`".abs($act)."`";
  ExecuteSQL($sql);
}
$Instance=$_SESSION[`CaseId`];
$_SESSION[`Instance`]=$Instance;
$fmt=ShowQueryResultScalar("select fFormat from Forms where fID=`CS_Event_Edit`");
$sql="select CaseID as EventId, rValue as Event, concat(`<input type=button value=Edit onclick=window.parent.SetCaseForm(`,cast(CaseID as char(10)),`,``CS_Event_Edit``,``$fmt``)>`) as EditIt, concat(`<input type=button value=Delete onclick=DeleteIt(`,cast(CaseID as char(10)),`)>`) as DeleteIt from Responses where rInstance=$Instance and qID=`CS_Event_Desc`";
ShowQueryResult($sql);
echo "<p>";