'); $(topInfo).find('.main-image') // Add image .append($('')) ; $(topInfo).find('.extra-info') // Add QR code .append($('
')) ; $(printContents).find('.dates:first').after($(topInfo)); // Fix title $(printContents).find('.event_title').text($(printContents).find('.event_title').text().replace(/(^\s*|\s*-\s*(Edit\s*)?$)/gi, '')); $(printContents).find('.event_title, .event_spec, hr:first').css('margin-top', '').wrapAll('
'); // Add general info to the bottom, but remove the venue info (it's there already - but FIXME: We could use the pictures) $(generalInfo).find('.g_info_tab.ev_ven').remove(); $(generalInfo).find('.g_info_tab.white h5').replaceWith('
'); newGeneralInfo = '
'+$(element).text()+' | '; } else { newGeneralInfo += ''+$(element).html()+' |
';document.getElementById( "calendar" ).innerHTML = t;}function showCalendar( me, calId, dt ){getDimensions( me );if ( document.getElementById ){var c = document.getElementById( calId );var i = getChildImage( me );var f = document.getElementById('frm');calendar.cal = c;calendar.caldt = dt;calendar.calf = f;var my = f[dt + '_year_month'].value.split( "-" );y = my[0];m = my[1];d = f[dt + '_monthday'].value;// Ensure y is nonzero so the pop-up calendar correctly figures out the past/current/future classes for each monthday.if ( y === '0' ){y = new Date().getFullYear();}buildCal( y, m, d );var box = getDimensions( i );varleft = box.x,top = ( box.y + i.offsetHeight );c.style.left = left + 'px';c.style.top = top + 'px';c.style.display = "block";}}function closeCal(){calendar.cal.style.display = 'none';}function prevMonth( y, m ){if ( new Date( y, m - 1, 1 ) < td ){return;}if ( m > 1 ){m--;}else{m = 12;y--;}buildCal( y, m );}//does this finction need to check for max month/year?function nextMonth( y, m ){if ( m < 12 ){m++;}else{m = 1;y++;}buildCal( y, m );}function goYearMonth( ym ){var ymlist = ym.split("-");buildCal( ymlist[0], ymlist[1] );}function pickDate( y, m, d, dt ){// set form valuesvar f = calendar.calf;var dt = calendar.caldt;f[dt + '_year_month'].value = y + "-" + m;f[dt + '_monthday'].value = d;tickCheckBox( 'availcheck' );if ( dt == "checkin" ){checkDateOrder( f, 'checkin_monthday', 'checkin_year_month', 'checkout_monthday', 'checkout_year_month' );}closeCal();updateDaySelect( f );}function initDaySelect(){var forms = document.getElementsByTagName( 'form' );for ( var i = 0; i < forms.length; i++ ){if ( forms[i].checkin_monthday ){updateDaySelect( forms[i] );}}}function updateDaySelect( me ){// 1-2 testingif ( !booking.env.b_simple_weekdays_for_js ){return;}var frm = document.getElementById('frm');if ( frm.getAttribute( 'id' ) !== 'frm' && frm.className !== 'availForm' ){return;}// Check if we have all fields. If not, we are in the first stage// of the book process and should not auto-update selects since there// is only the check-in select and the amount of nights.if ( !frm.checkin_monthday || !frm.checkout_monthday || !frm.checkin_year_month || !frm.checkout_year_month ){return;}if ( frm.checkin_monthday.value === '0' && frm.checkout_monthday.value === '0' && frm.checkin_year_month.value === '0' && frm.checkout_year_month.value === '0' ){return;}// If the year-month fields have nonzero values, prepend the day of the week to each monthday in the check-in and check-out monthday Selects.varci_d = frm.checkin_monthday,co_d = frm.checkout_monthday,ci_my,co_my,todaysDate;// If the form field has a nonzero value, use it;if ( frm.checkin_year_month.value !== '0' ){ci_my = frm.checkin_year_month.value.split( "-" );}else{// Use the current date value.todaysDate = new Date();ci_my = [ todaysDate.getFullYear(), todaysDate.getTwoDigitMonth() ];}if ( frm.checkout_year_month.value !== '0' ){co_my = frm.checkout_year_month.value.split( "-" );}else{todaysDate = new Date();co_my = [ todaysDate.getFullYear(), todaysDate.getTwoDigitMonth() ];}varci_sel = Math.max( ci_d.selectedIndex, 0 ),co_sel = Math.max( co_d.selectedIndex, 0 ),ci_sel_value = ci_d[ ci_sel ].value,co_sel_value = co_d[ co_sel ].value,monthDays = [],opt,i;ci_d.innerHTML = '';co_d.innerHTML = '';// Build the Day/Month prompt Options if the monthday values aren't already set or, if they are set, they are nonzero; and if the client isn't IE 5. This condition mimics the TMPL_IF in datebox.inc/div#avail (except for the inclusion here of IE5).var MonthdayPromptOption = function (){this.option = {"_this" : this,"@selected" : "selected","@class" : "day prompt site_experiment_encourage_date_entry_2","@value" : 0,"#text" : day};};if ( ci_sel_value === '0' ){buildHtmlNode( new MonthdayPromptOption(), ci_d ).selected = true;}if ( co_sel_value === '0' ){buildHtmlNode( new MonthdayPromptOption(), co_d ).selected = true;}function writeMonthdaysOptions( numberOfMonthdaysToShow, yearMonthSelectElement, monthDaysArray, monthDaysSelectElement, monthDaySelectValue ){var i, optionElementInnerHTML, optionElement;for ( i = 0; i < numberOfMonthdaysToShow; i++ ){optionElement = document.createElement( 'option' );optionElementInnerHTML = i + 1;if ( yearMonthSelectElement.value !== '0' ){optionElementInnerHTML = monthDaysArray[i] + ' ' + optionElementInnerHTML;}optionElement.innerHTML = optionElementInnerHTML;optionElement.value = ( i + 1 );if ( i > 0 && monthDaySelectValue == i + 1 ){optionElement.defaultSelected = optionElement.selected = true;}monthDaysSelectElement.appendChild( optionElement );}}// Check-in monthmonthDays = buildDaysForMonth( ci_my[0], ci_my[1] );var numberOfMonthdaysToShow = 31;if ( frm.checkin_year_month.value !== '0' ){numberOfMonthdaysToShow = monthDays.length;}writeMonthdaysOptions( numberOfMonthdaysToShow, frm.checkin_year_month, monthDays, ci_d, ci_sel_value );// Checkout monthmonthDays = buildDaysForMonth( co_my[0], co_my[1] );numberOfMonthdaysToShow = 31;if ( frm.checkout_year_month.value !== '0' ){numberOfMonthdaysToShow = monthDays.length;}writeMonthdaysOptions( numberOfMonthdaysToShow, frm.checkout_year_month, monthDays, co_d, co_sel_value );// IE 6 exhibits a bug whereby the value of the monthday select always jumps to zero.if (isIE6) {ci_d.value = ci_sel_value;co_d.value = co_sel_value;}}function buildDaysForMonth( year, month ){// Month index starts on 0(-11) in Date()-objectvar monthDate = new Date( year, month - 1 );var orgMonth = monthDate.getMonth();var dayArray = [], weekDay;while ( monthDate.getMonth() == orgMonth ){// Week starts on Sunday in Date()-objectweekDay = ( monthDate.getDay() == 0 ) ? 6 : ( monthDate.getDay() - 1 );dayArray.push( booking.env.b_simple_weekdays_for_js[weekDay] );monthDate.setDate( monthDate.getDate() + 1 );}return dayArray;}// Hides "Available rooms" and shows date input for stay.// This currently works without unique id's under the assumption that// the two (or more) divs containing the different "views" are in the same container.function switchDateStack(me, page) {var stackPage = me;var testMe = me.parentNode;try {while (testMe.nodeName != 'div') {stackPage = testMe;testMe = testMe.parentNode;}} catch(e) {}var stackCount = 0;while ( stackPage ) {if ( stackPage.nodeName.toLowerCase() == 'div' ) {stackCount++;if ( stackCount == page ) {stackPage.style.display = 'block';} else {stackPage.style.display = 'none';}}stackPage = stackPage.nextSibling;}}// Searches children to find imagefunction getChildImage( contextElm ){contextElm = contextElm.firstChild;while ( contextElm.nodeName.toLowerCase() != 'img' && contextElm.nextSibling ){contextElm = contextElm.nextSibling;}return contextElm;}// Getting element dimensionsfunction getDimensions( elm ) {var box = { x:0, y:0, w:0, h:0 };if(document.getBoxObjectFor) {var boxRef = document.getBoxObjectFor(elm);box.x = boxRef.x;box.y = boxRef.y;box.w = boxRef.width;box.h = boxRef.height;}else if(elm.getBoundingClientRect) {var boxRef = elm.getBoundingClientRect();box.x = boxRef.left;box.y = boxRef.top;box.w = (boxRef.right - boxRef.left);box.h = (boxRef.bottom - boxRef.top);if(document.compatMode && document.compatMode != 'BackCompat') {// IE6/compliance modebox.x += document.documentElement.scrollLeft - 2;box.y += document.documentElement.scrollTop - 2;}else if(!isIE5) {// IE5.5box.x += document.body.scrollLeft - 2;box.y += document.body.scrollTop - 2;}}else {// No known box information available, walking// manually through offsetParents to calculate x/y coordinatesbox.w = elm.offsetWidth;box.h = elm.offsetHeight;while(elm) {box.x += elm.offsetLeft;box.y += elm.offsetTop;if(elm.offsetParent) // Required for Safari 1.3 :(elm = elm.offsetParent;elsebreak;}}var cc;if(cc = document.getElementById('bodyconstraint'))box.x -= cc.offsetLeft;return box;}
Search