/*****************************************************************************/

/*
 *      menus.h -- REALmagic Celeste Application
 *
 *      Copyright (C) 1999-2000 Sigma Designs
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*****************************************************************************/

#include "remote.h"
#include "bitmaps/font_name.h"
#include "bitmaps/menus/password.h"
#include "bitmaps/menus/controller.h"
#include "bitmaps/menus/dvd_menu_setup.h"
#include "bitmaps/menus/menu_button.h"
#include "bitmaps/menus/onscreen_menu.h"
#include "bitmaps/menus/audio_setup.h"
#include "bitmaps/menus/rating.h"
#include "bitmaps/menus/REALmagic_DVD.h"
#include "bitmaps/menus/spoken_language.h"
#include "bitmaps/menus/standard_fullscreen.h"
#include "bitmaps/menus/standard_letterbox.h"
#include "bitmaps/menus/subtitle.h"
#include "bitmaps/menus/widescreen_fullscreen.h"
#include "bitmaps/menus/widescreen_letterbox.h"
#include "bitmaps/menus/tv.h"

//some defines for the menus fonts
#define MAIN_MENU_SELECT_EXIT_FONT     _RMA_CharR12
#define MAIN_MENU_ITEMS_FONT           _RMA_CharR14
#define MAIN_MENU_HEADER_FONT          _RMA_CharR24
#define AR_MENU_CHOICES_FONT           _RMA_CharR12
#define AR_MENU_ITEMS_FONT             _RMA_CharR14
#define AR_MENU_HEADER_FONT            _RMA_CharR24
#define SUBMENU_ITEMS_FONT             _RMA_CharR14
#define SUBMENU_CHOICES_FONT           _RMA_CharR14
#define SUBMENU_HEADER_FONT            _RMA_CharR24
#define PASSWORD_MENU_TEXT_FONT        _RMA_CharR14
#define PASSWORD_MENU_INPUT_FONT       _RMA_12x24
#define CHOCE_SUBMENU_LIST_FONT        _RMA_CharR12
#define HIDDEN_CHOCE_SUBMENU_LIST_FONT _RMA_CharR12
#define HIDDEN_ITEMS_FONT              _RMA_CharR14
#define MENUS_BACK_BUTTON_FONT         _RMA_CharR12
#define TR_MENU_TEXT_FONT              _RMA_CharR14
#ifdef PRINCETON
	#define FP_MENU_TEXT_FONT            _RMA_CharR14
#endif

//some defines for the menus sizes
#define MENU_WINDOW_HEIGHT 350
#define MENU_WINDOW_WIDTH  500
#define LEFT_HEADER_INDENT 10
#define TOP_HEADER_INDENT  10
#define TEXT_HEADER_INDENT 90
#define BACK_BUTTON_ALIGNMENT_X_MIDDLE 250
#define BACK_BUTTON_ALIGNMENT_Y_BOTTOM 345
#define MAIN_MENU_ITEMS_TEXT_INDENT         100
#define MAIN_MENU_ITEMS_BMP_INDENT          15
#define MAIN_MENU_CNTR_BMP_POS_LEFT         300
#define MAIN_MENU_CNTR_BMP_POS_BOTTOM       350
#define MAIN_MENU_EXIT_BMP_POS_LEFT         400
#define MAIN_MENU_EXIT_BMP_POS_BOTTOM       342
#define MAIN_MENU_EXIT_CNTR_TEXT_POS_BOTTOM 284
#define AR_MENU_HEADERS_INDENT_RIGHT       150
#define AR_MENU_ITEMS_X_ALIGNMENT_MIDDLE   240
#define AR_MENU_ITEMS_WIDTH                130
#define AR_MENU_ITEMS_HEIGHT               80
#define AR_MENU_FIRST_ITEM_Y_ALIGNMENT_TOP 90
#define AR_MENU_ITEMS_BMP_Y_INDENT         5
#define AR_MENU_ITEMS_TEXT_Y_INDENT        2
#define SUBMENU_ITEMS_WIDTH                220
#define SUBMENU_ITEMS_HEIGHT               31
#define SUBMENU_FIRST_ITEM_Y_ALIGNMENT_TOP 80
#define SUBMENU_ITEMS_X_ALIGNMENT_LEFT     30
#define SUBMENU_ITEMS_TEXT_X_ALIGNMENT     50
#define SUBMENU_LIST_MAX_WIDTH             MENU_WINDOW_WIDTH - SUBMENU_ITEMS_WIDTH - SUBMENU_ITEMS_X_ALIGNMENT_LEFT - SUBMENU_ITEMS_TEXT_X_ALIGNMENT
#define SUBMENU_LIST_MAX_HEIGHT            MENU_WINDOW_HEIGHT - SUBMENU_FIRST_ITEM_Y_ALIGNMENT_TOP
#define PASSWORD_MENU_WINDOW_HEIGHT           100
#define PASSWORD_MENU_WINDOW_WIDTH            300
#define PASSWORD_MENU_PASSWORD_FIELD_Y_INDENT 40
#define PASSWORD_MENU_TEXT_Y_INDENT           5
#define ENTER_PASSWORD_MENU_PASSWORD_FIELD_Y_INDENT 17
#define NEW_PASSWORD_MENU_WINDOW_HEIGHT 140
#define NEW_PASSWORD_MENU_WINDOW_WIDTH  270
#define NEW_PASSWORD_MENU_Y_OFFSET      18
#define CHANGE_PASSWORD_MENU_Y_OFFSET      17
#define CHANGE_PASSWORD_MENU_WINDOW_HEIGHT 100
#define CHANGE_PASSWORD_MENU_WINDOW_WIDTH  380
#define NEW_CHANGE_PASSWORD_MENU_X_INDENT 10
#define NEW_CHANGE_PASSWORD_MENU_Y_INDENT 18
#define HIDDEN_MENU_WINDOW_HEIGHT    140
#define HIDDEN_MENU_WINDOW_WIDTH     200
#define HIDDEN_MENU_ITEMS_WIDTH      112
#define HIDDEN_MENU_ITEMS_HEIGHT     30
#define HIDDEN_MENU_ITEMS_INDENT_X   10
#define HIDDEN_MENU_ITEMS_INDENT_TOP 12
#define HIDDEN_MENU_ITEMS_OFFSET     10
#define HIDDEN_MENU_TEXT_INDENT_X    15
#define HIDDEN_MENU_TEXT_INDENT_TOP  15
#define HIDDEN_MENU_TEXT_OFFSET      17
#define TR_MENU_WINDOW_WIDTH             200
#define TR_MENU_WINDOW_HEIGHT            118
#define TR_MENU_TEXT_OFFSET              0
#define TR_MENU_TEXT_INDENT_VERT         24
#ifdef PRINCETON
	#define FP_MENU_WINDOW_WIDTH 149
	#define FP_MENU_WINDOW_HEIGHT 80
	#define FP_MENU_TEXT_OFFSET 0
	#define FP_MENU_TEXT_INDENT_VERT 14
	#define FP_MENU_SCALE_OFFSET_Y 50
	#define FP_MENU_SCALE_OFFSET_X 10
	#define FP_MENU_SCALE_GRADE 2
	#define FP_MENU_SCALE_HEIGHT 8
#endif
// menus information

typedef struct tagMI {
	OSD_WND wnd;
	BYTE rNeig;
	BYTE lNeig;
	BYTE uNeig;
	BYTE dNeig;
	BYTE value;
} mI;

typedef struct tagMenu {
	BYTE name;
	PBYTE bmp;
	int (*createBmp)(IRma *, PBYTE *);
	int prev; //index in the global list
	mI menuItemsList[13];
	int menuItemsNumber;
	int hliItemIndex;
} Menu;

typedef struct tagRgs {
	BYTE kInd;
	DWORD i;
	WORD arrVal[13];
} Rgs;


extern HDTV_PARAMS Hdtv_Params[];
extern HDTV_PARAMS Hdtv_Params_Init;
extern int aptID;
extern int osdtID;
extern DWORD g_OutputMode;

BYTE lEng[8] = "ENGLISH";
BYTE lFre[7] = "FRENCH";
BYTE lSpa[8] = "SPANISH";
BYTE lIta[8] = "ITALIAN";
BYTE lGer[7] = "GERMAN";
BYTE lDut[6] = "DUTCH";
BYTE lPor[11] = "PORTUGUESE";
BYTE lChi[8] = "CHINESE";
BYTE lJap[9] = "JAPANESE";
BYTE lOth[7] = "OTHERS";
BYTE lOri[9] = "ORIGINAL";
BYTE lAuf[13] = "AUDIO FOLLOW";
BYTE vNTSCTV[8] = "NTSC TV";
BYTE vPALTV[7] = "PAL TV";
BYTE vMultisystemTV[15] = "MULTISYSTEM TV";
BYTE v480x96[18] = "1440x480 @ 96 FPS";
BYTE v480x120[19] = "1440x480 @ 120 FPS";
BYTE v480x60[18] = "2160x480 @ 60 FPS";
BYTE v480x72[18] = "1080x480 @ 72 FPS";
BYTE v720x96[17] = "720x720 @ 96 FPS";
BYTE v720x72[18] = "1440x720 @ 72 FPS";
BYTE v720x60[18] = "2160x720 @ 60 FPS";
BYTE v960x72[17] = "720x960 @ 72 FPS";
BYTE v960x60[18] = "1440x960 @ 60 FPS";
BYTE vAr4x3P[13] = "4:3 PAN&SCAN";
BYTE vAr4x3L[14] = "4:3 LETTERBOX";
BYTE vAr16x9On[13] = "16:9 ZOOM ON";
BYTE vAr16x9Off[14] = "16:9 ZOOM OFF";
BYTE vOff[4] = "OFF";
BYTE vOn[3] = "ON";
BYTE vChange[7] = "CHANGE";
#ifdef PRINCETON
BYTE vContr[9] = "CONTRAST";
BYTE vBackLi[10] = "BACKLIGHT";
#endif
BYTE aAuto[5] = "AUTO";
BYTE aAnalog[7] = "ANALOG";
BYTE aDigital[8] = "DIGITAL";
BYTE pEight[3] = "8:";
BYTE pSeven[9] = "7: NC-17";
BYTE pSix[5] = "6: R";
BYTE pFive[3] = "5:";
BYTE pFour[9] = "4: PG-13";
BYTE pThree[6] = "3: PG";
BYTE pTwo[3] = "2:";
BYTE pOne[5] = "1: G";
BYTE pUsa[4] = "USA";

PBYTE videoMenuArr[7][12] = {
	{vNTSCTV, vPALTV, vMultisystemTV, v480x60, v480x72, v480x96, v480x120, v720x60, v720x72, v720x96, v960x60, v960x72},
	{vAr4x3P, vAr4x3L, vAr16x9On, vAr16x9Off, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
	{vOn, vOff, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
	{vOff, vOn, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
	{vOff, vOn, vChange, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
	{vOff, vOn, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
#ifdef PRINCETON
	,
	{vBackLi, vContr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
#endif
};

PBYTE langMenuArr[4][11] = {
	{lOri, lEng, lFre, lSpa, lIta, lGer, lDut, lPor, lChi, lJap, lOth},
	{lAuf, lEng, lFre, lSpa, lIta, lGer, lDut, lPor, lChi, lJap, lOth},
	{lEng, lFre, lSpa, lIta, lGer, lDut, lPor, lChi, lJap, lOth, NULL},
	{lEng, lFre, lSpa, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
};

PBYTE audioMenuArr[5][2] = {
	{aAnalog, aDigital},
	{vOff, aAuto},
	{vOff, vOn},
	{vOff, vOn}
};

PBYTE passwordMenuArr[2][9] = {
	{vOff, pEight, pSeven, pSix, pFive, pFour, pThree, pTwo, pOne},
	{pUsa, lOth, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
};

#define MAIN 0
#define SUBMENU 1
#define SUBMENU_CHOICE 2
#define PARENTAL_CONTROL_MENU 3
#define HIDDEN_MENU 4

#define LANG 0
#define VIDEO 1
#define AUDIO 2

#define PARENTAL_CONT 0
#define PASSWORD 1

int createMenu(int, INFO *);
int returnToPrevMenu(int menuInd, INFO *pInfo);
int bSelect(int menuInd, INFO *pInfo);
int right(int menuInd, INFO *pInfo);
int left(int menuInd, INFO *pInfo);
int up(int menuInd, INFO *pInfo);
int down(int menuInd, INFO *pInfo);
void hliMenuItem(int menuInd, int neighbour, IOsd *pIOsd);
int createMainMenu(IRma *, PBYTE *);
int createSubmenu(IRma *pIRma, PBYTE *bmp);
int createChoiceSubmenu(IRma *pIRma, PBYTE *bmp);
int createARSubmenu(IRma *pIRma, PBYTE *bmp);
void loadSettings(int menuInd, INFO *pInfo);
void storeValue(int menuInd, int meniItInd, BYTE value, INFO *pInfo, BOOL bSave);
PBYTE createMenuList(IRma *, PRMASIZE, PRMAFONT, RMACOLORINDEX, RMAALIGNMENT, PBYTE, int);
BOOL checkPassword(INFO *pInfo);
PBYTE createPasswordWindow(IRma *pIRma, BOOL err);
BOOL enterPassword(INFO *pInfo, BOOL cW);
PBYTE createChangePasswordWindow(IRma *pIRma, BOOL cW);
void hiddenMenu(INFO *pInfo);
PBYTE createTRMenu(IRma *pIRma);
BOOL testRes(INFO *pInfo, BYTE newVal);
#ifdef PRINCETON	
void changeFPSettings(INFO *pInfo, int index);
PBYTE createFPSettingsMenu(IRma *pIRma, int index);
#endif

Rgs g_regValues[11] = {
	{
		RMREG_AUDIO_LANGUAGECODE, 0x00010001,
		{0xffff,
		 RM_LANGUAGECODE_ORIGINAL,
		 RM_LANGUAGECODE_ENGLISH,
		 RM_LANGUAGECODE_FRENCH,
		 RM_LANGUAGECODE_SPANISH,
		 RM_LANGUAGECODE_ITALIAN,
		 RM_LANGUAGECODE_GERMAN,
		 RM_LANGUAGECODE_DUTCH,
		 RM_LANGUAGECODE_PORTUGUESE,
		 RM_LANGUAGECODE_CHINESE,
		 RM_LANGUAGECODE_JAPANESE,
		 RM_LANGUAGECODE_OTHERS,
		 0xffff}
	},
	{
		RMREG_SUBPICTURE_LANGUAGECODE, 0x00010002,
		{0xffff,
		 RM_LANGUAGECODE_AUDIOFOLLOW,
		 RM_LANGUAGECODE_ENGLISH,
		 RM_LANGUAGECODE_FRENCH,
		 RM_LANGUAGECODE_SPANISH,
		 RM_LANGUAGECODE_ITALIAN,
		 RM_LANGUAGECODE_GERMAN,
		 RM_LANGUAGECODE_DUTCH,
		 RM_LANGUAGECODE_PORTUGUESE,
		 RM_LANGUAGECODE_CHINESE,
		 RM_LANGUAGECODE_JAPANESE,
		 RM_LANGUAGECODE_OTHERS,
		 0xffff}
	},
	{
		RMREG_MENU_LANGUAGECODE, 0x00010003,
		{0xffff,
		 RM_LANGUAGECODE_ENGLISH,
		 RM_LANGUAGECODE_FRENCH,
		 RM_LANGUAGECODE_SPANISH,
		 RM_LANGUAGECODE_ITALIAN,
		 RM_LANGUAGECODE_GERMAN,
		 RM_LANGUAGECODE_DUTCH,
		 RM_LANGUAGECODE_PORTUGUESE,
		 RM_LANGUAGECODE_CHINESE,
		 RM_LANGUAGECODE_JAPANESE,
		 RM_LANGUAGECODE_OTHERS,
		 0xffff, 0xffff}
	},
	{
		RMREG_LANGUAGECODE, 0x00010004,
		{0xffff,
		 RM_LANGUAGECODE_ENGLISH,
		 RM_LANGUAGECODE_FRENCH,
		 RM_LANGUAGECODE_SPANISH,
		 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}
	},
	{
		RMREG_USER_ASPECT_RATIO, 0x00010102,
		{0xffff,
		 (ASPECT_RATIO_4_3 << 8) | (DISPLAY_MODE_PAN_SCAN), //0x0001
		 (ASPECT_RATIO_4_3 << 8) | (DISPLAY_MODE_LETTERBOX), //0x0002
		 (ASPECT_RATIO_16_9 << 8) | (DISPLAY_MODE_ZOOM_ON), //0x0303
		 (ASPECT_RATIO_16_9 << 8) | (DISPLAY_MODE_NORMAL_OR_WIDE), //0x0300
		 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}
	},
	{
		RMREG_HDTV_RES, 0x00010101,
		{0xffff,
		 HDTV_480P_60FPS,  //0x0200
		 HDTV_480P_60FPS,  //0x0200
		 HDTV_480P_60FPS,  //0x0200
		 HDTV_480P_60FPS,  //0x0200
		 HDTV_480P_72FPS,  //0x0201
		 HDTV_480P_96FPS,  //0x0202
		 HDTV_480P_120FPS, //0x0203
		 HDTV_720P_60FPS,  //0x0204
		 HDTV_720P_72FPS,  //0x0205
		 HDTV_720P_96FPS,  //0x0206
		 HDTV_960P_60FPS,  //0x0207
		 HDTV_960P_72FPS}  //0x0208
	},
	{
		RMREG_PARENTALCONTROL, 0x00030001,
		{0xffff,
		 RM_PARENTALCONTROL_OFF, //0x000f
		 RM_PARENTALCONTROL_LEVEL8, //0x0008
		 RM_PARENTALCONTROL_LEVEL7, //0x0007
		 RM_PARENTALCONTROL_LEVEL6, //0x0006
		 RM_PARENTALCONTROL_LEVEL5, //0x0005
		 RM_PARENTALCONTROL_LEVEL4, //0x0004
		 RM_PARENTALCONTROL_LEVEL3, //0x0003
		 RM_PARENTALCONTROL_LEVEL2, //0x0002
		 RM_PARENTALCONTROL_LEVEL1, //0x0001
		 0xffff, 0xffff, 0xffff}
	},
	{
		RMREG_COUNTRYCODE, 0x00030002,
		{0xffff,
		 RM_COUNTRYCODE_US,
		 RM_COUNTRYCODE_OTHERS,
		 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}
	},
	{
		RMREG_PASSW_STATE, 0x00010105,
		{0xffff,
		 RM_PASSWORD_OFF,
		 RM_PASSWORD_ON,
		 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}
	},
	{
		RMREG_AUTOPLAY, 0x00010103,
		{0xffff,
		 RM_AUTOPLAY_ON,
		 RM_AUTOPLAY_OFF,
		 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}
	},
	{
		RMREG_AUDIO_TYPE, 0x00010201,
		{0xffff,
		 RM_AUDIO_TYPE_ANALOG,
		 RM_AUDIO_TYPE_SPDIF,
		 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}
	}
};

BYTE g_settings[][3][13] = {
	{
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		(BYTE) NULL,
		(BYTE) NULL
	},
	{
		{0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
		{0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}
	},
	{
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		(BYTE) NULL,
		(BYTE) NULL
	},
	{
		{0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		(BYTE) NULL
	}
};


Menu g_menusDesc[] = {
	{
		0,
		NULL,
	  createMainMenu,
		-1,
		{	//menuItemsList
			{	//0
				{0, 0, 0, 0}, //OSD_WINDOW
				1, //right neighbour
				3, //left neighbour
				3, //up neighbour
				1, //down neighbour
				0
			},
			{	//1
				{5, 90, 270, 64}, //OSD_WINDOW
				2, //right neighbour
				0, //left neighbour
				0, //up neighbour
				2, //down neighbour
				0
			},
			{	//2
				{5, 154, 270, 64}, //OSD_WINDOW
				3, //right neighbour
				1, //left neighbour
				1, //up neighbour
				3, //down neighbour
				0
			},
			{	//3
				{5, 218, 270, 64}, //OSD_WINDOW
				0, //right neighbour
				2, //left neighbour
				2, //up neighbour
				0, //down neighbour
				0
			},
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL
		},
		4,
		0
	},

	{
		0,
		NULL,
	  createSubmenu,
		MAIN,
		{	//menuItemsList
			{	//0
				{0, 0, 0, 0}, //OSD_WINDOW
				1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				1, //down neighbour
				0
			},
			{	//1
				{30, 80, 220, 31}, //OSD_WINDOW
				2, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				2, //down neighbour
				1
			},
			{	//2
				{30, 110, 220, 31}, //OSD_WINDOW
				3, //right neighbour
				1, //left neighbour
				1, //up neighbour
				3, //down neighbour
				1
			},
			{	//3
				{30, 140, 220, 31}, //OSD_WINDOW
				4, //right neighbour
				2, //left neighbour
				2, //up neighbour
				4, //down neighbour
				1
			},
			{	//4
				{30, 170, 220, 31}, //OSD_WINDOW
				5, //right neighbour
				3, //left neighbour
				3, //up neighbour
				5, //down neighbour
				1
			},
			{	//5
				{30, 200, 220, 31}, //OSD_WINDOW
				6, //right neighbour
				4, //left neighbour
				4, //up neighbour
				6, //down neighbour
				1
			},
			{	//6
				{30, 230, 220, 31}, //OSD_WINDOW
				7, //right neighbour
				5, //left neighbour
				5, //up neighbour
				7, //down neighbour
				1
			},
			{	//7
				{30, 260, 220, 31}, //OSD_WINDOW
				1, //right neighbour
				6, //left neighbour
				6, //up neighbour
				1, //down neighbour
				1
			},
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL
		},
		7,
		0
	},

	{
		0,
		NULL,
	  createChoiceSubmenu,
		SUBMENU,
		{	//menuItemsList
			{	//0
				{0, 0, 0, 0}, //OSD_WINDOW
				1, //right neighbour
				1, //left neighbour
				1, //up neighbour
				1, //down neighbour
				0
			},
			{	//1
				{-1, -1, -1, -1}, //OSD_WINDOW
				2, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				2, //down neighbour
				0
			},
			{	//2
				{-1, -1, -1, -1}, //OSD_WINDOW
				3, //right neighbour
				1, //left neighbour
				1, //up neighbour
				3, //down neighbour
				0
			},
			{	//3
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				2, //left neighbour
				2, //up neighbour
				-1, //down neighbour
				0
			},
			{	//4
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//5
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//6
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//7
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//8
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//9
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//10
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//11
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			},
			{	//12
				{-1, -1, -1, -1}, //OSD_WINDOW
				-1, //right neighbour
				-1, //left neighbour
				-1, //up neighbour
				-1, //down neighbour
				0
			}
		},
		-1,
		0
	},

	{
		0,
		(BYTE) NULL,
	  createSubmenu,
		SUBMENU,
		{	//menuItemsList
			{	//0
				{0, 0, 0, 0}, //OSD_WINDOW
				1, //right neighbour
				2, //left neighbour
				2, //up neighbour
				1, //down neighbour
				0
			},
			{	//1
				{30, 170, 220, 31}, //OSD_WINDOW
				2, //right neighbour
				0, //left neighbour
				0, //up neighbour
				2, //down neighbour
				1
			},
			{	//2
				{30, 230, 220, 31}, //OSD_WINDOW
				0, //right neighbour
				1, //left neighbour
				1, //up neighbour
				0, //down neighbour
				1
			},
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL,
			(BYTE) NULL
		},
		2,
		0
	}
};

//int COsd__Write_c = 1;
float g_sw = 1.0f;
float g_sh = 1.0f;

DWORD g_Pass;
