function MessageFromMenu(nCount,Param1)
-- if Param1==2000029 then
	-- CreateWindow(200,200,"8",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
			place[id]=1;
			playeffect("pclick");
			speciale_action(2,obj_id-12);			
			speciale_action(2,obj_id);
			on_place[id]=obj_id-12;
			SetObjectPosition(obj_id-12,xok,yok);	
			if on_place[id]==id then 
				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,"8",100,"messageinfo")
		end;		
	   BlockCursor(false);
	return;end;
	if sender==30 then
		setcurentleaf("albert_kab",17,1);
		DarkScreen(false)
		if flags.minicomplete7 then
		    StopEmiter("Kanc");
			Set_Cursor(16,3);
			speciale_action(2,114,true);
			setcolor(114,0,0,0,1,1);
			savegame(SaveLevel())
		return;end;
	return; end;
	
	if sender==36 then
	    if id==2100 then
		BlockCursor(false);
		clear_satelite_leaf("albert_kab");
		return;end;
	return;end;
	if sender==37 then
	   skipping=true;
	return;end;	
	if sender==10 then
		flags.minicomplete7=true;
		playeffect("miniC");
		StartTimer(2100,3);
		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,"8",100,"messageinfo")
		return;end;	 	
		if id>=1013 and id<=1024 then
		if obj_id==0  then
			add_to_mouse(id);
			mousepresed=true;
			obj_id=id;
			if obj_id==1013 then
			  obj_x=337
			  obj_y=569
			end;
			if obj_id==1014 then
			  obj_x=87
			  obj_y=521
			end;
			if obj_id==1015 then
			  obj_x=611
			  obj_y=481
			end;
			if obj_id==1016 then
			  obj_x=321
			  obj_y=490
			end;
			if obj_id==1017 then
			  obj_x=154
			  obj_y=327
			end;
			if obj_id==1018 then
			  obj_x=769
			  obj_y=341
			end;
			if obj_id==1019 then
			  obj_x=170
			  obj_y=495
			end;
			if obj_id==1020 then
			  obj_x=794
			  obj_y=471
			end;
			if obj_id==1021 then
			  obj_x=271
			  obj_y=505
			end;
			if obj_id==1022 then
			  obj_x=222
			  obj_y=507
			end;
			if obj_id==1023 then
			  obj_x=617
			  obj_y=547
			end;
			if obj_id==1024 then
			  obj_x=265
			  obj_y=509
			end;			
		return;end;
		return;end;
		if id>=1001 and id<=1012 and place[id]~=2 then
		if obj_id==0 then
			temp=id;
			for i=1001,1012,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+12);
		return;end;		
		return;end;	

		if id==5000 and skipping and obj_id==0 then
			if not flags.minicomplete7 then
				playeffect("skip");
				for i=1001,1012,1 do	
					SetAlfa(i,1,1,1);
				end;
				for i=1013,1024,1 do	
					SetAlfa(i,0,0,1);
				end;				
				SetObjectPosition(1001,650,131);	
				SetObjectPosition(1002,555,97);	
				SetObjectPosition(1003,358,92);	
				SetObjectPosition(1004,608,123);	
				SetObjectPosition(1005,307,92);	
				SetObjectPosition(1006,225,94 );	
				SetObjectPosition(1007,489,106);	
				SetObjectPosition(1008,408,107);	
				SetObjectPosition(1009,402,124);	
				SetObjectPosition(1010,326,159);	
				SetObjectPosition(1011,694,131);	
				SetObjectPosition(1012,671,131);	
				skipmini=true;
			return;end;            
		return;end; 
		
		if id==1000 and obj_id==0 then
			finish_mini_game(false);
			playeffect("close");
			DeleteResource("rm1_btn");
			DeleteResource("rm1_0003");
			DeleteResource("rm1_0004");
			DeleteResource("rm1_0005");
			DeleteResource("rm1_0006");
			DeleteResource("rm1_0007");
			DeleteResource("rm1_0008");
			DeleteResource("rm1_0009");
			DeleteResource("rm1_0010");
			DeleteResource("rm1_0011");
			DeleteResource("rm1_0012");
			DeleteResource("rm1_0013");
			DeleteResource("rm1_0014");
			DeleteResource("rm1_0015");
			DeleteResource("rm1_0016");
			DeleteResource("rm1_0017");
			DeleteResource("rm1_0018");
			DeleteResource("rm1_0019");
			DeleteResource("rm1_0020");
			DeleteResource("rm1_0021");
			DeleteResource("rm1_0022");
			DeleteResource("rm1_0023");
			DeleteResource("rm1_0024");
			DeleteResource("rm1_0025");
			DeleteResource("rm1_0026");
			DeleteResource("rm1_0027");
			DeleteResource("rm1_0028");			
		    clear_satelite_leaf("albert_kab");			
		return;end;
		
	end;

	if sender==8129 then
		if skipmini then
			finish_mini_game(true);
		return;end;
		x_id=id;
		y_id=attachedID;	
		if mousepresed==true
		then		
		if obj_id>0 then
		    mousepresed=false;
			check_position(698,383,710,398,1001,x_id,y_id,650,131);
			check_position(597,280,615,408,1002,x_id,y_id,555,97);
			check_position(404,290,421,408,1003,x_id,y_id,358,92);
			check_position(645,310,679,400,1004,x_id,y_id,608,123);
			check_position(349,306,380,325,1005,x_id,y_id,307,92);
			check_position(264,305,296,326,1006,x_id,y_id,225,94 );
			check_position(503,357,581,376,1007,x_id,y_id,489,106);
			check_position(437,368,489,379,1008,x_id,y_id,408,107);
			check_position(431,382,484,395,1009,x_id,y_id,402,124);
			check_position(347,407,391,429,1010,x_id,y_id,326,159);
			check_position(741,385,761,401,1011,x_id,y_id,694,131);
			check_position(717,389,734,401,1012,x_id,y_id,671,131);
			RemoveFromMouse(obj_id);
			SetObjectPosition(obj_id,obj_x,obj_y);	
			obj_id=0;
			error_pos=false
			for i=1001,1012 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; 
	
	-- if sender==6 then
	-- return;end;
	

end;
function mini_delete ()

end;