Ext.onReady(function() {
	/*
	 * Выбор фильтра по годам и месяцам
	 */
	var year_month_form = Ext.select("form[name='year_month_selector']").item(0);
	if(year_month_form != null){
		Ext.fly(year_month_form).select("select[name=year]").item(0).on("change", function(){
			var month_options = "";
			Ext.each(year_month[Ext.fly(this).getValue()], function(){
				month_options = "<option value=" + this + ">" + Date.monthNames[this] + "</option>" + month_options;
			});
			Ext.fly(year_month_form).select("select[name=month]").item(0).dom.innerHTML = month_options;
			delete month_options;
		});
	}
	delete year_month_form;
	
	var faq_list = Ext.select(".faq > dl");
	if(faq_list != null){
		faq_list.each(function(item){
			item.select("dt").on("click", function () {
				Ext.fly(this).parent().toggleClass("active");
			});
		});
	}
	delete faq_list;
	
	var formos = Ext.select(".formos").item(0);
	if(formos != null){
		Ext.DomHelper.append(formos, {tag: 'input', name: 'checked', value: 'valid', type: 'hidden'});
	}
	delete formos;
});
