function SelectRandom()

  if not flags.vaza and flags.hidden_rubka then
     selectrandomobject1(1.5,23);
  return;end;
  if (not flags.hidden3) or (flags.is_spirit and not flags.hidden_stol_police_two) then
     selectrandomobject1(1.5,36,false);
  return;end;
  if obj.pinct~=nil and obj.pinct.is_collapsed and not flags.ventil then
     selectrandomobject1(1.5,44,false);
  return;end;
  if obj.krtch~=nil and obj.krtch.is_collapsed and not  flags.case_police then
     if flags.game_sud_complM then
        selectrandomobject1(1.5,7,false);
     return;end;
     selectrandomobject1(1.5,8,false);
  return;end;
  if obj.plosk~=nil and obj.plosk.is_collapsed and not flags.kolba and flags.hidden_rubka then
     if flags.colba_openM then
        selectrandomobject1(1.5,12,false);
     return;end;
     selectrandomobject1(1.5,10,false);
  return;end;  
  if obj.napiln~=nil and obj.napiln.is_collapsed and not flags.kanistra and  flags.ugon_auto then
    selectrandomobject1(1.5,26,false);
  return;end;
  if obj.fomka~=nil and obj.fomka.is_collapsed and not flags.shkaf_police  then
     selectrandomobject1(1.5,52,false);  
  return;end;
   not_hint=true
 CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(54,11);

    if not flags.case_police then     
        Set_Anim_Cur(8,2);
    end;
    if not flags.colba_openM and not flags.kolba then
        Set_Anim_Cur(10,2);
    end;
    if flags.hidden_rubka then
        if not flags.kanistra and flags.ugon_auto then
            Set_Anim_Cur(26,2);
        end;
        if not flags.vaza then
            Set_Anim_Cur(23,2);
        end;    
    end;
    if not flags.ventil then
        Set_Anim_Cur(44,2);
    end    
    if not  flags.shkaf_police then    
        Set_Anim_Cur(52,2);
    end;
    if flags.colba_openM and not flags.kolba then
      Set_Anim_Cur(12,2)    
    end;
    if flags.game_sud_complM then
      if not keisik then
          Set_Anim_Cur(7,2)
      end;
    end;
    if (not flags.hidden3 and flags.comics3) or (flags.is_spirit and not flags.hidden_stol_police_two) then
      Set_Anim_Cur(36,2);
    end;

end;
function ActionsJump ()

end;
function SetParticles()
    if not flags.vaza and flags.hidden_rubka then
      AddParticleToObject(23,"vaza",405,315);
      MoveEmiter("vaza",405,315);
      StartEmiter("vaza");
    end;    
    if not flags.kanistra and flags.ugon_auto then
      AddParticleToObject(26,"kanistra",987,529);
      MoveEmiter("kanistra",987,529);
      StartEmiter("kanistra");
    end;
    if not flags.case_police then
      if flags.game_sud_complM then
          AddParticleToObject(7,"case",97,579);
          MoveEmiter("case",97,579);
          StartEmiter("case");  
      end;
      AddParticleToObject(8,"case",97,579);
      MoveEmiter("case",97,579);
      StartEmiter("case");
    end;    
    if not flags.kolba then
      AddParticleToObject(106,"statuj",41,294);
      MoveEmiter("statuj",41,294);
      StartEmiter("statuj");
    end;
    if not flags.ventil then
      AddParticleToObject(44,"polka",724,113);
      MoveEmiter("polka",724,113);
      StartEmiter("polka");
    end;

    if not flags.shkaf_police then
      AddParticleToObject(52,"shkaf_police",590,231);
      MoveEmiter("shkaf_police",590,231);
      StartEmiter("shkaf_police");
    end;
    if not flags.hidden3 and  flags.comics3 then
      AddParticleToObject(36,"stol_police",440,519);
      MoveEmiter("stol_police",440,519);
      StartEmiter("stol_police");
    end;
    if flags.is_spirit then
      if not flags.hidden_stol_police_two then
        AddParticleToObject(36,"stol_police",440,519);
        MoveEmiter("stol_police",440,519);
        StartEmiter("stol_police");
        ActivateObject(36,true);
      end;
    end;    
end;

function gameinput (sender,obj_id,attachedID)        
CursorTreatment(obj_id,sender,attachedID);
if sender == 1 then
  g_attachedID = attachedID;

  if obj_id == 54 then 
      playeffect("step_street")
          RemObjFromMouse()       
      jump("police","street",3,0);
  return; end;

  if obj_id == 36 then
    if (not flags.hidden3) or (flags.is_spirit and not flags.hidden_stol_police_two)  then
      flags.is_hidden_loc = true;
          RemObjFromMouse()            
      jump("police","stol_police",4,1);    
    return;end;    
  return; end;
  if obj_id == 23 and not flags.vaza then
    s_obj=attachedID       
    RemObjFromMouse()
    Set_Sat("vaza",4,2,"police")
  return; end;
  
  if obj_id == 10 or obj_id==12 then
    s_obj=attachedID         
    RemObjFromMouse()
    Set_Sat("statuj",4,3,"police")
  return; end;
  
  if obj_id == 52 then
    s_obj=attachedID         
    RemObjFromMouse()
    Set_Sat("shkaf_police",4,4,"police")
  return; end;
  if obj_id == 44 then
    s_obj=attachedID         
    RemObjFromMouse()
    Set_Sat("ventil_police",4,5,"police")
  return; end;
  if obj_id == 26 then
    s_obj=attachedID         
    RemObjFromMouse()
    Set_Sat("kanistr_police",4,6,"police")
  return; end;
  
    if obj_id==7 or obj_id == 8 then
          RemObjFromMouse()
        if not flags.card_to_case then
            s_obj=attachedID
        end;    
        Set_Sat("case_police",4,11,"police")    
    return;end;
    return; end;  

  if sender==100 then
    SetCursors()
    SetParticles()
    BlockCursor(false)
    playeffect("fon_room",true);
    if flags.is_hidden_finish then
        flags.is_hidden_finish =false
        Set_Anim_Cur(36,3);
        ActivateObject(36,false);
    end;
  return;end;
end
function SheetSwitched(nCount)
end;