function initEpoch() {
	new Epoch('epoch_popup','popup',document.getElementById('arrival'));
	new Epoch('epoch_popup','popup',document.getElementById('depart'));
}
function updateForm() {
	var arrivalDate = Date.parse(document.getElementById('arrival').value);
//alert(arrivalDate);
	//arrivalDate += 86400000;
	arrivalDate = new Date(arrivalDate);
	var departureDate = Date.parse(document.getElementById('depart').value);
	//departureDate += 86400000;
	departureDate = new Date(departureDate);
	arrivalDay = new String(arrivalDate.getDate());
	arrivalMonth = new String(arrivalDate.getMonth()+1);
	departureDay = new String(departureDate.getDate());
	departureMonth = new String(departureDate.getMonth()+1);
//alert(arrivalDay+" -- "+arrivalMonth+" -- "+departureDay+" -- "+departureMonth);
	filler = "0";
	if(arrivalDay.length == 1) {
		arrivalDay = filler.concat(arrivalDay);
	}
	if(arrivalMonth.length == 1) {
		arrivalMonth = filler.concat(arrivalMonth);
	}
	if(departureDay.length == 1) {
		departureDay = filler.concat(departureDay);
	}
	if(departureMonth.length == 1) {
		departureMonth = filler.concat(departureMonth);
	}
	var reservationString = '?CIM='+arrivalMonth+'&CID='+arrivalDay+'&CIY='+arrivalDate.getFullYear();
	reservationString += '&COM='+departureMonth+'&COD='+departureDay+'&COY='+departureDate.getFullYear();
	reservationString += '&AD='+document.getElementById('adults').value+'&CH='+document.getElementById('kids').value+'&RS=1&RSE=0&action=Check+Availability';
	//alert(reservationString);
//window.open('https://www.bighornmeadows.net/iqreservations/default.asp?CIM=02&CID=02&CIY=2011&COM=02&COD=05&COY=2011&AD=2&CH=0&RS=1&RSE=0&action=Check+Availability');
	window.open('https://reservations.thecedarwood.ca/iqreservations/default.asp'+reservationString);
}
window.onload=initEpoch;
