function SelectRandom()

  if not flags.derevo2 and obj.tesak~=nil and obj.tesak.is_collapsed   then
    selectrandomobject1(1.5,3,false); --÷óëàí
  return; end;  
  if not flags.krugka_water and obj.kruga~=nil and obj.kruga.is_collapsed then
    selectrandomobject1(1.5,10,false); --÷óëàí
  return; end;  
  if not flags.rama_steklo  and obj.rabper~=nil and obj.rabper.is_collapsed   then
    selectrandomobject1(1.5,4,false); --÷óëàí
  return; end;  
   not_hint=true
 CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(8,14);
    if not flags.derevo2 then
        Set_Anim_Cur(3,2);
    end;
    -- if not obj.medal.is_collapsed then
        -- Set_Anim_Cur(obj.medla.id,4);
    -- end;
    if not flags.rama_steklo then
        Set_Anim_Cur(4,2)
    end;
    Set_Anim_Cur(9,15);
    if not flags.krugka_water then
        Set_Anim_Cur(10,2);
    end;
    if flags.is_spirit then
        Set_Anim_Cur(320,11)
    end;
end;

function SetParticles()
    AddParticleToObject(7,"molnii",1000,61);
    MoveEmiter("molnii",1000,61);
    StartEmiter("molnii");
    -- if not obj.medla.is_collapsed then
      -- AddParticleToObject(obj.medla.id,"nog",311,480);
      -- MoveEmiter("nog",311,480);
      -- StartEmiter("nog");
    -- end;
    if not flags.derevo2 then
      AddParticleToObject(3,"derevo2",613,123);
      MoveEmiter("derevo2",613,123);
      StartEmiter("derevo2");
    end;
    if not flags.krugka_water then
      AddParticleToObject(10,"water_kêugka",661,501);
      MoveEmiter("water_kêugka",661,501);
      StartEmiter("water_kêugka");
    end;
    if not flags.rama_steklo then
      AddParticleToObject(4,"rama",131,354);
      MoveEmiter("rama",131,354);
      StartEmiter("rama");
    end;
end;

function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID)  
CursorTreatment(obj_id,sender,attachedID); 
  if sender==100 then
     SetParticles()
     SetCursors()
     BlockCursor(false)
     playeffect("fon_groza",true);
     playeffect("fon_storm",true);
    if flags.first_duh_entert then
        flags.first_duh_entert=false;
        speciale_action(2,321,true,2)
        Block_Show_Cur(true)
    end;
    if needalfa320 and alfa320=="down" then
        needalfa320=false
        alfa320="up"
        SetAlfa(321,0.4,1,2)
    return;end;
    if needalfa320 and alfa320=="up" then
        needalfa320=false
        alfa320="down"
        SetAlfa(321,1,0.4,2)
    return;end;     
    if jumpfromcomics then
        SetAlfa(19999999,1,0,1)            
    return;end;
  return;end;
  if sender==33 then
      Block_Show_Cur(false);
    if obj_id==321 then
        needalfa320=true;
        WaitRender()
    return;end;
    if jumpfromcomics then
    jumpfromcomics=false
    ShowMenu(true);
    CreatePlashechka(900000,"385")
    return;end;     
  return;end; 
  
  if sender==12 and clicking_now then
    if obj_id == obj.medla.id then
      Block_Show_Cur(false)      
      StoreObj(obj.medal.id);
      clicking_now=false
    return; end;  
  return;end;
  
  if sender == 1 then
    g_attachedID = attachedID;
    if obj_id == 9 then
       playeffect("step_street")
          RemObjFromMouse()        
      jump("prichal_turmy","tropa_obryva",16,0);
    return; end;
    if obj_id == 320 and flags.is_spirit then
      -- if not flags.comics15 then
         -- flags.comics15=true
         -- flags.is_comics=true
         -- ShowMenu(false)
         -- jump("prichal_turmy","comics15",12,50);
      -- return; end;
      jump("prichal_turmy","parom",9,0);
    return; end;
    if obj_id == 10 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("krugka_water",12,3,"prichal_turmy")    
    return; end;
    -- if obj_id == obj.medla.id then
      -- RemObjFromMouse()
      -- clicking_now=true      
      -- StoreObj(obj.medal.id,obj.medla.id,"325",285,350,"m1",323,217)
      -- StopEmiter("nog");
    -- return; end;
    if obj_id == 4 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("rama",12,2,"prichal_turmy")    
    return; end;
    if obj_id == 8 then
        playeffect("step_street")
          RemObjFromMouse()
      flags.is_comics=false
      jump("prichal_turmy","vhod_turmy",13,0);
    return; end;
    if obj_id == 3 or obj_id == 1 then
        RemObjFromMouse()
        s_obj=attachedID        
        Set_Sat("derevo2",12,1,"prichal_turmy")    
    return; end;
  return; end;
  
  if sender==16 then
        if obj_id==321 then
          speciale_action(2,320,true,2)
        SetAlfa(321,1,0.3,2)
        alfa320="down"
        CreatePlashechka(900000,"3025")
        Block_Show_Cur(false)
        return;end;
  return;end;

end
function SheetSwitched(nCount)
end;