function Buttons_T(sender,obj_id)
ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"kamera",false)  
end;
function gameinput (sender,obj_id,attachedID)    
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);
  if sender == 30 then
      DeleteResource("cep_krugka");
      DeleteResource("cep_krugka_2");
      DeleteResource("cep_krugka_9"); 
      DeleteResource("kr");               
    setcurentleaf("kamera",18,0);    
    Block_Show_Cur(false);
    if flags.perepil and not flags.perepilM then
       flags.perepilM=true;
      Set_Anim_Cur(5,3);       
       speciale_action(2,5)
       speciale_action(2,14)           
    end;
    if flags.cep_krugka then
      StopEmiter("cep_krugka");
      ActivateObject(5,false);
      ActivateObject(6,false);
      ActivateObject(14,false);
      speciale_action(2,6);
        if not flags.perepilM then
           flags.perepilM=true;
           Set_Anim_Cur(5,3);       
           speciale_action(2,5)
           speciale_action(2,14)           
        end;
    end;
  return;end;
  
  if sender==50 then
    StartTimer(8883,1);    
  return;end;
  
  if sender == 1 then
    if obj_id == 7 then
      if obj.rubil ~= nil and attachedID == obj.rubil.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        Block_Show_Cur(true);
        Set_Anim_Cur(7,3);
        speciale_action(2,4,true,1);
        flags.perepil=true;
        playeffect("napilnik")
      return; end;
      if attachedID~=-1 and ((obj.rubil~=nil and attachedID ~= obj.rubil.id) or (obj.rubil==nil )) then
            RemObjFromMouse()
            CreatePlashechka(900000,"1000")
      return;end;          
      CreatePlashechka(900000,"444")
    return; end;
    if obj_id == obj.kruag.id then
    if flags.perepil then    
      RemObjFromMouse()
      flags.cep_krugka = true;
      speciale_action(2,10);     
      speciale_action(2,11);     
      StoreObj(obj.kruga.id,obj_id,"445",335,350,"kr",290,217)        
    return;end;
    CreatePlashechka(900000,"444")
    return;end;
  return ;end;
  
  if sender == 16 then
    if obj_id == 4 then
      counter=counter+1
      speciale_action(2,5,true,1);
      speciale_action(2,4,true,0.7);
    return; end;
    if obj_id == 5 then
        if counter>=3 then
          speciale_action(2,6,true);
          speciale_action(2,7,true);
          speciale_action(2,5,true);
          speciale_action(2,10,true);    
            Set_Anim_Cur(obj.kruag.id,4);
          Block_Show_Cur(false)
        return;end;
      playeffect("napilnik")
      speciale_action(2,5,true,0.7);
      speciale_action(2,4,true,1);    
    return; end;
  return; end;
  
  
  if sender == 36 then
    if obj_id == 8883 then
      
      clear_satelite_leaf("kamera");
    return; end;
  return; end;
  

end
function SheetSwitched(nCount)
end;