function menuHover (mID, mBgColor, mFgColor) { if (document.all) { realID = 'm' + mID; document.getElementById(realID).style.backgroundColor = '#' + mBgColor; document.getElementById(realID).style.color = '#' + mFgColor; } } function menuJump (url) { window.location = url; } function bookFormUpdate () { var objForm = document.forms.bookCheck; var objArrDay = objForm.bookCheckInDate; var objArrMonth = objForm.bookCheckInMonth; var objDepDay = objForm.bookCheckOutDate; var objDepMonth = objForm.bookCheckOutMonth; var valArrDay = objArrDay.value; var valArrMonth = objArrMonth.value; var valDepDay = objDepDay.value; var valDepMonth = objDepMonth.value; var intArrDay = parseInt (valArrDay); var intDepDay = parseInt (valDepDay); var intArrMonth = parseInt (valArrMonth.substring (0, 2), 10); var intDepMonth = parseInt (valDepMonth.substring (0, 2), 10); var intArrDate = parseInt (valArrMonth.substring (3, 7)) * 10000 + intArrMonth * 100 + intArrDay; var intDepDate = parseInt (valDepMonth.substring (3, 7)) * 10000 + intDepMonth * 100 + intDepDay; var febDays = bookCheqLeap (objArrMonth); var intCurrDay = 23; var intCurrMnth = 07; arrMonth = new Array (0, 31, febDays, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); if (intArrDay <= intCurrDay && intArrMonth <= intCurrMnth) { objArrDay[intCurrDay-1].selected = true; } if (intArrDate >= intDepDate) { if ((intArrDay + 1) > arrMonth[intArrMonth]) { if (objDepMonth[objArrMonth.selectedIndex + 1]) { objDepDay[0].selected = true; objDepMonth[objArrMonth.selectedIndex + 1].selected = true; } else { objDepDay[objArrDay.selectedIndex].selected = true; objDepMonth[objArrMonth.selectedIndex].selected = true; } } else objDepDay[objArrDay.selectedIndex + 1].selected = true; if (Math.floor (intArrDate/100) > Math.floor (intDepDate/100)) { objDepMonth[objArrMonth.selectedIndex].selected = true; if (intArrDay >= intDepDay) objDepDay[objArrDay.selectedIndex + 1].selected = true; } } bookCheckMaxDays (intArrDay, intArrMonth, arrMonth, objArrDay); bookCheckMaxDays (intDepDay, intDepMonth, arrMonth, objDepDay); } function bookCheckMaxDays (intDay, intMonth, arrMax, objDay) { if (intDay > arrMax[intMonth]) { objDay[arrMax[intMonth]-1].selected = true; } } function bookCheqLeap (objMonth) { for (i = 0; i < objMonth.length; i++) { if (objMonth[i].value.substring (0, 2) == '02') febYear = parseInt (objMonth[i].value.substring (3, 7)); } if ((febYear/4) == Math.floor (febYear/4)) return 29; else return 28; } function bookTrapSubmit (objForm) { var arrMonths = new Array ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); var intArrDay = objForm.bookCheckInDate.value; var arrArrMonth = objForm.bookCheckInMonth.value.split('~'); var intDepDay = objForm.bookCheckOutDate.value; var arrDepMonth = objForm.bookCheckOutMonth.value.split('~'); var strCheckIn = arrMonths[parseInt (arrArrMonth[0], 10) - 1] + ' ' + intArrDay + ', ' + arrArrMonth[1]; var strCheckOut = arrMonths[parseInt (arrDepMonth[0], 10) - 1] + ' ' + intDepDay + ', ' + arrDepMonth[1]; var intRoomType = objForm.bookRoomType.value; var strRoomType; switch (intRoomType) { case '1': strRoomType = 'Single'; break; case '2': strRoomType = 'Double'; break; case '3': strRoomType = 'Junior suite'; break; case '4': strRoomType = 'Deluxe suite'; break; case '5': strRoomType = 'Luxury suite'; break; case '6': strRoomType = 'Royal suite'; break; default : strRoomType = 'No preference'; break; } var strAdults = objForm.bookAdultCount.value; var strChildren = (objForm.bookChildCount.value > 0) ? objForm.bookChildCount.value : 'none'; var strComments = (objForm.bookUserComments.value) ? objForm.bookUserComments.value : 'none'; var strChoiceSet = 'You have chosen the following options:\t\n\n\n'; strChoiceSet = strChoiceSet + 'Check-in date:\t\t ' + strCheckIn + ' \n'; strChoiceSet = strChoiceSet + 'Check-out date:\t\t ' + strCheckOut + ' \n'; strChoiceSet = strChoiceSet + 'Room type:\t\t ' + strRoomType + ' \n'; strChoiceSet = strChoiceSet + 'Number of adults:\t\t ' + strAdults + ' \n'; strChoiceSet = strChoiceSet + 'Number of children:\t\t ' + strChildren + ' \n'; strChoiceSet = strChoiceSet + 'Additional comments:\t ' + strComments + ' \n'; strChoiceSet = strChoiceSet + '\n\nClick OK to submit your request or Cancel to modify options.\t\n'; if (confirm (strChoiceSet)) return true; else return false; } function showImage (imageName, ext, width, height) { e = (ext) ? ext : 'jpg'; img = imageName + '.' + e; w = (width) ? width : 380; h = (height) ? height : 425; url = 'show_image/' + img; popUp (url, w, h); } function launchCalendar (action) { url = 'calendar/~' + action; popUp (url, 400, 260); } function printPage () { url = '/print/' + thisPage; str = 'toolbar=yes,location=no,4,resizable=no,status=no,menubar=no,scrollbars=yes,'; str = str + 'width=420,height=480,left=100,top=120'; window.open (url, '', str); } function send2Friend () { sendPage = 'display/' + thisPage; sendURL = 'send_to_a_friend/~' + sendPage.replace(/\//g, '~') + '~'; popUp (sendURL, 400, 335); } function bookmarkPage (callObj) { var url = window.location; var urn = document.title.replace (':/g', '-'); if (document.all && !window.opera) {window.external.AddFavorite (url, urn); return true;} if (window.sidebar && !window.opera) {window.sidebar.addPanel (urn, url, ''); return true;} if (window.opera) {alert ('Click Ctrl + T to bookmark!'); return true;} } function popUp (loc, width, height) { url = '/popup/' + loc; str = 'toolbar=no,location=no,4,resizable=no,status=no,menubar=no,scrollbars=no,'; str = str + 'width=' + width + ',height=' + height + ',left=100,top=120'; window.open (url, '', str); }