function SelectRandom()
    if not obj.sadnog.is_collapsed then
       selectrandomobject1(1.5,obj.sadngo.id,false);
    return;end;    
    if not flags.trava and obj.kosa~=nil and obj.kosa.is_collapsed then 
       selectrandomobject1(1.5,4,false);
    return;end;    
    if not flags.duplo and obj.svetka~=nil and obj.svetka.is_collapsed then 
       selectrandomobject1(1.5,8,false);
    return;end;    
    if flags.is_spirit and not flags.hidden_zarosli then
       selectrandomobject1(1.5,10,false);
    return;end;   
 not_hint=true	
CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(7,11);
    if not obj.sadnog.is_collapsed then
        Set_Anim_Cur(obj.sadngo.id,4);
    end;
    if not flags.duplo then
        Set_Anim_Cur(8,2)
    end;
    if not flags.trava then
        Set_Anim_Cur(4,2);
    end;
    Set_Anim_Cur(9,14);
    if flags.is_spirit then
      if not flags.hidden_zarosli then
        Set_Anim_Cur(10,2);
      end;
    end;
end;

function SetParticles()
    AddParticleToObject(6,"molnii1",500,61);
    MoveEmiter("molnii1",500,61);
    StartEmiter("molnii1");
    if not obj.sadngo.is_collapsed then
      AddParticleToObject(obj.sadngo.id,"bolts",385,427);
      MoveEmiter("bolts",385,427);
      StartEmiter("bolts");
    end;
    if not flags.trava then
      AddParticleToObject(7,"trava",836,415);
      MoveEmiter("trava",836,415);
      StartEmiter("trava");
    end;
    if not flags.duplo then
      AddParticleToObject(8,"tiger",268,205);
      MoveEmiter("tiger",268,205);
      StartEmiter("tiger");
    end;
    if flags.is_spirit then
      if not flags.hidden_zarosli then
        AddParticleToObject(10,"zarosli_hidd",95,429);
        MoveEmiter("zarosli_hidd",95,429);
        StartEmiter("zarosli_hidd");
      end;
    end;
end;

function ActionsJump (atID)
    StRot16=true
    StopRotate(36)
    StopRotate(37)
    StopRotate(38)    
end;

function gameinput (sender,obj_id,attachedID)  
CursorTreatment(obj_id,sender,attachedID);
  if sender==41 then
    if obj_id==121 then
        StartTimer(333333,15)
    return;end;
  return;end;
  
  if sender==100 then
    playeffect("fon_groza",true);
    SetParticles()
    SetCursors()
    BlockCursor(false)
    RotateObject(36,0,10,4)
    RotateObject(37,0,-10,4)
    RotateObject(38,0,10,4)
    ObL1=true
    ObL2=true
    ObL3=true
    StRot16=false
    if flags.is_hidden_finish then
        flags.is_hidden_finish=false
        ActivateObject(10,false);
        Set_Anim_Cur(10,3);
    end;
  return;end;
  
  if sender==7 and not StRot16 then
    if obj_id==36 then
        if ObL1 then
            ObL1=false
            RotateObject(36,10,0,4)
        else
            ObL1=true
            RotateObject(36,0,10,4)
        end;
    end;
    if obj_id==37 then
        if ObL2 then
            ObL2=false
            RotateObject(37,-10,0,4)
        else
            ObL2=true
            RotateObject(37,0,-10,4)
        end;    
    end;    
    if obj_id==38 then
        if ObL3 then
            ObL3=false
            RotateObject(38,10,0,4)
        else
            ObL3=true
            RotateObject(38,0,10,4)
        end;    
    end;    
  return;end;
  
  if sender==33 then
      Block_Show_Cur(false);
  return;end; 

  
  if sender == 1 then
    g_attachedID = attachedID;
    if obj_id == obj.sadngo.id then
      clicking_now=true
      RemObjFromMouse()
      StoreObj(obj.sadnog.id,obj_id,"361",335,350,"nojnici",290,217)
      StopEmiter("bolts");
    return; end;
    if obj_id == 10 then
      if flags.is_spirit and (not flags.hidden_zarosli) then
      flags.is_hidden_loc = true;
      playeffect("step_street")
      RemObjFromMouse()       
      jump("tropa_obryva","zarosli",16,3);
    return; end;  
    return; end;
    if obj_id == 7 then
      flags.is_jumping = false;
      playeffect("step_street")
      RemObjFromMouse()
      jump("tropa_obryva","prichal_turmy",12,0);
      if not flags.is_spirit_main and flags.is_jumping then
        ActivateObject(11,true);
        Set_Anim_Cur(11,1);
      end;
    return; end;
    if obj_id == 9 then
      playeffect("step_street")
      jump("tropa_obryva","obryv",17,0);
    return; end;
    if obj_id == 8 then
        RemObjFromMouse()
        s_obj=attachedID
        Set_Sat("duplo",16,2,"tropa_obryva")            
    return; end;
    if obj_id == 4 or obj_id == 3 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("trava",16,1,"tropa_obryva")        
    return; end;
  return; end;
  
  if sender == 36 then   
    if obj_id==333333 then
       StartTravel(121,1,nil,nil,flyRat1);
    end;
  return; end;

end
function SheetSwitched(nCount)
end;