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

function mini_create ()
	show_help_wnd=true;
	init_mini(1);
	create_mini(28,1008,7,"54120",3,3,618,200);
    
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)

	if sender==26 then
		if id==100 then
		   mini_game_PlaySequence();		   
		   BlockCursor(true);
		return;end;
	return;end;
	

	if sender==16 then
	BlockCursor(false);
		if not help then
			help=true;
			CreateWindow(200,200,"5",100,"messageinfo")
		end;	
	   
	return;end;
	if sender==37 then
	   skipping=true;
	return;end;
	if sender==30 then
		setcurentleaf("kulisi",1,1);
		DarkScreen(false);
		-- BlockCursor(false);
		if flags.minicomplete3 then	
		    StopEmiter("Svet3");
			speciale_action(2,9,true);
			setcolor(9,0,0,0,1,1);
			--addparticlesistem("sharp_star","./particles/particle3.psi",9,true);
			Set_Cursor(30,3);
			savegame(SaveLevel())
		return; end;
	return; end;
	if sender==36 then
		if id==2101 then
		   	 mini_game_PlaySequence();
		--	 check_mini_game_Sequence(objectid,false);
			 
			 BlockCursor(true);
		return;end;
		if id==2100 then		
			BlockCursor(false);
		   clear_satelite_leaf("kulisi");
		return;end;
		if id==2102 then		   
			--check_mini_game_Sequence(objectid,false);
			BlockCursor(false);
			CreateWindow(100,100,"214",100)
		return;end;
		if id==2103 then		   
			check_mini_game_Sequence(objectid,false);

		return;end;		
	return;end;
	if sender==10 then
		flags.minicomplete3=true;
		playeffect("miniC");
		StartTimer(2100,1);
		BlockCursor(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,"5",100,"messageinfo") 
		return;end;	
		if id==1000 then
		   clear_satelite_leaf("kulisi");
		    playeffect("close");
		   finish_mini_game(false);
		   DeleteResource("mc_btn" );
		   DeleteResource("mc_0011");
		   DeleteResource("mc_0012");
		   DeleteResource("mc_0004");
		   DeleteResource("mc_0005");
		   DeleteResource("mc_0006");
		   DeleteResource("mc_0007");
		   DeleteResource("mc_0008");
		   DeleteResource("mc_0009");
		   DeleteResource("mc_0010");
		   DeleteResource("mc_0015");
		   DeleteResource("mc_0016");
		   DeleteResource("mc_0017");
		   DeleteResource("mc_0018");
		   DeleteResource("mc_0019");
		   DeleteResource("mc_0020");
		   DeleteResource("mc_0021");
		   DeleteResource("mc_0013");
		   DeleteResource("mc_0014");
		   DeleteResource("mc_0022");
		   DeleteResource("mc_0023");
		return;end;       
		
		if id==5000 and skipping then
		 playeffect("skip");
			if not flags.minicomplete3 then
				finish_mini_game(true);
			return;end;	
		return;end;
		
		if id>=1008 and id<=1014 then
			mousepressed=true;
			objectid=id;
			check_mini_game_Sequence(id,true);
		return;end;
	
	return;end;	
	
	if sender==6 then
		if mousepressed then
			--speciale_action(2,objectid);
			--speciale_action(2,objectid);
			mousepressed=false;
			check_mini_game_Sequence(objectid,false);
		return;end;
	return;end;
end;
function mini_delete ()

end;
function PlayResult(nCount,Param1)
  if Param1==536870922
    then
		BlockCursor(true);
	    StartTimer(2102,1);
		StartTimer(2103,0.2)
return;
    end;
  if Param1==536870923
    then
	    BlockCursor(true);
		StartTimer(2101,1);
		StartTimer(2103,0.2)
return;
    --  messagebox("Последовательность проиграна верно");
    end;
  if Param1==536870913
    then
     -- messagebox("Игра успешно завершена");
      return;
    end;
  if Param1==536870914
    then
    --  messagebox("Игра не завершена");
    end;
end;
function PlayingFinished(nCount)
BlockCursor(false);
end;