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

function check_position(x1,y1,x2,y2,id,x,y,xok,yok)
	if x>=x1 and x<=x2 and y>=y1 and y<=y2 then
		if place[id]==0 then
		
			if obj_id-8==id then 			
				place[id]=1;
				playeffect("pclick");
				speciale_action(2,obj_id-8);			
				speciale_action(2,obj_id);
				on_place[id]=obj_id-8;
				SetObjectPosition(obj_id-8,xok,yok)	
				place[id]=2;
				setcolor(id,0.5,0.5,0.5,1);
			end;							
		return;end
	
	return;end;
end;


function mini_create ()
	show_help_wnd=true;
	init_mini(1);
	create_mini(8128);

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


	
	if sender==16 then
		if not help then
			help=true;
			CreateWindow(200,200,"9",100,"messageinfo")
		end;	
	   BlockCursor(false);
	return;end;
	if sender==30 then
		setcurentleaf("anna_room",17,2);
		DarkScreen(false);
		if flags.minicomplete8 then
			StopEmiter("Mirror");
			collaps_obj(335,0,0,0,0);
			AddElement("gr",335);
			StartTimer(9999,2.5)
			setcolor(335,0,0,0,0.5,1);
			MoveObjectToTree(335); 
			Set_Cursor(42,3);
			savegame(SaveLevel())
		return;end;
	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 sender==10 then
		flags.minicomplete8=true;
		playeffect("miniC");
		speciale_action(2,1019,true)
		speciale_action(2,1020,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,"9",100,"messageinfo")
		return;end;		
		if id==1019 then
			StartTimer(2100,2);
			BlockCursor(true);
		return;end;
		if id>=1009 and id<=1016 then
		if obj_id==0 then
			add_to_mouse(id);
			mousepresed=true;
			obj_id=id;
			if obj_id==1009 then
			  obj_x=759
			  obj_y=422
			end;
			if obj_id==1010 then
			  obj_x=623
			  obj_y=439
			end;
			if obj_id==1011 then
			  obj_x=748
			  obj_y=442
			end;
			if obj_id==1012 then
			  obj_x=479
			  obj_y=445
			end;
			if obj_id==1013 then
			  obj_x=759
			  obj_y=276
			end;
			if obj_id==1014 then
			  obj_x=660
			  obj_y=376
			end;
			if obj_id==1015 then
			  obj_x=475
			  obj_y=493
			end;
			if obj_id==1016 then
			  obj_x=596
			  obj_y=388
			end;
			
		return;end;
		return;end;
		if id>=1001 and id<=1008  and place[id]~=2 then
		if obj_id==0 then
			temp=id;
			for i=1001,1008,1 do
				if on_place[i]==id then
					temp=i;
					on_place[i]=1000;
				end;
			end;
			place[temp]=0;	
			speciale_action(2,id);
			speciale_action(2,id+8);
		return;end;		
		return;end;	

		if id==5000 and skipping and obj_id==0 then
			if not flags.minicomplete8 then
			playeffect("skip");
			for i=1001,1008,1 do
				SetAlfa(i,1,1,1)
			end;
			for i=1009,1016,1 do
				SetAlfa(i,0,0,1)
			end;			
				SetObjectPosition(1001,294,122);	
				SetObjectPosition(1002,338,318);
				SetObjectPosition(1003,322,178);
				SetObjectPosition(1004,374,139);	
				SetObjectPosition(1005,261,244);
				SetObjectPosition(1006,180,295);	
				SetObjectPosition(1007,286,304);	
				SetObjectPosition(1008,378,285);		                            
				skipmini=true;    
				finish_mini_game(true);
			return;end;
		return;end;
		
		if id==1000 and obj_id==0 then
			finish_mini_game(false);
			playeffect("close");
			DeleteResource("wm1_btn"  );
			DeleteResource("wm1_0003" );
			DeleteResource("wm1_0004" );
			DeleteResource("wm1_0005" );
			DeleteResource("wm1_0006" );
			DeleteResource("wm1_0007" );
			DeleteResource("wm1_0008" );
			DeleteResource("wm1_0009" );
			DeleteResource("wm1_0010" );
			DeleteResource("wm1_0011" );
			DeleteResource("wm1_0012" );
			DeleteResource("wm1_0013" );
			DeleteResource("wm1_0014" );
			DeleteResource("wm1_0015" );
			DeleteResource("wm1_0016" );
			DeleteResource("wm1_0017" );
			DeleteResource("wm1_0018" );
			DeleteResource("wm1_music");
			DeleteResource("wm1_box"  );
			DeleteResource("wm1_bg"   );		
		    clear_satelite_leaf("anna_room");			
		return;end;
		
	end;

	if sender==8129 then
		x_id=id;
		y_id=attachedID;	
		if mousepresed==true
		then		
		if obj_id>0 then
		    mousepresed=false;
			check_position(294,177,370,243,1001,x_id,y_id,294,122);
			check_position(338,405,387,436,1002,x_id,y_id,338,318);
			check_position(320,236,457,301,1003,x_id,y_id,322,178);
			check_position(376,189,473,258,1004,x_id,y_id,374,139);
			check_position(260,308,312,361,1005,x_id,y_id,261,244);
			check_position(171,357,260,413,1006,x_id,y_id,180,295);
			check_position(323,321,362,416,1007,x_id,y_id,286,304);
			check_position(397,321,435,411,1008,x_id,y_id,378,285);
			RemoveFromMouse(obj_id);                      
			SetObjectPosition(obj_id,obj_x,obj_y);	
			obj_id=0;
			error_pos=false
			for i=1001,1008 do
				if on_place[i]~=i then
					error_pos=true;
				return;end;
			end;
			if not error_pos then
				finish_mini_game(true);
			end;
		return;end;  
		end	

	end; 			
end;
function mini_delete ()

end;