function vacationPlannerGoBook(form) {
    var blnResult = true; // optimistic
    var w, h, lpos, tpos;
    w = 800;
    h = 650;
    lpos = (screen.width)?(screen.width-w)/2:100;
    tpos = (screen.height)?(screen.height-h)/2:100;

    var dtArrive, dtDepart, d1_ms, d2_ms, iDays;
    dtArrive = form.txtDateArrive.value;
    dtDepart = form.txtDateDepart.value;
    d1_ms = Date.parse(dtArrive);
    d2_ms = Date.parse(dtDepart);
    if (isNaN(d1_ms) || isNaN(d2_ms)) {
        alert('Please select your Arrival and/or Departure Dates.');
        return false;
    }
    iDays = daysBetween(Date.parse(dtArrive), Date.parse(dtDepart));

    var iAdults, iChildren;
    iAdults = form.ddlNumAdults[form.ddlNumAdults.selectedIndex].value;
    iChildren = form.ddlNumChildren[form.ddlNumChildren.selectedIndex].value;
    if (isNaN(iAdults) || isNaN(iChildren) || (Number(iAdults) + Number(iChildren) < 1)) {
        alert('Your party size must be greater than 0.');
        return false;
    }

    window.open("/go.book.chamber.asp?adt=" + dtArrive + "&days=" + iDays + "&ad=" + iAdults + "&ch=" + iChildren + "&tn=0&sr=0&utm_source=booking-engine&utm_medium=VacationPlanner","","height="+h+",width="+w+",toolbar=1,resizable=1,scrollbars=1,location=1,status=1,menubar=1,top="+tpos+",left="+lpos);
    return false; // don't want to post the form

} // vacationPlannerGoBook

function vacationPlannerGoBook2(form) {
    var blnResult = true; // optimistic
    var w, h, lpos, tpos;
    w = 800;
    h = 650;
    lpos = (screen.width)?(screen.width-w)/2:100;
    tpos = (screen.height)?(screen.height-h)/2:100;

    var dtArrive, dtDepart, d1_ms, d2_ms, iDays;
    dtArrive = form.txtDateArrive2.value;
    dtDepart = form.txtDateDepart2.value;
    d1_ms = Date.parse(dtArrive);
    d2_ms = Date.parse(dtDepart);
    if (isNaN(d1_ms) || isNaN(d2_ms)) {
        alert('Please select your Arrival and/or Departure Dates.');
        return false;
    }
    iDays = daysBetween(Date.parse(dtArrive), Date.parse(dtDepart));

    var iAdults, iChildren;
    iAdults = form.ddlNumAdults[form.ddlNumAdults.selectedIndex].value;
    iChildren = form.ddlNumChildren[form.ddlNumChildren.selectedIndex].value;
    if (isNaN(iAdults) || isNaN(iChildren) || (Number(iAdults) + Number(iChildren) < 1)) {
        alert('Your party size must be greater than 0.');
        return false;
    }

    window.open("/go.book.chamber.asp?adt=" + dtArrive + "&days=" + iDays + "&ad=" + iAdults + "&ch=" + iChildren + "&tn=0&sr=0&utm_source=booking-engine&utm_medium=VacationPlanner","","height="+h+",width="+w+",toolbar=1,resizable=1,scrollbars=1,location=1,status=1,menubar=1,top="+tpos+",left="+lpos);
    return false; // don't want to post the form

} // vacationPlannerGoBook

function daysBetween(date1_ms, date2_ms) {
    // The number of milliseconds in one day
    var ONE_DAY = 1000 * 60 * 60 * 24

    // Calculate the difference in milliseconds
    var difference_ms = Math.abs(date1_ms - date2_ms)
    
    // Convert back to days and return
    return Math.round(difference_ms/ONE_DAY)

} // daysBetween

function goWebCORISWithPackageAndForce(packageid){
	width = 800;
	height = 570;
	leftposition=(screen.width)?(screen.width-width)/2:100;
	topposition=((screen.height)?(screen.height-height)/2:100)-30;
	winpops=window.open("http://steamboat.mountainvisit.com/ReservationBooking/Secure/Vacation.aspx?action=startres&adt=&ddt=&days=&ad=&ch=&tn=&sr=&pkgid=" + packageid + "&pkgidfc=y","","height="+height+",width="+width+",toolbar=1,resizable=1,scrollbars=1,location=1,status=1,menubar=1,top="+topposition+",left="+leftposition)

} // goWebCORISWithPackageAndForce


