function initArrivalCalender() {

	if (!document.getElementById("arrival") || !document.getElementById("date-button-arrival")) {
		return
	}
	var dateButtonNode = document.getElementById('dateButtonArrival');
	if(dateButtonNode) {
		dateButtonNode.style.display = 'inline';
	}
	Calendar.setup(
		{
			inputField : "arrival", // ID of the input field
			button : "date-button-arrival", // ID of the button
			ifFormat : "%d.%m.%Y", // the date format
			daFormat : "%d.%m.%Y", // the date format
			firstDay : 1, 
			weekNumbers : true, 
			range : new Array(2008,2009),
			align : "Bl",
			dateStatusFunc : dateStatusFuncArrival
			//position : new Array(720,432)
		}
	);
}

addInitFunction(initArrivalCalender);


	function dateChangedArrival(cal) {
		// Beware that this function is called even if the end-user only
		// changed the month/year.  In order to determine if a date was
		// clicked you can use the dateClicked property of the calendar
		if (cal.dateClicked) {
			
			var node = document.getElementById('arrival');

			var y = cal.date.getFullYear();
			var m = cal.date.getMonth() + 1;     // integer, 0..11
			var d = cal.date.getDate();

			var checkTime = '' + ((d<10)?('0'+d):d) + '.' + ((m<10)?('0'+m):m) + '.' + y;
		
			if(node) {
				var options = node.options;
				if(options) {
					for(var i = 0; i< options.length; i++) {
						if (options[i].text == checkTime) {
							node.selectedIndex = i;
							
							return true;
						}
					}
				}
			}
						
		}
	}
	
	function dateIsSpecialArrival(year, month, day) {
		var node = document.getElementById('arrival');

		month++;

		var checkTime = '' + ((day<10)?('0'+day):day) + '.' + ((month<10)?('0'+month):month) + '.' + year;
	
		if(node) {
			var options = node.options;
			if(options) {
				for(var i = 0; i< options.length; i++) {
					if (options[i].text == checkTime) {
						if (node.selectedIndex == i) {
							
						}
						return true;
					}
				}
			}
		}
		
		return false;
	};
	
	function dateStatusFuncArrival(date, y, m, d) {
		if (dateIsSpecialArrival(y, m, d))
			return "special";
		else
			return true;
		// return true if you want to disable other dates
	};