function SelectRandom()
  if obj.rukja~=nil and not obj.rukja.is_collapsed then
    selectrandomobject1(1.5,21,false); --ручка
  return;end;
  if (not flags.hidden_chulan) or (flags.is_spirit and not flags.hidden_chulan_two) then
    selectrandomobject1(1.5,10,false); --чулан
  return; end;
  if (not flags.kukufka) and obj.shstr1~=nil and obj.shstr1.is_collapsed then
    selectrandomobject1(1.5,12,false); --часы
  return; end;
  if not flags.comodo and obj.kekuk~=nil and obj.kekuk.is_collapsed then
    if flags.shkaf_jonesM then
        selectrandomobject1(1.5,7,false); --комод
    return;end;
    selectrandomobject1(1.5,8,false); 
  return; end;  
  if not flags.luk_john and obj.ventyl~=nil and obj.ventyl.is_collapsed then  
    if flags.luk_jonesM then
        selectrandomobject1(1.5,3,false); 
    return;end;
    selectrandomobject1(1.5,5,false);
  return;end;
   not_hint=true
 CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(14,18);
    if not flags.luk_john then
    Set_Anim_Cur(5,2);
    end;
    if not obj.rukja.is_collapsed then
        Set_Anim_Cur(21,4)
    end;    
    if not flags.comodo then
        Set_Anim_Cur(8,2);
    end;
    if not flags.hidden_chulan then
    Set_Anim_Cur(10,2);
    end;
    if not flags.kukufka then
        Set_Anim_Cur(12,2);
    end;
    if flags.luk_jonesM and not flags.luk_john then
          Set_Anim_Cur(3,2);    
    end;
    if flags.shesternja and not flags.kukufka then
      Set_Anim_Cur(11,2);
    end;
    if flags.is_spirit then
      if not flags.hidden_chulan_two then
        Set_Anim_Cur(10,2);
      end;
    end;
end;

function SetParticles()
    if not obj.rukja.is_collapsed then
        AddParticleToObject(21,"ruk_johnes",233,561);
        MoveEmiter("ruk_johnes",233,561);
        StartEmiter("ruk_johnes");    
    end;
    if flags.luk_jonesM and not flags.luk_john then
          AddParticleToObject(3,"luk_john",719,598);
          MoveEmiter("luk_john",719,598);
          StartEmiter("luk_john");      
    end;
    if not flags.kukufka then
      AddParticleToObject(12,"statuj",372,181);
      MoveEmiter("statuj",372,181);
      StartEmiter("statuj");
    end;
    if not flags.comodo then
      AddParticleToObject(8,"comodo",928,489);
      MoveEmiter("comodo",928,489);
      StartEmiter("comodo");
    end;
    if not flags.luk_john then
      AddParticleToObject(5,"luk_john",719,598);
      MoveEmiter("luk_john",719,598);
      StartEmiter("luk_john");
    end;
    if not flags.hidden_chulan then
      AddParticleToObject(10,"chulan",764,498);
      MoveEmiter("chulan",764,498);
      StartEmiter("chulan");
    end;
    if flags.is_spirit then
      if not flags.hidden_chulan_two then
        AddParticleToObject(10,"chulan",764,498);
        MoveEmiter("chulan",764,498);
        StartEmiter("chulan");
        ActivateObject(10,true);
      end;
    end;
end;

function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID)  
    CursorTreatment(obj_id,sender,attachedID); 
  if sender==33 then
      Block_Show_Cur(false);
  return;end; 
  
  if sender==16 then
    if obj_id==1211 or obj_id==1212 or obj_id==1221 or obj_id==12225 or obj_id==1231 or obj_id==1232 then
        
        speciale_action(2,obj_id,true,2.7)    
        speciale_action(2,obj_id+1,true,3)    
    return;end
    if obj_id==1213 or obj_id==1223 or obj_id==1233 then
        speciale_action(2,obj_id,true,2.7)    
        speciale_action(2,obj_id-2,true,3)    
    return;end    
  return;end;
  if sender == 1 then
  
    g_attachedID = attachedID;
  
    if obj_id == 14 then
        playeffect("doors")
        RemObjFromMouse()
        jump("john_house","parom",9,0);
    return; end;
    

    if obj_id == 10 and ((not flags.hidden_chulan) or (flags.is_spirit and not flags.hidden_chulan_two)) then
        flags.is_hidden_loc = true;
        RemObjFromMouse()
        jump("john_house","chulan",11,1);
    return; end;
    
    if (obj_id == 5 or  obj_id == 3) and not flags.luk_john then
        RemObjFromMouse()
        s_obj=attachedID  
        Set_Sat("luk_john",11,4,"john_house")    
    return; end;
    
    if obj_id==21 then
        Set_Anim_Cur(21,3)
        StopEmiter("ruk_johnes");
        StoreObj(obj.rukja.id,21,"290",335,360,"ru4ka1",317,223)
        flags.rukja=true;             
    return;end;
    
    if obj_id == 8 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("comodo",11,3,"john_house")        
    return; end;    
    if obj_id == 12 or obj_id == 11 then
        RemObjFromMouse()    
      if not flags.shesternja then
        if not flags.complect then
                  s_obj=attachedID
        end;
        IsMiniGame=true        
        Set_Sat("john_shester",11,11,"john_house")    
      return; end;
      if flags.shesternja then
        s_obj=attachedID
        Set_Sat("kukufka",11,2,"john_house")    
      return; end;
    return; end;    
  return; end;
  
  
  if sender==100 then
  SetParticles()
  SetCursors()
  BlockCursor(false)
     playeffect("fon_room",true);
    if flags.is_hidden_finish then
        flags.is_hidden_finish=false
        ActivateObject(10,false);
        Set_Anim_Cur(10,3);
    end;
    if     fromMINIJONES then
        fromMINIJONES=false
        CreatePlashechka(900000,"600")     
    return;end;
    if from4asiki then
        Set_Sat1("kukufka",11,2,"john_house")        
    return;end;
  return;end;

  
end
function SheetSwitched(nCount)
end;