Cancun Resort Suites and Luxury Guest Rooms at Hard Rock Hotel Cancun (2024)

"; sRoomsDropdown2 += "

"; sRoomsDropdown2 += "

"; $roomsShell.append(sRoomsDropdown2); $("#children" + i + "Field").change(function () { if (($("#searchForm #travelOptions").val() == "1" && bSynxisEngineForHotel == true) == false) { CreateChildrenAgeDropdowns(this); } else { //remove child age fields if not needed $(".childrenAgesShell").remove(); } }); } for (var a = 1; a <= iMaxAdults; a++) { //only add the option if it doesnt already exist if ($("#rooms" + i + "Shell #adults" + i + "Field option[value='" + a + "']").length == 0) { var sSelected = ""; if (a==2) { sSelected = "selected"; } $("#rooms" + i + "Shell #adults" + i + "Field").append("

"); } } //remove any adult options above the max $("#rooms" + i + "Shell #adults" + i + "Field option:gt(" + (iMaxAdults-1) + ")").remove(); for (var a = 0; a <= iMaxChildren; a++) { //only add the option if it doesnt already exist if ($("#rooms" + i + "Shell #children" + i + "Field option[value='" + a + "']").length == 0) { $("#rooms" + i + "Shell #children" + i + "Field").append("

"); } } //remove any child options above the max $("#rooms" + i + "Shell #children" + i + "Field option:gt(" + iMaxChildren + ")").remove(); //we present a zero option for children so the gt selector doesnt have to minus one } //remove any dropdowns left if they were greater than the newly selected rooms count $("#searchForm .roomsShell:gt(" + (iRooms - 1) + ")").remove(); } } var iMaxChildAge = 17; var sChildNumberAgeLabel = "Child {!Number} Age"; function CreateChildrenAgeDropdowns(oChildSelect) { //get/create children age shell var $number2 = oChildSelect.id.replace("children", "").replace("Field",""); var $childrenAgesShell2 = $("#searchForm #children" + $number2 + "AgesShell"); if ($childrenAgesShell2.length == 0) { $("#searchForm #children" + $number2 + "Shell").after("

") //add new table row after children dropdown row $childrenAgesShell2 = $("#children" + $number2 + "AgesShell"); } //build age dropdown options for each child var iChildren2 = parseInt($("#searchForm select#children" + $number2 + "Field").val(), 10); if (iChildren2 == 0) { $("#searchForm #children" + $number2 + "AgesShell").remove(); //$("#searchForm .childagediv" + $number + ":gt(" + (iChildren - 1) + ")").remove(); } else { var sChildrenAgeOptions2 = ""; for (var i = 1; i <= iChildren2; i++) { if ($("#searchForm #childrenAge" + $number2 + i + "Shell").length == 0) { var sChildrenAgeDropdown2 = ""; sChildrenAgeDropdown2 += "

"; sChildrenAgeDropdown2 += "

"; $childrenAgesShell2.append(sChildrenAgeDropdown2); } } //$('#roomsExtraShellContainer2 select').selectBox(); //remove any dropdowns left if they were greater than the newly selected child count $("#searchForm .childagediv" + $number2 + ":gt(" + (iChildren2 - 1) + ")").remove(); } }}Date.isLeapYear = function (year) { return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); };Date.getDaysInMonth = function (year, month) { return [31, (Date.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];};Date.prototype.isLeapYear = function () { return Date.isLeapYear(this.getFullYear()); };Date.prototype.getDaysInMonth = function () { return Date.getDaysInMonth(this.getFullYear(), this.getMonth());};Date.prototype.addMonths = function (value) { var n = this.getDate(); this.setDate(1); this.setMonth(this.getMonth() + value); this.setDate(Math.min(n, this.getDaysInMonth())); return this;};function validateForm() { var arr = document.getElementById("checkinField"); var dep = document.getElementById("checkoutField"); var rooms = document.getElementById("rooms").value; var arrMonth = arr.value.split("/")[0]; var arrDay = arr.value.split("/")[1]; var arrYear = arr.value.split("/")[2]; var depMonth = dep.value.split("/")[0]; var depDay = dep.value.split("/")[1]; var depYear = dep.value.split("/")[2]; var arrDate = new Date(arrYear, arrMonth-1, arrDay); var depDate = new Date(depYear, depMonth-1, depDay); var oneDay = 1000*60*60*24; var today = new Date(); var today18Months = new Date(); today18Months.addMonths(18); var nights = Math.ceil((depDate.getTime()-arrDate.getTime())/(oneDay)); var fromToday = Math.ceil((arrDate.getTime()-today.getTime())/(oneDay)); var adults1 = $("#adults1Field").val(); var adults2 = $("#adults2Field").val(); var adults3 = $("#adults3Field").val(); var adults4 = $("#adults4Field").val(); var child1 = $("#children1Field").val(); var child2 = $("#children2Field").val(); var child3 = $("#children3Field").val(); var child4 = $("#children4Field").val(); var guestTotal = 0; if( adults1 ) { guestTotal += parseInt(adults1); } if( adults2 ) { guestTotal += parseInt(adults2); } if( adults3 ) { guestTotal += parseInt(adults3); } if( adults4 ) { guestTotal += parseInt(adults4); } if( child1 ) { guestTotal += parseInt(child1); } if( child2 ) { guestTotal += parseInt(child2); } if( child3 ) { guestTotal += parseInt(child3); } if( child4 ) { guestTotal += parseInt(child4); } if(arrDate.toString() == "Invalid Date" || depDate.toString() == "Invalid Date" || arrDate.toString() == "NaN" || depDate.toString() == "NaN"){ alert("The date format you have entered is incorrect. Please re-enter the date as mm/dd/yyyy."); return false; } if(fromToday < 0){ alert("Please select a date that has not already occurred."); return false; } if(nights <= 0){ alert("The check out date must occur after the arrival date."); return false; } if(nights > 30){ alert("Please choose a maximum of 30 nights."); return false; } if ( arrDate > today18Months || depDate > today18Months ){ alert("Reservations can only be made 18 months in advance, please choose new dates to continue."); return false; } var bIsMobileDevice = false; if (typeof (window.matchMedia) != "undefined") { if (window.matchMedia("(max-device-width: 599px) and (orientation: portrait)").matches) { bIsMobileDevice = true; } else if (window.matchMedia("(orientation: landscape)").matches) { //apple devices still report the portrait dimensions when in landscape orientation //so if we detect a device in landscape orientation whose width is less than the height //we know to use the height of the device as the width check if (screen.width < screen.height) { if (window.matchMedia("(max-device-width: 599px)").matches) { bIsMobileDevice = true; } } else { if (window.matchMedia("(max-device-width: 799px)").matches) { bIsMobileDevice = true; } } } } if (bIsMobileDevice == true) { $("#searchForm #mobile").val("1"); } else { $("#searchForm #mobile").val("0"); } //if(guestTotal > 6){ // alert("A maximum of 6 people can be chosen, please modify the amount of adults and children to continue."); // return false; //} return true;}

  • Hotel
  • Hotel + Flight
Cancun Resort Suites and Luxury Guest Rooms at Hard Rock Hotel Cancun (2024)
Top Articles
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5508

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.