function requestBoxSubmit(form) {
	// check if from-date is older than to-date
	dt_fm = form.dt_fm_year.value + form.dt_fm_month.value + form.dt_fm_day.value;
	dt_to = form.dt_to_year.value + form.dt_to_month.value + form.dt_to_day.value;
	if (dt_fm > dt_to) {
		var tmp_date = new Array (form.dt_fm_day.value, form.dt_fm_month.value, form.dt_fm_year.value);
		form.dt_fm_day.value	= form.dt_to_day.value;
		form.dt_fm_month.value	= form.dt_to_month.value;
		form.dt_fm_year.value	= form.dt_to_year.value;
		form.dt_to_day.value	= tmp_date[0];
		form.dt_to_month.value	= tmp_date[1];
		form.dt_to_year.value	= tmp_date[2];
	}
	// fill hidden fields
	form.dt_fm_complete.value = form.dt_fm_day.value + '.' + form.dt_fm_month.value + '.' + form.dt_fm_year.value;
	form.dt_to_complete.value = form.dt_to_day.value + '.' + form.dt_to_month.value + '.' + form.dt_to_year.value;
}

function dateFields(el) {
	var id = el.id.substr(0,6);
	var dtArray = el.value.split('.');
	if (dtArray.length == 3) {
		document.getElementById(id + "day").value	= dtArray[0];
		document.getElementById(id + "month").value	= dtArray[1];
		document.getElementById(id + "year").value	= dtArray[2];
	}
}

Calendar.setup({
	inputField		:	"dt_fm_day",
	ifFormat		:	"%d.%m.%Y", 
	button			:	"dt_fm_btn",
	singleClick		:	true,
    weekNumbers		:	false
});
Calendar.setup({
	inputField		:	"dt_to_day",
	ifFormat		:	"%d.%m.%Y", 
	button			:	"dt_to_btn",
	singleClick		:	true,
    weekNumbers		:	false
});
/*
document.getElementById('dt_fm_day').autocomplete = 'off';
document.getElementById('dt_fm_month').autocomplete = 'off';
document.getElementById('dt_fm_year').autocomplete = 'off';
document.getElementById('dt_to_day').autocomplete = 'off';
document.getElementById('dt_to_month').autocomplete = 'off';
document.getElementById('dt_to_year').autocomplete = 'off';
*/

