static char *avamax_eng_default[] = {
	"On",				// 0
	"Off",
	"AutoReplay",
	"Shutdown Timer",
	"Show Battery",
	"Title",			// 5
	"Artist",
    "Album",
    "Year",
    "Comment",
	"Track",			// 10
	"Genre",
	NULL
};

char *avamax_eng[20];
char *MuteStr_eng[2];

static InitLangDef()
{
	int index =0 ;
	while (avamax_eng_default[index]) {
		avamax_eng[index] = (char *) malloc(64);
		strcpy(avamax_eng[index],avamax_eng_default[index]);
		index++;
	}
	MuteStr_eng[0] = (char *) malloc(32);
	MuteStr_eng[1] = (char *) malloc(32);
	strcpy(MuteStr_eng[0],"Mute");	
	strcpy(MuteStr_eng[1],"Mute ");	
}

static void ReadFromLangDef()
{
	InitLangDef();
    FILE *f = fopen("/tmp/lang.def","rt");
    if (f) {
        char t1[255];
        char t2[255];
		char buffer[512];
        fscanf(f,"%s %s\n",t1,t2);        
    	while (!feof(f)) {
			char *ptr;
        	buffer[0] = 0;
        	fgets(buffer,512,f);        
        	ptr = strstr(buffer,"#define");
        	if (ptr) {
            	char t1[16];
            	char t2[256];
            	char t3[256];
            	sscanf(buffer,"%s %s\n",t1,t2);
            	char *ptr1 = strchr(buffer,'"');
            	if (ptr1) {
                	strcpy(t3,ptr1+1);
                	char *ptr2 = strrchr(t3,'"');
                	if (ptr2)
                    	*ptr2 = 0;
            	}
				if (strcmp(t2,"MENU_ON_DISPLAY") == 0) {
					strcpy(avamax_eng[0],t3);
				} else if (strcmp(t2,"MENU_OFF_DISPLAY") == 0) {
					strcpy(avamax_eng[1],t3);
				} else if (strcmp(t2,"MENU_AUTOREPLAY_DISPLAY") == 0) {
					strcpy(avamax_eng[2],t3);
				} else if (strcmp(t2,"MENU_SHUTDOWN_TIMER_DISPLAY") == 0) {
					strcpy(avamax_eng[3],t3);
				} else if (strcmp(t2,"MENU_SHOW_BATTERY_STR") == 0) {
					strcpy(avamax_eng[4],t3);
				} else if (strcmp(t2,"COMMON_MUTE_STR") == 0) {
					strcpy(MuteStr_eng[0],t3);
					sprintf(MuteStr_eng[1],"%s ",t3);
				} 
			}
		}
        fclose(f);
    }    
}

