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


function mini_create ()
	show_help_wnd=true;
	init_mini(1);
	create_mini(2,5,5,131072,1,"",1036,1004,20,31,50,50);
	if flags.gamecomplete then
		finish_mini_game(true);
	return;end;
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)

	if sender==33 then
		BlockCursor(false);
	return;end;
	
	
	if sender==30 then
		setcurentleaf("gangster",7,0);
		DarkScreen(false);
		if not close then
		if flags.gamecomplete then
			
			-- flags.blank1=false;		
			-- flags.blank2=false;
			if flags.passkey1 then		
				collaps_obj(227,0,0,0,0);
				AddElement("gr",227);
				setcolor(227,0,0,0,0.5,1);
				MoveObjectToTree(227); 
				flags.ready1=true;
				flags.passkey1=false;
			end;	
			if flags.passkey2 then		
				collaps_obj(108,0,0,0,0);
				AddElement("gr",108);
				setcolor(108,0,0,0,0.5,1);
				MoveObjectToTree(108); 
				flags.ready2=true;
				flags.passkey2=false;
			end;	
			if 	flags.ready1 and flags.ready2 then
				Set_Cursor(6,3);
				StopEmiter("Ap");
				flags.minicomplete=true;
				savegame(SaveLevel())
			return;end;				
			DeleteResource("numbers");

			DeleteResource("indicator");	

			DeleteResource("btn");
			DeleteResource("bg");	
			DeleteResource("bg1");
			DeleteResource("bg2");
			DeleteResource("blank");
			DeleteResource("passkey");	
			DeleteResource("handle");
			DeleteResource("handle1");
			DeleteResource("handle2");
			DeleteResource("for_whisky");
			DeleteResource("for_blank");
		return;end;
		return;end;
	return;end;
		
	if sender==10 then
		playeffect("miniC");
		flags.gamecomplete=true;
	return; end;
	if sender==37 then
	   skipping=true;
	return;end;
	if sender==16 then
		if (not help) and (not flags.gamecomplete) then
			help=true;
			CreateWindow(200,200,"1",100,"messageinfo")
		end;	
		BlockCursor(false);

		if id==1032 then
			speciale_action(2,1033,true);
			speciale_action(2,1032,true);	
			BlockCursor(true);
		return;end;
	
		if id==1046 then
			speciale_action(2,1033,true);
			speciale_action(2,1046,true);	
			BlockCursor(true);
		return;end;	
	return;end;

	if sender==36 then
		if id==2100 then
		BlockCursor(false);
		clear_satelite_leaf("gangster");
		return;end;
	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.gamecomplete then
				CreateWindow(200,200,"7",100,"messageinfo") 
				return;end;
				CreateWindow(200,200,"1",100,"messageinfo") 
		return;end;	
		
			if id==5000 and skipping then
			if not flags.gamecomplete then
				BlockCursor(true);
				playeffect("skip");
				finish_mini_game(true);
				speciale_action(2,1033,true);
				speciale_action(2,1032,true);	
				if (flags.blank1 or flags.blank2) and not flags.readypasskey  then  
					flags.readypasskey=true;
					speciale_action(2,1034,true);
					speciale_action(2,1035,true);		
				end;					
				HideSkipBtn ()	
			return;end;	
			return;end;
			
			if id==1034 then

					if flags.blank1 then
						flags.readypasskey=false;
					   flags.passkey1=true;
					   flags.blank1=false;
					   StartTimer(2100,1)	
						BlockCursor(true);					   
					return;end;
					if flags.blank2 then
						flags.readypasskey=false;
						flags.passkey2=true;
						flags.blank2=false;
						StartTimer(2100,1)
						BlockCursor(true);
					return;end;
			return;end;
				
			if id==1041 and attachedID==-1 then
			    playeffect("close");
				close=true;
               	clear_satelite_leaf("gangster");
				if not flags.gamecomplete then
					finish_mini_game(false);
				end;
				
				DeleteResource("numbers");

				DeleteResource("indicator");	

				DeleteResource("btn");
				DeleteResource("bg");	
				DeleteResource("bg1");
				DeleteResource("bg2");
				DeleteResource("blank");
				DeleteResource("passkey");	
				DeleteResource("handle");
				DeleteResource("handle1");
				DeleteResource("handle2");
				DeleteResource("for_whisky");
				DeleteResource("for_blank");					
			return;end;			

	
		if id==1044 then
		if not flags.whisky then
			if attachedID==236  then		
				RemoveFromMouse(attachedID);
				DeleteElement("gr",attachedID);
				-- speciale_action(2,10,true,2)
				flags.whisky=true;
				HideSkipBtn ()	
				StartProgress(5001,30,true)
				for i=1051,1060,1 do
				speciale_action(2,i);
				end;
				for i=1011,1020,1 do
				speciale_action(2,i);
				end;				
				
				-- for i=1001,1010,1 do
					-- speciale_action(2,i,true)
				-- end;
				-- for i=1011,1020,1 do
					-- speciale_action(2,i,true)
				-- end;
			 return;end;		
			 if (attachedID>-1) and (attachedID~=260) then
				CreateWindow(100,100,"200");
			 return;end;
			 if (attachedID==-1)  then
				CreateWindow(100,100,"202");
			 return;end;			
		return;end;	 
		return;end;

		if id==1042 then
			if attachedID==260 then		
				RemoveFromMouse(attachedID);
				DeleteElement("gr",attachedID);
				speciale_action(2,1035,true);
				BlockCursor(true);
				flags.blank1=true;
				flags.blank2=false;
			 return;end;		
			if attachedID==261 then		
				RemoveFromMouse(attachedID);
				DeleteElement("gr",attachedID);
				speciale_action(2,1035,true);
				BlockCursor(true);
				flags.blank2=true;
				flags.blank1=false;
			 return;end;				 
			 if (attachedID>-1) and (attachedID~=260) and (attachedID~=261) then
				CreateWindow(100,100,"200");
			 return;end;
			 if (attachedID==-1)  then
				CreateWindow(100,100,"201");
			 return;end;				
		return;end;
		
	if flags.whisky then		
			if id==1033 then	
				playeffect("mech1");
				if flags.gamecomplete then	
					BlockCursor(true);
					speciale_action(2,1033,true)		
					speciale_action(2,1032,true);										
					if (flags.blank1 or flags.blank2) and not flags.readypasskey then  					
						speciale_action(2,1034,true);
						speciale_action(2,1035,true);
						flags.readypasskey=true;						
					return;end;					
				return;end;
			speciale_action(2,1033,true);
			speciale_action(2,1046,true);	
			check_mini_game_zamok(1036,0,4);
			return;end;
			if not flags.gamecomplete then
			if id == 1011
			then
					  playeffect("safe");
					  check_mini_game_zamok(1036,0,1);
			elseif  id == 1016
			then
					playeffect("safe");
					  check_mini_game_zamok(1036,0,2);				  
			elseif id == 1012
			then
					  playeffect("safe");
					  check_mini_game_zamok(1037,1,1);
			elseif  id == 1017
			then
					playeffect("safe");
					  check_mini_game_zamok(1037,1,2);			
			elseif id == 1013
			then
					  playeffect("safe");
					  check_mini_game_zamok(1038,2,1);
			elseif  id == 1018
			then
					playeffect("safe");
					  check_mini_game_zamok(1038,2,2);		
			elseif id == 1014
			then
					  playeffect("safe");
					  check_mini_game_zamok(1039,3,1);
			elseif  id == 1019
			then
					playeffect("safe");
					  check_mini_game_zamok(1039,3,2);		
			elseif id == 1015
			then
					playeffect("safe");
					  check_mini_game_zamok(1040,4,1);
			elseif  id == 1020
			then
					playeffect("safe");
					  check_mini_game_zamok(1040,4,2);		
			return;end;
		return;end;
	return;end;
		CreateWindow(100,100,"202");
	return;end;
	
	
	if sender==14 then
	    addObjectToMouse(id);
	return; end;	

	
end;
function mini_delete ()

end;