function SelectRandom()
  if not flags.prichal_box and obj.kislot~=nil and obj.kislot.is_collapsed then    
    if flags.prichbox_openM then
        selectrandomobject1(1.5,4,false);
    return;end;
    selectrandomobject1(1.5,6,false); --ящик
  return; end;
  if not flags.koleso and obj.bagor~=nil and obj.bagor.is_collapsed then
    selectrandomobject1(1.5,24,false); --колесо
  return; end;
  if not flags.lebedka and obj.rukja~=nil and obj.rukja.is_collapsed and  flags.hidden_chulan then
    selectrandomobject1(1.5,20,false); --лебедка
  return; end;
  if not flags.mostik and obj.verev~=nil and obj.verev.is_collapsed  and obj.dosk~=nil and obj.dosk.is_collapsed then
    selectrandomobject1(1.5,8,false); --мостик
  return; end;
   not_hint=true
CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(29,11)
    if not flags.prichal_box then
        Set_Anim_Cur(6,2);
    end;

    if not flags.mostik then
        Set_Anim_Cur(8,2);
    end;
  if not flags.is_spirit then
    Set_Anim_Cur(30,16);
  else
  Set_Anim_Cur(30,14);
  end;
    if not flags.lebedka and flags.hidden_chulan then
        Set_Anim_Cur(20,2);
    end;
    if not flags.koleso then
        Set_Anim_Cur(24,2);
    end;
    Set_Anim_Cur(26,15);
    if flags.is_spirit then
        Set_Anim_Cur(321,14)
    end;
    if flags.prichbox_openM then
    if not flags.prichal_box then
        Set_Anim_Cur(4,2);
    end;    
    end;
end;

function SetParticles()
  AddParticleToObject(28,"water2",380,170);
  MoveEmiter("water2",380,170);
  StartEmiter("water2");

    if not flags.koleso then
      AddParticleToObject(24,"bcol",626,304);
      MoveEmiter("bcol",626,304);
      StartEmiter("bcol");
    end;
    if not flags.prichal_box then
    if flags.prichbox_open then
          AddParticleToObject(4,"prichal_box",232,511);
      MoveEmiter("prichal_box",232,511);
      StartEmiter("prichal_box");      
      else
      AddParticleToObject(6,"prichal_box",232,511);
      MoveEmiter("prichal_box",232,511);
      StartEmiter("prichal_box");
      end;
    end;
    if not flags.lebedka and flags.hidden_chulan then
      AddParticleToObject(20,"lebedka",706,331);
      MoveEmiter("lebedka",706,331);
      StartEmiter("lebedka");
    end;
    if not flags.mostik then
      AddParticleToObject(8,"mostik",907,342);
      MoveEmiter("mostik",907,342);
      StartEmiter("mostik");
    end;
end;

function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID) 
    CursorTreatment(obj_id,sender,attachedID); 
      if sender==33 then
        Block_Show_Cur(false);
        if obj_id==320 then
            needalfa320=true;
            WaitRender()
        return;end;
    return;end; 
    
    if sender==100 then
        SetParticles()
        SetCursors()
        BlockCursor(false)
        playeffect("fon_see",true);
        if fromcomics15 then
            fromcomics15=false
            ShowMenu(true)
        end;
        if flags.is_spirit and not flags.first_paromd then
          CreatePlashechka(900000,"3050")
          flags.first_paromd=true
        end;  
        if needalfa320 and alfa320=="down" then
            needalfa320=false
            alfa320="up"
            SetAlfa(320,0.1,1,3)
        return;end;
        if needalfa320 and alfa320=="up" then
            needalfa320=false
            alfa320="down"
            SetAlfa(320,1,0.1,3)
        return;end;        

    if flags.ugon_auto  and not flags.firstugon then
      flags.firstugon=true
      speciale_action(2,16);
      speciale_action(2,1);
    end;    
    return;end;        
  if sender==42 then
    if obj_id==122 then
           StartTimer(1211,45)
    return;end;
    if obj_id==123 then
           StartTimer(1221,30)
    return;end;    
    if obj_id==121 then
           StartTimer(1221,30)
    return;end;        
  return;end;  
  if sender==44 then
    AboutItem(obj_id)
  return;end;     
  if sender == 1 then
  
    g_attachedID = attachedID;
  
  
    if obj_id==16 then
        StopEmiter("fomka")
        Set_Anim_Cur(16,3);
        StoreObj(obj.fomka.id,obj_id,"118",285,350,"fomka",323,217)    
    return;end;
    
    if obj_id == 29 then
      playeffect("step_street")
      RemObjFromMouse()
      jump("parom","jmp_prichal",50,1);
    return; end;
    
    if obj_id == 26 then
      if flags.mostik then
      playeffect("step_street")
        RemObjFromMouse()
        jump("parom","john_house",11,0);
      return; end;
      CreatePlashechka(900000,"266")
    return; end;
    
    if obj_id == 30  or obj_id==321 then
      if not flags.is_spirit then
        flags.is_jumping = false;
        playeffect("step_street")
        RemObjFromMouse()    
        jump("parom","parom_main",10,0);
        if flags.is_jumping and not flags.g_tros then
          speciale_action(2,13);
          speciale_action(2,14);
        end;
      return; end;
      if flags.is_spirit then
        RemObjFromMouse()
        jump("parom","prichal_turmy",12,0);
      return; end;
    return; end;
    
    if obj_id == 6 or obj_id == 4 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("prichal_box",9,3,"parom")            
    return; end;
    
    if obj_id == 20 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("lebedka",9,1,"parom")    
    return; end;
    
    if obj_id == 24 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("koleso",9,4,"parom")        
    return; end;
    
    if obj_id == 8 or obj_id == 9 then
        RemObjFromMouse()
        s_obj=attachedID
        Set_Sat("mostik",9,2,"parom")            
    return; end;
    
  return; end;
  
  if sender == 36 then   
    if obj_id==1211 then
        StartTravel(122,1,nil,nil,flySeagul);
    return;end;
    if obj_id==1221 then          
        StartTravel(123,1,nil,nil,flysSeagul);
    return;end;  
  return; end;

  
end
function SheetSwitched(nCount)
end;