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

function gameinput (sender,obj_id,attachedID)   
CursorTreatment(obj_id,sender,attachedID); 
Buttons_T(sender,obj_id)
 
  if sender == 30 then
      DeleteResource("vaza_svecha2");
      DeleteResource("vaza_svecha");    
      DeleteResource("vaza_svecha9");   
      DeleteResource("svecha");                
    setcurentleaf("mayor_house",8,0);
    if flags.vase_broke and not flags.vase_brokeM then
        flags.vase_brokeM=true;
        speciale_action(2,10);
        speciale_action(2,12);    
      Set_Anim_Cur(12,2);        
    end;
    Block_Show_Cur(false);
    if flags.vaza_svecha then
    if not flags.vase_brokeM then
      speciale_action(2,10);
      speciale_action(2,12);

     end; 
     ActivateObject(12,false)
     Set_Anim_Cur(12,3);    
      StopEmiter("vaza_mayor");
      flags.help_vaza_mayor = true;
    end;
  return;end;
  
  if sender==50 then
        StartTimer(8882,1);
      Block_Show_Cur(true);
  return;end;
  
  if sender == 1 then
    
    if obj_id == 6 then
      if obj.kamen ~= nil and attachedID == obj.kamen.id then
        if counter==1 then
           playeffect("vase")
           speciale_action(2,21)
           speciale_action(10,21)
           counter=counter+1
        return;end;
        if counter==2 then
           playeffect("vase")
           speciale_action(2,20)
           speciale_action(2,21)
           speciale_action(10,20)
           counter=counter+1
        return;end;    
        if counter==3 then        
            RemObjFromMouse()
            UnStoreObj(attachedID);
            playeffect("vase")
            flags.vase_broke=true;
            speciale_action(2,20)
            speciale_action(2,6,true);
            speciale_action(2,9,true);
            Set_Anim_Cur(6,3);
            speciale_action(2,obj.svehc.id,true);    
            Set_Anim_Cur(obj.svehc.id,4);
        return;end;    
      return; end;
      if attachedID~=-1 and ((obj.kamen~=nil and attachedID ~= obj.kamen.id) or (obj.kamen==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;    
      if not   flags.vase_broke then
      CreatePlashechka(900000,"154")
      end;
    return; end;
    
    if obj_id == obj.svehc.id then
        RemObjFromMouse()
        flags.vaza_svecha = true;
      StoreObj(obj.svech.id,obj_id,"153",285,350,"svecha",323,217)    
    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("mayor_house");
    return; end;
  return; end;
  
end
function SheetSwitched(nCount)
end;