function MessageFromMenu(nCount,Param1)
-- if Param1==2000029 then
	-- CreateWindow(200,200,"1",100,"messageinfo") 
-- return;end;
showoptons(0);
return;end;

function mini_create ()
	show_help_wnd=true;
--	init_mini(1);	
	flags.part=1;
	n=8;
	-- if flags.part>1 then
	-- for i=1,flags.part,1 do
      -- speciale_action(2,1000+2*flags.part-1);
      -- speciale_action(2,1000+2*flags.part);
      -- speciale_action(2,1010+flags.part);
		-- for i=1000+2*flags.part-1,1010,1 do
          -- SetRightPos(i,x[i],y[i]);
		-- end;			
	    -- flags.part=flags.part+1;
        -- n=n-2
	-- end;
	-- end;
        init_mini(1);
        create_mini(19,2,10,250,70,500,500,1000+2*flags.part-1,1,10,n,-1,true);


end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)


	
	if sender==16 then   
		BlockCursor(false);
		if not help then
			help=true;
			CreateWindow(200,200,"1",100,"messageinfo")
		end;			
	return;end;
	if sender==30 then
		setcurentleaf("arend_room",19,0);
		DarkScreen(false);
		if flags.minicomplete then
		    StopEmiter("Env");
			Set_Cursor(16,3);
			collaps_obj(28,0,0,0,0);
			setcolor(28,0,0,0,0.5,1);
			savegame(SaveLevel())
		return;end	
	return; end;
	if sender==10 then
		if flags.part<6 then
      speciale_action(2,1000+2*flags.part-1);
      speciale_action(2,1000+2*flags.part);
      speciale_action(2,1010+flags.part);
			for i=1000+2*flags.part-1,1010,1 do
          SetRightPos(i,x[i],y[i]);
      end;	
      if flags.part<5 then
        flags.part=flags.part+1;
        n=n-2
        init_mini(1);
        create_mini(19,2,10,250,70,500,500,1000+2*flags.part-1,1,10,n,-1,true);
		if skipgame then
			finish_mini_game(true)
		return;end
      return;end;
		end;
		playeffect("miniC");	
		flags.minicomplete=true;
	return; end;

	if sender==36 then
	if id==2100 then
		BlockCursor(false);
		clear_satelite_leaf("arend_room");
		return;end;
	return;end;
	if sender==37 then
	   skipping=true;
	return;end;	
	
	if pause_state then
		if sender==1 or sender==6 or sender==14 then
			pause_state=false;
			set_visible_object(11111,false);
		end;	
	return;end;		
	if sender==1 then
		if id==6000 then
			   CreateWindow(200,200,"1",100,"messageinfo")
		return;end;		
		if id==5000 and skipping and objectid==0 then
			if not flags.minicomplete then
				playeffect("skip");
				if flags.part<6 then
					skipgame=true;
					finish_mini_game(true);
					
				end;
			return;end;
		return;end;
		
		if id==1000 and objectid==0 then
			playeffect("close");
			clear_satelite_leaf("arend_room");
			finish_mini_game(false);
			DeleteResource("btn");
			DeleteResource("letter");
			DeleteResource("flags.parts");
			DeleteResource("bg");	
			DeleteResource("envelope1");			
			DeleteResource("envelope2");			
			DeleteResource("envelope3");			
			DeleteResource("envelope4");			
			DeleteResource("envelope5");			
			DeleteResource("envelope6");		
DeleteResource("parts");			
		return;end;        
		
		if id>=1001 and id<=1010 then --нажимаем на часть телеграммы
		--	messageboxi(id);
			add_to_mouse(id);
			mousepresed=true;
			objectid=id;
		return 0; end	

		if id==1016 then
			speciale_action(2,1017,true);
			StartTimer(2100,3);
			BlockCursor(true);
		return;end;
		
		-- if id==1017 then
			-- clear_satelite_leaf("arend_room");
		-- return;end;		
	return;end
	
	if sender == 6 --Отпустили левую кнопку мышки
	then		
		if mousepresed==true
		then
			playeffect("pclick");
			RemoveFromMouse(objectid);
			check_mini_game_puzzle(objectid);
			mousepresed=false;
			objectid=0;
		end
	return; end;	
end;
function mini_delete ()

end;