﻿//AUTO-GENERATED-DO NOT MODIFY 

﻿
V3.Async={Branding:{DateFormat:"d MMMM yyyy",TimeFormat:"hh:mmtt",DateTimeFormat:"d MMMM yyyy @ h:mmtt",ShowImages:true,ImageUrls:{'loading':"../Resources/Images/markRefreshing.gif",'special':"../Resources/Images/markSpecialRate.gif",'hasprice':null,'unavail':null,'soldout':null},CellDOWAlignment:'Sunday',Animate:true,AnimationDuration:1000,RatePopupAlignment:'center bottom',PrioritiseSaveTextOverCompaction:true,Calculated:{CellHeight:0,CellWidth:0,CellBorderWidth:0},MaxStartTimesDisplayed:5},Grids:{},SearchCriteria:{ChannelShortname:null,Shortnames:[],InstanceId:0,NumberOfDays:0,IndustryCategoryGroup:'',StartDate:new Date(),Adults:0,Child:0,Concession:0,getTotalPax:function(){return this.Adults+this.Child+this.Concession;}},CurrentAjaxCall:null,SearchesToPerform:[],IndexOfCurrentSearch:0,IsUpdating:false,Hooks:{OnSelectionChanged:new V3.Utils.EventType('Async.SelectionChanged','providerShortname, product, targetDate, searchCriteria'),OnDeselected:new V3.Utils.EventType('Async.Deselected'),OnNewRateReceived:new V3.Utils.EventType('Async.NewRateReceived','shortname, product, date, searchCriteria, duration, defaultStartTime, startTimes',true),OnSearchStarted:new V3.Utils.EventType('Async.SearchStarted','searchCriteria'),OnSearchCompleted:new V3.Utils.EventType('Async.SearchCompleted'),OnProductRowStateChanged:new V3.Utils.EventType('Async.ProductRowStateChanged','objProduct, newState'),_cloneSearchArgs:function(){var sc=V3.Async.SearchCriteria;return{ChannelShortname:sc.ChannelShortname,Adults:sc.Adults,Child:sc.Child,Concession:sc.Concession,IndustryCategoryGroup:sc.IndustryCategoryGroup};},SelectionChanged:function(product,targetDate){this.OnSelectionChanged.fire(product.Grid.Shortname,product,targetDate,this._cloneSearchArgs());},Deselected:function(){this.OnDeselected.fire();},NewRateReceived:function(product,date,duration,defaultStartTime,startTimes){this.OnNewRateReceived.fire(product.Grid.Shortname,product,date,this._cloneSearchArgs(),duration,defaultStartTime,startTimes);},SearchStarted:function(){this.OnSearchStarted.fire(this._cloneSearchArgs());},SearchCompleted:function(){this.OnSearchCompleted.fire();},ProductRowStateChanged:function(product,newState){this.OnProductRowStateChanged.fire(product,newState);}},Status:{SelectedProduct:{},HighlightedCell:null,ActiveProductPopupControl:null,TotalProductCount:0,VisibleDates:{From:new Date(),To:new Date(),CurrentLeftOffset:0,setDate:function(date){this.From=date;this.To=date.addDays(V3.Async.SearchCriteria.NumberOfDays);},containsDate:function(date){return(this.From.valueOf()<=date.valueOf()&&date.valueOf()<this.To.valueOf());}},Constructed:{FromDate:new Date(),ToDate:new Date(),Width:0,clear:function(){this.Width=0;this.FromDate=new Date(0);},forDate:function(date){return(this.FromDate.valueOf()<=date.valueOf()&&date.addDays(V3.Async.SearchCriteria.NumberOfDays).valueOf()<=this.ToDate.valueOf());}}},DateRange:{Min:new Date(),Max:new Date()},Controls:{ddlMonth:null,ddlDayOfMonth:null,ddlAdults:null,ddlChildren:null,ddlConcessions:null,IsAccommodation:false,getDate:function(){return new Date((this.ddlMonth.value.substr(0,8)+this.ddlDayOfMonth.value).replace(/ /g,'/'));},validateSearchForm:function(){var hasNoChildrenField=(this.ddlChildren==undefined||this.ddlChildren==null);var hasNoConcessionsField=(this.ddlConcessions==undefined||this.ddlConcessions==null);if(this.ddlAdults.selectedIndex==0&&(hasNoChildrenField||this.ddlChildren.selectedIndex==0)&&(hasNoConcessionsField||this.ddlConcessions.selectedIndex==0)){alert('Please select number of people');return false;}
return true;},updateDateOnCalendar:function(optionalNewDate,optionalIsFiredFromCalendarPopup){var i,newDate,calendar=document.getElementById('calendarControl');if(calendar==null){return;}
if(optionalNewDate){V3.Utils.Html.Specialised.setDateOnDropLists(this.ddlMonth,this.ddlDayOfMonth,optionalNewDate);newDate=optionalNewDate;}else{newDate=new Date((this.ddlMonth.value.substr(0,8)+this.ddlDayOfMonth.value).replace(/ /g,'/'));}
if(optionalIsFiredFromCalendarPopup){hidePopup();}
else{A_CALENDARS[0].TC2D(newDate);}},ddlDayOfMonthChanged:function(sender){if(sender.selectedIndex==-1){sender.selectedIndex=0;}this.updateDateOnCalendar();},ddlMonthChanged:function(sender){V3.Utils.Html.Specialised.setDaysOfMonth(V3.Async.Controls.ddlMonth,V3.Async.Controls.ddlDayOfMonth);this.updateDateOnCalendar();}},updateDayRateUI:function(dayRateInfo,optional_KeepState){var status;RemoveCssStyle(dayRateInfo.UI,'special');if(optional_KeepState){if(dayRateInfo.UI.Label.innerHTML==''){dayRateInfo.UI.Label.innerHTML='-';}
if(V3.Async.IsUpdating){AddCssStyle(dayRateInfo.UI,'loading');status='loading';}else{RemoveCssStyle(dayRateInfo.UI,'loading');return;}}
else{RemoveCssStyle(dayRateInfo.UI,'loading');RemoveCssStyle(dayRateInfo.UI,'soldout');RemoveCssStyle(dayRateInfo.UI,'unavail');RemoveCssStyle(dayRateInfo.UI,'hasprice');if(V3.Async.IsUpdating){status='loading';if(dayRateInfo.DisplayedPrice==null){dayRateInfo.UI.Label.setText('-');}else{dayRateInfo.UI.Label.setText('$'+dayRateInfo.DisplayedPrice.toFixed(0));AddCssStyle(dayRateInfo.UI,'hasprice');}}else{if(dayRateInfo.DisplayedPrice==null){if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){status='soldout';dayRateInfo.UI.Label.setText('Sold');}else{status='unavail';dayRateInfo.UI.Label.innerHTML='<span class=pob_calendar_strip_unavailable_cell_marker><span>x</span></span>';}}else{dayRateInfo.UI.Label.setText('$'+dayRateInfo.DisplayedPrice.toFixed(0));if(dayRateInfo.IsSpecial==true){status='special';}else{status='hasprice';}}}
AddCssStyle(dayRateInfo.UI,status);}
if(V3.Async.Branding.ShowImages){if(V3.Async.Branding.ImageUrls[status]!=null){dayRateInfo.UI.Img.src=V3.Async.Branding.ImageUrls[status];dayRateInfo.UI.Img.style.visibility='visible';AddCssStyle(dayRateInfo.UI,'withimage');}else{dayRateInfo.UI.Img.style.visibility='hidden';RemoveCssStyle(dayRateInfo.UI,'withimage');}}},showProductPopup:function(product,date){this.hideActivePopup();if(product.Grid.ShowSingleRow){product=V3.Async.Status.SelectedProduct;}
var rateDetail=product.DailyPriceDetail[date];if(!rateDetail||rateDetail.DisplayedPrice==null||!product.RateDetailHtmlRender[date]){if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"||V3.Async.IsUpdating){return;}
product.Popup.show(rateDetail.UI,{'Rates':'<ul><li class="unavail">There is no availability on this day for the selected number of '+V3.CustomisationSettings.Words.Guests.toLowerCase()+'.</li></ul>','Note':''});}else{product.Popup.show(rateDetail.UI,product.RateDetailHtmlRender[date]);}
product.Popup.DisplayingForDate=date;V3.Async.Status.ActiveProductPopupControl=product.Popup;},hideActivePopup:function(){if(V3.Async.Status.ActiveProductPopupControl){V3.Async.Status.ActiveProductPopupControl.hide();V3.Async.Status.ActiveProductPopupControl=null;}},shouldShowSaveText:function(product,quote,fullRateQuote){return false;if(product.Grid.SaveTextRequiredDifference==null){return false;}
return(((1-product.Grid.SaveTextRequiredDifference)*fullRateQuote)>quote);},constructListItemsForAccomm:function(product,date,quotes,itemsMustBeUniform){var ret={};var duration,isFirstValidDuration=true,firstDisplayedDuration;for(duration=1;duration<=16;duration++){if(quotes[duration]==null||quotes[duration].Total==null){continue;}
var rate=quotes[duration].Rate;var quote=quotes[duration].Total;var fullRateQuote=(product.FullRate!=null?(product.FullRate.ForCurrentSearch.Total*duration):null);var consistantRateDifference=null,consistantUpToDuration=null;if(!itemsMustBeUniform){if(duration<=6&&quotes[duration+1]!=null&&quotes[duration+2]!=null){var diff=quotes[duration+1].Total-quotes[duration].Total;for(d=duration;d<=7;d++){if(!quotes[d]||!quotes[d+1]){break;}
if((quotes[d+1].Total-quotes[d].Total)==diff){consistantRateDifference=diff;consistantUpToDuration=d+1;}else{break;}}}}
var strRate='<span class="p">$'+rate.toFixed(0)+'</span>';var strQuote='<span class="p">$'+quote.toFixed(0)+'</span>';var strSave,isSpecial=false;if(fullRateQuote==null||(fullRateQuote-quote)<1||!this.shouldShowSaveText(product,quote,fullRateQuote)){strSave='';}else{if(V3.Async.Branding.PrioritiseSaveTextOverCompaction){consistantRateDifference=null;}
strSave='<span class="sv"> (Save $'+(fullRateQuote-quote).toFixed(0)+((!itemsMustBeUniform&&duration==1)?' per night':'')+')</span>';if((product.Grid.SpecialRateRequiredDifference!=null)&&Math.round(100*fullRateQuote*(1-product.Grid.SpecialRateRequiredDifference))>=Math.round(quote*100)){isSpecial=true;}}
var text='';if(!itemsMustBeUniform&&isFirstValidDuration){isFirstValidDuration=false;firstDisplayedDuration=duration;if(duration!=1){text+=strRate+' per night'+'<span class="a"> - min '+duration+' night stay.</span>';consistantUpToDuration=null;}
else{if(rate==consistantRateDifference||consistantRateDifference==null){text+=strRate+' per night'+strSave;}else{text+=strRate+' for first night<span class="a"> +$'+consistantRateDifference.toFixed(0)+' per extra night.</span>';}}}else{text+=duration+' nights for '+strQuote;if(consistantRateDifference==null){text+=strSave;consistantUpToDuration=null;}else{text+='<span class="a"> +$'+consistantRateDifference.toFixed(0)+' per extra night</span>';}}
ret[duration]={'Html':text,'IsSpecial':isSpecial,'Price':strQuote,'Save':strSave,'NightlyAverage':'<span class="nAvg">Avg '+strRate+' per night</span>'};if(consistantUpToDuration!=null){duration=consistantUpToDuration;}}
return ret;},constructListItemsForTEA:function(product,date,startTimes,itemsMustBeUniform){var ret={};var words={'Adult':{StartTimeKey:'AP',Text:' per '+V3.CustomisationSettings.Words.GuestNamesAdult,Divider:V3.Async.SearchCriteria.Adults},'Child':{StartTimeKey:'CP',Text:' per '+V3.CustomisationSettings.Words.GuestNamesChild,Divider:V3.Async.SearchCriteria.Child},'Concession':{StartTimeKey:'SP',Text:' per '+V3.CustomisationSettings.Words.GuestNamesConcession,Divider:V3.Async.SearchCriteria.Concession},'Total':{StartTimeKey:'TP',Text:' in Total',Divider:1}};var i,key;for(i=0;i<startTimes.length;i++){var st=startTimes[i];for(key in words){var word=words[key];if(word.Divider==0||(key!='Total'&&st['GP']!=0)){continue;}
var quote=st[word.StartTimeKey]/word.Divider;if(quote==0){continue;}
var fullRateQuote=null,text='',isSpecial=false,strQuote,strSave='';if(product.FullRate!=null){fullRateQuote=product.FullRate.ForCurrentSearch[key];if((product.Grid.SpecialRateRequiredDifference!=null)&&Math.round(100*fullRateQuote*(1-product.Grid.SpecialRateRequiredDifference))>=Math.round(quote*100)){isSpecial=true;}}
strQuote='<span class="p">$'+quote.toFixed(2)+'</span>';text=strQuote+word.Text;if(fullRateQuote!=null){if(this.shouldShowSaveText(product,quote,fullRateQuote)){strSave='<span class="sv"> (Save $'+(fullRateQuote-quote).toFixed(0)+word.Text+')</span>';text+=strSave;}}
if(!ret[i]){ret[i]={};}
ret[i][key]={'Html':text,'IsSpecial':isSpecial,'Price':strQuote,'Save':strSave};}}
return ret;},WebService:{constructRatePopupHtmlRenderForAccomm:function(product,dayPriceDetail,date){var items=V3.Async.constructListItemsForAccomm(product,date,dayPriceDetail.Rates,false);var duration,text='',firstDisplayedDuration=null;for(duration=1;duration<=8;duration++){if(items[duration]){if(firstDisplayedDuration==null){firstDisplayedDuration=duration;}
text+=(items[duration].IsSpecial?'<li class="sp">':'<li>')
+items[duration].Html
+'</li>';}}
var strAdvertisedRateExplaination='';if(!date.equals(dayPriceDetail.DisplayedPriceCriteria.CommencingOn)){strAdvertisedRateExplaination='<div class="advertisedRateExplaination">Displayed price is based on a <br />'+dayPriceDetail.DisplayedPriceCriteria.Duration+' night stay '
+V3.CustomisationSettings.Words.CommencingDate.toLowerCase()+' on '+formatDate(dayPriceDetail.DisplayedPriceCriteria.CommencingOn,V3.Async.Branding.DateFormat)+'</div>';}
else if(dayPriceDetail.DisplayedPriceCriteria.Duration!=firstDisplayedDuration){strAdvertisedRateExplaination='<div class="advertisedRateExplaination">Displayed price is based on a '+dayPriceDetail.DisplayedPriceCriteria.Duration+' night stay</div>';}
if(!product.RateDetailHtmlRender){product.RateDetailHtmlRender={};}
if(text==''){text='<li class="unavail">Not available for bookings '+V3.CustomisationSettings.Words.CommencingDate.toLowerCase()+' on this day.</li>';}
text='<ul>'+text+'</ul>';product.RateDetailHtmlRender[date]={Rates:text,Note:strAdvertisedRateExplaination};},constructRatePopupHtmlRenderForTEA:function(product,dayPriceDetail,date,productDailyRate){var i,items,defaultItem,text=null;if(productDailyRate.StartTimes.length<=V3.Async.Branding.MaxStartTimesDisplayed){items=V3.Async.constructListItemsForTEA(product,date,productDailyRate.StartTimes,false);defaultItem=items[productDailyRate.DefSTI];var st,isMultiple=null;for(i in items){if(isMultiple==null){isMultiple=false;}else if(isMultiple==false){isMultiple=true;break;}}
for(i in items){st=items[i];if(text==null){text='<div class="starttimes'+(isMultiple?' multiple':' single')+'"><span class="title">Available '+V3.CustomisationSettings.Words.CommencingCheckIn+' times</span><span class="del">:</span><ul>';}
text+='<li class="'+(st.Total.IsSpecial?'sp ':'')+(defaultItem.Total.Price==st.Total.Price?'sameprice':'diffprice')+'">'
+'<span class="ti">'+formatDate(new Date(productDailyRate.StartTimes[i].SD),V3.Async.Branding.TimeFormat)+'</span>'
+'<span class="cost"> - '+st.Total.Price+st.Total.Save+'</span>'
+'</li>';}
if(text!=null){text+='</ul></div>';}}
else{items=V3.Async.constructListItemsForTEA(product,date,[productDailyRate.StartTimes[productDailyRate.DefSTI]],false);defaultItem=items[0];var minPrice=productDailyRate.StartTimes[0].TP,maxPrice=productDailyRate.StartTimes[0].TP;for(i=0;i<productDailyRate.StartTimes.length;i++){if(minPrice>productDailyRate.StartTimes[i].TP){minPrice=productDailyRate.StartTimes[i].TP;}
if(maxPrice<productDailyRate.StartTimes[i].TP){maxPrice=productDailyRate.StartTimes[i].TP;}}
text='<div class="starttimes singleDescription"><span class="title">There are '
+productDailyRate.StartTimes.length
+' '
+V3.CustomisationSettings.Words.CommencingCheckIn.toLowerCase()
+' times available ranging from '
+formatDate(new Date(productDailyRate.StartTimes[0].SD),V3.Async.Branding.TimeFormat)
+' to '
+formatDate(new Date(productDailyRate.StartTimes[productDailyRate.StartTimes.length-1].SD),V3.Async.Branding.TimeFormat)
+'</span>';if(minPrice==maxPrice){text+='<span class="cost sameprice"> all priced at $'+minPrice.toFixed(2)+' in total</span>';}else{text+='<span class="cost diffprice"> with prices ranging from $'+minPrice.toFixed(2)+' to $'+maxPrice.toFixed(2)+'</span>';}
text+='.</div>';}
text+='<div class="advertised"><span class="title">Price breakdown (if available)</span><span class="del">:</span><ul>';var key;for(key in defaultItem){text+=(defaultItem[key].IsSpecial?'<li class="sp '+key+'">':'<li>')
+defaultItem[key].Html
+'</li>';}
text+='</ul></div>';if(!product.RateDetailHtmlRender){product.RateDetailHtmlRender={};}
product.RateDetailHtmlRender[date]={Rates:text,Note:''};},processProductRate:function(data,productDailyRate,product,date){try{var dayPriceDetail=product.DailyPriceDetail[date];if(!dayPriceDetail){return;}
var checkForSpecial=false;if(productDailyRate.DefSTI!=null){if(!dayPriceDetail.Rates){dayPriceDetail.Rates={};}
dayPriceDetail.Rates[data.Duration]={'Total':productDailyRate.StartTimes[productDailyRate.DefSTI].TP,'Rate':Math.ceil(productDailyRate.StartTimes[productDailyRate.DefSTI].TP/data.Duration)};}
var updateAdvertisedPrice=false;if(dayPriceDetail.DisplayedPrice==null||data.Duration<dayPriceDetail.DisplayedPriceCriteria.Duration){updateAdvertisedPrice=true;}
else if(dayPriceDetail.DisplayedPriceCriteria.Duration==data.Duration&&productDailyRate.DP<dayPriceDetail.DisplayedPrice){updateAdvertisedPrice=true;}
if(updateAdvertisedPrice){dayPriceDetail.DisplayedPrice=productDailyRate.DP;dayPriceDetail.DisplayedPriceCriteria={'CommencingOn':new Date(productDailyRate.DPCO),'Duration':data.Duration};if(product.FullRate!=null&&(product.Grid.SpecialRateRequiredDifference!=null)){fullRateQuote=product.FullRate.ForCurrentSearch.Total*data.Duration;var quote=productDailyRate.DP*data.Duration;if(Math.round(100*fullRateQuote*(1-product.Grid.SpecialRateRequiredDifference))>=Math.round(quote*100)){dayPriceDetail.IsSpecial=true;}else{dayPriceDetail.IsSpecial=false;}}
if(product.MaxPax<V3.Async.SearchCriteria.getTotalPax()){product.MaxPax=V3.Async.SearchCriteria.getTotalPax();try{$('.maxpax',product.ProductRow)[0].innerHTML="Max "+product.MaxPax+' '+V3.CustomisationSettings.Words.Guests;}catch(err){}}
if(!product.Grid.ShowSingleRow||product==V3.Async.Status.SelectedProduct){V3.Async.updateDayRateUI(dayPriceDetail);if(product.Notification.visible){product.Notification.hide();V3.Async.Hooks.ProductRowStateChanged(product,{NotificationVisible:false,DailyCellsVisible:true});}}}
if(data.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){this.constructRatePopupHtmlRenderForAccomm(product,dayPriceDetail,date);}else{this.constructRatePopupHtmlRenderForTEA(product,dayPriceDetail,date,productDailyRate);}
if(V3.Async.Status.ActiveProductPopupControl==product.Popup&&product.Popup.DisplayingForDate.equals(date)){product.Popup.update(product.RateDetailHtmlRender[date]);}
V3.Async.Hooks.NewRateReceived(product,date,data.Duration,productDailyRate.StartTimes[productDailyRate.DefSTI],productDailyRate.StartTimes);}catch(err){V3.Log.Error('exception was thrown in processProductRate(..)','err',err);}},moveToNextSearch:function(){try{if(V3.Async.IndexOfCurrentSearch+1<V3.Async.SearchesToPerform.length){V3.Async.IndexOfCurrentSearch++;V3.Log.Debug('Calling for new data, numnights='+V3.Async.SearchesToPerform[V3.Async.IndexOfCurrentSearch]);V3.Async.CurrentAjaxCall=Page.WebMethods.GetAvailability(V3.Async.SearchCriteria,V3.Async.SearchesToPerform[V3.Async.IndexOfCurrentSearch],V3.Async.WebService.callbackOnNewAvailability,V3.Async.WebService.callbackOnError);return true;}else{V3.Async.CurrentAjaxCall=null;return false;}}
catch(err){V3.Log.Error('unexpected error has occurred during moveToNextSearch()','err',err);V3.Async.CurrentAjaxCall=null;return false;}},callbackOnError:function(obj,msg,exc){var detectedAbort=V3.Utils.WebServices.isAborting(obj,msg,exc);if(detectedAbort){V3.Log.Warn('callbackOnError was invoked - detected as abort','args',{msg:msg,exc:exc,obj:obj},true);return;}
V3.Log.Error('callbackOnError was invoked','args',{msg:msg,exc:exc,obj:obj},true);if(V3.Async.WebService.moveToNextSearch()){V3.Async.IsUpdating=true;}else{V3.Async.IsUpdating=false;V3.Async.asyncSearchComplete();}
V3.Utils.NotifyUser(1);},callbackOnNewAvailability:function(data){var hasCalledMoveToNextSearch=false,isUpdating=false;try{var stopwatch=new V3.Utils.StopWatch();V3.Log.Debug('Received webservice response','data',data);if(!data.Success){V3.Log.Error("Response marked as unsuccessful!. Error= "+data.ErrorMessage);V3.Utils.NotifyUser(data.ErrorCode);}else{if(data.SearchCriteria.InstanceId!==V3.Async.SearchCriteria.InstanceId){V3.Log.Warn("dropping results with id: "+data.InstanceId);return;}
hasCalledMoveToNextSearch=true;isUpdating=V3.Async.WebService.moveToNextSearch();stopwatch.start();var shortname,productId,strDate;for(shortname in data.Results){if(!V3.Async.Grids[shortname]){continue;}
for(productId in data.Results[shortname]){if(!V3.Async.Grids[shortname].Products[productId]){continue;}
for(strDate in data.Results[shortname][productId]){var date=new Date(strDate);var productDailyRate=data.Results[shortname][productId][strDate];var product=V3.Async.Grids[shortname].Products[productId];V3.Async.WebService.processProductRate(data,productDailyRate,product,date);}}}
V3.Log.Info("Rendering new availability results took: "+stopwatch.stop().duration+'ms');}}
catch(err){V3.Log.Error('unexpected error during callbackOnNewAvailability','err',err);}
finally{if(!hasCalledMoveToNextSearch){isUpdating=V3.Async.WebService.moveToNextSearch();}
V3.Async.IsUpdating=isUpdating;if(!isUpdating){V3.Async.asyncSearchComplete();}}}},createRateCell:function(product){var e=document.createElement('div');product.FullRateCell.appendChild(e);product.FullRateCell=e;product.FullRateCell.style.position='relative';e=document.createElement('span');e.className='label';product.FullRateCell.Label=e;product.FullRateCell.appendChild(e);e=document.createElement('div');e.className='cover';e.style.position='absolute';e.style.top='0px';e.style.left='0px';e.style.width='100%';e.style.height='100%';e.style.display='none';product.FullRateCell.Cover=e;product.FullRateCell.appendChild(e);},calculateFullRate:function(){var shortname,productId;for(shortname in V3.Async.Grids){var grid=V3.Async.Grids[shortname];for(productId in grid.Products){var product=grid.Products[productId];if(!product.FullRateCell){continue;}
var newText='N/A';if(product.FullRate){var totalFullRate;if(V3.Async.SearchCriteria.IndustryCategoryGroup=='ACCOMM'){totalFullRate=product.FullRate.Total.toFixed(0);product.FullRate.ForCurrentSearch={'Total':totalFullRate};}else{totalFullRate=((V3.Async.SearchCriteria.Adults*product.FullRate.PerAdult)+
(V3.Async.SearchCriteria.Child*product.FullRate.PerChild)+
(V3.Async.SearchCriteria.Concession*product.FullRate.PerConcession)).toFixed(0);product.FullRate.ForCurrentSearch={'Adult':(V3.Async.SearchCriteria.Adults==0?0:product.FullRate.PerAdult),'Child':(V3.Async.SearchCriteria.Child==0?0:product.FullRate.PerChild),'Concession':(V3.Async.SearchCriteria.Concession==0?0:product.FullRate.PerConcession),'Total':totalFullRate};}
newText='$'+totalFullRate;}
if(product.FullRateCell.Label.innerHTML!=newText){if((!grid.ShowSingleRow||V3.Async.Status.SelectedProduct==product)){if(V3.Async.Branding.Animate){(function(c,newText){$(c.Cover).stop().fadeIn('fast',function(){c.Label.innerHTML=newText;$(c.Cover).fadeOut('fast')});})(product.FullRateCell,newText);}else{product.FullRateCell.Label.innerHTML=newText;}}}}}},asyncGridPrepareForNewSearch:function(isNewCriteria,isFake){this.isSearchNewCriteria=isNewCriteria;var stopwatch=new V3.Utils.StopWatch().start();this.hideActivePopup();var totalPaxBeingSearched=V3.Async.SearchCriteria.getTotalPax();var shortname,productId,date;var atleastOneProductIsAvailForSearch=false;this.calculateFullRate();for(shortname in V3.Async.Grids){var grid=V3.Async.Grids[shortname];for(productId in grid.Products){var product=grid.Products[productId];date=V3.Async.Status.Constructed.FromDate;while(date.valueOf()<V3.Async.Status.Constructed.ToDate.valueOf()){var dailyInfo=product.DailyPriceDetail[date];if(!isNewCriteria){if(!grid.ShowSingleRow||V3.Async.Status.SelectedProduct==product){this.updateDayRateUI(dailyInfo,!isNewCriteria);}}
if(!isFake&&V3.Async.Status.VisibleDates.containsDate(date)){dailyInfo.DisplayedPrice=null;dailyInfo.IsSpecial=false;dailyInfo.Rates={};}
if(isNewCriteria){if(!grid.ShowSingleRow||V3.Async.Status.SelectedProduct==product){this.updateDayRateUI(dailyInfo,!isNewCriteria);}}
date=date.addDays(1);}
if(product.MaxPax>=totalPaxBeingSearched){if(!grid.ShowSingleRow||V3.Async.Status.SelectedProduct==product){product.Notification.hide();V3.Async.Hooks.ProductRowStateChanged(product,{NotificationVisible:false,DailyCellsVisible:true});}
atleastOneProductIsAvailForSearch=true;}else{if(!grid.ShowSingleRow||V3.Async.Status.SelectedProduct==product){product.Notification.Label.setText('This '+V3.CustomisationSettings.Words.ProductSingular+' has a maximum capacity of '+product.MaxPax+' '+V3.CustomisationSettings.Words.Guests.toLowerCase()+'. Click <a href="javascript:V3.Async.setSearch('+product.MaxPax+',0,0);V3.Async.startAsyncSearch(true);">here</a> to search for '+product.MaxPax+' '+V3.CustomisationSettings.Words.GuestNamesAdult.toLowerCase()+'.');product.Notification.show();V3.Async.Hooks.ProductRowStateChanged(product,{NotificationVisible:true,DailyCellsVisible:false});}}}}
V3.Log.Info('asyncGridPrepareForNewSearch(..) took: '+stopwatch.stop().duration+'ms');return atleastOneProductIsAvailForSearch;},asyncSearchComplete:function(){var stopwatch=new V3.Utils.StopWatch().start();var shortname,productId,date,grid;for(shortname in V3.Async.Grids){grid=V3.Async.Grids[shortname];for(productId in grid.Products){if(!grid.ShowSingleRow||(V3.Async.Status.SelectedProduct&&productId==V3.Async.Status.SelectedProduct.Id)){date=V3.Async.Status.Constructed.FromDate;while(date.valueOf()<V3.Async.Status.Constructed.ToDate.valueOf()){this.updateDayRateUI(grid.Products[productId].DailyPriceDetail[date]);date=date.addDays(1);}}}}
var sw=new V3.Utils.StopWatch('EntireSearch');if(sw.isRunning){V3.Log.Info('Entire search took: '+sw.stop().duration+'ms');}
V3.Async.Hooks.SearchCompleted();V3.Log.Info('asyncSearchComplete() took: '+stopwatch.stop().duration+'ms');},asyncGridEmptyAndReset:function(){var shortname,productId,date;for(shortname in V3.Async.Grids){for(productId in V3.Async.Grids[shortname].Products){if(!V3.Async.Grids[shortname].ShowSingleRow||(V3.Async.Status.SelectedProduct&&V3.Async.Status.SelectedProduct.Id==productId)){for(date in V3.Async.Grids[shortname].Products[productId].DailyPriceDetail){V3.Async.Grids[shortname].Products[productId].Container.removeChild(V3.Async.Grids[shortname].Products[productId].DailyPriceDetail[date].UI);}}
V3.Async.Grids[shortname].Products[productId].DailyPriceDetail={};}
$(V3.Async.Grids[shortname].Header.Container).empty();}
V3.Async.Status.Constructed.clear();},inlineProductSelected:function(sender){var newProductId=sender.value;if(V3.Async.Status.SelectedProduct==null||V3.Async.Status.SelectedProduct.Id!=newProductId){var shortname,productid,product=null;for(shortname in V3.Async.Grids){if(V3.Async.Grids[shortname].Products[newProductId]){product=V3.Async.Grids[shortname].Products[newProductId];break;}}
if(product!=null){V3.Async.Status.SelectedProduct=product;V3.Async.asyncGridPrepareForNewSearch(false,true);V3.Async.asyncSearchComplete();if(V3.Async.Status.HighlightedCell){V3.Async.Hooks.SelectionChanged(V3.Async.Status.SelectedProduct,V3.Async.Status.HighlightedCell.Date);}}}},scrollCalendarToDate:function(){var newDate=V3.Async.Controls.getDate();if(V3.Async.Status.VisibleDates.containsDate(newDate)){return;}
var dayOffset=newDate.getDaysBetween(V3.Async.Status.VisibleDates.From);var maxScrollLimit=21;if(!V3.Async.Status.Constructed.forDate(newDate)&&((dayOffset<-maxScrollLimit)||(dayOffset-V3.Async.SearchCriteria.NumberOfDays)>maxScrollLimit)){var lookToTheFuture=false;if(newDate.addDays(V3.Async.SearchCriteria.NumberOfDays).valueOf()>=V3.Async.DateRange.Max.valueOf()){newDate=V3.Async.DateRange.Max.addDays(-1-V3.Async.SearchCriteria.NumberOfDays);lookToTheFuture=true;}
this.asyncGridEmptyAndReset();V3.Async.Status.VisibleDates.setDate(newDate);this.asyncGridAddDates(V3.Async.SearchCriteria.NumberOfDays,false);return this.scrollCalendar(lookToTheFuture,false,newDate);}else{return this.scrollCalendar(dayOffset);}},scrollCalendar:function(forwardDirection_or_offset,optional_EnableAnimation,targetDate){var i,dayOffset=0;if(optional_EnableAnimation==null||optional_EnableAnimation==undefined)optional_EnableAnimation=true;var scrollForwards;if(typeof(forwardDirection_or_offset)=='number'){scrollForwards=false;dayOffset=forwardDirection_or_offset;if(dayOffset>0&&V3.Async.Status.VisibleDates.From.addDays(dayOffset+V3.Async.SearchCriteria.NumberOfDays).valueOf()>=V3.Async.DateRange.Max.valueOf()){scrollForwards=true;}
if(!targetDate){targetDate=V3.Async.Controls.getDate();}}else{scrollForwards=forwardDirection_or_offset;}
if(scrollForwards){if(V3.Async.Status.VisibleDates.To.addDays(dayOffset).valueOf()>=V3.Async.DateRange.Max.valueOf()){dayOffset=V3.Async.DateRange.Max.getDaysBetween(V3.Async.Status.VisibleDates.To);}else{for(i=1;i<=7;i++){if(V3.Async.DateRange.Max.equals(V3.Async.Status.VisibleDates.To.addDays(i+dayOffset))||V3.Async.Status.VisibleDates.From.addDays(i+dayOffset).getDayOfWeek()==V3.Async.Branding.CellDOWAlignment){if(i<=3&&V3.Async.SearchCriteria.NumberOfDays>=10){if(V3.Async.DateRange.Max>V3.Async.Status.VisibleDates.To.addDays(i+dayOffset+7)){i+=7;}}
dayOffset=i+dayOffset;break;}}}}else{if(V3.Async.Status.VisibleDates.From.addDays(dayOffset).valueOf()<=V3.Async.DateRange.Min.valueOf()){dayOffset=V3.Async.DateRange.Min.getDaysBetween(V3.Async.Status.VisibleDates.From);}
else{for(i=1;i<=7;i++){if(V3.Async.DateRange.Min.equals(V3.Async.Status.VisibleDates.From.addDays(-i+dayOffset))||V3.Async.Status.VisibleDates.From.addDays(-i+dayOffset).getDayOfWeek()==V3.Async.Branding.CellDOWAlignment){dayOffset=-i+dayOffset;break;}}}}
if(V3.Async.Status.VisibleDates.From.addDays(dayOffset+V3.Async.SearchCriteria.NumberOfDays-7).valueOf()>V3.Async.DateRange.Max.valueOf()){dayOffset-=7;}
if(dayOffset==0){return false;}
if(!targetDate){targetDate=V3.Async.Controls.getDate().addDays(dayOffset);}
if(V3.Async.Status.VisibleDates.containsDate(targetDate)){V3.Async.Controls.updateDateOnCalendar(targetDate);}
var newDate=V3.Async.Status.VisibleDates.From.addDays(dayOffset);if(!V3.Async.Status.Constructed.forDate(newDate)){if(dayOffset>0){this.asyncGridAddDates(Math.abs(dayOffset),false);this.asyncGridRunCleanup(true);}else{this.asyncGridAddDates(Math.abs(dayOffset),true);this.asyncGridRunCleanup(false);}}
V3.Async.Status.VisibleDates.setDate(newDate);this.setAsyncGridLeftPosition(optional_EnableAnimation);return true;},getAsyncGridLeftPositionOfDate:function(grid,date){if(date.valueOf()<V3.Async.Status.Constructed.FromDate.valueOf()){date=V3.Async.Status.Constructed.FromDate;}else if(date.valueOf()>V3.Async.Status.Constructed.ToDate.valueOf()){date=V3.Async.Status.Constructed.ToDate;}
return $(grid.HeaderCells[date]).position().left;},setAsyncGridLeftPosition:function(enableAnimation){var newLeft=null;var shortname,grid;for(shortname in V3.Async.Grids){grid=V3.Async.Grids[shortname];if(newLeft==null){newLeft=this.getAsyncGridLeftPositionOfDate(grid,V3.Async.Status.VisibleDates.From);newLeft=(V3.Async.Branding.Calculated.CellWidth+V3.Async.Branding.Calculated.CellBorderWidth)*Math.round(newLeft/(V3.Async.Branding.Calculated.CellWidth+V3.Async.Branding.Calculated.CellBorderWidth));}
if(enableAnimation==true&&V3.Async.Branding.Animate==true&&V3.Async.Status.TotalProductCount<12){var objAnimationParams,offset;offset=(-$(grid.Header.Container).position().left)-newLeft;if(offset>0){objAnimationParams={'left':'+='+Math.abs(offset)+'px'};}else{objAnimationParams={'left':'-='+Math.abs(offset)+'px'};}
$(grid.Header.Container).stop().animate(objAnimationParams,{duration:V3.Async.Branding.AnimationDuration});$(grid.ProductRowsContainer).stop().animate(objAnimationParams,{duration:V3.Async.Branding.AnimationDuration});}else{grid.Header.Container.style.left=(-newLeft)+'px';grid.ProductRowsContainer.style.left=(-newLeft)+'px';}}
V3.Async.Status.Constructed.CurrentLeftOffset=newLeft;},cellClicked:function(sender,optionalDontDeselect){var current=V3.Async.Status.HighlightedCell;V3.Async.Controls.updateDateOnCalendar(sender.Date);if(sender.Grid.ShowSingleRow){if(sender.Product){if(current){RemoveCssStyle(current,'highlight');if(current==sender&&!optionalDontDeselect){V3.Async.Status.HighlightedCell=null;V3.Async.Hooks.Deselected();return;}}}else{RemoveCssStyle(current,'highlight');sender=V3.Async.Status.SelectedProduct.DailyPriceDetail[sender.Date].UI;}
AddCssStyle(sender,'highlight');V3.Async.Status.HighlightedCell=sender;V3.Async.Hooks.SelectionChanged(V3.Async.Status.SelectedProduct,sender.Date);}
else{if(sender.Product){V3.Async.Status.SelectedProduct=sender.Product;}
if(sender.Product){if(current){RemoveCssStyle(current,'highlight');if(current==sender){V3.Async.Status.SelectedProduct=null;V3.Async.Status.HighlightedCell=null;V3.Async.Hooks.Deselected();return;}}}
else{if(current){RemoveCssStyle(current,'highlight');sender=V3.Async.Status.SelectedProduct.DailyPriceDetail[sender.Date].UI;}else{return;}}
V3.Async.Hooks.SelectionChanged(V3.Async.Status.SelectedProduct,sender.Date);AddCssStyle(sender,'highlight');V3.Async.Status.HighlightedCell=sender;if(sender.Product.DailyPriceDetail[sender.Date].DisplayedPrice){var bookNowButton=$(sender.Product.ProductRow).children().last().children("input").first();if(bookNowButton){bookNowButton.click();}}}},updateHighlightedCell:function(targetDate){var targetGrid;if(V3.Async.Status.HighlightedCell){targetGrid=V3.Async.Status.HighlightedCell.Grid;}else if(V3.Async.Status.SelectedProduct){targetGrid=V3.Async.Status.SelectedProduct.Grid;}
else{return;}
var targetDPD=V3.Async.Status.SelectedProduct.DailyPriceDetail[targetDate];if(targetDPD){this.cellClicked(targetDPD.UI,true);}},setSearch:function(adults,children,concessions){V3.Async.Controls.ddlAdults.value=adults;if(V3.Async.Controls.ddlChildren){V3.Async.Controls.ddlChildren.value=children;}
if(V3.Async.Controls.ddlConcessions){V3.Async.Controls.ddlConcessions.value=concessions;}},getCurrentSearchCriteria:function(readPaxLevels){var e=V3.Async.SearchCriteria;e.IndustryCategoryGroup=(V3.Async.Controls.IsAccommodation?"ACCOMM":"TEA");e.StartDate=formatDate(V3.Async.Status.VisibleDates.From,'yyyy/MM/dd');if(readPaxLevels){e.Adults=parseInt(V3.Async.Controls.ddlAdults.value);e.Child=(V3.Async.Controls.ddlChildren==null?0:parseInt(V3.Async.Controls.ddlChildren.value));e.Concession=(V3.Async.Controls.ddlConcessions==null?0:parseInt(V3.Async.Controls.ddlConcessions.value));}
e.InstanceId++;V3.Log.Watch('V3.Async.SearchCriteria',e);},startAsyncSearch:function(isNewCriteria){new V3.Utils.StopWatch('EntireSearch').reset().start();this.getCurrentSearchCriteria(isNewCriteria);V3.Async.IsUpdating=true;V3.Async.IndexOfCurrentSearch=0;if(isNewCriteria){if(V3.Async.Status.HighlightedCell&&V3.Async.Status.HighlightedCell.Grid.ShowSingleRow){var targetDate=V3.Async.Controls.getDate();if(V3.Async.Status.HighlightedCell.Date!=targetDate){this.updateHighlightedCell(targetDate);}}}
V3.Log.Debug("Calling for new data");if(this.asyncGridPrepareForNewSearch(isNewCriteria)){if(V3.Async.CurrentAjaxCall!==null){V3.Async.CurrentAjaxCall.abort();}
V3.Async.CurrentAjaxCall=Page.WebMethods.GetAvailability(V3.Async.SearchCriteria,V3.Async.SearchesToPerform[V3.Async.IndexOfCurrentSearch],V3.Async.WebService.callbackOnNewAvailability,V3.Async.WebService.callbackOnError);}
if(isNewCriteria){V3.Async.Hooks.SearchStarted();}},createProductNotificationElement:function(cellWidth,cellHeight,bdrW,grid,product,productNum){var n=document.createElement('div');n.className='productNotificationContainer';n.style.display='none';n.style.position='absolute';n.style.width=V3.Async.Status.Constructed.Width+'px';n.style.height=(cellHeight)+'px';n.style.marginBottom=(bdrW)+'px';n.style.top=(((cellHeight+bdrW)*productNum))+'px';var l=document.createElement('span');l.className='label';l.style.position='absolute';n.appendChild(l);n.Label=l;l.setText=function(msg){V3.Utils.setInnerText(this,msg);};V3.Utils.Html.appendVisibilityShorthand(n,true,V3.Async.Branding.Animate);return n;},createProductContainer:function(cellWidth,cellHeight,bdrW,grid,product,productNum){var d=document.createElement('div');d.className='productRow';d.style.position='absolute';d.style.width=grid.Header.Container.style.width;d.style.height=(cellHeight+bdrW)+'px';d.style.marginBottom=(bdrW)+'px';d.style.top=(((cellHeight+bdrW)*productNum))+'px';$(product.ProductRow).children().first().height(cellHeight);$('td > div > div.innerContainer',product.ProductRow).height(cellHeight);return d;},createCell:function(cellWidth,cellHeight,bdrW,date,cssName,isRateCell,includeLabel){var UI=document.createElement('div');UI.className=cssName+' '+date.getDayOfWeek().substr(0,3).toLowerCase();UI.style.cssFloat='left';UI.style.styleFloat='left';UI.style.marginRight=bdrW+'px';UI.style.overflow='hidden';UI.style.position='relative';UI.Date=date;if(isRateCell){UI.style.width=cellWidth+'px';UI.style.height=(cellHeight)+'px';}
UI.onclick=function(){V3.Async.cellClicked(this);};if(includeLabel){var lbl=document.createElement('div');lbl.className='label';UI.appendChild(lbl);UI.Label=lbl;UI.Label.setText=function(msg){V3.Utils.setInnerText(this,'<span>'+msg+'</span>');}}
if(isRateCell&&V3.Async.Branding.ShowImages){var img=new Image();img.src=V3.Async.Branding.ImageUrls['loading'];img.style.position='absolute';img.style.left='0px';img.style.top='0px';img.style.visibility='hidden';img.style.styleFloat='left';img.style.cssFloat='left';UI.appendChild(img);UI.Img=img;}
return UI;},asyncGridRunCleanup:function(removeFromStart){var maxCellCount=45;var daysToRemove=Math.abs(V3.Async.Status.Constructed.ToDate.getDaysBetween(V3.Async.Status.Constructed.FromDate))-maxCellCount;if(daysToRemove<=0){return;}
for(shortname in V3.Async.Grids){for(i=0;i<daysToRemove;i++){if(removeFromStart){date=V3.Async.Status.Constructed.FromDate.addDays(i);}else{date=V3.Async.Status.Constructed.ToDate.addDays(-i);}
for(productId in V3.Async.Grids[shortname].Products){if(!V3.Async.Grids[shortname].ShowSingleRow||(V3.Async.Status.SelectedProduct&&V3.Async.Status.SelectedProduct.Id==productId)){product=V3.Async.Grids[shortname].Products[productId];if(product.DailyPriceDetail[date]){product.Container.removeChild(product.DailyPriceDetail[date].UI);delete product.DailyPriceDetail[date];}}}
if(V3.Async.Grids[shortname].HeaderCells[date]){V3.Async.Grids[shortname].Header.Container.removeChild(V3.Async.Grids[shortname].HeaderCells[date]);delete V3.Async.Grids[shortname].HeaderCells[date];}
V3.Async.Grids[shortname].Header.Container.style.left=-V3.Async.Status.VisibleDates.CurrentLeftOffset+'px';V3.Async.Grids[shortname].ProductRowsContainer.style.left=-V3.Async.Status.VisibleDates.CurrentLeftOffset+'px';}}
this.setAsyncGridLeftPosition(false);if(removeFromStart){V3.Async.Status.Constructed.FromDate=V3.Async.Status.Constructed.ToDate.addDays(-maxCellCount);}else{V3.Async.Status.Constructed.ToDate=V3.Async.Status.Constructed.FromDate.addDays(maxCellCount);}},asyncGridAddDates:function(numberToAdd,isPast){var cellWidth=V3.Async.Branding.Calculated.CellWidth;var cellHeight=V3.Async.Branding.Calculated.CellHeight;var bdrW=parseInt($('.productNameCell').css('border-bottom-width').replace(/px/g,''));var beginAtDate,recalculateVisibleWidth;if(V3.Async.Status.Constructed.Width==0){recalculateVisibleWidth=true;beginAtDate=V3.Async.Status.VisibleDates.From
V3.Async.Status.Constructed.FromDate=beginAtDate;V3.Async.Status.Constructed.ToDate=beginAtDate;V3.Async.Status.Constructed.CurrentLeftOffset=0;}else{if(isPast){beginAtDate=V3.Async.Status.Constructed.FromDate.addDays(-1);}else{beginAtDate=V3.Async.Status.Constructed.ToDate;}}
var shortname,i,date,insertPoint,visibleWidth=V3.Async.Status.Constructed.Width;for(shortname in V3.Async.Grids){var grid=V3.Async.Grids[shortname];grid.Table.style.borderCollapse='collapse';grid.Table.border='0px';grid.Table.cellSpacing='0px';grid.Table.cellPadding='0px';if(!grid.Header.Container){grid.Header.Container=document.createElement('div');grid.Header.Container.className='headerRow';grid.Header.appendChild(grid.Header.Container);}
for(i=0;i<numberToAdd;i++){if(isPast){date=beginAtDate.addDays(-i);}else{date=beginAtDate.addDays(i);}
var dateUI=this.createCell(cellWidth,cellHeight,bdrW,date,'date',false,true);dateUI.Label.setText(formatDate(date,'ddd\r\nd\r\nMMM'));dateUI.Grid=grid;grid.HeaderCells[date]=dateUI;if(isPast){$(grid.Header.Container).prepend(dateUI);}else{$(grid.Header.Container).append(dateUI);}
cellWidth=$(dateUI).width();cellHeight=$(dateUI).height();}
if(recalculateVisibleWidth){visibleWidth=((V3.Async.SearchCriteria.NumberOfDays*(cellWidth+bdrW))-bdrW);V3.Async.Status.Constructed.Width=visibleWidth;recalculateVisibleWidth=false;}
grid.Header.style.width=visibleWidth+'px';grid.Header.style.height=(cellHeight)+'px';grid.Header.style.overflow='hidden';grid.Header.style.position='relative';grid.Header.Container.style.position='relative';grid.Header.Container.style.width=((grid.Header.Container.children.length*(cellWidth+bdrW))+bdrW+visibleWidth)+'px';grid.Header.Container.style.height=(cellHeight)+'px';grid.ProductRowsContainer.style.position='relative';grid.ProductRowsContainer.style.width='auto';grid.ProductRowsContainer.style.height='auto';grid.ProductRowsIsolator.style.position='relative';grid.ProductRowsIsolator.style.overflow='hidden';grid.ProductRowsIsolator.style.width=grid.Header.style.width;grid.Table.style.width=(visibleWidth+260)+'px';var productId,productNum=0;for(productId in grid.Products){var product=grid.Products[productId];if(!product.Grid){product.Grid=grid;product.RateDetailHtmlRender='';product.Popup=new ProductPopupControl(product,'center bottom',1);product.Popup.UI.onclick=V3.Async.hideActivePopup;if(grid.ShowSingleRow&&grid.FirstProduct){product.Container=grid.FirstProduct.Container;product.Notification=grid.FirstProduct.Notification;product.FullRateCell=grid.FirstProduct.FullRateCell;}
else{product.Container=this.createProductContainer(cellWidth,cellHeight,bdrW,grid,product,productNum);if(V3.Utils.UserAgent!=UserAgentsEnum.iPad){product.Container.onmouseout=this.hideActivePopup;}
grid.ProductRowsContainer.appendChild(product.Container);product.Notification=this.createProductNotificationElement(cellWidth,cellHeight,bdrW,grid,product,productNum);grid.ProductRowsIsolator.appendChild(product.Notification);if(product.FullRateCell&&!product.FullRateCell.Label){this.createRateCell(product);}}}
product.Container.style.width=grid.Header.Container.style.width;for(i=0;i<numberToAdd;i++){if(isPast){date=beginAtDate.addDays(-i);}else{date=beginAtDate.addDays(i);}
var rateUI;if(!grid.ShowSingleRow||!grid.FirstProduct||product==grid.FirstProduct){rateUI=this.createCell(cellWidth,cellHeight,bdrW,date,'productRate',true,true);rateUI.Grid=grid;rateUI.Product=product;rateUI.Date=date;rateUI.onmouseover=function(){V3.Async.showProductPopup(this.Product,this.Date);};if(isPast){$(product.Container).prepend(rateUI);}else{$(product.Container).append(rateUI);}}
else{rateUI=grid.FirstProduct.DailyPriceDetail[date].UI;}
if(!product.DailyPriceDetail){product.DailyPriceDetail={};}
product.DailyPriceDetail[date]={UI:rateUI,Price:null,Rates:{}};}
productNum++;if(!grid.FirstProduct){grid.FirstProduct=product;}}
grid.ProductRowsIsolator.style.height=((grid.ProductRowsContainer.children.length*(cellHeight+bdrW))-(bdrW))+'px';}
V3.Async.Branding.Calculated.CellWidth=cellWidth;V3.Async.Branding.Calculated.CellHeight=cellHeight;V3.Async.Branding.Calculated.CellBorderWidth=bdrW;$(".productsContainerCell").css("width",V3.Async.Status.Constructed.Width+'px');$(".headerContainerCell").css("width",V3.Async.Status.Constructed.Width+'px');this.setAsyncGridLeftPosition(false);if(isPast){V3.Async.Status.Constructed.FromDate=V3.Async.Status.Constructed.FromDate.addDays(-numberToAdd);}else{V3.Async.Status.Constructed.ToDate=V3.Async.Status.Constructed.ToDate.addDays(numberToAdd);}},GetMetrics:function(){var i,providerShortname,productId;var numAvail=0,numTotal=0,numProducts=0,numAvailProducts=0;for(providerShortname in V3.Async.Grids){var grid=V3.Async.Grids[providerShortname];for(productId in grid.Products){numProducts++;var isAvail=false;for(i=0;i<V3.Async.SearchCriteria.NumberOfDays;i++){var dpd=grid.Products[productId].DailyPriceDetail[V3.Async.Status.VisibleDates.From.addDays(i)];if(dpd&&dpd.DisplayedPrice!=null){isAvail=true;numAvail++;}}
if(isAvail){numAvailProducts++;}}
numTotal=numAvailProducts*V3.Async.SearchCriteria.NumberOfDays;break;}
return{'NormalisedAvailability':(numTotal==0?0:(numAvail*100/numTotal)),'ProductCount':numProducts,'AvailableProductCount':numAvailProducts,'SearchTime':new V3.Utils.StopWatch('EntireSearch').getCurrentDuration(),'NumberOfDaysOutSearched':(V3.Async.Status.VisibleDates.From.getDaysBetween(new Date()))};},load:function(){V3.Async.startAsyncSearch(true);},submit:function(sender){if(sender.target=="_blank"){if(V3.Async.Status.HighlightedCell){RemoveCssStyle(V3.Async.Status.HighlightedCell,'highlight');V3.Async.Status.SelectedProduct=null;V3.Async.Status.HighlightedCell=null;V3.Async.Hooks.Deselected();}}},unload:function(){if(V3.Async.CurrentAjaxCall){V3.Async.CurrentAjaxCall.abort();V3.Async.CurrentAjaxCall=null;}},initialiseAsyncGrids:function(channelShortname,numberOfDaysOnDisplay,targetDate,searchesToPerform,initiallySelectedProduct){var fun=function(){var stopwatch=new V3.Utils.StopWatch().start(),initialDate=targetDate;var shortnames=[];var shortname;for(shortname in V3.Async.Grids){shortnames.push(shortname);}
V3.Async.SearchesToPerform=searchesToPerform;V3.Async.SearchCriteria.IndustryCategoryGroup=(V3.Async.Controls.IsAccommodation?'ACCOMM':'TEA');V3.Async.SearchCriteria.ChannelShortname=channelShortname;V3.Async.SearchCriteria.Shortnames=shortnames;V3.Async.SearchCriteria.InstanceId=0;V3.Async.SearchCriteria.NumberOfDays=numberOfDaysOnDisplay;if(initialDate.addDays(V3.Async.SearchCriteria.NumberOfDays).valueOf()>=V3.Async.DateRange.Max.valueOf()){initialDate=V3.Async.DateRange.Max.addDays(-V3.Async.SearchCriteria.NumberOfDays);V3.Async.Status.VisibleDates.setDate(initialDate);V3.Async.asyncGridAddDates(numberOfDaysOnDisplay,false);V3.Async.scrollCalendar(true,false);}else{V3.Async.Status.VisibleDates.setDate(initialDate);V3.Async.asyncGridAddDates(numberOfDaysOnDisplay,false);if(V3.Async.Status.VisibleDates.From.getDayOfWeek()!=V3.Async.Branding.CellDOWAlignment){V3.Async.scrollCalendar(false,false);}}
V3.Async.Controls.updateDateOnCalendar(targetDate);for(shortname in V3.Async.Grids){if(V3.Async.Grids[shortname].ShowSingleRow&&V3.Async.Grids[shortname].Products[initiallySelectedProduct]){V3.Async.Status.SelectedProduct=V3.Async.Grids[shortname].Products[initiallySelectedProduct];V3.Async.Status.HighlightedCell=V3.Async.Grids[shortname].Products[initiallySelectedProduct].DailyPriceDetail[targetDate].UI;break;}}
V3.Log.Info('initialiseAsyncGrids(..) took: '+stopwatch.stop().duration+'ms');};if(V3.Utils.UserAgent==UserAgentsEnum.IE7){V3.Utils.OnLoaded.addEventHandler(function(){fun();V3.Utils.OnLoaded.addEventHandler(V3.Async.load);});}else{fun();V3.Utils.OnLoad.addEventHandler(V3.Async.load);}
V3.Utils.OnSubmit.addEventHandler(V3.Async.submit);V3.Utils.OnUnload.addEventHandler(V3.Async.unload);},registerGrid:function(providerShortname,tableControlId,hasFullRates,headerContainerId,ratesIsolator,ratesContainerId,navForwardsId,navBackwardsId,isSingleRow,specialRateRequiredDifference,saveTextRequiredDifference,products,productCount){V3.Async.Status.TotalProductCount+=productCount;V3.Async.Grids[providerShortname]={'Shortname':providerShortname,'ShowSingleRow':isSingleRow,'Table':document.getElementById(tableControlId),'HasFullRates':hasFullRates,'HeaderCells':{},'Header':document.getElementById(headerContainerId),'ProductRowsIsolator':document.getElementById(ratesIsolator),'ProductRowsContainer':document.getElementById(ratesContainerId),'Products':products,'NavigationControls':{'Forwards':document.getElementById(navForwardsId),'Backwards':document.getElementById(navBackwardsId)},'SpecialRateRequiredDifference':specialRateRequiredDifference,'SaveTextRequiredDifference':saveTextRequiredDifference,'ProductCount':productCount};}};function ProductPopupControl(product,position,margin){this.Position=position;this.CssStyle='ratePopup';this.Margin=margin;var e=document.createElement('div');;e.style.position='absolute';e.style.display='none';this.UI=e;e=document.createElement('div');e.className="header";this.Header=e;e=document.createElement('span');e.className="title";this.Header.Title=e;e=document.createElement('span');e.className="additionalInfo";this.Header.AdditionalInfo=e;e=document.createElement('div');e.className="body";this.Body=e;e=document.createElement('div');e.className="footer";this.Footer=e;this.Header.appendChild(this.Header.Title);this.Header.appendChild(this.Header.AdditionalInfo);this.UI.appendChild(this.Header);this.UI.appendChild(this.Body);this.UI.appendChild(this.Footer);this.Header.Title.innerHTML=product.Name;document.body.appendChild(this.UI);}
ProductPopupControl.prototype.update=function(rateInfo){this.Body.innerHTML=rateInfo.Rates;this.Footer.innerHTML=rateInfo.Note;};ProductPopupControl.prototype.hide=function(){this.UI.style.display='none';};ProductPopupControl.prototype.show=function(sender,rateInfo){var tt=this.UI;if(!isFinite(this.Margin))this.Margin=2;this.hide();this.update(rateInfo);tt.className=this.CssStyle;if(!this.Position||this.Position==''){this.Position='top left';}
if(this.Position.indexOf("right")!=-1){tt.className+=" rightAligned";}else if(this.Position.indexOf("center")!=-1){tt.className+=" centerAligned";}else{tt.className+=" leftAligned";}
if(this.Position.indexOf("bottom")!=-1){tt.className+=" bottomAligned";}else if(this.Position.indexOf("middle")!=-1){tt.className+=" middleAligned";}else{tt.className+=" topAligned";}
var pos=getPageCoords(sender);var width=$(tt).outerWidth();var height=$(tt).outerHeight();if(tt.className.indexOf('leftAligned')!=-1){tt.style.left=(pos.x-(width+this.Margin))+"px";}else if(tt.className.indexOf('rightAligned')!=-1){tt.style.left=(pos.x+sender.offsetWidth+this.Margin)+"px";}else if(tt.className.indexOf('centerAligned')!=-1){tt.style.left=((pos.x+(sender.offsetWidth/2))-(width/2))+"px";}
if(tt.className.indexOf('topAligned')!=-1){tt.style.top=(pos.y-height-this.Margin)+"px";}
else if(tt.className.indexOf('bottomAligned')!=-1){tt.style.top=((pos.y+sender.offsetHeight+this.Margin))+"px";}
else if(tt.className.indexOf('middleAligned')!=-1){tt.style.top=((pos.y+(sender.offsetHeight/2))-(height/2))+"px";}
tt.style.display='block';};V3.Async.BookingOptions={List:{show:function(){},hide:function(){}},UpdatingNotification:{show:function(){},hide:function(){}},WaitingNotification:{show:function(){},hide:function(){}},NotAvailableNotification:{show:function(){},hide:function(){}},PickupLocations:{show:function(){},hide:function(){}},ListItems:{},CustomRow:{Input:null,Droplist:null,QuoteLabel:null,Refreshing:null},CustomDurationValue:1,SearchCriteria:{},Quotes:{},InvalidCheckInDates:{},IsCurrentProductInWaitingState:false,CurrentProduct:{},CurrentProvider:'',TargetDate:new Date(),CurrentStartTime:null,CurrentDuration:null,Data:{value:'',IgnoreData:false},SearchesCompleted:{Main:true,Special:true},Hooks:{OnProductSelected:new V3.Utils.EventType('BookingOptions.ProductSelected','providerShortname, product, targetDate, duration, startTime, paxLevels, pickupLocationId'),OnProductDeselected:new V3.Utils.EventType('BookingOptions.ProductDeselected'),OnWaitingToReloadState:new V3.Utils.EventType('BookingOptions.WaitingToReloadState','isComplete'),__lastNotification:null,ProductSelected:function(){var objData=[V3.Async.BookingOptions.CurrentProvider,V3.Async.BookingOptions.CurrentProduct.Id,formatDate(V3.Async.BookingOptions.TargetDate,'yyyy/MM/dd'),V3.Async.BookingOptions.CurrentDuration,V3.Async.BookingOptions.CurrentStartTime,{'Adults':V3.Async.BookingOptions.SearchCriteria.Adults,'Child':V3.Async.BookingOptions.SearchCriteria.Child,'Concession':V3.Async.BookingOptions.SearchCriteria.Concession},((V3.Async.BookingOptions.PickupLocations&&V3.Async.BookingOptions.CurrentProduct.PickupLocations)?V3.Async.BookingOptions.PickupLocations.Select.value:null)];var l=this.__lastNotification;var strData=JSON.stringify(objData);V3.Async.BookingOptions.Data.value=strData;V3.Async.BookingOptions.Data.IgnoreData=true;if(strData!=l){this.__lastNotification=strData;objData[1]=V3.Async.BookingOptions.CurrentProduct;objData[2]=V3.Async.BookingOptions.TargetDate;this.OnProductSelected.fireWithParamArray(objData);}},ProductDeselected:function(){if(this.__lastNotification!=null){this.__lastNotification=null;this.OnProductDeselected.fire();}},_waitingToReloadStateHasBeenFired:false,WaitingToReloadState:function(isComplete){if(!this._waitingToReloadStateHasBeenFired||isComplete){this.OnWaitingToReloadState.fire(isComplete);this._waitingToReloadStateHasBeenFired=true;}}},updateSelectedItemCss:function(){var i;for(i in this.ListItems){SwitchCssStyle(this.ListItems[i],'selected','',this.ListItems[i].Input.checked);}
if(this.CustomRow){SwitchCssStyle(this.CustomRow,'selected','',this.CustomRow.Input.checked);}
if(this.PickupLocations){if(this.PickupLocations.Select.value!=this.PickupLocations.Select.options[0].value){AddCssStyle(this.PickupLocations,'optionSelected');}else{RemoveCssStyle(this.PickupLocations,'optionSelected');}}},radioOption_Selected:function(sender){if(V3.Utils.UserAgent==UserAgentsEnum.IE7){var i;for(i in V3.Async.BookingOptions.ListItems){V3.Async.BookingOptions.ListItems[i].Input.checked=false;}
sender.checked=true;}
V3.Async.BookingOptions.updateSelectedItemCss();var duration=1;var productId=V3.Async.BookingOptions.CurrentProduct.Id;var date=V3.Async.BookingOptions.TargetDate;var startTime;if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){duration=(sender.value=='other'?V3.Async.BookingOptions.CustomDurationValue:sender.value);if(!V3.Async.BookingOptions.Quotes[productId][date][duration]){return;}
startTime=V3.Async.BookingOptions.Quotes[productId][date][duration].DefaultStartTime;}else{if(!V3.Async.BookingOptions.Quotes[productId][date][duration]){return;}
if(sender.value=='startTimeSelector'){startTime=V3.Async.BookingOptions.Quotes[productId][date][duration].StartTimes[V3.Async.BookingOptions.CustomRow.Droplist.value];}else{startTime=V3.Async.BookingOptions.Quotes[productId][date][duration].StartTimes[sender.value];}}
V3.Async.BookingOptions.CurrentDuration=duration;V3.Async.BookingOptions.CurrentStartTime=startTime;V3.Async.BookingOptions.Hooks.ProductSelected();},addQuote:function(productId,date,duration,defaultStartTime,startTimes){if(!V3.Async.BookingOptions.Quotes[productId]){V3.Async.BookingOptions.Quotes[productId]={};}
if(!V3.Async.BookingOptions.Quotes[productId][date]){V3.Async.BookingOptions.Quotes[productId][date]={};}
if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){if(defaultStartTime==null){V3.Async.BookingOptions.Quotes[productId][date][duration]={'DefaultStartTime':null,'Rate':null,'Total':null};}else{V3.Async.BookingOptions.Quotes[productId][date][duration]={'DefaultStartTime':defaultStartTime,'Rate':(defaultStartTime.TP/duration),'Total':defaultStartTime.TP};}}else{V3.Async.BookingOptions.Quotes[productId][date][duration]={'DefaultStartTime':defaultStartTime,'StartTimes':startTimes};}
return true;},hasQuoteDetail:function(productId,date,duration){return(V3.Async.BookingOptions.Quotes[productId]&&V3.Async.BookingOptions.Quotes[productId][date]&&V3.Async.BookingOptions.Quotes[productId][date][duration]);},onSpecialSearchSuccess:function(data){var foundCurrentCriteria=false;V3.Log.Watch('data',data);try{if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){if(!data.Success){V3.Log.Warn("Webservice returned 'unsuccessful' result");V3.Utils.NotifyUser(data.ErrorCode);return;}
if(data.Results&&data.Results[V3.Async.BookingOptions.SearchCriteria.Shortnames[0]]){var prov=data.Results[V3.Async.BookingOptions.SearchCriteria.Shortnames[0]];var productId,strDate;for(productId in prov){for(strDate in prov[productId]){var date=new Date(strDate);if(productId==V3.Async.BookingOptions.CurrentProduct.Id&&date.equals(V3.Async.BookingOptions.TargetDate)){foundCurrentCriteria=true;}
V3.Async.BookingOptions.addQuote(productId,date,data.Duration,prov[productId][strDate].StartTimes[prov[productId][strDate].DefSTI],prov[productId][strDate].StartTimes);}}}
if(!foundCurrentCriteria){V3.Async.BookingOptions.addQuote(V3.Async.BookingOptions.CurrentProduct.Id,V3.Async.BookingOptions.TargetDate,V3.Async.BookingOptions.CustomDurationValue,null,null);}}else{alert('not implemented');}}
catch(err){V3.Log.Error('exception thrown in V3.Async.BookingOptions.onSpecialSearchSuccess','err',err);}
finally{V3.Async.BookingOptions.SearchesCompleted.Special=true;V3.Async.BookingOptions.update();if(foundCurrentCriteria&&V3.Async.BookingOptions.CustomRow.Input.checked){V3.Async.BookingOptions.radioOption_Selected(V3.Async.BookingOptions.CustomRow.Input);}}},onSpecialSearchError:function(obj,msg,exc){try{V3.Log.Error("Error while calling web service",'args',{msg:msg,exc:exc,obj:obj},true);if(!V3.Utils.WebServices.isAborting(obj,msg,exc)){V3.Utils.NotifyUser(11);}}
catch(err){V3.Log.Error('exception thrown in V3.Async.BookingOptions.onSpecialSearchError','err',err);}
finally{V3.Async.BookingOptions.SearchesCompleted.Special=true;V3.Async.BookingOptions.update();}},performSpecialSearch:function(){try{V3.Async.BookingOptions.SearchCriteria.StartDate=formatDate(V3.Async.BookingOptions.TargetDate,'yyyy/MM/dd');V3.Async.BookingOptions.SearchCriteria.NumberOfDays=0;V3.Async.BookingOptions.SearchCriteria.Shortnames=[V3.Async.BookingOptions.CurrentProvider];Page.WebMethods.GetAvailability(V3.Async.BookingOptions.SearchCriteria,V3.Async.BookingOptions.CustomDurationValue,V3.Async.BookingOptions.onSpecialSearchSuccess,V3.Async.BookingOptions.onSpecialSearchError);V3.Async.BookingOptions.SearchesCompleted.Special=false;V3.Async.BookingOptions.update();}
catch(err){V3.Log.Error('exception thrown in V3.Async.BookingOptions.performSpecialSearch','err',err);}},createListItem:function(value,labelHtml,optionalCssName,optionalRadioId){var li=document.createElement('li');li.className='';if(optionalCssName){li.className=optionalCssName;}
li.Input=document.createElement('input');li.Input.type="radio";li.Input.setAttribute('name','optBookingSelection');li.Input.value=value;li.Input.checked=false;li.Input.onclick=function(){V3.Async.BookingOptions.radioOption_Selected(this);};if(optionalRadioId){li.Input.id=optionalRadioId;}
li.Container=document.createElement('div');li.Container.onclick=function(){li.Input.click();};li.appendChild(li.Input);li.appendChild(li.Container);var span=document.createElement('span');li.Container.appendChild(span);span.innerHTML=labelHtml;return li;},update:function(){V3.Async.BookingOptions.NotAvailableNotification.hide();V3.Async.BookingOptions.WaitingNotification.hide();if(this.CurrentProduct!=null){V3.Async.BookingOptions.WaitingNotification.hide();}else{V3.Async.BookingOptions.WaitingNotification.show();V3.Async.BookingOptions.List.Container.hide();V3.Async.BookingOptions.UpdatingNotification.hide();V3.Async.BookingOptions.NotAvailableNotification.hide();if(V3.Async.BookingOptions.PickupLocations){V3.Async.BookingOptions.PickupLocations.hide();}
return;}
if(this.IsCurrentProductInWaitingState||!this.Quotes[this.CurrentProduct.Id]||!this.Quotes[this.CurrentProduct.Id]||!this.Quotes[this.CurrentProduct.Id][this.TargetDate]){if(this.SearchesCompleted.Main||this.IsCurrentProductInWaitingState){V3.Async.BookingOptions.UpdatingNotification.hide();if(this.InvalidCheckInDates[this.CurrentProduct.Id]&&this.InvalidCheckInDates[this.CurrentProduct.Id][this.TargetDate]){var suggestedDate=V3.Async.BookingOptions.CurrentProduct.DailyPriceDetail[V3.Async.BookingOptions.TargetDate].DisplayedPriceCriteria.CommencingOn;V3.Async.BookingOptions.NotAvailableNotification.innerHTML='<span class="text hasDailyPrice">To stay on '+formatDate(this.TargetDate,V3.Async.Branding.DateFormat)+', you may need to select '+V3.CustomisationSettings.Words.CommencingDate+' date of '+formatDate(suggestedDate,V3.Async.Branding.DateFormat)+'</span>';}else{V3.Async.BookingOptions.NotAvailableNotification.innerHTML='<span class="text">Selected '+V3.CustomisationSettings.Words.CommencingDate+' date is unavailable</span>';}
V3.Async.BookingOptions.NotAvailableNotification.show();V3.Async.BookingOptions.List.Container.hide();}else{V3.Async.BookingOptions.UpdatingNotification.show();V3.Async.BookingOptions.List.Container.hide();}
if(V3.Async.BookingOptions.PickupLocations){V3.Async.BookingOptions.PickupLocations.hide();}
return;}
if(this.SearchesCompleted.Main||this.IsCurrentProductInWaitingState){V3.Async.BookingOptions.UpdatingNotification.hide();}else{V3.Async.BookingOptions.UpdatingNotification.show();}
var q=this.Quotes[this.CurrentProduct.Id][this.TargetDate];var li,textItems,e;if(V3.Async.SearchCriteria.IndustryCategoryGroup=="TEA"){V3.Async.BookingOptions.List.Header.innerHTML='For the '+V3.CustomisationSettings.Words.CommencingDate.toLowerCase()+' date of '+formatDate(V3.Async.BookingOptions.TargetDate,V3.Async.Branding.DateFormat)+', please select a booking option';textItems=V3.Async.constructListItemsForTEA(this.CurrentProduct,this.TargetDate,q[1].StartTimes,true);if(q[1].StartTimes.length<=V3.Async.Branding.MaxStartTimesDisplayed){this.CustomRow.hide();var i,st;for(i=0;i<q[1].StartTimes.length;i++){st=q[1].StartTimes[i];if(this.ListItems[st.SD]){continue;}
li=this.createListItem(i,V3.CustomisationSettings.Words.CommencingCheckIn+' time: '+formatDate(new Date(q[1].StartTimes[i].SD),V3.Async.Branding.TimeFormat)+'<span class="cost"><span class="div"> - </span><span class="label">Total cost: </span>'+textItems[i].Total.Price+textItems[i].Total.Save+'</span>');this.ListItems[st.SD]=li;this.List.appendChild(li);}}else{if(this.CustomRow.Droplist.options.length==0){for(i=0;i<q[1].StartTimes.length;i++){st=q[1].StartTimes[i];V3.Utils.Html.appendSelectItem(this.CustomRow.Droplist,formatDate(new Date(st.SD),V3.Async.Branding.TimeFormat)+'&nbsp;&nbsp;&nbsp; Total cost: $'+st.TP.toFixed(2),i);}}
e=textItems[this.CustomRow.Droplist.value].Total;this.CustomRow.show();}
if(V3.Async.BookingOptions.SearchesCompleted.Main&&!V3.Async.BookingOptions.Data.Cache&&q[1].StartTimes.length==1){V3.Async.BookingOptions.ListItems[q[1].StartTimes[0].SD].Input.click();}
if(this.PickupLocations){if(this.PickupLocations.Select.options.length>1){this.PickupLocations.show();}else{this.PickupLocations.hide();}}}else{if(V3.Async.BookingOptions.CustomRow){if(this.SearchesCompleted.Special){V3.Async.BookingOptions.CustomRow.Refreshing.hide();}else{V3.Async.BookingOptions.CustomRow.Refreshing.show();}}
V3.Async.BookingOptions.List.Header.innerHTML='For the '+V3.CustomisationSettings.Words.CommencingDate.toLowerCase()+' date of '+formatDate(V3.Async.BookingOptions.TargetDate,V3.Async.Branding.DateFormat)+', please select the number of nights you require';textItems=V3.Async.constructListItemsForAccomm(this.CurrentProduct,this.TargetDate,q,true);var duration,count=0;if(count<5){var nextItemInList=this.CustomRow;for(duration=8;duration>=1;duration--){if(!textItems[duration]){continue;}
if(this.ListItems[duration]){nextItemInList=this.ListItems[duration];}else{li=this.createListItem(duration,'Stay '+textItems[duration].Html+textItems[duration].NightlyAverage,'item');this.ListItems[duration]=li;this.List.insertBefore(li,nextItemInList);nextItemInList=li;}}}
if(textItems[this.CustomDurationValue]){e=textItems[this.CustomDurationValue];this.CustomRow.QuoteLabel.innerHTML='<span class="cost"><span class="div"> - </span><span class="label">Stay '+this.CustomDurationValue+' nights for </span>'+e.Price+e.Save+e.NightlyAverage+'</span>';if(this.CustomRow.Input.disabled){this.CustomRow.Input.disabled=false;RemoveCssStyle(this.CustomRow,'disabled');if(this.CustomRow.Input.checked){this.CustomRow.Input.click();}}}else if(this.SearchesCompleted.Special){this.CustomRow.QuoteLabel.innerHTML='<span class="un">A '+this.CustomDurationValue+' night stay is unavailable</span>';if(!this.CustomRow.Input.disabled){this.CustomRow.Input.disabled=true;if(this.CustomRow.Input.checked){AddCssStyle(this.CustomRow,'disabled');this.Hooks.ProductDeselected();}}}else{this.CustomRow.QuoteLabel.innerHTML='<span class="up">checking...</span>';if(!this.CustomRow.Input.disabled){this.CustomRow.Input.disabled=true;if(this.CustomRow.Input.checked){AddCssStyle(this.CustomRow,'disabled');this.Hooks.ProductDeselected();}}}}
V3.Async.BookingOptions.List.Container.show();V3.Async.BookingOptions.tryReadPostbackData();},reset:function(){var key;for(key in this.ListItems){this.List.removeChild(this.ListItems[key]);}
if(V3.Async.SearchCriteria.IndustryCategoryGroup=="TEA"){this.CustomRow.Droplist.clear();}
V3.Async.BookingOptions.ListItems={};if(V3.Async.BookingOptions.CustomRow){V3.Async.BookingOptions.CustomRow.Input.checked=false;}
V3.Async.BookingOptions.update();},async_onDeselected:function(){if(V3.Async.BookingOptions.CurrentProduct){var e=document.getElementById('productInfo_'+V3.Async.BookingOptions.CurrentProduct.Id);if(e){e.style.display='none';}
V3.Async.BookingOptions.CurrentProduct=null;V3.Async.BookingOptions.CurrentDuration=null;V3.Async.BookingOptions.CurrentStartTime=null;V3.Async.BookingOptions.reset();V3.Async.BookingOptions.update();V3.Async.BookingOptions.Hooks.ProductDeselected();}},async_onSelectionChanged:function(shortname,product,date,searchCriteria){var e;if(V3.Async.BookingOptions.CurrentProduct){e=document.getElementById('productInfo_'+V3.Async.BookingOptions.CurrentProduct.Id);if(e){e.style.display='none';}}
V3.Async.BookingOptions.CurrentProduct=null;V3.Async.BookingOptions.CurrentDuration=null;V3.Async.BookingOptions.CurrentStartTime=null;V3.Async.BookingOptions.reset();V3.Async.BookingOptions.CurrentProvider=shortname;V3.Async.BookingOptions.CurrentProduct=product;V3.Async.BookingOptions.SearchCriteria=searchCriteria;V3.Async.BookingOptions.TargetDate=date;e=document.getElementById('productInfo_'+product.Id);if(e){e.style.display='block';}
if(V3.Async.BookingOptions.CustomRow){V3.Async.BookingOptions.CustomRow.Droplist.onchange();V3.Async.BookingOptions.updateSelectedItemCss();}
if(V3.Async.BookingOptions.PickupLocations){var ePickup=V3.Async.BookingOptions.PickupLocations;ePickup.Select.length=1;if(V3.Async.BookingOptions.CurrentProduct.PickupLocations){var pl,plId;for(plId in V3.Async.BookingOptions.CurrentProduct.PickupLocations){pl=V3.Async.BookingOptions.CurrentProduct.PickupLocations[plId];V3.Utils.Html.appendSelectItem(ePickup.Select,pl.Description+' ('+pl.Time+')',plId);}}}
V3.Async.BookingOptions.Hooks.ProductDeselected();V3.Async.BookingOptions.update();V3.Async.BookingOptions.updateSelectedItemCss();},async_onRateReceived:function(shortname,product,date,sArgs,duration,defaultStartTime,startTimes){if(defaultStartTime==null){if(!V3.Async.BookingOptions.InvalidCheckInDates[product.Id]){V3.Async.BookingOptions.InvalidCheckInDates[product.Id]={};}
V3.Async.BookingOptions.InvalidCheckInDates[product.Id][date]=true;return false;}
else if(V3.Async.BookingOptions.InvalidCheckInDates[product.Id]){V3.Async.BookingOptions.InvalidCheckInDates[product.Id][date]=false;}
if(V3.Async.BookingOptions.addQuote(product.Id,date,duration,defaultStartTime,startTimes)){if(product==V3.Async.BookingOptions.CurrentProduct){if(V3.Async.BookingOptions.TargetDate.equals(date)){V3.Async.BookingOptions.update();}}}},async_onSearchStart:function(searchCriteria){V3.Async.BookingOptions.SearchCriteria=searchCriteria;V3.Async.BookingOptions.SearchesCompleted.Main=false;V3.Async.BookingOptions.Quotes={};V3.Async.BookingOptions.InvalidCheckInDates={};V3.Async.BookingOptions.reset();V3.Async.BookingOptions.Hooks.ProductDeselected();},async_onSearchCompleted:function(){V3.Async.BookingOptions.SearchesCompleted.Main=true;V3.Async.BookingOptions.update();},async_onProductRowStateChanged:function(product,newState){var newIsInWaitingState=newState.NotificationVisible;if(newIsInWaitingState!=V3.Async.BookingOptions.IsCurrentProductInWaitingState){V3.Async.BookingOptions.IsCurrentProductInWaitingState=newIsInWaitingState;V3.Async.BookingOptions.update();}},ddlStartTimeSelector_SelectedIndexChanged:function(sender,args){if(V3.Async.BookingOptions.List.Container.visible){V3.Async.BookingOptions.CustomRow.Input.click();}},ddlCustomDuration_SelectedIndexChanged:function(sender,args){V3.Async.BookingOptions.CustomDurationValue=sender.value;if(V3.Async.BookingOptions.CustomDurationValue>8&&!V3.Async.BookingOptions.hasQuoteDetail(V3.Async.BookingOptions.CurrentProduct.Id,V3.Async.BookingOptions.TargetDate,V3.Async.BookingOptions.CustomDurationValue)){V3.Async.BookingOptions.performSpecialSearch();}
else if(V3.Async.BookingOptions.List.Container.visible){V3.Async.BookingOptions.CustomRow.Input.click();}
V3.Async.BookingOptions.update();},tryReadPostbackData:function(){if(!V3.Async.BookingOptions.Data.IgnoreData){if(V3.Async.BookingOptions.Data.value!=''){var arrData=null;if(V3.Async.BookingOptions.Data.Cache){arrData=V3.Async.BookingOptions.Data.Cache;}else{try{arrData=JSON.parse(V3.Async.BookingOptions.Data.value);}
catch(err){V3.Log.Error('unexpected exception thrown while deserialising data in V3.Async.BookingOptions.tryReadPostbackData()','err',err);V3.Log.Error('V3.Async.BookingOptions.Data.value='+V3.Async.BookingOptions.Data.value);}
V3.Async.BookingOptions.Data.Cache=arrData;}
if(arrData&&V3.Async.BookingOptions.CurrentProvider==arrData[0]&&V3.Async.BookingOptions.CurrentProduct.Id==arrData[1]&&formatDate(V3.Async.BookingOptions.TargetDate,'yyyy/MM/dd')==arrData[2]&&V3.Async.BookingOptions.SearchCriteria.Adults==arrData[5].Adults&&V3.Async.BookingOptions.SearchCriteria.Child==arrData[5].Child&&V3.Async.BookingOptions.SearchCriteria.Concession==arrData[5].Concession){if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){var duration=arrData[3];if(duration>8){V3.Async.BookingOptions.Data.IgnoreData=true;V3.Async.BookingOptions.CustomRow.Droplist.value=duration;V3.Async.BookingOptions.CustomRow.Input.checked=true;V3.Async.BookingOptions.ddlCustomDuration_SelectedIndexChanged(V3.Async.BookingOptions.CustomRow.Droplist,null);}else if(V3.Async.BookingOptions.ListItems[duration]){V3.Async.BookingOptions.Data.IgnoreData=true;V3.Async.BookingOptions.ListItems[duration].Input.click();}
V3.Async.BookingOptions.Hooks.WaitingToReloadState(false);}
else{var index=-1;if(V3.Async.BookingOptions.CustomRow.Droplist.options.length>0){var i,startTimes=V3.Async.BookingOptions.Quotes[V3.Async.BookingOptions.CurrentProduct.Id][V3.Async.BookingOptions.TargetDate][1].StartTimes;for(i=0;i<startTimes.length;i++){if(startTimes[i].SD==arrData[4].SD){index=i;break;}}}
if(index!=-1||V3.Async.BookingOptions.ListItems[arrData[4].SD]!=null){V3.Async.BookingOptions.Data.IgnoreData=true;if(arrData[6]){V3.Async.BookingOptions.PickupLocations.Select.value=arrData[6];}
if(index!=-1){V3.Async.BookingOptions.CustomRow.Droplist.value=index;V3.Async.BookingOptions.CustomRow.Input.click();}else{V3.Async.BookingOptions.ListItems[arrData[4].SD].Input.click();}}
else{V3.Async.BookingOptions.Hooks.WaitingToReloadState(false);}}}
else{V3.Async.BookingOptions.Hooks.WaitingToReloadState(true);V3.Async.BookingOptions.Data.IgnoreData=true;}}}},onload:function(){V3.Async.BookingOptions.tryReadPostbackData();},initialise:function(ePlaceHolder,eHiddenInput){V3.Async.BookingOptions.Data=eHiddenInput;V3.Async.Hooks.OnSelectionChanged.addEventHandler(this.async_onSelectionChanged);V3.Async.Hooks.OnDeselected.addEventHandler(this.async_onDeselected);V3.Async.Hooks.OnNewRateReceived.addEventHandler(this.async_onRateReceived);V3.Async.Hooks.OnSearchStarted.addEventHandler(this.async_onSearchStart);V3.Async.Hooks.OnSearchCompleted.addEventHandler(this.async_onSearchCompleted);V3.Async.Hooks.OnProductRowStateChanged.addEventHandler(this.async_onProductRowStateChanged);var fun=function(){var e;try{var createElement=V3.Utils.Html.createElement;ePlaceHolder.appendChild(this.UpdatingNotification=createElement('div','updatingNotification',{useDisplay:false}));this.List=createElement('ul','bookingOptionList '+(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"?'forAccomm':'forTea'),false);this.List.Header=createElement('span','bookingOptionInstructions');this.List.Container=createElement('div','bookingOptionListContainer',true);this.List.Container.appendChild(this.List.Header);this.List.Container.appendChild(this.List);ePlaceHolder.appendChild(this.List.Container);ePlaceHolder.appendChild(this.WaitingNotification=createElement('div','waitingNotification',true));ePlaceHolder.appendChild(this.NotAvailableNotification=createElement('div','unavailableNotification',true));this.WaitingNotification.innerHTML='<span class="noticeSelectProduct">Please select '+V3.CustomisationSettings.Words.CommencingDate+' date</span>';e=document.createElement('span');e.innerHTML='Updating...';this.UpdatingNotification.appendChild(e);if(V3.Async.Branding.ImageUrls['loading']){e=document.createElement('img');e.src=V3.Async.Branding.ImageUrls['loading'];this.UpdatingNotification.appendChild(e);}
if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){this.PickupLocations=null;this.CustomRow=this.createListItem('other','Other: ','customRow','radioCustomDurationOption');this.CustomRow.Droplist=V3.Utils.Html.createSelect('customDuration',null,this.ddlCustomDuration_SelectedIndexChanged,null,null);this.CustomRow.Container.appendChild(this.CustomRow.Droplist);this.CustomRow.Container.appendChild(this.CustomRow.QuoteLabel=V3.Utils.Html.createElement('span','quoteLabel'));e=V3.Utils.Html.createElement('img',null,true);e.src=(V3.Async.Branding.ImageUrls.loading?V3.Async.Branding.ImageUrls.loading:'');this.CustomRow.Refreshing=e;this.CustomRow.Container.appendChild(this.CustomRow.Refreshing);for(var i=1;i<=14;i++){V3.Utils.Html.appendSelectItem(this.CustomRow.Droplist,(i+(i==1?' night':' nights')),i);}
this.CustomRow.Droplist.value=8;this.CustomDurationValue=8;this.List.appendChild(this.CustomRow);}else{this.CustomRow=this.createListItem('startTimeSelector',V3.CustomisationSettings.Words.CommencingCheckIn+' time: ','startTimeSelectorRow','radStartTimeOption');this.CustomRow.Droplist=V3.Utils.Html.createSelect('startTimeSelector',null,this.ddlStartTimeSelector_SelectedIndexChanged,null,null);this.CustomRow.Container.appendChild(this.CustomRow.Droplist);this.CustomRow.Container.appendChild(this.CustomRow.QuoteLabel=V3.Utils.Html.createElement('span','quoteLabel'));this.CustomRow.show=function(){if(!V3.Async.BookingOptions.CustomRow._isDetached){return;}V3.Async.BookingOptions.CustomRow._isDetached=false;V3.Async.BookingOptions.List.appendChild(V3.Async.BookingOptions.CustomRow);};this.CustomRow.hide=function(){if(V3.Async.BookingOptions.CustomRow._isDetached){return;}V3.Async.BookingOptions.CustomRow._isDetached=true;V3.Async.BookingOptions.List.removeChild(V3.Async.BookingOptions.CustomRow);};ePlaceHolder.appendChild(this.PickupLocations=V3.Utils.Html.createElement('div','pickupLocationContainer',{useDisplay:false}));e=V3.Utils.Html.createElement('span','label');e.innerHTML='<h3>Pickup Location<span class="div">:</span></h3>';this.PickupLocations.appendChild(e);this.PickupLocations.Select=V3.Utils.Html.createSelect('PickupLocations');e=V3.Utils.Html.createElement('span','selectContainer');e.appendChild(this.PickupLocations.Select);this.PickupLocations.appendChild(e);V3.Utils.Html.appendSelectItem(this.PickupLocations.Select,'No pickup required','00000000-0000-0000-0000-000000000000');this.CurrentDuration=1;this.PickupLocations.Select.onchange=function(){V3.Async.BookingOptions.updateSelectedItemCss();if(V3.Async.BookingOptions.CurrentStartTime!=null){V3.Async.BookingOptions.Hooks.ProductSelected();}};this.List.appendChild(this.CustomRow);}
this.reset();}
catch(err){V3.Log.Error('exception thrown in V3.Async.BookingOptions.initialise','err',err);}};if(V3.Utils.UserAgent==UserAgentsEnum.IE7){V3.Utils.OnLoaded.addEventHandler(function(){fun.apply(V3.Async.BookingOptions);});}else{fun.apply(this);V3.Utils.OnLoad.addEventHandler(V3.Async.BookingOptions.onload);}}};V3.Async.BookingSummary={Table:{show:function(){},hide:function(){}},ProductRows:[],ExtraRows:[],TotalValueCell:null,BookingFeeCell:null,SubTotalValueCell:null,WaitingNotification:{show:function(){},hide:function(){}},LoadingNotification:{show:function(){},hide:function(){}},PayNowButton:null,updateTotals:function(){var total=0,i;for(i=0;i<this.ProductRows.length;i++){total=total+this.ProductRows[i].Cost;}
for(i=0;i<this.ExtraRows.length;i++){total=total+this.ExtraRows[i].Cost;}
if(this.BookingFeeCell==null){this.TotalValueCell.innerHTML='$'+total.toFixed(2);this.TotalValueCell.Cost=total;}
else{this.SubTotalValueCell.innerHTML='$'+total.toFixed(2);this.SubTotalValueCell.Cost=total;total=total+this.BookingFeeCell.Cost;this.TotalValueCell.innerHTML='$'+total.toFixed(2);this.TotalValueCell.Cost=total;}},reset:function(){this.Table.hide();this.WaitingNotification.hide();this.LoadingNotification.hide();var i;for(i=0;i<this.ProductRows.length;i++){this.Table.removeRow(this.ProductRows[i]);}
this.ProductRows.clear();for(i=0;i<this.ExtraRows.length;i++){this.Table.removeRow(this.ExtraRows[i]);}
this.ExtraRows.clear();this.updateTotals();},update:function(){if(this.ProductRows.length>0){this.updateTotals();this.WaitingNotification.hide();this.Table.show();}else{this.Table.hide();this.WaitingNotification.show();}},addRow:function(isProductRow,strName,strDetail,numCost){var r;if(isProductRow){r=V3.Async.BookingSummary.Table.addRow(3,1,'body productRow');}else{var index=V3.Async.BookingSummary.Table.Rows.length-2;if(V3.Async.BookingSummary.SubTotalValueCell!=null){index-=2;}
r=V3.Async.BookingSummary.Table.addRow(3,index,'body extraRow');}
r.Cells[0].innerHTML=strName;r.Cells[0].className+=' item';r.Cells[1].className+=' detail';r.Cells[1].innerHTML=strDetail;r.Cells[2].className+=' subtotal value';r.Cells[2].innerHTML='$'+numCost.toFixed(2);r.Cost=numCost;V3.Async.BookingSummary.ProductRows.push(r);return r;},asyncBookingOptions_onProductSelected:function(providerShortname,product,targetDate,duration,startTime,paxLevels,pickupLocationId){V3.Async.BookingSummary.reset();var words={'Adults':V3.CustomisationSettings.Words.GuestNamesAdult,'Child':V3.CustomisationSettings.Words.GuestNamesChild,'Concession':V3.CustomisationSettings.Words.GuestNamesConcession};var strPaxText='<span class="label">For </span>',key,count=0;for(key in words){if(paxLevels[key]>0){if(count>0){strPaxText+=', ';}
strPaxText+='<span class="pax'+key+'"><span class="num">'+paxLevels[key]+'</span> '+words[key]+'</span>';count++;}}
var strPickupLocation='';if(pickupLocationId){var pl=product.PickupLocations[pickupLocationId];if(pl){strPickupLocation='<span class="pickup"><span class="label">Pickup Location: </span><span class="value">'+pl.Description+'</span>';if((pl.Time+'').length>0){strPickupLocation+='<span class="time"><span class="label">Time: </span><span class="value">'+pl.Time+'</span></span>';}
strPickupLocation+='</span>';}else{strPickupLocation='<span class="pickup none"><span class="label">Pickup Location: </span>No pickup selected</span>';}}
var strDetail='<span class="cIn"><span class="label">'+V3.CustomisationSettings.Words.CommencingCheckIn+':</span> '+formatDate(new Date(startTime.SD),V3.Async.Branding.DateTimeFormat)+'</span>'
+'<span class="cOut"><span class="label">'+V3.CustomisationSettings.Words.ConcludingCheckOut+':</span> '+formatDate(new Date(startTime.ED),V3.Async.Branding.DateTimeFormat)+'</span>'
+'<span class="pax">'+strPaxText+'</span>'
+strPickupLocation;V3.Async.BookingSummary.addRow(true,product.Name,strDetail,startTime.TP);V3.Async.BookingSummary.update();RemoveCssStyle(V3.Async.BookingSummary.PayNowButton,'disabled');V3.Async.BookingSummary.PayNowButton.disabled=false;},asyncBookingOptions_onProductDeselected:function(){V3.Async.BookingSummary.reset();V3.Async.BookingSummary.update();AddCssStyle(V3.Async.BookingSummary.PayNowButton,'disabled');V3.Async.BookingSummary.PayNowButton.disabled=true;},asyncBookingOptions_onWaitingToReloadState:function(isComplete){if(isComplete){V3.Async.BookingSummary.update();}else{V3.Async.BookingSummary.reset();V3.Async.BookingSummary.LoadingNotification.show();}},initialise:function(ePlaceHolder,eButtonPayNow,bookingFee){V3.Async.BookingSummary.PayNowButton=eButtonPayNow;AddCssStyle(V3.Async.BookingSummary.PayNowButton,'disabled');V3.Async.BookingSummary.PayNowButton.disabled=true;var fun=function(){try{var w=V3.Utils.Html.createElement('div','waitingNotification',{useDisplay:true});if(V3.Async.SearchCriteria.IndustryCategoryGroup=="ACCOMM"){w.innerHTML='<span>Please select a deal to continue.</span>';}else{w.innerHTML='<span>Please select a booking option to continue.</span>';}
ePlaceHolder.appendChild(w);V3.Async.BookingSummary.WaitingNotification=w;var l=V3.Utils.Html.createElement('div','updatingNotification',{useDisplay:true});var e=V3.Utils.Html.createElement('span');e.innerHTML='Reloading...';l.appendChild(e);e=document.createElement('img');e.src=V3.Async.Branding.ImageUrls['loading'];l.appendChild(e);ePlaceHolder.appendChild(l);V3.Async.BookingSummary.LoadingNotification=l;var shorthandTable=[];shorthandTable.push({className:'header',Cells:[{className:'item',innerHTML:'<span>'+V3.CustomisationSettings.Words.ProductSingular+'</span>'},{className:'detail',innerHTML:'<span>Booking Details</span>'},{className:'subtotal',innerHTML:'<span>Sub-Total</span>'}]});if(typeof(bookingFee)=='number'&&isFinite(bookingFee)){shorthandTable.push({className:'footer subTotal',Cells:[{className:'label',colSpan:2,innerHTML:'Total (inc GST):'},{className:'value'}]});shorthandTable.push({className:'footer bookingFee',Cells:[{className:'label',colSpan:2,innerHTML:'Booking Fee (inc GST):'},{className:'value',innerHTML:'$'+bookingFee.toFixed(2),Cost:bookingFee}]});}
shorthandTable.push({className:'footer total',Cells:[{className:'label',colSpan:2,innerHTML:'Payment Amount (inc GST):'},{className:'value'}]});var t=V3.Utils.Html.createTable(shorthandTable,null,'bookingSummary',{useDisplay:true});if(bookingFee==null){V3.Async.BookingSummary.SubTotalValueCell=null;V3.Async.BookingSummary.BookingFeeCell=null;V3.Async.BookingSummary.TotalValueCell=t.Rows[1].Cells[1];}else{V3.Async.BookingSummary.SubTotalValueCell=t.Rows[1].Cells[1];V3.Async.BookingSummary.BookingFeeCell=t.Rows[2].Cells[1];V3.Async.BookingSummary.TotalValueCell=t.Rows[3].Cells[1];}
ePlaceHolder.appendChild(t);V3.Async.BookingSummary.Table=t;V3.Async.BookingOptions.Hooks.OnProductSelected.addEventHandler(this.asyncBookingOptions_onProductSelected);V3.Async.BookingOptions.Hooks.OnProductDeselected.addEventHandler(this.asyncBookingOptions_onProductDeselected);V3.Async.BookingOptions.Hooks.OnWaitingToReloadState.addEventHandler(this.asyncBookingOptions_onWaitingToReloadState);this.reset();this.update();}
catch(err){V3.Log.Error('exception thrown in V3.Async.BookingSummary.initialise(..)','err',err);}};if(V3.Utils.UserAgent==UserAgentsEnum.IE7){V3.Utils.OnLoaded.addEventHandler(function(){fun.apply(V3.Async.BookingSummary);});}else{fun.apply(V3.Async.BookingSummary);}}};V3.Async.BookingReferral={ButtonRedirect:null,WaitingNotification:{},asyncBookingOptions_onProductSelected:function(){RemoveCssStyle(V3.Async.BookingReferral.ButtonRedirect,'disabled');V3.Async.BookingReferral.ButtonRedirect.disabled=false;V3.Async.BookingReferral.WaitingNotification.hide();},asyncBookingOptions_onProductDeselected:function(){AddCssStyle(V3.Async.BookingReferral.ButtonRedirect,'disabled');V3.Async.BookingReferral.ButtonRedirect.disabled=true;V3.Async.BookingReferral.WaitingNotification.show();},asyncBookingOptions_onWaitingToReloadState:function(){},initialise:function(ePlaceHolder,btnRedirect){try{V3.Async.BookingReferral.ButtonRedirect=btnRedirect;var w=V3.Utils.Html.createElement('div','waitingNotification',{useAnimated:true});w.innerHTML='<span>Please select a booking option to continue.</span>';ePlaceHolder.appendChild(w);this.WaitingNotification=w;this.asyncBookingOptions_onProductDeselected();V3.Async.BookingOptions.Hooks.OnProductSelected.addEventHandler(this.asyncBookingOptions_onProductSelected);V3.Async.BookingOptions.Hooks.OnProductDeselected.addEventHandler(this.asyncBookingOptions_onProductDeselected);V3.Async.BookingOptions.Hooks.OnWaitingToReloadState.addEventHandler(this.asyncBookingOptions_onWaitingToReloadState);}
catch(err){V3.Log.Error('exception thrown in V3.Async.Bookingreferral.initialise(..)','err',err);}}};
