local yes = false;

function Buttons_T(sender,obj_id)
    ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"police",false)  
end;

function gameinput (sender,obj_id,attachedID)    
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);  
  if sender == 30 then
      DeleteResource("statuj1");
      DeleteResource("statuj_big");    
      DeleteResource("statuj8");
      DeleteResource("stat1");       
    setcurentleaf("police",4,0);    
    if flags.colba_open and not flags.colba_openM then
      flags.colba_openM=true;
      speciale_action(2,9);
      speciale_action(2,10);    
      ActivateObject(12,true);
      Set_Anim_Cur(12,2)      
    end;
    Block_Show_Cur(false);
    if flags.kolba then
      flags.help_statuj = true;
      if not  flags.colba_openM then
      flags.colba_openM=true;
      speciale_action(2,9);
      speciale_action(2,10);
      end;
      speciale_action(2,11);
      speciale_action(2,12);
      speciale_action(2,13);
      speciale_action(2,14);
      speciale_action(2,15);
      StopEmiter("statuj");
      WaitRender()
    end;
  return;end;
  
  if sender==16 then
    if obj_id==11 then
        speciale_action(2,11,true)
        playeffect("kusachki")
        speciale_action(2,5,true)
    return;end;
    if obj_id==5 then
        speciale_action(2,6,true);
        speciale_action(2,4,true);
        speciale_action(2,5,true)
    return;end;    
    if obj_id==4 then
        Set_Anim_Cur(7,4);    
        Block_Show_Cur(false)
    return;end;        
  return;end;
  
  if sender==50 then
 
      StartTimer(8882,0.5);
      Block_Show_Cur(true);  
  return;end;
  
  if sender == 1 then
    if obj_id == 6 then
      if obj.plosk ~= nil and attachedID == obj.plosk.id then
        flags.wire_cut=true;
        RemObjFromMouse()
        UnStoreObj(attachedID);
        Block_Show_Cur(true);
        speciale_action(2,11,true)
        Set_Anim_Cur(6,3);
        Set_Anim_Cur(7,3);
      return; end;
      if attachedID~=-1 and ((obj.plosk~=nil and attachedID ~= obj.plosk.id) or (obj.plosk==nil ))  then
            RemObjFromMouse()
            CreatePlashechka(900000,"1000")
          return;end;          
          CreatePlashechka(900000,"127")
    return; end;
    
    if obj_id == 7 then
    if not flags.wire_cut then
    CreatePlashechka(900000,"1007")
    return;end;
      RemObjFromMouse()
      set_pixel_check(7,true)
      Set_Anim_Cur(7,3);    
      speciale_action(2,7,true);
      speciale_action(2,9,true);
      playeffect("kolba")
      flags.colba_open=true;    
      Set_Anim_Cur(obj.totme.id,4);      
      yes = true;      
    return; end;
    
    if obj_id == obj.totme.id and flags.colba_open then
        RemObjFromMouse()
        playeffect("statuetka")
         flags.kolba = true;
        StoreObj(obj.totem.id,obj.totme.id,"126",335,350,"stat1",291,239)
        
    return; end;
    
  return ;end;
  
  if sender == 100 then

  return; end;
  
  if sender == 36 then

    if obj_id == 8882 then
      Block_Show_Cur(false);
      clear_satelite_leaf("police");
    return; end;

  return; end;

    
end
function SheetSwitched(nCount)
end;