
	 flags.bull0 =false;
	flags.bull1 =false;
	flags.bull2 =false;
	flags.bull3 =false;
	flags.bull4 =false;
	flags.bull5 =false;



function mini_create()
	init_mini(true);
	create_mini(8128);
end;


function gameinput(sender, obj_id, attachedID)
MiniInterfaceHandler( sender, obj_id );

if sender==33 then					
	CreateWindow(CWX,CWY,"666",13443,nil,100,230);			
return; end;


if sender==26 then
	RemoveWindow(8,2.8,"DestroyMyWindow")
end


if sender==10 then
	mini_start=false;
		BlockCursor(true)
		leafobj={2235}
		GetRenderTarget(2235,"rendertar2");	
		
		function rendertar2(tex_name,tex_id)
			FlipVertical(2235);
			SetAlfa(2235,0,1,0,"vasea3353523")
			SetObjectPosition(2235,0,-256);
			LeaveObjectsOnReder("leafobj");
			ClosePlushes();			
		return end
	plushes_were_closed = true;
	flags.mini_complete=true;
end;


if sender==30 then
	BlockCursor(false)
	if mini_start then
			StopAllEffects()
			setstatemenu()
			StopMusic()
			mini_start=false;
	return;end
	
	SetCurrentLeaf("gates",3,0);
	ReturnHiddenObjects()      
	DeleteRenderTarget(2234)  					 
	leafobj={}
	DeleteRenderTarget(2235)  					 
	leafobj={}		
	OpenPlushes()
	AfterBullAnim()		
	flags.bull=true
	Set_Cursor(700,3)
	StopEmiter("Highlight")
	flags.cango=true;
	flags.start=true;
	Set_Cursor(123,4)
end

if sender==777 then
	 clear_satelite_leaf("gates");	
end	
	
	if sender==1 then	

	
		MiniInterfaceHandler( 1, obj_id );	

		if obj_id >= 10000 and obj_id <= 10012 then		

			if obj_id == 10001 or obj_id == 10000 then
				playeffect("042")
				speciale_action(2,10000);
				speciale_action(2,10001);
				speciale_action(2,100)	
				speciale_action(2,1)					
				flags.bull0 = not flags.bull0;
			end;
			if obj_id == 10003 or obj_id == 10002 then
				playeffect("042")
				speciale_action(2,10002);
				speciale_action(2,10003);
				speciale_action(2,2);
				speciale_action(2,3);
				flags.bull1 = not flags.bull1;
			end;
			if obj_id == 10005 or obj_id == 10004 then
				playeffect("042")
				speciale_action(2,10004);
				speciale_action(2,10005);
				speciale_action(2,4);
				speciale_action(2,5);
				flags.bull2 = not flags.bull2;
			end;
			if obj_id == 10007 or obj_id == 10006 then
			playeffect("042")
				speciale_action(2,10006);
				speciale_action(2,10007);
				speciale_action(2,6);
				speciale_action(2,7);
				flags.bull3 = not flags.bull3;
			end;
			if obj_id == 10009 or obj_id == 10010 then
			playeffect("042")
				speciale_action(2,10010);
				speciale_action(2,10009);
				speciale_action(2,10);
				speciale_action(2,9);
				flags.bull4 = not flags.bull4;
			end;
			if obj_id == 10011 or obj_id == 10012 then
			playeffect("042")
				speciale_action(2,10012);
				speciale_action(2,10011);
				speciale_action(2,12);
				speciale_action(2,11);
				flags.bull5 = not flags.bull5
			end;				
			
			if  flags.bull0 and
				flags.bull1 and
				flags.bull2 and
				flags.bull3 and
				flags.bull4 and
				flags.bull5 then
				flags.bull = true;
				set_visible_object(701,false)
				set_visible_object(702,false)
				Set_Cursor(700,3)	
				finish_mini_game(true)					
				flags.mini_complete=true;
				else
					flags.bull = false;
					Set_Cursor(700,2)
			end;		
			
		end;		
		
		
		
		
		
		
		
		
	end  --sender 1

end
