He = 1004;
She = 1003;
BHe = 1008;
BShe = 1009;

function LevelComplete()
	-- DeleteElement("gr",159)	
	flags = {};
	
	flags.glove_taken = true;	
	flags.rentgen_taken = true;
	flags.nvg_taken = true;
	flags.pointer_taken = true;
	flags.scaner_taken = true;
	flags.restore_sheet = false;
	set_visible_object(5558,false);
	obj={}
	SaveGame1();
	

-- for name,obj in pairs(obj) do
	-- if obj.is_collapsed then
	-- obj.is_collapsed= false
	-- end;
-- end
	-- if obj.a0033.is_stored then
		-- UnStoreObj(obj.a0033.id);
	-- else
		-- obj.a0033.is_stored = true;
	-- end;
	if gloveselect then	RotateToPos(2);		end;
	if nvgselect then	RotateToPos(3);			end;
	if rentgenselect then	RotateToPos(1);			end;
	if scanerselect then RotateToPos(0);			end;
	
	delete_tree_leaf("Root", "lab");
	NextLevel(6);
		
end;
flags.glove_taken = true;	
	flags.rentgen_taken = true;
	flags.nvg_taken = true;
dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");

-- CreateTextBackground("tochka1",0,0,20,100)


flags.rentgen_taken = true;
	flags.nvg_taken = true;
set_inpun_fun("gameinput");
flags.glove_vkl=false;
flags.glove_vikl=false;
flags.ngv_vkl=false;
flags.ngv_vikl=false;
flags.rentgen_vkl=false;
flags.rentgen_vikl=false;
flags.pointer_vkl=false;
flags.pointer_vikl=false;
flags.scaner_vkl=false;
flags.scaner_vikl=false;
flags.first_up_micro= true;
flags.first_up_chemic= true;
flags.first_up_scan= true;
flags["first_open"] = true;
flags["first_open1"] = true;
flags["first_open2"] = true;
flags["comics1"] = true;
flags["comics2"] = false;
flags["comics3"] = false;
flags["vibrali"] = false;
flags["mini1"] = false;
flags["mini2"] = false;
flags["items"] = 0;
scaner_is_usable=false
flags.add_a0033=false
pointer_is_usable=true
flags.items_collected = false;
flags["start_draw"] = true;
flags["first_time_load"] = true;
flags["items1"] = 0;
flags["mini_micro"] = false;
flags["scroll1"] = false;
flags["scroll2"] = false;
flags["scroll3"] = false;
flags["apparat"] = false;
flags["finish"] = false;
flags.start_mini1 = false;
flags.start_mini2 = false;
flags.start_mini3 = false;
flags.mini_micro_complete = false;
flags.mini_chemic_complete = false;
flags.mini_scan_complete = false;
flags.vzyali = false;
flags.otpustili = false;
flags.scr1 = false;
flags.scr2 = false;
flags.scr3 = false;
flags.finish_mini1=false;
flags.finish_mini2=false;


flags.scan_true=false;
flags.takescan=false;

flags.light1=true;
flags.light=false;
flags.nv_done=true;
flags.nvg_block=false;

if flags.restore_sheet then
	LoadGame();
	AddTool();	
end;
flags.restore_sheet = true;
-- SetWindowText("flags.mini_micro"..tostring(flags.mini_micro_complete).." ".."flags.mini_chemic"..tostring(flags.mini_chemic_complete).." ".."flags.mini_scan"..tostring(flags.mini_scan_complete))
if not flags.mini_micro_complete and not flags.mini_chemic and  flags.items_collected then
AddParticleToObject(obj.microscope.id,"micro");
MoveEmiter("micro",456,461);
	StartEmiter( "micro" );
	Set_Cursor( obj.microscope.id, 4 );

end;

if flags.mini_chemic_complete and not flags.mini_scan_complete then
AddParticleToObject(obj.scan.id,"scan");
MoveEmiter("scan",494+60,390+18);
	StartEmiter( "scan" );
	Set_Cursor( obj.scan.id, 2 );
end;
flags.restore_sheet = true;

AddTreeLeaf( "Root", "lab", 5, 0 );
AddTxt();
dofile("./data/5/0/res.lua");

flags.start_draw = true;
-- for name,o in pairs(obj) do
	-- if o.is_stored then
	-- SetObjectPosition(o.id,-1000,-1000)	
	-- set_visible_object( o.id, true );
	-- end;
-- end

if not  flags.mini_chemic and flags.saygirl then

speciale_action(2,obj.arrow22.id);	
	StartAnimation(obj.arrow22.id)
	SwitchToSheet("gr")
	StartEmiter( "micro" );
end
if flags.mini_chemic and not flags.mini_scan_complete then
	Set_Cursor( obj.scan.id, 2 );
	Set_Cursor( obj.microscope.id, 3 );
	-- StopEmiter( "micro" );
end
	
if flags.mini_chemic and flags.mini_scan_complete then
	Set_Cursor( obj.scan.id, 3 );
	Set_Cursor( obj.microscope.id, 3 );
end
StartAnimation( 5555555555,5,5 );
SetCurrentLeaf( "lab", 5, 0 );
ShowMenu( false );
flags.start_draw=false
-- playfile(".\\sound\\050.ogg",true,true);
playeffect("050",true)
c("5 lvl")