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

function mini_create ()
		show_help_wnd=true;
		init_mini(1);
		-- create_mini(8128);
		-- finish_mini_game(true);
		create_mini(496,1007,3,0,-1,4,0,5,7,-1,-1,-1);		
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)



	if sender==16 then
		if not help then
			help=true;
			CreateWindow(200,200,"4",100,"messageinfo")
		end;	
	   BlockCursor(false);
	return;end;
	if sender==30 then
		setcurentleaf("kulisi",1,1);
		DarkScreen(false);
		if flags.minicomplete4 then
		    StopEmiter("Svet4");
			speciale_action(2,245,true);
			setcolor(245,0,0,0,1,1);
			--addparticlesistem("sharp_star","./particles/particle3.psi",245,true);
			Set_Cursor(7,3);
			savegame(SaveLevel())
		return;end;	
	return; end;
	if sender==36 then
		if id==2100 then
		   BlockCursor(false);
		   clear_satelite_leaf("kulisi");
	    return;end;
	return;end;	
	if sender==37 then
	   skipping=true;
	return;end;	
	if sender==10 then
		playeffect("miniC");
		flags.minicomplete4=true;
		StartTimer(2100,2);
		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,"4",100,"messageinfo") 
		return;end;	
		if attachedID==-1 then
			if id==1007 or id==1008 then
			if not mousepresed then
				add_to_mouse(id);
				mousepresed=true;
				objectid=id;
				return;end;
			return;end;
			if id==1000 then
				finish_mini_game(false);
				 playeffect("close");
				clear_satelite_leaf("kulisi");
				DeleteResource("dm_0000");
				DeleteResource("dm_0001");
				DeleteResource("dm_0002");
				DeleteResource("dm_0003");
				DeleteResource("dm_0004");
				DeleteResource("dm_0005");
				DeleteResource("dm_0006");
				DeleteResource("dm_0007");
				DeleteResource("dm_0008");
				DeleteResource("dm_0009");	
				DeleteResource("dm_0010");		
				DeleteResource("dm_1000");	
				DeleteResource("dm_1001");	
				DeleteResource("dm_btn");					
			return;end;
			if id==5000 and skipping then
			playeffect("skip");
				if not flags.minicomplete4 then
					finish_mini_game(true);
					set_pos_in_img(1008,0,210,196,210)
					set_pos_in_img(1005,5*31,0,29,30)
				return;end;		
			return;end;			
		return; end;  
	return;end;
	
	if sender == 6 --Отпустили левую кнопку мышки
	then		
		if flags.minicomplete4 then
		   clear_satelite_leaf("kulisi");
		return;end;
		if mousepresed==true
		then
			RemoveFromMouse(objectid);
			if objectid==1007 then
				SetObjectPosition(objectid,416,360);
			end;	
			if objectid==1008 then
				SetObjectPosition(objectid,235,360);
			end;	
			check_mini_game_PAS(objectid); 
			mousepresed=false;
			objectid=0;
		end
	return; end;
	
	
end;

function MessageFromMinigame(nCount,Param1,Param2,Param3,Param4,Param5,Param6)
	playeffect("sand");
	if Param2>=0 and Param2<=7 then
		if Param2==0 then
			if Param1==1008 then
				set_pos_in_img(1008,0,420,196,210)
				set_pos_in_img(1005,0,0,18,23)
			return;end
			set_pos_in_img(1007,0,210,197,210)
			set_pos_in_img(1003,0,0,18,23)
		end;
		if Param2>0 and Param2<7 then
			if Param1==1008 then
				set_pos_in_img(1008,0,210,196,210)
				set_pos_in_img(1005,Param2*18,0,18,23)
			return;end
			set_pos_in_img(1007,0,0,197,210)
			set_pos_in_img(1003,Param2*18,0,18,23)
		end;
		if Param2==7 then
			if Param1==1008 then
				set_pos_in_img(1008,0,0,196,210)
				set_pos_in_img(1005,Param2*18,0,18,23)
			return;end
		end;
	end;
	if Param4>=0 and Param4<=7 then
		if Param4==0 then
			if Param3==1008 then
				set_pos_in_img(1008,0,420,196,210)
				set_pos_in_img(1005,0,0,18,23)
			return;end
			set_pos_in_img(1007,0,210,197,210)
			set_pos_in_img(1003,0,0,18,23)
		end;
		if Param4>0 and Param4<7 then
			if Param3==1008 then
				set_pos_in_img(1008,0,210,196,210)
				set_pos_in_img(1005,Param4*18,0,18,23)
			return;end
			set_pos_in_img(1007,0,0,197,210)
			set_pos_in_img(1003,Param4*18,0,18,23)
		end;
		if Param4==7 then
			if Param3==1008 then
				set_pos_in_img(1008,0,0,196,210)
				set_pos_in_img(1005,Param4*18,0,18,23)
			return;end
		end;
	end;	
end;

function mini_delete ()

end;