var strPopupText = ""; var boolPopup = false; var strPopupAttributes = ""; // Caches child objects for use on onNumAdultsSelect var iChildCache = ""; var nChildCache = ""; var submitReady = true; function onNumChildrenSelect(childrenSelectBox, nChildren, adultFormItemName, form) { var frm = childrenSelectBox.form; var adultFormItem = frm.elements[adultFormItemName]; var childCount = childrenSelectBox.options[childrenSelectBox.selectedIndex].value; var adultCount = adultFormItem.options[adultFormItem.selectedIndex].value; var totalCount = parseInt(adultCount) + parseInt(childCount); if(totalCount > 5){ hideChildren(); showPartySizeAlert(true); } else { showChildren(childrenSelectBox, nChildren); showPartySizeAlert(false); } iChildCache = childrenSelectBox; nChildCache = nChildren; } function onNumAdultsSelect(adultsSelectBox, childFormItemName, form) { var frm = adultsSelectBox.form; var childFormItem = frm.elements[childFormItemName]; var childCount = childFormItem.options[childFormItem.selectedIndex].value; var adultCount = adultsSelectBox.options[adultsSelectBox.selectedIndex].value; var totalCount = parseInt(adultCount) + parseInt(childCount); if(totalCount > 5){ hideChildren(); showPartySizeAlert(true); } else { showChildren(iChildCache, nChildCache); showPartySizeAlert(false); } } function showPartySizeAlert(bShow){ submitReady = !bShow; document.getElementById("header2").style.display = (bShow ? "block": "none"); try { adjustFooter(); } catch(e) { } } function showDateAlert(bShow){ submitReady = !bShow; document.getElementById("dateAlert").style.display = (bShow ? "block": "none"); try { adjustFooter(); } catch(e) { } } function resetChildrenVis(nChildren){ document.getElementById("header1").style.display = "none"; for(var i=1; i<=nChildren; i++) { var elementId = "child" + i; document.getElementById(elementId).style.display = "none"; } try { adjustFooter(); } catch(e) { } } function hideChildren(){ document.getElementById("header1").style.display = "none"; try { adjustFooter(); } catch(e) { } } function showChildren(selectBox, nChildren) { resetChildrenVis(nChildren); var n = selectBox.value; if(n>=1) { document.getElementById("header1").style.display = "block"; } for(var i=1; i<=n; i++) { var elementId = "child" + i; document.getElementById(elementId).style.display = "block"; } try { adjustFooter(); } catch(e) { } } dateRestricted = false; nightsRequired = false; function onBookingEngineSubmit(form){ var tmp = ""; tmp = document.forms[form].arrivalMonth; var aMonth = tmp.options[tmp.selectedIndex].value; tmp = document.forms[form].arrivalDate; var aDate = tmp.options[tmp.selectedIndex].value; tmp = document.forms[form].arrivalYear; var aYear = tmp.options[tmp.selectedIndex].value; tmp = document.forms[form].departureMonth; var dMonth = tmp.options[tmp.selectedIndex].value; tmp = document.forms[form].departureDate; var dDate = tmp.options[tmp.selectedIndex].value; tmp = document.forms[form].departureYear; var dYear = tmp.options[tmp.selectedIndex].value; aMonth = appendZero(aMonth); aDate = appendZero(aDate); dMonth = appendZero(dMonth); dDate = appendZero(dDate); tmp = document.forms[form].numAdults; var adultsTmp = tmp.options[tmp.selectedIndex].value; tmp = document.forms[form].numChildren; var childrenTmp = tmp.options[tmp.selectedIndex].value; tmp = document.forms[form].resort; var resort = tmp.value; // BEGIN CHECK FOR DATE RESTRICTIONS AND MINIMUM STAY RESTRICTIONS // --------------------------------------------------------------- dateOutOfRange = 0; var arrivalDateCheck = aYear + aMonth + aDate; var departureDateCheck = dYear + dMonth + dDate; if (dateRestricted) { if (arrivalDateCheck < minDate || arrivalDateCheck > maxDate) { dateOutOfRange = 1; } if (departureDateCheck < minDate || departureDateCheck > maxDate) { dateOutOfRange = 1; } } if (nightsRequired) { var arrivalDateObj = new Date(aYear, aMonth-1, aDate); var departureDateObj = new Date(dYear, dMonth-1, dDate); stayLength = (departureDateObj - arrivalDateObj)/(24*60*60*1000); if (stayLength < nightsRequired) { dateOutOfRange = 1; } } if (dateRestricted || nightsRequired) { if (dateOutOfRange==1) { showDateAlert(true); return false; } else { showDateAlert(false); } } // --------------------------------------------------------------- // END CHECK FOR DATE RESTRICTIONS AND MINIMUM STAY RESTRICTIONS var arrivalDateTmp = aYear + "-" + aMonth + "-" + aDate; var departureDateTmp = dYear + "-" + dMonth + "-" + dDate; postURL = "http://disneyworld.disney.go.com/services/en_US/BookingGenie/redirectDlr?gatewayID=search" postURL += "&" + "arrivalDate=" + arrivalDateTmp; postURL += "&departureDate=" + departureDateTmp; postURL += "&adults=" + adultsTmp; postURL += "&children=" + childrenTmp; if(childrenTmp > 0){ tmp = document.forms[form].child1Age; if(tmp != null){ var c1 = tmp.options[tmp.selectedIndex].value; c1 = checkInfant(c1); //postURL += "&child1=" + c1; postURL += "&ages=" + c1; } } if(childrenTmp > 1){ tmp = document.forms[form].child2Age; if(tmp != null){ var c2 = tmp.options[tmp.selectedIndex].value; c2 = checkInfant(c2); postURL += "," + c2; } } if(childrenTmp > 2){ tmp = document.forms[form].child3Age; if(tmp != null){ var c3 = tmp.options[tmp.selectedIndex].value; c3 = checkInfant(c3); postURL += "," + c3; } } if(childrenTmp > 3){ tmp = document.forms[form].child4Age; if(tmp != null){ var c4 = tmp.options[tmp.selectedIndex].value; c4 = checkInfant(c4); postURL += "," + c4; } } if(childrenTmp > 4){ tmp = document.forms[form].child5Age; if(tmp != null){ var c5 = tmp.options[tmp.selectedIndex].value; c5 = checkInfant(c5); postURL += "," + c5; } } if(childrenTmp > 5){ tmp = document.forms[form].child6Age; if(tmp != null){ var c6 = tmp.options[tmp.selectedIndex].value; c6 = checkInfant(c6); postURL += "," + c6; } } if(childrenTmp > 6){ tmp = document.forms[form].child7Age; if(tmp != null){ var c7 = tmp.options[tmp.selectedIndex].value; c7 = checkInfant(c7); postURL += "," + c7; } } postURL += "&action=quick" if (document.forms[form].packagePlan.length==3){ //in 3-button modules, if either air/hotel/tickets or hotel/tickets checked, do nothing if (document.forms[form].packagePlan[0].checked||document.forms[form].packagePlan[1].checked) { //postURL += "&resortOnly=false"; } else{ postURL += "&type=room"; } } if (document.forms[form].packagePlan.length==2){ //in 2-button modules, if hotel/tickets checked, do nothing if (document.forms[form].packagePlan[0].checked) { //postURL += "&resortOnly=false"; } else{ postURL += "&type=room"; } } if (resort!="") { postURL += "&resort=" + resort; } postURL += '&maxOffers=1&minOffers=1' if(submitReady){ if (boolPopup == true) { confirmRedirect(postURL, strPopupText, strPopupAttributes) } else { window.location = postURL; } } else{ } return false; } function appendZero(val){ if(Number(val) < 10){ return "0" + val; } else return val; } function checkInfant(val){ if(Number(val) < 2){ return "Infant"; } else return val; } function adjustFooter() { var objColumn1 = document.getElementById("column1"); var intColumn1Bottom = (objColumn1 != null) ? objColumn1.offsetTop + objColumn1.offsetHeight : 0; var objColumn2 = document.getElementById("column2"); var intColumn2Bottom = (objColumn2 != null) ? objColumn2.offsetTop + objColumn2.offsetHeight : 0; var objColumn3 = document.getElementById("column3"); var intColumn3Bottom = (objColumn3 != null) ? objColumn3.offsetTop + objColumn3.offsetHeight : 0; var intPageBottom = Math.max(intColumn1Bottom,intColumn2Bottom); intPageBottom = Math.max(intPageBottom,intColumn3Bottom) - 25; var objDisclaimer = document.getElementById("disclaimer"); var intDisclaimerHeight = 0; if (objDisclaimer != null) { var intDisclaimerTop = objDisclaimer.offsetTop; objDisclaimer.style.top = intPageBottom + "px"; intDisclaimerHeight = objDisclaimer.offsetHeight; } var objFooter = document.getElementById("footer"); if (objFooter != null) { var intFooterTop = objFooter.offsetTop; objFooter.style.top = intPageBottom + intDisclaimerHeight + "px"; } }