useGrafikpfad = 'images/ae/grafikpack-full';

var I18N = {
	'wordTable' : {
		'noObjInFrontOfAds' : 'Bitte die das Objekt nicht vor die Werbung schieben - auch DL braucht Werbung :/',
		'tavernTableEmpty' : 'Tisch {0} ist unbesetzt!',
		'tavernTableInfo' : 'Tischinfo',
		'tavernTableWithId' : 'Tisch {0}',
  		'DECIMAL_POINT' : ',',
  		'THOUSANDS_SEP' : '',
  		'SECOND' : ['ثانية', 'ثواني'],
  		'MINUTE' : ['دقيقة', 'دقائق'],
  		'HOUR' : ['ساعة', 'ساعات'],
  		'DAY' : ['يوم', 'ايام'],
  		'ABORT' : 'الغاء',
  		'AREANAME_0' : 'محيطات',
  		'AREANAME_7' : 'غابة الهمسات',
  		'AREANAME_8' : 'القاصة',
  		'AREANAME_9' : 'نادور نو',
  		'AREANAME_10' : 'ليخترهان',
  		'AREANAME_11' : 'وديان الزمرد',
  		'AREANAME_12' : 'اراضي داماكرا',
  		'AREANAME_13' : 'مدريا',
  		'AREANAME_14' : 'صحراء سن',
  		'AREANAME_15' : 'وادي الزجاج',
  		'HIRE_PACK_QUESTION' : 'هل ترغب بتأجير فريق المرتزقة \'{0}\' فعلاً؟',
  		'JS_NO_MONSTERS_ON_FIELD' : 'لا يوجد وحوش',
  		'JS_MONSTER_DISPLAY_DEACTIVATED' : 'تعطيل مؤشر الوحوش',
  		'QUEUE_ENTRY_READY' : 'انتهى',
		'BUILDING_PLACEMENT_INFO' : 'ضعوا المبنى في المكان المناسب للبدء في عملية البناء. [color=tomato]. [/color] اذا اردتم توقيف عملية البناء يمكنكم اغلاق هذه النافذة.',
		'INFO_MENU_HH' : 'بناء مباني',
		'INFO_MENU_BIBO' : 'مكتبة',
		'INFO_MENU_TEMPEL' : 'مدرسة الحكماء',
		'INFO_MENU_HEXE' : 'مختبر',
		'INFO_MENU_KASERNE' : 'ثكنة',
		'INFO_MENU_FRIEDHOF' : 'مقبرة',
		'INFO_MENU_DRACHENHOF' : 'مغارة التنين',
		'INFO_MENU_SCHATTENPORTAL' : 'بوابة الظلال',
		'INFO_MENU_VERTEIDIGUNG' : 'دفاع',
		'INFO_MENU_MARKT' : 'سوق',
		'INFO_MENU_HANDEL' : 'تجارة',
		'INFO_MENU_WAPPEN' : 'شارات',
		'INFO_MENU_TRUPPEN' : 'جيوش',
		'INFO_MENU_EINHEITEN' : 'وحدات',
		'INFO_MENU_KARTE' : 'خارطة',
		'INFO_MENU_AREA' : 'مناطق',
		'INFO_MENU_GRUPPE' : 'عصبة',
		'INFO_MENU_KRIEG' : 'حروب',
		'INFO_MENU_TOPLIST1' : 'قائمة الاوائل 1',
		'INFO_MENU_TOPLIST2' : 'قائمة الاوائل 2',
		'INFO_MENU_TOPLISTG' : 'قائمة العصب الاوائل',
		'INFO_MENU_IGM' : 'رسائل',
		'INFO_MENU_HILFE' : 'مساعدة',
		'INFO_MENU_SONSTIGES' : 'متعدد',
		'INFO_MENU_TAVERN' : 'مقهى',
		'INFO_MENU_COMMITMENT' : 'INFO_MENU_COMMITMENT',
		'INFO_MENU_TOURNEY' : 'INFO_MENU_TOURNEY',
		'INFO_MENU_SETTLESHOP' : 'INFO_MENU_SETTLESHOP',
		'GTYPE_ANARCHIE_BONUS' : 'في حال هناك فَوْضَوِيَّة ستم توزيع رسائل العصب على جميع اعضاء العصبة (في اليوم 1 و 15 من كل شهر). , وسيتم ارسال رسائل معلومات عام للقائد الجديد.',
		'GTYPE_SCHATTENBRUT_BONUS' : 'سيتم رسائل العصبة في الساعة الرابعة والنصف الى اللاعب الاقوى (عدد السكان).',
		'GTYPE_RITUALISTEN_BONUS' : 'الاقوياء يهتمون جدا بالعمل. عندما تزيد نقاط العمل تزيد معها التجهيزات. سيتم توزيع هذه التجهيزات على اعضاء العصبة في تمام الساعة الرابعة والنصف.',
		'GTYPE_JAEGER_SAMMLER_BONUS' : 'لدى الصياد والجامع يحصل الواحد على احقية حكم العصبة التى لديها اكبر كمية من انتاج الموارد.',
		'MAX_TRADE_DIFF_X' : 'على قيم الاختلاف ان لا تزيد عن {0}%',
		'TRADE_DIFF_OKAY' : 'نسبة الموارد جيدة!',
		'ORE' : 'حديد',
		'GOLD' : 'الذهب',
		'WOOD' : 'خشب',
		'FOOD' : 'الغذاء',
		'SILVER' : 'فضة',
		'DURATION_UNTIL_ENDTIME' : '{0} حتى {1}',
		'ENTER_TEMPLATE_NAME' : 'ماهو اسم النموذج؟',
		'YES' : 'نعم',
		'NO' : 'كلا',
		'MONSTERFIELD_TYPE_0' : 'مختلط',
		'MONSTERFIELD_TYPE_1' : 'قتال عن قرب',
		'MONSTERFIELD_TYPE_2' : 'قتال عن بعد',
		'MONSTERFIELD_TYPE_3' : 'سحر المبارزة',
		'MONSTERFIELD_TYPE_4' : 'سحر الدعم',
		'MONSTERFIELD_CHALLENGE' : '(تحدي)',
		'SAVE_NOTES' : 'حفظ المفكرات',
		'CLOSE_NOTES' : 'اغلاق',
		'ITEM_COSTS_POPUP' : 'هذا السلاح يغير من قدرة الوحدة الى [b]{1} نقاط النقل[/b] ولكن لامتلاك هذا السلاح هناك حاجة لـ [b]{2} نقاط طاقة[/b]:\n\n[img]{3}/icons/20x20/erz.gif[/img][b] حديد:[/b] {4} - [img]{3}/icons/20x20/gold.gif[/img][b] ذهب:[/b] {5} - [img]{3}/icons/20x20/holz.gif[/img][b] Holz:[/b] {6} - [img]{3}/icons/20x20/nahrung_{7}.gif[/img][b] غذاء:[/b] {8} - [img]{3}/icons/20x20/silber.gif[/img][b] فضة:[/b] {9}',
		'DO_REPAIR' : 'تصليح',
		'REPAIR_MARKET_RES' : 'تنقصك الموارد التالية [b] للتصليح [/b]:',
		'HEAL_UNITS' : 'شفاء وحدات',
		'HEAL_MARKET_RES' : 'تنقصك الموارد التالية  [b]للشفاء [/b]:',
		'MISSING_RES' : 'الموارد الاولية الناقصة'
	},
	
	/**
	  * Format number according to the locale
	  *
	  * @param theNumber The number to be formatted
	  * @param decimalDigits The number of decimal digits can be passed to this functions, as it is not locale specific. Defaults to 0 decimal digits.
	  */
	'numberFormat' : function(theNumber, decimalDigits) {
		return(number_format(theNumber, decimalDigits, this.wordTable['DECIMAL_POINT'], this.wordTable['THOUSANDS_SEP']));
	},

	/**
	 * Format a duration according to the locale
	 *
	 * @param duration The duration to format
	 * @param showUnit (optional) If the unit shall be displayed, set this to true (default)
	 */
	 'durationFormat' : function(duration, showUnit) {
		if(duration < 60) {
		  multiplier = 1;
		  unitLangId = 'SECOND';
		} else if(duration < 3600) {
		  multiplier = 60;
		  unitLangId = 'MINUTE';
		} else if(duration < 86400) {
		  multiplier = 3600;
		  unitLangId = 'HOUR';
		} else {
		  multiplier = 86400;
		  unitLangId = 'DAY';
		}
		
		durationString = this.numberFormat(duration / multiplier, 1);
		if(durationString.indexOf(this.wordTable['DECIMAL_POINT']) != -1) { // If we have a fractionated number
			durationString = durationString.replace(/0+$/, '');						// Trim right zeroes
			if(durationString.substr(durationString.length - 1, 1) == this.wordTable['DECIMAL_POINT']) durationString = durationString.substr(0, durationString.length - 1);  // If, after trimming zeroes, the decimal point is the end of the string, remove it as well
		}
		return(durationString + (showUnit ? ' ' + this.pluralize(Math.round(duration / multiplier * 10) / 10, unitLangId) : ''));
	},
	
	/**
	  * Function to pluralize a given language object
	  *
	  * @param theNumber The number that we are seeking the plural form for
	  * @param langObjId The language object ID. This must refer to an array of objects inside this internationalization classes word table
	  */
	'pluralize' : function(theNumber, langObjId) {
		if(theNumber != 1) return(this.wordTable[langObjId][1]); // In german, everything with a count of 2 or more uses the plural
		return(this.wordTable[langObjId][0]);			// Otherwise return the singular
	},
	
	/**
	  * Returns a specific string
	  * In contrast to the PHP I18N function, this function is used rarely, only when JS strings have wildcards that must be replaced. Usually, the variables are accessed directly through the word table.
          *
	  * @param varName The variable name of the string
	  * @param params A number indexed array of values. The wildcard {0} in the string is replaced with the value at index 0 etc. If the array is empty, nothing is changed
	  */
	'getSpecificString' : function(varName, params) {
		var varVal = this.wordTable[varName];
		if(typeof(params) != 'undefined' && typeof(params.length) != 'undefined') {
			for(var i = 0, len = params.length; i < len; ++i) {
				var replacer = new RegExp('\\{' + String(i) + '\\}', 'g');
				varVal = varVal.replace(replacer, params[i]);
			}
		}
		return(varVal);
	}


}