local fFirstTime=true;

function MessageFromMenu(nCount,Param1)
if Param1==2000029 then
	-- if flags.minicomplete10  then
		-- CreateWindow(200,200,"209",100,"messageinfo") 
	-- return;end;
	-- CreateWindow(200,200,"11",100,"messageinfo") 
return;end;
showoptons(0);
return;end;

function mini_create ()
	show_help_wnd=true;
	if not flags.minicomplete10 then
	init_mini(1);
	create_mini(3,337,242,80,80,1001,4,2);
	end;
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)


	
	if sender==16 then
		if not help and not flags.minicomplete10 then
			help=true;
			CreateWindow(200,200,"11",100,"messageinfo")
		end;		
	   BlockCursor(false);
	return;end;
	if sender==30 then
		setcurentleaf("anna_room",17,2);
		DarkScreen(false);
		if flags.minicomplete10 and flags.mirror then
			Set_Cursor(39,3);
			StopEmiter("Diary");
			--CreateWindow(100,100,"210");
			collaps_obj(47,0,0,10,1);
			setcolor(47,0,0,0,0.5,1);	
			savegame(SaveLevel())
		return;end;
		--AddParticleToObject(47,"./particles/particle2.psi");
	return; end;
	
	if sender==10 then
		flags.minicomplete10=true;
		speciale_action(2,1018); 
		speciale_action(4,1018); 
		speciale_action(2,1019); 
		speciale_action(4,1019); 	
		playeffect("miniC");		
		--clear_satelite_leaf("anna_room");
		---speciale_action(2,2000);  
	return; end;

	-- if sender==36 then
		-- if id==2100 then
		-- BlockCursor(false);
		-- clear_satelite_leaf("anna_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
		if flags.minicomplete10  then
			CreateWindow(200,200,"209",100,"messageinfo") 
		return;end;
		CreateWindow(200,200,"11",100,"messageinfo") 
		return;end;		
	if id==5000 and skipping then
		if not flags.minicomplete10 then
			playeffect("skip");
			finish_mini_game(true);
			HideSkipBtn ()	
		return;end;
	return;end;
	
	if id==1000 then
		if not flags.minicomplete10 then
			playeffect("close");
			finish_mini_game(false);
		end;
		clear_satelite_leaf("anna_room");
		DeleteResource("am_bg");
		DeleteResource("am_parts");
		DeleteResource("am_btn");	
		DeleteResource("am_text_mirror");
		DeleteResource("am_text");
		DeleteResource("am_open_diary");		
	return; end;
	
	if id==1018 then
	if not flags.mirror then
		if attachedID==328 then
			RemoveFromMouse(328);
			DeleteElement("gr",328);		
			flags.mirror=true;
			speciale_action(2,1019); 
			speciale_action(2,1020); 
			speciale_action(4,1020); 

		return;end;
		if attachedID~=328 then
			CreateWindow(100,100,"209")
		return;end;
	return;end;
	return;end;
	
	if id==1020 then
			clear_satelite_leaf("anna_room");
	return;end;
	if id > 1000 and id < 1017 --нажимаем на монетку 
	then
		playeffect("boxes");
        check_mini_game_money_pation(id,fFirstTime);
        fFirstTime=not fFirstTime;
	end	
	return; end;	  
	
	if sender==14 then
	StopSheet=true;
		if id>0 then
			addObjectToMouse(id);
		return; end;
	return; end;
end;
function mini_delete ()

end;