function IfTableClose()
    if 
    (not flags.mini_pismo or not flags.lab_rugje or not flags.tatoo or not flags.help_zakluch or not flags.mini_dnk or not flags.john_day_book or not flags.mini_notebook)
    then
        AddParticleToObject(11,"stol_lab",660,410);
        MoveEmiter("stol_lab",660,410);
        StartEmiter("stol_lab");
    else    
        StopEmiter("stol_lab")
        ActivateObject(11,false)
    end;
end;

tumbocka=false;
flags.load_laborator = true;

SetActivLeaf("laborator");
Spirit_Particles()
AddObjForCur()



addstaticobjecttogame(1211,"labweb",76,0,"",0  ,0  ,118,70);
addstaticobjecttogame(1212,"labweb",76,0,"",118,0  ,118,70);
addstaticobjecttogame(1213,"labweb",76,0,"",236,0  ,118,70);
addstaticobjecttogame(1214,"labweb",76,0,"",354,0  ,118,70);

speciale_action(2,1212)
speciale_action(2,1213)
speciale_action(2,1214)

stol_lab={
394,378,
650,351,
988,388,
832,492
}

tumba={
82,433,
172,394,
185,652,
94,753 
}

lab_exit={
892,79,
1015,79,
1015,379,
892,379
}


CreatePolygon(11,4,"stol_lab")



addactivobjecttogame(14,"Big_lab",173,337,"","",0,0,164,167,83,35); --пуля
speciale_action(2,14);
addactivobjecttogame(15,"Big_lab",130,28 ,"","",0,0,0,342,252,111); --ружье
speciale_action(2,15);
addactivobjecttogame(16,"Big_lab",305,235,"","",0,0,124,453,122,24); --дневник1
speciale_action(2,16);
addactivobjecttogame(17,"Big_lab",289,319,"","",0,0,135,95,119,24); --дневник2
speciale_action(2,17);
addactivobjecttogame(19,"Big_lab",159,210,"","",0,0,0,453,124,59); --письмо
speciale_action(2,19);
addactivobjecttogame(20,"Big_lab",223,329,"","",0,0,124,477,82,21); --фоты
speciale_action(2,20);

addstaticobjecttogame(25,"Big_lab",109,488,"",135,0,60,95); --совок
speciale_action(2,25);
addstaticobjecttogame(26,"Big_lab",93 ,394,"",0,0,135,342); --откррытая дверка
speciale_action(2,26);

CreatePolygon(34,4,"tumba")



CreatePolygon(30,4,"lab_exit")



addstaticobjecttogame(33,"lab_8",0  ,0  ,""); --фон



  
Block_Show_Cur(false);

addfade(501,0);

-- if flags.tumbal_openM then
    -- tumbocka=true;
    -- if flags.sovokvis then
        -- speciale_action(2,25); --откррытая дверка
    -- end;
    -- speciale_action(2,26); --откррытая дверка
    -- ActivateObject(26,true)
-- end;


if flags.mini_dnk then 
    speciale_action(2,14);
    AddParticleToObject(14,"p6",228,348);
    MoveEmiter("p6",228,348);
    StartEmiter("p6");  

end;

if flags.john_day_book then 
 speciale_action(2,16);
    AddParticleToObject(16,"p1",338,244);
    MoveEmiter("p1",338,244);
    StartEmiter("p1");  

end;

if flags.lab_rugje then  
speciale_action(2,15);
    AddParticleToObject(15,"p2",148,34);
    MoveEmiter("p2",148,34);
    StartEmiter("p2");  

end;

if flags.mini_notebook then
    AddParticleToObject(17,"p3",308,328);
    MoveEmiter("p3",308,328);
    StartEmiter("p3");  
  speciale_action(2,17);
end;

if flags.tatoo then  
speciale_action(2,20);
    AddParticleToObject(20,"p4",265,339);
    MoveEmiter("p4",265,339);
    StartEmiter("p4");  

end;

if flags.expert then
    speciale_action(2,19);
    AddParticleToObject(19,"p5",184,216);
    MoveEmiter("p5",184,216);
    StartEmiter("p5");  

end;
    
--частицы--

IfTableClose()
-- if flags.tumba_lab then
  -- if not tumbocka then
  -- tumbocka=true;
  -- speciale_action(2,26); --откррытая дверка
  -- end;
      -- ActivateObject(26,false)
-- end;




-- if not flags.tumba_lab then
  -- if flags.tumbal_open then
        -- AddParticleToObject(26,"dverka_lab",140,530);
        -- MoveEmiter("dverka_lab",140,530);
        -- StartEmiter("dverka_lab");  
  -- end;
  -- AddParticleToObject(34,"dverka_lab",140,530);
  -- MoveEmiter("dverka_lab",140,530);
  -- StartEmiter("dverka_lab");
-- end;