
function submitForm()
{
	
	warning = startyear = document.getElementById('tx_rolcalendar_pi2[falseDate]').value;
	
	startyear = document.getElementById('tx_rolcalendar_pi2[startyear]').value;
	startmonth = document.getElementById('tx_rolcalendar_pi2[startmonth]').value;
	startday = document.getElementById('tx_rolcalendar_pi2[startday]').value;
	
	endyear = document.getElementById('tx_rolcalendar_pi2[endyear]').value;
	endmonth = document.getElementById('tx_rolcalendar_pi2[endmonth]').value;
	endday = document.getElementById('tx_rolcalendar_pi2[endday]').value;
	
	startdate = dateToUnixdate(startday,startmonth,startyear);
	enddate = dateToUnixdate(endday,endmonth,endyear);
	
	if(enddate<startdate)
	{
		alert("Achtung, Startdatum ist höher als Enddate");
	}
	else 
	{
		document.getElementById('tx_rolcalendar_pi2[startdate]').value = startdate;
		document.getElementById('tx_rolcalendar_pi2[enddate]').value = enddate;
		document.getElementById('tx_rolcalendar_pi2_form').submit();
	}
	
}


function dateToUnixdate(day,month,year)
{
	var humDate = new Date(year,
          month-1,
          day);
    return (humDate.getTime()/1000.0);
}