if ($prm==`CS_Case_Create`)
   {
      $UserId=$_SESSION[`UserId`];
      ExecuteSQL("insert into Responses (CaseID,qID,uID) select `New Case`, `CaseID`,$UserId");
      $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(CS_Case_Detail);
   }
$stat=1;