function SelectRandom()
  
  if (obj.pila~=nil and obj.pila.is_stored) and not flags.derevo then
    selectrandomobject1(1.5,9,false);    
  return;end;  
   not_hint=true
  CreatePlashechka(900000,"10005")
return;end;

function ActionsJump (atID)
    StRot3=true
    StopRotate(25)
    StopRotate(26)        
    StopRotate(27)    
end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    --if flags.comics4 then
        Set_Anim_Cur(16,16);
--    end;
    Set_Anim_Cur(12,14)
    Set_Anim_Cur(3,14)
    if flags.derevo then
      Set_Anim_Cur(17,15);
    end;
    if not flags.derevo then
      Set_Anim_Cur(9,2);
    end;
end;


function SetParticles()
    AddParticleToObject(16,"FlyList4",1100,0);
    MoveEmiter("FlyList4",1100,0);
    StartEmiter("FlyList4");
 if not flags.derevo then
  AddParticleToObject(9,"derevo",591,537);
  MoveEmiter("derevo",591,537);
  StartEmiter("derevo");
end;  
end;


function gameinput (sender,obj_id,attachedID)    
    CursorTreatment(obj_id,sender,attachedID);
if sender==100 then
playeffect("fon_street",true);
SetCursors()
SetParticles()
BlockCursor(false)
    StRot3=false
    RotateObject(25,0,10,3)
    RotateObject(26,0,-5,3)
    RotateObject(27,0,-10,3)
    firstR1=true
    firstR2=true
    firstR3=true
-- if flags.first == 0 then
    -- Block_Show_Cur(true)
   -- StartTimer(6789,0.1)
-- end;    
return;end;

if sender == 16 then
    if obj_id==30 then
        speciale_action(2,30,true,3.6)
        speciale_action(2,32,true,3.8)    
    return;end;
    if obj_id==32 then
        speciale_action(2,32,true,3.6)
        speciale_action(2,30,true,3.8)        
    return;end;    
  if obj_id == 9 then
    StartTimer(88850,1);
  return; end;
  if obj_id==23 then
    speciale_action(2,23,true,2);
    speciale_action(2,9,true,2);

    Set_Anim_Cur(9,2);
    Block_Show_Cur(false);
    StopEmiter("listva");
    flags.first = 1;  
    tree_fall=false
    -- DeleteRenderTarget(TargetID)    
    -- ReturnHiddenObjects()        
    -- leafobj={}    
    speciale_action(2,30,true,1.6)
    speciale_action(2,32,true,1.8)

    AddParticleToObject(16,"FlyList4",1100,0);
    MoveEmiter("FlyList4",1100,0);
    StartEmiter("FlyList4");

    add_animation(121)
    add_animation_frame(121,"street21",5000,5000,0,0,34,47,0.1);
    add_animation_frame(121,"street21",5000,5000,34,0,34,47,0.1);
    add_animation_frame(121,"street21",5000,5000,68,0,34,47,0.1);
    add_animation_frame(121,"street21",5000,5000,0,0,34,47,0.1);
    StartAnimation(121)

    add_animation(122)
    add_animation_frame(122,"street22",5000,5000,0,0,25,35,0.1);
    add_animation_frame(122,"street22",5000,5000,25,0,25,35,0.1);
    add_animation_frame(122,"street22",5000,5000,50,0,25,35,0.1);
    add_animation_frame(122,"street22",5000,5000,0,0,25,35,0.1);
    StartAnimation(122)
    flyCrow = {"InstantiationOfLine", 2, -200, 25, 1024, 25, 10, false};
    flySmallCrow = {"InstantiationOfLine", 2, 1024, 45, -200, 45, 10, false};
    StartTravel(121,1,nil,nil,flyCrow);
    StartTimer(1211,25)
    StartTimer(1221,15)    
    CreatePlashechka(900000,"2017")        
    Block_Show_Cur(false)
  return;end;
return; end;


if sender==7 and not StRot3 then
  if obj_id==25 then
    if firstR1 then
        firstR1=false
        RotateObject(25,10,0,3)
    else 
        firstR1=true
        RotateObject(25,0,10,3)
    end    
  end;
  if obj_id==26 then
    if firstR2 then
        firstR2=false
        RotateObject(26,-5,0,3)
    else 
        firstR2=true
        RotateObject(26,0,-5,3)
    end    
  end;
  if obj_id==27 then
    if firstR3 then
        firstR3=false
        RotateObject(27,-10,0,3)
    else 
        firstR3=true
        RotateObject(27,0,-10,3)
    end    
  end;    
return;end;  
  
if sender == 1 then

  g_attachedID = attachedID;

  if obj_id == 3 then
        playeffect("doors")
        playeffect("step_room")
        RemObjFromMouse()
      jump("street","holl",1,0);    
  return; end;
  if obj_id == 12 then
      playeffect("doors")
      playeffect("step_room")
      RemObjFromMouse()
      jump("street","police",4,0);
  return; end;
  if obj_id == 9 then
    s_obj=attachedID         
    RemObjFromMouse()
    Set_Sat("derevo",3,1,"street")
  return; end;
  
  if obj_id == 16 then
      playeffect("step_street")
      RemObjFromMouse()  
      jump("street","jmp_mayor_portal",50,0);
  return; end;
  
  if obj_id == 17 then
      playeffect("step_street")
      RemObjFromMouse()
      jump("street","jmp_prichal",50,1);
  return; end;
  
return; end; 

if sender == 36 then
    if obj_id==1212 then
        AddParticleToObject(16,"FlyList1",1224,200);
        MoveEmiter("FlyList1",1224,200);
        StartEmiter("FlyList1");
    return;end;
  if obj_id==6789 then
    Block_Show_Cur(true)
    tree_fall=true
    -- leafobj={TargetID,9,10,23,387,6789}
    -- GetRenderTarget(TargetID,"rendertar");
    AddParticleToObject(387,"listva",449,234);
    MoveEmiter("listva",449,234);
    StartEmiter("listva");
    playeffect("tree")
    StartTimer(88840,0.1);
    flags.first = 1;
  return;end;

  if obj_id == 88840 then
    speciale_action(2,10,true,2);
    speciale_action(2,23,true,2);
  return; end;
  
  if obj_id==1211 then
    x,y=GetObjectPosition(121)
    if x>=1024 then
    StartTravel(121,1,nil,nil,flyCrow);
    end;  
    StartTimer(1211,15)
    
  return;end;
  
   if obj_id==1221 then
      StartTimer(1221,25)
      StartTravel(122,1,nil,nil,flySmallCrow);
  return;end; 

return; end;
 
end
function SheetSwitched(nCount)
end;