function printWindow()
{
	window.print();
}

function openWindow(url,name,width,height)
{
	var win = window.open(url,name,"width="+width+", height="+height+", location=no, menubar=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=no, dependent=yes");
	if(win) win.focus();
}

function syncCalendars(idStart,idEnd)
{
	var startCal = document.getElementById(idStart);
	var endCal = document.getElementById(idEnd);
	
	startCal.endCal = endCal;
	startCal.onChange = function(el) {
		var endDate;
		var parts = el.get('value').split('.');
		var startDate = new Date(parseInt(parts[2]),parseInt(parts[1]),parseInt(parts[0]));
		if(el.endCal.get('value')!='') {
			parts = el.endCal.get('value').split('.');
			endDate = new Date(parseInt(parts[2]),parseInt(parts[1]),parseInt(parts[0]));
		} else endDate = new Date(startDate.getTime()-1);
		if(startDate.getTime()>endDate.getTime()) el.endCal.set('value',el.get('value'));
	};
	
	startCal.addEvent('change',startCal.onChange);
	if(startCal.get('value')!='') startCal.onChange(startCal);
}
