function openPhotoWindow( url, width, height )
{
	var left = ( window.screen.availWidth - width ) / 2;
	var top  = ( window.screen.availHeight - height ) / 2;

	var w = window.open( url, 'photo', 'location=no,menubar=no,resizable=no,titlebar=no,toolbar=no,status=no,statusbar=no,directories=no,width=' + width + ',height=' + height + ',top=' + top + ',left=' + left );
	return false;	
}

function recountDeparture()
{
	var aD = document.getElementById( 'orderArrivalDay' ).value;
	var aM = document.getElementById( 'orderArrivalMonth' ).value;
	var aY = document.getElementById( 'orderArrivalYear' ).value;
	var dD = document.getElementById( 'orderDepartureDay' ).value;
	var dM = document.getElementById( 'orderDepartureMonth' ).value;
	var dY = document.getElementById( 'orderDepartureYear' ).value;
	if ( aY * 1000 + aM * 100 + aD >= dY * 1000 + dM * 100 + dD )
	{
		dD = aD;
		dM = aM;
		dY = aY;
		dD++;
		if ( dD == 32 )
		{
			dD = 1;
			dM++;
			if ( dM == 13 )
			{
				dM = 1;
				dY++;
			}
		}
		document.getElementById( 'orderDepartureDay' ).value = dD;
		document.getElementById( 'orderDepartureMonth' ).value = dM;
		document.getElementById( 'orderDepartureYear' ).value = dY;
	}
}	
