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

function check_keys()
	if flags.slot1 and flags.slot2 and flags.slot3 and flags.slot4 then
		finish_mini_game(false);
		init_mini(1);
		SetInitPos(1001,642,331,270);
		SetInitPos(1002,481,208,0);
		SetInitPos(1003,313,331,90);
		SetInitPos(1004,485,460,180);
		rotateTo(1001,90);
		rotateTo(1002,0);
		rotateTo(1003,270);
		rotateTo(1004,180);
		create_mini(19,4,10,188,81,847,574,1001,10,10,0,1000);
		flags.rotate=true;			
	return;end
end;

function mini_create ()
	show_help_wnd=true;
	init_mini(1);
	if not flags.rotate then			
		create_mini(8128);
	return;end;
			SetInitPos(1001,642,331,270);
		SetInitPos(1002,481,208,0);
		SetInitPos(1003,313,331,90);
		SetInitPos(1004,485,460,180);
		rotateTo(1001,90);
		rotateTo(1002,0);
		rotateTo(1003,270);
		rotateTo(1004,180);
	create_mini(19,4,10,188,81,847,574,1001,10,10,0,1000);
	--finish_mini_game(true);
	-- create_mini(19,4,10,188,81,847,574,1001,10,10,0,1000);
	--create_mini(19,4,10,188,81,847,574,1001,2,10,0,1000);
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)


	
	if sender==30 then	
	setcurentleaf("azart_room",3,1);
	DarkScreen(false);
		if 	flags.minicomplete2 then			
			StopEmiter("Door");
			speciale_action(2,52);
			speciale_action(2,48);
			speciale_action(2,47);
			Set_Cursor(52,1);
			DeleteElement("gr",110);
			DeleteElement("gr",111);
			DeleteElement("gr",112);
			DeleteElement("gr",113);
			savegame(SaveLevel())
		return; end;
	return; end;
	if sender==36 then
		if id==2100 then
		BlockCursor(false);
	    clear_satelite_leaf("azart_room");
		return;end;
	return;end;
	if sender==37 then
	   skipping=true;
	return;end;	
	if sender==10 then
		flags.minicomplete2=true;
		playeffect("miniC");
		StartTimer(2100,3);
		BlockCursor(true);
		--speciale_action(2,1002);
		-- speciale_action(2,1005);
		-- rotate=true
	
	return; end;

	if sender==16 then
		if not help then
			help=true;
			CreateWindow(200,200,"3",100,"messageinfo")
		end;	
	    BlockCursor(false);
		if id==1021 then
		   clear_satelite_leaf("azart_room");
		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
			CreateWindow(200,200,"3",100,"messageinfo") 
		return;end;	
		if id==5000 and skipping then
			playeffect("skip");
			if not flags.minicomplete2 then
				finish_mini_game(true);
				for i=110,113,1 do
					RemoveFromMouse(attachedID);
					DeleteElement("gr",attachedID);			
				end;
				for i=1001,1004,1 do
					SetAlfa(i,1,1);
					SetHotPoint(i,68,68);
				end;
				RotateObject(1001,0,90);
				RotateObject(1002,0,0);
				RotateObject(1003,0,270);
				RotateObject(1004,0,180);
			return;end;	
		return;end;			
		if id==1013 then
			finish_mini_game(false);
			DeleteResource("m_parts");
			DeleteResource("m_handle");
			DeleteResource("m_handleon");
			DeleteResource("m_btn");
			DeleteResource("m_hole");
			DeleteResource("m_red");
			DeleteResource("m_green");
			DeleteResource("m_yellow");
			DeleteResource("m_blue");
			DeleteResource("m_bg");
		    clear_satelite_leaf("azart_room");		
			playeffect("close");
			slot={}
			slot[1006]=false;
			slot[1007]=false;
			slot[1008]=false;
			slot[1009]=false;

			position={}
			position[1001]=1000;
			position[1002]=1000;
			position[1003]=1000;
			position[1004]=1000;			
		return;end;

		if flags.rotate then
			
			if id==1005 then
				speciale_action(2,1005);
				speciale_action(2,1021);
			return;end;
			
			if id>=1001 and id<=1004 then
				playeffect("KeyRotate")
				check_mini_game_puzzle(id,7);
			return;end;
		return;end;
		
		if id==1006 and attachedID==110 then
			speciale_action(2,1001);
			playeffect("KeyIns")
			flags.slot1=true
			check_keys();
			RemoveFromMouse(attachedID);
			DeleteElement("gr",attachedID);
		return;end;

		if id==1007 and attachedID==111 then
			speciale_action(2,1002);
			playeffect("KeyIns")
			flags.slot2=true
			check_keys();
			RemoveFromMouse(attachedID);
			DeleteElement("gr",attachedID);			
		return;end;
		
		if id==1008 and attachedID==112 then
			speciale_action(2,1003);
			playeffect("KeyIns")
			flags.slot3=true
			check_keys();
			RemoveFromMouse(attachedID);
			DeleteElement("gr",attachedID);			
		return;end;

		if id==1009 and attachedID==113 then
			speciale_action(2,1004);
			playeffect("KeyIns")
			flags.slot4=true
			check_keys();
			RemoveFromMouse(attachedID);
			DeleteElement("gr",attachedID);			
		return;end;
		
	return;end;


	
	if sender==14 then
	StopSheet=true;
	    addObjectToMouse(id);
	return; end;		
end;
function mini_delete ()

end;