	
StartTravel(106,1,nil,nil,{"InstantiationOfLine",2,289,33,1024 ,33,70,false})
StartTravel(107,1,nil,nil,{"InstantiationOfLine",2,694,82,800,82,60,false})
StartTravel(108,1,nil,nil,{"InstantiationOfLine",2,96,113,766 ,113,80,false})


AddParticleToObject(1,"Highlight");
MoveEmiter("Highlight",460,465);

AddParticleToObject(204,"voda1");
MoveEmiter("voda1",661,167);
AddParticleToObject(205,"voda2");
MoveEmiter("voda2",907,193);
AddParticleToObject(206,"voda3");
MoveEmiter("voda3",419,157);
AddParticleToObject(207,"voda4");
MoveEmiter("voda4",83,193);
StartEmiter("voda4")
StartEmiter("voda3")
StartEmiter("voda2")
StartEmiter("voda1")
WaitRender();

		flags.poexal1= true;
		flags.poexal2= true;
		flags.poexal3= true;
		flags.poexal4= true;
function gameinput(sender,obj_id,attachedID)
	if SLevel==1.0 then return; end;
	if sender == 2 then
		RemoveFromMouse(object);
		MessageProc(sender,obj_id);
	return;end;	
--обработка плашки	
	 if (sender == 1  or sender==5) and not isTimes  and imagetex~=-1 then
			set_visible_object(obj.plashechka.id,false)
			set_visible_object(obj[imagetex].id,false)
			del_object_from_game(5654547)		
			gameinput(26,imageid)	
			
							
	end
	
	
	
	if sender == 41 then
	
	if obj_id ==obj.dragonfly.id then	
		StartAnimation( 5555555555,1,5 );
	return;end;
	
	RotateHandler(obj_id);		
	c("\n"..obj_id)
	if obj_id==106 then
	 if flags.poexal2 then
		set_pos_in_img(106,81,0,81,104)
		StartTravel(106,1,nil,nil,{"InstantiationOfLine",2,1024 ,33,289,33,70,false})
		flags.poexal2= false
		else
		set_pos_in_img(106,0,0,81,104)
		StartTravel(106,1,nil,nil,{"InstantiationOfLine",2,289,33,1024 ,33,70,false})
		flags.poexal2= true
		end;	
	end;
	if obj_id==107 then
	 if flags.poexal3 then
		set_pos_in_img(107,30,0,30,45)
		StartTravel(107,1,nil,nil,{"InstantiationOfLine",2,82,694,82,800,82,60,false})
		flags.poexal3= false
		else
		set_pos_in_img(107,0,0,30,45)
		StartTravel(107,1,nil,nil,{"InstantiationOfLine",2,800,82,694,82,60,false})
		flags.poexal3= true
		end;	
	end;	
	if obj_id==108 then
	 if flags.poexal4 then
		set_pos_in_img(108,60,0,60,26)
		StartTravel(108,1,nil,nil,{"InstantiationOfLine",2,766 ,113,96,113,80,false})
		flags.poexal4= false
		else
		set_pos_in_img(108,0,0,60,26)
		StartTravel(108,1,nil,nil,{"InstantiationOfLine",2,96,113,766 ,113,80,false})
		flags.poexal4= true
		end;	
	end;	
	return;end;	
--коллапс мусора
	if sender == 12 then
		if obj.shtangen.is_collapsed and obj.molotok.is_collapsed and obj.otvertka.is_collapsed and obj.truba.is_collapsed and obj.jest.is_collapsed and obj.rinda.is_collapsed and obj.ploskie.is_collapsed and
			obj.kusa4.is_collapsed and obj.lasti.is_collapsed and obj.mask.is_collapsed and obj.radio.is_collapsed and obj.kanistra.is_collapsed and
			obj.ballo.is_collapsed and obj.chaiki.is_collapsed and obj.kruger.is_collapsed then	
			flags.items_collected = true;
			flags.comics2 = true;		
			StartTimer(23232,1.5,"levelcomp")
			ClosePlushes()
			HideGlove()
			HideScaner()
			function levelcomp()
			
			
			LevelComplete()		
			
			end	
			AlternateTimer("SwitchSheet1",1000)					
		end;
	return; end;		
	
	if sender == 33 then		 
--кораблики на фоне		 
		if not flags.finish then
			flags.finish = false;
			ShowMenu(true);
			SwitchToSheet("re");
			c("\neeeeeeeeeeeeeeee\n")
			
		
			
			
		return end
	return;end;
	
	if sender==777 then
	--старт локации	
			if top_plush_id and  flags.comics1 then		
				StartTimer(43342,0.5,"conv15")
			function conv15()
				CreatePlashechka(79,"51","goodgirl")	
			end		
			
			ShowMenu(true)
			SwitchToSheet("re")
			flags.comics1=false;
			return;end
	if top_plush_id then		
		ShowMenu(true)
		end	
	
	end

	if sender == 100 then
	
		if flags.first_time_load then
			
			flags.first_time_load=false
			set_visible_object(obj.intro.id,true)
			
			flags.start_draw = false;
			speciale_action(4,obj.intro.id);
		return; end;	
		
		if flags.start_draw then
			flags.start_draw = false;		
		return; end;	
		-- First Comics --
	return; end;
	if sender == 8 then
		HideGlove();		
		HideScaner();
		HideRentgen()
		HideNvg();
	return end;
	
if sender == 1 then
--тыкаем на мусор
		if obj_id == obj.shtangen.id or obj_id == obj.molotok.id or obj_id == obj.otvertka.id or obj_id == obj.truba.id or obj_id == obj.jest.id or obj_id == obj.ploskie.id or obj_id == obj.rinda.id or
			obj_id == obj.kusa4.id or obj_id == obj.lasti.id or obj_id == obj.mask.id or obj_id == obj.radio.id or obj_id == obj.kanistra.id or
			obj_id == obj.ballo.id or obj_id == obj.chaiki.id or obj_id == obj.kruger.id then
			if scaner_on then
				CreatePlashechka(9999,"70","goodgirl")
			return;end;
			flags.items = flags.items + 1;
				CollapseObj(obj_id);
		if obj_id == obj.lasti.id then
			set_visible_object(100,false);
			flags.lasti= true;
		end;
		return; end;

return; end;
	
return; end; 
function SelectRandom()
local dist=-1;local a=-1;local b=-1;local v=100;local t=-1;local diag=-1;
local width = -1;local height = -1;local radius=1.2;
				if flags.items >= 15 then
		
	return end
	
	ok = false
	while not ok do
		help_id = GetRandomObject();
		for i,v in pairs(obj) do
			if v.id == help_id and not v.is_collapsed then
				ok = true
				x,y=GetObjectPosition(v.id);
				x1,y1=GetObjectPosition(obj.dragonfly.id);
				width,height = GetObjectSize(v.id)
				a= (x-x1); b= (y-y1);  dist= math.sqrt (a^2+b^2);				
		        t=dist/400;		
                r = (math.sqrt(width^2+height^2)*0.5);		
				
				if r<50 then	r=75;	radius=4;	end  -- при радиусе меньше 50 определяем время кружения и радиус стрекозы
				
				if r>50 and r <100 then	r=87 radius=2.5;  end  --при радиусе больше 50 и меньше 100
				
				if r>100 then 	r=100 	radius=0.75;  end  -- при радиусе больше 100
				
				StartBigTravel(obj.dragonfly.id, v.id, 0, t, r/90, t, 2 ,radius);
			return end
		end
	end
end;
