function SelectRandom()
    if not obj.racha.is_collapsed then
       selectrandomobject1(1.5,obj.racah.id,false);
    return;end;    
    if not flags.hidden_stulja or (flags.is_spirit and not flags.hidden_stulja_two) then
       selectrandomobject1(1.5,6,false);
    return;end;        
    if not flags.ventil_turma and obj.tabura~=nil and obj.tabura.is_collapsed then
       selectrandomobject1(1.5,13,false);
    return;end;    
    if not flags.soed_provod and obj.shnrk~=nil and obj.shnrk.is_collapsed and obj.izole~=nil and obj.izole.is_collapsed then
        selectrandomobject1(1.5,14,false);
    return;end;        
    if flags.soed_provod and not flags.shitok and obj.predo~=nil and obj.predo.is_collapsed then
        selectrandomobject1(1.5,3,false);
    return;end;            
    if flags.shitok and not flags.shitok_set then
        selectrandomobject1(1.5,3,false);
    return;end;        
    if flags.shitok_set and not flags.pult and obj.iskeyo~=nil and obj.iskeyo.is_collapsed and obj.keytwo~=nil and obj.keytwo.is_collapsed and obj.keytri~=nil and obj.keytri.is_collapsed then
        selectrandomobject1(1.5,15,false);
    return;end;    
    if not flags.is_spirit and flags.stul_is_ready  then
        selectrandomobject1(1.5,1);
    return;end;    
	 not_hint=true
   CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(obj.racah.id,4);
    if (not flags.hidden_stulja) or (flags.is_spirit and not flags.hidden_stulja_two) then
        Set_Anim_Cur(6,2);
    end;
    Set_Anim_Cur(7,15);
    if not flags.ventil_turma then
        Set_Anim_Cur(13,2);
    end;
    if not flags.soed_provod then
        Set_Anim_Cur(14,2);
    end;
    if flags.soed_provod then
      Set_Anim_Cur(3,2);
    end;
    if flags.shitok_set then
      Set_Anim_Cur(3,3);
      if not flags.pult then
      Set_Anim_Cur(15,2);
      end;
    end;
    if flags.stul_is_ready and not flags.is_spirit then
      Set_Anim_Cur(1,4);
    end;
end;


function SetParticles()
  AddParticleToObject(12,"SvetMig3",538,0);
  MoveEmiter("SvetMig3",538,0);
  StartEmiter("SvetMig3");
    if not obj.racah.is_collapsed then
      AddParticleToObject(obj.racah.id,"racha",619,594);
      MoveEmiter("racha",619,594);
      StartEmiter("racha");
    end;
    if not flags.hidden_stulja then
      AddParticleToObject(6,"stulja",878,537);
      MoveEmiter("stulja",878,537);
      StartEmiter("stulja");
    end;
    if not flags.ventil_turma then
      AddParticleToObject(13,"ventil_turma",449,69);
      MoveEmiter("ventil_turma",449,69);
      StartEmiter("ventil_turma");
    end;
    if not flags.soed_provod then
      AddParticleToObject(909,"iskri",50,457);
      MoveEmiter("iskri",50,450);
      StartEmiter("iskri");
      AddParticleToObject(14,"jama",50,425);
      MoveEmiter("jama",50,425);
      StartEmiter("jama");
    end;
    if flags.soed_provod then
      if not flags.shitok_set then
        AddParticleToObject(3,"shitok",892,112);
        MoveEmiter("shitok",892,112);
        StartEmiter("shitok");
      end;
    end;
    if not flags.pult and  flags.shitok_set then
        AddParticleToObject(15,"postbox",40,181);
        MoveEmiter("postbox",40,181);
        StartEmiter("postbox");
    end; 
    if flags.stul_is_ready and not flags.is_spirit then
        AddParticleToObject(1,"el_chair",255,482);
        MoveEmiter("el_chair",255,482);
        StartEmiter("el_chair");      
        AddParticleToObject(910,"el_chair1",327,422);
        MoveEmiter("el_chair1",327,422);
        StartEmiter("el_chair1");    
    end;
    if flags.is_spirit then
      if not flags.hidden_stulja_two then
        ActivateObject(6,true);
        AddParticleToObject(6,"stulja",878,537);
        MoveEmiter("stulja",878,537);
        StartEmiter("stulja");
      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==100 then
  SetParticles()
  SetCursors()
  BlockCursor(false)
  playeffect("fon_dark",true);
    -- if flags.first_enter then
        -- add_free_leaf("Root","comics30",19,51);
        -- set_satelite_leaf("electro");
        -- DoFile(19,51)
        -- flags.first_enter=true        
    -- end;
    if flags.is_hidden_finish then
        flags.is_hidden_finish=false
        ActivateObject(6,false);
        Set_Anim_Cur(6,3);
    end;
    if not flags.first_electro then
        flags.first_electro=true
        add_free_leaf("Root","comics30",19,51);
        set_satelite_leaf("electro");
        DoFile(19,51)    
    end;
  return;end;
 
  if sender==41 then
    if obj_id==70 then
        speciale_action(2,obj_id)
        StartTimer(5219999,5)
    end;
    if obj_id==71 then
        speciale_action(2,obj_id)
        StartTimer(5229999,1)
    end;    
    if obj_id==872 then
        speciale_action(2,obj_id)
        StartTimer(5239999,3)
    end;        
  return;end;
  
  if sender==36 then
    if obj_id==5219999 then
        speciale_action(2,70)
        StartTravel(70,1,nil,nil,e_gad1);
    end;    
    if obj_id==5229999 then
        speciale_action(2,71)
        StartTravel(71,1,nil,nil,e_gad2);
    end;
    if obj_id==5239999 then
        speciale_action(2,872)
        StartTravel(872,1,nil,nil,e_gad3);
    end;    
    if obj_id == 5123 then
        RemObjFromMouse()
        IsMiniGame=true        
        fromShit=true
        Set_Sat1("shitok_set",19,11,"electro")    
    return; end;        
  return;end;
 

  if sender == 1 then
    g_attachedID = attachedID;
    if obj_id == 7 then
        StopEmiter("Emitter")    
        playeffect("step_room")
        RemObjFromMouse()      
        jump("electro","koridor",15,0);
    return; end;
    if obj_id == 6 then
    if not flags.hidden_stulja or (flags.is_spirit and not flags.hidden_stulja_two) then
        flags.is_hidden_loc = true;
        RemObjFromMouse() 
        jump("electro","stulja",19,1);
    return; end;  
    return; end;
    if obj_id == 9 then
      
    return; end;
    if obj_id == 1 then
    --  if flags.stul_ok then
        RemObjFromMouse()
        speciale_action(2,1);
        speciale_action(2,16);    
        ClearCursor()
        Set_Anim_Cur(1,3)    
        StopEmiter("el_chair");    
        StopEmiter("el_chair1");            
        add_free_leaf("Root","comics10",19,50);
        set_satelite_leaf("electro");
        DoFile(19,50)
   --   return; end;
 --     CreatePlashechka(900000,"486")
    return; end;
    if obj_id == 15 then
    if flags.shitok_set then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("pult",19,5,"electro")    
    end;    
    return; end;
    if obj_id == 3 then
      if not flags.shitok then
        RemObjFromMouse()
        s_obj=attachedID
        Set_Sat("shitok",19,4,"electro")    
      return; end;
      if flags.shitok then
        RemObjFromMouse()
        IsMiniGame=true        
        Set_Sat("shitok_set",19,11,"electro")
      return; end;
    return; end;
    if obj_id == obj.racah.id then
        RemObjFromMouse()
        StoreObj(obj.racha.id,obj_id,"295",335,350,"ru4ka",290,217)      
        StopEmiter("racha");
    return; end;
    if obj_id == 14 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("provoda",19,3,"electro")
    return; end;
    if obj_id == 13 then
      if not flags.tabura_stoit then
        if obj.tabura ~= nil and attachedID == obj.tabura.id then
          RemObjFromMouse()
          UnStoreObj(attachedID);
          speciale_action(2,11);
          playeffect("taburetka")
          flags.tabura_stoit = true;
        return; end;
        CreatePlashechka(900000,"210")
      return; end;
      if flags.tabura_stoit then
        RemObjFromMouse()
        s_obj=attachedID     
        Set_Sat("ventil_turma",19,2,"electro")
      return; end;
    return; end;
  return; end;
  

end
function SheetSwitched(nCount)
end;