{

	myPopup

	accepttext
	backtext

	Init[ (s)
	{
		MenuBackground(182);

		AddStaticItem(26);
		AddStaticItem(26);
		AddStaticItem(26);
		AddStaticItem(26);
		AddStaticItem(26);
		AddStaticItem(26);
		AddMenuItem(76,"MenuSlave");
		AddStaticItem(26);
		AddMenuItem(112,"MenuHost");
		AddStaticItem(26);
		AddStaticItem(26);

		if( GetBluetoothStatus() )
		{
			AddMenuItem(472, "TurnOff");
		}
		else
		{
			AddMenuItem(473, "TurnOn");
		}
		AddStaticItem(26);
		AddStaticItem(496);
		AddStaticItem(GetBluetoothName(),false);

		myPopup=CreatePopupMenu(18,75,150,60);
		myPopup.AddItem(497);
		myPopup.AddItem(49,"TurnOnBT");
		myPopup.AddItem(50,"DoNotTurnOnBT");
		myPopup.SetSelectable(0,false);
		myPopup.SetVisible(false);
		myPopup.SetSelectedItem(1);
		myPopup.SetBackground();

		accepttext=AddFloatingTextJustify(530, 0, 195, false,32767);
                accepttext.SetFontNum(1);
		backtext=AddFloatingTextJustify(531, 176, 195, true,32767);
		backtext.SetFontNum(1);

		if( not GetBluetoothStatus() )
		{
			// do popup
			myPopup.SetVisible(true);

		}

	} ]

	HideAcceptBack[ (s)
	{
		accepttext.SetVisible(false);
		backtext.SetVisible(false);
	} ]

	ShowAcceptBack[ (s)
	{
		accepttext.SetVisible(true);
		backtext.SetVisible(true);
	} ]

	TurnOnBT[ (s)
	{
		SetBluetooth( true, true );
		myPopup.SetVisible( false );
		ClearMenu();
		Init();
	} ]

	DoNotTurnOnBT[ (s)
	{
		myPopup.SetVisible( false );
		OpenMenu("MainMenu");
	} ]

	TurnOff[ (s)
	{
		SetBluetooth( false );
		OpenMenu("MainMenu");
	} ]

	TurnOn[ (s)
	{
		SetBluetooth( true );
	} ]

	MenuSlave[ (s)
	{
		if (MPBluetoothInUse())
		{
			OpenMenu("BTUsed");
		}
		else
		{
			OpenMenu("JoinGameMenu");
			//OpenMenu("JoinGunChoice");
			//MultiplayerSlave();
		}
	} ]

	MenuHost[ (s)
	{
		if (MPBluetoothInUse())
		{
			OpenMenu("BTUsed");
		}
		else
		{
			HostOptions();
		}
	} ]

	MultiplayerBack[ (s)
	{
		OpenMenu("MainMenu");
	} ]

	OnRightSoftkey[ (s)
	{
		MultiplayerMenuBack();
	} ]

}