
if(!this.ResMgr) {
	this.ResMgr = new Object();
}

ResMgr ={
	currentLanguage	:	null,
	isReverse_lang : false,
}

ResMgr.initResource = function(){

	this.currentLanguage = parseInt($.sf.plugin('TV').GetLanguage());
	alert("##mini##***** ResMgr.initResource(" + this.currentLanguage + ") -> " + TV_LANGUAGE_CODE[this.currentLanguage]);

	if(TV_LANGUAGE_CODE[this.currentLanguage] == 'ar' || TV_LANGUAGE_CODE[this.currentLanguage] == 'fa' || TV_LANGUAGE_CODE[this.currentLanguage] == 'he' || TV_LANGUAGE_CODE[this.currentLanguage]== 'ur')
	{
		this.isReverse_lang = true;
	}
	else
	{
		this.isReverse_lang = false;
	}	
	
	alert("##mini##***** ResMgr.initResource -> is Reverse Lang : "+this.isReverse_lang);
}

ResMgr.GetCurLanguage = function(){

	return this.currentLanguage;
}

ResMgr.isReverseLanguage = function(){

	return this.isReverse_lang;
}

//for country list
//ISO 639-2
ResMgr.GetCurSkypeLanguageCode = function(){

	switch(this.currentLanguage) {
		case ENUM_TV_LANGUAGE.ENG:
		case ENUM_TV_LANGUAGE.ENG_US:
			return 'en';

		case ENUM_TV_LANGUAGE.KOR:
			return 'ko';

		case ENUM_TV_LANGUAGE.CHI:
			return 'zh-hans';

		case ENUM_TV_LANGUAGE.HKG:
		case ENUM_TV_LANGUAGE.TPE:
			return 'zh-hant';
			
		case ENUM_TV_LANGUAGE.FRA:
		case ENUM_TV_LANGUAGE.FRA_US:
			return 'fr';
			
		case ENUM_TV_LANGUAGE.DEU:
			return 'de';

		case ENUM_TV_LANGUAGE.SPA:
		case ENUM_TV_LANGUAGE.SPA_US:
			return 'es';

		case ENUM_TV_LANGUAGE.RUS:
			return 'ru';

		case ENUM_TV_LANGUAGE.ARA:
			return 'ar';

		case ENUM_TV_LANGUAGE.POR:
			return 'pt';
		
		case ENUM_TV_LANGUAGE.POR_US:
			return 'pt-br';
			
		case ENUM_TV_LANGUAGE.ITA:
			return 'it';			

		case ENUM_TV_LANGUAGE.SWE:
			return 'sv';

		case ENUM_TV_LANGUAGE.POL:
			return 'pl';
			
		case ENUM_TV_LANGUAGE.BUL:
			return 'bg';			

		case ENUM_TV_LANGUAGE.CRO:
			return 'cs';	

		case ENUM_TV_LANGUAGE.DAN:
			return 'da';

		case ENUM_TV_LANGUAGE.GRE:
			return 'el';

		case ENUM_TV_LANGUAGE.FIN:
			return 'fi';

		case ENUM_TV_LANGUAGE.HUN:
			return 'hu';

		case ENUM_TV_LANGUAGE.HEB:
			return 'he';

		case ENUM_TV_LANGUAGE.DUT:
			return 'nl';

		case ENUM_TV_LANGUAGE.NOR:
			return 'no';			

		case ENUM_TV_LANGUAGE.ROM:
			return 'ro';			

		case ENUM_TV_LANGUAGE.TUR:
			return 'tr';			

		case ENUM_TV_LANGUAGE.JPN:
			return 'ja';
					
		default: 
			return 'en';

	}

}

ResMgr.GetCurLicenseLanguageCode = function(){

	switch(this.currentLanguage) {

		case ENUM_TV_LANGUAGE.ENG:
			return 'en-gb';
		case ENUM_TV_LANGUAGE.ENG_US:
			return 'en-us';

		case ENUM_TV_LANGUAGE.KOR:
			return 'ko';

		case ENUM_TV_LANGUAGE.CHI:
			return 'zh-Hans';

		case ENUM_TV_LANGUAGE.HKG:
		case ENUM_TV_LANGUAGE.TPE:
			return 'zh-Hant';
			
		case ENUM_TV_LANGUAGE.FRA:
		case ENUM_TV_LANGUAGE.FRA_US:
			return 'fr';
			
		case ENUM_TV_LANGUAGE.DEU:
			return 'de';

		case ENUM_TV_LANGUAGE.SPA:
			return 'es-es';
		case ENUM_TV_LANGUAGE.SPA_US:
			return 'es';

		case ENUM_TV_LANGUAGE.RUS:
			return 'ru';

		case ENUM_TV_LANGUAGE.POR:
			return 'pt';
		
		case ENUM_TV_LANGUAGE.POR_US:
			return 'pt-br';
			
		case ENUM_TV_LANGUAGE.ITA:
			return 'it';			

		case ENUM_TV_LANGUAGE.POL:
			return 'pl';

		case ENUM_TV_LANGUAGE.CRO:
			return 'cs';	

		case ENUM_TV_LANGUAGE.DAN:
			return 'da';

		case ENUM_TV_LANGUAGE.FIN:
			return 'fi';

		case ENUM_TV_LANGUAGE.HUN:
			return 'hu';

		case ENUM_TV_LANGUAGE.DUT:
			return 'nl';

		case ENUM_TV_LANGUAGE.NOR:
			return 'no';				

		case ENUM_TV_LANGUAGE.TUR:
			return 'tr';			

		case ENUM_TV_LANGUAGE.JPN:
			return 'ja';
			
		case ENUM_TV_LANGUAGE.EST:
			return 'et';
					
		default: 
			return '';
	}
}





