function SelectRandom()
    if not flags.hidden_reshetka or (flags.zavareno and not flags.hidden_reshetka_dwa) then
       selectrandomobject1(1.5,10,false);
    return;end;
    if not flags.stenka and obj.kyst~=nil and obj.kyst.is_collapsed then
       selectrandomobject1(1.5,5,false);
    return;end;    
    if not flags.zamok_kamera and flags.stenka and obj.gruzik~=nil and obj.gruzik.is_collapsed then
       selectrandomobject1(1.5,12,false);
    return;end;            
    if not flags.luk_turma and obj.medal~=nil and obj.medal.is_collapsed and obj.meddwa~=nil and obj.meddwa.is_collapsed then
       if flags.luk_turma_openM then
       selectrandomobject1(1.5,1,false);
       return;end;            
       selectrandomobject1(1.5,2,false);
    return;end;   
 not_hint=true	
CreatePlashechka(900000,"10005")  
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    --messagebox(tostring(flags.hidden_reshetka_dwa))
    if not flags.luk_turma then
        Set_Anim_Cur(2,2);
    end;
    if not flags.zamok_kamera then
        Set_Anim_Cur(12,2);
    end;
    if not flags.stenka then
        Set_Anim_Cur(5,2);
    end;
    Set_Anim_Cur(8,14);
    Set_Anim_Cur(7,11);
    if (not flags.hidden_reshetka) or (flags.zavareno and not flags.hidden_reshetka_dwa) then
        Set_Anim_Cur(10,2);
    end;
    if flags.zamok_kamera then
      Set_Anim_Cur(11,18);
    end;

end;

function SetParticles()
    if not flags.hidden_reshetka then
      AddParticleToObject(10,"reshetka",512,472);
      MoveEmiter("reshetka",512,472);
      StartEmiter("reshetka");
    end;
    if not flags.stenka then
      AddParticleToObject(5,"stenka",976,277);
      MoveEmiter("stenka",976,277);
      StartEmiter("stenka");
    end;
    if not flags.zamok_kamera then
      AddParticleToObject(12,"zamok_kamera",154,310);
      MoveEmiter("zamok_kamera",154,310);
      StartEmiter("zamok_kamera");
    end;
    if flags.zavareno and not flags.hidden_reshetka_dwa then
     AddParticleToObject(10,"reshetka",512,472);
     MoveEmiter("reshetka",512,472);
     StartEmiter("reshetka");
     ActivateObject(10,true);
    end;
    if not flags.luk_turma then
      AddParticleToObject(2,"luk_john",578,528);
      MoveEmiter("luk_john",578,528);
      StartEmiter("luk_john");
    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.is_hidden_finish then
        flags.is_hidden_finish=false
        ActivateObject(10,false);
        Set_Anim_Cur(10,3);        
    end;
    if flags.zavareno and not flags.hidden_reshetka_dwa then
     AddParticleToObject(10,"reshetka",512,472);
     MoveEmiter("reshetka",512,472);
     StartEmiter("reshetka");
     ActivateObject(10,true);
     Set_Anim_Cur(10,2);
    end;  
  return;end;

  if sender==41 then
    if obj_id==40 then
        speciale_action(2,obj_id)
        StartTimer(3219999,2)
    end;
    if obj_id==41 then
        speciale_action(2,obj_id)
        StartTimer(3229999,3)
    end;    
    if obj_id==42 then
        speciale_action(2,obj_id)
        StartTimer(3239999,5)
    end;        
  return;end;
  
  if sender==36 then
    if obj_id==3219999 then
        speciale_action(2,40)
        StartTravel(40,1,nil,nil,t_gad1);
    end;    
    if obj_id==3229999 then
        speciale_action(2,41)
        StartTravel(41,1,nil,nil,t_gad2);
    end;
    if obj_id==3239999 then
        speciale_action(2,42)
        StartTravel(42,1,nil,nil,t_gad3);
    end;    
  if obj_id==1221 then
        x,y=GetObjectPosition(121)
        if x>=1024 then
        StartTravel(121,1,nil,nil,flyRat);
        end;
        StartTimer(1221,25)    
    return;end;    
  return;end;
  
  if sender == 1 then
    g_attachedID = attachedID;
    if obj_id == 11 then
      flags.is_jumping = false;
      playeffect("step_room")
      RemObjFromMouse()
      jump("turma","kamera",18,0);
    return; end;
    if obj_id == 12 then
        if not flags.is_gruzik then
            s_obj=attachedID
        end;
      RemObjFromMouse()
      IsMiniGame=true        
      Set_Sat("zamok_kamery",14,11,"turma")    
    return; end;
    if obj_id == 7 then
      playeffect("step_room")
      RemObjFromMouse()      
      jump("turma","jmp_turma",50,3);
    return; end;
    if obj_id == 10 then
    if not flags.hidden_reshetka or (flags.zavareno and not flags.hidden_reshetka_dwa) then
      flags.is_hidden_loc = true;
      RemObjFromMouse()        
      jump("turma","reshetka",14,1);
    return; end;  
    return; end;
    if obj_id == 8 then
      playeffect("step_room")
      RemObjFromMouse()     
      jump("turma","koridor",15,0);
    return; end;
    if obj_id == 5 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("stenka",14,3,"turma")    
    return; end;
    if obj_id == 2 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("luk_turma",14,2,"turma")    
    return; end;
  return; end;
   
end
function SheetSwitched(nCount)
end;