/* javascript compressor */
Ext.apply(Ext.Element.prototype,{getValue:function(){var el=this.dom;switch(el.tagName.toLowerCase()){case'select':var values=[];for(i=0;ithis.opts.length){pos=this.opts.length}this.opts.splice(pos,0,opt)}else{this.opts.push(opt)}if(!norender){this.renderOptions()}},renderOptions:function(){while(this.el&&this.el.dom.options.length>0){this.el.dom.options[0]=null}if(this.opts.length==0){this.hide();return}this.show();for(i=0;this.el&&i0){for(i=0;i'),loading:new Ext.Template('','Loading...','
'),iframe:new Ext.Template('')};this.inputs=[];var args=arguments;if(args.length==1&&args[0]instanceof Array){args=args[0]}this.map={};for(i=0;iYou will receive an email with a validation code. Please enter the code in the following box, or click the link provided in the email, to confirm your reservation.
');cw.addClass('tb-reservation-validate');var bp=Ext.apply(MY.Joomla.getParams('public','validate'),{reservation:this.reservation.id});this.validateForm=new Ext.form.Form({method:'POST',url:MY.Joomla.ajaxurl,baseParams:bp});this.validateForm.add(new Ext.form.TextField({name:'code',fieldLabel:'Validation Code',labelWidth:220,width:100}));this.validateForm.addButton({text:'Validate',scope:this,handler:function(){this.validateForm.submit({scope:this,success:function(form,action){var result=action.result;cw.removeClass('tb-reservation-validate');cw.addClass('tb-reservation-success');cw.update(this._confirmationHtml(sendConfirmation))},failure:function(form,action){var result=action.result;Ext.MessageBox.alert('Email Validation',result.error)}})}});this.validateForm.render(cw)}for(i=0;iYou will receive an email with your reservation confirmation details.':'';var time=Date.parseDate(this.reservation.start,'Y-m-d H:i:s');var html=['Your Reservation has been confirmed!
',this.reservation.infoHtml,lastLine];return html.join(' ')},confirmReservation:function(){if(!this.form||this.currentStep.id!='info'||!this.reservation||this.confirming){return}this.confirming=true;this.form.submit({params:this.getParams({task:'confirmReservation'}),scope:this,success:function(form,action){this.confirming=false;this.reservation=action.result.reservation;this.closeReservation(action.result.sendConfirmation,action.result.requireValidation==1,action.result)},failure:function(form,action){this.confirming=false;Ext.MessageBox.alert('Problem Confirming Reservation','Please correct the errors noted on the form.
Hover the field to see the error message.',function(){var r=action.result;if(action.result&&action.result.errors){var err=action.result.errors;for(var n in err){var f=this.form.findField(n);if(f){f.focus();if(f.selectText){f.selectText()}return}}}this.focusEmptyField(this.form)},this)}})},getForm:function(s){if(this.form){return this.form}var w=200;this.form=new Ext.form.Form({method:'POST',url:MY.Joomla.ajaxurl,baseParams:MY.Joomla.getParams('public','confirmReservation')});this.form.container({labelAlign:'right'},new Ext.form.TextField({name:'name',allowBlank:false,width:w,value:this.user.name,fieldLabel:'Name'}),new Ext.form.TextField({name:'email',allowBlank:false,width:w,value:this.user.email,fieldLabel:'Email'}),new Ext.form.TextField({name:'phone',allowBlank:false,width:w,fieldLabel:'Phone'}),new Ext.form.TextArea({name:'notes',allowBlank:true,width:w,fieldLabel:'Notes'}));this.form.addButton({text:'Make Reservation'},this.confirmReservation,this);var fc=Ext.DomHelper.append(s.contentWrap.dom,{tag:'div'});this.fc=Ext.get(fc);this.fc.setVisibilityMode(Ext.Element.DISPLAY);this.form.render(this.fc);var c=100;this.form.items.each(function(field){field.getEl().set({'tabindex':c++});if(field.getEl().dom.tagName.toLowerCase()=='input'){field.on('specialkey',function(field,e){if(e.getKey()==e.RETURN||e.getKey()==e.ENTER){this.confirmReservation()}},this)}},this);for(var i=0;i