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

function CheckPhotos()
	if ingame[btemp1] and ingame[btemp2] then
	-- messageboxi(btemp1)
	-- messageboxi(btemp2)
	if btemp1==btemp2-4 then
		speciale_action(2,btemp1,true)
		speciale_action(2,btemp2,true)
		ingame[btemp1]=false
		ingame[btemp2]=false
		lostpict=lostpict-1;
		if lostpict==0 then
			finish_mini_game(true);
		end;
	end

	end;
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==30 then
		setcurentleaf("kab_direktor",3,0);
		DarkScreen(false);
		if flags.minicomplete1 then
			StopEmiter("Letter");
			speciale_action(2,100,true);
			setcolor(100,0,0,0,1,1);
			Set_Cursor(45,3);
			savegame(SaveLevel())
		return; end;		
	return; end;
	if sender==36 then
		if id==2100 then
		BlockCursor(false);
	   clear_satelite_leaf("kab_direktor");
	   return;end;
	return;end;
	if sender==10 then
		flags.minicomplete1=true;
		RotateObject(1017,0,-360);
		RotateObject(1018,0,360);
		playeffect("miniC");
		StartTimer(2100,2)
		BlockCursor(true);

	return; end;
	if sender==7 then
	   CheckPhotos()
	return;end;
	if sender==37 then
	   skipping=true;
	return;end;
	if sender==16 then
		if not help then
			help=true;
			CreateWindow(200,200,"2",100,"messageinfo")
		end;	
		BlockCursor(false);
	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,"2",100,"messageinfo") 
		return;end;		
		if id==5000 and skipping then
		playeffect("skip");
			if not flags.minicomplete1 then
				for i=1001,1008 do
				   if ingame[i] then
					   speciale_action(2,i,true)
				   end;
				end;
				finish_mini_game(true);
			return;end;		
		return;end;		
		if id==1000 then
		playeffect("close");
		    clear_satelite_leaf("kab_direktor");
			finish_mini_game(false);
			DeleteResource("am1_btn");
			DeleteResource("am1_photos");
			DeleteResource("am1_barrel1");
			DeleteResource("am1_barrel2");
			DeleteResource("am1_bg");
		return;end;
		
		if id==1018 then
			playeffect("Bar")
			initpos[id]=finalpos[id]
			finalpos[id]=finalpos[id]+90;
			RotateObject(id,initpos[id],finalpos[id],2);
			if finalpos[id]==360 then finalpos[id]=0 end;
			for i=1001,1004,1 do			
				initpos[i]=finalpos[i]
				finalpos[i]=finalpos[i]+90;
				RotateObject(i,initpos[i],finalpos[i],2);				
				if finalpos[i]==360 then finalpos[i]=0 end;
				if finalpos[i]==0 then
					btemp1=i;
				end;			
			end
		return;end;
		
		if id==1017 then
			playeffect("Bar")
			initpos[id]=finalpos[id]
			finalpos[id]=finalpos[id]-90;
			RotateObject(id,initpos[id],finalpos[id],2);	
			if finalpos[id]==0 then finalpos[id]=360 end;			
			for i=1005,1008,1 do
				initpos[i]=finalpos[i]
				finalpos[i]=finalpos[i]-90;		
				RotateObject(i,initpos[i],finalpos[i],2);
				if finalpos[i]==0 then finalpos[i]=360 end;
				if finalpos[i]==180 then
					btemp2=i;
				end;						
			end
			
		return;end;		
	return;end;
	
			
end;
function mini_delete ()

end;