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


function mini_create ()
show_help_wnd=true;
			init_mini(1);
	create_mini(8128);
	--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,"2",100,"messageinfo")
		end;		
	   BlockCursor(false);
	return;end;
	if sender==30 then
		setcurentleaf("photolab",2,1);
		DarkScreen(false);
		DeleteElement("gr",102);	
		--ShowMenu(true);
		----Emitters(true);
		if flags.minicomplete1 then
		     StopEmiter("Svet2");
			flags.minitext3=true;
			speciale_action(2,1,true);
			Set_Cursor(1,2);
			Set_Cursor(14,3);	

		return;end;
		-- loadresource("data\\2\\1\\0001.png","a0102",102);
		-- addactivobjecttogame(102,"a0102",0,2000,"","");
		-- AddElement("gr",102);
		-- MoveObjectToTree(102);
	return; end;
	if sender==37 then
	   skipping=true;
	return;end;	

	if sender==10 then
		flags.minicomplete1=true;
		clear_satelite_leaf("photolab");
		playeffect("miniC");
	return; end;
	
	if sender==26 then
		if id==1 then
			error_game=false;
			for i=1,5,1 do
				if not spotOk[i] then 
					error_game=true 
				return;end;
			end;
			if not error_game then
				finish_mini_game(true);
			return;end;		
		return;end;
	return;end;
	
	
	if sender==8128 then
		if id>=373 and id<=605 and attachedID>=225 and attachedID<=448 then
		spot=false;
		if id>=SpotX1[1]+gloveX and id<=SpotX2[1]+gloveX and attachedID>=SpotY1[1]+gloveY and attachedID<=SpotY2[1]+gloveY then
		if not spotOk[1] then
			spot=true;
			spotOk[1]=true;
			CreateWindow(100,100,"216",1)
		return;end;				
		return;end;
		if id>=SpotX1[2]+gloveX and id<=SpotX2[2]+gloveX and attachedID>=SpotY1[2]+gloveY and attachedID<=SpotY2[2]+gloveY then
		if not spotOk[2] then
      		spot=true;
			spotOk[2]=true;
			CreateWindow(100,100,"217",1)
		return;end;
		return;end;
		if id>=SpotX1[3]+gloveX and id<=SpotX2[3]+gloveX and attachedID>=SpotY1[3]+gloveY and attachedID<=SpotY2[3]+gloveY then
		if not spotOk[3] then
			spot=true;
			spotOk[3]=true;
			CreateWindow(100,100,"218",1)
		return;end;			
		return;end;
		if id>=SpotX1[4]+gloveX and id<=SpotX2[4]+gloveX and attachedID>=SpotY1[4]+gloveY and attachedID<=SpotY2[4]+gloveY then
		if not spotOk[4] then
			spot=true;
			spotOk[4]=true;
			CreateWindow(100,100,"219",1)
		return;end;		
		return;end;
		if id>=SpotX1[5]+gloveX and id<=SpotX2[5]+gloveX and attachedID>=SpotY1[5]+gloveY and attachedID<=SpotY2[5]+gloveY then
		if not spotOk[5] then
			spot=true;
			spotOk[5]=true;
			CreateWindow(100,100,"220",1)
		return;end;			
		return;end;		
		-- rX=id-gloveX;
		-- rY=attachedID-gloveY;
		if id>=gloveX and id<=gloveX+702 and attachedID>=gloveY and attachedID<=gloveY+382 then		
			if not spot then
				BeginMoving(1003);
				add_to_mouse(1003);
				objectid=1003;
				mousepressed=true;
				speciale_action(4,1001);
				speciale_action(4,1002);
			return;end;		
		return;end;		
		return;end;	
	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,"2",100,"messageinfo") 
		return;end;
		
		if id==5000 and skipping and attachedID==-1 then
		playeffect("skip");
			if not flags.minicomplete1 then
				finish_mini_game(true);
			return;end;		
		return;end;	
		
		if id==1000  and  attachedID==-1 then
		playeffect("close");
			finish_mini_game(false);
			clear_satelite_leaf("photolab");
			DeleteResource("o2_btn");
			DeleteResource("o2_lens");
			DeleteResource("o2_bg1");
			DeleteResource("o2_glove");
			DeleteResource("o2_bg");			
		return;end;
		-- if id==1003 then
			-- if not spot then
				-- add_to_mouse(id);
				-- objectid=id;
				-- mousepressed=true;
			-- return;end;	
		-- return;end;
	return;end;
	
	if sender==8129 then
		if mousepressed then
			mousepressed=false;		
			RemoveFromMouse(objectid);
			-- gloveX=id-rX;
			-- gloveY=attachedID-rY;
			EndMoving(1003);
			--SetObjectPosition(objectid,gloveX,gloveY);		
			speciale_action(4,1001);
			speciale_action(4,1002);
		return;end;		
	return;end;		

	
end;	
function MessageFromMinigame(nCount,Param1,Param2)
		gloveX=Param1
		gloveY=Param2
	end;
function mini_delete ()

end;