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

-- function LevelComplete()
    -- StoreObj(obj.dosk.id,nil,"161",285,350,"doski",323,217)    
-- end;

function gameinput (sender,obj_id,attachedID)   
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);   
  if sender == 30 then
    DeleteResource("mayor_wind2" );
    DeleteResource("mayor_wind11");     
    DeleteResource("mayor_wind10");  
    DeleteResource("doski_all" );
    setcurentleaf("mayor_house",8,0);    
    if flags.mayor_wind then
      speciale_action(2,41);
      speciale_action(2,42)
      Set_Anim_Cur(42,16);
      StopEmiter("mayor_wind");
      flags.help_mayor_wind = true;
      neighbors.stol.lock=false;  
      neighbors.saray.lock=false;  
    end;
    Block_Show_Cur(false);
  return;end;
  
  if sender==50 then
   
    Block_Show_Cur(true)
    StartTimer(8882,1);
  return;end;
  
  if sender == 1 then
    if obj_id == 9 or obj_id == 11 or obj_id == 13 then
      if obj.fomka ~= nil and attachedID == obj.fomka.id then
        playeffect("doski")
        ActivateObject(obj_id,false)
        speciale_action(2,obj_id,true)
        Set_Anim_Cur(obj_id,3)
        speciale_action(2,obj_id+1,true)        
        counter=counter+1
        if counter==3 then
            StopAllEffects()
            StartTimer(8884,2);
            RemObjFromMouse()
            Block_Show_Cur(true)
        return; end;
      return; end;
      if attachedID~=-1 and ((obj.fomka~=nil and attachedID ~= obj.fomka.id) or (obj.fomka==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;      
      CreatePlashechka(900000,"160")
    return; end;
  return ;end;
  
  
  if sender == 36 then
    if obj_id == 8882 then
        
      Block_Show_Cur(false);
      clear_satelite_leaf("mayor_house");
    return; end;    
    if obj_id==8883 then
        Block_Show_Cur(false);
             flags.mayor_wind = true;
        StoreObj(obj.dosk.id,nil,"161",285,350,"doski",323,217)    
    return;end;
    if obj_id==8884 then
        speciale_action(2,10,true,1.5)
        speciale_action(2,12,true,1.5)
        speciale_action(2,14,true,1.5)
        StartTimer(8883,2);
    return;end;
  return; end;
end
function SheetSwitched(nCount)
end;