if ($prm==`RE_NewCase`)
   {
      $UserId=$_SESSION[`UserId`];
      $ProjectId=$_SESSION[`ProjectId`];
      ExecuteSQL(~insert into Responses (CaseID,qID,uID,ProjectId) select `New Case`, `CaseID`,$UserId,$ProjectId~);
      $CaseId=ShowQueryResultScalar(~select rUnique from Responses where CaseID=`New Case` and qID=`CaseID`~); 
      ExecuteSQL(~update Responses set CaseID=$CaseId, rValue=$CaseId, rOK=2 where rUnique=$CaseId~);
      $_SESSION[`CaseId`]=$CaseId;
      SetForm(RE_ListingDetail);
   }
$stat=1;