function MessageFromMenu(nCount,Param1)
-- if Param1==2000029 then
	      -- if flags.mini_redwire and flags.mini_bluewire and flags.mini_fuel and flags.mini_trans then
			-- CreateWindow(200,200,"11",100,"messageinfo") 
		  -- return;end;
			-- CreateWindow(200,200,"8",100,"messageinfo") 
-- return;end;
showoptons(0);
return;end;

function mini_create ()
show_help_wnd=true;
			init_mini(1);
	create_mini(19,98,30,265,103,480,480,3022,2,5,0,-1);
--	finish_mini_game(true);
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==28 then
		-- if step==1 then
			-- RotateObject(1300,0,-90);
		-- return;end;
	-- return;end;
	-- if sender==7 then
		-- if step==1 then
		  -- MoveObjectY(1300,229,129,2);
		  -- step=2;
		-- return;end;	
	-- return;end;
	if sender==30 then
		setcurentleaf("cherdak",5,2);
		DarkScreen(false);
		if flags.minicomplete7 then
		   StopEmiter("RW")	
			-- if not flags.mini_redwire then
				-- DeleteElement("gr",348)
			-- end;
			-- if not flags.mini_bluewire then
				-- DeleteElement("gr",333)
			-- end;
			-- if not flags.mini_fuel then
				-- DeleteElement("gr",334)
			-- end;
			-- if not flags.mini_trans then
				-- DeleteElement("gr",346)
			-- end;			
			speciale_action(2,8);
			setcolor(8,0,0,0,1,1);
			Set_Cursor(38,3);
			DeleteElement("gr",304);
			DeleteElement("gr",305);
			DeleteElement("gr",333);
			DeleteElement("gr",334);
			DeleteElement("gr",346);
			DeleteElement("gr",348);	
			savegame(SaveLevel())
		return; end;
	return; end;
	
	if sender==36 then
	if id==2100 then
		BlockCursor(false);
		clear_satelite_leaf("cherdak");	
		return;end;
	return;end;
	if sender==37 then
	   skipping=true;
	return;end;	
	if sender==10 then
		flags.minicomplete7=true;
		playeffect("train");
		StartAnimation(1300,0,26)	
		StartTimer(2100,6);	
		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
	      if flags.mini_redwire and flags.mini_bluewire and flags.mini_fuel and flags.mini_trans then
			CreateWindow(200,200,"11",100,"messageinfo") 
		  return;end;
			CreateWindow(200,200,"8",100,"messageinfo") 
		return;end;		
	
		if id==5000 and skipping then
			if not flags.minicomplete7 then
				playeffect("skip");
				SkipMini();
			return;end;			
		return;end;			
		if id==1200 and attachedID==-1 then
			clear_satelite_leaf("cherdak");	
			finish_mini_game(false);
			playeffect("close");
			DeleteResource("m_channel");
			DeleteResource("m_0000"	);
			DeleteResource("m_0001"	);
			DeleteResource("m_0002"	);
			DeleteResource("m_0004"	);
			DeleteResource("m_0006"	);
			DeleteResource("m_0007"	);
			DeleteResource("m_0008"	);	
			DeleteResource("m_0009"	);
			DeleteResource("m_0010"	);
			DeleteResource("m_0011"	);
			DeleteResource("m_0012"	);
			DeleteResource("m_0013"	);
			DeleteResource("m_btn"		);			
			DeleteResource("train"		);	
		return;end;        
		
		if flags.mini_redwire and flags.mini_bluewire and flags.mini_fuel and flags.mini_trans then
			if id>=3022 and id<=3119 then
				playeffect("pclick");
			   check_mini_game_puzzle(id,7);
			return;end;	
		return;end;

		if id==1006 then
			if attachedID==348 then
				RemoveFromMouse(attachedID);
				DeleteElement("gr",attachedID);
				speciale_action(2,1002,true);
				flags.mini_redwire=true;	
				if flags.mini_redwire and flags.mini_bluewire and flags.mini_fuel and flags.mini_trans then
					AddSkipBtn(372,573)
				return;end;				
			return;end;
			if attachedID~=348 and attachedID>-1 then
				CreateWindow(100,100,"200");     
			return; end;
				CreateWindow(100,100,"201");  		 	
		return; end;
			
		if id==1007 then
			if attachedID==333 then
				RemoveFromMouse(attachedID);
				DeleteElement("gr",attachedID);
				speciale_action(2,1004,true);
				flags.mini_bluewire=true;
				if flags.mini_redwire and flags.mini_bluewire and flags.mini_fuel and flags.mini_trans then
					HideSkipBtn ()		
				return;end;						
			return;end;
			if attachedID~=333 and attachedID>-1 then
				CreateWindow(100,100,"200");     
			return; end;
				CreateWindow(100,100,"201");  		 	
		return;end

		if id==1010 then
			if attachedID==334 then
				RemoveFromMouse(attachedID);
				DeleteElement("gr",attachedID);
				speciale_action(2,1008,true);
				flags.mini_fuel=true;		
				if flags.mini_redwire and flags.mini_bluewire and flags.mini_fuel and flags.mini_trans then
					HideSkipBtn ()
					StartProgress(5001,30,true)					
				return;end;						
			return;end;
			if attachedID~=334 and attachedID>-1 then
				CreateWindow(100,100,"200");     
			return; end;
				CreateWindow(100,100,"201");  		 		
		return;end		

		if id==1013 then
			if attachedID==346 then
				RemoveFromMouse(attachedID);
				DeleteElement("gr",attachedID);
				speciale_action(2,1011,true);
				flags.mini_trans=true;	
				if flags.mini_redwire and flags.mini_bluewire and flags.mini_fuel and flags.mini_trans then
					HideSkipBtn ()			
				return;end;						
			return;end;
			if attachedID~=346 and attachedID>-1 then
				CreateWindow(100,100,"200");     
			return; end;
				CreateWindow(100,100,"201");  		 		
		return;end
		
	return;end;
	
	if sender==14 then
	    addObjectToMouse(id);
	return; end;	
end;


function mini_delete ()

end;