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

function gameinput (sender,obj_id,attachedID)  
CursorTreatment(obj_id,sender,attachedID); 
Buttons_T(sender,obj_id)   
  
  if sender == 30 then
      DeleteResource("comodo2");
      DeleteResource("comodo_all"); 
      DeleteResource("comodo8");     
      DeleteResource("comodo9");          
    setcurentleaf("john_house",11,0);    
    DarkScreen(false);
    if flags.shkaf_jones and (not flags.shkaf_jonesM) then
      flags.shkaf_jonesM=true;
      speciale_action(2,7);
      speciale_action(10,7);
    end;    
    Block_Show_Cur(false);
    if flags.comodo then
      StopEmiter("comodo");
      if not flags.shkaf_jonesM then
      flags.shkaf_jonesM=true;
      speciale_action(2,7);
      end;
      ActivateObject(8,false);
      Set_Anim_Cur(8,3);
    end;
  return;end;
  
  if sender==50 then
      Block_Show_Cur(true);
      StartTimer(8882,1);  
  return;end;
  
  if sender == 1 then
    if obj_id == 8 then
      if obj.kekuk ~= nil and attachedID == obj.kekuk.id then
        RemObjFromMouse()
        UnStoreObj(obj.kekuk.id);
        speciale_action(2,4,true,1);
        playeffect("keyrotate");
        Block_Show_Cur(true);
      return; end;
      if attachedID~=-1 and ((obj.kekuk~=nil and attachedID ~= obj.kekuk.id) or (obj.kekuk==nil )) then
            RemObjFromMouse()
            CreatePlashechka(900000,"1000")
      return;end;    
    CreatePlashechka(900000,"284")      
    return; end;
    
    if obj_id == 6 then
      RemObjFromMouse()
      flags.comodo = true;     
      StoreObj(obj.ventyl.id,6,"283",335,360,"ventil",317,223)
    return; end;
  return ;end;
  
  if sender == 16 then
    if obj_id == 4 then
      counter=counter+1;
      speciale_action(2,4,true,0.7);
      speciale_action(2,5,true,1);
      playeffect("keyrotate");
    return; end;
    if obj_id == 5 then
      if counter>2 then
      playeffect("mini_doors");
      speciale_action(2,5,true);
      speciale_action(2,7,true);
      speciale_action(2,6,true);
      Set_Anim_Cur(6,4);
      Block_Show_Cur(false);
      flags.shkaf_jones=true;
      return;end;
      speciale_action(2,4,true,1);
      speciale_action(2,5,true,0.7);
      playeffect("keyrotate");      
    return; end;
  return; end;
  
  if sender == 100 then
  return; end;
  
  if sender == 36 then
    if obj_id == 8882 then
       
      clear_satelite_leaf("john_house");
    return; end;
  return; end;

end
function SheetSwitched(nCount)
end;