DateTimeFormatInfo = function(){
	this._initialized = false;
	this._cultureID = ""; 
	this._cultureName = "";
	this._dayNames = null;	
	this._abbreviatedDayNames = null;
	this._monthNames = null;	
	this._abbreviatedMonthNames = null;	
	this._amDesignator = "";
	this._pmDesignator = "";
	this._calendarTwoDigitYearMax = 1999;
	this._timeSeparator = ":";
	this._patterns = new Object();
	
	this._parseRegExp = null;
}

DateTimeFormatInfo.prototype = {
	initialize: function(cultureID, cultureName, dayNames, abbreviatedDayNames, monthNames, abbreviatedMonthNames, amDesignator, pmDesignator, calendarTwoDigitYearMax, timeSeparator, patterns){
		this._initialized = true;
		if(!(typeof(cultureID) == "string" || cultureID instanceof String) || cultureID.length == 0) throw "cultureID is not defined!";
		this._cultureID = cultureID;
		this._cultureName = cultureName;
		this._dayNames = dayNames;
		this._abbreviatedDayNames = abbreviatedDayNames;
		this._monthNames = monthNames;
		this._abbreviatedMonthNames = abbreviatedMonthNames;
		this._amDesignator = amDesignator;
		this._pmDesignator = pmDesignator;
		this._calendarTwoDigitYearMax = calendarTwoDigitYearMax;
		this._timeSeparator = timeSeparator;
		if(patterns && typeof(patterns) == 'object'){
			this._patterns["shortDate"] = "shortDate" in patterns ? patterns["shortDate"] : "MM/dd/yyyy";
			this._patterns["longDate"] = "longDate" in patterns ? patterns["longDate"] : "dddd, dd MMMM yyyy";
			this._patterns["shortTime"] = "shortTime" in patterns ? patterns["shortTime"] : "HH:mm";
			this._patterns["longTime"] = "longTime" in patterns ? patterns["longTime"] : "HH:mm:ss";
			this._patterns["fullDateTime"] = "fullDateTime" in patterns ? patterns["fullDateTime"] : "dddd, dd MMMM yyyy HH:mm:ss";
			this._patterns["monthDay"] = "monthDay" in patterns ? patterns["monthDay"] : "MMMM dd";
			this._patterns["sortableDateTime"] = "sortableDateTime" in patterns ? patterns["sortableDateTime"] : "yyyy'-'MM'-'dd'T'HH':'mm':'ss";
			this._patterns["yearMonth"] = "yearMonth" in patterns ? patterns["yearMonth"] : "yyyy MMMM";
			this._patterns["invariantSortableDateTime"] = "invariantSortableDateTime" in patterns ? patterns["invariantSortableDateTime"] : "MM/dd/yyyy HH:mm:ss";					
		}	
	},
	getCultureName: function(){
		return this._cultureName; 
	},
	getDayNames: function(){
		return this._dayNames;
	},
	getAbbreviatedDayNames: function(){
		return this._abbreviatedDayNames;
	},
	getMonthNames: function(){
		return this._monthNames;
	},
	getAbbreviatedMonthNames: function(){
		return this._abbreviatedMonthNames;
	},
	getAMDesignator: function(){
		return this._amDesignator;
	},
	getPMDesignator: function(){
		return this._pmDesignator;
	},
	getCalendarTwoDigitYearMax: function(){
		return this._calendarTwoDigitYearMax;
	},
	getShortDatePattern: function(){
		return this._patterns["shortDate"];
	},
	getLongDatePattern: function(){
		return this._patterns["longDate"];
	},
	getShortTimePattern: function(){
		return this._patterns["shortTime"] ;
	},
	getLongTimePattern: function(){
		return this._patterns["longTime"];
	},	
	getFullDateTimePattern: function(){
		return this._patterns["fullDateTime"];
	},	
	getMonthDayPattern: function(){
		return this._patterns["monthDay"];
	},
	getSortableDateTimePattern: function(){
		return this._patterns["sortableDateTime"];
	},	
	getYearMonthPattern: function(){
		return this._patterns["yearMonth"];
	},
	getUniversalSortableDateTimePattern: function(){
		return this._patterns["invariantSortableDateTime"];
	},
    getUniversalSortableDatePattern: function(){
		return this._patterns["invariantSortableDate"];
	},
	getPatternsArray: function(){
		var result = new Array();
		result.push(this._patterns["sortableDateTime"]);
		result.push(this._patterns["fullDateTime"]);
		result.push(this._patterns["longTime"]);
		result.push(this._patterns["longDate"]);
		result.push(this._patterns["shortTime"]);
		result.push(this._patterns["shortDate"]);
		result.push(this._patterns["monthDay"]);
		result.push(this._patterns["yearMonth"]);
		result.push(this._patterns["invariantSortableDateTime"]);
		result.push(this._patterns["invariantSortableDate"]);			
		return result;
	},
	getTimeSeparator: function(){
		return this._timeSeparator;
	},
	getParseRegExp: function(format){
	    
		if(!this._parseRegExp) return null;
		return format in this._parseRegExp ? this._parseRegExp[format] : null;
	},
	setParseRegExp: function(format, regex){
		if(!this._parseRegExp)
			this._parseRegExp = new Object();
		this._parseRegExp[format] = regex;
	}
}

DateTimeFormatInfo._entries = null;
DateTimeFormatInfo.getEntry = function(cultureID){
	if(this._entries == null) return null;
	return cultureID in this._entries ? this._entries[cultureID] : null;
}
DateTimeFormatInfo.createEntry = function(cultureID, cultureName, dayNames, abbreviatedDayNames, monthNames, abbreviatedMonthNames, amDesignator, pmDesignator, calendarTwoDigitYearMax, timeSeparator, patterns){
	var entry = this.getEntry(cultureID);
	if(entry) throw "DateTimeFormatInfo '" + cultureID + "' already exists!";
	entry = new DateTimeFormatInfo();
	entry.initialize(cultureID, cultureName, dayNames, abbreviatedDayNames, monthNames, abbreviatedMonthNames, amDesignator, pmDesignator, timeSeparator, calendarTwoDigitYearMax, patterns);
	if(this._entries == null) this._entries = new Object();
	this._entries[cultureID] = entry;
	return entry;
}

LangHintCalendarInfo = function(){
	this._initialized = false;
	this._cultureID = ""; 
	this._cultureName = "";
	this.css_ver = "";
	this.title = "";
	this.date = "";
	this.prev_mon = "";
	this.next_mon = "";
	this.curr = "";
	this.curr_day = "";
	this.per_week = "";
	this.per_mon = "";
	this.per_year = "";
	this.close = "";
	this.month = "";
	this.year = "";
	this.time = "";
	this.time_hide = "";
	this.hour = "";
	this.minute = "";
	this.second = "";
	this.hour_title = "";
	this.minute_title = "";
	this.second_title = "";
	this.set_time = "";
	this.clear_time = "";
}


LangHintCalendarInfo.prototype = {
	initialize: function(cultureID, cultureName, css_ver, title, date, prev_mon, next_mon, curr, curr_day, per_week, per_mon, per_year, close, month, year, time, time_hide, hour, minute, second, hour_title, minute_title, second_title, set_time, clear_time){
		this._initialized = true;
		if(!(typeof(cultureID) == "string" || cultureID instanceof String) || cultureID.length == 0) throw "cultureID is not defined!";
		this._cultureID = cultureID;
		this._cultureName = cultureName;
		this.css_ver = css_ver;
		this.title = title;
		this.date = date;
		this.prev_mon = prev_mon;
		this.next_mon = next_mon;
		this.curr = curr;
		this.curr_day = curr_day;
		this.per_week = per_week;
		this.per_mon = per_mon;
		this.per_year = per_year;
		this.close = close;
		this.month = month;
		this.year = year;
		this.time = time;
		this.time_hide = time_hide;
		this.hour = hour;
		this.minute = minute;
		this.second = second;
		this.hour_title = hour_title;
		this.minute_title = minute_title;
		this.second_title = second_title;
		this.set_time = set_time;
		this.clear_time = clear_time;
	}
}

LangHintCalendarInfo._hintes = null;
LangHintCalendarInfo.getHint = function(cultureID){
	if(this._hintes == null) return null;
	return cultureID in this._hintes ? this._hintes[cultureID] : null;
}
LangHintCalendarInfo.createHint = function(cultureID, cultureName, css_ver, title, date, prev_mon, next_mon, curr, curr_day, per_week, per_mon, per_year, close, month, year, time, time_hide, hour, minute, second, hour_title, minute_title, second_title, set_time, clear_time){
	var Hint = this.getHint(cultureID);
	if(Hint) throw "LangHintCalendarInfo '" + cultureID + "' already exists!";
	Hint = new LangHintCalendarInfo();
	Hint.initialize(cultureID, cultureName, css_ver, title, date, prev_mon, next_mon, curr, curr_day, per_week, per_mon, per_year, close, month, year, time, time_hide, hour, minute, second, hour_title, minute_title, second_title, set_time, clear_time);
	if(this._hintes == null) this._hintes = new Object();
	this._hintes[cultureID] = Hint;
	return Hint;
}

DateTimeFormatInfo.createEntry("0", "", ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"], ["January","February","March","April","May","June","July","August","September","October","November","December",""], ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""], "AM", "PM", 2029, ":", {shortDate:"yyyy-MM-dd",longDate:"dd MMMM yyyy",shortTime:"HH:mm",longTime:"HH:mm:ss",fullDateTime:"dddd, dd MMMM yyyy HH:mm:ss",monthDay:"MMMM dd",sortableDateTime:"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss",yearMonth:"yyyy MMMM",invariantSortableDateTime:"MM/dd/yyyy hh:mm:ss"});
DateTimeFormatInfo.createEntry("1", "", ["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"], ["Вс","Пн","Вт","Ср","Чт","Пт","Сб"], ["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь",""], ["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек",""], "AM", "PM", 2029, ":", {shortDate:"yyyy-MM-dd",longDate:"dd MMMM yyyy",shortTime:"HH:mm",longTime:"HH:mm:ss",fullDateTime:"dddd, dd MMMM yyyy HH:mm:ss",monthDay:"MMMM dd",sortableDateTime:"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss",yearMonth:"yyyy MMMM",invariantSortableDateTime:"MM/dd/yyyy hh:mm:ss"});
var modNameMonth = new Array("Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря");

LangHintCalendarInfo.createHint("0", "", '1', 'Calendar', 'Insert date', 'Previous month', 'Next month', 'Go to current month', 'Insert the current date', 'Period: Week', 'Period: Month', 'Select year', 'Close', 'Select month', 'Select year', 'Show time', 'Hide time', 'h:', 'm:', 's:', 'Hours (00 - 23)', 'Minutes (00 - 59)', 'Seconds (00 - 59)', 'Set the current time (server)', 'Reset time' );
LangHintCalendarInfo.createHint("1", "", '1', 'Календарь', 'Вставить дату', 'Предыдущий месяц', 'Следующий месяц', 'Перейти на текущий месяц', 'Вставить текущую дату', 'Период: неделя', 'Период: месяц', 'Выбрать год', 'Закрыть', 'Выбрать месяц', 'Выбрать год', 'Показать время', 'Скрыть время', 'ч:', 'м:', 'с:', 'Часы (00 - 23)', 'Минуты (00 - 59)', 'Секунды (00 - 59)', 'Установить текущее время (серверное)', 'Сбросить время' );

