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

function gameinput (sender,obj_id,attachedID)    
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);
  if sender == 30 then
      DeleteResource("lebedkatwo_2");
      DeleteResource("lebedkatwo_3");     
      DeleteResource("lebedkatwo_b1");     
      DeleteResource("lebedkatwo_b2");        
      DeleteResource("lebedkatwo_8");      
    setcurentleaf("obryv",17,0);    
    Block_Show_Cur(false);
    if flags.key3vverh and not flags.key3vverhM then
       flags.key3vverhM=true;
       speciale_action(2,2);
       speciale_action(2,4);
       speciale_action(2,6);
       speciale_action(2,5);    
       flags.kluchik_vidim=true;       
    end;
    if flags.lebedkatwo then
    if not flags.key3vverhM then
      flags.key3vverhM=true;    
      speciale_action(2,2);
      speciale_action(2,4);
      speciale_action(2,6);     
    end;     
        if flags.kluchik_vidim then
         speciale_action(2,5);
      end;  
      StopEmiter("lebedkatwo");
      ActivateObject(7,false);
      Set_Anim_Cur(7,3);
    end;
  return;end;
  
  if sender==50 then
        Block_Show_Cur(true);
      StartTimer(8883,1);
  return;end;
  
  if sender == 1 then
    if obj_id == 9 then
      if obj.racha ~= nil and attachedID == obj.racha.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        Block_Show_Cur(true);
        flags.key3vverh=true;
        speciale_action(2,7,true);
        speciale_action(2,8,true);
        Set_Anim_Cur(9,3)
        playeffect("lebedka")
        ActivateObject(9,false)
      return; end;
      if attachedID~=-1 and ((obj.racha~=nil and attachedID ~= obj.racha.id) or (obj.racha==nil )) then
            RemObjFromMouse() 
            CreatePlashechka(900000,"1000")
      return;end;          
      CreatePlashechka(900000,"483")
    return; end; 
    if obj_id == 11 then
        RemObjFromMouse()
              flags.lebedkatwo = true;     
        StoreObj(obj.keytri.id,obj_id,"478",335,350,"kl1",290,217)
    return; end;    
  return ;end;
  
  if sender == 16 then
    if obj_id == 7 then
      speciale_action(2,6,true);
      speciale_action(2,7,true);
    return; end;
    if obj_id == 6 then
      speciale_action(2,5,true);
      speciale_action(2,11,true);
      speciale_action(2,6,true);
      Set_Anim_Cur(11,4);
    return; end;
    if obj_id == 5 then
        Block_Show_Cur(false)
    return; end;
  return; end;
  
  if sender == 36 then
    if obj_id == 8883 then
 
      clear_satelite_leaf("obryv");
    return; end;
  return; end;
  

end
function SheetSwitched(nCount)
end;