local iStartId=1030;
local iObjId=0;
function MessageFromMenu(nCount,Param1)
-- if Param1==2000029 then
	-- CreateWindow(200,200,"4",100,"messageinfo") 
-- return;end;
showoptons(0);
return;end;


function mini_create ()
show_help_wnd=true;
			init_mini(1);
			create_mini(22,7,7,1,1,7,7,170,110,58,58,iStartId);
			
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)

	
	if sender==16 then
		if not help then
			help=true;
			CreateWindow(200,200,"4",100,"messageinfo")
		end;		
	   BlockCursor(false);

	return;end;

	if sender==30 then
		setcurentleaf("azart_room",3,1);
		DarkScreen(false);
		if flags.minicomplete3 then
		    StopEmiter("TableD");
			speciale_action(2,14,true);
			Set_Cursor(46,3);
			setcolor(14,0,0,0,1,1);
			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.minicomplete3=true;
		flags.minirun3=false;
		playeffect("miniC");
		StartTimer(2100,1)
		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
			CreateWindow(200,200,"4",100,"messageinfo") 
		return;end;		
		if id==5000 then
			playeffect("skip");
			if skipping then
			if not flags.minicomplete3 then
					BlockCursor(true);
					finish_mini_game(true);
			return;end;			
			return;end;		
		return;end;		
		if id==1013 then
			playeffect("close");
			finish_mini_game(false);
			clear_satelite_leaf("azart_room");
			DeleteResource("cm1_bg");
			DeleteResource("cm1_btn");
			DeleteResource("cm1_dices");
			DeleteResource("cm1_player");
			DeleteResource("cm1_dices_frames");
		return;end;
     if id>iStartId+2 and id<iStartId+15 and iObjId==0

      then
        if not flags.minicomplete3
          then
            iObjId=id;
			
            check_mini_game_BG1(true,id);
            return;
          end
      end;
  end;


	if sender==6 then
    if not flags.minicomplete3
      then
        check_mini_game_BG1(false,iObjId);
		iObjId=0;
        return;
      end
	return; end;	

end;
function StartAnimationHere(nCount)
  for i=iStartId+3,iStartId+14,1 do setcolor(i,1,1,1,0) end;
  speciale_action(2,1300);
	StartAnimation(1300);
	playeffect("Dices")
end;
function StopAnimationHere(nCount,Param1,Param2)
  PauseAnimation(1300,true);
  speciale_action(2,1300);
  setcolor(iStartId+3+Param1-1,1,1,1,1);
  setcolor(iStartId+3+Param2+6-1,1,1,1,1);
  speciale_action(4,iStartId+3+Param1-1);
  speciale_action(4,iStartId+3+Param2+6-1);
  iObjId=0;
end;