// big booking box var updateTotalValue = 0; function checkAvailability(checkAvailForm) { var cForm = document.forms[checkAvailForm]; cForm.submit(); } function sm_checkAvailability(checkAvailForm) { var cForm = document.forms[checkAvailForm]; cForm.submit(); } function checkAvailabilitySmart(checkAvailForm) { var cForm = document.forms[checkAvailForm]; cForm.submit(); } function updateCheckAvailAll(checkAvailForm,column) { var cForm = document.forms[checkAvailForm]; var cDate = new Date(); updateCheckAvailDo(column,cForm,cDate); } function sm_updateCheckAvailAll(checkAvailForm,column) { var cForm = document.forms[checkAvailForm]; var cDate = new Date(); updateCheckAvailDo(column,cForm,cDate); } function updateCheckAvailDo(column,cForm,cDate) { var sDate = getDate(cForm,0);setDate(cForm,sDate,0); //Get Start Date & Set Correct StartDate var eDate = getDate(cForm,2);setDate(cForm,eDate,1); //Get EndDate & Set Correct EndDate //-Change StartDate or Number of Nights------------------------------------------------------------ if(column=='sDate' || column=='Nights') { var sDate = getDate(cForm,0); if(sDate.getTime()=(cDate.getTime()/1000)) { cValue += Number(Hotel[i][(j+3)]);break; } } cDate.setDate(cDate.getDate()+1); } var cElement = cForm.elements['checkHotel[TotalRooms]']; var TotalRooms = cElement[cElement.selectedIndex].value; var cElement = cForm.elements['checkHotel[ApproxTotal]']; var xValue = Number(Math.round(Number(TotalRooms) * Number(cValue/Number(cRate)))); if(xValue==0) { cElement.value = ''; } else { var nForm = document.forms['hotelCurrency']; var nElement = nForm.elements['CurrencyCode']; var cName = nElement.options[nElement.selectedIndex].text; cElement.value = xValue + ' ' + cName; } } function updateCheckAvail(checkAvailForm,column) { var cForm = document.forms[checkAvailForm]; var cDate = getcDate(); updateCheckAvailDo(column,cForm,cDate); } function bookRoom(checkAvailForm) { var cForm = document.forms[checkAvailForm]; cForm.submit(); } function getcDate() { var cDate = new Date(); var mDate = new Date(); mDate.setFullYear(mDate.getFullYear()+10); for(var i=0;i" +cYear+""); document.write(""); } sm_updateCheckAvailAll('checkAvailStandard','Nights'); // end big booking box // small booking box var ckAvailStartTdyShort = new Date(); var ckAvailStartTdyDateShift = 1; //remove time from Date ckAvailStartTdyShort = new Date(ckAvailStartTdyShort.getFullYear(), ckAvailStartTdyShort.getMonth(), ckAvailStartTdyShort.getDate()); var ckAvailStartDateShort = new Date(ckAvailStartTdyShort.getFullYear(), ckAvailStartTdyShort.getMonth(), ckAvailStartTdyShort.getDate() + ckAvailStartTdyDateShift); function getElcheckavailabilityShort(tmpname) { return document.forms['checkAvailQuick'].elements[tmpname]; } function shortAddDate(cDate, addDay) { return new Date(cDate.getFullYear(), cDate.getMonth(), cDate.getDate() + addDay); } function showChangeDateShort(values) { if(values=='in') { setAllDate(getElcheckavailabilityShort('txtCheck_InShort').value,'in'); } else if (values=='out') { setAllDate(getElcheckavailabilityShort('txtCheck_OutShort').value,'out'); } } function setAllDate(cDate,InOut) { if (InOut=='in') { var startDate = ChStrtoDate(cDate); var endDate = ChStrtoDate(getElcheckavailabilityShort('txtCheck_OutShort').value); if(startDate=endDate) endDate = shortAddDate(startDate, ckAvailStartTdyDateShift); } else if (InOut=='out') { var startDate = ChStrtoDate(getElcheckavailabilityShort('txtCheck_InShort').value); var endDate = ChStrtoDate(cDate); if(startDate=endDate) endDate = shortAddDate(startDate, ckAvailStartTdyDateShift); } else { var startDate = ckAvailStartTdyShort; var endDate = ckAvailStartDateShort; } var Nights = Math.floor((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)); getElcheckavailabilityShort('checkHotel[Nights]').value = Nights; getElcheckavailabilityShort('txtCheck_InShort').value = ChDatetoStr(startDate); getElcheckavailabilityShort('txtCheck_OutShort').value = ChDatetoStr(endDate); var arrtmpDate = ChDatetoStr(startDate).split("/"); var b = getElcheckavailabilityShort('checkHotel[sMonth2]'); setElementShort(b, arrtmpDate[1]+'/'+arrtmpDate[2]); var b = getElcheckavailabilityShort('checkHotel[sYear]'); b.value = arrtmpDate[2]; var b = getElcheckavailabilityShort('checkHotel[sMonth]'); b.value = arrtmpDate[1]; var b = getElcheckavailabilityShort('checkHotel[sDay]'); setElementShort(b, arrtmpDate[0]); var arrtmpDate = ChDatetoStr(endDate).split("/"); var b = getElcheckavailabilityShort('checkHotel[eMonth2]'); setElementShort(b, arrtmpDate[1]+'/'+arrtmpDate[2]); var b = getElcheckavailabilityShort('checkHotel[eYear]'); b.value = arrtmpDate[2]; var b = getElcheckavailabilityShort('checkHotel[eMonth]'); b.value = arrtmpDate[1]; var b = getElcheckavailabilityShort('checkHotel[eDay]'); setElementShort(b, arrtmpDate[0]); } function createlistYearShort() { var a = getElcheckavailabilityShort('checkHotel[sMonth2]'); a.length = 0; createListInOptions(ckAvailStartTdyShort, a); var b = getElcheckavailabilityShort('checkHotel[eMonth2]'); b.length = 0; createListInOptions(ckAvailStartDateShort, b); getElcheckavailabilityShort('checkHotel[Nights]').value = ckAvailStartTdyDateShift; } function createListInOptions(tmptoday, obj) { var sMonth = tmptoday.getMonth() + 1; var sYear = tmptoday.getFullYear(); var i = 0; var arrmonth; var lang = getElcheckavailabilityShort('checkHotel[LanguageCode]').value; if(lang=="ja") arrmonth = new Array("", "1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"); else arrmonth = new Array("", "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); for(i=0;i<=17;i++) { sYearShow = String(sYear).substring(2,4); obj.options[i]=new Option(arrmonth[sMonth] +' ' + sYearShow, padZero(sMonth)+'/'+sYear); sMonth = sMonth + 1; if(sMonth>=13) { sMonth = 1; sYear = sYear + 1; } } } var ddd = 0; function setDefDateShort() { ddd = ddd + 1; getElcheckavailabilityShort('txtCheck_InShort').value = ChDatetoStr(ckAvailStartTdyShort); getElcheckavailabilityShort('txtCheck_OutShort').value = ChDatetoStr(ckAvailStartDateShort); setAllDate(ChDatetoStr(ckAvailStartTdyShort), 'in'); setAllDate(ChDatetoStr(ckAvailStartDateShort), 'out'); } function ChDatetoStr(cDate) { return padZero(cDate.getDate()) + '/' + padZero(cDate.getMonth() + 1) + '/' + cDate.getFullYear(); } function ChStrtoDate(cDate) { var arrcDate = cDate.split("/"); return new Date(arrcDate[2], Number(arrcDate[1])-1, Number(arrcDate[0])); } function setElementShort(cElement,cValue) { for(var i=0;i and objects (for IE only) */ function hideElement( elmID, overDiv ) { if( ie ) { for( i = 0; i < document.all.tags( elmID ).length; i++ ) { obj = document.all.tags( elmID )[i]; if( !obj || !obj.offsetParent ) { continue; } // Find the element's offsetTop and offsetLeft relative to the BODY tag. objLeft = obj.offsetLeft; objTop = obj.offsetTop; objParent = obj.offsetParent; while( objParent.tagName.toUpperCase() != "BODY" && objParent.tagName.toUpperCase() != "HTML") { objLeft += objParent.offsetLeft; objTop += objParent.offsetTop; objParent = objParent.offsetParent; } objHeight = obj.offsetHeight - 5; objWidth = obj.offsetWidth; var tmpoverDivoffsetTop = overDiv.offsetTop; if(LongIsinLayer || ShortIsinLayer) { aTag = document.getElementById(LayerParentCalendar); //if(aTag!=null) tmpoverDivoffsetTop += aTag.offsetTop; if(aTag!=null) { if(String(aTag.style.top)!="") { tmpoverDivoffsetTop += aTag.offsetTop; } } } if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft ); else if(( tmpoverDivoffsetTop + overDiv.offsetHeight ) <= objTop ); else if( tmpoverDivoffsetTop >= ( objTop + objHeight )); else if( overDiv.offsetLeft >= ( objLeft + objWidth )); else { obj.style.visibility = "hidden"; obj.style.display = "none"; } } } } /* * unhides