/*
 * ResLogic Web 2.0 Booking Engine & CMS
 * Copyright(c) 2009-2011 ResLogic, Inc.
 * http://www.reslogic.com/
 */
if(typeof Jemplate=="undefined"){var Jemplate=function(){this.init.apply(this,arguments)}}Jemplate.VERSION="0.22";Jemplate.process=function(){var b=new Jemplate(Jemplate.prototype.config);return b.process.apply(b,arguments)};(function(){if(!Jemplate.templateMap){Jemplate.templateMap={}}var proto=Jemplate.prototype={};proto.config={AUTO_RESET:true,BLOCKS:{},CONTEXT:null,DEBUG_UNDEF:false,DEFAULT:null,ERROR:null,EVAL_JAVASCRIPT:false,GLOBAL:true,SCOPE:this,FILTERS:{},INCLUDE_PATH:[""],INTERPOLATE:false,OUTPUT:null,PLUGINS:{},POST_PROCESS:[],PRE_PROCESS:[],PROCESS:null,RECURSION:false,STASH:null,TOLERANT:null,VARIABLES:{},WRAPPER:[]};proto.defaults={AUTO_RESET:true,BLOCKS:{},CONTEXT:null,DEBUG_UNDEF:false,DEFAULT:null,ERROR:null,EVAL_JAVASCRIPT:false,GLOBAL:true,SCOPE:this,INCLUDE_PATH:[""],INTERPOLATE:false,OUTPUT:null,PLUGINS:{},POST_PROCESS:[],PRE_PROCESS:[],PROCESS:null,RECURSION:false,STASH:null,TOLERANT:null,VARIABLES:{},WRAPPER:[]};Jemplate.init=function(config){Jemplate.prototype.config=config||{};for(var i in Jemplate.prototype.defaults){if(typeof Jemplate.prototype.config[i]=="undefined"){Jemplate.prototype.config[i]=Jemplate.prototype.defaults[i]}}};proto.init=function(config){this.config=config||{};for(var i in Jemplate.prototype.defaults){if(typeof this.config[i]=="undefined"){this.config[i]=Jemplate.prototype.defaults[i]}}};proto.process=function(template,data,output){var context=this.config.CONTEXT||new Jemplate.Context();context.config=this.config;context.stash=new Jemplate.Stash(this.config.STASH,this.config);context.__filter__=new Jemplate.Filter();context.__filter__.config=this.config;context.__plugin__=new Jemplate.Plugin();context.__plugin__.config=this.config;var result;var proc=function(input){try{if(typeof context.config.PRE_PROCESS=="string"){context.config.PRE_PROCESS=[context.config.PRE_PROCESS]}for(var i=0;i<context.config.PRE_PROCESS.length;i++){context.process(context.config.PRE_PROCESS[i])}result=context.process(template,input);if(typeof context.config.POST_PROCESS=="string"){context.config.PRE_PROCESS=[context.config.POST_PROCESS]}for(i=0;i<context.config.POST_PROCESS.length;i++){context.process(context.config.POST_PROCESS[i])}}catch(e){if(!String(e).match(/Jemplate\.STOP\n/)){throw (e)}result=e.toString().replace(/Jemplate\.STOP\n/,"")}if(typeof output=="undefined"){return result}if(typeof output=="function"){output(result);return null}if(typeof(output)=="string"||output instanceof String){if(output.match(/^#[\w\-]+$/)){var id=output.replace(/^#/,"");var element=document.getElementById(id);if(typeof element=="undefined"){throw ('No element found with id="'+id+'"')}element.innerHTML=result;return null}}else{output.innerHTML=result;return null}throw ("Invalid arguments in call to Jemplate.process");return 1};if(typeof data=="function"){data=data()}else{if(typeof data=="string"){var url=data;Jemplate.Ajax.processGet(url,function(data){proc(data)});return null}}return proc(data)};if(typeof Jemplate.Context=="undefined"){Jemplate.Context=function(){}}proto=Jemplate.Context.prototype;proto.include=function(template,args){return this.process(template,args,true)};proto.process=function(template,args,localise){if(localise){this.stash.clone(args)}else{this.stash.update(args)}var func=Jemplate.templateMap[template];if(typeof func=="undefined"){return'TEMPLATE ERROR: No Jemplate template named "'+template+'" available'}var output=func(this);if(localise){this.stash.declone()}return output};proto.set_error=function(error,output){this._error=[error,output];return error};proto.plugin=function(name,args){if(typeof name=="undefined"){return"TEMPLATE ERROR: Unknown plugin name ':"+name+"'"}var func=eval(name);return new func(this,args)};proto.filter=function(text,name,args){if(name=="null"){name="null_filter"}if(typeof this.__filter__.filters[name]=="function"){return this.__filter__.filters[name](text,args,this)}else{return"TEMPLATE ERROR: Unknown filter name ':"+name+"'"}};if(typeof Jemplate.Plugin=="undefined"){Jemplate.Plugin=function(){}}proto=Jemplate.Plugin.prototype;proto.plugins={};if(typeof Jemplate.Filter=="undefined"){Jemplate.Filter=function(){}}proto=Jemplate.Filter.prototype;proto.filters={};proto.filters.null_filter=function(text){return""};proto.filters.upper=function(text){return text.toUpperCase()};proto.filters.lower=function(text){return text.toLowerCase()};proto.filters.ucfirst=function(text){var first=text.charAt(0);var rest=text.substr(1);return first.toUpperCase()+rest};proto.filters.lcfirst=function(text){var first=text.charAt(0);var rest=text.substr(1);return first.toLowerCase()+rest};proto.filters.trim=function(text){return text.replace(/^\s+/g,"").replace(/\s+$/g,"")};proto.filters.collapse=function(text){return text.replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/," ")};proto.filters.html=function(text){text=text.replace(/&/g,"&amp;");text=text.replace(/</g,"&lt;");text=text.replace(/>/g,"&gt;");text=text.replace(/"/g,"&quot;");return text};proto.filters.html_para=function(text){var lines=text.split(/(?:\r?\n){2,}/);return"<p>\n"+lines.join("\n</p>\n\n<p>\n")+"</p>\n"};proto.filters.html_break=function(text){return text.replace(/(\r?\n){2,}/g,"$1<br />$1<br />$1")};proto.filters.html_line_break=function(text){return text.replace(/(\r?\n)/g,"$1<br />$1")};proto.filters.uri=function(text){return encodeURIComponent(text)};proto.filters.url=function(text){return encodeURI(text)};proto.filters.indent=function(text,args){var pad=args[0];if(!text){return null}if(typeof pad=="undefined"){pad=4}var finalpad="";if(typeof pad=="number"||String(pad).match(/^\d$/)){for(var i=0;i<pad;i++){finalpad+=" "}}else{finalpad=pad}var output=text.replace(/^/gm,finalpad);return output};proto.filters.truncate=function(text,args){var len=args[0];if(!text){return null}if(!len){len=32}if(text.length<len){return text}var newlen=len-3;return text.substr(0,newlen)+"..."};proto.filters.repeat=function(text,iter){if(!text){return null}if(!iter||iter==0){iter=1}if(iter==1){return text}var output=text;for(var i=1;i<iter;i++){output+=text}return output};proto.filters.replace=function(text,args){if(!text){return null}var re_search=args[0];var text_replace=args[1];if(!re_search){re_search=""}if(!text_replace){text_replace=""}var re=new RegExp(re_search,"g");return text.replace(re,text_replace)};if(typeof Jemplate.Stash=="undefined"){Jemplate.Stash=function(stash,config){this.__config__=config;this.data={GLOBAL:this.__config__.SCOPE};this.LOCAL_ANCHOR={};this.data.LOCAL=this.LOCAL_ANCHOR;this.update(stash)}}proto=Jemplate.Stash.prototype;proto.clone=function(args){var data=this.data;this.data={GLOBAL:this.__config__.SCOPE};this.data.LOCAL=this.LOCAL_ANCHOR;this.update(data);this.update(args);this.data._PARENT=data};proto.declone=function(args){this.data=this.data._PARENT||this.data};proto.update=function(args){if(typeof args=="undefined"){return}for(var key in args){if(key!="GLOBAL"&&key!="LOCAL"){this.set(key,args[key])}}};proto.get=function(ident,args){var root=this.data;var value;if((ident instanceof Array)||(typeof ident=="string"&&/\./.test(ident))){if(typeof ident=="string"){ident=ident.split(".");var newIdent=[];for(var i=0;i<ident.length;i++){newIdent.push(ident.replace(/\(.*$/,""));newIdent.push(0)}ident=newIdent}for(var i=0;i<ident.length;i+=2){var dotopArgs=ident.slice(i,i+2);dotopArgs.unshift(root);value=this._dotop.apply(this,dotopArgs);if(typeof value=="undefined"){break}root=value}}else{value=this._dotop(root,ident,args)}if(typeof value=="undefined"||value==null){if(this.__config__.DEBUG_UNDEF){throw ("undefined value found while using DEBUG_UNDEF")}value=""}return value};proto.set=function(ident,value,set_default){var root,result,error;root=this.data;while(true){if((ident instanceof Array)||(typeof ident=="string"&&/\./.test(ident))){if(typeof ident=="string"){ident=ident.split(".");var newIdent=[];for(var i=0;i<ident.length;i++){newIdent.push(ident.replace(/\(.*$/,""));newIdent.push(0)}ident=newIdent}for(var i=0;i<ident.length-2;i+=2){var dotopArgs=ident.slice(i,i+2);dotopArgs.unshift(root);dotopArgs.push(1);result=this._dotop.apply(this,dotopArgs);if(typeof value=="undefined"){break}root=result}var assignArgs=ident.slice(ident.length-2,ident.length);assignArgs.unshift(root);assignArgs.push(value);assignArgs.push(set_default);result=this._assign.apply(this,assignArgs)}else{result=this._assign(root,ident,0,value,set_default)}break}return(typeof result!="undefined")?result:""};proto._dotop=function(root,item,args,lvalue){if(root==this.LOCAL_ANCHOR){root=this.data}var atroot=root==this.data;var value,result=undefined;var is_function_call=args instanceof Array;args=args||[];if(typeof root=="undefined"||typeof item=="undefined"||typeof item=="string"&&item.match(/^[\._]/)){return undefined}if(atroot||(root instanceof Object&&!(root instanceof Array))||root==this.data.GLOBAL){if(typeof root[item]!="undefined"&&root[item]!=null&&(!is_function_call||!this.hash_functions[item])){if(typeof root[item]=="function"){result=root[item].apply(root,args)}else{return root[item]}}else{if(lvalue){return root[item]={}}else{if(this.hash_functions[item]&&!atroot||item=="import"){args.unshift(root);result=this.hash_functions[item].apply(this,args)}else{if(item instanceof Array){result={};for(var i=0;i<item.length;i++){result[item[i]]=root[item[i]]}return result}}}}}else{if(root instanceof Array){if(this.list_functions[item]){args.unshift(root);result=this.list_functions[item].apply(this,args)}else{if(typeof item=="string"&&/^-?\d+$/.test(item)||typeof item=="number"){if(typeof root[item]!="function"){return root[item]}result=root[item].apply(this,args)}else{if(item instanceof Array){for(var i=0;i<item.length;i++){result.push(root[item[i]])}return result}}}}else{if(this.string_functions[item]&&!lvalue){args.unshift(root);result=this.string_functions[item].apply(this,args)}else{if(this.list_functions[item]&&!lvalue){args.unshift([root]);result=this.list_functions[item].apply(this,args)}else{result=undefined}}}}if(result instanceof Array){if(typeof result[0]=="undefined"&&typeof result[1]!="undefined"){throw result[1]}}return result};proto._assign=function(root,item,args,value,set_default){var atroot=root==this.data;var result;args=args||[];if(typeof root=="undefined"||typeof item=="undefined"||typeof item=="string"&&item.match(/^[\._]/)){return undefined}if(atroot||root.constructor==Object||root==this.data.GLOBAL){if(root==this.LOCAL_ANCHOR){root=this.data}if(!(set_default&&typeof root[item]!="undefined")){if(atroot&&item=="GLOBAL"){throw"Attempt to modify GLOBAL access modifier"}if(atroot&&item=="LOCAL"){throw"Attempt to modify LOCAL access modifier"}return root[item]=value}}else{if((root instanceof Array)&&(typeof item=="string"&&/^-?\d+$/.test(item)||typeof item=="number")){if(!(set_default&&typeof root[item]!="undefined")){return root[item]=value}}else{if((root.constructor!=Object)&&(root instanceof Object)){try{result=root[item].apply(root,args)}catch(e){}}else{throw"dont know how to assign to ["+root+"."+item+"]"}}}return undefined};proto.string_functions={};proto.string_functions["typeof"]=function(value){return typeof value};proto.string_functions.chunk=function(string,size){var list=new Array();if(!size){size=1}if(size<0){size=0-size;for(var i=string.length-size;i>=0;i=i-size){list.unshift(string.substr(i,size))}if(string.length%size){list.unshift(string.substr(0,string.length%size))}}else{for(i=0;i<string.length;i=i+size){list.push(string.substr(i,size))}}return list};proto.string_functions.defined=function(string){return 1};proto.string_functions.hash=function(string){return{value:string}};proto.string_functions.length=function(string){return string.length};proto.string_functions.list=function(string){return[string]};proto.string_functions.match=function(string,re,modifiers){var regexp=new RegExp(re,modifiers==undefined?"g":modifiers);var list=string.match(regexp);return list};proto.string_functions.repeat=function(string,args){var n=args||1;var output="";for(var i=0;i<n;i++){output+=string}return output};proto.string_functions.replace=function(string,re,sub,modifiers){var regexp=new RegExp(re,modifiers==undefined?"g":modifiers);if(!sub){sub=""}return string.replace(regexp,sub)};proto.string_functions.search=function(string,re){var regexp=new RegExp(re);return(string.search(regexp)>=0)?1:0};proto.string_functions.size=function(string){return 1};proto.string_functions.split=function(string,re){var regexp=new RegExp(re);var list=string.split(regexp);return list};proto.list_functions={};proto.list_functions["typeof"]=function(list){return"array"};proto.list_functions.list=function(list){return list};proto.list_functions.join=function(list,str){return list.join(str)};proto.list_functions.sort=function(list,key){if(typeof(key)!="undefined"&&key!=""){return list.sort(function(a,b){if(a[key]==b[key]){return 0}else{if(a[key]>b[key]){return 1}else{return -1}}})}return list.sort()};proto.list_functions.nsort=function(list){return list.sort(function(a,b){return(a-b)})};proto.list_functions.grep=function(list,re){var regexp=new RegExp(re);var result=[];for(var i=0;i<list.length;i++){if(list[i].match(regexp)){result.push(list[i])}}return result};proto.list_functions.unique=function(list){var result=[];var seen={};for(var i=0;i<list.length;i++){var elem=list[i];if(!seen[elem]){result.push(elem)}seen[elem]=true}return result};proto.list_functions.reverse=function(list){var result=[];for(var i=list.length-1;i>=0;i--){result.push(list[i])}return result};proto.list_functions.merge=function(list){var result=[];var push_all=function(elem){if(elem instanceof Array){for(var j=0;j<elem.length;j++){result.push(elem[j])}}else{result.push(elem)}};push_all(list);for(var i=1;i<arguments.length;i++){push_all(arguments[i])}return result};proto.list_functions.slice=function(list,start,end){if(end==-1){return list.slice(start)}return list.slice(start,end+1)};proto.list_functions.splice=function(list){var args=Array.prototype.slice.call(arguments);args.shift();return list.splice.apply(list,args)};proto.list_functions.push=function(list,value){list.push(value);return list};proto.list_functions.pop=function(list){return list.pop()};proto.list_functions.unshift=function(list,value){list.unshift(value);return list};proto.list_functions.shift=function(list){return list.shift()};proto.list_functions.first=function(list){return list[0]};proto.list_functions.size=function(list){return list.length};proto.list_functions.max=function(list){return list.length-1};proto.list_functions.last=function(list){return list.slice(-1)};proto.hash_functions={};proto.hash_functions["typeof"]=function(hash){return"object"};proto.hash_functions.each=function(hash){var list=new Array();for(var key in hash){list.push(key,hash[key])}return list};proto.hash_functions.exists=function(hash,key){return(typeof(hash[key])=="undefined")?0:1};proto.hash_functions["import"]=function(hash,hash2){for(var key in hash2){hash[key]=hash2[key]}return""};proto.hash_functions.keys=function(hash){var list=new Array();for(var key in hash){list.push(key)}return list};proto.hash_functions.list=function(hash,what){var list=new Array();var key;if(what=="keys"){for(key in hash){list.push(key)}}else{if(what=="values"){for(key in hash){list.push(hash[key])}}else{if(what=="each"){for(key in hash){list.push(key,hash[key])}}else{for(key in hash){list.push({key:key,value:hash[key]})}}}}return list};proto.hash_functions.nsort=function(hash){var list=new Array();for(var key in hash){list.push(key)}return list.sort(function(a,b){return(a-b)})};proto.hash_functions.item=function(hash,key){return hash[key]};proto.hash_functions.size=function(hash){var size=0;for(var key in hash){size++}return size};proto.hash_functions.sort=function(hash){var list=new Array();for(var key in hash){list.push(key)}return list.sort()};proto.hash_functions.values=function(hash){var list=new Array();for(var key in hash){list.push(hash[key])}return list};proto.hash_functions.pairs=function(hash){var list=new Array();var keys=new Array();for(var key in hash){keys.push(key)}keys.sort();for(var key in keys){key=keys[key];list.push({key:key,value:hash[key]})}return list};proto.hash_functions.remove=function(hash,key){return delete hash[key]};proto.hash_functions["delete"]=proto.hash_functions.remove;if(typeof Jemplate.Iterator=="undefined"){Jemplate.Iterator=function(object){if(object instanceof Array){this.object=object;this.size=object.length;this.max=this.size-1}else{if(object instanceof Object){this.object=object;var object_keys=new Array;for(var key in object){object_keys[object_keys.length]=key}this.object_keys=object_keys.sort();this.size=object_keys.length;this.max=this.size-1}else{if(typeof object=="undefined"||object==null||object==""){this.object=null;this.max=-1}}}}}proto=Jemplate.Iterator.prototype;proto.get_first=function(){this.index=0;this.first=1;this.last=0;this.count=1;return this.get_next(1)};proto.get_next=function(should_init){var object=this.object;var index;if(typeof(should_init)!="undefined"&&should_init){index=this.index}else{index=++this.index;this.first=0;this.count=this.index+1;if(this.index==this.size-1){this.last=1}}if(typeof object=="undefined"){throw ("No object to iterate")}if(this.object_keys){if(index<this.object_keys.length){this.prev=index>0?this.object_keys[index-1]:"";this.next=index<this.max?this.object_keys[index+1]:"";return[this.object_keys[index],false]}}else{if(index<=this.max){this.prev=index>0?object[index-1]:"";this.next=index<this.max?object[index+1]:"";return[object[index],false]}}return[null,true]};var stubExplanation="stub that doesn't do anything. Try including the jQuery, YUI, or XHR option when building the runtime";Jemplate.Ajax={get:function(url,callback){throw ("This is a Jemplate.Ajax.get "+stubExplanation)},processGet:function(url,callback){throw ("This is a Jemplate.Ajax.processGet "+stubExplanation)},post:function(url,callback){throw ("This is a Jemplate.Ajax.post "+stubExplanation)}};Jemplate.JSON={parse:function(decodeValue){throw ("This is a Jemplate.JSON.parse "+stubExplanation)},stringify:function(encodeValue){throw ("This is a Jemplate.JSON.stringify "+stubExplanation)}}}());Function.prototype.interceptResult=function(e,b){if(typeof e!="function"){return this}var f=this;var c=function(){var h=f.apply(this||window,arguments);var m=Array.prototype.slice.call(arguments,0);var k=[h].concat(m);var j=e.apply(b||this||window,k);return j};return c};Function.prototype.trapFunction=function(j,c){var k=this,f,b;var h=function(){try{b=k.apply(this||window,arguments)}catch(n){var m="\n Error Details:";for(var q in n){m+="  "+q+":"+n[q]+"\n"}if(typeof j=="function"){m+="\n \n Calling Source Code: "+String(j)+"\n";var p=Array.prototype.slice.call(arguments,0);var e=[f].concat(p);b=j.apply(c||this||window,e)}Ext.jx.log("Error Handled:\n"+m)}return b};return h};Ext.applyIf(Array.prototype,{each:function(e){for(var c=0,b=this.length;c<b;c++){e(this[c])}}});WRM={isClient:true,isServer:false,toNumber:function(c){var b=Number(c);return isNaN(b)?0:b},showFlash:function(c){var b=Ext.jx.String.escapeHTML(Ext.encode(c));return'<div class="rl-tpl-showflash-placeholder">'+b+"</div>"},pageOptions:function(params){if(!RL.tplOptions){RL.tplOptions={}}for(var option in params){var s_new_value=params[option];var s_orig_value=RL.tplOptions[option];if(option=="s_js_add"){var tempVar;try{eval("tempVar=function (){ "+s_new_value+"}");tempVar.defer(1)}catch(err){Ext.jx.log("RL.Screen.Template::processJemplate("+this.jemplate+"): Error on s_js_add: "+err.message)}}else{if(s_orig_value==""||typeof s_orig_value=="undefined"){}else{if(option=="s_css_url"||option=="s_js_url"){s_new_value=s_orig_value+";"+s_new_value}else{}}}RL.tplOptions[option]=s_new_value}},date:{convert_text_pretty:function(c,e){var b=Ext.jx.cleanDate(c);if(!b){return}if(!e){return b.format("D, M d, Y")}else{if(e==1){return b.format("d-M-Y")}else{if(e==2){return b.format("d-M-y")}}}}},text:{label:window.l,format_email:function(b,c){if(!b){return""}return'<a href="mailto:'+b+'">'+b+"</a>"+(c?"<br>":"")}},html:{get_image_url:function(f,c){if(!f){return undef}c=c||"br";var b=Ext.jx.getStoreValue("CONFIG#IMAGEPATH");var e={br:"br_",browse:"br_",tn:"tn_",thumb:"tn_",thumbnail:"tn_"};b+=e[c];b+=f;return b},get_image_tag:function(h,e,c,j){if(!h&&!j){return}if(c){c='name = "'+c+'"'}var f=this.get_image_url(h,e);var b;if(f){b="<img border=0 "+c+' style="display:visible;" src="'+f+'" alt="" width="120" height="100" />'}else{if(j){b="<img border=0 "+c+' style="display:none" src="'+f+'" alt="" width="120" height="100" />'}}return b},getGetLink:function(){return this.getLink},getLink:function(b){if(!b){b={screen:""}}b.l=1;if(!b.tpl){b.tpl=""}return"#"+Ext.urlEncode(b)}},math:{Round:function(c,b){return Ext.jx.math.round(c,b)}}};Ext.apply(Ext.Component.prototype,{getBasicForm:function(){if(typeof(this.basicForm)!="undefined"){return this.basicForm}var b=this.findParentByType("form");this.basicForm=b.length&&b[0]?b[0].form:false;return this.basicForm},getStore:function(){var b=this.getBasicForm();var c=(b===false?false:b.store)},getRecord:function(){var c=this.getBasicForm();var b=(c===false?false:c.record);return b}});Ext.Container.prototype.removeRange=Ext.util.MixedCollection.prototype.removeRange=function(c,b){if(!this.items){return this}for(var e=b||(this.items.length-1);e>=(c||0);e--){this.remove(e)}return this};Ext.override(Ext.Container,{isOptional:null,loadRecord:Ext.form.BasicForm.prototype.loadRecord,fixTriggerFields:function(){this.cascade(function(b){if(b instanceof Ext.form.TriggerField&&b.wrap&&(!b.wrap.getWidth()||b.wrap.getWidth()==b.el.getWidth()||Ext.isIE)){Ext.jx.Misc.WebKitLateTriggerRender.call(b)}})},shallowFindBy:function(j,h){if(this.items){var f=this.items.items;for(var e=0,b=f.length;e<b;e++){var k=f[e];if(j.call(h||k,k,this)===true){return k}}}return},findField:function(c){var b=(this.items?this.items.get(c):null);if(!b){this.cascade(function(e){if(e.dataControlField==c||e.dataIndex==c||e.id==c||(e.getName&&e.getName()==c)||e.name==c){b=e;return false}})}return b||null},getValues:function(c){var b={};this.cascade(function(j){if(j.isFormField||j.getValue){var h=j.dataControlField||j.dataIndex||j.getName&&j.getName()||j.name||j.id;if(/ext-comp-\d+/.test(h)){return}var e=j.getValue?j.getValue():j.value;if(e===j.emptyText||e===undefined){e=""}b[h]=e}});return b},setValues:function(b){this.cascade(function(h){if(h.isFormField){var c=h.dataControlField||h.dataIndex||h.getName()||h.name||h.id;if(/ext-comp-\d+/.test(c)){return}if(!b.hasOwnProperty(c)){return}try{h.setValue(b[c])}catch(f){}}});return b},setValuesIf:function(b){var c=this.getValues();this.cascade(function(k){if(k.isFormField){var e=k.dataControlField||k.dataIndex||k.getName()||k.name||k.id;if(/ext-comp-\d+/.test(e)){return}var j=b[e];var h=c[e];if(typeof j!="undefined"){if(typeof h=="undefined"||h==""){k.setValue(j)}}}});return b},validate:function(j){var h=true;if(this.items){var f=this.items.items;var c=[];for(var e=0,b=f.length;e<b;e++){if(f[e].items){c.push(f[e])}else{if(!f[e].isOptional&&f[e].validate&&f[e].rendered&&!f[e].validate()){h=false}}}if(h){for(var e=0,b=c.length;e<b;e++){if(c[e].validate&&!c[e].validate()){h=false;break}}}}return h}});Ext.override(Ext.form.FieldSet,{getName:function(){return this.checkboxName||this.id+"-checkbox"},getValue:function(){return !this.collapsed}});Ext.lib.Ajax.isCrossDomain=function(c){var b=/(?:(\w*:)\/\/)?([\w\d\-\.]*(?::\d*)?)/.exec(c);if(!b[1]){return false}return(b[1]!=location.protocol)||(b[2]!=location.host)};Ext.override(Ext.data.Connection,{isUrlGetSafe:function(b,c){if(!c){c=0}return((Ext.isIE&&b.length<2083-c)||(Ext.isOpera&&b.length<4050-c)||true)},request:function(h){if(this.fireEvent("beforerequest",this,h)!==false){var c=h.params;if(typeof c=="function"){c=c.call(h.scope||window,h)}if(typeof c=="object"){c=Ext.urlEncode(c)}if(this.extraParams){var k=Ext.urlEncode(this.extraParams);c=c?(c+"&"+k):k}var b=h.url||this.url;if(typeof b=="function"){b=b.call(h.scope||window,h)}if(h.form){var e=Ext.getDom(h.form);b=b||e.action;var n=e.getAttribute("enctype");if(h.isUpload||(n&&n.toLowerCase()=="multipart/form-data")){return this.doFormUpload(h,c,b)}var m=Ext.lib.Ajax.serializeForm(e);c=c?(c+"&"+m):m}var r=h.headers;if(this.defaultHeaders){r=Ext.apply(r||{},this.defaultHeaders);if(!h.headers){h.headers=r}}var q=this.timeout;if(h.timeout&&h.timeout>0){q=h.timeout*1000}var j={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:h},timeout:q};h.method=h.method||this.method||(c?"POST":"GET");if(h.method=="GET"&&(this.disableCaching&&h.disableCaching!==false)||h.disableCaching===true){b+=(b.indexOf("?")!=-1?"&":"?")+"_dc="+(new Date().getTime())}if(typeof h.autoAbort=="boolean"){if(h.autoAbort){this.abort()}}else{if(this.autoAbort!==false){this.abort()}}if((h.method=="GET"&&c)||h.xmlData||h.jsonData){b+=(b.indexOf("?")!=-1?"&":"?")+c;c=""}if(h.scriptTag||this.scriptTag||Ext.lib.Ajax.isCrossDomain(b)){this.transId=this.scriptRequest(h.method,b,j,c,h)}else{this.transId=Ext.lib.Ajax.request(h.method,b,j,c,h)}if(this.transId===false){this.handleFailure.defer(1,this,h)}return this.transId}else{Ext.callback(h.callback,h.scope,[h,null,null]);return null}},scriptRequest:function(b,e,h,j,n){var c=++Ext.data.ScriptTagProxy.TRANS_ID;var m={id:c,cb:n.callbackName||"stcCallback"+c,scriptId:"stcScript"+c,options:n};e+=(e.indexOf("?")!=-1?"&":"?")+j+String.format("&{0}={1}",n.callbackParam||this.callbackParam||"callback",m.cb);if(!this.isUrlGetSafe(e)){alert("Error the get URL is too long.");return false}var f=this;window[m.cb]=function(p){f.handleScriptResponse(p,m)};m.timeoutId=this.handleScriptFailure.defer(h.timeout,this,[m]);var k=document.createElement("script");k.setAttribute("src",e);k.setAttribute("type","text/javascript");k.setAttribute("id",m.scriptId);document.getElementsByTagName("head")[0].appendChild(k);return m},handleScriptResponse:function(f,c){this.transId=false;this.destroyScriptTrans(c,true);var b=c.options;var e;if(typeof f=="string"){if(window.ActiveXObject){e=new ActiveXObject("Microsoft.XMLDOM");e.async="false";e.loadXML(f)}else{e=new DOMParser().parseFromString(f,"text/xml")}}response={responseObject:f,responseText:(typeof f=="object")?Ext.util.JSON.encode(f):String(f),responseXML:e,argument:b.argument};this.fireEvent("requestcomplete",this,response,b);Ext.callback(b.success,b.scope,[response,b]);Ext.callback(b.callback,b.scope,[b,true,response])},handleScriptFailure:function(c){this.transId=false;this.destroyScriptTrans(c,false);var b=c.options;response={argument:b.argument,status:500,statusText:l("Server failed to respond"),responseText:""};this.fireEvent("requestexception",this,response,b,{status:-1,statusText:l("communication failure")});Ext.callback(b.failure,b.scope,[response,b]);Ext.callback(b.callback,b.scope,[b,false,response])},destroyScriptTrans:function(c,b){document.getElementsByTagName("head")[0].removeChild(document.getElementById(c.scriptId));clearTimeout(c.timeoutId);if(b){window[c.cb]=undefined;try{delete window[c.cb]}catch(f){}}else{window[c.cb]=function(){window[c.cb]=undefined;try{delete window[c.cb]}catch(h){}}}}});Ext.override(Ext.form.DateField,{onTriggerClick:function(){if(this.disabled){return}if(this.menu==null){this.menu=new Ext.menu.DateMenu(Ext.apply({hideOnClick:false},this.configMenu))}this.onFocus();Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))},this.configPicker);if(!this.getValue()){this.menu.picker.setValue(this.parseDate(this.defaultDate||this.minValue||new Date()))}else{this.menu.picker.setValue(this.getValue())}if(Ext.isIE){this.menu.setWidth(175)}this.menu.show(this.el,"tl-bl?");this.menuEvents("on")}});Ext.form.DateField.prototype.onRender=Ext.form.DateField.prototype.onRender.createSequence(function(){if(this.vtype=="daterange"&&this.endDateField){var b=this;(function(){if(b.el.dom){Ext.form.VTypes.daterange(b.getValue(),b)}}).defer(100,this)}});Ext.DatePicker.prototype.onRender=Ext.DatePicker.prototype.onRender.createSequence(function(){if(this.datePickerMsg){this.el.insertHtml("afterBegin",'<div align=center class="x-date-middle x-btn x-btn-text" style="width:auto">'+this.datePickerMsg+"</div>")}});Date.prototype.getMaxDate=function(b){return(this.subtractDt(b)>0?this:b)};Date.prototype.getMinDate=function(b){return(this.subtractDt(b)<0?this:b)};Date.prototype.subtractDt=function(b){var c=(this.getTime()-b.getTime())/86400000;return c};Ext.override(Ext.data.Record,{getTableName:function(){return this.getTable().tableName},tpl:function(c,b){c=c.replace(/(\.HTML)?$/,".HTML").toUpperCase();var e={label:window.l,field:function(f){return f},image:function(f){return f},o_table:this,h_options:b};return Jemplate.process(this.getTableName()+"/"+c,e)},getValueRaw:function(b){return this.getValue(b)},getValue:function(c){c=c.replace(/\./,"#").toUpperCase();var b=c.split("#");if(b.length&&b[0]=="PROSPW"||b[1]=="CUSTNUM"){return RL.Global.user.prospwRecord.data["PROSPW#"+b[1]]}return this.data[c]},get_images:function(){if(!this.a_images){this.a_images=[];var c=this.getTableName();for(var e=1;e<=10;e++){var b=this.getValue(c+"#IMAGE"+e);if(b){this.a_images.push(b)}}}return this.a_images},get_image:function(f,j,e,b){if(!j){j=1}if(!f){f="br_"}f=f.toLowerCase();var c={br:"br_",browse:"br_",tn:"tn_",thumb:"tn_",thumbnail:"tn_"};f=c[f]||f;var h=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"})+"/"+f;if(!b){b=this.get_images()[j-1]}if(!b){return""}return"<img border=0 class='wrm_image "+f+"' style='float:left; margin: 3px; BORDER: solid 1px black; "+e+"' src='"+h+b+"'>"},getLink:function(e){if(!e){e={}}var c={DEPT:{param:"pl",value:"DEPT#DEPTNO"},SERVICE:{param:"producttype",value:"SERVICE#CODE"},PRODGRP:{param:"prodgroup",value:"PRODGRP#PGID"},RESORT:{param:"dest",value:"RESORT#SEARCHCODE"},SUPERDES:{param:"superdest",value:"SUPERDES#CODE"},SPECIAL:{param:"special",value:"SPECIAL#CODE"}};var b=c[this.getTableName()];if(b){e[b.param]=this.data[b.value]}else{Ext.jx.log("called get_link from unhandled table: "+this.getTableName())}return WRM.html.getLink(e)}});Ext.data.Record.create=Ext.data.Record.create.interceptResult(function(c,b,f){var h;if(f&&f.tableName&&(h=Ext.jx.getTable(f.tableName))){if(!h.FuncsRow){h.FuncsRow={}}if(!c.prototype.getTable){c.prototype.getTable=function(){return h};Ext.apply(c.prototype,h.FuncsRow)}}else{}if(f&&f.rowObj&&f.rowObj.prototype){Ext.apply(c.prototype,f.rowObj.prototype)}var e=Ext.extend(c,{constructor:function(j,k){c.superclass.constructor.apply(this,arguments);if(!this.id){this.id=(k||k===0)?k:++Ext.data.Record.AUTO_ID}if(!this.data){this.data=j}}});return e});Ext.data.Store.prototype.getStoreId=function(){if(!this.storeId){this.setStoreId(Ext.id())}return this.storeId};Ext.data.Store.prototype.setStoreId=function(b){if(this.id||this.storeId){Ext.StoreMgr.unregister(this)}this.storeId=this.id=b;Ext.StoreMgr.register(this)};Ext.DataView.prototype.prepareData=function(h,c,b){var f={_record:b};for(var e in h){f[e]=h[e]}return f};Ext.Element.prototype.withinBox=function(e,f){var c=this.getBox(true);var b=e.x||e[0];var h=e.y||e[1];if(!f){f=0}return(c.x-f<=b&&c.right+f>=b&&c.y-f<=h&&c.bottom+f>=h)};Ext.form.ComboBoxQuickChange=Ext.extend(Ext.form.ComboBox,{initComponent:function(){Ext.form.ComboBoxQuickChange.superclass.initComponent.call(this);this.on("select",function(){var b=this.getValue();if(String(b)!==String(this.startValue)){this.fireEvent("change",this,b,this.startValue);this.startValue=b}})}});Ext.reg("combo_quick_change",Ext.form.ComboBoxQuickChange);Ext.ns("Ext.form.ComboBox");Ext.form.ComboBox.Container=Ext.extend(Ext.form.ComboBoxQuickChange,{tpl:" ",embedd:null,height:300,minHeight:200,expandFromOnLoad:false,onViewClick:function(){return},onViewMove:function(){return},onViewOver:function(){return},initList:function(){Ext.form.ComboBox.Container.superclass.initList.call(this);this.view.setStore(null);if(!(this.embedd instanceof Ext.Component)){this.embedd=Ext.ComponentMgr.create(this.embedd,Ext.Panel)}this.embedd.applyToMarkup(this.innerList)},onLoad:function(){this.expandFromOnLoad=true;Ext.form.ComboBox.Container.superclass.onLoad.call(this);this.expandFromOnLoad=false},onDestroy:function(){Ext.destroy(this.embedd);Ext.form.ComboBox.Container.superclass.onDestroy.call(this)},onTypeAhead:function(){if(this.store.getCount()>0){var c=this.store.getAt(0);var e=c.data[this.displayField];var b=e.length;var f=this.getRawValue().length;if(f!=b){this.setValue(c.data[this.valueField]);this.selectText(f,e.length)}}},expand:function(){if(this.expandFromOnLoad){return}if(this.isExpanded()||!this.hasFocus){return}var f=Ext.getBody();var h=f.getBox().bottom;var e=this.el.getBox().bottom;var m=h-e-10;var n=this.embedd;var j=this.list;if(m>=this.minHeight){if(m<=this.height){this.height=m}this.alignTo=this.listAlign||"tl-bl?"}else{var c=f.getBox().y;var b=this.el.getBox().y;var k=b-c-10;if(k<=this.height){this.height=k}this.alignTo="bl-tl?"}j.setHeight(this.height);n.setHeight(this.height);j.alignTo(this.wrap,this.alignTo);j.show();if(n.doLayout){n.doLayout()}this.innerList.setOverflow("auto");Ext.getDoc().on("mousewheel",this.collapseIf,this);Ext.getDoc().on("mousedown",this.collapseIf,this);this.fireEvent("expand",this)},onTriggerClick:function(){if(this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});this.expand();this.el.focus()}}});Ext.reg("container_combo",Ext.form.ComboBox.Container);Ext.apply(Ext.form.VTypes,{daterange:function(x,c){var b,f,w=false;if(!c.startDateField&&!c.endDateField){alert("needs to have the startDateField or the endDateField");return}else{if(c.endDateField){w=true;b=c;f=c.ownerCt.findField(c.endDateField)||c.ownerCt.ownerCt.findField(c.endDateField)||c.ownerCt.ownerCt.ownerCt.findField(c.endDateField);if(!f){alert("Could not find the end date field");return}}else{if(c.startDateField){b=c.ownerCt.findField(c.startDateField)||c.ownerCt.ownerCt.findField(c.startDateField)||c.ownerCt.ownerCt.ownerCt.findField(c.startDateField);f=c;if(!b){alert("Could not find the start date field");return}}}}var q=function(z,B){var A=z.activeDate;z.activeDate=B;z.update(A)};var e=b.getValue();var s=f.getValue();var k=(typeof(b.minDaysOut)=="undefined"?5:c.minDaysOut);var m=(typeof(b.defaultDays)=="undefined"?5:c.defaultDays);var t=(typeof(b.minDays)=="undefined"?0:c.minDays);var u=(typeof(b.maxDays)=="undefined"?2:c.maxDays);var j=(typeof(b.minDate)=="undefined"?(new Date()).clearTime():Ext.jx.cleanDate(b.minDate));var n=(typeof(b.maxDate)=="undefined"?"":Ext.jx.cleanDate(b.maxDate));if(w){if(e){var v=e.add("d",t);f.minValue=v;if(f.menu&&f.menu.picker){f.menu.picker.minDate=v;q(f.menu.picker,f.minValue)}var v=e.add("d",t);if(u){var p=e.add("d",u);f.maxValue=p;if(f.menu&&f.menu.picker){f.menu.picker.maxDate=p;q(f.menu.picker,f.minValue)}}if(s){var h=s.subtractDt(e);if(h<t||(u&&h>u)){var r=e.add("d",m);f.setValue(r);f.fireEvent("change",f,r,s)}}else{var r=e.add("d",m);f.setValue(r);f.fireEvent("change",f,r,s)}}else{f.minValue=b.minValue;f.maxValue=b.maxValue;if(f.menu&&f.menu.picker){f.menu.picker.minDate=f.minValue;f.menu.picker.maxDate=f.maxValue;q(f.menu.picker,f.minValue)}}}else{}return true},password:function(e,c){if(c.initialPassField){var b=Ext.getCmp(c.initialPassField);return(e==b.getValue())}return true},passwordText:"Passwords do not match"});Ext.override(Ext.layout.FormLayout,{renderItem:function(h,b,f){if(h&&!h.rendered&&(h.isFormField||h.fieldLabel)&&h.inputType!="hidden"){var e=this.getTemplateArgs(h);if(typeof b=="number"){b=f.dom.childNodes[b]||null}if(b){h.formItem=Ext.get(this.fieldTpl.insertBefore(b,e))}else{h.formItem=Ext.get(this.fieldTpl.append(f,e))}h.render("x-form-el-"+h.id)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}}});Ext.override(Ext.Component,{hideItem:function(){if(this.formItem){this.formItem.addClass("x-hide-"+this.hideMode)}else{this.hide()}},showItem:function(){if(this.formItem){this.formItem.removeClass("x-hide-"+this.hideMode)}else{this.hide()}}});Ext.Panel.prototype.createClasses=Ext.Panel.prototype.createClasses.createSequence(function(){if(this.tools){var c=false;for(var b in this.tools){c=true;break}if(!c){this.tools=undefined}}});Ext.StoreMgr.lookup=function(id){if(Ext.isArray(id)){var fields=["field1"],expand=!Ext.isArray(id[0]);if(!expand){for(var i=2,len=id[0].length;i<=len;++i){fields.push("field"+i)}}return new Ext.data.ArrayStore({fields:fields,data:id,expandData:expand,autoDestroy:true,autoCreated:true})}var store=Ext.isObject(id)?(id.events?id:Ext.create(id,"store")):this.get(id);if(!store){store=eval(id)}return store};Ext.jx={vendors:{},vars:{language:"",debug:0},ignoreNull:function(b){if(typeof(b)=="undefined"||b===null){b=""}return b},allowDebug:false,debug:function(message){if(Ext.jx.allowDebug){if(message){Ext.jx.log("Ext.jx.debug Message: "+message)}eval("debugger")}else{Ext.jx.log("debug statement ignored")}1},isObjectEmpty:function(c){for(var b in c){return false}return true},lowerCaseKeys:function(c){var b={};Ext.jx.each(c,function(f,e){b[e.toLowerCase()]=f});return b},getQueryString:function(b,e){if(!b){b=window.location.search}var c=Ext.urlDecode(b.replace(/^\?/,"")||null);return e?Ext.jx.lowerCaseKeys(c):c},getUrlFrag:function(b,e){if(!b){b=window.location.href}var c=Ext.urlDecode(/[^#]*(?:#(.*))?/.exec(b)[1]||null);return e?Ext.jx.lowerCaseKeys(c):c},getVar_QS_Frag:function(e,c){var b=Ext.jx.getQueryString();if(b&&b[e]){return b[e]}var f=Ext.jx.getUrlFrag();if(f&&f[e]){return f[e]}if(c){if(b&&b[c]){return b[c]}if(f&&f[c]){return f[c]}}return undefined},getStore:function(c,b){return Ext.jx.getTable(c).getData(b).getStore()},getStoreValue:function(b){if(typeof b=="string"){b={fieldName:b}}var c=this.getRecord(b);return(c?c.data[b.fieldName]:undefined)},setStoreValue:function(b,c){if(typeof b=="string"){b={fieldName:b}}var e=this.getRecord(b);return(e?e.data[b.fieldName]=c:undefined)},getRecord:function(c){var b;if(c.storeId){b=Ext.StoreMgr.lookup(c.storeId)}else{if(c.tableName){if(!c.dataName){c.dataName="ALL"}var e=Ext.jx.getTable(c.tableName);b=e.getData(c.dataName).getStore()}else{if(c.fieldName.indexOf("#")!=-1){c.tableName=c.fieldName.split("#")[0];if(!c.tableName){c.tableName="DEPT"}if(!c.dataName){c.dataName="ALL"}b=Ext.jx.getTable(c.tableName).getData(c.dataName).getStore()}}}if(!b){return undefined}var f;if(c.recordId){f=b.getById(c.recordId)}else{if(c.recordNo){f=b.data.items[c.recordNo]}else{if(b.data.items.length==1){f=b.data.items[0]}}}return f},getTable:function(b){if(!b){Ext.jx.debug("Did not specify tableName");return""}if(!Ext.jx.tables){Ext.jx.tables={}}b=b.toUpperCase();var c=Ext.jx.tables[b];if(!c){Ext.jx.debug("Can not load table: "+b)}return c},setTable:function(c,h){if(!Ext.jx.tables){Ext.jx.tables={}}if(!c){Ext.jx.debug("Did not specify tableName");return""}else{if(typeof(c)=="object"){var f=c;for(var b in f){var e=f[b];if(e===null||e===undefined){continue}Ext.jx.setTable(b,e)}return}}var k=Ext.jx.Table;c=c.toUpperCase();var j=Ext.jx.tables[c];if(!j){if(!h){h={}}h.tableName=c;j=Ext.jx.tables[c]=new Ext.jx.Table(h)}else{if(h){j.applyDefinition(h)}}return j},copyForm:function(e){var c={h_exclusions:{}};Ext.jx.each(Ext.jx.TableFormCopyOverrides,function(h,j){c.h_exclusions[j]=function(){return h.apply(e,arguments)}});if(Ext.jx.vars.language){var f;if(!formContainer.languages||!(f=formContainer.languages[Ext.jx.vars.language]())){}else{c.h_overrides=f}}var b=Ext.jx.Object.deepCopy(e,c);return b},TableFormCopyOverrides:{CONDITION:function(f,e){var c=this;var b=e.o_source[e.s_key];var h={};Ext.jx.each(b,function(k,j){h[j]=k});return h},NO_COPY:function(e,c){var b=c.o_source[c.s_key];var f={};Ext.jx.each(b,function(j,h){f[h]=j});return f},INSERT_DB:function(c,n){var b=this;var e=n.s_value;var j=n.o_source;var h=Ext.jx.getTable(e.tableName);var k;if(e.dataName){k=h.getData(e.dataName)}else{alert("todo")}Ext.jx.Prototypes.Resume();var m=k.getStore();Ext.jx.Prototypes.Pause();var f=j.xtype;if(/^combo/.test(f)){return{store:m}}else{alert("Can not find handler for xtype: "+j.xtype)}}},TableData:{getStore:function(p,b,n,j){var f=this;if(!f.storeStorage||j){var e=Ext.data.Record.create(f.meta.fields,f.meta);var h=new Ext.data.JsonReader(f.meta,e);if(!f.rows.length){f.rows=[]}var k=f.storeStorage=new (n||Ext.data.Store)({data:f,reader:h});if(p&&p.remote){var c=Ext.jx.Server.get();var m="";if(Ext.jx.getQueryString()["debug_mode"]){m+="&debug_output_to_email=1"}if(Ext.lib.Ajax.isCrossDomain(c)){k.proxy=new Ext.data.ScriptTagProxy({url:c+"?"+(p.remoteUrlAppend||f.dataName)+"&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO")+m})}else{k.proxy=new Ext.data.HttpProxy({url:c+"?"+(p.remoteUrlAppend||f.dataName)+"&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO")+m})}if(p.loadNow){k.on({load:function(){Ext.jx.Server.release(c)},loadException:function(){Ext.jx.Server.release(c);alert("could not load store")}});k.load()}}}return f.storeStorage}},each:function(e,k,j,m){var c=typeof(j)=="object";if(!m){m={}}if(typeof(e.length)!="undefined"){if(m.b_reverse_order){for(var b=e.length-1;b>=0;b--){var h=e[b];if(h===null||h===undefined){continue}if(false===k.call(j||(typeof(h)=="object"?h:this),h,b,m)){break}}}else{for(var b=0;b<e.length;b++){var h=e[b];if(h===null||h===undefined){continue}if(false===k.call(j||(typeof(h)=="object"?h:this),h,b,m)){break}}}}else{if(typeof(e)=="object"){for(var f in e){var h=e[f];if(h===null||h===undefined){continue}if(false===k.call(j||(typeof(h)=="object"?h:this),h,f,m)){break}}}}return},log:function(){try{if(window.console){if(Ext.isIE){var b="";Ext.each(arguments,function(e){b+=String(e)});console.log(b)}else{console.log.apply(console,arguments)}}}catch(c){debug()}},redirect:function(b,c){Ext.jx.unmask(Ext.getBody());if(!c){c=l("Now redirecting you.")}Ext.jx.mask(Ext.getBody(),c,"rl-mask-medium",true);window.location.replace(b)}};window.debug=Ext.jx.debug;window.log=Ext.jx.log;Ext.form.CompositeField.prototype.updateInvalidMark=Ext.form.CompositeField.prototype.updateInvalidMark.trapFunction();Ext.Button.prototype.setText=Ext.Button.prototype.setText.trapFunction();Ext.ButtonGroup.prototype.onAfterLayout=Ext.ButtonGroup.prototype.onAfterLayout.trapFunction();Ext.Element.prototype.getStyle=Ext.Element.prototype.getStyle.trapFunction();Ext.override(Ext.grid.GridView,{hasRows:function(){var b=this.mainBody.dom&&this.mainBody.dom.firstChild;return b&&b.nodeType==1&&b.className!="x-grid-empty"}});Ext.Element.prototype.getValue=Ext.Element.prototype.getValue.trapFunction();if(Ext.isIE){if(Ext.isIE6||Ext.isIE7){Ext.Element.prototype.getAttribute=Ext.Element.prototype.getAttribute.trapFunction()}Ext.Element.prototype.setWidth=Ext.Element.prototype.setWidth.trapFunction();Ext.Shadow.prototype.realign=Ext.Shadow.prototype.realign.trapFunction();Ext.form.Field.prototype.markInvalid=Ext.form.Field.prototype.markInvalid.trapFunction();Ext.lib.Scroll.prototype.setAttr=Ext.lib.Scroll.prototype.setAttr.trapFunction();Ext.lib.AnimMgr.stop=Ext.lib.AnimMgr.stop.trapFunction();Ext.Element.prototype.setStyle=Ext.Element.prototype.setStyle.trapFunction();Ext.Element.prototype.getXY=Ext.Element.prototype.getXY.trapFunction(function(){return[0,0]});Ext.list.ListView.prototype.onResize=Ext.list.ListView.prototype.onResize.trapFunction()}else{if(Ext.isWebKit){Ext.form.Field.prototype.markInvalid=Ext.form.Field.prototype.markInvalid.trapFunction()}else{if(Ext.isGecko3){Ext.Element.prototype.insertBefore=Ext.Element.prototype.insertBefore.trapFunction()}}}if(Ext.isIE){var tempTableEl=null,emptyTags=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,tableRe=/^table|tbody|tr|td$/i,pub,afterbegin="afterbegin",afterend="afterend",beforebegin="beforebegin",beforeend="beforeend",ts="<table>",te="</table>",tbs=ts+"<tbody>",tbe="</tbody>"+te,trs=tbs+"<tr>",tre="</tr>"+tbe;function ieTable(p,k,j,m){tempTableEl.innerHTML=[k,j,m].join("");var b=-1,f=tempTableEl,c;while(++b<p){f=f.firstChild}if(c=f.nextSibling){var n=document.createDocumentFragment();while(f){c=f.nextSibling;n.appendChild(f);f=c}f=n}return f}function insertIntoTable(b,c,f,e){var h,j;tempTableEl=tempTableEl||document.createElement("div");if(b=="td"&&(c==afterbegin||c==beforeend)||!/td|tr|tbody/i.test(b)&&(c==beforebegin||c==afterend)){return}j=c==beforebegin?f:c==afterend?f.nextSibling:c==afterbegin?f.firstChild:null;if(c==beforebegin||c==afterend){f=f.parentNode}if(b=="td"||(b=="tr"&&(c==beforeend||c==afterbegin))){h=ieTable(4,trs,e,tre)}else{if((b=="tbody"&&(c==beforeend||c==afterbegin))||(b=="tr"&&(c==beforebegin||c==afterend))){h=ieTable(3,tbs,e,tbe)}else{h=ieTable(2,ts,e,te)}}f.insertBefore(h,j);return h}Ext.DomHelper.insertHtml=function(k,b,m){var j={},e,q,n,s,h,c,t,p=b.nodeType!=1,r,f=Ext.emptyFn;if(p){r=b.parentNode.appendChild(document.createElement("span"),b);r.appendChild(b);b=r;f=function(){r.parentNode.appendChild(r.firstChild,r);r.parentNode.removeChild(r)}}k=k.toLowerCase();j[beforebegin]=["BeforeBegin","previousSibling"];j[afterend]=["AfterEnd","nextSibling"];if(b.insertAdjacentHTML){if(tableRe.test(b.tagName)&&(c=insertIntoTable(b.tagName.toLowerCase(),k,b,m))){return c}j[afterbegin]=["AfterBegin","firstChild"];j[beforeend]=["BeforeEnd","lastChild"];if((e=j[k])){b.insertAdjacentHTML(e[0],m);t=b[e[1]];f();return t}}else{n=(b.nodeType==1?b:b.parentNode).ownerDocument.createRange();q="setStart"+(/end/i.test(k)?"After":"Before");if(j[k]){n[q](b);s=n.createContextualFragment(m);b.parentNode.insertBefore(s,k==beforebegin?b:b.nextSibling);t=b[(k==beforebegin?"previous":"next")+"Sibling"];f();return t}else{h=(k==afterbegin?"first":"last")+"Child";if(b.firstChild){n[q](b[h]);s=n.createContextualFragment(m);if(k==afterbegin){b.insertBefore(s,b.firstChild)}else{b.appendChild(s)}}else{b.innerHTML=m}t=b[h];f();return t}}throw'Illegal insertion point -> "'+k+'"'}}Ext.ux.SimpleIframePanel=Ext.extend(Ext.Panel,{initComponent:function(){Ext.ux.SimpleIframePanel.superclass.initComponent.apply(this,arguments);this.addEvents("load")},onRender:function(){this.bodyCfg={tag:"iframe",src:this.src,frameborder:0,style:{border:"0px none"}};if(this.bodyCls){this.bodyCfg.cls=this.bodyCls}this.resizable=(this.src.split(window.location.host).length>=2);if(this.resizable){this.bodyCfg.scrolling="no";this.bodyCfg.style.overflow="hidden"}Ext.ux.SimpleIframePanel.superclass.onRender.apply(this,arguments);var e=this;var b=function(){e.resizeIframe();e.fireEvent("load",e)};var c=this.body.dom;if(c.attachEvent){c.attachEvent("onload",b)}else{c.onload=b}},resizeIframe:function(){if(!this.resizable){return}if(this.src.split(window.location.host).length<2){return}try{var c=this.body.dom;var h=c.contentWindow;var f=h.document;var b;if(f.body.offsetHeight){b=f.body.offsetHeight+32}else{if(f.body.scrollHeight){b=f.body.scrollHeight}}if(b){this.setHeight(b);f.body.scroll="no";this.syncSize()}}catch(e){Ext.jx.log("Problem resizing iframe:"+e.message)}}});Ext.reg("simple_iframe_panel",Ext.ux.SimpleIframePanel);Ext.jx.onlyKeepFirst=function(b){var c=0;Ext.getBody().select(b).each(function(e){if(!c){e.remove(true)}c++})};Ext.jx.mask=function(h,j,c,f,e){if(!RL.masksNow){RL.masksNow=[]}RL.masksNow.push(1);if(!e&&RL.masksNow.length>1){return}var b=Ext.get(h).mask(j,c);b.addClass("rl-mask-overwindow");if(f){b.addClass("rl-mask-opaque")}};Ext.jx.unmask=function(c,b){RL.masksNow.pop();if(RL.masksNow.length>0){return}var e=Ext.get(c);if(b){e.unmask.defer(b,e)}else{e.unmask()}};Ext.jx.cleanDate=function(e){var f=!e?undefined:Ext.isDate(e)?e:Date.parseDate(e,"m/d/Y");if(!f&&e){var b=e.split("/"),c;b[0]=Number(b[0]);if(b[0]>0&&b[0]<10){b[0]="0"+b[0];c=true}b[1]=Number(b[1]);if(b[1]>0&&b[1]<10){b[1]="0"+b[1];c=true}if(c){f=Date.parseDate(b.join("/"),"m/d/Y")}}return f};Ext.jx.getDBDate=function(b){return !b?undefined:Ext.isDate(b)?b.format("m/d/Y"):b};devThrow=function(b){if(RL&&RL.Defaults&&RL.Defaults.DEV_MODE){throw b}return false};Ext.override(Ext.layout.TableLayout,{getNextCell:function(n){var b=this.getNextNonSpan(this.currentColumn,this.currentRow);var j=this.currentColumn=b[0],h=this.currentRow=b[1];for(var m=h;m<h+(n.rowspan||1);m++){if(!this.cells[m]){this.cells[m]=[]}for(var f=j;f<j+(n.colspan||1);f++){this.cells[m][f]=true}}var k=document.createElement("td");if(n.cellId){k.id=n.cellId}var e="x-table-layout-cell";if(n.cellCls){e+=" "+n.cellCls}k.className=e;if(n.colspan){k.colSpan=n.colspan}if(n.rowspan){k.rowSpan=n.rowspan}if(n.vAlign){k.vAlign=n.vAlign}if(n.cellStyle){k.style=n.cellStyle}if(n.cellWidth){k.width=n.cellWidth}this.getRow(h).appendChild(k);return k}});window.l=function(c){var b;if(window._labels&&c){if(!(b=window._labels[String(c).toUpperCase()])){b=c}}else{b=c}return b};Ext.ns("Ext.jx");Ext.jx.Ajax={urlDecode:function(n){if(!a){return""}var e=[];for(var j in o){var h=o[j],c=encodeURIComponent(j);var m=typeof h;if(m=="undefined"){e.push(c,"=&")}else{if(m!="function"&&m!="object"){e.push(c,"=",encodeURIComponent(h),"&")}else{if(Ext.isArray(h)){if(h.length){for(var f=0,b=h.length;f<b;f++){e.push(c,"=",encodeURIComponent(h[f]===undefined?"":h[f]),"&")}}else{e.push(c,"=&")}}else{if(Ext.isDate(h)){e.push(c,"=",encodeURIComponent(h.dateFormat("m/d/Y")),"&")}else{e.push(c,"=",encodeURIComponent(Ext.jx.Ajax.urlEncode(h)),"&")}}}}}e.pop();return e.join("")},urlEncode:function(n){if(!n){return""}var e=[];for(var j in n){var h=n[j],c=encodeURIComponent(j);var m=typeof h;if(m=="undefined"){e.push(c,"=&")}else{if(m!="function"&&m!="object"){e.push(c,"=",encodeURIComponent(h),"&")}else{if(Ext.isArray(h)){if(h.length){for(var f=0,b=h.length;f<b;f++){e.push(c,"=",encodeURIComponent(h[f]===undefined?"":h[f]),"&")}}else{e.push(c,"=&")}}else{if(Ext.isDate(h)){e.push(c,"=",encodeURIComponent(h.dateFormat("m/d/Y")),"&")}else{e.push(c,"=",encodeURIComponent(Ext.jx.Ajax.urlEncode(h)),"&")}}}}}e.pop();return e.join("")},cleanFieldNamesForPost:function(b,c,e){if(typeof(c)=="undefined"){c={}}if(!e){e=""}else{e+="#"}Ext.jx.each(b,function(j,h){if(/ext-comp-\d+/.test(h)){return}var f=Ext.type(j);if(f=="string"){if(j==""){return}}else{if(f=="date"){j=j.dateFormat("m/d/Y")}else{if(f=="object"){if(Ext.isDate(j)){j=j.dateFormat("m/d/Y")}else{if(j.format0){j=j.format0()}}}}}var k=e+h.replace(/\#/,".");c[k]=j});return c}};Ext.ns("Ext.jx");Ext.jx.External={includeJs:function(f,c){var e=document.createElement("script");e.setAttribute("language","javascript");e.setAttribute("type","text/javascript");e.setAttribute("src",f);if(c){e.onreadystatechange=function(){if(e.readyState=="complete"||e.readyState=="loaded"){if(e.getAttribute("b_fired_onload")!=1){e.setAttribute("b_fired_onload",1);c()}}};e.onload=function(){if(e.getAttribute("b_fired_onload")!=1){e.setAttribute("b_fired_onload",1);c()}}}var b=document.getElementsByTagName("head").item(0);b.appendChild(e);return false},includeCss:function(j,h){if(!j){return h?h():false}for(var f=0;f<document.styleSheets.length;f++){var c=document.styleSheets[f].href;if(c&&j.indexOf(c)!=-1){return h?h():false}}var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",j);if(h){b.onreadystatechange=function(){if(b.readyState=="complete"||b.readyState=="loaded"){if(b.getAttribute("b_fired_onload")!=1){b.setAttribute("b_fired_onload",1);h()}}};b.onload=function(){if(b.getAttribute("b_fired_onload")!=1){b.setAttribute("b_fired_onload",1);h()}}}var e=document.getElementsByTagName("head").item(0);e.appendChild(b);return false}};Ext.ns("Ext.jx");Ext.jx.Map={Google:{urlKeys:{},loaded:true,apiCallBack:function(){Ext.jx.Map.Google.loaded=true;Ext.lib.Event.on(window,"unload",function(){if(window.GUnload){GUnload()}})},include:function(){if(Ext.jx.Map.included){return false}Ext.jx.Map.included=true;Ext.jx.External.includeJs("http://maps.google.com/maps/api/js?sensor=false&callback=Ext.jx.Map.Google.apiCallBack")}}};Ext.ns("Ext.jx");Ext.jx.math={num:function(c,b){if(typeof(b)=="undefined"){b=0}if(typeof c!="number"){c=Number(c);if(typeof(c)!="number"){return b}}return c},safe_divide:function(b,c){return(Ext.jx.math.num(c)==0?0:Ext.jx.math.num(b)/Ext.jx.math.num(c))},safe_divide_round:function(c,f,e){if(typeof(e)=="undefined"){e=2}var b=Ext.jx.math.round(Ext.jx.math.safe_divide(c,f),e);return b},generate_random:function(b,e){if(typeof(b)=="undefined"){return 0}if(typeof(e)=="undefined"){e=0}var c=Math.floor(Math.random()*(b-e+1)+e);return c},round:function(e,c){if(typeof(c)=="undefined"){c=1}var f=Math.pow(10,c);var b=Math.round(e*f)/f;return b},regExPosNeg:/(\-?)(\d*)\.?(\d*)/,currencyDefaults:{USD:"$ 123,456,789.00",CAD:"C$ 123,456,789.00",AUD:"A$ 123,456,789.00",HKD:"HK$ 123,456,789.00",GBP:"&pound; 123,456,789.00",EUR:"&euro; 123 456 789,00",CHF:"123 456 789,00 CHF",JPY:"J&yen; 123.456.789",RMB:"C&yen; 123.456.789,00",CNY:"C&yen; 123.456.789,00"},formatCurrency:function(t,p,k){var b;if(!p){p=RL.Global.getCurrency()}else{if(typeof p=="string"){b=p;p=Ext.jx.getTable("CURRENCY").Funcs.getCurrencyByCode(p)}}if(!b){b=p.data["CURRENCY#CTYCODE"]}var n=Ext.jx.getStoreValue("CONFIG#CURRENCY");if(n&&n!=b&&!k){t=t*p.get("CURRENCY#CONVRATE")}var s=p.data["CURRENCY#HTMLFORMAT"]||Ext.jx.math.currencyDefaults[b]||Ext.jx.math.htmlFormat;var c=Ext.jx.math.analyzeCurrency(s),h=Ext.jx.math.regExPosNeg.exec(t),m=0,f;var q=c.currencyPrefix+(h[1]||""),j="";var r=Ext.jx.String.reverse(h[2]),e=r.length;for(f=c.digitsGroupingLast;f<e;f+=c.digitsGroupingLast){if(m){j+=c.groupingSeperator}j+=r.substr(m,f-m);m=f}if(m<e){if(m){j+=c.groupingSeperator}j+=r.substr(m)}q+=Ext.jx.String.reverse(j);if(c.decimalPlaces){q+=c.decimalSeperator;q+=String(Math.round(Math.pow(10,c.decimalPlaces)*Number("1."+h[3]))).substr(1)}q+=c.currencyPostfix;return q},htmlFormat:"$ 123,456,789.00",analyzeCache:{},regexCurrencyAnalyze:/(.*)(1.?2.?3.?4.?5.?6.?7.?8.?9)(\D*)(0*)(.*)/,analyzeCurrency:function(c){if(!c||c==""){c=Ext.jx.math.htmlFormat}if(Ext.jx.math.analyzeCache[c]){return Ext.jx.math.analyzeCache[c]}var f=Ext.jx.math.regexCurrencyAnalyze.exec(c),k=Ext.jx.String.reverse(f[2]),b=[],e=0;var j=/\D+/g.exec(k);var h=j?k.substr(0,j.index):k;return Ext.jx.math.analyzeCache[c]={currencyPrefix:f[1]||"",currencyPostfix:f[5]||"",decimalSeperator:f[3]||".",decimalPlaces:typeof f[4]=="string"?f[4].length:0,groupingSeperator:j?k.substr(h.length,j[0].length):"",digitsGroupingLast:h.length||3}}};Ext.namespace("Ext.jx.Misc");Ext.jx.Misc.updateItemLabel=function(e,f,b,j){var c;if((c=b.get(j))){var h=e.findBy(function(k){return k.name===f},e)[0];if(h){h.fieldLabel=c}}};Ext.jx.Misc.WebKitLateTriggerRender=function(){return undefined;if(!this.trigger){return undefined}var b=this.width||this.el.getWidth()||110;var c=this.triggerWidth||this.trigger.getWidth()||17;var f=this.adjustWidth("input",b-c);this.el.setWidth(f);this.wrap.setWidth(f+c);var e;if(Ext.isIE&&!this.hideTrigger&&this.el.getY()!=(e=this.trigger.getY())){this.el.position();this.el.setY(e)}};Ext.jx.isEmpty=function(c){for(var b in c){return false}return true};Ext.ns("Ext.jx");Ext.jx.Object={deepCopy:function(J,E){if(!E){E={}}if(!E.h_exclusions){E.h_exclusions={}}var B=Ext.jx.vars;var t,r=[];if(!B.n_deep_copy_count){B.n_deep_copy_count=0}var f="-REP-ID-DC-"+(++B.n_deep_copy_count);Ext.jx.Prototypes.Pause();var n,D;if(typeof(J)==="object"&&J!=null&&typeof(J.length)!="undefined"){t=[];for(var s=0;s<J.length;s++){var j=s;var v=J[s];if(typeof(v)==="object"&&v!=null){r.push({s_key:j,s_value:v,o_source:J,o_dest:t,s_path:""})}else{t[j]=v}}}else{if(typeof(J)==="object"){t={};for(var j in J){var v=J[j];if(typeof(v)==="object"&&v!=null){r.push({s_key:j,s_value:v,o_source:J,o_dest:t,s_path:""})}else{t[j]=v}}}else{Ext.jx.Prototypes.Resume();return J}}var j,x,C,u;for(var s=0;s<r.length;s++){var h=r[s];j=h.s_key;x=h.o_source[j];u=h.s_path+"["+j+"]";if(h.s_value.nodeType||h.s_value.constructor==RegExp){h.o_dest[j]=x;continue}if(E.b_dupe_checker){if(x[f]){var b=r[x[f]-1];h.o_dest[j]=b.o_source[j];continue}try{x[f]=s+1}catch(H){}}var w=E.h_exclusions[h.s_key]||(h.o_source.h_deep_copy_info?h.o_source.h_deep_copy_info[h.s_key]:0);if(typeof(w)==="function"){var c=w(h.s_value,h);for(var G in c){var F=c[G];h.o_dest[G]=F}}else{if(w==1){var m;if(typeof(h.s_value)==="object"&&h.s_value!=null&&typeof(h.s_value.length)!="undefined"){m=[];for(var p=0;p<h.s_value.length;p++){var G=p;var F=h.s_value[p];m[G]=F}h.o_dest[h.s_key]=m}else{if(typeof(h.s_value)==="object"){m={};for(var G in h.s_value){var F=h.s_value[G];m[G]=F}h.o_dest[h.s_key]=m}else{h.o_dest[h.s_key]=h.s_value}}}else{if(w==2){h.o_dest[h.s_key]=h.s_value}else{if(w==3){}else{if(E.o_existing){E.o_existing=E.o_existing[j]}if(typeof(h.s_value.length)!="undefined"){var m=h.o_dest[h.s_key]=[];for(var A=0;A<h.s_value.length;A++){var G=A;var F=h.s_value[G];var z=h.s_value;if(typeof(F)==="object"&&F!=null){r.push({s_key:G,s_value:F,o_source:z,o_dest:m,s_path:u})}else{m[G]=F}}}else{var m=h.o_dest[h.s_key]={};var q=false;for(var G in h.s_value){var F=h.s_value[G];var z=h.s_value;if(E.h_overrides&&(n=E.h_overrides[G])&&(D=n[F])){if(typeof(D)==="object"){if(!q){q={}}for(var k in D){var I=D[k];m[k]=I;q[k]=true}}else{F=D}}if(typeof(F)==="object"&&F!=null){r.push({s_key:G,s_value:F,o_source:z,o_dest:m,s_path:u})}else{if(!q||!q[G]){m[G]=F}}}}}}}}}if(E.b_dupe_checker&&!B.b_debug_leave_replication_vars){for(var s=0;s<r.length;s++){var h=r[s];j=h.s_key;x=h.o_source[j];s_value_dest=h.o_dest[j];if(x&&x[f]){delete x[f]}if(s_value_dest&&s_value_dest[f]){delete s_value_dest[f]}}}Ext.jx.Prototypes.Resume();E.n_objects_copied=r.length;return t}};Ext.ns("Ext.jx");Ext.jx.plugins={onConfig:{init:function(f){if(typeof(f.onConfig)==="object"&&!(f.onConfig instanceof Array)){if(f.onConfig.overrideAdv){for(var b in f.onConfig.overrideAdv){var c=f.onConfig.overrideAdv[b].method;var e=f.onConfig.overrideAdv[b].arguments;if(!(e instanceof Array)){e=[e]}f[b]=f[b][c].apply(f[b],e)}}}}},onExt:{init:function(f){if(typeof(f.onBrowser)==="object"&&!(f.onBrowser instanceof Array)){var e=false,b=false;for(var c in f.onBrowser){if(Ext[c]){Ext.apply(f,f.onBrowser[c]);b=f.onBrowser[c].defaults;e=true;break}}if(!e&&f.onBrowser.isElse){b=f.onBrowser.isElse.defaults;Ext.apply(f,f.onBrowser.isElse)}if(b){f.items.each(function(h){f.applyDefaults(h)})}}}},Tab_Fix:{init:function(b){b.on("tabchange",function(e,c){if(!c.renderedSafe){if(!c.alwaysDoLayout){c.renderedSafe=true}this.el.mask(l("Preparing your screen..."),"x-mask-loading");this.on("afterlayout",function(){this.el.unmask.defer(1,this.el)});this.doLayout.defer(1,this)}})}}};Ext.ns("Ext.jx");Ext.jx.Prototypes={Pause:function(){if(!Ext.jx.vars.h_prototypes){Ext.jx.vars.h_prototypes={h_functions:{},h_arrays:{}}}Ext.jx.vars.h_prototypes.Function={};for(var b in Function.prototype){Ext.jx.vars.h_prototypes.h_functions[b]=Function.prototype[b];delete Function.prototype[b]}Ext.jx.vars.h_prototypes.Array={};for(var b in Array.prototype){Ext.jx.vars.h_prototypes.h_arrays[b]=Array.prototype[b];delete Array.prototype[b]}},Resume:function(){if(!Ext.jx.vars.h_prototypes){Ext.jx.vars.h_prototypes={h_functions:{},h_arrays:{}}}for(var b in Ext.jx.vars.h_prototypes.h_functions){if(!Function.prototype[b]){Function.prototype[b]=Ext.jx.vars.h_prototypes.h_functions[b]}}for(var b in Ext.jx.vars.h_prototypes.h_arrays){if(!Array.prototype[b]){Array.prototype[b]=Ext.jx.vars.h_prototypes.h_arrays[b]}}}};Ext.ns("Ext.jx");Ext.jx.Server={servers:(function(){var c={};var b=window.location.href.split(window.location.host)[0]+window.location.host+"/";c[b]=undefined;return c})(),getPrimary:function(){var b;for(var c in Ext.jx.Server.servers){b=Ext.jx.Server.servers[c]||(Ext.jx.Server.servers[c]={serverName:c,loadCount:0});break}b.loadCount++;b.lastAccess=Date();return b.serverName},get:function(){var c;for(var e in Ext.jx.Server.servers){var b=Ext.jx.Server.servers[e];if(!b){c=Ext.jx.Server.servers[e]={serverName:e,loadCount:0};break}else{if(!b.loadCount){c=b;break}else{if(!c||b.loadCount<c.loadCount||(b.loadCount==c.loadCount&&b.lastAccess<c.lastAccess)){c=b}}}}c.loadCount++;c.lastAccess=Date();return c.serverName},release:function(c){var b=Ext.jx.Server.servers[c];b.loadCount--}};Ext.ns("Ext.jx");Ext.jx.String={reverse:function(b){return b.split("").reverse().join("")},addStripTags:/\/?\/?-->/gi,stripTags:function(c,b){c=Ext.util.Format.stripTags(Ext.jx.ignoreNull(c)).replace(Ext.jx.String.stripTags,"");if(b&&c.length>b){c=c.substr(0,b)+"..."}return c},convertDos2Html:function(b){if(!b){return""}b=b.replace(/\t/g,"&nbsp;&nbsp;&nbsp;");b=b.replace(/\n/g,"<br>");b=b.replace(/ /g,"&nbsp;");b=b.replace(/\r/g," ");return b},replaceSubstr:function(b,h,c,f){var k;b=String(b);h=String(h);if(!isNaN(f)){var e=b.substr(0,c);var j=b.substr(c+f);h=h.substr(0,f);k=e+h+j}else{var e=b.substr(0,c);k=e+h}return k},stripWhites:function(b){return String(b).replace(/\s/g,"")},escapeHTML:function(c){var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return c.replace(/[&<>"']/g,function(e){return b[e]})},reverseHTML:function(c){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};return c.replace(/&amp;|&lt;|&gt;|&quot;|&#39;/g,function(e){return escapeTable[e]})}};Ext.jx.stripTags=Ext.jx.String.stripTags;Ext.ns("Ext.jx");Ext.jx.Table=function(b){this.getForm=function(c){var f=this;if(!f.forms){f.forms={}}var e=f.forms[c];if(!e){alert("Can not find form "+f.tableName+"::"+c)}return e};this.getData=function(c,e){var f=this;if(!f.dataStorage){f.dataStorage={}}if(!c){c="ALL"}var h=f.dataStorage[c];if(!h&&(c=="ALL"||(e&&e.remote))){h=f.setData(c,{})}if(!h){alert("Can not find data "+f.tableName+"::"+c)}if(!h.getStore){f.setData(c,h)}return h};this.setMetaDataDefaults=function(c,f){var e=this;Ext.apply(f,Ext.jx.TableData);f.getTable=function(){return e};if(!f.dataName){f.dataName=c}var h=f.meta;if(!h){h=f.meta={}}if(!h.root){h.root="rows"}if(!f[h.root]){f[h.root]={}}if(!h.totalProperty){h.totalProperty="results"}if(!h.id){h.id="#LINK_TO_"+e.tableName}if(!h.tableName){h.tableName=e.tableName}if(!h.fieldsIndex){h.fieldsIndex={}}if(!h.fields){h.fields=[];if(e.fields){Ext.jx.each(e.fields,function(j,k){var m={};Ext.apply(m,j);m.name=k;if(h.fieldsIndex[k]){return}h.fieldsIndex[k]=m;h.fields.push(m)})}else{if(f&&f.rows&&f.rows[0]){Ext.jx.each(f.rows[0],function(m,k){var n={};var j=e.fields[k];if(j){Ext.apply(n,j)}n.name=k;if(h.fieldsIndex[k]){return}h.fieldsIndex[k]=n;h.fields.push(n)})}else{Ext.jx.debug("Did not specify fields");return}}}else{Ext.jx.each(h.fields,function(m,k){h.fieldsIndex[k]=m;var j=e.fields[k];if(j){Ext.applyIf(m,j)}})}};this.setData=function(c,f){var e=this;if(!e.dataStorage){e.dataStorage={}}if(!f&&typeof c!="string"){f=c;c="ALL"}if(!c){c="ALL"}if(!f){Ext.jx.debug("Did not specify data "+e.tableName+"::"+c)}else{e.dataStorage[c]=f;e.setMetaDataDefaults(c,f)}return f};this.FuncsRow=function(){return{getRecord:function(e){var c=this;if(c.parentTables&&c.parentTables[e]){return c.parentTables[e]}return""},template:function(e){var c=this;var h=c.getTable(),f;if(!h.templates||(!(f=h.templates[e]))){return""}if(typeof f=="string"){f=new Ext.XTemplate(f)}else{if(Ext.isArray(f)){f=new Ext.XTemplate(f.join(""))}}return f.applyTemplate(Ext.DataView.prototype.prepareData(c.data,null,c))}}}();this.Funcs=function(){return{updateServer:function(){}}}();this.applyDefinition=function(e){if(!e){return}for(var c in e){var f=e[c];if(f===null||f===undefined){continue}if(this[c]&&(c=="Funcs"||c=="FuncsRow"||c=="forms"||c=="templates")){Ext.apply(this[c],e[c])}else{this[c]=e[c]}}};this.applyDefinition(b)};Ext.ns("Ext.jx");Ext.jx.Template={searchLists:{},clearSearchItems:function(c,b){var e=Ext.jx.Template;if(typeof(c)==="string"){c=e.searchLists[c]||(e.searchLists[c]=[])}while(c.length){c.pop()}return""},setSearchItem:function(c,b){var e=Ext.jx.Template;if(typeof(c)==="string"){c=e.searchLists[c]||(e.searchLists[c]=[])}c.push(b);return""},findSearchItem:function(c,b){var e=Ext.jx.Template;if(typeof(c)==="string"){c=e.searchLists[c]}return c[b]}};Ext.ns("Ext.ux.event");Ext.override(Ext.util.Observable,{subscribe:function(b,e,c,f){Ext.ux.event.Broadcast.addEvents(b);Ext.ux.event.Broadcast.on(b,e,c,f)},unsubscribe:function(){Ext.ux.event.Broadcast.un.apply(Ext.ux.event.Broadcast,arguments)},publish:function(){if(Ext.ux.event.Broadcast.eventsSuspended!==true){var b=Ext.ux.event.Broadcast.events?Ext.ux.event.Broadcast.events[arguments[0].toLowerCase()]:false;if(typeof b=="object"){return b.fire.apply(b,Array.prototype.slice.call(arguments,1))}}return true},removeSubscriptionsFor:function(c){for(var b in Ext.ux.event.Broadcast.events){if((b==c)||(!c)){if(typeof Ext.ux.event.Broadcast.events[b]=="object"){Ext.ux.event.Broadcast.events[b].clearListeners()}}}},hasSubscription:function(b){return Ext.ux.event.Broadcast.hasListener(b)}});Ext.ux.event.Broadcast=new Ext.util.Observable;Ext.ns("ExtX.form.ComboBox");ExtX.form.ComboBox.Twin=Ext.extend(Ext.form.ComboBox,{trigger1Class:null,trigger2Class:null,initComponent:function(){ExtX.form.ComboBox.Twin.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]};this.addEvents("trigger2click")},getTrigger:function(b){return this.triggers[b]},initTrigger:function(){var b=this.trigger.select(".x-form-trigger",true);var c=this;b.each(function(f,j,e){var h="Trigger"+(e+1);f.hide=function(){var k=c.wrap.getWidth();this.dom.style.display="none";c.el.setWidth(k-c.trigger.getWidth());this["hidden"+h]=true};f.show=function(){var k=c.wrap.getWidth();this.dom.style.display="";c.el.setWidth(k-c.trigger.getWidth());this["hidden"+h]=false};if(this["hide"+h]){f.dom.style.display="none";this["hidden"+h]=true}this.mon(f,"click",this["on"+h+"Click"],this,{preventDefault:true});f.addClassOnOver("x-form-trigger-over");f.addClassOnClick("x-form-trigger-click")},this);this.triggers=b.elements},getTriggerWidth:function(){var b=0;Ext.each(this.triggers,function(f,e){var h="Trigger"+(e+1),c=f.getWidth();if(c===0&&!this["hidden"+h]){b+=this.defaultTriggerWidth}else{b+=c}},this);return b},onDestroy:function(){Ext.destroy(this.triggers);ExtX.form.ComboBox.Twin.superclass.onDestroy.call(this)},onTrigger1Click:function(){this.onTriggerClick.apply(this,arguments)},onTrigger2Click:function(){this.fireEvent("trigger2click",this)}});Ext.reg("ExtX.form.ComboBox.Twin",ExtX.form.ComboBox.Twin);Ext.ns("Ext.ux.layout");Ext.ux.layout.Coolcard=Ext.extend(Ext.layout.CardLayout,{actionsQueue:undefined,constructor:function(e){var c={method:"raw",anchor:"t",easing:"easeOut",duration:0.6,remove:false,useDisplay:true};var b={method:"raw",anchor:"b",easing:"easeOut",duration:0.8,remove:false,useDisplay:false};this.actionsQueue=[];if(!e){e={}}if(!e.outFx){e.outFx={}}if(!e.inFx){e.inFx={}}Ext.applyIf(e.outFx,c);Ext.applyIf(e.inFx,b);Ext.ux.layout.Coolcard.superclass.constructor.call(this,e)},setActiveItem:function(f,e,c){if(!e){e={}}if(!c){c={}}var b={};b.item=f;b.outFx=Ext.applyIf(e,this.outFx);b.inFx=Ext.applyIf(c,this.inFx);this.actionsQueue.push(b);if(this.actionsQueue.length==1){this.setActiveItemInternal()}},processQueue:function(){this.actionsQueue.shift();if(this.actionsQueue.length>0){this.setActiveItemInternal.defer(1,this)}},applyEffect:function(c,b){var e=[];if(b.method=="raw"){if(b.callback){b.callback.call(b.scope)}return}if(b.method=="slideIn"||b.method=="slideOut"||b.method=="ghost"){e.push(b.anchor)}e.push(b);c[b.method].apply(c,e)},setActiveItemInternal:function(){var h=this.actionsQueue[0];var e=h.outFx;var c=h.inFx;h=h.item;h=this.container.getComponent(h);if(this.activeItem!=h){var b=this.activeItem;if(b){var f=this.container.items.indexOf(b);this.container.items.remove(b);if(e.method!="raw"){var j=Ext.getBody().createChild({tag:"div",cls:"x-background-underlay"});j.alignTo(b.getEl(),"tl-tl");j.appendChild(b.getEl());this.applyEffect(j,e)}else{b.hide()}}this.activeItem=h;h.show();this.layout();if(h.doLayout){h.doLayout()}c.scope=this;c.callback=function(){if(b){b.hide();this.container.items.insert(f,b);if(e.method!="raw"){this.container.getLayoutTarget().appendChild(b.getEl());j.remove()}}this.processQueue()};this.applyEffect(h.getEl(),c)}else{this.processQueue()}},setContainer:function(b){Ext.ux.layout.Coolcard.superclass.setContainer.call(this,b);b.on("beforeadd",this.setupItem,this)},setupItem:function(b,c,e){if(b.items.items.length){c.hidden=true}},onLayout:function(c,f){Ext.layout.FitLayout.superclass.onLayout.call(this,c,f);if(!this.container.collapsed){var e=this.activeItem||c.items.itemAt(0);if(e){var b=f.getViewSize();b.width-=f.getPadding("lr")+e.getEl().getMargins("lr");b.height-=f.getPadding("tb")+e.getEl().getMargins("tb");this.setItemSize(e,b)}}}});Ext.Container.LAYOUTS.coolcard=Ext.ux.layout.Coolcard;Ext.ns("Ext.ux.layout");Ext.ux.layout.ColumnFit=Ext.extend(Ext.layout.ColumnLayout,{onLayout:function(f,m){var j=f.items.items,k=j.length,n,b;if(!this.innerCt){m.addClass("x-column-layout-ct");this.innerCt=m.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"});this.innerCt.setStyle({height:"100%",width:"100%"})}this.renderAll(f,this.innerCt);if(this.container.hidden){return}var r=m.getViewSize();var p=r.width-m.getPadding("lr")-this.scrollOffset,e=r.height-m.getPadding("tb"),q=p;for(b=0;b<k;b++){n=j[b];if(Ext.isIE6&&n.getEl().getMargins("lr")){n.el.setStyle({display:"inline"})}if(!n.columnWidth){q-=(n.getSize().width+n.getEl().getMargins("lr"))}}q=q<0?0:q;for(b=0;b<k;b++){n=j[b];if(n.columnWidth){n.setWidth(Math.floor(n.columnWidth*q)-n.getEl().getMargins("lr"))}}(function(){if(!m.dom){return}var s=m.getViewSize();var u=s.height-m.getPadding("tb");for(b=0;b<k;b++){n=j[b];var t=n.el.getStyle("height");var c=u-n.getEl().getMargins("tb");if(t!="100%"){n.setHeight(c)}}}).defer(1,this)}});Ext.Container.LAYOUTS.columnfit=Ext.ux.layout.ColumnFit;Ext.ns("Ext.ux.layout");Ext.ux.layout.Slide=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,renderHidden:false,easing:"none",duration:0.5,opacity:1,activeItemNo:0,compatMode:false,setContainer:function(b){Ext.ux.layout.Slide.superclass.setContainer.call(this,b);b.addEvents("activeitemchanged")},onLayout:function(b,c){Ext.ux.layout.Slide.superclass.onLayout.call(this,b,c);if(b.items.getCount()&&!this.activeItem){this.activeItem=b.items.itemAt(0)}},setActiveItem:function(e){if(typeof(e)=="string"){e=this.container.items.keys.indexOf(e)}else{if(typeof(e)=="object"){e=this.container.items.items.indexOf(e)}}var c=this.container.getComponent(e);if(this.activeItem!=c){if(this.activeItem){if(this.compatMode||Ext.isOpera){this.activeItem.el.setStyle("display","none");c.el.setStyle("display","block")}else{if(c&&(!c.rendered||!this.isValidParent(c,this.container))){this.renderItem(c,e,this.container.getLayoutTarget());c.show()}var b=[this.container.body.getX()-this.container.body.getWidth(),this.container.body.getX()+this.container.body.getWidth()];this.activeItem.el.shift({duration:this.duration,easing:this.easing,opacity:this.opacity,x:(this.activeItemNo<e?b[0]:b[1])});c.el.setY(this.container.body.getY());c.el.setX((this.activeItemNo<e?b[1]:b[0]));c.el.shift({duration:this.duration,easing:this.easing,opacity:1,x:this.container.body.getX()})}}this.activeItemNo=e;this.activeItem=c;this.layout();this.container.fireEvent("activeitemchanged",this.activeItem)}},renderAll:function(b,c){if(this.deferredRender){this.renderItem(this.activeItem,undefined,c)}else{Ext.ux.layout.Slide.superclass.renderAll.call(this,b,c)}}});Ext.Container.LAYOUTS.slide=Ext.ux.layout.Slide;Ext.namespace("Ext.ux.layout");Ext.ux.layout.RowFitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,trackChildEvents:["collapse","expand","hide","show"],monitorChildren:true,disableCollapseAnimation:true,splitHeight:5,rendered:false,renderItem:function(k,b,h){Ext.ux.layout.RowFitLayout.superclass.renderItem.apply(this,arguments);for(var e=0,j=this.trackChildEvents.length;e<j;e++){var f=this.trackChildEvents[e];k.on(f,this["_item_"+f],this)}if(this.disableCollapseAnimation){k.animCollapse=false}this.checkRelHeight(k)},checkRelHeight:function(e){if(e.rowFit&&e.height!==e.rowFit.height){delete e.rowFit}if(!e.rowFit){e.rowFit={hasAbsHeight:false,relHeight:0,calcRelHeight:0,calcAbsHeight:0,height:e.height};var b=e.height;if(typeof b=="string"&&/\%/.test(b)){e.rowFit.relHeight=parseInt(b)}else{if(typeof b=="number"){e.rowFit.hasAbsHeight=!Boolean(e.split)}}}e.isResizable=e.isResizable||Boolean(e.split)||!e.rowFit.hasAbsHeight},onLayout:function(q,r){Ext.ux.layout.RowFitLayout.superclass.onLayout.call(this,q,r);if(this.container.collapsed||!q.items||!q.items.length){return}var e=0,w=0,t=1,x=0,s=[];var f=r.getViewSize();f.width-=r.getPadding("lr");for(var k=0,b=q.items.length;k<b;k++){var v=q.items.itemAt(k);this.checkRelHeight(v);if(!v.isVisible()){continue}if(v.collapsed){var m=v.getEl().getHeight();e+=m;v.setWidth(f.width-v.getEl().getMargins("lr"))}else{if(v.rowFit.hasAbsHeight){e+=v.height;v.setSize({width:f.width-v.getEl().getMargins("lr"),height:v.height})}else{if(v.rowFit.relHeight){w+=v.rowFit.relHeight;s.push(v)}else{if(v.autoHeight){e+=v.getEl().getHeight()+v.getEl().getMargins("tb");v.setWidth(f.width-v.getEl().getMargins("lr"))}else{x++;e+=v.getFrameHeight?v.getFrameHeight():0;if(Ext.isIE6){v.setSize({width:f.width-v.getEl().getMargins("lr"),height:0})}else{v.setWidth(f.width-v.getEl().getMargins("lr"))}s.push(v)}}}}}if(x==0&&w!=100){t=100/w}f=r.getViewSize();f.height-=r.getPadding("tb");var A=f.height-e,j=A;while(s.length){var v=s.shift();var p=v.rowFit.relHeight*t;var z=0;if(!p){p=(100-w)/x}if(!s.length){z=j}else{z=Math.floor(A*p/100)}if(z<0){z=0}v.rowFit.calcAbsHeight=z;v.rowFit.calcRelHeight=p;v.setSize({width:f.width-v.getEl().getMargins("lr"),height:z});j-=z}for(var k=0,b=q.items.length;k<b;k++){var v=q.items.itemAt(k);if(v.isSlider&&v.el2resize){var u=new Ext.SplitBar(v.el,v.el2resize.el,Ext.SplitBar.VERTICAL,Ext.SplitBar.TOP);u.setAdapter(new Ext.ux.layout.RowFitLayout.SplitAdapter(u));v.el2resize.sliderId=v.getId();v.el2resize=false}}if(!this.rendered){this.rendered=true}},setContainer:function(b){Ext.ux.layout.RowFitLayout.superclass.setContainer.call(this,b);this._addSliders(b)},_addSliders:function(h){var f=h.splitHeight||this.splitHeight;var b=true;var m=h.items.length;for(var e=m-1;e>=0;e--){var k=h.items.itemAt(e);this.checkRelHeight(k);if(k.isResizable){if(b){b=false;continue}if(k.split){var j=new Ext.Panel({height:f,isSlider:true});j.el2resize=k;j.addClass("x-splitbar-y");h.insert(e+1,j)}}}},itemListener:function(b){b.ownerCt.doLayout()},_item_show:function(c){if(!this.monitorChildren){return}if(!c.isSlider&&c.sliderId){var b=c.ownerCt.findById(c.sliderId);if(!b.isVisible()){b.show();return}}c.ownerCt.doLayout()},_item_hide:function(c){if(!this.monitorChildren){return}if(!c.isSlider&&c.sliderId){var b=c.ownerCt.findById(c.sliderId);if(b.isVisible()){b.hide();return}}c.ownerCt.doLayout()},_item_expand:function(b){if(!this.monitorChildren){return}this._item_show(b)},_item_collapse:function(b){if(!this.monitorChildren){return}this._item_hide(b)},ctAddItem:function(e,c,b){e.doLayout()},ctDelItem:function(c,b){c.doLayout()}});if(Ext.SplitBar.BasicLayoutAdapter){Ext.ux.layout.RowFitLayout.SplitAdapter=function(e){if(e&&e.el.dom.nextSibling){var c=Ext.getCmp(e.el.dom.nextSibling.id),b=Ext.getCmp(e.resizingEl.id);while(c&&(c.collapsed||!c.isVisible()||!c.isResizable)){c=Ext.getCmp(c.el.dom.nextSibling.id)}if(c){e.maxSize=(b.rowFit.hasAbsHeight?b.rowFit.calcAbsHeight:b.getSize().height)+c.getInnerHeight()-1}e.minSize=b.getFrameHeight()+1}};Ext.extend(Ext.ux.layout.RowFitLayout.SplitAdapter,Ext.SplitBar.BasicLayoutAdapter,{setElementSize:function(j,k,c){var h=Ext.getCmp(j.resizingEl.id);if(!h||h.collapsed||!h.isVisible()){return}if(h.rowFit.hasAbsHeight){h.setHeight(k)}else{if(j.el.dom.nextSibling){var f=Ext.getCmp(j.el.dom.nextSibling.id);while(f&&(f.collapsed||!f.isVisible()||!f.isResizable)){f=Ext.getCmp(f.el.dom.nextSibling.id)}var q=k-h.rowFit.calcAbsHeight,e=f.rowFit,p=h.rowFit,m=p.calcRelHeight/p.calcAbsHeight,n=m*q;p.relHeight=p.calcRelHeight+n;if(e.hasAbsHeight){var b=f.height-q;f.height=b;f.setHeight(b)}else{e.relHeight=e.calcRelHeight-n}}}h.ownerCt.doLayout()}})}Ext.Container.LAYOUTS["row-fit"]=Ext.ux.layout.RowFitLayout;Ext.ns("ExtX.Layout");ExtX.Layout.RowFit=Ext.extend(Ext.layout.ContainerLayout,{initialPass:true,onLayout:function(b,f){if(this.initialPass){this.initialPass=false;f.createChild({cls:"x-clear"})}this.renderAll(b,f);if(!this.container.isVisible()){return}var n=f.getViewSize();var k=n.height-f.getPadding("tb");var m=k;var c=/^\d+$/;var h=/^(\d+)\%$/;var e=0;b.items.each(function(p){if(p.hidden){return}if(c.test(p.height)||p.autoHeight){m-=p.getHeight()+p.getEl().getMargins("tb")}if(!p.height&&!p.autoHeight){e++}});m=m<0?0:m;var j=0;b.items.each(function(q){if(q.hidden){return}var p=h.exec(q.height);if(p){var r=parseInt(p[1])/100;var s=Math.floor(r*m)-q.getEl().getMargins("tb");q.setHeight(s);j+=s}});m-=j;b.items.each(function(p){if(!(p.height||p.autoHeight||p.hiden)){p.setHeight(Math.floor(m/e)-p.getEl().getMargins("tb"))}})},isValidParent:function(e,b){return b&&e.getEl().parent().hasClass("x-rowfit-layout-row")},renderItem:function(e,c,h){if(!e.rendered){if(typeof c=="number"){c=h.dom.childNodes[c]}var f=document.createElement("div");var b=Ext.get(f).addClass("x-rowfit-layout-row");h.dom.insertBefore(f,c||null);ExtX.Layout.RowFit.superclass.renderItem.call(this,e,null,b)}else{ExtX.Layout.RowFit.superclass.renderItem.apply(this,arguments)}}});Ext.Container.LAYOUTS.rowfit=ExtX.Layout.RowFit;Ext.ns("ExtX.Layout");ExtX.Layout.DynamicCard=Ext.extend(Ext.layout.CardLayout,{setItemSize:function(c,b){if(c&&b.height>0){if(c.extraHeight){b.height+=c.extraHeight}c.setSize(b)}}});Ext.Container.LAYOUTS["card-dynamic"]=ExtX.Layout.DynamicCard;Ext.namespace("Ext.ux.layout");Ext.ux.layout.FieldTriggerFormLayout=function(b){Ext.ux.layout.FieldTriggerFormLayout.superclass.constructor.call(this,b)};Ext.ux.layout.FieldTriggerFormLayout=Ext.extend(Ext.layout.FormLayout,{fieldTpl:(function(){var b=new Ext.Template('<div class="x-form-item {itemCls}" tabIndex="-1">','<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}{labelTriggerBtn}</label>','<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">','</div><div class="{clearCls}"></div>',"</div>");b.disableFormats=true;return b.compile()})(),getTemplateArgs:function(c){var b=!c.fieldLabel||c.hideLabel;return{id:c.id,label:c.fieldLabel,labelTriggerBtn:c.labelTriggerBtn,labelStyle:c.labelStyle||this.labelStyle||"",elementStyle:this.elementStyle||"",labelSeparator:b?"":(typeof c.labelSeparator=="undefined"?this.labelSeparator:c.labelSeparator),itemCls:(c.itemCls||this.container.itemCls||"")+(c.hideLabel?" x-hide-label":""),clearCls:c.clearCls||"x-form-clear-left"}}});Ext.Container.LAYOUTS.triggerform=Ext.ux.layout.FieldTriggerFormLayout;Ext.ns("Ext.ux.layout");Ext.ux.layout.CenterLayout=Ext.extend(Ext.layout.FitLayout,{setItemSize:function(c,b){this.container.addClass("ux-layout-center");c.addClass("ux-layout-center-item");if(c&&b.height>0){if(c.width){b.width=c.width}c.setSize(b)}}});Ext.Container.LAYOUTS["ux.center"]=Ext.ux.layout.CenterLayout;Ext.ns("ExtX.Data.Store");ExtX.Data.Store.Paged=Ext.extend(Ext.data.GroupingStore,{wholeDataSet:null,filteredCount:null,pageSize:20,constructor:function(){this.wholeDataSet=[];ExtX.Data.Store.Paged.superclass.constructor.apply(this,arguments)},loadRecords:function(c,n,k){if(!c||k===false){if(k!==false){this.fireEvent("load",this,[],n)}if(n.callback){n.callback.call(n.scope||this,[],n,false,c)}return}var b=c.records,m=c.totalRecords||b.length;if(!n||n.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var e=0,f=b.length;e<f;e++){b[e].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.data.clear();this.wholeDataSet=[];var j=n.from||0;var h=n.to||b.length-1;for(var e=j;e<=h;e++){this.wholeDataSet[e]=b[e-j]}this.data.addAll(b);this.totalLength=m;this.applySort();this.fireEvent("datachanged",this)}else{var j=n.from;var h=n.to;for(var e=j;e<=h;e++){this.wholeDataSet[e]=b[e-j]}this.totalLength=Math.max(m,this.data.length+b.length);if(isNaN(this.totalLength)){this.totalLength="N/A"}this.data.clear();this.data.addAll(b);this.fireEvent("datachanged",this)}this.fireEvent("load",this,b,n);if(n.callback){n.callback.call(n.scope||this,b,n,true)}},getTotalCount:function(){if(!this.isFiltered()){return ExtX.Data.Store.Paged.superclass.getTotalCount.apply(this,arguments)}return this.filteredCount},clearFilter:function(){var b=this.isFiltered();ExtX.Data.Store.Paged.superclass.clearFilter.apply(this,arguments);if(b){this.refreshDataSet()}this.setDataPage(0,this.pageSize-1)},filterBy:function(){this.clearFilter();this.setDataPage(0,this.getTotalCount()-1);ExtX.Data.Store.Paged.superclass.filterBy.apply(this,arguments);this.filteredCount=this.getCount();this.refreshDataSet();this.setDataPage(0,this.pageSize-1)},publishUpdates:function(c,b){this.setDataPage(c||0,b||this.pageSize-1)},loadData:function(e,b,h,f){var c=this.reader.readRecords(e);this.loadRecords(c,{add:b,from:h,to:f},true)},removeAll:function(){this.wholeDataSet=[];this.totalLength=0;ExtX.Data.Store.Paged.superclass.removeAll.apply(this,arguments);this.fireEvent("load",this,[],{})},setDataPage:function(e,c){this.data.clear();var b=this.wholeDataSet.slice(e,c+1);this.data.addAll(b);this.fireEvent("load",this,b,{from:e,to:c});this.fireEvent("datachanged",this)},haveDataPage:function(e,c){for(var b=e;b<=c;b++){if(!this.wholeDataSet[b]){return false}}return true},refreshDataSet:function(){this.wholeDataSet=this.data.items.slice()}});Ext.ns("ExtX.DataView.Transition");ExtX.DataView.Transition.Grouped=Ext.extend(Object,{itemWidth:null,itemHeight:null,groupHeight:null,dataview:null,dataviewID:null,cachedStoreData:null,groupElements:null,defaults:{interval:20,duration:750,idProperty:"id"},noneFoundElement:null,groupConfig:null,task:null,isDataDirty:true,prevWidth:null,firstAnimation:true,constructor:function(b){Ext.apply(this,b||{},this.defaults);this.groupElements=[]},init:function(b){this.dataview=b;var e=this.idProperty;var c=b.store;b.blockRefresh=true;b.updateIndexes=b.updateIndexes.createSequence(function(){this.getTemplateTarget().select(this.itemSelector).each(function(j,k,h){j.id=j.dom.id=String.format("{0}-{1}",b.id,c.getAt(h).get(e))})});this.dataviewID=b.id;this.cacheStoreData(c);c.on("load",this.cacheStoreData,this);c.on("datachanged",this.onDataChanged,this);var f=this;b.refreshTransitions=function(h){f.refreshTransitions(h)};b.afterRender=b.afterRender.createSequence(function(){var h=f.noneFoundElement=this.el.createChild({tag:"div",html:l("Nothing found, please choose another filter options"),cls:"rl-dataview-animated-none-message",style:"visibility : hidden;"})})},refreshTransitions:function(b){this.refresh(this.dataview.store,b)},onDataChanged:function(b){this.isDataDirty=true;this.refresh(b)},refresh:function(q,n){var m=this.dataview.getTemplateTarget();var u=m.getWidth();if(!this.isDataDirty&&u==this.prevWidth){if(n){n()}return}this.prevWidth=u;var s=this.getAdded(q);var B=this.getRemoved(q);var f=this.getRemaining(q);var x=Ext.apply({},f,s);var b=this.duration;var p=this.dataviewID;var t=this.idProperty;Ext.each(B,function(G){Ext.fly(p+"-"+G.get(t)).fadeOut({remove:false,duration:b/1000/2,useDisplay:true})});Ext.each(this.groupElements,function(G){G.fadeOut({remove:true,duration:b/1000/2,useDisplay:true})});if(q.getCount()){this.noneFoundElement.fadeOut({remove:false,duration:b/1000})}else{this.cacheStoreData(q);this.noneFoundElement.center(m);this.noneFoundElement.fadeIn({duration:b/1000});return}if(!this.itemHeight){var e=m.child("#"+p+"-"+q.getAt(0).get(t));this.itemWidth=e.getMargins("lr")+e.getWidth();this.itemHeight=e.getMargins("bt")+e.getHeight()}var j=this.itemWidth;var z=this.itemHeight;var D=q.getCount(),c=Math.floor(u/j);var E=this.groupElements=[];var k=q.getGroup();k.index=this.analyzeMainGroup(k);Ext.each(k.groups,function(I,H){var G=this.groupConfig[k.field];var J=m.createChild({tag:"div",html:G&&G.getTitle&&G.getTitle(I.typicalRecord)||"- No title -",cls:"rl-dataview-animated-separator",style:"visibility : hidden;"});if(G&&G.titleCls){J.addClass(G.titleCls)}J.applyStyles({top:this.getGroupTop(H,k,c)+"px",left:"0px"}).fadeIn({remove:false,duration:b/1000});E.push(J)},this);m.applyStyles({display:"block",position:"relative"});var h={},F={},v={};Ext.iterate(f,function(K,H){var K=H.get(t),G=v[K]=m.child("#"+p+"-"+K);var J=G.getLeft()-m.getLeft()-G.getMargins("l")-m.getPadding("l");var I=G.getTop()-m.getTop()-G.getMargins("t")-m.getPadding("t");h[K]={top:I,left:J}});var r=0;q.each(function(G){var H=G.get(t);F[H]={top:this.getTopFor(r,k,c),left:this.getLeftFor(r,k,c)};r++},this);var w=new Date();var A=this.firstAnimation;var C=function(){var Q=new Date()-w,S=Q/b;if(S>=1||A){for(var G in F){var H=Ext.fly(p+"-"+G).applyStyles({top:F[G].top+"px",left:F[G].left+"px"});if(A){H.setVisible(true)}}if(!A){Ext.TaskMgr.stop(this.task)}this.task=null;this.isDataDirty=false;this.firstAnimation=false;if(n){n.defer(100)}}else{for(var G in F){if(!f[G]){continue}var K=h[G],N=F[G],L=K.top,O=N.top,J=K.left,P=N.left,M=S*Math.abs(L-O),R=S*Math.abs(J-P),T=L>O?L-M:L+M,I=J>P?J-R:J+R;Ext.fly(p+"-"+G).applyStyles({top:T+"px",left:I+"px"})}}};if(this.task){Ext.TaskMgr.stop(this.task)}if(A){C.call(this)}else{this.task=Ext.TaskMgr.start({run:C,interval:this.interval,scope:this})}if(!A){Ext.iterate(s,function(H,G){Ext.fly(p+"-"+G.get(t)).applyStyles({top:F[H].top+"px",left:F[H].left+"px"}).fadeIn({remove:false,duration:b/1000})})}this.cacheStoreData(q)},cacheStoreData:function(b){var c=this.cachedStoreData={};b.each(function(e){c[e.get(this.idProperty)]=e},this)},getExisting:function(){return this.cachedStoreData},getExistingCount:function(){var e=0,c=this.getExisting();for(var b in c){e++}return e},getAdded:function(b){var c={};b.each(function(e){if(this.cachedStoreData[e.get(this.idProperty)]==undefined){c[e.get(this.idProperty)]=e}},this);return c},getRemoved:function(b){var c=[];for(var e in this.cachedStoreData){if(b.findExact(this.idProperty,e)==-1){c.push(this.cachedStoreData[e])}}return c},getRemaining:function(b){var c={};b.each(function(e){if(this.cachedStoreData[e.get(this.idProperty)]!=undefined){c[e.get(this.idProperty)]=e}},this);return c},analyzeMainGroup:function(e,b){var c=this.idProperty;var f={};Ext.each(e.groups,function(j,h){Ext.each(j.rows,function(k){f[k.get(c)]={group:j,index:h}})});return f},getGroupIndexFor:function(e,c){if(!c.groups.length){return -1}var b=this.dataview.store.getAt(e);return c.index[b.get(this.idProperty)].index},getGroupFor:function(e,c){var b=this.dataview.store.getAt(e);var f=c.index[b.get(this.idProperty)];return f?f.group:null},getIndexOfFirstInGroup:function(e,c){if(e==-1){return 0}var b=c.groups[e].typicalRecord;return this.dataview.store.indexOf(b)},getTopFor:function(c,n,b){var j=this.getGroupIndexFor(c,n);var k=this.getGroupTop(j,n,b);var f=this.getIndexOfFirstInGroup(j,n);var h=c-f;var m=Math.floor(h/b);var e=j!=-1?this.getGroupElementHeight(j):0;return k+e+m*this.itemHeight},getLeftFor:function(c,b,e){var h=this.getGroupIndexFor(c,b);var k=this.getIndexOfFirstInGroup(h,b);var j=c-k;var f=j%e;return f*this.itemWidth},getGroupTop:function(h,c,e){if(!h||h==-1){return 0}var b=this.getGroupTop(h-1,c,e);var j=c.groups[h-1].rows.length;var f=Math.ceil(j/e);return b+this.getGroupElementHeight(h-1)+f*this.itemHeight},getGroupElementHeight:function(b){var c=this.groupElements[b];return c.getHeight()+c.getMargins("tb")}});Ext.ns("Ext.ux");Ext.ux.DataViewTransition=Ext.extend(Object,{itemWidth:null,itemHeight:null,dataview:null,dataviewID:null,cachedStoreData:null,defaults:{interval:20,duration:750,idProperty:"id"},noneFoundElement:null,constructor:function(b){Ext.apply(this,b||{},this.defaults)},init:function(b){this.dataview=b;var e=this.idProperty;var c=b.store;b.blockRefresh=true;b.updateIndexes=b.updateIndexes.createSequence(function(){this.getTemplateTarget().select(this.itemSelector).each(function(j,k,h){j.id=j.dom.id=String.format("{0}-{1}",b.id,c.getAt(h).get(e))})});this.dataviewID=b.id;this.cacheStoreData(c);c.on("load",this.cacheStoreData,this);c.on("datachanged",this.onDataChanged,this);var f=this;b.refreshTransitions=function(){f.refreshTransitions()};b.afterRender=b.afterRender.createSequence(function(){var h=f.noneFoundElement=this.el.createChild({tag:"div",html:l("Nothing found, please choose another filter options"),cls:"rl-dataview-animated-none-message",style:"visibility : hidden;"})})},refreshTransitions:function(){this.onDataChanged(this.dataview.store)},onDataChanged:function(p){if(!this.dataview.rendered){return}var m=this.dataview.getTemplateTarget(),f=p.getAt(0),r=this.getAdded(p),B=this.getRemoved(p),h=this.getRemaining(p),x=Ext.apply({},h,r);var b=this.duration;var n=this.dataviewID;var s=this.idProperty;if(!this.itemHeight){var e=m.child("#"+n+"-"+f.get(s));this.itemWidth=e.getMargins("lr")+e.getWidth();this.itemHeight=e.getMargins("bt")+e.getHeight()}var k=this.itemWidth;var z=this.itemHeight;Ext.each(B,function(F){Ext.fly(n+"-"+F.get(s)).fadeOut({remove:false,duration:b/1000,useDisplay:true})});if(f==undefined){this.cacheStoreData(p);this.noneFoundElement.center(m);this.noneFoundElement.fadeIn({duration:b/1000});return}else{this.noneFoundElement.fadeOut({remove:false,duration:b/1000})}var D=p.getCount(),u=m.getWidth(),c=Math.floor(u/k),t=Math.ceil(D/c);m.applyStyles({display:"block",position:"relative"});var j={},E={},v={};Ext.iterate(h,function(H,G){var H=G.get(s),F=v[H]=m.child("#"+n+"-"+H);j[H]={top:F.getTop()-m.getTop()-F.getMargins("t")-m.getPadding("t"),left:F.getLeft()-m.getLeft()-F.getMargins("l")-m.getPadding("l")}});Ext.iterate(h,function(I,H){var F=j[I],G=v[I];if(G.getStyle("position")!="absolute"){G.applyStyles({position:"absolute",left:F.left,top:F.top,width:G.getWidth(!Ext.isIE),height:G.getHeight(!Ext.isIE)})}});var q=0;Ext.iterate(p.data.items,function(H){var L=H.get(s),G=v[L];var F=q%c,K=Math.floor(q/c),J=K*z,I=F*k;E[L]={top:J,left:I};q++});var w=new Date();var C=function(){var O=new Date()-w,Q=O/b;if(Q>=1){for(var F in E){Ext.fly(n+"-"+F).applyStyles({top:E[F].top+"px",left:E[F].left+"px"})}Ext.TaskMgr.stop(A)}else{for(var F in E){if(!h[F]){continue}var I=j[F],L=E[F],J=I.top,M=L.top,H=I.left,N=L.left,K=Q*Math.abs(J-M),P=Q*Math.abs(H-N),R=J>M?J-K:J+K,G=H>N?H-P:H+P;Ext.fly(n+"-"+F).applyStyles({top:R+"px",left:G+"px"})}}};var A={run:C,interval:this.interval,scope:this};Ext.TaskMgr.start(A);Ext.iterate(r,function(G,F){Ext.fly(n+"-"+F.get(s)).applyStyles({top:E[G].top+"px",left:E[G].left+"px"}).fadeIn({remove:false,duration:b/1000})});this.cacheStoreData(p)},cacheStoreData:function(b){this.cachedStoreData={};b.each(function(c){this.cachedStoreData[c.get(this.idProperty)]=c},this)},getExisting:function(){return this.cachedStoreData},getExistingCount:function(){var e=0,c=this.getExisting();for(var b in c){e++}return e},getAdded:function(b){var c={};b.each(function(e){if(this.cachedStoreData[e.get(this.idProperty)]==undefined){c[e.get(this.idProperty)]=e}},this);return c},getRemoved:function(b){var c=[];for(var e in this.cachedStoreData){if(b.findExact(this.idProperty,e)==-1){c.push(this.cachedStoreData[e])}}return c},getRemaining:function(b){var c={};b.each(function(e){if(this.cachedStoreData[e.get(this.idProperty)]!=undefined){c[e.get(this.idProperty)]=e}},this);return c}});Date.prototype.getFirstDateOfWeek=function(c){if(typeof c==="undefined"){c=(Ext.DatePicker?Ext.DatePicker.prototype.startDay:0)}var b=this.getDay()-c;if(b<0){b+=7}return this.add(Date.DAY,-b)};Array.prototype.sortDates=function(){return this.sort(function(e,c){return e.getTime()-c.getTime()})};if(!Ext.util.EasterDate){Ext.util.EasterDate=function(e,j){if(typeof e==="undefined"){e=new Date().getFullYear()}e=parseInt(e,10);if(typeof j==="undefined"){j=0}j=parseInt(j,10);var c=e%19;var f=(19*c+24)%30;var h=f+(2*(e%4)+4*(e%7)+6*f+5)%7;if((h==35)||((h==34)&&(f==28)&&(c>10))){h-=7}var b=new Date(e,2,22);b.setTime(b.getTime()+86400000*h+86400000*j);return b}}Ext.namespace("Ext.ux","Ext.ux.form");Ext.ux.DatePickerPlus=Ext.extend(Ext.DatePicker,{version:"1.4",noOfMonth:1,noOfMonthPerRow:3,fillupRows:true,eventDates:function(b){return[]},styleDisabledDates:false,eventDatesSelectable:true,defaultEventDatesText:"",defaultEventDatesCls:"x-datepickerplus-eventdates",setEventDates:function(e,f){if(typeof f==="undefined"){f=true}this.edArray=[];for(var c=0,b=e.length;c<b;++c){if(Ext.isDate(e[c])){this.edArray.push({date:e[c],text:this.defaultEventDatesText,cls:this.defaultEventDatesCls})}else{if(e[c].date){e[c].date=this.jsonDate(e[c].date);this.edArray.push(e[c])}}}this.eventDates=function(h){return this.edArray};if(this.rendered&&f){this.eventDatesNumbered=this.convertCSSDatesToNumbers(this.eventDates(this.activeDate.getFullYear()));this.update(this.activeDate)}},eventDatesRE:false,eventDatesRECls:"",eventDatesREText:"",showWeekNumber:true,weekName:"Wk.",selectWeekText:"Click to select all days of this week",selectMonthText:"Click to select all weeks of this month",multiSelection:false,multiSelectByCTRL:true,selectedDates:[],prevNextDaysView:"mark",preSelectedDates:[],lastSelectedDate:false,markNationalHolidays:true,nationalHolidaysCls:"x-datepickerplus-nationalholidays",nationalHolidays:function(f){f=(typeof f==="undefined"?(this.lastRenderedYear?this.lastRenderedYear:new Date().getFullYear()):parseInt(f,10));var j=new Date(f,0,1).getDay();var m=new Date(f,1,1).getDay();var c=new Date(f,4,1).getDay();var k=new Date(f,8,1).getDay();var h=new Date(f,9,1).getDay();var b=new Date(f,10,1).getDay();var e=[{text:"New Year's Day",date:new Date(f,0,1)},{text:"Martin Luther King Day",date:new Date(f,0,(j>1?16+7-j:16-j))},{text:"Washington's Birthday",date:new Date(f,1,(m>1?16+7-m:16-m))},{text:"Memorial Day",date:new Date(f,4,(c==6?31:30-c))},{text:"Independence Day",date:new Date(f,6,4)},{text:"Labor Day",date:new Date(f,8,(k>1?2+7-k:2-k))},{text:"Columbus Day",date:new Date(f,9,(h>1?9+7-h:9-h))},{text:"Veterans Day",date:new Date(f,10,11)},{text:"Thanksgiving Day",date:new Date(f,10,(b>4?26+7-b:26-b))},{text:"Christmas Day",date:new Date(f,11,25)}];return e},markWeekends:true,weekendCls:"x-datepickerplus-weekends",weekendText:"",weekendDays:[6,0],useQuickTips:true,pageKeyWarp:1,maxSelectionDays:false,maxSelectionDaysTitle:"Datepicker",maxSelectionDaysText:"You can only select a maximum amount of %0 days",undoText:"Undo",stayInAllowedRange:true,summarizeHeader:false,resizable:false,renderOkUndoButtons:true,renderTodayButton:true,disablePartialUnselect:true,allowedDates:false,allowedDatesText:"",strictRangeSelect:false,displayMask:3,displayMaskText:"Please wait...",renderPrevNextButtons:true,renderPrevNextYearButtons:false,disableMonthPicker:false,nextYearText:"Next Year (Control+Up)",prevYearText:"Previous Year (Control+Down)",showActiveDate:false,shiftSpaceSelect:true,disabledLetter:false,allowMouseWheel:true,focus:Ext.emptyFn,initComponent:function(){Ext.ux.DatePickerPlus.superclass.initComponent.call(this);this.noOfMonthPerRow=this.noOfMonthPerRow>this.noOfMonth?this.noOfMonth:this.noOfMonthPerRow;this.addEvents("beforeyearchange","afteryearchange","beforemonthchange","aftermonthchange","beforemonthclick","beforeweekclick","beforedateclick","aftermonthclick","afterweekclick","afterdateclick","undo","beforemousewheel","beforemaxdays")},activeDateKeyNav:function(h){if(this.showActiveDate){this.activeDate=this.activeDate.add("d",h);var f=this.activeDateCell.split("#");var e=parseInt(f[0],10);var c=parseInt(f[1],10);var b=Ext.get(this.cellsArray[e].elements[c]);if((c+h>41&&e+1>=this.cellsArray.length)||(c+h<0&&e-1<0)){this.update(this.activeDate)}else{b.removeClass("x-datepickerplus-activedate");c+=h;if(c>41){c-=42;e++}else{if(c<0){c+=42;e--}}b=Ext.get(this.cellsArray[e].elements[c]);b.addClass("x-datepickerplus-activedate");this.activeDateCell=e+"#"+c}}},handleMouseWheel:function(f){if(this.fireEvent("beforemousewheel",this,f)!==false){var b=(this.activeDate?this.activeDate.getMonth():99);var h=(this.activeDate?this.activeDate.getFullYear():0);Ext.ux.DatePickerPlus.superclass.handleMouseWheel.call(this,f);var j=(this.activeDate?this.activeDate.getMonth():999);var c=(this.activeDate?this.activeDate.getFullYear():9999);if(b!=j){this.fireEvent("aftermonthchange",this,b,j)}if(h!=c){this.fireEvent("afteryearchange",this,h,c)}}},onRender:function(u,O){if(this.noOfMonthPerRow===0){this.noOfMonthPerRow=1}if(this.fillupRows&&this.noOfMonthPerRow>1&&this.noOfMonth%this.noOfMonthPerRow!==0){this.noOfMonth+=(this.noOfMonthPerRow-(this.noOfMonth%this.noOfMonthPerRow))}var b=(Ext.isIE?" x-datepickerplus-ie":"");var C=['<table cellspacing="0"',(this.multiSelection?' class="x-date-multiselect'+b+'" ':(b!==""?'class="'+b+'" ':"")),">"];C.push("<tr>");var M=(Ext.isIE?'<img src="'+Ext.BLANK_IMAGE_URL+'" />':"");var B=(this.multiSelection?(this.useQuickTips?' ext:qtip="'+this.selectWeekText+'" ':' title="'+this.selectWeekText+'" '):"");var q=(this.markWeekends&&this.weekendText!==""?(this.useQuickTips?' ext:qtip="'+this.weekendText+'" ':' title="'+this.weekendText+'" '):"");var J=["<thead><tr>"];if(this.showWeekNumber){J.push('<th class="x-date-weeknumber-header"><a href="#" hidefocus="on" class="x-date-weeknumber" tabIndex="1"><em><span ',(this.multiSelection?(this.useQuickTips?' ext:qtip="'+this.selectMonthText+'" ':' title="'+this.selectMonthText+'" '):""),">"+this.weekName+"</span></em></a></th>")}var E=this.dayNames;for(var G=0;G<7;++G){var L=this.startDay+G;if(L>6){L=L-7}J.push("<th><span>",E[L].substr(0,1),"</span></th>")}J.push("</tr></thead><tbody><tr>");if(this.showWeekNumber){J.push('<td class="x-date-weeknumber-cell"><a href="#" hidefocus="on" class="x-date-weeknumber" tabIndex="1"><em><span ',B,"></span></em></a></td>")}for(var F=0;F<42;++F){if(F%7===0&&F>0){if(this.showWeekNumber){J.push('</tr><tr><td class="x-date-weeknumber-cell"><a href="#" hidefocus="on" class="x-date-weeknumber" tabIndex="1"><em><span ',B,"></span></em></a></td>")}else{J.push("</tr><tr>")}}J.push('<td class="x-date-date-cell"><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span ',(this.weekendDays.indexOf((F+this.startDay)%7)!=-1?q:""),"></span></em></a></td>")}J.push("</tr></tbody></table></td></tr></table></td>");var h=J.join("");if(this.summarizeHeader&&this.noOfMonth>1){C.push('<td align="center" id="',this.id,'-summarize" colspan="',this.noOfMonthPerRow,'" class="x-date-middle x-date-pickerplus-middle"></td></tr>');C.push("<tr>")}for(var t=0,A=this.noOfMonth;t<A;++t){C.push('<td><table class="x-date-pickerplus',(t%this.noOfMonthPerRow===0?"":" x-date-monthtable"),(!this.prevNextDaysView?" x-date-pickerplus-prevnexthide":""),'" cellspacing="0"><tr>');if(t===0){C.push('<td class="x-date-left">');if(this.renderPrevNextButtons){C.push('<a class="npm" href="#" ',(this.useQuickTips?' ext:qtip="'+this.prevText+'" ':' title="'+this.prevText+'" '),"></a>")}if(this.renderPrevNextYearButtons){C.push('<a class="npy" href="#" ',(this.useQuickTips?' ext:qtip="'+this.prevYearText+'" ':' title="'+this.prevYearText+'" '),"></a>")}C.push("</td>")}else{if(t==this.noOfMonthPerRow-1){if(this.renderPrevNextButtons){C.push('<td class="x-date-dummy x-date-middle">',M,"</td>")}}}C.push("<td class='x-date-middle x-date-pickerplus-middle",(t===0&&!this.disableMonthPicker?" x-date-firstMonth":""),"' align='center'>");if(t>0||this.disableMonthPicker){C.push('<span id="',this.id,"-monthLabel",t,'"></span>')}C.push("</td>");if(t==this.noOfMonthPerRow-1){C.push('<td class="x-date-right">');if(this.renderPrevNextButtons){C.push('<a class="npm" href="#" ',(this.useQuickTips?' ext:qtip="'+this.nextText+'" ':' title="'+this.nextText+'" '),"></a>")}if(this.renderPrevNextYearButtons){C.push('<a class="npy" href="#" ',(this.useQuickTips?' ext:qtip="'+this.nextYearText+'" ':' title="'+this.nextYearText+'" '),"></a>")}C.push("</td>")}else{if(t===0){if(this.renderPrevNextButtons){C.push('<td class="x-date-dummy x-date-middle">',M,"</td>")}}}C.push("</tr><tr><td",(t===0||t==this.noOfMonthPerRow-1?' colspan="3" ':""),'><table class="x-date-inner" id="',this.id,"-inner-date",t,'" cellspacing="0">');C.push(h);if((t+1)%this.noOfMonthPerRow===0){C.push("</tr><tr>")}}C.push("</tr>");C.push("<tr><td",(this.noOfMonthPerRow>1?' colspan="'+this.noOfMonthPerRow+'"':""),' class="x-date-bottom" align="center"><div><table width="100%" cellpadding="0" cellspacing="0"><tr><td align="right" class="x-date-multiokbtn">',M,'</td><td align="center" class="x-date-todaybtn">',M,'</td><td align="left" class="x-date-multiundobtn">',M,"</td></tr></table></div></td></tr>");C.push('</table><div class="x-date-mp"></div>');var e=document.createElement("div");e.className="x-date-picker";e.innerHTML=C.join("");u.dom.insertBefore(e,O);this.el=Ext.get(e);this.eventEl=Ext.get(e.firstChild);if(this.renderPrevNextButtons){var r=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a.npm"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});var n=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a.npm"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true})}if(this.renderPrevNextYearButtons){var D=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a.npy"),{handler:this.showPrevYear,scope:this,preventDefault:true,stopDefault:true});var z=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a.npy"),{handler:this.showNextYear,scope:this,preventDefault:true,stopDefault:true})}if(this.allowMouseWheel){this.eventEl.on("mousewheel",this.handleMouseWheel,this)}if(!this.disableMonthPicker){this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block")}var c=new Ext.KeyNav(this.eventEl,{left:function(k){(!this.disabled&&k.ctrlKey&&(!this.disableMonthPicker||this.renderPrevNextButtons)?this.showPrevMonth():this.activeDateKeyNav(-1))},right:function(k){(!this.disabled&&k.ctrlKey&&(!this.disableMonthPicker||this.renderPrevNextButtons)?this.showNextMonth():this.activeDateKeyNav(1))},up:function(k){(!this.disabled&&k.ctrlKey&&(!this.disableMonthPicker||this.renderPrevNextYearButtons)?this.showNextYear():this.activeDateKeyNav(-7))},down:function(k){(!this.disabled&&k.ctrlKey&&(!this.disableMonthPicker||this.renderPrevNextYearButtons)?this.showPrevYear():this.activeDateKeyNav(7))},pageUp:function(k){if(!this.disabled){this.update(this.activeDate.add("mo",this.pageKeyWarp*(-1)))}},pageDown:function(k){if(!this.disabled){this.update(this.activeDate.add("mo",this.pageKeyWarp))}},enter:function(k){k.stopPropagation();if(!this.disabled){if(this.multiSelection){this.okClicked()}else{this.finishDateSelection(this.activeDate)}}return true},scope:this});if(!this.disableSingleDateSelection){this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"})}if(this.multiSelection&&this.showWeekNumber){this.eventEl.on("click",this.handleWeekClick,this,{delegate:"a.x-date-weeknumber"})}this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.spaceKeyPressed,this);this.cellsArray=[];this.textNodesArray=[];this.weekNumberCellsArray=[];this.weekNumberTextElsArray=[];this.weekNumberHeaderCellsArray=[];var p,j,I,f,w;for(var s=0,N=this.noOfMonth;s<N;++s){p=Ext.get(this.id+"-inner-date"+s).select("tbody td.x-date-date-cell");j=Ext.get(this.id+"-inner-date"+s).query("tbody td.x-date-date-cell span");this.cellsArray[s]=p;this.textNodesArray[s]=j;if(this.showWeekNumber){I=Ext.get(this.id+"-inner-date"+s).select("tbody td.x-date-weeknumber-cell");f=Ext.get(this.id+"-inner-date"+s).select("tbody td.x-date-weeknumber-cell span");this.weekNumberCellsArray[s]=I;this.weekNumberTextElsArray[s]=f;w=Ext.get(this.id+"-inner-date"+s).select("th.x-date-weeknumber-header");this.weekNumberHeaderCellsArray[s]=w}}if(!this.disableMonthPicker){this.mbtn=new Ext.Button({text:" ",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-firstMonth",true)});this.mbtn.on("click",this.showMonthPickerPlus,this);this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu")}if(this.renderTodayButton||this.showToday){var K=new Date().dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom .x-date-todaybtn",true),text:String.format(this.todayText,K),tooltip:String.format(this.todayTip,K),handler:this.selectToday,scope:this})}if(this.multiSelection&&this.renderOkUndoButtons){this.OKBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom .x-date-multiokbtn",true),text:this.okText,handler:this.okClicked,scope:this});this.undoBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom .x-date-multiundobtn",true),text:this.undoText,handler:function(){if(!this.disabled){this.fireEvent("undo",this,this.preSelectedDates);this.preSelectedDates=[];for(var m=0,k=this.selectedDates.length;m<k;++m){this.preSelectedDates.push(this.selectedDates[m].clearTime().getTime())}this.update(this.activeDate)}},scope:this})}if(Ext.isIE){this.el.repaint()}this.preSelectedDates=[];for(var v=0,H=this.selectedDates.length;v<H;++v){this.preSelectedDates.push(this.selectedDates[v].clearTime().getTime())}this.update(this.value)},showMonthPickerPlus:function(){if(!this.disabled){this.showMonthPicker()}},convertCSSDatesToNumbers:function(e){var f=[[],[],[]];for(var c=0,b=e.length;c<b;++c){f[0][c]=e[c].date.clearTime().getTime();f[1][c]=(e[c].text?e[c].text:this.defaultEventDatesText);f[2][c]=(e[c].cls?e[c].cls:this.defaultEventDatesCls)}return f},clearSelectedDates:function(b){if(typeof b==="undefined"){b=true}this.selectedDates=[];this.preSelectedDates=[];if(this.rendered&&b){this.update(this.activeDate)}},jsonDate:function(e){if(!Ext.isArray(e)){if(typeof e==="string"){return Date.parseDate(e.replace(/T/," "),"Y-m-d H:i:s")}}else{for(var c=0,b=e.length;c<b;c++){if(typeof e[c]==="string"){e[c]=Date.parseDate(e[c].replace(/T/," "),"Y-m-d H:i:s")}}}return e},setSelectedDates:function(f,j){if(typeof j==="undefined"){j=true}f=this.jsonDate(f);if(!Ext.isArray(f)){f=[f]}var h,e;for(var c=0,b=f.length;c<b;++c){h=f[c];e=h.clearTime().getTime();if(this.preSelectedDates.indexOf(e)==-1){this.preSelectedDates.push(e);this.selectedDates.push(h)}}if(this.rendered&&j){this.update(this.activeDate)}},setAllowedDates:function(b,c){if(typeof c==="undefined"){c=true}this.allowedDates=this.jsonDate(b);if(this.rendered&&c){this.update(this.activeDate)}},setMinDate:function(b){this.minDate=this.jsonDate(b);this.update(this.value,true)},setMaxDate:function(b){this.maxDate=this.jsonDate(b);this.update(this.value,true)},setDateLimits:function(b,c){this.minDate=this.jsonDate(b);this.maxDate=this.jsonDate(c);this.update(this.value,true)},update:function(ab,f,E){if(typeof E==="undefined"){E=false}if(typeof f==="undefined"){f=false}if(f){var u=this.activeDate;this.activeDate=null;ab=u}var A=(this.displayMask&&(isNaN(this.displayMask)||this.noOfMonth>this.displayMask)?true:false);if(!E&&A){this.el.mask(this.displayMaskText);this.update.defer(10,this,[ab,false,true]);return false}if(this.stayInAllowedRange&&(this.minDate||this.maxDate)){if(this.minDate&&(this.minDate.getFullYear()>ab.getFullYear()||(this.minDate.getMonth()>ab.getMonth()&&this.minDate.getFullYear()==ab.getFullYear()))){ab=new Date(this.minDate.getTime())}else{if(this.maxDate&&(this.maxDate.getFullYear()<ab.getFullYear()||(this.maxDate.getMonth()<ab.getMonth()&&this.maxDate.getFullYear()==ab.getFullYear()))){ab=new Date(this.maxDate.getTime())}}}var L=ab.getMonth();var W=(this.activeDate?this.activeDate.getMonth():L);var U=ab.getFullYear();var D=(this.activeDate?this.activeDate.getFullYear():U);if(W!=L){this.fireEvent("beforemonthchange",this,W,L)}if(D!=U){this.fireEvent("beforeyearchange",this,D,U)}this.activeDate=ab.clearTime();this.preSelectedCells=[];this.lastSelectedDateCell="";this.activeDateCell="";var ac=(this.lastSelectedDate?this.lastSelectedDate:0);var z=new Date().clearTime().getTime();var ah=this.minDate?this.minDate.clearTime().getTime():Number.NEGATIVE_INFINITY;var C=this.maxDate?this.maxDate.clearTime().getTime():Number.POSITIVE_INFINITY;var R=this.disabledDatesRE;var K=this.disabledDatesText;var P=this.disabledDays?this.disabledDays.join(""):false;var c=this.disabledDaysText;var S=this.eventDatesRE;var r=this.eventDatesRECls;var q=this.eventDatesREText;var m=this.allowedDatesText;var G=this.format;var ad=this.activeDate.getTime();this.todayMonthCell=false;this.todayDayCell=false;if(this.allowedDates){this.allowedDatesT=[];for(var X=0,ag=this.allowedDates.length;X<ag;++X){this.allowedDatesT.push(this.allowedDates[X].clearTime().getTime())}}var J=function(e,an,aq,al){var ao,ak=Ext.get(an),am=Ext.get(aq),ap=al.getTime(),w=false,k;an.title="";an.firstChild.dateValue=ap;var x=al.getFullYear();if(e.lastRenderedYear!==x){e.lastRenderedYear=x;if(e.markNationalHolidays){e.nationalHolidaysNumbered=e.convertCSSDatesToNumbers(e.nationalHolidays(x))}e.eventDatesNumbered=e.convertCSSDatesToNumbers(e.eventDates(x))}if(ap<ah){an.className=" x-date-disabled";w=e.minText}if(ap>C){an.className=" x-date-disabled";w=e.maxText}if(P){if(P.indexOf(al.getDay())!=-1){w=c;an.className=" x-date-disabled"}}if(R&&G){k=al.dateFormat(G);if(R.test(k)){w=K.replace("%0",k);an.className=" x-date-disabled"}}if(e.allowedDates&&e.allowedDatesT.indexOf(ap)==-1){an.className=" x-date-disabled";w=m}if(e.markWeekends&&e.weekendDays.indexOf(al.getDay())!=-1&&!ak.hasClass("x-date-disabled")){ak.addClass(e.weekendCls)}if(!ak.hasClass("x-date-disabled")||e.styleDisabledDates){if(e.eventDatesNumbered[0].length>0){ao=e.eventDatesNumbered[0].indexOf(ap);if(ao!=-1){if(e.eventDatesNumbered[2][ao]!==""){ak.addClass(e.eventDatesNumbered[2][ao]+(e.eventDatesSelectable?"":"-disabled"));w=(e.eventDatesNumbered[1][ao]!==""?e.eventDatesNumbered[1][ao]:false)}}}if(S&&G){k=al.dateFormat(G);if(S.test(k)){w=q.replace("%0",k);an.className=r}}}if(!ak.hasClass("x-date-disabled")){if(e.markNationalHolidays&&e.nationalHolidaysNumbered[0].length>0){ao=e.nationalHolidaysNumbered[0].indexOf(ap);if(ao!=-1){ak.addClass(e.nationalHolidaysCls);w=(e.nationalHolidaysNumbered[1][ao]!==""?e.nationalHolidaysNumbered[1][ao]:false)}}if(e.preSelectedDates.indexOf(ap)!=-1){ak.addClass("x-date-selected");e.preSelectedCells.push(an.firstChild.monthCell+"#"+an.firstChild.dayCell)}if(ap==ac){e.lastSelectedDateCell=an.firstChild.monthCell+"#"+an.firstChild.dayCell}}else{if(e.disabledLetter){aq.innerHTML=e.disabledLetter}}if(ap==z){ak.addClass("x-date-today");w=e.todayText}if(e.showActiveDate&&ap==ad&&e.activeDateCell===""){ak.addClass("x-datepickerplus-activedate");e.activeDateCell=an.firstChild.monthCell+"#"+an.firstChild.dayCell}if(w){if(e.useQuickTips){Ext.QuickTips.register({target:am,text:w})}else{an.title=w}}};var B,Q,n,t,F,v,b,af,H,Y,aa,s,V,T,p,h,j,O;var I=[];for(var N=0,M=this.noOfMonth;N<M;++N){if(this.summarizeHeader&&this.noOfMonth>1&&(N===0||N==this.noOfMonth-1)){I.push(this.monthNames[ab.getMonth()]," ",ab.getFullYear());if(N===0){I.push(" - ")}}B=this.cellsArray[N].elements;Q=this.textNodesArray[N];if((this.markNationalHolidays||this.eventDates.length>0)&&this.useQuickTips){for(var ae=0,Z=Q.length;ae<Z;++ae){Ext.QuickTips.unregister(Q[ae])}}n=ab.getDaysInMonth();t=ab.getFirstDateOfMonth();F=t.getDay()-this.startDay;if(F<=this.startDay){F+=7}v=ab.add("mo",-1);b=v.getDaysInMonth()-F;n+=F;af=new Date(v.getFullYear(),v.getMonth(),b).clearTime();Y=0;if(this.showWeekNumber){s=this.weekNumberCellsArray[N].elements;V=this.weekNumberTextElsArray[N].elements;T=new Date(af);T.setDate(T.getDate()+7);p=this.weekNumberHeaderCellsArray[N].elements;p[0].firstChild.monthValue=ab.getMonth();p[0].firstChild.dateValue=T.getTime();p[0].firstChild.monthCell=N;p[0].firstChild.dayCell=0;while(Y<s.length){V[Y].innerHTML=T.getWeekOfYear();s[Y].firstChild.dateValue=T.getTime();s[Y].firstChild.monthCell=N;s[Y].firstChild.dayCell=(Y*7);T.setDate(T.getDate()+7);Y++}Y=0}for(;Y<F;++Y){Q[Y].innerHTML=(++b);B[Y].firstChild.monthCell=N;B[Y].firstChild.dayCell=Y;af.setDate(af.getDate()+1);B[Y].className="x-date-prevday";J(this,B[Y],Q[Y],af)}for(;Y<n;++Y){aa=Y-F+1;Q[Y].innerHTML=(aa);B[Y].firstChild.monthCell=N;B[Y].firstChild.dayCell=Y;af.setDate(af.getDate()+1);B[Y].className="x-date-active";J(this,B[Y],Q[Y],af);if(af.getTime()==z){this.todayMonthCell=N;this.todayDayCell=Y}}var aj=0;for(;Y<42;++Y){Q[Y].innerHTML=(++aj);B[Y].firstChild.monthCell=N;B[Y].firstChild.dayCell=Y;af.setDate(af.getDate()+1);B[Y].className="x-date-nextday";J(this,B[Y],Q[Y],af)}if(N===0&&!this.disableMonthPicker){this.mbtn.setText(this.monthNames[ab.getMonth()]+" "+ab.getFullYear())}else{h=Ext.get(this.id+"-monthLabel"+N);h.update(this.monthNames[ab.getMonth()]+" "+ab.getFullYear())}ab=ab.add("mo",1);if(!this.internalRender){j=this.el.dom.firstChild;O=j.offsetWidth;this.el.setWidth(O+this.el.getBorderWidth("lr"));Ext.fly(j).setWidth(O);this.internalRender=true}}if(this.summarizeHeader&&this.noOfMonth>1){var ai=Ext.get(this.id+"-summarize");ai.update(I.join(""))}this.el.unmask();if(W!=L){this.fireEvent("aftermonthchange",this,W,L)}if(D!=U){this.fireEvent("afteryearchange",this,D,U)}},beforeDestroy:function(){if(this.rendered){if(this.mbtn){this.mbtn.destroy()}if(this.todayBtn){this.todayBtn.destroy()}if(this.OKBtn){this.OKBtn.destroy()}if(this.undoBtn){this.undoBtn.destroy()}}},handleWeekClick:function(v,x){if(!this.disabled){v.stopEvent();var s=new Date(x.dateValue).getFirstDateOfWeek(this.startDay),r=0,b,n,c;var p=x.monthCell;var j=x.dayCell;switch(x.parentNode.tagName.toUpperCase()){case"TH":r=42;b=x.monthValue;break;case"TD":r=7;break}if((r==42&&this.fireEvent("beforemonthclick",this,b,this.lastStateWasSelected)!==false)||(r==7&&this.fireEvent("beforeweekclick",this,s,this.lastStateWasSelected)!==false)){if(!Ext.EventObject.ctrlKey&&this.multiSelectByCTRL){this.removeAllPreselectedClasses()}c=true;if(this.disablePartialUnselect){var h=s;for(var m=0;m<r;++m){n=h.getMonth();if((r==7||n===b)&&this.preSelectedDates.indexOf(h.clearTime().getTime())==-1){c=false;break}h=h.add(Date.DAY,1)}}var w=false;var u=1;if(this.strictRangeSelect&&((this.preSelectedDates.indexOf(s.add(Date.DAY,-1).clearTime().getTime())==-1&&!c)||(this.preSelectedDates.indexOf(s.add(Date.DAY,-1).clearTime().getTime())!=-1&&c))){w=true;s=s.add(Date.DAY,r-1);u=-1}this.maxNotified=false;for(var q=0,f;q<r;++q){n=s.getMonth();f=(w?r-1-q:q);if(r==7||n===b){this.markDateAsSelected(s.clearTime().getTime(),true,p,j+f,c)}s=s.add(Date.DAY,u)}if(r==42){this.fireEvent("aftermonthclick",this,b,this.lastStateWasSelected)}else{this.fireEvent("afterweekclick",this,new Date(x.dateValue).getFirstDateOfWeek(this.startDay),this.lastStateWasSelected)}}}},markDateAsSelected:function(j,h,f,c,e){var m=Ext.get(this.cellsArray[f].elements[c]);if((m.hasClass("x-date-prevday")||m.hasClass("x-date-nextday"))&&this.prevNextDaysView!=="mark"){return false}if(this.multiSelection&&(Ext.EventObject.ctrlKey||h)){var b=new Date(j).add(Date.DAY,-1).clearTime().getTime();var k=new Date(j).add(Date.DAY,1).clearTime().getTime();if(this.preSelectedDates.indexOf(j)==-1){if(this.maxSelectionDays===this.preSelectedDates.length){if(!this.maxNotified){if(this.fireEvent("beforemaxdays",this)!==false){Ext.Msg.alert(this.maxSelectionDaysTitle,this.maxSelectionDaysText.replace(/%0/,this.maxSelectionDays))}this.maxNotified=true}return false}if(m.hasClass("x-date-disabled")){return false}if(this.strictRangeSelect&&this.preSelectedDates.indexOf(k)==-1&&this.preSelectedDates.indexOf(b)==-1&&this.preSelectedDates.length>0){return false}this.preSelectedDates.push(j);this.markSingleDays(f,c,false);this.markGhostDatesAlso(f,c,false);this.lastStateWasSelected=true}else{if(e&&(!this.strictRangeSelect||(this.strictRangeSelect&&((this.preSelectedDates.indexOf(k)==-1&&this.preSelectedDates.indexOf(b)!=-1)||(this.preSelectedDates.indexOf(k)!=-1&&this.preSelectedDates.indexOf(b)==-1))))){this.preSelectedDates.remove(j);this.markSingleDays(f,c,true);this.markGhostDatesAlso(f,c,true);this.lastStateWasSelected=false}}}else{this.removeAllPreselectedClasses();this.preSelectedDates=[j];this.preSelectedCells=[];this.markSingleDays(f,c,false);this.markGhostDatesAlso(f,c,false);this.lastStateWasSelected=true}this.lastSelectedDate=j;this.lastSelectedDateCell=f+"#"+c;if(this.multiSelection&&!this.renderOkUndoButtons){this.copyPreToSelectedDays()}return true},markSingleDays:function(e,c,b){if(!b){Ext.get(this.cellsArray[e].elements[c]).addClass("x-date-selected");this.preSelectedCells.push((e)+"#"+(c))}else{Ext.get(this.cellsArray[e].elements[c]).removeClass("x-date-selected");this.preSelectedCells.remove((e)+"#"+(c))}},markGhostDatesAlso:function(e,c,b){if(this.prevNextDaysView=="mark"){var h=Ext.get(this.cellsArray[e].elements[c]),f;if(h.hasClass("x-date-prevday")&&e>0){f=(5-Math.floor(c/7))*7;if(Ext.get(this.cellsArray[e-1].elements[c+f]).hasClass("x-date-nextday")){f-=7}this.markSingleDays(e-1,c+f,b)}else{if(h.hasClass("x-date-nextday")&&e<this.cellsArray.length-1){f=28;if(this.cellsArray[e].elements[c].firstChild.firstChild.firstChild.innerHTML!=this.cellsArray[e+1].elements[c-f].firstChild.firstChild.firstChild.innerHTML){f=35}this.markSingleDays(e+1,c-f,b)}else{if(h.hasClass("x-date-active")&&((c<14&&e>0)||(c>27&&e<this.cellsArray.length-1))){if(c<14){f=28;if(!Ext.get(this.cellsArray[e-1].elements[c+f]).hasClass("x-date-nextday")){f=35}if(c+f<42&&this.cellsArray[e].elements[c].firstChild.firstChild.firstChild.innerHTML==this.cellsArray[e-1].elements[c+f].firstChild.firstChild.firstChild.innerHTML){this.markSingleDays(e-1,c+f,b)}}else{f=28;if(!Ext.get(this.cellsArray[e+1].elements[c-f]).hasClass("x-date-prevday")){f=35}if(c-f>=0&&this.cellsArray[e].elements[c].firstChild.firstChild.firstChild.innerHTML==this.cellsArray[e+1].elements[c-f].firstChild.firstChild.firstChild.innerHTML){this.markSingleDays(e+1,c-f,b)}}}}}}},removeAllPreselectedClasses:function(){for(var f=0,c=this.preSelectedCells.length;f<c;++f){var b=this.preSelectedCells[f].split("#");Ext.get(this.cellsArray[b[0]].elements[b[1]]).removeClass("x-date-selected")}this.preSelectedDates=[];this.preSelectedCells=[]},handleDateClick:function(D,q){D.stopEvent();var b=Ext.fly(q.parentNode);if(!this.disabled&&q.dateValue&&!b.hasClass("x-date-disabled")&&!b.hasClass("x-datepickerplus-eventdates-disabled")&&this.fireEvent("beforedateclick",this,D)!==false){if((!b.hasClass("x-date-prevday")&&!b.hasClass("x-date-nextday"))||this.prevNextDaysView=="mark"){var w=Ext.EventObject;if((!w.ctrlKey&&this.multiSelectByCTRL)||w.shiftKey||!this.multiSelection){this.removeAllPreselectedClasses()}var p=(((!w.ctrlKey&&!this.multiSelectByCTRL)||w.shiftKey)&&this.multiSelection?true:false);if(w.shiftKey&&this.multiSelection&&this.lastSelectedDate){var G=this.lastSelectedDate;var h=q.dateValue;var k=(G<h?1:-1);var v=this.lastSelectedDateCell.split("#");var z=parseInt(v[0],10);var B=parseInt(v[1],10);var n,m=0,j=0;this.maxNotified=false;var s=this.activeDate.getFirstDateOfMonth().clearTime().getTime();var r=this.activeDate.add(Date.MONTH,this.noOfMonth-1).getLastDateOfMonth().clearTime().getTime();if(G<s||G>r){var x=this.minDate?this.minDate.clearTime().getTime():Number.NEGATIVE_INFINITY;var A=this.maxDate?this.maxDate.clearTime().getTime():Number.POSITIVE_INFINITY;var H=this.disabledDays?this.disabledDays.join(""):"";var F=this.disabledDatesRE;var C=this.format;var u=this.allowedDates?this.allowedDatesT:false;var E,f,c;while(G<s||G>r){E=new Date(G);f=false;if(F){c=E.dateFormat(C);f=F.test(c)}if(!(G<x)&&!(G>A)&&H.indexOf(E.getDay())==-1&&!f&&(!u||u.indexOf(G)!=-1)){if(this.maxSelectionDays===this.preSelectedDates.length){if(this.fireEvent("beforemaxdays",this)!==false){Ext.Msg.alert(this.maxSelectionDaysTitle,this.maxSelectionDaysText.replace(/%0/,this.maxSelectionDays))}break}this.preSelectedDates.push(G)}G=new Date(G).add(Date.DAY,k).clearTime().getTime()}z=(k>0?0:this.cellsArray.length-1);B=(k>0?0:41);n=Ext.get(this.cellsArray[z].elements[B]);while(n.hasClass("x-date-prevday")||n.hasClass("x-date-nextday")){n.addClass("x-date-selected");this.preSelectedCells.push((z)+"#"+(B));B+=k;n=Ext.get(this.cellsArray[z].elements[B])}}while((h-G)*k>0&&z>=0&&z<this.cellsArray.length){this.markDateAsSelected(G,p,z,B,true);G=new Date(G).add(Date.DAY,k).clearTime().getTime();n=Ext.get(this.cellsArray[z].elements[B]);if(n.hasClass("x-date-active")){m=0}else{m++}B+=k;if(B==42){z++;B=(m>=7?14:7)}else{if(B<0){z--;B=34;n=Ext.get(this.cellsArray[z].elements[B]);if(n.hasClass("x-date-nextday")||m==7){B=27}}}}}this.markDateAsSelected(q.dateValue,p,q.monthCell,q.dayCell,true);this.finishDateSelection(new Date(q.dateValue))}}},copyPreToSelectedDays:function(){this.selectedDates=[];for(var c=0,b=this.preSelectedDates.length;c<b;++c){this.selectedDates.push(new Date(this.preSelectedDates[c]))}},okClicked:function(){this.copyPreToSelectedDays();this.selectedDates=this.selectedDates.sortDates();this.fireEvent("select",this,this.selectedDates)},spaceKeyPressed:function(j){var h=(((!Ext.EventObject.ctrlKey&&!this.multiSelectByCTRL)||Ext.EventObject.shiftKey)&&this.multiSelection?true:false);if(!this.disabled&&this.shiftSpaceSelect==Ext.EventObject.shiftKey&&this.showActiveDate){var f=this.activeDateCell.split("#");var c=parseInt(f[0],10);var b=parseInt(f[1],10);this.markDateAsSelected(this.activeDate.getTime(),h,c,b,true);this.finishDateSelection(this.activeDate)}else{this.selectToday()}},finishDateSelection:function(b){this.setValue(b);if(this.multiSelection){this.fireEvent("afterdateclick",this,b,this.lastStateWasSelected)}else{this.fireEvent("afterdateclick",this,b,this.lastStateWasSelected);this.fireEvent("select",this,this.value)}},selectToday:function(){if(!this.disabled&&this.todayBtn&&!this.todayBtn.disabled){var b=new Date().clearTime();var c=b.getTime();if(typeof this.todayMonthCell==="number"){this.markDateAsSelected(c,false,this.todayMonthCell,this.todayDayCell,true)}else{if(this.multiSelection){this.update(b)}}this.finishDateSelection(b)}},setValue:function(b){if(Ext.isArray(b)){this.selectedDates=[];this.preSelectedDates=[];this.setSelectedDates(b,true);b=b[0]}this.value=b.clearTime(true);if(this.el&&!this.multiSelection&&this.noOfMonth==1){this.update(this.value)}},setSize:Ext.emptyFn});Ext.reg("datepickerplus",Ext.ux.DatePickerPlus);if(parseInt(Ext.version.substr(0,1),10)>2){Ext.menu.DateItem=Ext.ux.DatePickerPlus;Ext.override(Ext.menu.DateMenu,{initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);if(this.strict=(Ext.isIE7&&Ext.isStrict)){this.on("show",this.onShow,this,{single:true,delay:20})}var b=(this.initialConfig.usePickerPlus?Ext.ux.DatePickerPlus:Ext.DatePicker);Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new b(Ext.apply({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item"},this.initialConfig))});Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}}})}else{Ext.menu.DateItem=function(b){if(b&&b.usePickerPlus){Ext.menu.DateItem.superclass.constructor.call(this,new Ext.ux.DatePickerPlus(b),b)}else{Ext.menu.DateItem.superclass.constructor.call(this,new Ext.DatePicker(b),b)}this.picker=this.component;this.addEvents("select");this.picker.on("render",function(c){c.getEl().swallowEvent("click");c.container.addClass("x-menu-date-item")});this.picker.on("select",this.onSelect,this)};Ext.extend(Ext.menu.DateItem,Ext.menu.Adapter,{onSelect:function(c,b){this.fireEvent("select",this,b,c);Ext.menu.DateItem.superclass.handleClick.call(this)}})}if(Ext.form&&Ext.form.DateField){Ext.ux.form.DateFieldPlus=Ext.extend(Ext.form.DateField,{usePickerPlus:true,showWeekNumber:true,noOfMonth:1,noOfMonthPerRow:3,nationalHolidaysCls:"x-datepickerplus-nationalholidays",markNationalHolidays:true,eventDates:function(b){return[]},eventDatesRE:false,eventDatesRECls:"",eventDatesREText:"",multiSelection:false,multiSelectionDelimiter:",",multiSelectByCTRL:true,fillupRows:true,markWeekends:true,weekendText:"",weekendCls:"x-datepickerplus-weekends",weekendDays:[6,0],useQuickTips:true,pageKeyWarp:1,maxSelectionDays:false,resizable:false,renderTodayButton:true,renderOkUndoButtons:true,tooltipType:"qtip",allowedDates:false,allowedDatesText:"",renderPrevNextButtons:true,renderPrevNextYearButtons:false,disableMonthPicker:false,showActiveDate:false,shiftSpaceSelect:true,disabledLetter:false,allowMouseWheel:true,summarizeHeader:false,stayInAllowedRange:true,disableSingleDateSelection:false,eventDatesSelectable:false,styleDisabledDates:false,allowOtherMenus:false,onBeforeYearChange:function(b,e,c){this.fireEvent("beforeyearchange",this,e,c,b)},onAfterYearChange:function(b,e,c){this.fireEvent("afteryearchange",this,e,c,b)},onBeforeMonthChange:function(b,c,e){this.fireEvent("beforemonthchange",this,c,e,b)},onAfterMonthChange:function(b,c,e){this.fireEvent("aftermonthchange",this,c,e,b)},onAfterMonthClick:function(b,e,c){this.fireEvent("aftermonthclick",this,e,c,b)},onAfterWeekClick:function(c,b,e){this.fireEvent("afterweekclick",this,b,e,c)},onAfterDateClick:function(c,b,e){this.fireEvent("afterdateclick",this,b,e,c)},onBeforeMouseWheel:function(b,c){this.fireEvent("beforemousewheel",this,c,b)},onBeforeMaxDays:function(b){this.fireEvent("beforemaxdays",this,b)},onUndo:function(c,b){this.fireEvent("undo",this,b,c)},onTriggerClick:function(){if(this.disabled){return}if(!this.menu){this.menu=new Ext.menu.DateMenu({allowOtherMenus:this.allowOtherMenus,usePickerPlus:this.usePickerPlus,noOfMonth:this.noOfMonth,noOfMonthPerRow:this.noOfMonthPerRow,listeners:{beforeyearchange:{fn:this.onBeforeYearChange,scope:this},afteryearchange:{fn:this.onAfterYearChange,scope:this},beforemonthchange:{fn:this.onBeforeMonthChange,scope:this},aftermonthchange:{fn:this.onAfterMonthChange,scope:this},afterdateclick:{fn:this.onAfterDateClick,scope:this},aftermonthclick:{fn:this.onAfterMonthClick,scope:this},afterweekclick:{fn:this.onAfterWeekClick,scope:this},beforemousewheel:{fn:this.onBeforeMouseWheel,scope:this},beforemaxdays:{fn:this.onBeforeMaxDays,scope:this},undo:{fn:this.onUndo,scope:this}}});this.relayEvents(this.menu,["select"])}if(this.menu.isVisible()){this.menu.hide();return}if(this.disabledDatesRE){this.ddMatch=this.disabledDatesRE}if(typeof this.minDate=="string"){this.minDate=this.parseDate(this.minDate)}if(typeof this.maxDate=="string"){this.maxDate=this.parseDate(this.maxDate)}Ext.apply(this.menu.picker,{minDate:this.minValue||this.minDate,maxDate:this.maxValue||this.maxDate,disabledDatesRE:this.ddMatch,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,showToday:this.showToday,format:this.format,minText:String.format(this.minText,this.formatDate(this.minValue||this.minDate)),maxText:String.format(this.maxText,this.formatDate(this.maxValue||this.maxDate)),showWeekNumber:this.showWeekNumber,nationalHolidaysCls:this.nationalHolidaysCls,markNationalHolidays:this.markNationalHolidays,multiSelectByCTRL:this.multiSelectByCTRL,fillupRows:this.fillupRows,multiSelection:this.multiSelection,markWeekends:this.markWeekends,weekendText:this.weekendText,weekendCls:this.weekendCls,weekendDays:this.weekendDays,useQuickTips:this.useQuickTips,eventDates:this.eventDates,eventDatesRE:this.eventDatesRE,eventDatesRECls:this.eventDatesRECls,eventDatesREText:this.eventDatesREText,pageKeyWarp:this.pageKeyWarp,maxSelectionDays:this.maxSelectionDays,resizable:this.resizable,renderTodayButton:this.renderTodayButton,renderOkUndoButtons:this.renderOkUndoButtons,allowedDates:this.allowedDates,allowedDatesText:this.allowedDatesText,renderPrevNextButtons:this.renderPrevNextButtons,renderPrevNextYearButtons:this.renderPrevNextYearButtons,disableMonthPicker:this.disableMonthPicker,showActiveDate:this.showActiveDate,shiftSpaceSelect:this.shiftSpaceSelect,disabledLetter:this.disabledLetter,allowMouseWheel:this.allowMouseWheel,summarizeHeader:this.summarizeHeader,stayInAllowedRange:this.stayInAllowedRange,disableSingleDateSelection:this.disableSingleDateSelection,eventDatesSelectable:this.eventDatesSelectable,styleDisabledDates:this.styleDisabledDates});if(this.menuEvents){this.menuEvents("on")}else{this.menu.on(Ext.apply({},this.menuListeners,{scope:this}))}this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?");this.menu.focus()},setValue:function(b){var k=this;if(Ext.isArray(b)){var h=[];for(var j=0,c=b.length;j<c;++j){h.push(k.formatDate(b[j]))}var f=h.join(this.multiSelectionDelimiter);Ext.form.DateField.superclass.setValue.call(this,f)}else{Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(b)))}},validateValue:function(f){if(this.multiSelection){var k=this;var b=f.split(this.multiSelectionDelimiter);var j=true;for(var h=0,c=b.length;h<c;++h){if(!Ext.ux.form.DateFieldPlus.superclass.validateValue.call(k,b[h])){j=false}}return j}else{return Ext.ux.form.DateFieldPlus.superclass.validateValue.call(this,f)}},getValue:function(){if(this.multiSelection){var f=Ext.form.DateField.superclass.getValue.call(this);var k=this;var b=f.split(this.multiSelectionDelimiter);var j=[];for(var h=0,c=b.length;h<c;++h){var m=k.parseDate(b[h]);if(m){j.push(m)}}return(j.length>0?j:"")}else{return Ext.ux.form.DateFieldPlus.superclass.getValue.call(this)}},beforeBlur:function(){if(this.multiSelection){this.setValue(this.getRawValue().split(this.multiSelectionDelimiter))}else{var b=this.parseDate(this.getRawValue());if(b){this.setValue(b)}}},submitFormat:"Y-m-d",submitFormatAddon:"-format",onRender:function(){Ext.ux.form.DateFieldPlus.superclass.onRender.apply(this,arguments);var b=this.name||this.el.dom.name||(this.id+this.submitFormatAddon);if(b==this.id){b+=this.submitFormatAddon}this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:b,value:this.formatHiddenDate(this.parseDate(this.value))});this.hiddenName=b;this.el.dom.removeAttribute("name");this.el.on({keyup:{scope:this,fn:this.updateHidden},blur:{scope:this,fn:this.updateHidden}});this.setValue=this.setValue.createSequence(this.updateHidden);if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:this.trigger},this.tooltip))}else{this.trigger.dom[this.tooltipType]=this.tooltip}}},onDisable:function(){Ext.ux.form.DateFieldPlus.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.dom.setAttribute("disabled","disabled")}},onEnable:function(){Ext.ux.form.DateFieldPlus.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.dom.removeAttribute("disabled")}},formatHiddenDate:function(b){return Ext.isDate(b)?Ext.util.Format.date(b,this.submitFormat):b},formatMultiHiddenDate:function(b){var k=this,h=[],f;for(var j=0,c=b.length;j<c;++j){h.push(k.formatHiddenDate(b[j]))}f=h.join(this.multiSelectionDelimiter);this.hiddenField.dom.value=f},updateHidden:function(b){if(Ext.isArray(b)){this.formatMultiHiddenDate(b)}else{var c=this.getValue();if(Ext.isArray(c)){this.formatMultiHiddenDate(c)}else{this.hiddenField.dom.value=this.formatHiddenDate(c)}}}});Ext.reg("datefieldplus",Ext.ux.form.DateFieldPlus)}Ext.util.Format.field=function(b){return(!b?"":'<span id="'+(b.name||b.id)+'-tpl-wrap"></span>')};Ext.ux.TemplateLayout=Ext.extend(Ext.layout.ContainerLayout,{setContainer:function(b){Ext.ux.TemplateLayout.superclass.setContainer.apply(this,arguments);b.el.addClass("x-form-template-layout")},renderAll:function(h,k){var j=h.items.items;if(!this.tpl){this.tpl=h.tpl}if(typeof this.tpl=="string"){this.tpl=new Ext.XTemplate(this.tpl)}else{if(Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl.join(""))}}var b={};for(var f=0,c=j.length;f<c;f++){var e=j[f];b[e.name||e.id]=e}this.tpl.overwrite(h.body,b);for(var f=0,c=j.length;f<c;f++){var e=j[f];e.rendered=false;var m=Ext.getDom((e.name||e.id)+"-tpl-wrap");if(m){e.render(m.parentNode,m);Ext.fly(m).remove()}}}});Ext.Container.LAYOUTS.template=Ext.ux.TemplateLayout;var o=Ext.Container.prototype.lookupComponent;Ext.override(Ext.Container,{lookupComponent:function(b){if(!b){Ext.jx.log("ugly code below..only is known to be needed in ie");b=Ext.ComponentMgr.create({xtype:"panel",hidden:true,renderTo:Ext.getBody()});return b}else{if(b instanceof Ext.Element){return b}else{if(b.nodeType&&(b.nodeType==1)){return Ext.get(b)}else{return o.call(this,b)}}}}});Ext.layout.CarouselLayout=Ext.extend(Ext.layout.ContainerLayout,{constructor:function(b){b=b||{};if(!(b.chunkedScroll||b.pagedScroll)){Ext.applyIf(b,{scrollIncrement:10,scrollRepeatInterval:10,marginScrollButtons:12,animScroll:false})}Ext.layout.CarouselLayout.superclass.constructor.call(this,b);if(this.chunkedScroll||this.pagedScroll){this.scrollRepeatInterval=this.scrollDuration*1000;this.scrollAnimationConfig={duration:this.chunkedScroll?this.scrollDuration:this.scrollDuration*2,callback:this.updateScrollButtons,scope:this}}else{this.scrollAnimationConfig=this.animScroll?{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}:false}},scrollIncrement:10,scrollRepeatInterval:10,scrollDuration:0.35,animScroll:true,chunkedScroll:false,monitorResize:true,scrollButtonPosition:"right",loopCount:0,loopPictureDelay:5,loopImages:function(){if(this.loopCount<=0){return}var b=this.getScrollTo(1);if(b){b=Math.min(this.getMaxScrollPos(),b);if(b!=this.getScrollPos()){this.scrollTo(b)}else{return}}else{this.scrollTo(0);this.loopCount--;if(this.loopCount<=0){return}}this.loopImages.defer(this.loopPictureDelay*1000,this)},onLayout:function(f,j){var h=f.items.items,b=h.length,k,e;if(!this.scrollWrap){this.scrollWrap=j.createChild({cls:"x-carousel-layout",cn:[{cls:"x-carousel-left-scrollbutton",style:{height:"100%"}},{cls:"x-carousel-right-scrollbutton",style:{height:"100%"}},{tag:this.scrollElementTag||"div",cls:"x-carousel-scroller",cn:{cls:"x-carousel-body"}}]});this.scrollWrap.addClass("x-scroll-button-position-"+this.scrollButtonPosition);this.scrollLeft=this.scrollWrap.child(".x-carousel-left-scrollbutton");this.scrollRight=this.scrollWrap.child(".x-carousel-right-scrollbutton");this.scroller=this.scrollWrap.child(".x-carousel-scroller");this.strip=this.scroller.child(".x-carousel-body");if(this.pagedScroll){this.scrollLeft.on("click",this.onScrollLeftClick,this);this.scrollRight.on("click",this.onScrollRightClick,this)}else{this.leftRepeater=new Ext.util.ClickRepeater(this.scrollLeft,{interval:this.pagedScroll?10000:this.scrollRepeatInterval,delay:0,handler:this.onScrollLeftClick,scope:this});this.rightRepeater=new Ext.util.ClickRepeater(this.scrollRight,{interval:this.pagedScroll?10000:this.scrollRepeatInterval,delay:0,handler:this.onScrollRightClick,scope:this})}this.renderAll(f,this.strip)}this.updateScrollButtons.defer(10,this);if(this.loopCount>0&&(this.chunkedScroll||this.pagedScroll)&&!this.startedLoop){this.startedLoop=true;this.loopImages.defer(this.loopPictureDelay*1000,this)}},renderItem:function(f,b,e){if(f){if(f.initialConfig){if(f.rendered){if(typeof b=="number"){b=e.dom.childNodes[b]}e.dom.insertBefore(f.getEl().dom,b||null)}else{f.render(e,b)}}else{if(f instanceof Ext.Element){f.el=f;if(typeof b=="number"){b=e.dom.childNodes[b]}e.dom.insertBefore(f.dom,b||null)}}}f.el.addClass("x-carousel-item")},onResize:function(h,b,f){Ext.layout.CarouselLayout.superclass.onResize.apply(this,arguments);if(!this.strip){return}if(Ext.isIE){this.scrollLeft.setHeight(this.scroller.getHeight());this.scrollRight.setHeight(this.scroller.getHeight())}this.setItemsEdges();var e=this.getMaxScrollPos();if(this.getScrollPos()>e){this.scrollTo(e)}},setItemsEdges:function(){var s=this.strip.getLeft();var v=this.container.items.items;var m=v.length;for(var n=0;n<m;n++){var q=v[n];var p=q.el;var u=p.getBox();var k=u.x-s;var h=u.right-s;q.edges={left:k,leftAnchor:k,right:h,rightAnchor:h};if(n==0){p.setStyle({"margin-left":"0px"})}else{if(n==v.length-1){p.setStyle({"margin-right":"0px"})}var j=v[n-1];var f=((k-j.edges.right)/2);j.edges.rightAnchor+=f;q.edges.leftAnchor-=f}}this.itemWidth=v[m-1].edges.rightAnchor/m},getNextOnLeft:function(){var c=this.container.items.items;if(c.length){for(var b=c.length-1;b>-1;b--){if(c[b].edges&&c[b].edges.left<this.getScrollPos()){return c[b]}}}},getNextOnRight:function(){var f=this.container.items.items;if(f.length){var c=this.scroller.dom.scrollLeft+this.getClientWidth();for(var e=0,b=f.length;e<b;e++){if(f[e].edges&&f[e].edges.right>c){return f[e]}}}},onScrollRightClick:function(){this.loopCount=0;var b=this.getScrollTo(1);if(b){b=Math.min(this.getMaxScrollPos(),b);if(b!=this.getScrollPos()){this.scrollTo(b)}}},onScrollLeftClick:function(){this.loopCount=0;var b=Math.max(0,this.getScrollTo(-1));if(b!=this.getScrollPos()){this.scrollTo(b)}},scrollTo:function(c){if(this.scrollAnimationConfig){var b=Math.abs(this.getScrollPos()-c);this.scrollAnimationConfig.duration=this.scrollDuration*(b/this.itemWidth)}this.scroller.scrollTo("left",c,this.scrollAnimationConfig);if(!this.scrollAnimationConfig){this.updateScrollButtons()}},updateScrollButtons:function(){var b=this.getScrollPos();this.scrollLeft[(b==0)?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[(b>=this.getMaxScrollPos())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},getScrollWidth:function(){var b=this.container.items.items;if(b.length&&!b[0].edges){this.setItemsEdges()}return b.length?b[b.length-1].edges.rightAnchor:0},getScrollPos:function(){return this.scroller.dom.scrollLeft||0},getMaxScrollPos:function(){return this.getScrollWidth()-this.getClientWidth()},getClientWidth:function(){return this.scroller.dom.clientWidth||0},getScrollTo:function(e){var f=this.getScrollPos();if(this.chunkedScroll||this.pagedScroll){if(e==-1){var c=this.getNextOnLeft();if(c){if(this.pagedScroll){return c.edges.rightAnchor-this.getClientWidth()}else{return c.edges.leftAnchor}}}else{var b=this.getNextOnRight();if(b){if(this.pagedScroll){return b.edges.leftAnchor}else{return(b.edges.rightAnchor-this.getClientWidth())}}}}else{return(e==-1)?f-this.scrollIncrement:f+this.scrollIncrement}},isValidParent:function(e,b){return true}});Ext.Container.LAYOUTS.carousel=Ext.layout.CarouselLayout;Ext.ns("Ext.ux");Ext.ux.ContainerSpacer=Ext.extend(Ext.Panel,{frame:false,hideBorder:true,baseCls:"x-frameless",render:function(){if(!this.items&&!this.html){this.html="&#160;"}Ext.ux.ContainerSpacer.superclass.render.apply(this,arguments)}});Ext.reg("container_spacer",Ext.ux.ContainerSpacer);Ext.namespace("Ext.ux.panel");Ext.ux.GMapPanel=Ext.extend(Ext.Panel,{border:false,respErrors:[{code:"UNKNOWN_ERROR",msg:"A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known."},{code:"ERROR",msg:"There was a problem contacting the Google servers."},{code:"ZERO_RESULTS",msg:"The request returns zero results."},{code:"INVALID_REQUEST",msg:"This request was invalid."},{code:"REQUEST_DENIED",msg:"The webpage is not allowed to use the geocoder for some reason."},{code:"OVER_QUERY_LIMIT",msg:"The webpage has gone over the requests limit in too short a period of time."}],locationTypes:[{level:4,code:"ROOFTOP",msg:"The returned result is a precise geocode for which we have location information accurate down to street address precision."},{level:3,code:"RANGE_INTERPOLATED",msg:"The returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address."},{level:2,code:"GEOMETRIC_CENTER",msg:"The returned result is the geometric center of a result such as a polyline (for example, a street) or polygon (region)."},{level:1,code:"APPROXIMATE",msg:"The returned result is approximate."}],respErrorTitle:"Error",geoErrorMsgUnable:"Unable to Locate the Address you provided",geoErrorTitle:"Address Location Error",geoErrorMsgAccuracy:'The address provided has a low accuracy.<br><br>"{0}" Accuracy.<br><br>{1}',gmapType:"map",zoomLevel:3,yaw:180,pitch:0,displayGeoErrors:false,minGeoAccuracy:"ROOFTOP",mapDefined:false,mapDefinedGMap:false,initComponent:function(){this.addEvents("mapready","apiready");Ext.applyIf(this,{markers:[],cache:{marker:[],polyline:[],infowindow:[]}});Ext.ux.GMapPanel.superclass.initComponent.call(this);if(window.google&&window.google.maps){this.on("afterrender",this.apiReady,this)}else{window.gmapapiready=this.apiReady.createDelegate(this);this.buildScriptTag("http://maps.google.com/maps/api/js?sensor=false&callback=gmapapiready")}},apiReady:function(){if(this.rendered){(function(){if(this.gmapType==="map"){this.gmap=new google.maps.Map(this.body.dom,{zoom:this.zoomLevel,mapTypeId:google.maps.MapTypeId.ROADMAP});this.mapDefined=true;this.mapDefinedGMap=true}if(this.gmapType==="panorama"){this.gmap=new GStreetviewPanorama(this.body.dom);this.mapDefined=true}if(!this.mapDefined&&this.gmapType){this.gmap=new google.maps.Map(this.body.dom,{zoom:this.zoomLevel,mapTypeId:google.maps.MapTypeId.ROADMAP});this.gmap.setMapTypeId(this.gmapType);this.mapDefined=true;this.mapDefinedGMap=true}google.maps.event.addListenerOnce(this.getMap(),"tilesloaded",this.onMapReady.createDelegate(this));google.maps.event.addListener(this.getMap(),"dragend",this.dragEnd.createDelegate(this));if(typeof this.setCenter==="object"){if(typeof this.setCenter.geoCodeAddr==="string"){this.geoCodeLookup(this.setCenter.geoCodeAddr,this.setCenter.marker,false,true,this.setCenter.listeners)}else{if(this.gmapType==="map"){var b=new google.maps.LatLng(this.setCenter.lat,this.setCenter.lng);this.getMap().setCenter(b,this.zoomLevel);this.lastCenter=b}if(typeof this.setCenter.marker==="object"&&typeof b==="object"){this.addMarker(b,this.setCenter.marker,this.setCenter.marker.clear)}}if(this.gmapType==="panorama"){this.getMap().setLocationAndPOV(new google.maps.LatLng(this.setCenter.lat,this.setCenter.lng),{yaw:this.yaw,pitch:this.pitch,zoom:this.zoomLevel})}}}).defer(200,this)}else{this.on("afterrender",this.apiReady,this)}},afterRender:function(){var b=this.ownerCt.getSize();Ext.applyIf(this,b);Ext.ux.GMapPanel.superclass.afterRender.call(this)},buildScriptTag:function(c,f){var b=document.createElement("script"),e=document.getElementsByTagName("head")[0];b.type="text/javascript";b.src=c;return e.appendChild(b)},onMapReady:function(){this.addMapControls();this.addOptions();this.addMarkers(this.markers);this.fireEvent("mapready",this,this.getMap())},onResize:function(b,c){Ext.ux.GMapPanel.superclass.onResize.call(this,b,c);if(typeof this.getMap()=="object"){google.maps.event.trigger(this.getMap(),"resize");if(this.lastCenter){this.getMap().setCenter(this.lastCenter,this.zoomLevel)}}},setSize:function(e,b,c){Ext.ux.GMapPanel.superclass.setSize.call(this,e,b,c);if(Ext.isObject(this.getMap())){google.maps.event.trigger(this.getMap(),"resize");if(this.lastCenter){this.getMap().setCenter(this.lastCenter,this.zoomLevel)}}},dragEnd:function(){this.lastCenter=this.getMap().getCenter()},getMap:function(){return this.gmap},getCenter:function(){return this.getMap().getCenter()},getCenterLatLng:function(){var b=this.getCenter();return{lat:b.lat(),lng:b.lng()}},addMarkers:function(e){if(Ext.isArray(e)){for(var c=0;c<e.length;c++){if(e[c]){if(typeof e[c].geoCodeAddr=="string"){this.geoCodeLookup(e[c].geoCodeAddr,e[c].marker,false,e[c].setCenter,e[c].listeners)}else{var b=new google.maps.LatLng(e[c].lat,e[c].lng);this.addMarker(b,e[c].marker,false,e[c].setCenter,e[c].listeners)}}}}},addMarker:function(e,f,c,b,h){Ext.applyIf(f,{});if(c===true){this.clearMarkers()}if(b===true){this.getMap().setCenter(e,this.zoomLevel);this.lastCenter=e}var j=new google.maps.Marker(Ext.apply(f,{position:e}));if(f.infoWindow){this.createInfoWindow(f.infoWindow,e,j)}this.cache.marker.push(j);j.setMap(this.getMap());if(typeof h==="object"){for(evt in h){google.maps.event.addListener(j,evt,h[evt])}}return j},addPolyline:function(e,c){var f=new google.maps.MVCArray,b,c=c?c:{strokeColor:"#FF0000",strokeOpacity:1,strokeWeight:2};Ext.each(e,function(h){f.push(new google.maps.LatLng(h.lat,h.lng))},this);var b=new google.maps.Polyline(Ext.apply({path:f},c));this.cache.polyline.push(b);b.setMap(this.getMap())},createInfoWindow:function(c,b,e){var h=this,f=new google.maps.InfoWindow({content:c.content,position:b});if(e){google.maps.event.addListener(e,"click",function(){h.hideAllInfoWindows();f.open(h.getMap())})}this.cache.infowindow.push(f);return f},hideAllInfoWindows:function(){for(var b=0;b<this.cache.infowindow.length;b++){this.cache.infowindow[b].close()}},clearMarkers:function(){this.hideAllInfoWindows();this.hideMarkers()},hideMarkers:function(){Ext.each(this.cache.marker,function(b){b.setMap(null)})},showMarkers:function(){Ext.each(this.cache.marker,function(b){b.setMap(this.getMap())},this)},addMapControls:function(){if(this.gmapType==="map"){if(Ext.isArray(this.mapControls)){for(i=0;i<this.mapControls.length;i++){}}else{if(typeof this.mapControls==="string"){}else{if(typeof this.mapControls==="object"){}}}}},addMapControl:function(c){var b=window[c];if(typeof b==="function"){}},addOptions:function(){if(Ext.isArray(this.mapConfOpts)){var b;for(i=0;i<this.mapConfOpts.length;i++){}}else{if(typeof this.mapConfOpts==="string"){}}},addOption:function(c){var b=this.getMap()[c];if(typeof b==="function"){this.getMap()[c]()}},geoCodeLookup:function(h,e,c,b,f){if(!this.geocoder){this.geocoder=new google.maps.Geocoder()}this.geocoder.geocode({address:h},this.addAddressToMap.createDelegate(this,[h,e,c,b,f],true))},centerOnClientLocation:function(){this.getClientLocation(function(c){var b=new google.maps.LatLng(c.latitude,c.longitude);this.getMap().setCenter(b,this.zoomLevel);this.lastCenter=b})},getClientLocation:function(b,c){if(!c){c=Ext.emptyFn}if(!this.clientGeo){this.clientGeo=google.gears.factory.create("beta.geolocation")}geo.getCurrentPosition(b.createDelegate(this),c)},addAddressToMap:function(e,h,p,j,m,b,q){if(!e||h!=="OK"){this.respErrorMsg(h)}else{var f=e[0].geometry.location,c=this.getLocationTypeInfo(e[0].geometry.location_type,"level"),k=this.getLocationTypeInfo(this.minGeoAccuracy,"level");if(c===0){this.geoErrorMsg(this.geoErrorTitle,this.geoErrorMsgUnable)}else{if(c<k){this.geoErrorMsg(this.geoErrorTitle,String.format(this.geoErrorMsgAccuracy,e[0].geometry.location_type,this.getLocationTypeInfo(e[0].geometry.location_type,"msg")))}else{point=new google.maps.LatLng(f.lat(),f.lng());if(b){this.getMap().setCenter(point,this.zoomLevel);this.lastCenter=point}if(typeof j==="object"){if(!j.title){j.title=e.formatted_address}var n=this.addMarker(point,j,m,false,q);if(j.callback){j.callback.call(this,n,point)}}}}}},geoErrorMsg:function(c,b){Ext.jx.log(c,b);this.hide()},respErrorMsg:function(b){Ext.each(this.respErrors,function(c){if(b==c.code){Ext.jx.log(c.msg)}},this);this.hide()},getLocationTypeInfo:function(b,c){var e=0;Ext.each(this.locationTypes,function(f){if(f.code===b){e=f[c]}});return e}});Ext.reg("gmappanel",Ext.ux.GMapPanel);Ext.ns("Ext.ux");Ext.ux.Menu=Ext.extend(Ext.util.Observable,{direction:"vertical",delay:0.2,autoWidth:true,transitionType:"fade",transitionDuration:0.3,animate:true,currentClass:"current",trackingMouse:false,constructor:function(h,f){f=f||{};Ext.apply(this,f);Ext.ux.Menu.superclass.constructor.call(this,f);this.addEvents("show","hide","click");this.el=Ext.get(h);this.elId=h;if(!this.el.select("li").getCount()||f.ulId||f.useStandAloneMenu){this.elLink=this.el;var e=f.ulId?Ext.get(f.ulId):this.el.next();var c=e.wrap({tag:"li"});c.createChild({tag:"a",style:"display:none"},e);this.el=c.wrap({tag:"ul"})}this.initMarkup();this.initEvents();this.setCurrent()},initMarkup:function(){this.container=this.el.wrap({cls:"ux-menu-container",style:"z-index: "+ --Ext.ux.Menu.zSeed+";width:100px;"});this.items=this.el.select("li");this.el.addClass("ux-menu ux-menu-"+this.direction);this.el.select("ul").setStyle("display","");this.el.select(">li").addClass("ux-menu-item-main");this.el.select("li:has(>ul)").addClass("ux-menu-item-parent").each(function(c){c.down("a").addClass("ux-menu-link-parent").createChild({tag:"span",cls:"ux-menu-arrow"})});this.el.select("li:first-child>a").addClass("ux-menu-link-first");this.el.select("li:last-child>a").addClass("ux-menu-link-last");this.container.addClass("ux-menu-clearfix");if(this.autoWidth){this.doAutoWidth()}var b=this.el.select("ul");b.addClass("ux-menu-sub");if(Ext.isBorderBox||Ext.isIE7){b.each(function(c){c.parent().createChild({tag:"iframe",cls:"ux-menu-ie-iframe"}).setWidth(c.getWidth()).setHeight(c.getHeight())})}b.addClass("ux-menu-hidden")},initEvents:function(){this.showTask=new Ext.util.DelayedTask(this.showMenu,this);this.hideTask=new Ext.util.DelayedTask(function(){this.showTask.cancel();this.hideAll();this.fireEvent("hide")},this);this.el.hover(function(){this.hideTask.cancel()},function(){this.hideTask.delay(this.delay*1000)},this);this.el.select("li.ux-menu-item-parent").on("mouseenter",this.onParentEnter,false,{me:this,delay:5});if(this.elLink){this.elLink.on("mouseenter",this.onParentEnter,false,{me:this,delay:5});this.elLink.hover(function(){this.hideTask.cancel()},function(){this.hideTask.delay(this.delay*1000)},this)}this.el.on("mouseover",function(c,b){this.manageSiblings(b);if(!Ext.fly(b).hasClass("ux-menu-item-parent")){this.showTask.cancel()}},this,{delegate:"li"});this.el.on("click",function(c,b){return this.fireEvent("click",c,b,this)},this,{delegate:"a"})},onParentEnter:function(j,h,k){var f=Ext.get(this),e=k.me;var b=f.parent("ul");if(!b||!(b.hasClass("ux-menu")||b.hasClass("ux-menu-sub"))){if(e.ulId&&e.elLink.dom.tagName=="A"){e.container.setXY([e.elLink.getLeft(),e.elLink.getBottom()])}else{e.container.setXY(j.xy)}f=e.el.child("li")}if(!f.hasClass("ux-menu-item-main")&&f.parent("ul").hasActiveFx()){f.parent("ul").stopFx(true)}var m=f.child("ul");if(!m||!m.hasClass("ux-menu-hidden")){return}e.showTask.delay(e.delay*1000,false,false,[f])},showMenu:function(c){try{var h=c.child("ul"),b=y=0;c.select(">a").addClass("ux-menu-link-hover");if(this.direction=="horizontal"&&c.hasClass("ux-menu-item-main")){y=c.getHeight()+1}else{b=c.getWidth()+1}if(Ext.isIE){h.select("ul").addClass("ux-menu-hidden");if(Ext.isBorderBox||Ext.isIE7){c.down("iframe").setStyle({left:b+"px",top:y+"px",display:"block"})}}h.setStyle({left:b+"px",top:y+"px"}).removeClass("ux-menu-hidden");if(this.animate){switch(this.transitionType){case"slide":if(this.direction=="horizontal"&&c.hasClass("ux-menu-item-main")){h.slideIn("t",{duration:this.transitionDuration})}else{h.slideIn("l",{duration:this.transitionDuration})}break;default:h.setOpacity(0.001).fadeIn({duration:this.transitionDuration});break}}this.fireEvent("show",c,h,this)}catch(f){}},manageSiblings:function(b){var b=Ext.get(b);b.parent().select("li.ux-menu-item-parent").each(function(c){if(c.dom.id!==b.dom.id){c.select(">a").removeClass("ux-menu-link-hover");c.select("ul").stopFx(false).addClass("ux-menu-hidden");if(Ext.isBorderBox||Ext.isIE7){c.select("iframe").setStyle("display","none")}}})},hideAll:function(){this.manageSiblings(this.el)},setCurrent:function(){var b=this.el.query("."+this.currentClass);if(!b.length){return}var c=Ext.get(b[b.length-1]).removeClass(this.currentClass).findParent("li",null,true);while(c&&c.parent(".ux-menu")){c.down("a").addClass(this.currentClass);c=c.parent("li")}},doAutoWidth:function(){var b=function(e){var f=0;var c=e.select(">li");e.setStyle({width:3000+"px"});c.each(function(h){f=Math.max(f,h.getWidth())});f=Ext.isIE?f+1:f;c.setWidth(f+"px");e.setWidth(f+"px")};if(this.direction=="vertical"){this.container.select("ul").each(b)}else{this.el.select("ul").each(b)}}});Ext.ux.Menu.zSeed=10000;Ext.ux.TabPanelSkin=Ext.extend(Ext.TabPanel,{width:500,tabsBgCls:undefined,tabBtnCls:undefined,tabsTitle:undefined,tabsTitleCls:undefined,onRender:function(h,b){this.autoWidth=false;if(this.container){var e=this.container.getWidth();if(e){this.width=e}}if(this.tabBtnCls){this.itemTpl=new Ext.XTemplate('<li class="{cls}" id="{id}" style="overflow:hidden">','<a class="x-tab-right-empty" href="#" onclick="return false;">','<em class="x-tab-left-empty">','<span class="x-tab-strip-inner ',this.tabBtnCls,'">','<span class="x-tab-strip-text {iconCls}">{text} {extra}</span>',"</span>","</em>","</a>","</li>")}Ext.ux.TabPanelSkin.superclass.onRender.call(this,h,b);var j=this.header.child(".x-tab-strip-wrap"),f=j.child("ul");if(this.tabsBgCls){j.addClass(this.tabsBgCls);f.addClass("remove-background")}if(this.tabBtnCls){if(f.child(".x-tab-strip-inner")){f.child(".x-tab-strip-inner").addClass(this.tabBtnCls)}j.child(".x-tab-strip-top").addClass("remove-border")}if(this.tabsTitleCls){if(Ext.isIE&&!Ext.isIE8){j.child(".x-tab-strip-top").setStyle("width","auto");var c=j.child("ul").wrap({tag:"div"});c.setStyle("width","5000px");c.createChild({tag:"div",cls:this.tabsTitleCls,html:this.tabsTitle},j.child("ul"))}else{j.createChild({tag:"div",cls:this.tabsTitleCls,html:this.tabsTitle},j.child("ul"))}this.header.child(".x-tab-strip-spacer").setStyle("display","none")}}});Ext.ux.GroupTab=Ext.extend(Ext.Container,{mainItem:0,expanded:true,deferredRender:true,activeTab:null,idDelimiter:"__",headerAsText:false,frame:false,hideBorders:true,initComponent:function(b){Ext.apply(this,b);this.frame=false;Ext.ux.GroupTab.superclass.initComponent.call(this);this.addEvents("activate","deactivate","changemainitem","beforetabchange","tabchange");this.setLayout(new Ext.layout.CardLayout({deferredRender:this.deferredRender}));if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems();this.on("beforerender",function(){this.groupEl=this.ownerCt.getGroupEl(this)},this);this.on("add",this.onAdd,this,{target:this});this.on("remove",this.onItemRemove,this,{target:this});if(this.mainItem!==undefined){var c=(typeof this.mainItem=="object")?this.mainItem:this.items.get(this.mainItem);delete this.mainItem;this.setMainItem(c)}},setActiveTab:function(e){e=this.getComponent(e);if(!e){return false}if(!this.rendered){this.activeTab=e;return true}if(this.activeTab!=e&&this.fireEvent("beforetabchange",this,e,this.activeTab)!==false){if(this.activeTab&&this.activeTab!=this.mainItem){var b=this.getTabEl(this.activeTab);if(b){Ext.fly(b).removeClass("x-grouptabs-strip-active")}}var c=this.getTabEl(e);Ext.fly(c).addClass("x-grouptabs-strip-active");this.activeTab=e;this.stack.add(e);this.layout.setActiveItem(e);if(this.layoutOnTabChange&&e.doLayout){e.doLayout()}if(this.scrolling){this.scrollToTab(e,this.animScroll)}this.fireEvent("tabchange",this,e);return true}return false},getTabEl:function(b){if(b==this.mainItem){return this.groupEl}return Ext.TabPanel.prototype.getTabEl.call(this,b)},onRender:function(c,b){Ext.ux.GroupTab.superclass.onRender.call(this,c,b);this.strip=Ext.fly(this.groupEl).createChild({tag:"ul",cls:"x-grouptabs-sub"});this.tooltip=new Ext.ToolTip({target:this.groupEl,delegate:"a.x-grouptabs-text",trackMouse:true,renderTo:document.body,listeners:{beforeshow:function(h){var f=(h.triggerElement.parentNode===this.mainItem.tabEl)?this.mainItem:this.findById(h.triggerElement.parentNode.id.split(this.idDelimiter)[1]);if(!f.tabTip){return false}h.body.dom.innerHTML=f.tabTip},scope:this}});if(!this.itemTpl){var e=new Ext.Template('<li class="{cls}" id="{id}">','<a onclick="return false;" class="x-grouptabs-text {iconCls}">{text}</a>',"</li>");e.disableFormats=true;e.compile();Ext.ux.GroupTab.prototype.itemTpl=e}this.items.each(this.initTab,this)},afterRender:function(){Ext.ux.GroupTab.superclass.afterRender.call(this);if(this.activeTab!==undefined){var b=(typeof this.activeTab=="object")?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(b)}},initTab:function(e,b){var f=this.strip.dom.childNodes[b];var h=Ext.TabPanel.prototype.getTemplateArgs.call(this,e);if(e===this.mainItem){e.tabEl=this.groupEl;h.cls+=" x-grouptabs-main-item"}var c=f?this.itemTpl.insertBefore(f,h):this.itemTpl.append(this.strip,h);e.tabEl=e.tabEl||c;e.on("disable",this.onItemDisabled,this);e.on("enable",this.onItemEnabled,this);e.on("titlechange",this.onItemTitleChanged,this);e.on("iconchange",this.onItemIconChanged,this);e.on("beforeshow",this.onBeforeShowItem,this)},setMainItem:function(b){b=this.getComponent(b);if(!b||this.fireEvent("changemainitem",this,b,this.mainItem)===false){return}this.mainItem=b},getMainItem:function(){return this.mainItem||null},onBeforeShowItem:function(b){if(b!=this.activeTab){this.setActiveTab(b);return false}},onAdd:function(b,e,c){if(this.rendered){this.initTab.call(this,e,c)}},onItemRemove:function(e,c){Ext.destroy(Ext.get(this.getTabEl(c)));this.stack.remove(c);c.un("disable",this.onItemDisabled,this);c.un("enable",this.onItemEnabled,this);c.un("titlechange",this.onItemTitleChanged,this);c.un("iconchange",this.onItemIconChanged,this);c.un("beforeshow",this.onBeforeShowItem,this);if(c==this.activeTab){var b=this.stack.next();if(b){this.setActiveTab(b)}else{if(this.items.getCount()>0){this.setActiveTab(0)}else{this.activeTab=null}}}},onBeforeAdd:function(c){var b=c.events?(this.items.containsKey(c.getItemId())?c:null):this.items.get(c);if(b){this.setActiveTab(c);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var e=c.elements;c.elements=e?e.replace(",header",""):e;c.border=(c.border===true)},onItemDisabled:Ext.TabPanel.prototype.onItemDisabled,onItemEnabled:Ext.TabPanel.prototype.onItemEnabled,onItemTitleChanged:function(c){var b=this.getTabEl(c);if(b){Ext.fly(b).child("a.x-grouptabs-text",true).innerHTML=c.title}},onItemIconChanged:function(f,b,e){var c=this.getTabEl(f);if(c){Ext.fly(c).child("a.x-grouptabs-text").replaceClass(e,b)}},beforeDestroy:function(){Ext.TabPanel.prototype.beforeDestroy.call(this);this.tooltip.destroy()}});Ext.reg("grouptab",Ext.ux.GroupTab);Ext.ns("Ext.ux");Ext.ux.GroupTabPanel=Ext.extend(Ext.TabPanel,{tabPosition:"left",alternateColor:false,alternateCls:"x-grouptabs-panel-alt",defaultType:"grouptab",deferredRender:false,activeGroup:null,hideExpandIcon:false,tabWidth:null,autoHeight:true,initComponent:function(){Ext.ux.GroupTabPanel.superclass.initComponent.call(this);this.addEvents("beforegroupchange","groupchange");this.elements="body,header";this.stripTarget="header";this.tabPosition=this.tabPosition=="right"?"right":"left";this.addClass("x-grouptabs-panel");if(this.tabStyle&&this.tabStyle!=""){this.addClass("x-grouptabs-panel-"+this.tabStyle)}if(this.alternateColor){this.addClass(this.alternateCls)}this.on("beforeadd",function(c,e,b){this.initGroup(e,b)});this.items.each(function(b){b.on("beforetabchange",function(c,f,e){this.fireEvent("beforetabchange",this,f,e)},this);b.on("tabchange",function(c){this.fireEvent("tabchange",this,c.activeTab)},this)},this)},initEvents:function(){this.mon(this.strip,"mousedown",this.onStripMouseDown,this)},onRender:function(e,b){Ext.TabPanel.superclass.onRender.call(this,e,b);if(this.plain){var j=this.tabPosition=="top"?"header":"footer";this[j].addClass("x-tab-panel-"+j+"-plain")}var c=this[this.stripTarget];this.stripWrap=c.createChild({cls:"x-tab-strip-wrap ",cn:{tag:"ul",cls:"x-grouptabs-strip x-grouptabs-tab-strip-"+this.tabPosition+" "+(this.hideExpandIcon?"hideExpandIcon":"showExpandIcon")}});var h=(this.tabPosition=="bottom"?this.stripWrap:null);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.header.addClass("x-grouptabs-panel-header");this.bwrap.addClass("x-grouptabs-bwrap");this.body.addClass("x-tab-panel-body-"+this.tabPosition+" x-grouptabs-panel-body");if(!this.groupTpl){var f=new Ext.Template('<li class="{cls}" id="{id}">',this.hideExpandIcon?"":'<a class="x-grouptabs-expand" onclick="return false;"></a>','<a class="x-grouptabs-text {iconCls}" href="#" onclick="return false;">',"<span>{text}</span></a>","</li>");f.disableFormats=true;f.compile();Ext.ux.GroupTabPanel.prototype.groupTpl=f}this.items.each(this.initGroup,this)},afterRender:function(){Ext.ux.GroupTabPanel.superclass.afterRender.call(this);this.tabJoint=Ext.fly(this.body.dom.parentNode).createChild({cls:"x-tab-joint"});this.addClass("x-tab-panel-"+this.tabPosition);this.header.setWidth(this.tabWidth);if(this.activeGroup!==undefined){var b=(typeof this.activeGroup=="object")?this.activeGroup:this.items.get(this.activeGroup);delete this.activeGroup;this.setActiveGroup(b);b.setActiveTab(b.getMainItem())}},getGroupEl:Ext.TabPanel.prototype.getTabEl,findTargets:function(f){var c=null,b=f.getTarget("li",this.strip);if(b){c=this.findById(b.id.split(this.idDelimiter)[1]);if(c.disabled){return{expand:null,item:null,el:null}}}return{expand:f.getTarget(".x-grouptabs-expand",this.strip),isGroup:!f.getTarget("ul.x-grouptabs-sub",this.strip),item:c,el:b}},onStripMouseDown:function(c){if(c.button!=0){return}c.preventDefault();var b=this.findTargets(c);if(b.expand){this.toggleGroup(b.el)}else{if(b.item){if(b.isGroup){b.item.setActiveTab(b.item.getMainItem())}else{b.item.ownerCt.setActiveTab(b.item)}}}},expandGroup:function(b){if(b.isXType){b=this.getGroupEl(b)}Ext.fly(b).addClass("x-grouptabs-expanded");this.syncTabJoint()},toggleGroup:function(b){if(b.isXType){b=this.getGroupEl(b)}Ext.fly(b).toggleClass("x-grouptabs-expanded");this.syncTabJoint()},collapseGroup:function(b){if(b.isXType){b=this.getGroupEl(b)}Ext.fly(b).removeClass("x-grouptabs-expanded");this.syncTabJoint()},syncTabJoint:function(c){if(!this.tabJoint){return}c=c||this.getGroupEl(this.activeGroup);if(c){this.tabJoint.setHeight(Ext.fly(c).getHeight()-2);var b=Ext.isGecko2?0:1;if(this.tabPosition=="left"){this.tabJoint.alignTo(c,"tl-tr",[-2,b])}else{this.tabJoint.alignTo(c,"tr-tl",[1,b])}}else{this.tabJoint.hide()}},getActiveTab:function(){if(!this.activeGroup){return null}return this.activeGroup.getTabEl(this.activeGroup.activeTab)||null},onResize:function(){Ext.ux.GroupTabPanel.superclass.onResize.apply(this,arguments);this.syncTabJoint()},createCorner:function(b,c){return Ext.fly(b).createChild({cls:"x-grouptabs-corner x-grouptabs-corner-"+c})},initGroup:function(j,c){var f=this.strip.dom.childNodes[c],h=this.getTemplateArgs(j);if(c===0){h.cls+=" x-tab-first"}h.cls+=" x-grouptabs-main";h.text=j.getMainItem().title;var e=f?this.groupTpl.insertBefore(f,h):this.groupTpl.append(this.strip,h),b=this.createCorner(e,"top-"+this.tabPosition),k=this.createCorner(e,"bottom-"+this.tabPosition);j.tabEl=e;if(j.expanded){this.expandGroup(e)}if(Ext.isIE6||(Ext.isIE&&!Ext.isStrict)){k.setLeft("-10px");k.setBottom("-5px");b.setLeft("-10px");b.setTop("-5px")}this.mon(j,{scope:this,changemainitem:this.onGroupChangeMainItem,beforetabchange:this.onGroupBeforeTabChange})},setActiveGroup:function(c){c=this.getComponent(c);if(!c){return false}if(!this.rendered){this.activeGroup=c;return true}if(this.activeGroup!=c&&this.fireEvent("beforegroupchange",this,c,this.activeGroup)!==false){if(this.activeGroup){this.activeGroup.activeTab=null;var b=this.getGroupEl(this.activeGroup);if(b){Ext.fly(b).removeClass("x-grouptabs-strip-active")}}var e=this.getGroupEl(c);Ext.fly(e).addClass("x-grouptabs-strip-active");this.activeGroup=c;this.stack.add(c);this.layout.setActiveItem(c);this.syncTabJoint(e);this.fireEvent("groupchange",this,c);return true}return false},onGroupBeforeTabChange:function(b,e,c){if(b!==this.activeGroup||e!==c){this.strip.select(".x-grouptabs-sub > li.x-grouptabs-strip-active",true).removeClass("x-grouptabs-strip-active")}this.expandGroup(this.getGroupEl(b));if(b!==this.activeGroup){return this.setActiveGroup(b)}},getFrameHeight:function(){var b=this.el.getFrameWidth("tb");b+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);return b},adjustBodyWidth:function(b){return b-this.tabWidth}});Ext.reg("grouptabpanel",Ext.ux.GroupTabPanel);Ext.namespace("Ext.ux");Ext.ux.Image=Ext.extend(Ext.BoxComponent,{src:Ext.BLANK_IMAGE_URL,autoEl:{tag:"img",cls:"tng-managed-image",src:Ext.BLANK_IMAGE_URL},initComponent:function(){Ext.ux.Image.superclass.initComponent.apply(this,arguments)},onRender:function(){Ext.ux.Image.superclass.onRender.apply(this,arguments);if(!Ext.isEmpty(this.src)&&(this.src!==Ext.BLANK_IMAGE_URL)){this.setSrc(this.src)}this.relayEvents(this.el,["click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","keypress","keydown","keyup"])},setSrc:function(b){this.el.dom.src=b}});Ext.reg("image",Ext.ux.Image);Ext.ns("ExtX.Jemplate.Container");ExtX.Jemplate.Container=Ext.extend(Object,{host:null,jemplate:null,data:null,constructor:function(b){Ext.apply(this,b||{});this.jemplate=this.jemplate.replace(/(\.HTML)?$/,".HTML").toUpperCase()},init:function(b){this.host=b;b.onRender=b.onRender.createSequence(this.onRender.createDelegate(this));b.refresh=this.refresh.createDelegate(this)},onRender:function(){var b=this.host;b.el.update(Jemplate.process(this.jemplate,this.data))},refresh:function(c){var b=this.host;b.el.update(Jemplate.process(this.jemplate,c))}});Ext.preg("ExtX.Jemplate.Container",ExtX.Jemplate.Container);Ext.ns("ExtX.List");ExtX.List.GroupedView=Ext.extend(Ext.list.ListView,{autoHeight:true,autoWidth:true,groupConfigs:null,tpl:true,rowsTemplate:new Ext.XTemplate('<tpl for="rows">',"<dl>",'<tpl for="parent.columns">','<tpl if="!values.hidden">','<dt style="width:{[values.widthPx ? values.widthPx+"px" : ""]};text-align:{align};">','<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',"{[ values.renderer ? values.renderer.call(values.scope || window, parent._record.get(values.dataIndex), parent._record) : values.tpl.apply(parent) ]}","</em></dt>","</tpl>","</tpl>",'<div class="x-clear"></div>',"</dl>","</tpl>"),initComponent:function(){this.columns=this.columns||[];if(this.columns.length){this.reCalculateColumnsWidths()}ExtX.List.GroupedView.superclass.initComponent.call(this);this.addEvents("afterlayout","afterlayout-buffered");this.groupConfigs=this.groupConfigs||{};this.on("afterlayout-buffered",this.onBufferedLayout,this,{buffer:25})},doLayout:function(){this.fireEvent("afterlayout-buffered")},onBufferedLayout:function(){this.fireEvent("afterlayout",this)},getGroupContent:function(k,j){var c=k.field;var f="";if(c){Ext.each(k.groups,function(p){f+=this.getGroupContent(p,k)},this)}else{f=this.rowsTemplate.apply(this.collectData(k.rows))}var b=this.groupConfigs[j.field]||{};var m=b.headerTemplate||new Ext.XTemplate("Group on: "+j.field);if(!(m instanceof Ext.XTemplate)){m=new Ext.XTemplate(m)}var e=b.headerClass;var n=k.typicalRecord;var h=['<div class="x-listgrid-group" recordId="'+n.id+'">','<div class="x-listgrid-group-hd '+(e?e:"")+'">',m.apply({typicalRecord:n}),"</div>",'<div class="x-listgrid-group-body">',f,"</div>","</div>"];return h.join("")},getGroupBody:function(e){var c=e.field;if(!c){return this.rowsTemplate.apply(this.collectData(e.rows))}var b="";Ext.each(e.groups,function(f){b+=this.getGroupContent(f,e)},this);return b},getHTML:function(){var b=this.store.getGroup();return this.getGroupBody(b)},refresh:function(){this.clearSelections(false,true);var c=this.getTemplateTarget();c.update("");var b=this.store.getRange();if(b.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){c.update(this.emptyText)}this.all.clear()}else{c.update(this.getHTML());this.all.fill(Ext.query(this.itemSelector,c.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},reCalculateColumnsWidths:function(){var c=this.columns;var e=0;var b=0;Ext.each(c,function(j,h){if(j.hidden){return}if(j.widthPx&&!j.autoWidth){b+=j.widthPx}if(j.autoWidth){e++}});if(e){var f=(this.maxWidth-b)/e;Ext.each(c,function(j,h){if(j.hidden){return}if(j.autoWidth){j.widthPx=f}})}},getColumnForDataIndex:function(c){var b;Ext.each(this.columns,function(f,e){if(f.dataIndex==c){b=f;return false}});return b}});Ext.reg("ExtX.List.GroupedView",ExtX.List.GroupedView);Ext.ns("ExtX.List.View");ExtX.List.View.RowPopup=Ext.extend(Ext.Panel,{baseCls:"x-frameless",autoHide:false,floating:true,shim:false,shadow:!Ext.isIE6,autoHeight:true,showDuration:0.25,border:false,marginLeft:0,isShown:false,isShowCalled:false,autoEventsHide:null,target:null,client:null,constructor:function(b){ExtX.List.View.RowPopup.superclass.constructor.apply(this,arguments);this.target=Ext.get(this.target)},show:function(){if(this.isShowCalled){return devThrow("Can't re-use ExtX.List.View.RowPopup")}this.isShowCalled=true;if(!this.rendered){this.render(this.target);this.doLayout()}var b=this.el;b.disableShadow();var c=this.client.getContentTarget().getBox().bottom-this.target.getBox().bottom;var f=this.el.getBox().height>c;var e=this.target.getBox().y-this.client.getContentTarget().getBox().y;var h=this.el.getBox().height>e;if(!h&&f){this.slideAlign="b";b.alignTo(this.target,"bl-tl",[this.marginLeft+1,-1]);if(b.shadow){b.shadow.adjusts.t=-3;b.shadow.adjusts.h=3}}else{this.slideAlign="t";b.alignTo(this.target,"tl-bl",[this.marginLeft+1,-1]);if(b.shadow){b.shadow.adjusts.t=0;b.shadow.adjusts.h=3}}b.slideIn(this.slideAlign,{duration:this.showDuration,callback:this.onAfterShow,scope:this})},onAfterShow:function(){this.isShown=true;if(!(Ext.isIE6||Ext.isIE7)){this.el.enableShadow(true)}this.setHeight("auto");this.setWidth("auto");if(this.autoEventsHide){Ext.each(this.autoEventsHide,function(b){Ext.getBody().on(b,this.checkForMouseout,this)},this)}},checkForMouseout:function(b){if(b.within(this.target)||b.target==this.target.dom||b.target==this.el.dom||b.within(this.el)){return}if(this.el.withinBox(b.xy,5)){return}this.hide()},hide:function(c,b){if(!this.isShown){this.destroy();if(c){c.call(b||window)}return}if(this.autoEventsHide){Ext.each(this.autoEventsHide,function(e){Ext.getBody().un(e,this.checkForMouseout,this)},this)}this.el.disableShadow();this.fireEvent("beforedestroy",this);this.el.slideOut(this.slideAlign,{remove:false,duration:this.showDuration,callback:function(){this.destroy();if(c){c.call(b||window)}},scope:this})},afterHide:function(c,b){}});Ext.reg("ExtX.List.View.RowPopup",ExtX.List.View.RowPopup);Ext.namespace("Ext.ux");Ext.ux.MultiSelectTextField=function(b){this.values=[];this.displayValues=[];this.hiddenFields=[];Ext.ux.MultiSelectTextField.superclass.constructor.call(this,b)};Ext.extend(Ext.ux.MultiSelectTextField,Ext.form.ComboBox,{hideTrigger:true,values:[],displayValues:[],hiddenFields:[],delimiter:",",fixedWidth:0,rightAlignValue:false,initValue:function(){if(!this.ranInitValue){this.ranInitValue=true;if(this.value!==undefined){this.setValue(this.value)}this.originalValue=this.getValue()}},getValue:function(){var b="";if(!this.fixedWidth){b=this.values.join(this.delimiter)}else{for(var c=0;c<this.values.length;c++){b+=(this.rightAlignValue?this.padLeft(this.values[c],this.fixedWidth):this.padRight(this.values[c],this.fixedWidth))}}return b},addValue:function(b,j){var c=this.valueField?this.findRecord(this.valueField,b):this.store.getById(b);if(!c){return}var f=this.valueField?c.data[this.valueField]:c.id;var h=c.data[this.displayField];if(this.values.indexOf(f)==-1){var e=this.el.insertSibling({tag:"input",type:"hidden",value:f,name:(this.hiddenName||this.name)},"before",true);this.values.push(f);this.displayValues.push(h);this.hiddenFields.push(e)}if(!j){this.updateDisplay()}},removeValue:function(c,j){var e=this.valueField?this.findRecord(this.valueField,c):this.store.getById(c);if(!e){return}var f=this.valueField?e.data[this.valueField]:e.id;var h=e.data[this.displayField];var b=this.values.indexOf(f);if(b==-1){return}this.removeItemAtIndex(b);if(!j){this.updateDisplay()}},removeItemAtIndex:function(b,e){var c=Ext.get(this.hiddenFields[b]);c.remove();this.values[b]=null;this.displayValues[b]=null;this.hiddenFields[b]=null;if(!e){this.cleanData()}},cleanData:function(){this.values=this.cleanArray(this.values);this.displayValues=this.cleanArray(this.displayValues);this.hiddenFields=this.cleanArray(this.hiddenFields)},cleanArray:function(c){var f=[];var b=c.length;for(var e=0;e<b;e++){if(c[e]){f.push(c[e])}}return f},setValue:function(e){this.clearValue();if(!(e instanceof Array)){if(!this.fixedWidth){e=e.split(this.delimiter)}else{var c=[];for(var f=0;f<e.length;f+=this.fixedWidth){c.push(e.substr(f,this.fixedWidth).trim())}e=c}}var b=e.length;for(var f=0;f<b;f++){this.addValue(e[f],true)}this.updateDisplay()},onBlur:function(){this.updateDisplay();Ext.form.ComboBox.superclass.onBlur.call(this)},updateDisplay:function(){var b=this.displayValues.join(", ");if(b.trim()!==""){b+=", "}Ext.form.ComboBox.superclass.setValue.call(this,b)},clearValue:function(){this.values=[];this.displayValues=[];var b=this.hiddenFields.length;for(var c=0;c<b;c++){if(this.hiddenFields[c].remove){Ext.fly(this.hiddenFields[c]).remove()}}this.hiddenFields=[];this.setRawValue("");this.lastSelectionText="";this.applyEmptyText()},onSelect:function(b,c){if(this.fireEvent("beforeselect",this,b,c)!==false){this.addValue(b.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,b,c)}},onRender:function(c,b){Ext.form.ComboBox.superclass.onRender.call(this,c,b);this.el.dom.removeAttribute("name");if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}if(!this.editable){this.editable=true;this.setEditable(false)}},getLastValue:function(){var b=this.getRawValue().split(",");return b[b.length-1].trim()},onTriggerClick:function(){if(this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getLastValue())}this.el.focus()}},initQuery:function(){var b=this.getLastValue();if(b.trim()!==""){this.doQuery(b)}this.removeOld()},removeOld:function(){var j=this.getRawValue();var b=this.displayValues.length;var c=this.displayValues.slice().sort(function(k,m){return m.length-k.length});var f=false;for(var e=0;e<b;e++){var h=c[e];if(j.indexOf(h)==-1){f=true;this.removeItemAtIndex(this.displayValues.indexOf(h),true)}}if(f){this.cleanData();this.updateDisplay()}},fieldParts:function(){var e=this.getRawValue().split(",");var b=e.length;for(var c=0;c<b;c++){e[c]=e[c].trim()}return e},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(!this.selectByValue(this.value,true)){this.select(0,true)}}else{this.selectNext();if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.onEmptyResults()}},validateValue:function(b){if(this.values.length===0&&!this.allowBlank){this.markInvalid(this.blankText);return false}if(this.values.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false}if(this.values.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}return true},padLeft:function(e,c,j){e=(!e?"":String(e.trim()));j=(!j?" ":String(j));var b=e.length;var h=c-b;for(var f=0;f<h;f++){e=j+e}e=e.substr(0,c);return e},padRight:function(c,b,e){c=(!c?"":String(c.trim()));if(!e||typeof(b)=="undefined"||!(b>1)){e=" "}else{e=String(e)}for(;c.length<b;c+=e){}c=c.substr(0,b);return c}});Ext.reg("multitextfield",Ext.ux.MultiSelectTextField);Ext.ux.MultiSelectPopupField=Ext.extend(Ext.ux.MultiSelectTextField,{popupNoFrame:false,popupHideTitle:false,hideTrigger:false,getValues:function(){return this.values},hasValue:function(b){return(this.values.indexOf(b)!==-1)},onTriggerClick:function(){this.collapse();if(!this.gridPanel){this.createGrid()}else{this.store.clearFilter(true);this.gridStore.fireEvent("datachanged",this.gridStore)}if(this.popup.el.isVisible()){this.hidePopup()}else{this.popup.show();this.popup.el.alignTo(this.el,this.popupAlignTo||"bl");this.gridPanel.view.scroller.dom.scrollTop=0;Ext.getDoc().on("mousedown",this.onBodyMousedown,this)}},createGrid:function(){this.fields=this.store.recordType.prototype.fields;this.fieldCount=this.fields.length;if(!this.minItemsForSnake){this.minItemsForSnake=10}this.store.clearFilter();if(this.store.getCount()<this.minItemsForSnake){this.columnCount=1}else{if(!this.columnCount){this.columnCount=3}}if(!this.colModel){this.colModel=[];for(var b=0;b<this.fieldCount;b++){this.colModel.push({width:this.itemsWidth||100,dataIndex:this.fields.keys[b]})}this.colModel=new Ext.grid.ColumnModel(this.colModel)}else{if(Ext.isArray(this.colModel)){this.colModel=new Ext.grid.ColumnModel(this.colModel)}}this.colModel.config[0].renderer=this.firstCellRenderer.createDelegate(this);this.dataColumns=this.colModel.getColumnCount();if(this.categoryField){this.gridStore=this.categorizeStore()}else{if(this.store.getCount()>this.minItemsForSnake){this.gridStore=this.convertStore();this.colModel=this.convertColumnModel()}else{this.gridStore=this.store}}var e=new Ext.grid.RowSelectionModel({listeners:{beforerowselect:function(){return false}}});this.gridPanel=new Ext.grid.GridPanel({stateful:false,stripeRows:false,border:false,ds:this.gridStore,cm:this.colModel,sm:e,listeners:{cellClick:this.toggleSelection,scope:this}});var c={stateful:false,closeAction:"hide",hidden:true,width:this.popupWidth||Math.min(Ext.getBody().getViewSize().width,this.colModel.getTotalWidth()+40),height:this.popupHeight||300,renderTo:Ext.getBody(),layout:"fit",items:this.gridPanel,listeners:{hide:this.onPopupHide,scope:this}};if(!this.popupHideTitle){c.title=this.popupTitle||"Choose one or more"}this.popup=(!this.popupNoFrame?new Ext.Window(c):new Ext.Panel(c));if(!this.categoryField){this.gridPanel.el.addClass("multiselect-popup")}},convertStore:function(){var p=this.store.getCount();var q=Math.floor((p+(this.columnCount-1))/this.columnCount);var r=[];for(var h=0;h<q;h++){var b=[];var n=[];for(var e=0,f=h;e<this.columnCount&&f<p;e++){n.push(f);b=b.concat(this.store.getAt(f).json);f+=q}b.linearIndices=n;r.push(b)}var m=[];for(var h=0;h<this.columnCount;h++){for(var f=0;f<this.fields.length;f++){m.push(this.fields.keys[f]+"-col-"+h)}}return new Ext.data.SimpleStore({fields:m,data:r})},convertColumnModel:function(){if(Ext.isArray(this.colModel)){var f=[];for(var c=0;c<this.columnCount;c++){for(var b=0;b<this.colModel.length;b++){var e=this.colModel[b].dataIndex;if(typeof e=="undefined"){e=this.fields.keys[b]}f.push({renderer:this.colModel[b].renderer,width:this.colModel[b].width||100,dataIndex:e+"-col-"+c})}}return new Ext.grid.ColumnModel(f)}else{var f=[];for(var c=0;c<this.columnCount;c++){for(var b=0;b<this.colModel.getColumnCount();b++){e=this.colModel.config[b].dataIndex;if(typeof e=="undefined"){e=this.fields.keys[b]}f.push({renderer:this.colModel.config[b].renderer,width:this.colModel.config[b].width||100,dataIndex:e+"-col-"+c})}}return new Ext.grid.ColumnModel(f)}},categorizeStore:function(){this.categories={};this.categoryNames=[];this.columnCount=0;var r=0;if(!this.displayField){this.valueField=this.displayField}for(var k=0,h=this.store.data.items,c=h.length;k<c;k++){var f=h[k].data;var e=[f[this.displayField]];e.linearIndex=k;var p=f[this.categoryField];if(!this.categories[p]){this.categoryNames.push(p);this.categories[p]=[];this.columnCount++}this.categories[p].push(e);r=Math.max(r,this.categories[p].length)}this.dataColumns=1;var t=[];for(var k=0;k<r;k++){var b=[];var n=[];for(var e=0;e<this.columnCount;e++){var s=this.categories[this.categoryNames[e]];if(typeof(s[k])=="undefined"){s[k]=[""]}b=b.concat(s[k]);n.push(s[k].linearIndex)}b.linearIndices=n;t.push(b)}var m=[];for(var k=0;k<this.columnCount;k++){m.push(this.fields.keys[0]+"-col-"+k)}var q=[];for(var k=0;k<this.columnCount;k++){cmConfig={header:this.categoryNames[k],dataIndex:this.fields.keys[0]+"-col-"+k};cmConfig.renderer=this.firstCellRenderer.createDelegate(this);q.push(cmConfig)}this.colModel=new Ext.grid.ColumnModel(q);return new Ext.data.SimpleStore({fields:m,data:t})},firstCellRenderer:function(f,n,b,e,k,j){this.gridStore.clearFilter(true);var b=this.store.getAt(this.getLinearIndex(e,k));if(!b){return"&#160;"}var m=this.valueField?b.get(this.valueField):b.id;var h=this.hasValue(m)?"checked":"";var c='<input type="checkbox" '+h+' id="'+Ext.id()+'"></input>&#160;';return c+f},getLinearIndex:function(f,e){var c=Math.floor(e/this.dataColumns);var b=this.gridStore.getAt(f).json.linearIndices;return b?b[c]:f},toggleSelection:function(j,m,p,k){var b=Math.floor(p/this.dataColumns);var q=this.gridPanel.view.getCell(m,b*this.dataColumns);var h=Ext.fly(q).child("input[type=checkbox]",true);var f=this.getLinearIndex(m,p);var c=this.store.getAt(f);if(c){var n=this.valueField?c.get(this.valueField):c.id;if(this.hasValue(n)){this.removeValue(n);h.checked=false}else{this.addValue(n);h.checked=true}}},hidePopup:function(){this.popup.hide()},onPopupHide:function(){Ext.getDoc().un("mousedown",this.onBodyMousedown,this)},onBodyMousedown:function(b){if(!b.within(this.popup.el)&&!(b.getTarget()==this.trigger.dom)){this.popup.hide();this.focus(false,1)}}});Ext.reg("multiselectpopup",Ext.ux.MultiSelectPopupField);Ext.ux.MultiGroupingStore=Ext.extend(Ext.data.GroupingStore,{constructor:function(b){Ext.ux.MultiGroupingStore.superclass.constructor.apply(this,arguments)},sortInfo:[],sort:function(m,h){if(!arguments.length){return}var k=[];if(Ext.isArray(m)){for(var j=0,b=m.length;j<b;++j){if(m[j]){var n=typeof m[j]=="string"?m[j]:m[j].field;k.push(this.fields.get(n)||{name:n})}}}else{k.push(this.fields.get(m)||{name:m})}if(k.length<1){return false}if(!h){if(this.sortInfo&&this.sortInfo.length>0&&this.sortInfo[0].field==k[0].name){h=(this.sortToggle[k[0].name]||"ASC").toggle("ASC","DESC")}else{h=k[0].sortDir}}var e=(this.sortToggle)?this.sortToggle[k[0].name]:null;var c=(this.sortInfo)?this.sortInfo:null;this.sortToggle[k[0].name]=h;this.sortInfo=[];for(var j=0,b=k.length;j<b;++j){this.sortInfo.push({field:k[j].name,direction:h})}if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this)}else{if(!this.load(this.lastOptions)){if(e){this.sortToggle[k[0].name]=e}if(c){this.sortInfo=c}}}},setDefaultSort:function(f,c){c=c?c.toUpperCase():"ASC";this.sortInfo=[];if(!Ext.isArray(f)){this.sortInfo.push({field:f,direction:c})}else{for(var e=0,b=f.length;e<b;++e){this.sortInfo.push({field:f[e].field,direction:c});this.sortToggle[f[e]]=c}}},groupBy:function(e,c){if(!c&&this.groupField==e){return}if(this.groupField){for(var f=0;f<this.groupField.length;f++){if(e==this.groupField[f]){return}}this.groupField.push(e)}else{this.groupField=[e]}if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}this.baseParams.groupBy=e}if(this.groupOnSort){this.sort(e);return}if(this.remoteGroup){this.reload()}else{var b=this.sortInfo||[];if(b.field!=e){this.applySort()}else{this.sortData(e)}this.fireEvent("datachanged",this)}},applySort:function(){var c=this.sortInfo;if(c&&c.length>0&&!this.remoteSort){this.sortData(c,c[0].direction)}else{if(!this.groupOnSort&&!this.remoteGroup){var b=this.getGroupState();if(b&&b!=this.sortInfo){this.sortData(this.groupField)}}}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo:undefined):this.groupField},sortData:function(e,k){k=k||"ASC";var c=[];var m;for(var f=0,b=e.length;f<b;++f){m=e[f];var j=this.fields.get(m.field?m.field:m);c.push(j?j.sortType:function(n){return n})}var h=function(r,q){var v=[];var u=[];var t=e.length;var p;var n;for(var s=0;s<t;++s){p=e[s];n=p.field?p.field:p;v.push(c[s](r.data[n]));u.push(c[s](q.data[n]))}var w;for(var s=0;s<t;++s){w=v[s]>u[s]?1:(v[s]<u[s]?-1:0);if(w!=0){return w}}return w};this.data.sort(k,h);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(k,h)}},getGroupOn:function(){var b=this.getGroupState();if(!b){b=[]}else{if(!(b instanceof Array)){b=[b]}}return[].concat(b)},getGroup:function(){return this.createGroup(this.getRange(),this.getGroupOn())},createGroup:function(e,f){var m={typicalRecord:e[0]};var k=m.rows=m.rows||[];var b=m.groups=m.groups||[];if(!f.length){m.rows=k.concat(e);return m}var c=m.field=f.shift();var j;var h;Ext.each(e,function(n,p){if(!p){h=[n];j=n.get(c)}else{if(n.get(c)==j){h.push(n)}else{b.push(this.createGroup(h,f.slice()));h=[n];j=n.get(c)}}if(p==e.length-1){b.push(this.createGroup(h,f.slice()))}},this);return m}});Ext.ux.MultiGroupingView=Ext.extend(Ext.grid.GroupingView,{constructor:function(b){Ext.ux.MultiGroupingView.superclass.constructor.apply(this,arguments);this.on("beforerefresh",function(){if(this.rowsCache){delete rowsCache}},this);this.offscreenRowCache=Ext.getBody().createChild({cls:"x-hide-offsets"},null,true);this.renderCellDefer=0},displayEmptyFields:false,displayFieldSeparator:", ",getMultiGroupId:function(f,j){var e=this.grid.getGridEl().id;var h=this.cm.findColumnIndex(f);var c=this.cm.config[h];var k=c.groupRenderer||c.renderer;var b=this.getGroup(j,{data:{}},k,0,h,this.ds);return e+"-gp-"+f+"-"+Ext.util.Format.htmlEncode(j)},processRows:function(b,e){var c=this.getRows();if(!c.length){return}e=e||!this.grid.stripeRows;b=b||0;Ext.each(c,function(h,f){h.rowIndex=f;h.className=h.className.replace(this.rowClsRe," ");if(!e&&(f+1)%2===0){h.className+=" x-grid3-row-alt"}});if(b===0){Ext.fly(c[0]).addClass(this.firstRowCls)}Ext.fly(c[c.length-1]).addClass(this.lastRowCls)},renderRows:function(){var e=this.getGroupField();var j=!!e;if(this.hideGroupedColumn){var h=[];for(var f=0,c=e.length;f<c;++f){var b=this.cm.findColumnIndex(e[f]);if(b>=0){h.push(b)}}if(!j&&this.lastGroupField!==undefined){this.mainBody.update("");for(var f=0,c=this.lastGroupField.length;f<c;++f){var b=this.cm.findColumnIndex(this.lastGroupField[f]);if(b>=0){this.cm.setHidden(b,false)}else{alert("Unhide Col: "+b)}}delete this.lastGroupField;delete this.lgflen}else{if(j&&h.length>0&&this.lastGroupField===undefined){this.lastGroupField=e;this.lgflen=e.length;for(var f=0,c=h.length;f<c;++f){this.cm.setHidden(h[f],true)}}else{if(j&&this.lastGroupField!==undefined&&(e!==this.lastGroupField||this.lgflen!=this.lastGroupField.length)){this.mainBody.update("");for(var f=0,c=this.lastGroupField.length;f<c;++f){var b=this.cm.findColumnIndex(this.lastGroupField[f]);if(b>=0){this.cm.setHidden(b,false)}}this.lastGroupField=e;this.lgflen=e.length;for(var f=0,c=h.length;f<c;++f){this.cm.setHidden(h[f],true)}}}}}return Ext.ux.MultiGroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(J,M,n,Z,D,P){if(M.length<1){return""}var S=this.getGroupField();var V=S.length;var w=this.grid.getTopToolbar();if(w){for(var ak=0;ak<w.items.length;ak++){Ext.removeNode(Ext.getDom(w.items.itemAt(ak).id))}if(V==0){w.addItem(new Ext.Toolbar.TextItem("Drop Columns Here To Group"))}else{w.addItem(new Ext.Toolbar.TextItem("Grouped By:"));for(var R=0;R<V;R++){var X=S[R];if(R>0){w.addItem(new Ext.Toolbar.Separator())}var aj=new Ext.Toolbar.Button({text:this.cm.lookup[this.cm.findColumnIndex(X)].header});aj.fieldName=X;w.addItem(aj)}}}this.enableGrouping=!!S;if(!this.enableGrouping||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var al="width:"+this.getTotalWidth()+";";var L=this.grid.getGridEl().id;var s=[],f,ad,F,T;var e=[];var ah=0;var C=[];if(this.stylesheet){Ext.util.CSS.removeStyleSheet(L+"-style")}this.stylesheet=Ext.util.CSS.createStyleSheet("div#"+L+" div.x-grid3-row {padding-left:"+(V*12)+"px}div#"+L+" div.x-grid3-header {padding-left:"+(V*12)+"px}",L+"-style");for(var ad=0,F=M.length;ad<F;ad++){ah=0;var c=Z+ad;var Y=M[ad];var W=0;var ai=[];var H;var z;var x=[];var u=[];var U;var N=0;var O=[];for(var ac=0;ac<V;ac++){H=S[ac];var m=this.cm.findColumnIndex(H);var p=this.cm.lookup[m];if(!p){m=this.cm.findColumnIndex(H);break}z=p.header;U=Y.data[H];if(U!==undefined){if(ad==0){O.push({idx:ac,dataIndex:H,header:z,value:U});e[ac]=U;ai.push(U);x.push(H);u.push(z+": "+U)}else{if(e[ac]!=U){O.push({idx:ac,dataIndex:H,header:z,value:U});e[ac]=U;N=1;ai.push(U);x.push(H);u.push(z+": "+U)}else{if(V-1==ac&&N!=1){f.rs.push(Y)}else{if(N==1){O.push({idx:ac,dataIndex:H,header:z,value:U});ai.push(U);x.push(H);u.push(z+": "+U)}else{if(ac<V-1){if(C[H]){C[H].rs.push(Y)}}}}}}}else{if(this.displayEmptyFields){O.push({idx:ac,dataIndex:H,header:z,value:this.emptyGroupText||"(none)"});x.push(H);u.push(z+": ")}}}for(var aa=0;aa<O.length;aa++){var q=O[aa];ag=q.dataIndex;var Q=O[aa].header;T=L+"-gp-"+q.dataIndex+"-"+Ext.util.Format.htmlEncode(q.value);var h=typeof this.state[T]!=="undefined"?!this.state[T]:this.startCollapsed;var E=h?"x-grid-group-collapsed":"";var K=(!n.groupFieldStyles?"":n.groupFieldStyles[q.dataIndex]||"");f={group:q.dataIndex,gvalue:q.value,text:q.header,groupId:T,startRow:c,rs:[Y],cls:E,style:al+"padding-left:"+(q.idx*12)+"px;"+K};C[q.dataIndex]=f;s.push(f);Y._groupId=T}}var G=[];var ab=0;for(var I=0,F=s.length;I<F;I++){ab++;var ag=s[I];var af=ag.group==S[V-1];this.doMultiGroupStart(G,ag,J,n,D);if(ag.rs.length!=0&&af){var ae=Ext.grid.GroupingView.superclass.doRender.call(this,J,ag.rs,n,ag.startRow,D,P);if(typeof ae=="string"){G[G.length]=ae}else{this.offscreenRowCache.innerHTML="";this.offscreenRowCache.appendChild(ae);G[G.length]=this.offscreenRowCache.innerHTML}}if(af){var A;var B=s[I+1];if(B!=null){for(var A=0;A<S.length;A++){if(B.group==S[A]){break}}ab=S.length-A}for(var aa=0;aa<ab;aa++){this.doMultiGroupEnd(G,ag,J,n,D)}ab=A}}return G.join("")},initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var b=this.grid.getSelectionModel();b.on(b.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startMultiGroup){this.startMultiGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">')}this.startMultiGroup.compile();this.endMultiGroup="</div></div>"},doMultiGroupStart:function(b,f,c,h,e){h.groupFieldClasses=h.groupFieldClasses||{};h.groupFieldTemplates=h.groupFieldTemplates||{};h.groupFieldClasses[f.group]=h.groupFieldClasses[f.group]||"x-grid-group-hd";h.groupFieldTemplates[f.group]=h.groupFieldTemplates[f.group]||this.groupTextTpl;if(typeof(h.groupFieldTemplates[f.group])=="string"){h.groupFieldTemplates[f.group]=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="',h.groupFieldClasses[f.group],'" style="{style}"><div class="x-grid-group-title">',h.groupFieldTemplates[f.group],"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">');h.groupFieldTemplates[f.group].compile()}b[b.length]=h.groupFieldTemplates[f.group].apply(f)},doMultiGroupEnd:function(b,f,c,h,e){b[b.length]=this.endMultiGroup},getRows:function(){if(this.rowsCache){f=this.rowsCache.slice(0)}else{if(!this.enableGrouping){return Ext.grid.GroupingView.superclass.getRows.call(this)}var b=this.getGroupField();var f=[];var e,c=this.getGroups();f=this.getRowsFromGroup(f,c,b[b.length-1])}return f},getRowsFromGroup:function(b,e,k){var c=new RegExp(".*-gp-"+k+"-.*");for(var h=0,m=e.length;h<m;h++){var p=e[h].id;if(c.test(p)){g=e[h].childNodes[1].childNodes;for(var f=0,n=g.length;f<n;f++){b[b.length]=g[f]}}else{if(!e[h].childNodes[1]){}else{b=this.getRowsFromGroup(b,e[h].childNodes[1].childNodes,k)}}}return b}});Ext.ux.MultiGroupingPanel=function(b){b=b||{};b.tbar=new Ext.Toolbar({id:"grid-tbr"});Ext.ux.MultiGroupingPanel.superclass.constructor.call(this,b)};Ext.extend(Ext.ux.MultiGroupingPanel,Ext.grid.GridPanel,{initComponent:function(){Ext.ux.MultiGroupingPanel.superclass.initComponent.call(this);this.on("render",this.setUpDragging,this)},setUpDragging:function(){this.dragZone=new Ext.dd.DragZone(this.getTopToolbar().getEl(),{ddGroup:"grid-body",panel:this,scroll:false,onInitDrag:function(b){var c=this.dragData.ddel;c.id=Ext.id("ven");this.proxy.update(c);return true},getDragData:function(c){var b=Ext.get(c.getTarget().id);if(b.hasClass("x-toolbar x-small-editor")){return false}d=c.getTarget().cloneNode(true);d.id=Ext.id();this.dragData={repairXY:Ext.fly(b).getXY(),ddel:d,btn:c.getTarget()};return this.dragData},getRepairXY:function(){return this.dragData.repairXY}});this.dropTarget2s=new Ext.dd.DropTarget("grid-tbr",{ddGroup:"gridHeader"+this.getGridEl().id,panel:this,notifyDrop:function(b,f,c){var h=this.panel.getColumnModel().getDataIndex(this.panel.getView().getCellIndex(c.header));this.panel.store.groupBy(h);return true}});this.dropTarget22s=new Ext.dd.DropTarget(this.getView().el.dom.childNodes[0].childNodes[1],{ddGroup:"grid-body",panel:this,notifyDrop:function(n,m,j){var k=Ext.get(j.btn).dom.innerHTML;var f=this.panel.getTopToolbar();var c=f.items.findIndexBy(function(e){return e.text==k},this);if(c<0){return}var b=f.items.get(c).fieldName;Ext.removeNode(Ext.getDom(f.items.get(c).id));if(c>0){Ext.removeNode(Ext.getDom(f.items.get(c-1).id))}var q=this.panel.view.cm.findColumnIndex(b);this.panel.view.cm.setHidden(q,false);var p=[];for(var h=this.panel.store.groupField.length-1;h>=0;h--){if(this.panel.store.groupField[h]==b){this.panel.store.groupField.pop();break}p.push(this.panel.store.groupField[h]);this.panel.store.groupField.pop()}for(var h=p.length-1;h>=0;h--){this.panel.store.groupField.push(p[h])}if(this.panel.store.groupField.length==0){this.panel.store.groupField=false}this.panel.store.fireEvent("datachanged",this);return true}})}});Ext.ux.PanelBlind=Ext.extend(Ext.Panel,{constructor:function(b){b=Ext.apply({autoHeight:true,floating:true,cls:"x-blind",bodyStyle:{"border-width":"0px"},buttonAlign:"center",buttons:[{text:l("hide"),iconCls:"hide-btn",scale:"large",iconAlign:"left",handler:this.dismiss.createDelegate(this,[])}]},b);Ext.ux.PanelBlind.superclass.constructor.call(this,b)},init:function(b){this.client=b;if(!this.client.blinds){this.client.blinds=new Ext.util.MixedCollection()}b.blinds.add(this);this.client.on({destroy:this.destroy,resize:this.syncSizeWithClient,scope:this})},destroy:function(){this.client.un("destroy",this.destroy,this);this.client.un("resize",this.syncSizeWithClient,this);Ext.ux.PanelBlind.superclass.destroy.apply(this,arguments)},syncSizeWithClient:function(){this.setWidth(this.client.body.getSize(true).width)},show:function(c){var b=(this.useMask?this.client.getEl().mask():undefined);if(c){this.removeRange();this.add(c.items);if(this.rendered){this.doLayout()}}if(!this.rendered){this.render(this.client.getEl());this.doLayout()}if(b){this.el.setZIndex(Number(b.getStyle("z-index"))+1)}this.el.disableShadow();this.syncSizeWithClient();this.el.alignTo(this.client.body,"tl-tl");this.el.slideIn("t",{callback:function(){this.el.visible=true;this.el.enableShadow(true);this.items.each(function(e){if(typeof e.afterShow=="function"){e.afterShow()}})},scope:this})},dismiss:function(c,b){this.items.each(function(e){if(typeof e.beforeDismiss=="function"){e.beforeDismiss()}});this.el.disableShadow();this.el.slideOut("t",{callback:function(){this.client.getEl().unmask();if(this.destroyOnDismiss){delete this.client.blinds[this.id];this.destroy()}if(c){c.call(b||window)}},scope:this})}});Ext.ux.PanPanel=Ext.extend(Ext.Panel,{bodyStyle:{"overflow-y":"auto","overflow-x":"auto"},wheelIncrement:20,constructor:function(b){b.autoHeight=false;b.autoWidth=false;b.autoScroll=false;Ext.ux.PanPanel.superclass.constructor.call(this,b)},onRender:function(){if(this.ownerCt&&this.ownerCt.getInnerHeight){this.ownerCt.on("resize",this.onParentResize,this)}Ext.ux.PanPanel.superclass.onRender.apply(this,arguments);this.onParentResize.defer(10,this);this.el.on("mousedown",this.onMouseDown,this);this.el.on("mousewheel",this.onWheel,this);this.el.setStyle("cursor","move")},onParentResize:function(){if(this.ownerCt&&this.ownerCt.getInnerHeight){this.suspendEvents();this.setHeight(this.ownerCt.getInnerHeight());this.setWidth(this.ownerCt.getInnerWidth());this.resumeEvents()}},onMouseDown:function(b){b.stopEvent();this.mouseX=b.getPageX();this.mouseY=b.getPageY();Ext.getBody().on("mousemove",this.onMouseMove,this);Ext.getDoc().on("mouseup",this.onMouseUp,this)},onWheel:function(h){var j=h.getWheelDelta()*this.wheelIncrement*-1;h.stopEvent();var k=this.body.dom.scrollTop;var f=k+j;var b=this.body.dom.scrollHeight-this.body.dom.clientHeight;var c=Math.max(0,Math.min(b,f));if(c!=k){this.body.dom.scrollTop=c}},onMouseMove:function(h){h.stopEvent();var b=h.getPageX();var j=h.getPageY();if(h.within(this.body)){var f=b-this.mouseX;var c=j-this.mouseY;this.body.dom.scrollLeft-=f;this.body.dom.scrollTop-=c}this.mouseX=b;this.mouseY=j},onMouseUp:function(b){Ext.getBody().un("mousemove",this.onMouseMove,this);Ext.getDoc().un("mouseup",this.onMouseUp,this)}});Ext.reg("panpanel",Ext.ux.PanPanel);(function(){var b={"Ext.Container.prototype.initComponent":Ext.Container.prototype.initComponent,"Ext.Component.prototype.beforeDestroy":Ext.Component.prototype.beforeDestroy};Ext.override(Ext.Component,{beforeDestroy:function(){if(this.__SLOT__){delete this.__COLLECTOR__.slots[this.__SLOT__];delete this.__SLOT__;delete this.__COLLECTOR__;delete this.siblingSlots}b["Ext.Component.prototype.beforeDestroy"].call(this)}});var c=function(){var e=this;var f=function(j){if(j.slot&&j!=e){var k=function(m,n){return Boolean(m.slots)};var h=j.findParentBy(k);if(!h){return}h.slots[j.slot]=j;j.siblingSlots=h.slots;j.__SLOT__=j.slot;j.__COLLECTOR__=h;delete j.slot}};this.cascade(f)};Ext.ns("Ext.ux.reference");Ext.ux.reference.Slot={siblingSlots:undefined,slot:undefined,slots:undefined};Ext.override(Ext.Container,{slot:undefined,siblingSlots:undefined,slots:undefined,initComponent:function(){if(this.slots){this.slots={}}this.addEvents("add");this.on("add",c,this);b["Ext.Container.prototype.initComponent"].call(this)}})})();Ext.ux.RowActionSingle=function(b){Ext.apply(this,b);this.addEvents({beforeaction:true,action:true});if(!this.tpl){this.tpl=new Ext.Template(this.tplCt.replace(/\{items\}/,this.getTpl()))}if(this.autoWidth){this.width=this.widthSlope+this.widthIntercept;this.fixed=true}if(!this.renderer){this.renderer=function(m,e,h,n,k,j,f){e.css+=(e.css?" ":"")+"ux-row-action-cell";var c=this.tpl.apply(this.getData(m,e,h,n,k,j));if(f){Ext.fly(f.parentNode).addClass("ux-row-action-cell");f.innerHTML=c}return c}.createDelegate(this)}Ext.ux.RowActionSingle.superclass.constructor.call(this)};Ext.extend(Ext.ux.RowActionSingle,Ext.util.Observable,{autoWidth:true,header:"",menuDisabled:true,sortable:false,name:"",index:undefined,iconCls:"",text:"",style:"",tooltip:"",tplItem:'<div class="ux-row-action-item {cls}" {qtip} actionIndex={actionIndex} {style}>{text}</div>',tplItemInline:'<span class="ux-row-action-item" {qtip} actionIndex={actionIndex} {style}><img src={blankImage} class="ux-row-action-blank-icon {cls}"/>{text}</span>',inlineTpl:undefined,tplCt:'<div class="ux-row-action">{items}</div>',widthIntercept:4,widthSlope:21,getTpl:function(c){var b=(c&&!this.noBlankImg?this.tplItemInline:this.tplItem);b=b.replace(/\{actionIndex\}/,this.index);b=b.replace(/\{blankImage\}/,Ext.BLANK_IMAGE_URL);var h="&#160;";if(this.textIndex){h="<span>{"+this.textIndex+"}</span>"}else{if(this.text){h="<span>"+this.text+"</span>"}}b=b.replace(/\{text\}/,h);var e="";if(this.iconIndex){e=" {"+this.iconIndex+"}"}else{if(this.iconCls){e=" "+this.iconCls}}if(this.cls){e+=" "+this.cls}b=b.replace(/\{cls\}/,e);var f="";if(this.qtipIndex){f=' qtip="{'+this.qtipIndex+'}"'}else{if(this.tooltip||this.qtip){f=' qtip="'+(this.tooltip||this.qtip)+'"'}}b=b.replace(/\{qtip\}/,f);var j=(this.style?' style="'+this.style+'"':"");b=b.replace(/\{style\}/,j);return b},getInline:function(h,b,c,j,f,e){if(!this.inlineTpl){this.inlineTpl=new Ext.Template(this.getTpl(true))}return this.inlineTpl.apply(this.getData(h,b,c,j,f,e))},getData:function(h,b,c,j,f,e){return(c?c.data:{})},getColumn:function(){}});Ext.ux.RowActions=function(b){Ext.apply(this,b)};Ext.ux.RowActions.prototype={autoWidth:true,header:"",menuDisabled:true,sortable:false,tplCt:'<div class="ux-row-action">{items}</div>',widthIntercept:4,widthSlope:21,processedActions:false,alternativeGetTarget:null,getData:function(h,b,c,j,f,e){return(c?c.data:{})},get:function(b){if(!this.processedActions){this.initActions()}var c=this.actions.get(b);return c},getInline:function(k,j,c,e,m,h,f){if(!this.processedActions){this.initActions()}var b=this.actions.get(k);if(!b){return alert("Did not load the button:"+k)}return b.getInline(j,c,e,m,h,f)},initActions:function(){this.processedActions=true;this.initialActions=this.actions;this.actions=new Ext.util.MixedCollection(false,function(b){return b.name||b.iconCls||b.text||Ext.id()});Ext.each(this.initialActions,function(c){c.index=this.actions.getCount();var b=new Ext.ux.RowActionSingle(c);this.actions.add(b)},this)},init:function(e){if(!this.processedActions){this.initActions()}if(!this.tpl){var c=[];this.actions.each(function(f){c.push(f.getTpl())});this.tpl=new Ext.Template(this.tplCt.replace(/\{items\}/,c.join("")))}if(this.autoWidth){this.width=this.widthSlope*this.actions.getCount()+this.widthIntercept;this.fixed=true}if(e instanceof ExtX.List.GroupedView){this.dataview=e;e.on({containerclick:{scope:this,fn:this.onClickListView},click:{scope:this,fn:this.onClickDataView}})}else{if(e instanceof Ext.DataView){this.dataview=e;e.on({click:{scope:this,fn:this.onClickDataView}})}else{if(e instanceof Ext.grid.GridPanel){if(!this.renderer){this.renderer=function(p,h,k,q,n,m,j){h.css+=(h.css?" ":"")+"ux-row-action-cell";var f=this.tpl.apply(this.getData(p,h,k,q,n,m));if(j){Ext.fly(j.parentNode).addClass("ux-row-action-cell");j.innerHTML=f}return f}.createDelegate(this)}this.grid=e;var b=e.getView();b.cellSelectorDepth=5;e.on({render:{scope:this,fn:function(){b.mainBody.on({click:{scope:this,fn:this.onClickGrid}})}}});if(b.groupTextTpl){b.interceptMouse=b.interceptMouse.createInterceptor(function(f){if(f.getTarget(".ux-row-action-item")){return false}})}}}}},onClickDataView:function(k,j,b,h){var p=this.alternativeGetTarget?this.alternativeGetTarget(k,j,b,h):h.getTarget(".ux-row-action-item");if(!p){return}var m=Number(p.getAttribute("actionIndex"));var c=this.actions.get(m);if(!this.eventsSuspended&&c.fireEvent("beforeaction",this,this.dataview,f,c,j,undefined,n)===false){return}var f=this.dataview.store.getAt(j);var n=p.className.replace(/ux-row-action-item /,"");c.fireEvent("action",this,this.dataview,f,c,j,undefined,n,b)},onClickListView:function(k,j){var q=j.getTarget(".ux-row-action-item");if(!q){return}var f=j.getTarget(".x-listgrid-group");if(!f){return}var n=Number(q.getAttribute("actionIndex"));var b=this.actions.get(n);var m=this.dataview.store;var h=m.getById(f.getAttribute("recordId"));var c=m.indexOf(h);var p=q.className.replace(/ux-row-action-item /,"");if(!this.eventsSuspended&&b.fireEvent("beforeaction",this,this.dataview,h,b,c,undefined,p)===false){return}b.fireEvent("action",this,this.dataview,h,b,c,undefined,p)},onClickGrid:function(k,m){var u=k.getTarget(".ux-row-action-item");if(!u){return}var v=k.getTarget(".x-grid3-row");var b,n=false,p=this.grid.getView(),q=this.grid.store;if(false!==v&&null!=v){b=p.findCellIndex(k.getTarget());n=v.rowIndex}else{var h=k.getTarget(".x-grid-group");if(h){var f=h.id.replace(/\&/,"&amp;");n=q.data.findIndex("_groupId",f);if(n==-1){Ext.jx.debug("can not match to groupid")}}}if(n!==false&&n!=-1){var j=q.getAt(n);var s=u.className.replace(/ux-row-action-item /,"");var r=Number(u.getAttribute("actionIndex"));var c=this.actions.get(r);if(true!==this.eventsSuspended&&false===c.fireEvent("beforeaction",this,this.grid,j,c,n,b,s)){return}c.fireEvent("action",this,this.grid,j,c,n,b,s)}}};Ext.namespace("Ext.ux.form");Ext.ux.form.SuperBoxSelect=function(b){Ext.ux.form.SuperBoxSelect.superclass.constructor.call(this,b);this.addEvents("beforeadditem","additem","newitem","beforeremoveitem","removeitem","clear")};Ext.ux.form.SuperBoxSelect=Ext.extend(Ext.ux.form.SuperBoxSelect,Ext.form.ComboBox,{allowAddNewData:false,backspaceDeletesLastItem:true,classField:null,clearBtnCls:"",displayFieldTpl:null,extraItemCls:"",extraItemStyle:"",expandBtnCls:"",fixFocusOnTabSelect:true,navigateItemsWithTab:true,pinList:true,preventDuplicates:true,queryValuesDelimiter:"|",queryValuesInidicator:"valuesqry",removeValuesFromStore:true,renderFieldBtns:true,stackItems:false,styleField:null,supressClearValueRemoveEvents:false,validationEvent:"blur",valueDelimiter:",",initComponent:function(){Ext.apply(this,{items:new Ext.util.MixedCollection(false),usedRecords:new Ext.util.MixedCollection(false),addedRecords:[],remoteLookup:[],hideTrigger:true,grow:false,resizable:false,multiSelectMode:false,preRenderValue:null});if(this.transform){this.doTransform()}Ext.ux.form.SuperBoxSelect.superclass.initComponent.call(this);if(this.mode==="remote"&&this.store){this.store.on("load",this.onStoreLoad,this)}},onRender:function(c,b){Ext.ux.form.SuperBoxSelect.superclass.onRender.call(this,c,b);this.el.dom.removeAttribute("name");var e=(this.stackItems===true)?"x-superboxselect-stacked":"";if(this.renderFieldBtns){e+=" x-superboxselect-display-btns"}this.el.removeClass("x-form-text").addClass("x-superboxselect-input-field");this.wrapEl=this.el.wrap({tag:"ul"});this.outerWrapEl=this.wrapEl.wrap({tag:"div",cls:"x-form-text x-superboxselect "+e});this.inputEl=this.el.wrap({tag:"li",cls:"x-superboxselect-input"});if(this.renderFieldBtns){this.setupFieldButtons().manageClearBtn()}this.setupFormInterception();if(this.preRenderValue){this.setValue(this.preRenderValue);this.preRenderValue=null}},onStoreLoad:function(c,b,e){var j=e.params[this.queryParam]||c.baseParams[this.queryParam]||"",k=e.params[this.queryValuesInidicator]||c.baseParams[this.queryValuesInidicator];if(this.removeValuesFromStore){this.store.each(function(n){if(this.usedRecords.containsKey(n.get(this.valueField))){this.store.remove(n)}},this)}if(k){var m=j.split(this.queryValuesDelimiter);Ext.each(m,function(n){this.remoteLookup.remove(n);var q=this.findRecord(this.valueField,n);if(q){this.addRecord(q)}},this);if(this.setOriginal){this.setOriginal=false;this.originalValue=this.getValue()}}if(j!==""&&this.allowAddNewData){Ext.each(this.remoteLookup,function(n){if(typeof n=="object"&&n[this.displayField]==j){this.remoteLookup.remove(n);if(b.length&&b[0].get(this.displayField)===j){this.addRecord(b[0]);return}var p=this.createRecord(n);this.store.add(p);this.addRecord(p);this.addedRecords.push(p);(function(){if(this.isExpanded()){this.collapse()}}).defer(10,this);return}},this)}var f=[];if(j===""){Ext.each(this.addedRecords,function(n){if(this.preventDuplicates&&this.usedRecords.containsKey(n.get(this.valueField))){return}f.push(n)},this)}else{var h=new RegExp(Ext.escapeRe(j)+".*","i");Ext.each(this.addedRecords,function(n){if(this.preventDuplicates&&this.usedRecords.containsKey(n.get(this.valueField))){return}if(h.test(n.get(this.displayField))){f.push(n)}},this)}this.store.add(f);this.store.sort(this.displayField,"ASC");if(this.store.getCount()===0&&this.isExpanded()){this.collapse()}},doTransform:function(){var p=Ext.getDom(this.transform),h=[];if(!this.store){this.mode="local";var k=[],b=p.options;for(var f=0,j=b.length;f<j;f++){var e=b[f],m=(Ext.isIE6||Ext.isIE7?e.getAttributeNode("value").specified:e.hasAttribute("value"))?e.value:e.text,n=(Ext.isIE6||Ext.isIE7?e.getAttributeNode("class").specified:e.hasAttribute("class"))?e.className:"",c=(Ext.isIE6||Ext.isIE7?e.getAttributeNode("style").specified:e.hasAttribute("style"))?e.style:"";if(e.selected){h.push(m)}k.push([m,e.text,n,c.cssText])}this.store=new Ext.data.SimpleStore({id:0,fields:["value","text","cls","style"],data:k});Ext.apply(this,{valueField:"value",displayField:"text",classField:"cls",styleField:"style"})}if(h.length){this.value=h.join(",")}},setupFieldButtons:function(){this.buttonWrap=this.outerWrapEl.createChild({cls:"x-superboxselect-btns"});this.buttonClear=this.buttonWrap.createChild({tag:"div",cls:"x-superboxselect-btn-clear "+this.clearBtnCls});this.buttonExpand=this.buttonWrap.createChild({tag:"div",cls:"x-superboxselect-btn-expand "+this.expandBtnCls});this.initButtonEvents();return this},initButtonEvents:function(){this.buttonClear.addClassOnOver("x-superboxselect-btn-over").on("click",function(b){b.stopEvent();if(this.disabled){return}this.clearValue();this.el.focus()},this);this.buttonExpand.addClassOnOver("x-superboxselect-btn-over").on("click",function(b){b.stopEvent();if(this.disabled){return}if(this.isExpanded()){this.multiSelectMode=false}else{if(this.pinList){this.multiSelectMode=true}}this.onTriggerClick()},this)},removeButtonEvents:function(){this.buttonClear.removeAllListeners();this.buttonExpand.removeAllListeners();return this},clearCurrentFocus:function(){if(this.currentFocus){this.currentFocus.onLnkBlur();this.currentFocus=null}return this},initEvents:function(){var b=this.el;b.on({click:this.onClick,focus:this.clearCurrentFocus,blur:this.onBlur,keydown:this.onKeyDownHandler,keyup:this.onKeyUpBuffered,scope:this});this.on({collapse:this.onCollapse,expand:this.clearCurrentFocus,scope:this});this.wrapEl.on("click",this.onWrapClick,this);this.outerWrapEl.on("click",this.onWrapClick,this);this.inputEl.focus=function(){b.focus()};Ext.ux.form.SuperBoxSelect.superclass.initEvents.call(this);Ext.apply(this.keyNav,{tab:function(c){if(this.fixFocusOnTabSelect&&this.isExpanded()){c.stopEvent();b.blur();this.onViewClick(false);this.focus(false,10);return true}this.onViewClick(false);if(b.dom.value!==""){this.setRawValue("")}return true},down:function(c){if(!this.isExpanded()&&!this.currentFocus){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(){}})},onClick:function(){this.clearCurrentFocus();this.collapse();this.autoSize()},beforeBlur:Ext.form.ComboBox.superclass.beforeBlur,onFocus:function(){this.outerWrapEl.addClass(this.focusClass);Ext.ux.form.SuperBoxSelect.superclass.onFocus.call(this)},onBlur:function(){this.outerWrapEl.removeClass(this.focusClass);this.clearCurrentFocus();if(this.el.dom.value!==""){this.applyEmptyText();this.autoSize()}Ext.ux.form.SuperBoxSelect.superclass.onBlur.call(this)},onCollapse:function(){this.view.clearSelections();this.multiSelectMode=false},onWrapClick:function(b){b.stopEvent();this.collapse();this.el.focus();this.clearCurrentFocus()},markInvalid:function(e){var c,b;if(!this.rendered||this.preventMark){return}this.outerWrapEl.addClass(this.invalidClass);e=e||this.invalidText;switch(this.msgTarget){case"qtip":Ext.apply(this.el.dom,{qtip:e,qclass:"x-form-invalid-tip"});Ext.apply(this.wrapEl.dom,{qtip:e,qclass:"x-form-invalid-tip"});if(Ext.QuickTips){Ext.QuickTips.enable()}break;case"title":this.el.dom.title=e;this.wrapEl.dom.title=e;this.outerWrapEl.dom.title=e;break;case"under":if(!this.errorEl){c=this.getErrorCt();if(!c){this.el.dom.title=e;break}this.errorEl=c.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(c.getWidth(true)-20)}this.errorEl.update(e);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case"side":if(!this.errorIcon){c=this.getErrorCt();if(!c){this.el.dom.title=e;break}this.errorIcon=c.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();Ext.apply(this.errorIcon.dom,{qtip:e,qclass:"x-form-invalid-tip"});this.errorIcon.show();this.on("resize",this.alignErrorIcon,this);break;default:b=Ext.getDom(this.msgTarget);b.innerHTML=e;b.style.display=this.msgDisplay;break}this.fireEvent("invalid",this,e)},clearInvalid:function(){if(!this.rendered||this.preventMark){return}this.outerWrapEl.removeClass(this.invalidClass);switch(this.msgTarget){case"qtip":this.el.dom.qtip="";this.wrapEl.dom.qtip="";break;case"title":this.el.dom.title="";this.wrapEl.dom.title="";this.outerWrapEl.dom.title="";break;case"under":if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}break;case"side":if(this.errorIcon){this.errorIcon.dom.qtip="";this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}break;default:var b=Ext.getDom(this.msgTarget);b.innerHTML="";b.style.display="none";break}this.fireEvent("valid",this)},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[Ext.isIE?5:2,3])}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}this.list.alignTo(this.outerWrapEl,this.listAlign).show();this.innerList.setOverflow("auto");Ext.getDoc().on({mousewheel:this.collapseIf,mousedown:this.collapseIf,scope:this});this.fireEvent("expand",this)},restrictHeight:function(){var c=this.innerList.dom,e=c.scrollTop,k=this.list;c.style.height="";var m=k.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,f=Math.max(c.clientHeight,c.offsetHeight,c.scrollHeight),b=this.getPosition()[1]-Ext.getBody().getScroll().top,n=RL.Global.getWindowSize().height-b-this.getSize().height,j=Math.max(b,n,this.minHeight||0)-k.shadowOffset-m-5;f=Math.min(f,j,this.maxHeight);this.innerList.setHeight(f);k.beginUpdate();k.setHeight(f+m);k.alignTo(this.outerWrapEl,this.listAlign);k.endUpdate();if(this.multiSelectMode){c.scrollTop=e}},validateValue:function(b){if(this.items.getCount()===0){if(this.allowBlank){this.clearInvalid();return true}else{this.markInvalid(this.blankText);return false}}else{this.clearInvalid();return true}},setupFormInterception:function(){var b;this.findParentBy(function(e){if(e.getForm){b=e.getForm()}});if(b){var c=b.getValues;b.getValues=function(f){if(this.items.getCount()>0){this.el.dom.disabled=true}var e=this.el.dom.value;this.setRawValue("");var h=c.call(b,f);this.el.dom.disabled=false;this.setRawValue(e);return h}.createDelegate(this)}},onResize:function(b,e,j,c){var f=Ext.isIE6?4:Ext.isIE7?1:Ext.isIE8?1:0;this._width=b;this.outerWrapEl.setWidth(b-f);if(this.renderFieldBtns){f+=(this.buttonWrap.getWidth()+20);this.wrapEl.setWidth(b-f)}Ext.ux.form.SuperBoxSelect.superclass.onResize.call(this,b,e,j,c);this.autoSize()},onEnable:function(){Ext.ux.form.SuperBoxSelect.superclass.onEnable.call(this);this.items.each(function(b){b.enable()});if(this.renderFieldBtns){this.initButtonEvents()}},onDisable:function(){Ext.ux.form.SuperBoxSelect.superclass.onDisable.call(this);this.items.each(function(b){b.disable()});if(this.renderFieldBtns){this.removeButtonEvents()}},clearValue:function(b){Ext.ux.form.SuperBoxSelect.superclass.clearValue.call(this);this.preventMultipleRemoveEvents=b||this.supressClearValueRemoveEvents||false;this.removeAllItems();this.fireEvent("clear",this);return this},onKeyUp:function(b){if(this.editable!==false&&!b.isSpecialKey()&&(!b.hasModifier()||b.shiftKey)){this.lastKey=b.getKey();this.dqTask.delay(this.queryDelay)}},onKeyDownHandler:function(k,f){var c,n,b;if((k.getKey()===k.DELETE||k.getKey()===k.SPACE)&&this.currentFocus){k.stopEvent();c=this.currentFocus;this.on("expand",function(){this.collapse()},this,{single:true});b=this.items.indexOfKey(this.currentFocus.key);this.clearCurrentFocus();if(b<(this.items.getCount()-1)){n=this.items.itemAt(b+1)}c.preDestroy(true);if(n){(function(){n.onLnkFocus();this.currentFocus=n}).defer(200,this)}return true}var m=this.el.dom.value,h,j=k.ctrlKey;if(k.getKey()===k.ENTER){k.stopEvent();if(m!==""){if(j||!this.isExpanded()){this.view.clearSelections();this.collapse();this.setRawValue("");this.fireEvent("newitem",this,m)}else{this.onViewClick();if(this.unsetDelayCheck){this.delayedCheck=true;this.unsetDelayCheck.defer(10,this)}}}else{if(!this.isExpanded()){return}this.onViewClick();if(this.unsetDelayCheck){this.delayedCheck=true;this.unsetDelayCheck.defer(10,this)}}return true}if(m!==""){this.autoSize();return}if(k.getKey()===k.HOME){k.stopEvent();if(this.items.getCount()>0){this.collapse();h=this.items.get(0);h.el.focus()}return true}if(k.getKey()===k.BACKSPACE){k.stopEvent();if(this.currentFocus){c=this.currentFocus;this.on("expand",function(){this.collapse()},this,{single:true});b=this.items.indexOfKey(c.key);this.clearCurrentFocus();if(b<(this.items.getCount()-1)){n=this.items.itemAt(b+1)}c.preDestroy(true);if(n){(function(){n.onLnkFocus();this.currentFocus=n}).defer(200,this)}return}else{h=this.items.get(this.items.getCount()-1);if(h){if(this.backspaceDeletesLastItem){this.on("expand",function(){this.collapse()},this,{single:true});h.preDestroy(true)}else{if(this.navigateItemsWithTab){h.onElClick()}else{this.on("expand",function(){this.collapse();this.currentFocus=h;this.currentFocus.onLnkFocus.defer(20,this.currentFocus)},this,{single:true})}}}return true}}if(!k.isNavKeyPress()){this.multiSelectMode=false;this.clearCurrentFocus();return}if(k.getKey()===k.LEFT||(k.getKey()===k.UP&&!this.isExpanded())){k.stopEvent();this.collapse();h=this.items.get(this.items.getCount()-1);if(this.navigateItemsWithTab){if(h){h.focus()}}else{if(this.currentFocus){b=this.items.indexOfKey(this.currentFocus.key);this.clearCurrentFocus();if(b!==0){this.currentFocus=this.items.itemAt(b-1);this.currentFocus.onLnkFocus()}}else{this.currentFocus=h;if(h){h.onLnkFocus()}}}return true}if(k.getKey()===k.DOWN){if(this.currentFocus){this.collapse();k.stopEvent();b=this.items.indexOfKey(this.currentFocus.key);if(b==(this.items.getCount()-1)){this.clearCurrentFocus.defer(10,this)}else{this.clearCurrentFocus();this.currentFocus=this.items.itemAt(b+1);if(this.currentFocus){this.currentFocus.onLnkFocus()}}return true}}if(k.getKey()===k.RIGHT){this.collapse();h=this.items.itemAt(0);if(this.navigateItemsWithTab){if(h){h.focus()}}else{if(this.currentFocus){b=this.items.indexOfKey(this.currentFocus.key);this.clearCurrentFocus();if(b<(this.items.getCount()-1)){this.currentFocus=this.items.itemAt(b+1);if(this.currentFocus){this.currentFocus.onLnkFocus()}}}else{this.currentFocus=h;if(h){h.onLnkFocus()}}}}},onKeyUpBuffered:function(b){if(!b.isNavKeyPress()){this.autoSize()}},reset:function(){Ext.ux.form.SuperBoxSelect.superclass.reset.call(this);this.addedRecords=[];this.autoSize().setRawValue("");this.el.focus()},applyEmptyText:function(){if(this.items.getCount()>0){this.el.removeClass(this.emptyClass);this.setRawValue("");return this}if(this.rendered&&this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}return this},removeAllItems:function(){this.items.each(function(b){b.preDestroy(true)},this);this.manageClearBtn();return this},resetStore:function(){this.store.clearFilter();if(!this.removeValuesFromStore){return this}this.usedRecords.each(function(b){this.store.add(b)},this);this.sortStore();return this},sortStore:function(){var b=this.store.getSortState();if(b&&b.field){this.store.sort(b.field,b.direction)}return this},getCaption:function(e){if(typeof this.displayFieldTpl==="string"){this.displayFieldTpl=new Ext.XTemplate(this.displayFieldTpl)}var c,b=e instanceof Ext.data.Record?e.data:e;if(this.displayFieldTpl){c=this.displayFieldTpl.apply(b)}else{if(this.displayField){c=b[this.displayField]}}return c},addRecord:function(c){var h=c.data[this.displayField],e=this.getCaption(c),j=c.data[this.valueField],b=this.classField?c.data[this.classField]:"",f=this.styleField?c.data[this.styleField]:"";if(this.removeValuesFromStore){this.usedRecords.add(j,c);this.store.remove(c)}this.addItemBox(j,h,e,b,f);this.fireEvent("additem",this,j,c)},createRecord:function(b){if(!this.recordConstructor){var c=[{name:this.valueField},{name:this.displayField}];if(this.classField){c.push({name:this.classField})}if(this.styleField){c.push({name:this.styleField})}this.recordConstructor=Ext.data.Record.create(c)}return new this.recordConstructor(b)},addItems:function(b){if(Ext.isArray(b)){Ext.each(b,function(c){this.addItem(c)},this)}else{this.addItem(b)}},addItem:function(b){var f=b[this.valueField];if(this.disabled){return false}if(this.preventDuplicates&&this.hasValue(f)){return}var c=this.findRecord(this.valueField,f);if(c){this.addRecord(c);return}else{if(!this.allowAddNewData){return}}if(this.mode==="remote"){this.remoteLookup.push(b);this.doQuery(f,false,false);return}var e=this.createRecord(b);this.store.add(e);this.addRecord(e);return true},addItemBox:function(c,m,b,h,f){var k=function(q){var n="";if(typeof q=="function"){n=q.call()}else{if(typeof q=="object"){for(var r in q){n+=r+":"+q[r]+";"}}else{if(typeof q=="string"){n=q+";"}}}return n};var j=Ext.id(null,"sbx-item");var e=new Ext.ux.form.SuperBoxSelectItem({owner:this,disabled:this.disabled,renderTo:this.wrapEl,cls:this.extraItemCls+" "+h,style:k(this.extraItemStyle)+" "+f,caption:b,display:m,value:c,key:j,listeners:{remove:function(n){if(this.fireEvent("beforeremoveitem",this,n.value)===false){return}this.items.removeKey(n.key);if(this.removeValuesFromStore){if(this.usedRecords.containsKey(n.value)){this.store.add(this.usedRecords.get(n.value));this.usedRecords.removeKey(n.value);this.sortStore();if(this.view){this.view.render()}}}if(!this.preventMultipleRemoveEvents){this.fireEvent.defer(250,this,["removeitem",this,n.value,this.findInStore(n.value)])}this.preventMultipleRemoveEvents=false},destroy:function(){this.collapse();this.autoSize().manageClearBtn().validateValue()},scope:this}});e.render();e.hidden=this.el.insertSibling({tag:"input",type:"hidden",value:c,name:(this.hiddenName||this.name)},"before");this.items.add(j,e);this.applyEmptyText().autoSize().manageClearBtn().validateValue()},manageClearBtn:function(){if(!this.renderFieldBtns||!this.rendered){return this}var b="x-superboxselect-btn-hide";if(this.items.getCount()===0){this.buttonClear.addClass(b)}else{this.buttonClear.removeClass(b)}return this},findInStore:function(c){var b=this.store.find(this.valueField,c.trim());if(b>-1){return this.store.getAt(b)}return false},getValue:function(){var b=[];this.items.each(function(c){b.push(c.value)});return b.join(this.valueDelimiter)},getValueEx:function(){var b=[];this.items.each(function(e){var c={};c[this.valueField]=e.value;c[this.displayField]=e.display;c[this.classField]=e.cls;b.push(c)},this);return b},initValue:function(){Ext.ux.form.SuperBoxSelect.superclass.initValue.call(this);if(this.mode==="remote"){this.setOriginal=true}},setValue:function(e){if(!this.rendered){this.preRenderValue=e;return}var b=Ext.isArray(e)?e:e.split(this.valueDelimiter);this.removeAllItems().resetStore();this.remoteLookup=[];Ext.each(b,function(h){var f=this.findRecord(this.valueField,h);if(f){this.addRecord(f)}else{if(this.mode==="remote"){this.remoteLookup.push(h)}}},this);if(this.mode==="remote"){var c=this.remoteLookup.join(this.queryValuesDelimiter);this.doQuery(c,false,true)}},setValueEx:function(b){this.removeAllItems().resetStore();if(!Ext.isArray(b)){b=[b]}Ext.each(b,function(c){this.addItem(c)},this)},hasValue:function(c){var b=false;this.items.each(function(e){if(e.value==c){b=true;return false}},this);return b},onSelect:function(b,c){var e=b.data[this.valueField];if(this.preventDuplicates&&this.hasValue(e)){return}this.setRawValue("");this.lastSelectionText="";if(this.fireEvent("beforeadditem",this,e)!==false){this.addRecord(b)}if(this.store.getCount()===0||!this.multiSelectMode){this.collapse()}else{this.restrictHeight()}},onDestroy:function(){this.items.each(function(b){b.preDestroy(true)},this);if(this.renderFieldBtns){Ext.destroy(this.buttonClear,this.buttonExpand,this.buttonWrap)}Ext.destroy(this.inputEl,this.wrapEl,this.outerWrapEl);Ext.ux.form.SuperBoxSelect.superclass.onDestroy.call(this)},autoSize:function(){if(!this.rendered){return this}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var e=this.el,c=e.dom.value,f=document.createElement("div");if(c===""&&this.emptyText&&this.items.getCount()<1){c=this.emptyText}f.appendChild(document.createTextNode(c));c=f.innerHTML;f=null;c+="&#160;";var b=Math.max(this.metrics.getWidth(c)+24,24);if(typeof this._width!="undefined"){b=Math.min(this._width,b)}this.el.setWidth(b);if(Ext.isIE){this.el.dom.style.top="0"}return this},doQuery:function(f,e,b){f=Ext.isEmpty(f)?"":f;var c={query:f,forceAll:e,combo:this,cancel:false};if(this.fireEvent("beforequery",c)===false||c.cancel){return false}f=c.query;e=c.forceAll;if(e===true||(f.length>=this.minChars)){if(this.lastQuery!==f){this.lastQuery=f;if(this.mode=="local"){this.selectedIndex=-1;if(e){this.store.clearFilter()}else{this.store.filter(this.displayField,f)}this.onLoad()}else{this.store.baseParams[this.queryParam]=f;this.store.baseParams[this.queryValuesInidicator]=b;this.store.load({params:this.getParams(f)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}}});Ext.reg("superboxselect",Ext.ux.form.SuperBoxSelect);Ext.ux.form.SuperBoxSelectItem=function(b){Ext.apply(this,b);Ext.ux.form.SuperBoxSelectItem.superclass.constructor.call(this)};Ext.ux.form.SuperBoxSelectItem=Ext.extend(Ext.ux.form.SuperBoxSelectItem,Ext.Component,{initComponent:function(){Ext.ux.form.SuperBoxSelectItem.superclass.initComponent.call(this)},onElClick:function(c){var f=this.owner;f.clearCurrentFocus().collapse();if(f.navigateItemsWithTab){this.focus()}else{f.el.dom.focus();var b=this;(function(){this.onLnkFocus();f.currentFocus=this}).defer(10,this)}},onLnkClick:function(b){if(b){b.stopEvent()}this.preDestroy();if(!this.owner.navigateItemsWithTab){this.owner.el.focus()}},onLnkFocus:function(){this.el.addClass("x-superboxselect-item-focus");this.owner.outerWrapEl.addClass("x-form-focus")},onLnkBlur:function(){this.el.removeClass("x-superboxselect-item-focus");this.owner.outerWrapEl.removeClass("x-form-focus")},enableElListeners:function(){this.el.on("click",this.onElClick,this,{stopEvent:true});this.el.addClassOnOver("x-superboxselect-item x-superboxselect-item-hover")},enableLnkListeners:function(){this.lnk.on({click:this.onLnkClick,focus:this.onLnkFocus,blur:this.onLnkBlur,scope:this})},enableAllListeners:function(){this.enableElListeners();this.enableLnkListeners()},disableAllListeners:function(){this.el.removeAllListeners();this.lnk.un("click",this.onLnkClick,this);this.lnk.un("focus",this.onLnkFocus,this);this.lnk.un("blur",this.onLnkBlur,this)},onRender:function(e,b){Ext.ux.form.SuperBoxSelectItem.superclass.onRender.call(this,e,b);var h=this.el;if(h){h.remove()}this.el=h=e.createChild({tag:"li"},e.last());h.addClass("x-superboxselect-item");var f=this.owner.navigateItemsWithTab?(Ext.isSafari?"button":"a"):"span";var j=this.key;Ext.apply(h,{focus:function(){var k=this.down(f+".x-superboxselect-item-close");if(k){k.focus()}},preDestroy:function(){this.preDestroy()}.createDelegate(this)});this.enableElListeners();h.update(this.caption);var c={tag:f,"class":"x-superboxselect-item-close",tabIndex:this.owner.navigateItemsWithTab?"0":"-1"};if(f==="a"){c.href="#"}this.lnk=h.createChild(c);if(!this.disabled){this.enableLnkListeners()}else{this.disableAllListeners()}this.on({disable:this.disableAllListeners,enable:this.enableAllListeners,scope:this});this.setupKeyMap()},setupKeyMap:function(){new Ext.KeyMap(this.lnk,[{key:[Ext.EventObject.BACKSPACE,Ext.EventObject.DELETE,Ext.EventObject.SPACE],fn:this.preDestroy,scope:this},{key:[Ext.EventObject.RIGHT,Ext.EventObject.DOWN],fn:function(){this.moveFocus("right")},scope:this},{key:[Ext.EventObject.LEFT,Ext.EventObject.UP],fn:function(){this.moveFocus("left")},scope:this},{key:[Ext.EventObject.HOME],fn:function(){var b=this.owner.items.get(0).el.focus();if(b){b.el.focus()}},scope:this},{key:[Ext.EventObject.END],fn:function(){this.owner.el.focus()},scope:this},{key:Ext.EventObject.ENTER,fn:function(){}}]).stopEvent=true},moveFocus:function(b){var c=this.el[b=="left"?"prev":"next"]()||this.owner.el;c.focus.defer(100,c)},preDestroy:function(b){if(this.fireEvent("remove",this)===false){return}var c=function(){if(this.owner.navigateItemsWithTab){this.moveFocus("right")}this.hidden.remove();this.hidden=null;this.destroy()};if(b){c.call(this)}else{this.el.hide({duration:0.2,callback:c,scope:this})}return this},onDestroy:function(){Ext.destroy(this.lnk,this.el);Ext.ux.form.SuperBoxSelectItem.superclass.onDestroy.call(this)}});Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,defaultValue:1,accelerate:false,constructor:function(b){Ext.ux.Spinner.superclass.constructor.call(this,b);Ext.apply(this,b);this.mimicing=false},init:function(b){this.field=b;b.afterMethod("onRender",this.doRender,this);b.afterMethod("onEnable",this.doEnable,this);b.afterMethod("onDisable",this.doDisable,this);b.afterMethod("afterRender",this.doAfterRender,this);b.afterMethod("onResize",this.doResize,this);b.afterMethod("onFocus",this.doFocus,this);b.beforeMethod("onDestroy",this.doDestroy,this)},doRender:function(c,b){var e=this.el=this.field.getEl();var h=this.field;if(!h.wrap){h.wrap=this.wrap=e.wrap({cls:"x-form-field-wrap"})}else{this.wrap=h.wrap.addClass("x-form-field-wrap")}this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(!h.width){this.wrap.setWidth(e.getWidth()+this.trigger.getWidth())}this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:{width:"13px",height:"2px;"}});this.splitter.setRight((Ext.isIE)?1:2).setTop(10).show();this.proxy=this.trigger.createProxy("",this.splitter,true);this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle("left","0px");this.proxy.setSize(14,1);this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});this.initTrigger();this.initSpinner()},doAfterRender:function(){var b;if(Ext.isIE&&this.el.getY()!=(b=this.trigger.getY())){this.el.position();this.el.setY(b)}},doEnable:function(){if(this.wrap){this.wrap.removeClass(this.field.disabledClass)}},doDisable:function(){if(this.wrap){this.wrap.addClass(this.field.disabledClass);this.el.removeClass(this.field.disabledClass)}},doResize:function(b,c){if(typeof b=="number"){this.el.setWidth(b-this.trigger.getWidth())}this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},doFocus:function(){if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});this.el.on("keydown",this.checkTab,this)}},checkTab:function(b){if(b.getKey()==b.TAB){this.triggerBlur()}},mimicBlur:function(b){if(!this.wrap.contains(b.target)&&this.field.validateBlur(b)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab,this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");this.field.onBlur.call(this.field)},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){this.field.addEvents({spin:true,spinup:true,spindown:true});this.keyNav=new Ext.KeyNav(this.el,{up:function(b){b.preventDefault();this.onSpinUp()},down:function(b){b.preventDefault();this.onSpinDown()},pageUp:function(b){b.preventDefault();this.onSpinUpAlternate()},pageDown:function(b){b.preventDefault();this.onSpinDownAlternate()},scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:true});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:true});this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this);this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);this.dd.onDrag=this.onDrag.createDelegate(this)},onMouseOver:function(){if(this.disabled){return}var b=this.getMiddle();this.tmpHoverClass=(Ext.EventObject.getPageY()<b)?"x-form-spinner-overup":"x-form-spinner-overdown";this.trigger.addClass(this.tmpHoverClass)},onMouseOut:function(){this.trigger.removeClass(this.tmpHoverClass)},onMouseMove:function(){if(this.disabled){return}var b=this.getMiddle();if(((Ext.EventObject.getPageY()>b)&&this.tmpHoverClass=="x-form-spinner-overup")||((Ext.EventObject.getPageY()<b)&&this.tmpHoverClass=="x-form-spinner-overdown")){}},onMouseDown:function(){if(this.disabled){return}var b=this.getMiddle();this.tmpClickClass=(Ext.EventObject.getPageY()<b)?"x-form-spinner-clickup":"x-form-spinner-clickdown";this.trigger.addClass(this.tmpClickClass)},onMouseUp:function(){this.trigger.removeClass(this.tmpClickClass)},onTriggerClick:function(){if(this.disabled||this.el.dom.readOnly){return}var c=this.getMiddle();var b=(Ext.EventObject.getPageY()<c)?"Up":"Down";this["onSpin"+b]()},getMiddle:function(){var c=this.trigger.getTop();var e=this.trigger.getHeight();var b=c+(e/2);return b},isSpinnable:function(){if(this.disabled||this.el.dom.readOnly){Ext.EventObject.preventDefault();return false}return true},handleMouseWheel:function(b){if(this.wrap.hasClass("x-trigger-wrap-focus")==false){return}var c=b.getWheelDelta();if(c>0){this.onSpinUp();b.stopEvent()}else{if(c<0){this.onSpinDown();b.stopEvent()}}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop()},endDrag:function(){this.proxy.hide()},onDrag:function(){if(this.disabled){return}var c=Ext.fly(this.dd.getDragEl()).getTop();var b="";if(this._previousY>c){b="Up"}if(this._previousY<c){b="Down"}if(b!=""){this["onSpin"+b]()}this._previousY=c},onSpinUp:function(){if(this.isSpinnable()==false){return}if(Ext.EventObject.shiftKey==true){this.onSpinUpAlternate();return}else{this.spin(false,false)}this.field.fireEvent("spin",this.field,this);this.field.fireEvent("spinup",this.field,this)},onSpinDown:function(){if(this.isSpinnable()==false){return}if(Ext.EventObject.shiftKey==true){this.onSpinDownAlternate();return}else{this.spin(true,false)}this.field.fireEvent("spin",this.field,this);this.field.fireEvent("spindown",this.field,this)},onSpinUpAlternate:function(){if(this.isSpinnable()==false){return}this.spin(false,true);this.field.fireEvent("spin",this.field,this);this.field.fireEvent("spinup",this.field,this)},onSpinDownAlternate:function(){if(this.isSpinnable()==false){return}this.spin(true,true);this.field.fireEvent("spin",this.field,this);this.field.fireEvent("spindown",this.field,this)},spin:function(f,c){var b=parseFloat(this.field.getValue());var e=(c==true)?this.alternateIncrementValue:this.incrementValue;(f==true)?b-=e:b+=e;b=(isNaN(b))?this.defaultValue:b;b=this.fixBoundries(b);this.field.setRawValue(b)},fixBoundries:function(c){var b=c;if(this.field.minValue!=undefined&&b<this.field.minValue){b=this.field.minValue}if(this.field.maxValue!=undefined&&b>this.field.maxValue){b=this.field.maxValue}return this.fixPrecision(b)},fixPrecision:function(c){var b=isNaN(c);if(!this.field.allowDecimals||this.field.decimalPrecision==-1||b||!c){return b?"":c}return parseFloat(parseFloat(c).toFixed(this.field.decimalPrecision))},doDestroy:function(){if(this.trigger){this.trigger.remove()}if(this.wrap){this.wrap.remove();delete this.field.wrap}if(this.splitter){this.splitter.remove()}if(this.dd){this.dd.unreg();this.dd=null}if(this.proxy){this.proxy.remove()}if(this.repeater){this.repeater.purgeListeners()}}});Ext.form.Spinner=Ext.ux.Spinner;Ext.ns("Ext.ux.form");Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:"wrap",deferHeight:true,autoSize:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(e){var c=Ext.copyTo({},e,"incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass");var f=this.spinner=new Ext.ux.Spinner(c);var b=e.plugins?(Ext.isArray(e.plugins)?e.plugins.push(f):[e.plugins,f]):f;Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(e,{plugins:b}))},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab,this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");this.field.onBlur.call(this.field)},getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},validateBlur:function(){return true}});Ext.reg("spinnerfield",Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;Ext.override(Array,{findBy:function(f){var c=[];for(var e=0,b=this.length;e<b;e++){if(f.call(this||scope,this[e])){c.push(this[e])}}if(c.length!=0){return c}}});Ext.override(String,{endsWith:function(b){return this.substring(this.length-b.length)==b}});Ext.ux.Sound=(function(){var b=(navigator.plugins&&Array.prototype.findBy.call(navigator.plugins,function(h){return h.name.indexOf("Flash")!==-1}));var f=(Ext.isGecko&&Ext.isWindows),e=!f||(navigator.plugins&&Array.prototype.findBy.call(navigator.plugins,function(h){return h.name.indexOf("QuickTime")!==-1}));if(!e){return{enable:Ext.emptyFn,disable:Ext.emptyFn,play:Ext.emptyFn}}var c={};return{enable:function(){e=true},disable:function(){e=false},play:function(m,k){if(!e){return}var k=Ext.apply({track:"global",url:m,replace:false},k);if(k.replace&&c[k.track]){for(var n=0;n<=c[k.track].id;n++){var p=Ext.get("sound_"+k.track+"_"+n);p.dom.Stop&&p.dom.Stop();p.remove()}c[k.track]=null}if(c[k.track]){c[k.track].id++}else{c[k.track]={id:0}}k.id=c[k.track].id;var p;if(k.url.endsWith(".swf")&&b){var h="sound_"+k.track+"_"+k.id;var j={tag:"object",cls:"x-hide-offsets",cn:[{tag:"embed",src:k.url,type:"application/x-shockwave-flash",quality:"high"},{tag:"param",name:"quality",value:"high"},{tag:"param",name:"movie",value:k.url}]};if(Ext.isIE){j.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";j.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";j.id=h}else{j.cn[0].id=h}Ext.DomHelper.useDom=true;Ext.getBody().createChild(j,null,true);Ext.getDom(h).Play();Ext.DomHelper.useDom=false;return}else{if(Ext.isIE){p=document.createElement("bgsound");p.setAttribute("src",k.url);p.setAttribute("loop","1");p.setAttribute("autostart","true")}else{if(f&&!k.url.endsWith(".wav")){p=document.createElement("object");p.setAttribute("type","audio/mpeg");p.setAttribute("data",k.url)}else{p=document.createElement("embed");p.setAttribute("src",k.url);p.setAttribute("hidden","true");p.setAttribute("loop","false");p.setAttribute("autostart","true")}}}p.className="x-hide-offsets";p.setAttribute("id","sound_"+k.track+"_"+k.id);document.body.appendChild(p)}}})();Ext.ns("Ext.ux.TabPanel");Ext.ux.TabPanel.Slideable=Ext.extend(Ext.TabPanel,{constructor:function(b){Ext.ux.TabPanel.Slideable.superclass.constructor.call(this,b)},initComponent:function(){var b=this.layout;delete this.layout;Ext.ux.TabPanel.Slideable.superclass.initComponent.call(this);if(b){this.setLayout(new Ext.Container.LAYOUTS[b](this.layoutConfig))}}});Ext.reg("tabpanel_slideable",Ext.ux.TabPanel.Slideable);Ext.ns("Ext.ux.TabPanel");Ext.ux.TabPanel.Slideable=Ext.extend(Ext.TabPanel,{constructor:function(b){Ext.ux.TabPanel.Slideable.superclass.constructor.call(this,b)},initComponent:function(){var b=this.layout;delete this.layout;Ext.ux.TabPanel.Slideable.superclass.initComponent.call(this);if(b){this.setLayout(new Ext.Container.LAYOUTS[b](this.layoutConfig))}}});Ext.reg("tabpanel_slideable",Ext.ux.TabPanel.Slideable);Ext.ns("ExtX.Toolbar");ExtX.Toolbar.Paging=Ext.extend(Ext.PagingToolbar,{slots:true,cls:"pagingToolbar",initComponent:function(){this.addEvents("show-page");ExtX.Toolbar.Paging.superclass.initComponent.call(this);this.remove(this.refresh);var b=this.items.indexOf(this.last);this.remove(b+1)},refresh:function(){this.doLoad(this.cursor,true)},doLoad:function(e,b){var c=e+this.pageSize-1;if(this.fireEvent("beforechange",this,e,c)!==false){this.fireEvent("show-page",this,e,c,b)}},onLoad:function(c,e,j){if(!this.rendered){this.dsLoaded=[c,e,j];return}var f=this.getParams();this.cursor=j[f.start||"from"]||0;var h=this.getPageData(),k=h.activePage,b=h.pages;this.afterTextItem.setText(String.format(this.afterPageText,h.pages));this.inputItem.setValue(k);this.first.setDisabled(k==1);this.prev.setDisabled(k==1);this.next.setDisabled(k==b);this.last.setDisabled(k==b||b=="N/A");this.refresh.hide();this.updateInfo();this.fireEvent("change",this,h)},getPageData:function(){var b=this.store;var c=b.getTotalCount();var e={total:c,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:c<this.pageSize?1:Math.ceil(c/this.pageSize)};if(isNaN(e.pages)){e.pages="N/A"}return e}});Ext.reg("ExtX.Toolbar.Paging",ExtX.Toolbar.Paging);Ext.ns("Ext.ux.window");Ext.ux.window.MessageWindowGroup=function(b){b=b||{};var c=new Ext.WindowGroup();c.positions=[];Ext.apply(c,b);return c};Ext.ux.window.MessageWindowMgr=Ext.ux.window.MessageWindowGroup();Ext.ux.window.MessageWindow=Ext.extend(Ext.Window,{hideAction:"close",autoHide:true,autoHeight:false,bodyStyle:{"text-align":"left",padding:"10px"},buttonAlign:"center",cls:"x-notification",constrain:true,constrainHeader:true,draggable:true,floating:true,frame:true,handleHelp:Ext.emptyFn,help:true,hideFx:{delay:5000},hoverCls:"msg-over",iconCls:"x-icon-information",minHeight:40,minWidth:200,msgs:[],monitorResize:true,pinOnClick:true,pinState:"unpin",plain:false,resizable:false,textHelp:"Get help",textPin:"Pin this to prevent closing",textUnpin:"Unpin this to close",initHidden:true,initComponent:function(){Ext.apply(this,{collapsible:false,footer:false,minHeight:20,stateful:false});if(this.interval){this.startAutoRefresh()}if(this.autoHide){if(this.pinState==="unpin"){this.task=new Ext.util.DelayedTask(this[this.hideAction],this,[this.animateTarget])}}else{this.closable=true}Ext.ux.window.MessageWindow.superclass.initComponent.call(this);this.on({mouseout:{scope:this,fn:this.onMouseout}});this.addEvents("afterpin","afterunpin","click");this.initFx()},initEvents:function(){this.manager=this.manager||Ext.ux.window.MessageWindowMgr;Ext.ux.window.MessageWindow.superclass.initEvents.call(this)},focus:function(){Ext.ux.window.MessageWindow.superclass.focus.call(this)},toFront:function(){if(this.manager.bringToFront(this)){if(this.focusOnShow){this.focus()}}return this},initTools:function(){if(this.pinOnClick){this.addTool({id:"unpin",handler:this.handlePin,hidden:(!this.pinState||this.pinState==="pin"),qtip:this.textPin,scope:this});this.addTool({id:"pin",handler:this.handleUnpin,hidden:(!this.pinState||this.pinState==="unpin"),qtip:this.textUnpin,scope:this})}if(this.help){this.addTool({id:"help",handler:this.handleHelp,qtip:this.textHelp,scope:this})}Ext.ux.window.MessageWindow.superclass.initTools.apply(this,arguments)},onRender:function(c,b){Ext.ux.window.MessageWindow.superclass.onRender.call(this,c,b);if(this.clip){switch(this.clip){case"bottom":Ext.destroy(this.getEl().child("."+this.baseCls+"-bl"));break}}if(true){this.el.addClassOnOver(this.hoverCls)}Ext.fly(this.body.dom).on("click",this.handleClick,this)},close:function(b){if(this.fireEvent("beforeclose",this)!==false){this.hide(b,function(){this.fireEvent("close",this);this.destroy()},this)}},togglePinState:function(b){if(this.pinOnClick){if(this.tools.unpin.isVisible()){this.handlePin(b,this.tools.unpin,this)}else{this.handleUnpin(b,this.tools.pin,this)}}},createElement:function(b,c){if(this.shiftHeader){switch(b){case"header":return;case"tbar":Ext.ux.window.MessageWindow.superclass.createElement.call(this,"header",c);Ext.ux.window.MessageWindow.superclass.createElement.call(this,b,c);return}}Ext.ux.window.MessageWindow.superclass.createElement.call(this,b,c)},focus:Ext.emptyFn,getState:function(){return Ext.apply(Ext.ux.window.MessageWindow.superclass.getState.call(this)||{},this.getBox())},handleClick:function(b){this.fireEvent("click",this,this.msg);this.togglePinState(b)},handlePin:function(e,c,b){c.hide();this.tools.pin.show();this.cancelHiding();this.fireEvent("afterpin",this)},handleUnpin:function(e,c,b){c.hide();this.tools.unpin.show();this[this.hideAction](this.animateTarget);this.fireEvent("afterunpin",this)},cancelHiding:function(){this.addClass("fixed");if(this.autoHide){if(this.pinState==="unpin"){this.task.cancel()}}if(this.tools.pin){this.tools.pin.show()}if(this.tools.unpin){this.tools.unpin.hide()}},initFx:function(){this.showFx=this.showFx||{};Ext.applyIf(this.showFx,{align:"b",duration:1,callback:this.afterShow,scope:this});this.hideFx=this.hideFx||{};Ext.applyIf(this.hideFx,{block:false,callback:this.afterHide,easing:"easeOut",remove:true,scope:this});this.origin=this.origin||{};Ext.applyIf(this.origin,{el:Ext.getDoc(),increment:true,pos:"br-br",offX:-20,offY:-20,spaY:5})},getAnimEl:function(c){var e;if(c.useProxy){e=this.proxy;this.proxy.setOpacity(0.5);this.proxy.show();var b=this.getBox(false);this.proxy.setBox(b);this.el.hide()}else{e=this.el}return e},animHide:function(){this.manager.positions.remove(this.pos);var c=this.hideFx,b=this.getAnimEl(c);switch(c.mode){case"none":break;case"slideIn":b[c.mode]("b",c);break;case"custom":Ext.callback(c.callback,c.scope,[this,b,c]);break;case"standard":c.duration=c.duration||0.25;c.opacity=0;b.shift(c);break;default:c.duration=c.duration||1;b.ghost("b",c);break}},afterShow:function(){Ext.ux.window.MessageWindow.superclass.afterShow.call(this);this.on("move",function(){this.manager.positions.remove(this.pos);this.cancelHiding()},this);if(this.autoHide){if(this.pinState==="unpin"){this.task.delay(this.hideFx.delay)}}},animShow:function(){if(this.el.isVisible()&&this.el.hasClass(this.hoverCls)){return}if(this.msgs.length>1){this.updateMsg()}var c=this.showFx,b=this.el;this.position(b);b.slideIn(c.align,c)},position:function(c){var e,b=(this.showFx.align.substr(0,1)=="t")?1:-1;this.pos=0;if(this.origin.increment){while(this.manager.positions.indexOf(this.pos)>-1){this.pos++}this.manager.positions.push(this.pos)}this.setSize(this.width||this.minWidth,this.height||this.minHeight);if(this.origin.increment){e=this.origin.offY+((this.getSize().height+this.origin.spaY)*this.pos*b)}else{e=0}c.alignTo(this.origin.el,this.origin.pos,[this.origin.offX,e])},onMouseout:function(){},positionPanel:function(c,b,f){if(b&&typeof b[1]=="number"){f=b[1];b=b[0]}c.pageX=b;c.pageY=f;if(b===undefined||f===undefined){return}if(f<0){f=10}var e=c.translatePoints(b,f);c.setLocation(e.left,e.top);return c},setMessage:function(b){this.body.update(b)},setTitle:function(c,b){Ext.ux.window.MessageWindow.superclass.setTitle.call(this,c,b||this.iconCls)},startAutoRefresh:function(b){if(b){this.updateMsg(true)}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId)}this.autoRefreshProcId=setInterval(this.animShow.createDelegate(this,[]),this.interval)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId)}},updateMsg:function(b){if(this.el&&!this.el.hasClass(this.hoverCls)){if(b){}else{this.msgIndex=this.msgs[this.msgIndex+1]?this.msgIndex+1:0;this.msg=this.msgs[this.msgIndex]}this.body.update(this.msg.text)}else{}}});Ext.reg("message-window",Ext.ux.window.MessageWindow);Ext.ux.Wizard=Ext.extend(Ext.Panel,{stepTitleTpl:"<h3>{stepTitle} [{stepIndex}/{stepCount}]</h3><br>",constructor:function(c){Ext.ux.Wizard.superclass.constructor.call(this,c);var b=this.getNavButtons();if(b.prev){b.prev.disabled=true;if(!b.prev.handler){b.prev.handler=this.onPrev.createDelegate(this)}}if(b.next){if(!b.next.handler){b.next.handler=this.onNext.createDelegate(this)}}if(b.finish){b.finish.hidden=true;if(!b.finish.handler){b.finish.handler=this.onFinish.createDelegate(this)}}this.stepTitleItem=this.getStepTitleItem();this.stepJumpItem=this.getStepJumpItem();this.jumpData=[];if(b.cancel){if(!b.cancel.handler){b.cancel.handler=this.onCancel.createDelegate(this)}}},disableButtons:function(){this.updateNavButtons(true)},addStep:function(f){var e=this.getCardLayout();if(Ext.isArray(f)){Ext.each(f,function(h){this.addStep(h)})}else{e.add(f);var b=this.jumpData;var c=[b.length,f.stepTitle];b.push(c)}},onRender:function(c,b){var e=this.getCardLayout();Ext.ux.Wizard.superclass.onRender.call(this,c,b);(function(){var f=(typeof this.stepIndex=="undefined"?0:this.stepIndex);this.setActiveStep(f);if(this.stepJumpItem){this.jumpCombo=new Ext.form.ComboBox({renderTo:this.stepJumpItem.body,width:this.stepJumpItem.el.getWidth(true),editable:false,triggerAction:"all",mode:"local",displayField:"cap",valueField:"idx",store:new Ext.data.SimpleStore({fields:["idx","cap"],data:this.jumpData}),listeners:{scope:this,select:function(k,h,j){this.fireEvent("onstepchanged");this.setActiveStep(j)}}})}this.updateStepTitle();this.stepIndex=undefined}).defer(1,this)},getStepTitleItem:function(){return this.stepTitleItem||(this.stepTitleItem=this.findBy(function(b){return b.stepTitleItem===true},this)[0])},getStepJumpItem:function(){return this.stepJumpItem||(this.stepJumpItem=this.findBy(function(b){return b.stepJumpItem===true},this)[0])},getNavButtons:function(){if(!this.navButtons){function c(h,e){if(h.buttons){var f;Ext.each(h.buttons,function(j){if(j.wizardButton===e){f=j;return false}});return f}}this.navButtons={prev:false,next:false,finish:false,cancel:false};for(buttonName in this.navButtons){var b=c(this,buttonName)||(this.findBy(function(e){return e.wizardButton===buttonName||(e.buttons&&c(e,buttonName))},this)[0]);if(b){this.navButtons[buttonName]=b}}}return this.navButtons},getCardLayout:function(){return this.cardLayout||(this.cardLayout=this.findBy(function(b){return b.layout==="card"},this)[0])},getStepIndex:function(c){var b=this.getCardLayout();return this.cardLayout.items.indexOf(c)||0},getStepCount:function(){var b=this.getCardLayout();return(!b.items?0:b.items.length)},updateStepTitle:function(){var c=this.getStepTitleItem();if(!c){return false}var e=this.getStepIndex(this.getActiveStep());var h=this.getStepCount();if(typeof this.stepTitleTpl=="string"&&this.stepTitleTpl!=""){this.stepTitleTpl=new Ext.XTemplate(this.stepTitleTpl)}var f=this.getActiveStep();var b=(f&&f.stepTitle?f.stepTitle:"");if(!(typeof this.stepTitleTpl=="string"&&this.stepTitleTpl=="")){this.stepTitleTpl.overwrite(c.el,{stepIndex:e+1,stepCount:h,stepTitle:b})}if(this.jumpCombo){this.jumpCombo.setValue(e)}},updateNavButtons:function(h){var e=this.getNavButtons();var f=this.getStepIndex(this.getActiveStep());var k=this.getStepCount();var j;j={prev:true,next:true,finish:"hide",cancel:true};if(f<=0){j.prev=false}if(f>=k-1){j.next="hide";j.finish=true}if(this.buttonStatus){j=this.buttonStatus}for(buttonName in e){var c=e[buttonName];var b=j[buttonName];if(!c){}else{if(c&&b=="hide"){c.hide()}else{c.show();if(h){c.setDisabled(true)}else{c.setDisabled(!b)}}}}},setActiveStep:function(e,b,k){var c=this.getCardLayout();var h=this.getStepCount();if(h==0){this.updateNavButtons();return false}else{if(!isNaN(e)&&(e<0||e>=h)){return false}}var n=this.getActiveStep();var m=(b?n:this.getCardLayout().layout.container.getComponent(e));if(n){if(!b&&n===m){if(!k){return false}}else{if(!this.noValidate&&!n.noValidate&&n.validate&&!n.validate()){var j=this.getStepIndex(n);var f=this.getStepIndex(m);if(f>=j){n.fireEvent("invalid",n,this);return false}}else{if(n.fireEvent("beforestepchange",n,this)===false){return false}}}}if(!b){c.layout.setActiveItem(m);m.fireEvent("stepchange",m,this)}this.updateNavButtons();this.updateStepTitle();return true},onNext:function(){var c=this.getActiveStep();c.fireEvent("onnextclick",c,this);var b=this.getStepIndex(this.getActiveStep());this.setActiveStep(b+1)},onPrev:function(){var c=this.getActiveStep();c.fireEvent("onprevclick",c,this);var b=this.getStepIndex(this.getActiveStep());this.setActiveStep(b-1)},onFinish:function(){var b=this.getActiveStep();b.fireEvent("onfinishclick",b,this);if(this.setActiveStep(undefined,true)){if(this.afterFinish){this.addStep(this.afterFinish);var c=this.getStepCount();this.setActiveStep(c-1);this.disableButtons()}this.fireEvent("onfinishclick",this.getActiveStep(),this)}},onCancel:function(){var b=this.getActiveStep();b.fireEvent("oncancelclick",b,this)},getActiveStep:function(){var b=this.getCardLayout();return b.layout.activeItem}});Ext.reg("wizard",Ext.ux.Wizard);Ext.jx.setTable({_VENDOR_PRICING:{templates:{gdsair:'<tpl for=".">{[ values._record.template("gdsair_line") ]}</tpl>',gdsair_line:["<TABLE cellSpacing='0' cellPadding='2' border='0' width=100% class=gdsAirRecord>","	<TBODY>","		<TR class='rl-air-search-header'>","			<TD width='20'>&nbsp;</TD>","			<TD colSpan='3' width='100%'>",'				<span class="ux-row-action-item"  qtip="Add the item to your quote" actionIndex=0  style="width:45px">','				<img src={[Ext.BLANK_IMAGE_URL]} class="ux-row-action-blank-icon  add-to-cart-orange"/>&#160;</span>',"				&nbsp;&nbsp;&nbsp; <B>{[ values._record.getPriceConverted() ]} Roundtrip</B>","			</TD>","		</TR>","		<TR bgColor='whitesmoke'>","			<TD width='20'>&nbsp;</TD>","			<TD colSpan='3'><table width='100%' cellSpacing='0' cellPadding='0'>","					<TR>","						<td>","							<b>Departure</b>","						</td>","						<td align='right'>","							<B>{#TRIP1_AIRLINE_NAME}</B>&nbsp;&nbsp;<IMG src='wrm_client/images/gds/airven/tn_{#TRIP1_AIRLINE_CODE}.gif' align='top' border='0'>","						</td>","					</TR>","				</table>","			</TD>","		</TR>","		<TR vAlign='top'>","			<TD width='20'>&nbsp;</TD>","			<td>","				<table cellSpacing='0' cellPadding='0' width='100%'>","					<tr>","						<TD width='20'>&nbsp;</TD>","						<td>						","							<table cellSpacing='0' cellPadding='0' valign=top>","							<tr valign=top>						","								<td zwidth='157'>","									<b>Depart</b> {#TRIP1_START_AIRP_NAME} ({#TRIP1_START_AIRP_CODE})<br>","									<b>Arrive</b> {#TRIP1_END_AIRP_NAME} ({#TRIP1_END_AIRP_CODE}) ","								</td>","							</tr>","							</table>","						</td>","						<TD width='10'></td>","						<TD zwidth='124'>","							<b>{#TRIP1_START_DATE_PRETTY}</b><BR>","						</TD>","						</TD>","						<TD width='10'></td>","						<TD zwidth='124'>","							<table cellSpacing='0' cellPadding='0' valign=top>","							<tr valign=top>						","								<TD zwidth='100'>","									<B>{#TRIP1_START_TIME_PRETTY}</B><br>","									<B>{#TRIP1_END_TIME_PRETTY}</B>","								</TD>","							</tr>","							</table>","						</TD>","						<TD width='5'></td>","						<TD zwidth='76'>","							Flight: {#TRIP1_START_FLIGHT_NUM}<br>","							{#TRIP1_STOPS_PRETTY}","						</TD>","					</tr>","				</table>","			</td>","		</TR>","		<TR><td height=5></td></tr>		","		<TR bgColor='whitesmoke'>","			<TD width='20'>&nbsp;</TD>","			<TD colSpan='3'>","				<table width='100%' cellSpacing='0' cellPadding='0''>","					<TR>","						<td>","							<b>Return</b>","						</td>","						<td align='right'>","							<B>{#TRIP2_AIRLINE_NAME}</B>&nbsp;&nbsp;<IMG src='wrm_client/images/gds/airven/tn_{#TRIP2_AIRLINE_CODE}.gif' align='top' border='0'>","						</td>","					</TR>","				</table>","			</TD>","		</TR>","		<TR vAlign='top'>","			<TD width='20'>&nbsp;</TD>","			<td>","				<table cellSpacing='0' cellPadding='0' width='100%'>","					<tr>","						<TD width='20'>&nbsp;</TD>","						<td>						","							<table cellSpacing='0' cellPadding='0' valign=top>","							<tr valign=top>						","								<td zwidth='157'>","									<b>Depart</b> {#TRIP2_START_AIRP_NAME} ({#TRIP2_START_AIRP_CODE})<br>","									<b>Arrive</b> {#TRIP2_END_AIRP_NAME} ({#TRIP2_END_AIRP_CODE}) ","								</td>","							</tr>","							</table>","						</td>","						<TD width='10'></td>","						<TD zwidth='124'>","							<b>{#TRIP2_START_DATE_PRETTY}</b><BR>","						</TD>","						<TD width='10'></td>","						<TD zwidth='124'>","							<table cellSpacing='0' cellPadding='0' valign=top>","							<tr valign=top>						","								<TD zwidth='100'>","									<B>{#TRIP2_START_TIME_PRETTY}</B><br>","									<B>{#TRIP2_END_TIME_PRETTY}</B>","								</TD>","							</tr>","							</table>","						</TD>","						<TD width='5'></td>","						<TD zwidth='76'>","							Flight: {#TRIP2_START_FLIGHT_NUM}<br>","							{#TRIP2_STOPS_PRETTY}","						</TD>","					</tr>","				</table>","			</td>","		</TR>","		<TR><td height=5></td></tr>","		<TR>","			<TD width='20'>&nbsp;</TD>","			<TD colSpan='3'>&nbsp;","			</TD>","		</TR>","		<TR><td height=5></td></tr>","	</TBODY>","</TABLE>"],gdsair_line_compressed:["<div class='flights-trip departure-trip'>","<div class='trip-label'>Departure</div>","<div class='airport-label depart-airport'>Depart</div>","<div class='airport'>{#TRIP1_START_AIRP_NAME} ({#TRIP1_START_AIRP_CODE}) flight {#TRIP1_START_FLIGHT_NUM}</div>","<div class='airport-label arrive-airport'>Arrive</div>","<div class='airport'>{#TRIP1_END_AIRP_NAME} ({#TRIP1_END_AIRP_CODE})</div>","<div class='flight-stops'>{#TRIP1_STOPS_PRETTY}</div>","</div","<div class='flights-trip return-trip'>","<div class='trip-label'>Return</div>","<div class='airport-label depart-airport'>Depart</div>","<div class='airport'>{#TRIP2_START_AIRP_NAME} ({#TRIP2_START_AIRP_CODE}) flight {#TRIP2_START_FLIGHT_NUM}</div>","<div class='airport-label arrive-airport'>Arrive</div>","<div class='airport'>{#TRIP2_END_AIRP_NAME} ({#TRIP2_END_AIRP_CODE})</div>","<div class='flight-stops'>{#TRIP2_STOPS_PRETTY}</div>","</div"],longdescription:'<table><tr><td><b>{SUPERDES#NAME}</b>...{[ Ext.jx.ignoreNull(values["SUPERDES#MULTIPLE"]) ]}</td></tr></table>'},FuncsRow:{getVendor:function(){this.vendorRecord=(this.vendorRecord||Ext.jx.vendors[this.get("#LINK_TO_VENDOR")]);if(!this.vendorRecord){debug("no vendor record")}return this.vendorRecord},getService:function(){this.productRecord=(this.productRecord||Ext.jx.getRecord({tableName:"SERVICE",recordId:"SERVICE#CODE="+(this.get("BUILD#TYPE")||this.get("VENDOR#VENTYPE"))}));if(!this.productRecord){debug("no service record")}return this.productRecord},getPriceConverted:function(){return Ext.jx.math.formatCurrency(this.get("BUILD#PRICE"))},getQuantityMaxValue:function(){var c=this;var b=this.getService();if(b.isInventoryRequired()&&c.data["#MIN_AVAIL"]!="NA"){return Number(c.data["#MIN_AVAIL"])}else{return b.getQuantityMaxValue()}}}}});Ext.jx.setTable({AGENT:{Funcs:{getAgentByCode:function(c){var b=Ext.jx.getStore("AGENT");return b.getAt(b.find("AGENT#CODE",c))}}}});Ext.jx.setTable({BUILD:{FuncsRow:{getValue:function(b){if(/^VENDOR\./.test(b)){var c=this.getVendor();if(c){return c.getValue(b)}}if(b=="BUILD#PRTLINE"){return true}return Ext.data.Record.prototype.getValue.call(this,b)},get_product:function(){return this.getService()},get_startdate_pretty:function(b){return WRM.date.convert_text_pretty(this.getValue("BUILD#DDATE"),b)},get_enddate_pretty:function(b){return WRM.date.convert_text_pretty(this.getValue("BUILD#RDATE"),b)},show_enddate:function(){return this.getValue("BUILD#RDATE")&&this.getValue("BUILD#DDATE")!=this.getValue("BUILD#RDATE")},get_popup_url:function(){},getService:function(){var b;if(this.recordProduct){return this.recordProduct}if((b=this.get("BUILD#TYPE")||this.get("VENDOR#VENTYPE"))){return this.recordProduct=Ext.jx.getRecord({tableName:"SERVICE",recordId:"SERVICE#CODE="+b})}},get_service_desc:function(){var c=this.getValue("BUILD#CODE");var b;if(c=="CC-ADJ"){b="Automatic credit card adjustment"}else{if(c=="PL-ADJ"){b="Automatic department adjustment"}else{if(c=="INS-ADJ"){b="Automatic insurance line"}else{if(c=="ADJUST"){b="Profit/Price adjustment"}else{if(c=="AUTO"){b="One time per person markup"}else{b=this.getValue("BUILD#SERVICE")||""}}}}}return b},get_service_desc_without_quanity:function(){var b=this.get_service_desc();return b.replace(/^(.*?:\s)?/,"")},get_res:function(){},get_price_converted:function(){return this.getValue("BUILD#PRICE")},get_tprice_converted:function(){return this.getValue("BUILD#TPRICE")},get_description:function(){if(this.get("BUILD#TYPE")=="S*"){return this.get("SPECIAL#DESC")}var b=this.getService();return b&&b.get("SERVICE#DESCRIP")},getVendor:function(){if(this.recordVendor){return this.recordVendor}var b=this.get("#LINK_TO_VENDOR");if(!b){b="VENDOR#VENID="+this.get("BUILD#VENID")+"&VENDOR#MGTCOID="+(this.get("BUILD#MGTCOID")||"~~NULL~~")}return this.recordVendor=Ext.jx.vendors&&Ext.jx.vendors[b]},getPrice:function(){return Number(this.get("BUILD#PRICE"))},getNicePrice:function(){return Ext.jx.math.formatCurrency(this.getPrice())},getTotalPrice:function(){return Number(this.get("BUILD#TPRICE"))},getNiceTotalPrice:function(){return Ext.jx.math.formatCurrency(this.getTotalPrice())}}}});Ext.jx.setTable({CURRENCY:{Funcs:{getCurrencyByCode:function(c){var b=Ext.jx.getStore("CURRENCY");return b.getAt(b.find("CURRENCY#CTYCODE",c))}},FuncsRow:{asString:function(b){return Ext.jx.math.formatCurrency(b,this)}}}});Ext.jx.setTable({DEPT:{Funcs:{getDept:function(){return Ext.jx.getStore("DEPT").getAt(0)}},FuncsRow:{get_superdests_with_specials:function(){if(!this.a_superdests_with_specials){this.a_superdests_with_specials=[];var b={};Ext.each(this.get_specials(99),function(c){var e=c.get_super_dest_code();if(e&&!b[e]){b[e]=1;var f=c.get_super_dest();if(f){this.a_superdests_with_specials.push(f)}}},this)}return this.a_superdests_with_specials},get_specials:function(c,h){if(!h){h={}}var f=Ext.jx.getStore("SPECIAL");if(!c){c=9}var b=new Ext.data.Store({recordType:f.recordType});if(!h.s_destcode&&!h.b_no_featured_specials){h.b_featured_specials=1}var e=0;f.each(function(j){if(!h.b_featured_specials||j.get("SPECIAL#FEATURED")=="Y"){if(c!=null&&e++>=c){return false}b.add(j.copy())}});if(h.b_featured_specials&&!e&&!h.b_no_featured_specials){h.b_featured_specials=false;h.b_no_featured_specials=true;return this.get_specials(c,h)}b.sort("SPECIAL#SORTCODE");return b.getRange()},get_email_outer_start:function(){},get_email_outer_end:function(){},getQuoteBubble:function(c){if(!c){c={}}if(!c.id){c.id=Ext.id()}var b=Ext.jx.String.escapeHTML(Ext.encode(c));return{s_box:'<div class="rl-quote-bubble-placeholder">'+b+"</div>",s_start_quote_link:"Ext.getCmp('"+c.id+"').onNewQuote(); return false;",s_return_msg:""}},getQuotingRange:function(){var c="_quotingRange";if(!this[c]){var e=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMIN"))||new Date().add(Date.DAY,-30);var f=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMAX"))||new Date().add(Date.DAY,30*6);var b={minDate:e,maxDate:f};if(b.maxDate.subtractDt(b.minDate)<0){this[c]="null"}else{this[c]=new RL.Model.DateRange();this[c].addRange(b.minDate.clearTime(),b.maxDate.clearTime())}}return this[c]=="null"?undefined:this[c]},getQuotingRange_Start:function(){var c="_quotingRangeStart";if(!this[c]){var e=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMIN"))||new Date().add(Date.DAY,-30);var f=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMAX"))||new Date().add(Date.DAY,30*6);var h=Number(Ext.jx.getStoreValue("DEPT#TQDAYSMIN"))||0;if(h){f=f.add(Date.DAY,-1*h)}var b={minDate:e,maxDate:f};if(b.maxDate.subtractDt(b.minDate)<0){this[c]="null"}else{this[c]=new RL.Model.DateRange();this[c].addRange(b.minDate.clearTime(),b.maxDate.clearTime())}}return this[c]=="null"?undefined:this[c]},getQuotingRange_End:function(){var c="_quotingRangeEnd";if(!this[c]){var e=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMIN"))||new Date().add(Date.DAY,-30);var h=Number(Ext.jx.getStoreValue("DEPT#TQDAYSMIN"))||0;if(h){e=e.add(Date.DAY,h)}var f=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMAX"))||new Date().add(Date.DAY,30*6);var b={minDate:e,maxDate:f};if(b.maxDate.subtractDt(b.minDate)<0){this[c]="null"}else{this[c]=new RL.Model.DateRange();this[c].addRange(b.minDate.clearTime(),b.maxDate.clearTime())}}return this[c]=="null"?undefined:this[c]}}}});Ext.jx.setTable({GTAW:{forms:{SAVE_QUOTE_WIZARD:{xtype:"wizard",stepTitleTpl:"",anchor:"100% 100%",layout:"border",plain:true,bodyStyle:"padding:5px;",buttonAlign:"right",closable:true,items:[{region:"west",width:150,html:"<div class=wizardBookingImg></div>"},{frame:true,region:"center",layout:"anchor",bodyStyle:"padding:5px",items:[{stepTitleItem:true},{anchor:"100% 100%",layout:"card",activeItem:0,defaults:{border:false},autoScroll:true}]}],buttons:[{text:"Previous",wizardButton:"prev"},{text:"Next",wizardButton:"next"},{text:"Finish",wizardButton:"finish"}],listeners:{finish:function(){var b=this.getValues();var c=Ext.jx.getStore("GTAW").getAt(0);Ext.jx.debug("error: logic not finished")}}},SAVE_QUOTE_FINAL:{stepTitle:"Finishing",title:"Please wait while we are preparing your quote.",autoHeight:true,border:true,collapsible:false,width:480},BOOK_WIZARD:{xtype:"wizard",anchor:"100% 100%",layout:"border",plain:true,bodyStyle:"padding:5px;",buttonAlign:"right",closable:true,items:[{region:"west",width:150,baseCls:"wizardBookingImg",html:"&#160"},{frame:true,region:"center",bodyStyle:"padding:5px",layout:"card",activeItem:0,defaults:{border:false},autoScroll:true}],buttons:[{text:"Previous",wizardButton:"prev"},{text:"Next",wizardButton:"next"},{text:"Finish",wizardButton:"finish"}]},BOOK_WIZARD_TERMS:{stepTitle:"Terms & Conditions",noValidate:true,items:[{xtype:"panel",layout:"fit",name:"deptTerms",border:true,autoScroll:true,height:300,frame:true},{xtype:"radio",name:"termsAccept",value:true,boxLabel:"I accept the license agreement",checked:true,allowBlank:false},{xtype:"radio",name:"termsAccept",value:false,checked:false,boxLabel:"I do not accept the license agreement"}],listeners:{beforerender:function(){var b=Ext.jx.getRecord({tableName:"DEPT"});this.findField("deptTerms").html=b.get("DEPT#WEBTERMS")},beforestepchange:function(){var b=false;this.cascade(function(c){if(c.name==="termsAccept"&&c.value){b=c.getValue();return false}});if(!b){Ext.MessageBox.alert("Terms and Conditions","In order to proceed, you must accept our license agreement.");return false}}}},BOOK_WIZARD_CUSTOMER:{stepTitle:"Customer",xtype:"fieldset",title:"Customer Information",autoHeight:true,border:true,defaultType:"textfield",collapsible:false,width:480,items:[{fieldLabel:"First Name",name:"PROSPW#FIRST",width:200,allowBlank:false},{fieldLabel:"Last Name",name:"PROSPW#LAST",width:200,allowBlank:false},{fieldLabel:"Group/Company",name:"PROSPW#GROUP_NAME",width:200,allowBlank:false},{fieldLabel:"Email",name:"PROSPW#EMAIL",width:200,vtype:"email",allowBlank:false},{fieldLabel:"Email Opt-In",name:"PROSPW#EMAILSPEC",xtype:"checkbox",value:"false",allowBlank:true},{fieldLabel:"Address 1",name:"PROSPW#ADDRESS",width:200,allowBlank:false},{fieldLabel:"Address 2",name:"PROSPW#ADDRESS2",width:200,allowBlank:true},{fieldLabel:"City",name:"PROSPW#CITY",width:200,allowBlank:false},{fieldLabel:"State/Province",name:"PROSPW#STATE",width:200,allowBlank:false},{fieldLabel:"Zip/Postal Code",name:"PROSPW#ZIP",width:200,allowBlank:false},{fieldLabel:"Phone (day)",name:"PROSPW#PHONE_DAY",width:200,allowBlank:false},{fieldLabel:"Phone (night)",name:"PROSPW#PHONE_NITE",width:200,allowBlank:false}],listeners:{invalid:function(){Ext.MessageBox.alert("Missing fields","Please put in the missing fields.")}}},BOOK_WIZARD_PAX_COUNT:{stepTitle:"Passenger Count",items:[{xtype:"fieldset",autoHeight:true,defaultType:"textfield",collapsible:false,items:[{fieldLabel:"No. Adults",name:"passengerNoAdult",allowBlank:false,minValue:1,maxValue:50,decimalPrecision:0,width:50,xtype:"uxspinner"},{fieldLabel:"No. Children",name:"passengerNoChild",minValue:0,maxValue:50,decimalPrecision:0,width:50,xtype:"uxspinner"}]}],listeners:{beforeshow:function(){},beforestepchange:function(){}}},BOOK_WIZARD_PAX_NAMES:{stepTitle:"Passenger Names",name:"passenger",items:[{}],listeners:{beforeshow:function(){},beforestepchange:function(){}}},BOOK_WIZARD_PAX_NAMES_SINGLE:{xtype:"fieldset",collapsible:false,autoHeight:true,labelWidth:80,items:[{xtype:"textfield",fieldLabel:"First Name",width:"200",allowBlank:false},{xtype:"textfield",fieldLabel:"Last Name",width:"200",allowBlank:false},{hideLabel:true,labelAlign:"left",xtype:"radio",value:"adult",boxLabel:"Adult",height:20},{hideLabel:true,labelAlign:"left",xtype:"radio",value:"child",boxLabel:"Child",height:20},{fieldLabel:"Age",allowBlank:false,decimalPrecision:0,width:50,xtype:"uxspinner"}]},BOOK_WIZARD_CREDIT_CARD:{stepTitle:"Credit Card Information",items:[{xtype:"fieldset",autoHeight:true,defaultType:"textfield",collapsible:false,items:[{fieldLabel:"Amount",width:75,allowBlank:false},{xtype:"combo",fieldLabel:"Type",store:["Visa","MasterCard","American Express","Discover"],typeAhead:true,mode:"local",triggerAction:"all",emptyText:"",listWidth:120,width:120,forceSelection:true,allowBlank:false,selectOnFocus:true},{fieldLabel:"Credit Card No.",width:200,allowBlank:false},{fieldLabel:"Expiration Date",format:"m/Y",useDayDate:31,allowBlank:false},{fieldLabel:"Name on Card",width:200,allowBlank:false},{fieldLabel:"Security Code",width:35,allowBlank:false},{fieldLabel:"Billing Address",width:200,allowBlank:false}]}],listeners:{beforestepchange:function(){}}}}}});Ext.jx.setTable({GTAW:{templates:{description:'{[ values._record.getValue("RESORT#RESORT") ]}<br>{GTAW#DDATE} to {GTAW#RDATE}<br>{GTAW#ADULT} adults {GTAW#CHILD} children<br>'},FuncsRow:{is_booking:function(){var c=this;var b=c.getValue("GTAW.TYPE");return b=="B"||b=="S"},get_dept:function(){return Ext.jx.getStore("DEPT").getAt(0)},get_agent:function(){return Ext.jx.getTable("AGENT").Funcs.getAgentByCode(this.get("GTAW#SALESREP"))},get_payment_schedule:function(){var c=this;var e={value:c.getValue("GTAW#NETAMT")||0};var b=[];var f=c.get_payment(1,e);if(f){b.push(f)}f=c.get_payment(2,e);if(f){b.push(f)}f=c.get_payment(3,e);if(f){b.push(f)}f=c.get_payment(99,e);if(f){b.push(f)}return b},get_payment:function(n,m){var e=this,b,f,p;if(n==99){f=e.getValue("GTAW#FINDATE");p="Final";b=m.value}else{var q=(n==1?"":n);var h="GTAW#DEPDATE"+q;var r="GTAW#DEPAMT"+q;var c="GTAW#DEPTYPE"+q;var k=["","Deposit","Second Deposit","Third Deposit"];p=k[n];b=e.getValue(r)||0;f=e.getValue(h)||undefined;if(!b||!f){return undefined}var j=e.getValue(c)||false;if(!j){b=b*Number(e.getValue("GTAW#PAX")||1)}if(b>m.value){b=m.value}m.value-=b}b=Ext.jx.math.round(b,2);return{n_amount:b,s_date:f,s_payment_name:p}},getTripTitle:function(){var b=this.get("GTAW#TYPE");var c;if(b=="B"){c=l("Reservation Confirmation")}else{if(b=="S"){c=l("Confirmation Request")}else{c=this.getTripTypePretty()+" "+l("Overview")}}return c},getTripTypePretty:function(){var b=this.get("GTAW#TYPE");var c={P:"Proposal",I:"Inactive",S:"Confirmation Request",B:"Confirmation",C:"Cancellation"};return c[b]||b||c.P},getPaxDesc:function(){var b=this.getValue("GTAW#ADULT");var c=!b?"":b+(b==1?" "+l("adult"):" "+l("adults"));var f=this.getValue("GTAW#CHILD");if(f=="0"){f=""}var e=!f?"":" / "+f+(f==1?" "+l("child"):" "+l("children"));var h=this.getValue("GTAW#INFANT");if(h=="0"){h=""}var j=!h?"":" / "+h+(h==1?" "+l("infant"):" "+l("infants"));return c+e+j},get_customer_phones:function(){var b="";var e=this.getValue("PROSPW#PHONE_DAY");var c=this.getValue("PROSPW#PHONE_NITE");if(/\d/.test(e)){b+=e+"<br>"}if(/\d/.test(c)){b+=c+"<br>"}return b},get_customer_desc:function(c){var j;var m=this.getValue("PROSPW#GROUP_NAME");var e=this.getValue("PROSPW#AGENCY");var h=this.getValue("PROSPW#FIRST");var k=this.getValue("PROSPW#LAST");var b=this.getValue("GTAW#AGENT");var n=this.getValue("GTAW#AGENTEMAIL");var f=this.getValue("GTAW#LEADNAME");if(!this.getValue("PROSPW#CUSTNUM")){j="Anonymous Customer"}else{if(e&&m||(!h&&!k)){j=m}else{j=h+" "+k}}if(c&&e){if(b){j+="<br> Travel Agent: "+b}if(n){j+="<br> Travel Agent Email: "+n}if(f){j+="<br> Lead Name: "+f}}return j},get_note:function(){},get_header:function(){var e;var c=this.get_dept();var b=this.getValue("GTAW#TYPE");if(b=="B"){e=c.getValue("DEPT#BKHEADER")}else{if(b=="S"){e=c.getValue("DEPT#SOBKHEADER")}else{e=c.getValue("DEPT#TQHEADER")}}return e},get_quote_links:function(){},get_tsis:function(){return Ext.jx.getStore("BUILD").getRange()},getCurrency:function(){return RL.Global.getCurrency().get("CURRENCY#CTYCODE")},isFinalized:function(){return this.get("GTAW#RESNUM")},getTypeDesc:function(){var e=Ext.jx.getStore("GTAW").getAt(0);var c=e.get("GTAW#RESNUM");if(!c){return""}var b={P:"Proposal",B:"Confirmation",S:"Confirmation Request",D:"Inactive",C:"Cancellation"};return b[e.get("GTAW#TYPE")||"P"]+": "+e.get("GTAW#RESNUM")},getResortRecord:function(){var b=Ext.jx.getStore("RESORT");return b.getAt(b.find("RESORT#SEARCHCODE",this.get("GTAW#RESORT")))},organizeBuildByType:function(){var b={};var c=Ext.jx.getStore("BUILD");c.each(function(j){var h=j.getService();if(!h){return}var f=h.data["SERVICE#CODE"];var e=b[f]=b[f]||[];e.push(j)});return b},getAdultsNum:function(){return Number(this.get("GTAW#ADULT")||0)},getChildrenNum:function(){return Number(this.get("GTAW#CHILD")||0)},getDDate:function(b){return Ext.jx.cleanDate(this.get("GTAW#DDATE"))},getRDate:function(b){return Ext.jx.cleanDate(this.get("GTAW#RDATE"))},checkDatesSearch:function(c,h,f,b){if(h&&f&&!Ext.jx.getStore("BUILD").getCount()){if(b){this.data["GTAW#RESORT"]=b}var e=Number(c.get("SERVICE#DDATEPLUS"));if(isNaN(e)){e=0}this.data["GTAW#DDATE"]=h.add("d",-1*e);var j=Number(c.get("SERVICE#RDATEMINUS"));if(isNaN(j)){j=0}this.data["GTAW#RDATE"]=f.add("d",j)}}}}});Ext.namespace("Ext.jx.Misc");(function(){var c="<select class=quantityDropdown>";for(var b=0;b<=100;b++){c+="<option value="+b+">"+b+"</option>"}c+="</select>";Ext.jx.Misc.getSimpleQtyActionCol=function(){return{header:l("Quantity"),width:50,renderer:function(f,h,e,j){return c}}}})();Ext.jx.setTable({PRODGRP:{Funcs:{getNonEmptyGroups:function(c){var b=[];var e=Ext.jx.getStore("PRODGRP");e.each(function(f){if(f.get(c||"PRODGRP#TLVISIBLE")!=1){return}if(f.get_products().getCount()){b.push(f)}});return b},getProductsCodes:function(){var c=[];var b=this.getNonEmptyGroups();Ext.each(b,function(f){var e=f.get_products();e.each(function(h){c.push(h.get("SERVICE#CODE"))})});return c}},FuncsRow:{get_products:function(){var c=this;if(c._products){return c._products}var b=Ext.jx.getStore("SERVICE","ALL");b.sort("SERVICE#LINERANGE","ASC");b.sort("SERVICE#PG_SORT","ASC");var e=c.get("PRODGRP#PGID");return c._products=!e?new Ext.util.MixedCollection():b.query("SERVICE#PGID",e)},autoCalcEndDate:function(){var b=this;return Number(b.data["PRODGRP#CALCENDDAT"])==1}}}});Ext.jx.setTable({RESORT:{templates:{shortcleandesc:["{[",'values._record.getImageHtml(1,"TN_")+','values._record.getName("bold")+','values._record.getDescRaw("browse",400)',"]}"],shortdescription:["<table><tr><td>","{[",'values._record.getImageHtml(1,"TN_")+','values._record.getName("bold")+','values._record.getDescRaw("browse",400)',"]}","</td></tr></table>"],description:'<table><tr><td><img style="float:left; margin:3px" src="{[Ext.jx.getStoreValue("CONFIG#IMAGEPATH")]}/BR_{RESORT#IMAGE1}"><b>{RESORT#RESORT}</b>...{[ values["RESORT#MULTIPLE"] ]}</td></tr></table>',description_nopic:'<b>{RESORT#RESORT}</b>...{[ values["RESORT#MULTIPLE"] ]}',longdescription:'<table><tr><td><img style="float:left; margin:3px" src="{[Ext.jx.getStoreValue("CONFIG#IMAGEPATH")]}/BR_{RESORT#IMAGE1}"><b>{RESORT#RESORT}</b>...{[ Ext.jx.ignoreNull(values["RESORT#MULTIPLE"]) ]}</td></tr></table>'},Funcs:{getDestinationByCode:function(c){var b=Ext.jx.getStore("RESORT");return b.getAt(b.find("RESORT#SEARCHCODE",c))}},FuncsRow:{get_super_dest:function(){return this.getSuperDestRecord()},getLink:function(b){return WRM.html.getLink({dest:this.getCode(),screen:"tpl(DEST::"+b.tpl+")"})},getSpecials:function(h,c){var j=Ext.jx.getStore("SPECIAL");var b=new Ext.data.Store({recordType:j.recordType});var f=this.getCode();var e=0;j.each(function(k){if(k.get("SPECIAL#RESORT")==f&&(!h||k.get("SPECIAL#FEATURED"))){if(c!=null&&e++>=c){return false}b.add(k.copy())}});b.sort("SPECIAL#SORTCODE");return b},getShortCleanDesc:function(){return this.getImageHtml(1,"TN_")+this.getName("bold")+this.getDescRaw("browse",400)+'<div class="x-clear"></div>'},getCode:function(){return this.get("RESORT#SEARCHCODE")},getDesc:function(){var b=Ext.jx.ignoreNull(this.data["RESORT#MULTIPLE"])||Ext.jx.ignoreNull(this.data["RESORT#SINGLE"]);return b.replace(/\/\/-->/g,"")},hasPictures:function(){return this.data["RESORT#IMAGE1"]&&this.data["RESORT#IMAGE2"]},getRandomImage:function(){var b=[];for(var c=1;c<=10;c++){var e=this.get("RESORT#IMAGE"+c);if(!e){continue}b.push(e)}return b[Math.floor(b.length*Math.random())]},checkAllRequiredProducts:function(){var e={desc:"",index:{}};var h=Ext.jx.getStore("GTAW").getAt(0);var k=Ext.jx.getStore("SERVICE");var c=h.organizeBuildByType();var b=this.getRequiredProducts();for(var f in b){if(!c[f]){var j=k.data.map["SERVICE#CODE="+f];if(j){e.index[f]=1;if(e.desc.length){e.desc+=", "}e.desc+=j.data["SERVICE#DESCRIP"]}}}return e},getRequiredProducts:function(){if(this.requiredProducts){return this.requiredProducts}this.requiredProducts={};var b=Ext.jx.getStore("SERVICE");var c=this.data["RESORT#PRODDEF"].split(",");Ext.jx.each(c,function(f){var h=Ext.util.Format.trim(f.substr(0,2));if(h==""){return}var j=b.data.map["SERVICE#CODE="+h];if(!j){return}if(j.data["SERVICE#TLVISIBLE"]!="Y"){return}var e=Ext.util.Format.trim(f.substr(2,1));if(e!=2){return}this.requiredProducts[h]=1},this);return this.requiredProducts},get_products:function(b){if(this.products){return this.products}this.products=[];var c=Ext.jx.getStore("SERVICE");var e=this.data["RESORT#PRODDEF"].split(",");Ext.jx.each(e,function(f){var h=Ext.util.Format.trim(f.substr(0,2));if(h==""){return}var j=c.data.map["SERVICE#CODE="+h];if(!j){return}if(j.data[b?"SERVICE#TLVISIBLE":"SERVICE#TABVISIBLE"]!="Y"){return}this.products.push(j)},this);this.products=this.products.sort(function(h,f){return h.data["SERVICE#LINERANGE"]-f.data["SERVICE#LINERANGE"]});return this.products},getProductTabs:function(){var b=this,c=[];Ext.jx.each(b.get_products(),function(f){var e=f.get("SERVICE.CODE");var h=f.get("SERVICE.DESCRIP");c.push({name:h,title:h,html:b.getProductContentTab(e)})},this);return c},getSuperDestRecord:function(){var c=Ext.jx.getStore("SUPERDES");var b=this.get("RESORT#SUPERDES");return c.query("SUPERDES#CODE",b).itemAt(0)},getQuoteBubble:function(c,b){c=c||330;b=b||300;return'<div class="rl-tpl-destination-quotebubble" style="width : '+c+"px; height : "+b+'px"></div>'},getImageCarousel:function(b){b=b||215;return'<div class="rl-tpl-destination-carousel" style="height : '+b+'px"></div>'},showTabPanel:function(c){var b=Ext.jx.String.escapeHTML(Ext.encode(c));return'<div class="rl-tpl-destination-content-tabpanel" style="display : none" destId="'+this.getCode()+'">'+b+"</div>"},getProductContentTab:function(b){return'<div class="rl-tpl-destination-product-tab" style="display : none" productId="'+b+'" destId="'+this.getCode()+'"></div>'},getName:function(f){var e=this;var c="";var b=e.get("RESORT#RESORT");if(f==="bold"){c="<b>"+b+"</b>..."}else{c=b}return c},getDescRaw:function(e,b){var f=this;var c="";if(e==="browse"){c=this.getDesc()}else{if(e==="full"){c=f.get("RESORT#SINGLE")||f.get("RESORT#MULTIPLE")}}return c},getContentTabs:function(){var f=this,e=[];e.push({name:"Pictures",title:l("Overview"),html:f.tpl("PICTURES")});for(var h=1;h<=7;h++){var c=o_dest.get("RESORT.CAT"+h+"NAME");var b=o_dest.get("RESORT.CAT"+h+"INFO");if(!b||!c){next}e.push({name:c,title:c,html:b})}return e},getImageHtml:function(c,h){var f=this;if(!c){c=1}if(!h){h="TN_"}var j=f.get("RESORT#IMAGE"+c);if(!j){return""}var b=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"})+"/";var e="<img style='float:left; margin:3px' src='"+b+h+j+"'>";return e}}}});Ext.jx.setTable({SERVICE:{Funcs:{getServiceByCode:function(c){var b=Ext.jx.getStore("SERVICE");return b.getAt(b.find("SERVICE#CODE",c))}},FuncsRow:{getQuantityMaxValue:function(){return Number(this.data["SERVICE#WEBMAXQTY"])||99},isGDSLodging:function(){return this.data["#B_USELODGINGGDS"]},isGDSAir:function(){return this.data["#B_USEGDS"]&&!this.data["#B_USELODGINGGDS"]},showStartDateOnSearch:function(){var b=this;if(b.data["#B_DONT_SHOW_DATES_EVER"]||b.data["#B_DONT_SHOW_DATES_ON_SEARCH"]){return false}return true},showStartDateOnAdd:function(){var b=this;if(b.data["#B_DONT_SHOW_DATES_EVER"]||b.data["#B_DONT_SHOW_DATES_ON_SEARCH"]||b.data["#B_DONT_SHOW_DATES_ON_ADD"]){return false}if(b.isInventoryRequired()||b.isGDSLodging()){return false}return true},showEndDateOnSearch:function(){var b=this;if(b.data["#B_DONT_SHOW_DATES_EVER"]||b.data["#B_DONT_SHOW_DATES_ON_SEARCH"]){return false}if(b.data["#B_USE_SPECIAL_CAR_PRICING"]){return true}if(b.autoCalcEndDate()){return false}return true},showEndDateOnAdd:function(){var b=this;if(b.data["#B_DONT_SHOW_DATES_EVER"]||b.data["#B_DONT_SHOW_DATES_ON_SEARCH"]){return false}if(b.data["#B_USE_SPECIAL_CAR_PRICING"]){return true}if(b.autoCalcEndDate()||b.isInventoryRequired()||b.isGDSLodging()){return false}return true},usesInventory:function(){return !this.isGDSLodging()&&this.get("#B_USEINVENTORY")&&Ext.jx.getStoreValue("DEPT#INVRULES")&&/[1Y]/.test(Ext.jx.getStoreValue("DEPT#INVRULES").substr(0,1))},isInventoryRequired:function(){return this.usesInventory()&&!(/[1Y]/.test(Ext.jx.getStoreValue("DEPT#INVRULES").substr(1,1)))},getTimesCats:function(){var h=this;if(h._timesCats){return h._timesCats}var b=Ext.jx.getStore("TIMES","ALL");var f=h.get("SERVICE#CODE");f="GO";var j=h._times=!f?new Ext.util.MixedCollection():b.query("TIMES#PRODUCT",f);var c=new Ext.data.ArrayStore({fields:b.fields.items});c.add(j.items);c.sort("TIMES#LABEL","ASC");var e={};c.each(function(m){var k=m.data["TIMES#CATEGORY"]||" ";if(!e[k]){e[k]=[]}e[k].push(m)});return h._timesCats=e},autoCalcEndDate:function(){var b=this;return !this.isGDSAir()&&!this.isGDSLodging()&&(Number(b.data["SERVICE#CALCENDDAT"])==1||(Number(b.data["#B_PRICENIGHTLY"])!=1&&Number(b.data["#B_DONT_AUTOCHANGE_END_DATE"])!=1))},isPerPerson:function(){var b=this;return(b.get("SERVICE#AUTOCALC")==1||b.get("#B_AUTO_CALC_UNITS_FROM_PAX")==1)},allowSkip:function(){var e=true;if(RL.Global.getTripType()==="single"){var f=Ext.jx.getStore("GTAW").getAt(0),b=Ext.jx.getStore("RESORT").data.map["RESORT#SEARCHCODE="+f.data["GTAW#RESORT"]];if(b){var c=b.checkAllRequiredProducts();e=!c.index[this.data["SERVICE#CODE"]]}}return e},isSameDay:function(){return Number(this.get("SERVICE#SAMEDAY"))==1},useOccupanceLevels:function(){return Number(this.get("#B_USEOCCUPANCYLEVELS"))==1},useStartTime:function(){return this.showStartDateOnAdd()&&Number(this.get("#B_USE_START_TIME"))==1},useEndTime:function(){return this.showEndDateOnAdd()&&Number(this.get("#B_USE_END_TIME"))==1}}}});Ext.jx.setTable({SPECIAL:{Funcs:{getSpecialByCode:function(c){var b=Ext.jx.getStore("SPECIAL");return b.getAt(b.find("SPECIAL#CODE",c))},getSpecialsFor:function(b){var h=Ext.jx.getStore("SPECIAL");var f=b.getCode();var e=new RegExp(f+",");var c=new Ext.data.Store({recordType:h.reader.recordType});h.each(function(j){if(j.get("SPECIAL#RESORT")==f||e.test(j.get("SPECIAL#DESTINDEX"))){c.add(j)}});c.sort("SPECIAL#SORTCODE");return c}},FuncsRow:{get_super_dest_code:function(){var b=this.get_super_dest();return !b?undefined:b.getValueRaw("SUPERDES#CODE")},get_super_dest:function(){if(!this.o_super_dest){var b=this.get_dest();if(b){this.o_super_dest=b.get_super_dest()}}return this.o_super_dest},getFullDesc:function(){var b="";b+="<table><tr><td>";b+=this.get_image("br_",1);b+="<div>"+(this.get("SPECIAL#SINGLE")||this.get("SPECIAL#MULTIPLE"))+"</div>";b+="<div style='clear:both'></div>";b+="</td></tr></table>";return b},getLink_JS:function(){return"new RL.Special.Popup({specialCode:'"+this.get("SPECIAL#CODE")+"'}).show(); return false;"},get_dest:function(){return Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(this.get("SPECIAL#RESORT"))},getName:function(){return this.get("SPECIAL#DESC")},getFromPrice:function(){var b=this.get("SPECIAL#FROMPRICE");if(!(b>0)){b=""}return b},getBrowseImage:function(){var c=this.get_images()[0];if(c){return c}var b=this.getResort();return b&&b.getRandomImage()||"/images/no-photo.jpg"},get_images:function(){if(!this.a_images){Ext.data.Record.prototype.get_images.call(this);var b=this.get("#VENDOR_IMAGES").split(";");for(var c=0;c<b.length;c++){var e=b[c];if(e){this.a_images.push(e)}}}return this.a_images},hasImages:function(){return this.get_images().length>0},hasPriceCodes:function(){for(var b=1;b<12;b++){if(!Number(this.get("SPECIAL#PRICE"+b))){continue}var c=this.get("SPECIAL#TYPE");if(c!=1&&c!=2&&c!=3){continue}var e=Number(this.get("SPECIAL#MINNIGHTS")||this.get("SPECIAL#BASENGTS"));if((c==2||c==3)&&!e){continue}return true}return false},getResort:function(){var b=this.get("SPECIAL#RESORT");return Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(b)},getValidStartDateRange:function(){if(this.__cachedStartRange__){return this.__cachedStartRange__.clone()}var c=new RL.Model.DateRange();if(Ext.isIE6||Ext.isIE7||Ext.isIE8){log("major ie error");debug("major ie error")}for(var e=1;e<=12;e++){var b=this.get("SPECIAL#D"+e+"S");var h=this.get("SPECIAL#D"+e+"E");if(b&&h){c.addRange(b,h)}}var k=this.get("SPECIAL#DOWSTART").split("");var f=[];Ext.jx.each(k,function(n,m){if(n!="Y"){f.push(m)}});c.filterDaysOfWeek(f);var j=this;c.filterBy(function(m){var n=j.getValidEndDateRange();n.filterByMinMaxNights(m,j.get("SPECIAL#MINNIGHTS"),j.get("SPECIAL#MAXNIGHTS"));return n.isEmpty()});this.__cachedStartRange__=c;return c.clone()},getValidEndDateRange:function(){if(this.__cachedEndRange__){return this.__cachedEndRange__.clone()}var e=new RL.Model.DateRange();for(var f=1;f<=12;f++){var c=this.get("SPECIAL#D"+f+"S");var j=this.get("SPECIAL#D"+f+"E");if(c&&j){e.addRange(c,j)}}var b=this.get("SPECIAL#DOWEND").split("");var h=[];Ext.jx.each(b,function(m,k){if(m!="Y"){h.push(k)}});e.filterDaysOfWeek(h);this.__cachedEndRange__=e;return e.clone()},getValidMonths:function(m){var c=m||{};for(var j=1;j<=12;j++){var e=Ext.jx.cleanDate(this.get("SPECIAL#D"+j+"S"));var k=Ext.jx.cleanDate(this.get("SPECIAL#D"+j+"E"));if(e&&k){var h=e.getFirstDateOfMonth();var b=k.getFirstDateOfMonth();for(var f=h;f<=b;f=f.add(Date.MONTH,1)){c[f-0]=true}}}return c},getBuildData:function(w,A,u,n,q){var e=Number(this.get("SPECIAL#PRICE"+w));if(!e){return}A=Ext.jx.cleanDate(A);u=Ext.jx.cleanDate(u);A.clearTime();u.clearTime();var B=Ext.jx.getTable("CURRENCY").Funcs.getCurrencyByCode(this.get("SPECIAL#CURRENCY")||"USD");var h=(n instanceof Ext.data.Record)?n:Ext.jx.getTable("CURRENCY").Funcs.getCurrencyByCode(n||"USD");var t=this.get((w==10?"SPECIAL#PRICEDES":"SPECIAL#PRICEDESC")+w);var f=Number(this.get("SPECIAL#NETPRICE"+w));var j=Number(this.get("SPECIAL#EXTRANGT"+w));var x=Number(this.get("SPECIAL#NETXNGT"+w));var m=this.get("SPECIAL#TYPE");var b=this.get("SPECIAL#CODE");var k=this.get("SPECIAL#DESC");var s=(u-A)/(24*60*60*1000);var r=Number(this.get("SPECIAL#MINNIGHTS")||this.get("SPECIAL#BASENGTS"));var p=Number(this.get("SPECIAL#MAXNIGHTS")||99);var C;var v;var z;if(m==1){C=e;r=r||1;v=Ext.jx.math.round(C/r,2);z=Ext.jx.math.round(f/r,2)}else{if(m==2){if(!r){return}v=e;z=f;C=Ext.jx.math.round(v*s,2);f=Ext.jx.math.round(z*s,2)}else{if(m==3){if(!r){return}C=e;var c=s-r;C+=j*c;f+=x*c;v=Ext.jx.math.round(C/s,2);z=Ext.jx.math.round(f/s,2)}else{return}}}return{"#VENDOR_MGTCO":b+": "+k,"BUILD#SERVICE":q+": "+k+"("+t+")","BUILD#DDATE":A.format("m/d/Y"),"BUILD#RDATE":u.format("m/d/Y"),"BUILD#CODE":b,"BUILD#CITY":w,"SPECIAL#RESORT":this.get("SPECIAL#RESORT"),"SPECIAL#MULTIPLE":this.get("SPECIAL#MULTIPLE"),"SPECIAL#DESC":k,"#DATE_RANGES":A.format("m/d/Y")+","+u.format("m/d/Y"),"SPECIAL#MINNIGHTS":r,"SPECIAL#MAXNIGHTS":p,"SPECIAL#TYPE":m,"SPECIAL#DOWSTART":this.get("SPECIAL#DOWSTART"),"SPECIAL#DOWEND":this.get("SPECIAL#DOWEND"),"BUILD#UNITS":q,"BUILD#NGTS":s,"BUILD#PRICE":C,"BUILD#UNPRICE":f,"#UNIT_DESC":t,"BUILD#VENID":"S*","BUILD#TYPE":"S*"}}}}});Ext.jx.setTable({SUPERDES:{templates:{dests:['{[ Ext.jx.Template.clearSearchItems("resortDropdown") ]}','<tpl for=".">','{[ !values._record.getDests().items.length ? "" : ','"<table><tr><td>"+','values._record.getImageHtml(1,"TN_")+','values._record.getName("bold")+','values._record.getDescRaw("browse")+','"</td></tr></table>"'," ]}",'<tpl for="_record.getDests().items">',"{[",'Ext.jx.Template.setSearchItem("resortDropdown",values)+','"<div class=\'search-item\' recordId=\'"+values.get("#LINK_TO_RESORT")+"\'>"+','values.template("shortdescription")+','"</div>"',"]}","</tpl>","</tpl>"],longdescription:'<table><tr><td><b>{SUPERDES#NAME}</b>...{[ Ext.jx.ignoreNull(values["SUPERDES#MULTIPLE"]) ]}</td></tr></table>'},FuncsRow:{get_specials:function(){if(!this.a_specials){var b=this.getValueRaw("SUPERDES#CODE");var c=Ext.jx.getRecord({tableName:"DEPT"});this.a_specials=[];Ext.each(c.get_specials(99),function(e){var f=e.get_super_dest_code();if(b==e.get_super_dest_code()){this.a_specials.push(e)}},this)}return this.a_specials},getName:function(f){var e=this;var c="";var b=e.get("SUPERDES#NAME");if(f==="bold"){c="<b>"+b+"</b>..."}else{if(f=="span"){c="<span>"+b+"...</span>"}else{c=b}}return c},getDescRaw:function(c){var e=this;var b="";if(c==="browse"){b=e.get("SUPERDES#MULTIPLE")||e.get("SUPERDES#SINGLE")}else{if(c==="full"){b=e.get("SUPERDES#SINGLE")||e.get("SUPERDES#MULTIPLE")}}return b},getDests:function(){var e=this;if(!e._dests){var b=Ext.jx.getStore("RESORT","ALL");var c=e.get("SUPERDES#CODE");if(c){e._dests=b.query("RESORT#SUPERDES",c);e._dests.keySort()}else{e._dests=new Ext.util.MixedCollection()}}return e._dests},getImageHtml:function(c,f){var j=this;if(!c){c=1}if(!f){f="TN_"}var h=j.get("SUPERDES#IMAGE"+c);if(!h){return""}var b=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"})+"/";var e="<img style='float:left; margin:3px' src='"+b+f+h+"'>";return e},getContent:function(){var c=this;var b={items:[{layout:"fit",height:50,width:600,title:c.data["SUPERDES#NAME"],layout:"column"},{id:"superdesContentDetail",autoHeight:true}]};var e=[{title:l("Description"),sort:-1,item:{html:c.template("longdescription")}}];return b},getCarousel:function(){var e=this;var f={layoutConfig:{pagedScroll:true,loopCount:1,scrollButtonPosition:"split",marginScrollButtons:1},layout:"carousel",items:[]};var h=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"});for(var b=1;b<=10;b++){var c=e.data["RESORT#IMAGE"+b];if(!c){continue}f.items.push({style:{margin:"1px 1px 1px 1px"},html:{tag:"img",width:250,height:200,src:h+"/fs_"+c,style:{width:250,height:200}}})}if(f.items.length){return f}else{return{}}}}}});Ext.jx.setTable({VENDOR:{templates:{description:'<table><tr><td style="font-weight:normal"><img style="float:left; margin:3px" src="{[Ext.jx.getStoreValue("CONFIG#IMAGEPATH")]}/BR_{VENDOR#IMAGE1}"><b>{VENDOR#VENDOR}</b>...{[ values["VENDOR#SHORT"] ]}</td></tr></table>',description_nopic:'<b>{VENDOR#VENDOR}</b>...{[ values["VENDOR#SHORT"] ]}',longdescription:'<table><tr><td style="font-weight:normal"><img style="float:left; margin:3px" src="{[Ext.jx.getStoreValue("CONFIG#IMAGEPATH")]}/BR_{VENDOR#IMAGE1}"><b>{VENDOR#VENDOR}</b>...{[ Ext.jx.ignoreNull(values["VENDOR#LONG"])|| Ext.jx.ignoreNull(values["VENDOR#SHORT"]) ]}</td></tr></table>'},FuncsRow:{getDesc:function(b){return Ext.jx.ignoreNull(this.data["VENDOR#SHORT"])||Ext.jx.ignoreNull(this.data["VENDOR#LONG"])},hasPictures:function(){return this.data["VENDOR#IMAGE1"]&&this.data["VENDOR#IMAGE2"]},hasMap:function(){return this.getService().get("#B_USEMAPS")&&this.hasWellFormedStreetAddress()},hasStreetView:function(){return false},usesInventory:function(){return this.getService().usesInventory()},isInventoryRequired:function(){return this.getService().isInventoryRequired()},hasContentTabs:function(){return(this.data["VENDOR#IMAGE1"]&&this.data["VENDOR#IMAGE2"])||(this.data["VENDOR#LONG"]||this.data["VENDOR#CAT1NAME"]||this.data["VENDOR#CAT2NAME"]||this.data["VENDOR#CAT3NAME"]||this.data["VENDOR#CAT4NAME"]||this.data["VENDOR#CAT5NAME"]||this.data["VENDOR#CAT6NAME"]||this.data["VENDOR#CAT7NAME"])||this.hasMap()||this.hasStreetView()||this.usesInventory()},getMapDesc:function(){return this.get_image("TN_")+this.getName("bold")+this.getDesc(200)},getName:function(f){var e=this;var c="";var b=e.get("VENDOR#VENDOR");if(f==="bold"){c="<b>"+b+"</b>..."}else{c=b}return c},getShortDesc:function(){var e=this;var h=[];var k=e.data["VENDOR#SHORT"];var c=Ext.jx.getStoreValue("CONFIG#IMAGEPATH");var f=e.get("VENDOR#MGTCOID")||"~~NULL~~";var j=!e.data["VENDOR#IMAGE1"]?"":'<img rl_vendor_id="'+e.get("VENDOR#VENID")+'" rl_vendor_mgtcoid="'+f+'" '+(e.hasContentTabs()?'class="rl-vendor-image"':"")+' src = "'+c+"/BR_"+e.data["VENDOR#IMAGE1"]+'" alt = "" />';var b=new RL.PriceResult.PricingRowActions();h.push('<div class = "prodtype_short_desc">','<div class = "prodtype_ldg_header">','<div class = "prodtype_header_style1">');if(j&&e.data["VENDOR#IMAGE2"]){h.push(b.getInline("more-info-pictures"))}if(e.data["VENDOR#LONG"]||e.data["VENDOR#CAT1NAME"]||e.data["VENDOR#CAT2NAME"]||e.data["VENDOR#CAT3NAME"]||e.data["VENDOR#CAT4NAME"]||e.data["VENDOR#CAT5NAME"]||e.data["VENDOR#CAT6NAME"]||e.data["VENDOR#CAT7NAME"]){h.push(b.getInline("more-info"))}if(this.hasMap()){h.push(b.getInline("more-info-map"))}if(this.hasStreetView()){h.push(b.getInline("more-info-streetview"))}if(e.usesInventory()){h.push(b.getInline("more-info-calendar"))}h.push("</div>",e.data["VENDOR#VENDOR"],"</div>");if(j||k){h.push('<div class = "prodtype_ldg_desc">',j,"<ul>","<li>",k,"</li>","</ul>","</div>")}h.push("</div>");return h.join("")},getService:function(){var b=this;var c=Ext.jx.getRecord({tableName:"SERVICE",recordId:"SERVICE#CODE="+b.get("VENDOR#VENTYPE")});return c},hasWellFormedStreetAddress:function(){var b=this.getStreetAddress();return b&&!/o\.?\s*box/i.test(b)},getStreetAddress:function(){var b;if(this.get("VENDOR#CITY")){b=this.get("VENDOR#ADDRESS1")||this.get("VENDOR#ADDRESS2")}else{if(this.get("VENDOR#CITY1")){b=this.get("VENDOR#ADDR1")||this.get("VENDOR#ADDR2")}}return b},getAddress:function(){var c=this;var b=this.getStreetAddress();if(b){if(c.get("VENDOR#CITY")){b+=(b?",":"")+c.get("VENDOR#CITY");if(c.get("VENDOR#STATE")){b+=(b?",":"")+c.get("VENDOR#STATE")}if(c.get("VENDOR#COUNTRY")){b+=(b?",":"")+c.get("VENDOR#COUNTRY")}}else{b+=(b?",":"")+c.get("VENDOR#CITY1");if(c.get("VENDOR#STATE1")){b+=(b?",":"")+c.get("VENDOR#STATE1")}if(c.get("VENDOR#COUNTRY1")){b+=(b?",":"")+c.get("VENDOR#COUNTRY1")}}}return b},getVendor:function(){return this}}}});Ext.ns("RL");RL.Account=Ext.extend(Ext.Container,{slots:true,height:500,beforeInitComponent:function(){Ext.apply(this,{xtype:"container",layout:"row-fit",items:[{xtype:"RL.Account.Header",height:60},{xtype:"RL.Account.Quotes"}]})},initComponent:function(){this.beforeInitComponent();RL.Account.superclass.initComponent.call(this);this.on("back-to-quote",this.onBackToQuote,this);this.on("update-profile",this.onUpdateProfile,this);this.on("quote-open",this.onOpenQuote,this)},onUpdateProfile:function(){new Ext.Window({title:l("Update profile"),height:80,width:160}).show()},onBackToQuote:function(){RL.Global.startQuoteOver()},onOpenQuote:function(j,b,k,h,n,c,m){var f=Ext.jx.Server.get();var e=Ext.jx.Ajax.urlEncode({screen:"scnContentQuote",resno:k.get("GTAWQUOTES#RESNUM"),check:k.get("#CHECK")});Ext.jx.redirect(f+"?"+e,l("Now redirecting you to your main quote page"))}});Ext.reg("RL.Account",RL.Account);Ext.ns("RL.Account");RL.Account.Header=Ext.extend(Ext.Container,{slots:true,constructor:function(b){b=b||{};Ext.apply(b,{cls:"",items:[{xtype:"toolbar",items:[{xtype:"tbtext",cls:"rl-account-header-welcome",text:l("Welcome")+" "+RL.Global.user.getFullName()+" -- "+l("Here are your trips.")}]}]});RL.Account.Header.superclass.constructor.call(this,b)},initComponent:function(){RL.Account.Header.superclass.initComponent.call(this);this.addEvents("update-profile","back-to-quote");this.enableBubble("update-profile","back-to-quote")},onUpdateProfile:function(){this.fireEvent("update-profile",this)},onBackToQuote:function(){this.fireEvent("back-to-quote",this)}});Ext.reg("RL.Account.Header",RL.Account.Header);Ext.ns("RL.Account");RL.Account.Quotes=Ext.extend(Ext.grid.GridPanel,{slots:true,quoteActions:null,beforeInitComponent:function(){var b=this.quoteActions=new Ext.ux.RowActions({actions:[{name:"openQuote",id:1,dataIndex:"dummyIndex",iconCls:"rl-icon-quote-edit",text:l("open"),autoWidth:false,width:70,fixed:true,tooltip:l("Open this quote"),listeners:{action:this.onOpenQuote,scope:this}}]});Ext.apply(this,{cls:"rl-account-quotes-grid",plugins:[b],viewConfig:{forceFit:true},selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),columns:[b.get("openQuote"),{header:l("Trip No."),dataIndex:"GTAWQUOTES#RESNUM",align:"center"},{header:l("Destination"),dataIndex:"dummyIndex",renderer:this.destinationNameRenderer},{header:l("From"),dataIndex:"GTAWQUOTES#DDATE",align:"center"},{header:l("To"),dataIndex:"GTAWQUOTES#RDATE",align:"center"}],store:RL.Global.user.getQuotesStore()})},initComponent:function(){this.beforeInitComponent();RL.Account.Quotes.superclass.initComponent.call(this);this.addEvents("quote-open");this.enableBubble("quote-open")},destinationNameRenderer:function(j,m,f,n,c,k){var h=Ext.jx.getStore("RESORT");var e=h.find("RESORT#SEARCHCODE",f.get("GTAWQUOTES#RESORT"));var b;if(e!=-1){b=h.getAt(e).get("RESORT#RESORT")}return b},onOpenQuote:function(b,h,c,j,k,e,f){this.fireEvent("quote-open",b,h,c,j,k,e,f)}});Ext.reg("RL.Account.Quotes",RL.Account.Quotes);Ext.ns("RL.Build");RL.Build.Popup=Ext.extend(Ext.Panel,{pricingRecord:null,searchForm:null,buildPopup:null,slots:true,initComponent:function(){if(Ext.isIE){Ext.apply(this,{width:260})}else{Ext.apply(this,{autoWidth:true})}Ext.apply(this,{frame:true,hideBorders:true,autoHeight:true,layout:"fit",items:[{xtype:"panel",slot:"slider",autoWidth:true,autoHeight:true,layout:"card",bodyStyle:{background:"none transparent"},activeItem:0,items:[{xtype:"RL.Build.Base",slot:"build",listeners:{"rooms-number-change":this.onRoomNumberChange,scope:this},pricingRecord:this.pricingRecord},{xtype:"RL.Build.More",slot:"more"}]}]});RL.Build.Popup.superclass.initComponent.call(this);var b=this.slots;b.build.on("add-service",this.onAddService,this);b.build.on("cancel",this.onMore,this);b.more.on("build-more",this.onMore,this);b.more.on("build-skip",this.onSkip,this)},onRoomNumberChange:function(h,e,f){var b=this.buildPopup;if(b instanceof Ext.Window){b.center()}},onAddService:function(b,c){var f=this.searchForm;var j=[];Ext.each(c,function(n){j.push(f.quote.addServiceItem(this.pricingRecord,n,f.n_dest,f.destCode))},this);var m=j[0];var h=Ext.jx.getStore("GTAW").getAt(0);if(!h.getDDate()){h.set("GTAW#DDATE",m.get("BUILD#DDATE"))}if(!h.getRDate()){h.set("GTAW#RDATE",m.get("BUILD#RDATE"))}if(!h.get("GTAW#RESORT")){h.set("GTAW#RESORT",f.destCode||m.get("VENDOR#REGION"))}if(!h.get("GTAW#ADULT")){var k=Number(Ext.jx.getStoreValue("DEPT#TQNOADL"))||2;if(m.get_product().isPerPerson()){k=m.get("BUILD#UNITS")}h.set("GTAW#ADULT",k);h.set("GTAW#PAX",k)}if(f.canSuggestMoreItems()){var e=this.slots.more;e.refresh(m,f.getServiceItemDescription());this.slots.slider.layout.setActiveItem(e)}else{this.onSkip(m)}},onMore:function(){this.closeBuildPopup()},onSkip:function(b){this.closeBuildPopup();this.searchForm.fireEvent("after-service-add",this.searchForm,b)},closeBuildPopup:function(){var b=this.buildPopup;if(b instanceof Ext.Window){b.close()}else{b.hide()}}});Ext.reg("RL.Build.Popup",RL.Build.Popup);Ext.ns("RL.Build");RL.Build.More=Ext.extend(Ext.Panel,{slots:true,constructor:function(b){b=b||{};Ext.apply(b,{baseCls:"x-frameless",bodyStyle:"padding-bottom : 10px",items:[{xtype:"container",slot:"content",cls:"afterAddMsg",html:""}],bbar:new Ext.Toolbar({toolbarCls:"x-frameless-toolbar",items:[{xtype:"button",text:l("yes"),iconCls:"yes-btn",scale:"large",iconAlign:"left",handler:this.onMoreClick,scope:this},"->",{xtype:"button",text:l("next"),iconCls:"select-alt-btn",scale:"large",iconAlign:"left",handler:this.onSkipClick,scope:this}]})});RL.Build.More.superclass.constructor.call(this,b)},initComponent:function(){RL.Build.More.superclass.initComponent.call(this);this.addEvents("build-more","build-skip");this.enableBubble("build-more","build-skip")},refresh:function(e,c){var b=this.slots.content;if(!b.rendered){return}b.el.update('<div class="added">'+l("You just added")+" <b>"+e.data["BUILD#SERVICE"]+'</b></div><div class="another">'+l("Would you like to add another from")+" <b>"+c+"</b>"+l("?")+"</div>")},onMoreClick:function(){this.fireEvent("build-more")},onSkipClick:function(){this.fireEvent("build-skip")}});Ext.reg("RL.Build.More",RL.Build.More);Ext.ns("RL.Build");RL.Build.Edit=Ext.extend(Ext.Window,{buildRecord:null,quote:null,slots:true,sourceEl:null,initComponent:function(){Ext.apply(this,{baseCls:"x-box",frame:true,border:false,closable:false,resizable:false,modal:true,width:320,items:[{xtype:"container",cls:"rl-edit-service-item-header",html:this.buildRecord.get("BUILD#SERVICE")},{xtype:"RL.Build.Base",slot:"build",isEdit:true,addButtonText:l("ok"),initialValues:this.buildRecord.data,pricingRecord:this.buildRecord}]});RL.Build.Edit.superclass.initComponent.call(this);this.addEvents("add-service");var b=this.slots;b.build.on("add-service",this.onAddService,this);b.build.on("cancel",this.onCancel,this)},show:function(b){this.sourceEl=b;RL.Build.Edit.superclass.show.apply(this,arguments)},onCancel:function(){this.hide(this.sourceEl,this.close,this)},onAddService:function(b,c){this.quote.editBuildRecord(this.buildRecord,c);this.fireEvent("add-service",b,c);this.hide(this.sourceEl,this.close,this)}});Ext.reg("RL.Build.Edit",RL.Build.Edit);Ext.ns("RL");RL.Build.Base=Ext.extend(Ext.Container,{pricingRecord:null,productRecord:null,slots:true,initialValues:null,addButtonText:null,isEdit:false,beforeInitComponent:function(){var c=this.productRecord=this.pricingRecord.getService();var e=Ext.jx.getStore("GTAW").getAt(0);Ext.apply(this,{autoHeight:true,width:290,style:"overflow : hidden"});var b=this.items=[];this.addEvents("rooms-number-change");if(c.useOccupanceLevels()){b.push({xtype:"RL.Build.Occupancy",slot:"occupancy",pricingRecord:this.pricingRecord,productRecord:this.productRecord,numberOfRooms:this.isEdit?1:1,allowChooseNumberOfRooms:!this.isEdit,initialValues:this.initialValues})}else{if(this.productRecord.get("SERVICE#CONAGEDEF")==2){b.push({xtype:"hidden",slot:"qty",name:"BUILD#UNITS",value:e.getAdultsNum()})}else{b.push({xtype:"container",slot:"quantities",layout:"form",labelAlign:"top",items:[{xtype:"spinnerfield",slot:"qty",name:"BUILD#UNITS",fieldLabel:this.getQuantityLabel(),width:50,minValue:1,maxValue:this.pricingRecord.getQuantityMaxValue(),allowBlank:false,value:this.initialValues?undefined:e.getAdultsNum()+e.getChildrenNum()}]})}}b.push(this.getVSpacer(5),this.getTimeFields(),this.getVSpacer());if(RL.Defaults.USE_PROD_HELP_TXT){b.push({xtype:"container",slot:"helptxt",cls:"x-form-item-label",html:c.get("SERVICE#HELP")},this.getVSpacer())}b.push(this.getButtons());this.addEvents("add-service","cancel")},initComponent:function(){this.beforeInitComponent();RL.Build.Base.superclass.initComponent.call(this);var b=this.slots;if(this.productRecord.useOccupanceLevels()){b.occupancy.on("rooms-number-change",this.onRoomNumberChange,this)}if(this.initialValues){if(b.quantities){b.quantities.setValues(this.initialValues)}b.times.setValues(this.initialValues)}},onRoomNumberChange:function(e,b){this.doLayout();this.fireEvent("rooms-number-change",this,e,b)},getButtons:function(){return{xtype:"container",height:40,layout:"column",style:Ext.isIE6?"margin-top : -10px":undefined,items:[{xtype:"button",width:100,text:this.addButtonText||l("add"),iconCls:"service-add-btn",scale:"large",handler:this.onAddService,scope:this},this.getSlurpySpacer(),{xtype:"button",width:100,text:l("cancel"),iconCls:"hide-btn",scale:"large",handler:this.onCancel,scope:this}]}},getTimeFields:function(){var c=this.pricingRecord.getService();var b=[].concat(c.showStartDateOnAdd()?this.getStartDateField(!c.showEndDateOnAdd()):[],c.useStartTime()?this.getStartTimeField():[],c.showEndDateOnAdd()?this.getEndDateField():[],c.useEndTime()?this.getEndTimeField():[]);var e=[];var f=b.length-1;Ext.each(b,function(j,h){e.push(j);if(h!=b.length-1){e.push(this.getSlurpySpacer(1/f))}},this);return{xtype:"container",slot:"times",layout:"column",items:e}},getVSpacer:function(b){return{xtype:"container",html:"&nbsp;",height:b||10}},getSpacer:function(b){return{xtype:"container",html:"&nbsp;",width:b||10}},getSlurpySpacer:function(b){return{xtype:"container",html:"&nbsp;",columnWidth:b||1}},getStartDateField:function(c){var e=this.findParentBy(function(f){return !!f.searchForm});var b=e?e.searchForm.getSearchValues():{};return{xtype:"container",items:[{xtype:"container",html:this.getStartDateLabel()},{xtype:"daterange_start",slot:"startdate",isServiceItem:true,vtype:c?null:"daterange",name:"BUILD#DDATE",endDateField:"BUILD#RDATE",minDays:this.productRecord.isSameDay()?0:1,value:this.pricingRecord.get("BUILD#DDATE")||b["#DDATE"]}]}},getEndDateField:function(){var c=this.findParentBy(function(e){return !!e.searchForm});var b=c?c.searchForm.getSearchValues():{};return{xtype:"container",items:[{xtype:"container",html:this.getEndDateLabel()},{xtype:"daterange_end",slot:"enddate",isServiceItem:true,name:"BUILD#RDATE",startDateField:"BUILD#DDATE",value:this.pricingRecord.get("BUILD#RDATE")||b["#RDATE"]}]}},getStartTimeField:function(){return{xtype:"container",items:[{xtype:"container",html:this.getStartTimeLabel()},{xtype:"textfield",slot:"startTime",name:"BUILD#STARTTIME"}]}},getEndTimeField:function(){return{xtype:"container",items:[{xtype:"container",html:this.getEndTimeLabel()},{xtype:"textfield",slot:"endTime",name:"BUILD#ENDTIME"}]}},getQuantityLabel:function(){var b=this.pricingRecord.getService();var c=b.data;if(c["SERVICE#QTYLAB"]){return c["SERVICE#QTYLAB"]}else{return b.isPerPerson()?l("No. Items"):l("No. Units")}},getStartDateLabel:function(){return this.productRecord.get("SERVICE#DSTARTLAB")||l("Start Date")},getEndDateLabel:function(){return this.productRecord.get("SERVICE#DENDLAB")||l("End Date")},getStartTimeLabel:function(){return this.productRecord.get("SERVICE#STIMELAB")||l("Start Time")},getEndTimeLabel:function(){return this.productRecord.get("SERVICE#ETIMELAB")||l("End Time")},getValues:function(){var c=this.slots;var b=[];if(this.productRecord.useOccupanceLevels()){b=c.occupancy.getValues()}else{if(c.quantities){b=[c.quantities.getValues()]}else{if(c.qty){b=[{"BUILD#UNITS":c.qty.getValue()}]}}}Ext.each(b,function(e){Ext.apply(e,c.times.getValues())});return b},onAddService:function(){if(!this.validate()){return}this.fireEvent("add-service",this,this.getValues())},onCancel:function(){this.fireEvent("cancel",this)}});Ext.reg("RL.Build.Base",RL.Build.Base);Ext.ns("RL.Build");RL.Build.Occupancy=Ext.extend(Ext.Container,{slots:true,numberOfRooms:1,allowChooseNumberOfRooms:true,initialValues:null,beforeInitComponent:function(){var e=this.pricingRecord.getQuantityMaxValue();var c=[];for(var b=1;b<=e;b++){c.push([b])}Ext.apply(this,{items:[{xtype:"container",slot:"combo",layout:"form",items:[{xtype:"combo",slot:"noOfRooms",fieldLabel:l("No. of Rooms"),disabled:!this.allowChooseNumberOfRooms,editable:false,emptyText:l("No valid dates"),store:new Ext.data.ArrayStore({fields:["number"],idIndex:0,data:c}),mode:"local",triggerAction:"all",displayField:"number",valueField:"number",value:this.numberOfRooms,width:80}]}]});this.items.push({xtype:"RL.Build.Occupancy.Header"});for(var b=1;b<=this.numberOfRooms;b++){this.items.push({xtype:"RL.Build.Occupancy.Row",slot:"room"+b,roomNumber:b})}this.addEvents("rooms-number-change")},initComponent:function(){this.beforeInitComponent();RL.Build.Occupancy.superclass.initComponent.call(this);var b=this.slots;b.noOfRooms.on("select",this.onNumberSelect,this);if(this.initialValues){this.setValues(this.initialValues)}},onNumberSelect:function(f,b){var e=b.get("number");if(e==this.numberOfRooms){return}if(e>this.numberOfRooms){for(var c=this.numberOfRooms+1;c<=e;c++){this.add({xtype:"RL.Build.Occupancy.Row",slot:"room"+c,roomNumber:c})}this.doLayout();this.fireEvent("rooms-number-change",this,e);for(var c=this.numberOfRooms+1;c<=e;c++){this.slots["room"+c].getEl().fadeIn({duration:0.5})}}else{for(var c=this.numberOfRooms;c>e;c--){this.remove(this.slots["room"+c])}this.fireEvent("rooms-number-change",this,e)}this.numberOfRooms=e},getValues:function(){var b=[];for(var c=1;c<=this.numberOfRooms;c++){b.push(this.slots["room"+c].getValues())}return b}});Ext.reg("RL.Build.Occupancy",RL.Build.Occupancy);Ext.ns("RL.Build.Occupancy");RL.Build.Occupancy.Row=Ext.extend(Ext.Container,{roomNumber:null,numberOfAdults:null,numberOfChildren:null,agesOfChildren:null,beforeInitComponent:function(){Ext.apply(this,{layout:"column",items:[].concat({xtype:"displayfield",width:60,value:l("Room")+" "+this.roomNumber},{xtype:"perperson_selector",slot:"adultsNum",name:"#NO_ADULTS",allowBlank:false,width:70,value:this.numberOfAdults},Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?[]:[this.getSpacer(),{xtype:"perperson_selector",slot:"childrenNum",name:"#NO_CHILDREN",width:70,value:this.numberOfChildren}])})},initComponent:function(){this.beforeInitComponent();RL.Build.Occupancy.Row.superclass.initComponent.call(this)},getSpacer:function(b){return{xtype:"container",html:"&nbsp;",width:b||10}}});Ext.reg("RL.Build.Occupancy.Row",RL.Build.Occupancy.Row);Ext.ns("RL.Build.Occupancy");RL.Build.Occupancy.Header=Ext.extend(Ext.Container,{beforeInitComponent:function(){Ext.apply(this,{layout:"column",items:[].concat(this.getSpacer(60),{xtype:"displayfield",width:70,value:Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?l("No. Passengers"):l("No. Adults")},Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?[]:[this.getSpacer(),{xtype:"displayfield",width:70,value:l("No. Children")}])})},initComponent:function(){this.beforeInitComponent();RL.Build.Occupancy.Header.superclass.initComponent.call(this)},getSpacer:function(b){return{xtype:"container",html:"&nbsp;",width:b||10}}});Ext.reg("RL.Build.Occupancy.Header",RL.Build.Occupancy.Header);Ext.ns("RL.Control");RL.Control.SortButton=Ext.extend(Ext.Button,{sortData:null,beforeInitComponent:function(){var b=this.sortData;b.direction=b.direction||"ASC";Ext.apply(this,{iconCls:"rl-sort-"+b.direction.toLowerCase()});this.addEvents("sort-change")},initComponent:function(){this.beforeInitComponent();RL.Control.SortButton.superclass.initComponent.call(this);this.on("click",this.onButtonClick,this)},onButtonClick:function(c){var b=this.sortData;b.direction=b.direction.toggle("ASC","DESC");this.setIconClass(this.iconCls.toggle("rl-sort-asc","rl-sort-desc"));this.fireEvent("sort-change",this,b)}});Ext.reg("RL.Control.SortButton",RL.Control.SortButton);Ext.ns("RL.Cust");RL.Cust.Save=Ext.extend(Ext.Panel,{defaults:{border:false},frame:true,border:false,cls:"new-members",cantSkip:false,labelWidth:130,constructor:function(b){b=b||{};this.stepTitle=l("Customer");this.title=l("New Members");var c=[{xtype:"button",text:l("continue"),scale:"large",iconCls:"addmember-btn",iconAlign:"left",handler:this.onContinue,scope:this,style:{"margin-left":"25px"}}];if(!b.isTravelAgent&&Ext.jx.getStoreValue("DEPT#TAON")==1){c.push({xtype:"button",text:l("travel agent registration"),scale:"large",iconAlign:"left",handler:this.onAgentRegistration,scope:this,style:{"margin-left":"25px"}})}if(Ext.jx.getStoreValue("DEPT#CONANON")!=1&&Ext.jx.getStoreValue("DEPT#CONANON")!=2&&!b.cantSkip){c.push({xtype:"button",text:"<b>"+l("no thanks")+"</b>",scale:"medium",handler:this.onSkip,scope:this,style:{"margin-left":"200px"}})}Ext.apply(b,{layout:"form",items:[!Ext.jx.getStoreValue("DEPT#CONCUSTASK")?{}:{baseCls:"profile-pitch",html:Ext.jx.getStoreValue("DEPT#CONCUSTASK")},{fieldLabel:l("First Name"),name:"PROSPW#FIRST",width:200,xtype:"textfield"},{fieldLabel:l("Last Name"),name:"PROSPW#LAST",width:200,xtype:"textfield"},{fieldLabel:l("Group/Company"),name:"PROSPW#GROUP_NAME",width:200,xtype:"textfield"},{fieldLabel:l("ARC/IATA No."),name:"PROSPW#IATA",width:200,xtype:"textfield"},{fieldLabel:l("Email"),name:"PROSPW#EMAIL",width:200,vtype:"email",xtype:"textfield"},{fieldLabel:l("Email Opt-In"),name:"PROSPW#EMAILSPEC",value:"false",xtype:"checkbox"},{fieldLabel:l("Address 1"),name:"PROSPW#ADDRESS",width:200,xtype:"textfield"},{fieldLabel:l("Address 2"),name:"PROSPW#ADDRESS2",width:200,xtype:"textfield"},{fieldLabel:l("City"),name:"PROSPW#CITY",width:200,xtype:"textfield"},{fieldLabel:l("State/Province"),name:"PROSPW#STATE",width:200,xtype:"textfield"},{fieldLabel:l("Zip/Postal Code"),name:"PROSPW#ZIP",width:200,xtype:"textfield"},{fieldLabel:l("Country"),name:"PROSPW#COUNTRY",width:200,xtype:"textfield"},{fieldLabel:l("Phone (day)"),name:"PROSPW#PHONE_DAY",width:200,xtype:"textfield"},{fieldLabel:l("Phone (night)"),name:"PROSPW#PHONE_NITE",width:200,xtype:"textfield"},{fieldLabel:l("Fax"),name:"PROSPW#FAX",width:200,xtype:"textfield"},{xtype:"hidden",name:"PROSPW#AGENCY",value:b.isTravelAgent?1:0},{baseCls:"required-fields-note",width:300,html:l("An asterisk (*) denotes a required field.")}],buttons:c,buttonAlign:"left"});RL.Cust.Save.superclass.constructor.call(this,b)},initComponent:function(){RL.Cust.Save.superclass.initComponent.call(this);this.addEvents("customer-ready")},onContinue:function(){if(!this.validate()){this.onInvalid();return}var e=Ext.jx.getStore("GTAW").getAt(0);if(e){var b=this.getValues();var c=/#/;for(var f in b){if(c.test(f)){e.data[f]=b[f]}}}this.fireEvent("customer-ready",this)},onAgentRegistration:function(){RL.Global.dispatch({screen:"scnLogonTA"},{addHistory:1})},onSkip:function(){this.fireEvent("customer-ready",this)},onInvalid:function(){Ext.MessageBox.show({icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK,title:l("Validation Error"),msg:l("Please fill out all required fields")})},onRender:function(h,f){var n=Ext.jx.getRecord({tableName:"DEPT"});var j=n.get(this.isTravelAgent?"DEPT#TAVALID":"DEPT#CUSTVALID");var b=["PROSPW#FIRST","PROSPW#LAST","PROSPW#GROUP_NAME","PROSPW#EMAIL","PROSPW#PHONE_DAY","PROSPW#PHONE_NITE","PROSPW#FAX","PROSPW#ADDRESS","PROSPW#ADDRESS2","PROSPW#CITY","PROSPW#STATE","PROSPW#ZIP","PROSPW#COUNTRY","PROSPW#IATA","PROSPW#EMAILSPEC","PROSPW#SALESREP",undefined,"PROSPW#SYSTEM2","PROSPW#REFDES"];for(var p=0,e=0;p<b.length;p++,e+=2){var q=b[p];if(!q){continue}var m=this.findBy(function(r){return r.name===q})[0];if(!m){continue}var k=(j.length>=e+1&&j.substr(e,1)==="Y");var c=(k&&j.substr(e+1,1)==="Y");if(q=="PROSPW#REFDES"&&RL.Variables.trk){k=false}if(k){if(c){m.fieldLabel="* "+m.fieldLabel;m.allowBlank=false}else{m.allowBlank=true}if(q=="PROSPW#EMAILSPEC"){m.checked=true}}else{m.hideItem();m.inputType="hidden"}}RL.Cust.Save.superclass.onRender.call(this,h,f)}});Ext.reg("cust_save",RL.Cust.Save);Ext.ns("RL.Cust");RL.Cust.Identity=Ext.extend(Ext.Window,{slots:true,showCancelButton:false,cantSkip:false,initComponent:function(){Ext.apply(this,{title:l("Customer Information"),iconCls:"rl-icon-locked",width:700,autoHeight:true,modal:true,resizable:false,items:[{title:l("Existing members"),frame:true,autoHeight:true,items:[{xtype:"RL.Login.Form",slot:"login",returnTrips:true,frame:false,plain:false,width:600,height:130,buttonAlign:"left",showCancelButton:this.showCancelButton,loginButtonConfig:{text:l("continue"),scale:"large",iconCls:"addmember-btn",style:{"margin-left":"25px"}}}]},{xtype:"cust_save",slot:"form",isTravelAgent:this.isTravelAgent,autoHeight:true,cantSkip:this.cantSkip}]});RL.Cust.Identity.superclass.initComponent.call(this);this.addEvents("customer-ready","customer-logged-in");this.slots.form.on("customer-ready",this.onCustomerInfoReady,this);this.on("cancel",this.close,this);this.on("logged-in",this.onLoggedIn,this)},onLoggedIn:function(){this.fireEvent("customer-logged-in",this);this.close()},onCustomerInfoReady:function(){RL.Global.user.prospwRecord.data=this.getValues();this.hide();this.fireEvent("customer-ready",this)}});Ext.reg("RL.Cust.Identity",RL.Cust.Identity);Ext.ns("RL.Destination");RL.Destination.Carousel=Ext.extend(Ext.Panel,{layout:"carousel",baseCls:"x-frameless",autoWidth:true,height:200,layoutConfig:{pagedScroll:true,loopCount:1,scrollButtonPosition:"split",marginScrollButtons:1},destRecord:null,constructor:function(c){var b=c.destRecord;c.items=[];var h=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"});for(var e=1;e<=10;e++){var f=b.data["RESORT#IMAGE"+e];if(!f){continue}c.items.push({style:{margin:"1px 1px 1px 1px"},html:{tag:"img",width:250,height:200,src:h+"/fs_"+f,style:{width:250,height:200}}})}RL.Destination.Carousel.superclass.constructor.call(this,c)}});Ext.reg("dest_carousel",RL.Destination.Carousel);Ext.ns("RL.Destination");RL.Destination.Map=Ext.extend(Ext.ux.GMapPanel,{destRecord:null,constructor:function(c){var b=c.destRecord;Ext.apply(c,{title:l("map"),mapType:"terrain",renderedSafe:true,controls:["zoom","menumaptype","scale"],zoom:14,border:false,markers:[{address:b.getAddress(),icon:"building",title:b.get("RESORT#RESORT"),html:b.template("longdescription"),maxWidth:300}]});RL.Destination.Map.superclass.constructor.call(this,c)}});Ext.reg("dest_map",RL.Destination.Map);Ext.ns("RL.Destination");RL.Destination.Content=Ext.extend(Ext.ux.TabPanelSkin,{tabsBgCls:"prodtype_ldg_header",tabBtnCls:"prodtype_round_button",tabsTitleCls:"quote_steps_msg",autoHeight:true,active:null,plain:true,border:false,activeTab:0,showDestName:false,isFullScreen:false,destRecord:null,constructor:function(f){if(!f.items){f.items=[]}var c=f.items;var b=f.destRecord;if(!b.hasPictures){Ext.jx.debug("problem with hasPictures")}else{if(b.hasPictures()){c.push({title:l("Pictures"),name:"Pictures",baseCls:"prodtype_ldg_desc",sort:-3,autoHeight:true,items:[{xtype:"container",html:b.getDesc(),autoWidth:true,autoHeight:true},{xtype:"dest_carousel",destRecord:b}]})}var j=Ext.jx.getStoreValue("CONFIG#CONDESTCON");if(j==1){if(b.data["RESORT#MULTIPLE"]){c.push({title:l("About"),name:"About",sort:-2,html:b.data["RESORT#MULTIPLE"],autoHeight:true})}}var k=j==2?((b.data["RESORT#MULTIPLE"]||"")+(b.data["RESORT#SINGLE"]||"")):b.data["RESORT#SINGLE"];if(k){c.push({title:l("More Info"),name:"More Info",sort:-1,html:k,autoHeight:true,bodyStyle:"overflow-y : auto"})}for(var h=1;h<=7;h++){if(!b.data["RESORT#CAT"+h+"NAME"]||!b.data["RESORT#CAT"+h+"INFO"]){continue}c.push({title:b.data["RESORT#CAT"+h+"NAME"],name:"RESORT#CAT"+h+"NAME",sort:b.data["RESORT#CAT"+h+"ORDER"],hideBorders:true,autoHeight:true,items:[{xtype:!f.noPanPanels?"panpanel":"panel",html:b.data["RESORT#CAT"+h+"INFO"]}]})}if(f.isFullScreen){var m=Ext.jx.getTable("PRODGRP").Funcs.getNonEmptyGroups("PRODGRP#TABVISIBLE");Ext.each(m,function(n){c.push(new RL.Destination.ProductGroup({title:n.data["PRODGRP#PGDESC"],productGroupRecord:n,destinationRecord:b,sort:80+((n.data["PRODGRP#LINERANGE"]||0)/100),isAutoHeight:isAutoHeight}))});var e=b.get_products();Ext.each(e,function(n){if(n.data["SERVICE#CODE"]=="IN"||n.isGDSAir()){return}c.push(new RL.Destination.ProductGroup({title:n.data["SERVICE#DESCRIP"],productRecord:n,destinationRecord:b,sort:80+((n.data["SERVICE#LINERANGE"]||0)/100),isAutoHeight:isAutoHeight}))},this)}}c.sort(function(p,n){return(p.sort||0)-(n.sort||0)});if(f.showDestName){this.tabsTitle=b.data["RESORT#RESORT"]}Ext.each(c,function(p,n){if(f.active==p.name){f.activeTab=n}});RL.Destination.Content.superclass.constructor.call(this,f)}});Ext.reg("dest_content",RL.Destination.Content);Ext.ns("RL.Destination.Content");RL.Destination.Content.Templated=Ext.extend(Ext.ux.GroupTabPanel,{slots:true,destRecord:null,activeGroup:0,tabs:null,tabWidth:160,beforeInitComponent:function(){var b=this.destRecord;var c=[];var e=this;Ext.each(this.tabs,function(h){var f=[];Ext.each(h.items||[],function(j){f.push(e.getTab(j))});h.items=f;c.push(h);if(h.name==e.activeGroup){e.activeGroup=c.length-1}});c.sort(function(h,f){return(h.sort||0)-(f.sort||0)});Ext.apply(this,{items:c})},initComponent:function(){this.beforeInitComponent();RL.Destination.Content.Templated.superclass.initComponent.call(this)},getTab:function(b){return Ext.apply(b,{xtype:"RL.Destination.Content.Tab.HTML",destRecord:this.destRecord})}});Ext.reg("RL.Destination.Content.Templated",RL.Destination.Content.Templated);Ext.ns("RL.Destination.Content");RL.Destination.Content.Tab=Ext.extend(Ext.Container,{name:null,sort:null,content:null,destRecord:null,showQuoteStarter:true,autoHeight:true,autoWidth:true,beforeInitComponent:function(){var f=this.destRecord.getCode();var b=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(f);var c=b.getSpecials();var e=[{xtype:"RL.Quote.Starter",baseCls:"x-panel",frame:false,style:"margin : 5px",hidden:!this.showQuoteStarter,autoHeight:true,initialDestCode:f}];if(c.getCount()){e[0].title=l("Customer Trip Quote to ")+b.get("RESORT#RESORT");e.unshift({xtype:"panel",border:true,style:"margin : 5px",title:l("Hot deals in ")+b.get("RESORT#RESORT"),items:[{xtype:"RL.Destination.Specials.DataView",destRecord:b,specials:c,hideFrame:true,autoHeight:false,height:Math.round((c.getCount()/3)+0.49)*130}]})}Ext.apply(this,{border:false,items:this.content.concat(e)})},initComponent:function(){this.beforeInitComponent();RL.Destination.Content.Tab.superclass.initComponent.call(this)}});Ext.reg("RL.Destination.Content.Tab",RL.Destination.Content.Tab);Ext.ns("RL.Destination.Content.Tab");RL.Destination.Content.Tab.Templated=Ext.extend(Ext.Panel,{name:null,sort:null,content:null,destRecord:null,showQuoteStarter:true,reLayout:false,reLayoutDelay:1500,jemplate:null,data:null,border:false,baseCls:"x-frameless",initComponent:function(){this.jemplate=this.jemplate.replace(/(\.HTML)?$/,".HTML").replace(/::/g,"/").toUpperCase();RL.Destination.Content.Tab.Templated.superclass.initComponent.call(this)},onRender:function(){RL.Destination.Content.Tab.Templated.superclass.onRender.apply(this,arguments);var c=this.body;var b=this.destRecord;c.update(Jemplate.process(this.jemplate,this.data));c.select(".rl-tpl-destination-carousel").each(function(e){Ext.ComponentMgr.create({xtype:"dest_carousel",baseCls:"x-panel",border:false,destRecord:b,height:215,renderTo:e}).doLayout()});c.select(".rl-tpl-destination-quotebubble").each(function(e){Ext.ComponentMgr.create({xtype:"RL.Quote.Starter",baseCls:"x-panel",frame:false,style:"margin : 5px",renderTo:e,showStartMessage:false,initialDestCode:b.getCode()}).doLayout()})}});Ext.reg("RL.Destination.Content.Tab.Templated",RL.Destination.Content.Tab.Templated);Ext.ns("RL.Destination.Content.Tab");RL.Destination.Content.Tab.HTML=Ext.extend(Ext.Container,{name:null,sort:null,destRecord:null,reLayout:true,reLayoutDelay:1500,border:false,baseCls:"x-frameless",afterRender:function(){RL.Destination.Content.Tab.HTML.superclass.afterRender.apply(this,arguments);var c=this.el;var b=this.destRecord;c.select(".rl-tpl-destination-carousel").each(function(e){Ext.ComponentMgr.create({xtype:"dest_carousel",baseCls:"x-panel",border:false,destRecord:b,height:215,renderTo:e}).doLayout()});c.select(".rl-tpl-destination-quotebubble").each(function(e){Ext.ComponentMgr.create({xtype:"RL.Quote.Starter",baseCls:"x-panel",frame:false,style:"margin : 5px",renderTo:e,showStartMessage:false,initialDestCode:b.getCode()}).doLayout()});c.select(".rl-tpl-destination-product-tab").each(function(f){var e=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(f.getAttribute("destId"));var j=f.getAttribute("productId");var h=Ext.jx.getTable("SERVICE").Funcs.getServiceByCode(j);f.show();Ext.ComponentMgr.create({xtype:"RL.PriceSearch.Service",style:"padding : 10px",recordProduct:h,title:h.data["SERVICE#DESCRIP"],productCode:h.get("SERVICE#CODE"),compactSearch:true,quote:new RL.Model.Quote(),n_dest:0,destCode:e.getCode(),sort:80+((h.data["SERVICE#LINERANGE"]||0)/100),wizard:this,isStandAloneData:true,noSkipButtons:true,applyTo:f}).doLayout()},this)}});Ext.reg("RL.Destination.Content.Tab.HTML",RL.Destination.Content.Tab.HTML);Ext.ns("RL.Destination.Content");RL.Destination.Content.Home=Ext.extend(Ext.ux.TabPanelSkin,{slots:true,tabsBgCls:"prodtype_ldg_header",tabBtnCls:"prodtype_round_button",tabsTitleCls:"quote_steps_msg",active:null,plain:true,border:false,activeTab:0,noPanPanels:false,showDestName:false,isFullScreen:false,destRecord:null,specialRecord:null,constructor:function(b){if(!b.items){b.items=[]}var h=b.items;var m=b.destRecord;if(!m.hasPictures){Ext.jx.debug("problem with hasPictures")}else{if(m.hasPictures()){h.push({xtype:"RL.Destination.Content.Tab",bodyCssClass:"prodtype_ldg_desc",title:l("Pictures"),name:"Pictures",sort:-3,destRecord:m,autoHeight:false,content:[{baseCls:"x-frameless",html:m.getDesc(),autoWidth:false,autoHeight:true},{xtype:"dest_carousel",destRecord:m,autoWidth:false,height:215}]})}var p=Ext.jx.getStoreValue("CONFIG#CONDESTCON");if(p==1){if(m.data["RESORT#MULTIPLE"]){h.push({xtype:"RL.Destination.Content.Tab",title:l("About"),name:"About",sort:-2,destRecord:m,autoHeight:false,content:[{xtype:"container",html:m.data["RESORT#MULTIPLE"]}]})}}var f=p==2?((m.data["RESORT#MULTIPLE"]||"")+(m.data["RESORT#SINGLE"]||"")):m.data["RESORT#SINGLE"];if(f){h.push({xtype:"RL.Destination.Content.Tab",title:l("More Info"),name:"More Info",sort:-1,destRecord:m,autoHeight:false,content:[{xtype:"container",html:f}]})}for(var c=1;c<=7;c++){if(!m.data["RESORT#CAT"+c+"NAME"]||!m.data["RESORT#CAT"+c+"INFO"]){continue}h.push({xtype:"RL.Destination.Content.Tab",title:m.data["RESORT#CAT"+c+"NAME"],name:"RESORT#CAT"+c+"NAME",sort:m.data["RESORT#CAT"+c+"ORDER"],destRecord:m,hideBorders:true,autoHeight:false,content:[{xtype:!b.noPanPanels?"panpanel":"panel",autoHeight:true,html:m.data["RESORT#CAT"+c+"INFO"]}]})}var e=b.specialRecord;var k=Ext.jx.getTable("SPECIAL").Funcs.getSpecialsFor(m);if(!e&&Ext.jx.getStoreValue("CONFIG#IREURL")&&Ext.jx.getStoreValue("DEPT#CONSPECS")==1){if(k.getCount()>0){h.push({xtype:"RL.Destination.Content.Tab",title:l("Hot Deals"),name:"Specials",sort:90,destRecord:m,hideBorders:true,autoHeight:false,content:[{xtype:"RL.Destination.Specials.DataView",destRecord:m,specials:k}]})}}if(e){h.push({xtype:"panel",slot:"hotDealWrapper",title:l("Hot Deals"),name:"Specials",autoHeight:true,sort:100,tbar:new Ext.Toolbar({items:[{xtype:"tbtext",cls:"rl-special-toolbar-title",text:e.get("SPECIAL#DESC")},{xtype:"tbspacer",width:20},{xtype:"combo",editable:false,mode:"local",triggerAction:"all",width:200,listWidth:400,emptyText:l("Choose another special"),displayField:"SPECIAL#DESC",valueField:"SPECIAL#CODE",store:k,listeners:{scope:this,select:this.onAnotherSpecialChosen}},{xtype:"tbspacer",width:20},{iconCls:"rl-icon-specials-view-all",scale:"medium",text:l("View all")+" "+m.get("RESORT#RESORT")+" "+l("specials"),handler:this.switchHotDealsToAllInDestination.createDelegate(this,[true])}]}),items:[{xtype:"RL.Special.Content",specialRecord:e}]});b.active="Specials"}if(b.isFullScreen){var j=Ext.jx.getTable("PRODGRP").Funcs.getNonEmptyGroups("PRODGRP#TABVISIBLE");Ext.each(j,function(q){if(RL.Global.getVendorsForProductGroup(m,q).length){h.push({xtype:"RL.PriceSearch.ProductGroup",title:q.data["PRODGRP#PGDESC"],recordProdGroup:q,productCode:"---",compactSearch:RL.Defaults.COMPACT_PRICESEARCH,quote:new RL.Model.Quote(),n_dest:0,destCode:m.getCode(),sort:80+((q.data["PRODGRP#LINERANGE"]||0)/100),wizard:this,isStandAloneData:true,noSkipButtons:true,listeners:{scope:this,"after-service-add":this.onServiceItemAdd}})}});var n=m.get_products();Ext.each(n,function(q){if(q.data["SERVICE#CODE"]=="IN"||q.isGDSAir()){return}if(RL.Global.getVendorsForProduct(m,q).length){h.push({xtype:"RL.PriceSearch.Service",recordProduct:q,title:q.data["SERVICE#DESCRIP"],productCode:q.get("SERVICE#CODE"),compactSearch:true,quote:new RL.Model.Quote(),n_dest:0,destCode:m.getCode(),sort:80+((q.data["SERVICE#LINERANGE"]||0)/100),wizard:this,isStandAloneData:true,noSkipButtons:true})}},this)}}h.sort(function(r,q){return(r.sort||0)-(q.sort||0)});if(b.showDestName){this.tabsTitle=m.data["RESORT#RESORT"]}Ext.each(h,function(r,q){if(b.active&&b.active==r.name){b.activeTab=q}});RL.Destination.Content.Home.superclass.constructor.call(this,b)},initComponent:function(){RL.Destination.Content.Home.superclass.initComponent.call(this);this.on("after-service-add",this.onServiceItemAdd,this);this.on("beforetabchange",this.checkHotDeals,this)},switchHotDealsToAllInDestination:function(c){var e=this.slots.hotDealWrapper;e.removeAll();e.getTopToolbar().hide();var b=this.destRecord;e.add({xtype:"RL.Destination.Specials.DataView",slot:"allSpecials",header:false,autoHeight:true,sort:90,destRecord:b,specials:Ext.jx.getTable("SPECIAL").Funcs.getSpecialsFor(b)});if(c){e.doLayout()}},checkHotDeals:function(b,e,c){if(c==this.slots.hotDealWrapper&&!this.slots.allSpecials){this.switchHotDealsToAllInDestination(false)}},onAnotherSpecialChosen:function(c,b){var e=this.slots.hotDealWrapper;e.removeAll();e.add({xtype:"RL.Special.Content",specialRecord:Ext.jx.getTable("SPECIAL").Funcs.getSpecialByCode(b.get("SPECIAL#CODE"))});e.doLayout(false,true)},onServiceItemAdd:function(h,k){var j=Ext.jx.getStore("GTAW").getAt(0);var c=RL.Global.getDefaultDates();var e=j.getDDate();var b=j.getRDate();if(!e||!b){e=c.startDate;b=c.endDate}var f=!RL.Global.displayStartStep()?-1:0;RL.Global.dispatch({screen:"scnWizardSteps",dest:h.destCode,startdate:e.format("m/d/Y"),enddate:b.format("m/d/Y"),step:f+h.productCode=="LO"?3:2},{addHistory:1})}});Ext.reg("RL.Destination.Content.Home",RL.Destination.Content.Home);Ext.ns("RL.Destination.Content");RL.Destination.Content.GroupTab=Ext.extend(Ext.ux.GroupTabPanel,{slots:true,noPanPanels:false,showDestName:false,isFullScreen:false,destRecord:null,specialRecord:null,producttype:null,productgroup:null,vendor:null,autoHeight:true,activeGroup:0,hideExpandIcon:true,beforeInitComponent:function(){var m=this.destRecord;var h=[];var r=[];r.push({xtype:"RL.Destination.Content.Tab",title:l("Overview"),name:"Pictures",sort:-3,destRecord:m,autoHeight:true,autoWidth:true,content:[{xtype:"container",cls:"rl-white-background",html:m.getDesc(),autoWidth:true,autoHeight:true},{xtype:"dest_carousel",baseCls:"x-panel",border:false,destRecord:m,autoWidth:false,height:215}]});var q=Ext.jx.getStoreValue("CONFIG#CONDESTCON");if(q==1){if(m.data["RESORT#MULTIPLE"]){r.push({xtype:"RL.Destination.Content.Tab",title:l("About"),name:"About",sort:-2,destRecord:m,autoHeight:false,content:[{xtype:"container",html:m.data["RESORT#MULTIPLE"]}]})}}var f=q==2?((m.data["RESORT#MULTIPLE"]||"")+(m.data["RESORT#SINGLE"]||"")):m.data["RESORT#SINGLE"];if(f){r.push({xtype:"RL.Destination.Content.Tab",title:l("More Info"),name:"More Info",sort:-1,destRecord:m,autoHeight:false,content:[{xtype:"container",html:f}]})}for(var c=1;c<=7;c++){if(!m.data["RESORT#CAT"+c+"NAME"]||!m.data["RESORT#CAT"+c+"INFO"]){continue}r.push({xtype:"RL.Destination.Content.Tab",title:m.data["RESORT#CAT"+c+"NAME"],name:"RESORT#CAT"+c+"NAME",sort:m.data["RESORT#CAT"+c+"ORDER"],destRecord:m,autoHeight:false,reLayout:true,content:[{xtype:!this.noPanPanels?"panpanel":"panel",autoHeight:true,border:false,html:m.data["RESORT#CAT"+c+"INFO"]}]})}var e=this.specialRecord;var k=Ext.jx.getTable("SPECIAL").Funcs.getSpecialsFor(m);if(!e&&Ext.jx.getStoreValue("CONFIG#IREURL")&&Ext.jx.getStoreValue("DEPT#CONSPECS")==1){if(k.getCount()>0){h.push({xtype:"RL.Destination.Specials.DataView",title:l("Hot Deals"),name:"Specials",sort:90,destRecord:m,specials:k,hideBorders:true})}}if(e){h.push({xtype:"panel",slot:"hotDealWrapper",title:l("Hot Deals"),name:"Specials",autoWidth:true,autoHeight:true,sort:100,tbar:new Ext.Toolbar({items:[{xtype:"tbtext",cls:"rl-special-toolbar-title",text:e.get("SPECIAL#DESC")},{xtype:"tbspacer",width:20},{xtype:"combo",editable:false,mode:"local",triggerAction:"all",width:200,listWidth:400,emptyText:l("Choose another special"),displayField:"SPECIAL#DESC",valueField:"SPECIAL#CODE",store:k,listeners:{scope:this,select:this.onAnotherSpecialChosen}},{xtype:"tbspacer",width:20},{iconCls:"rl-icon-specials-view-all",scale:"medium",text:l("View all")+" "+m.get("RESORT#RESORT")+" "+l("specials"),handler:this.switchHotDealsToAllInDestination.createDelegate(this,[true])}]}),items:[{xtype:"RL.Special.Content",specialRecord:e}]});this.activeGroup="Specials"}if(this.isFullScreen){var j=Ext.jx.getTable("PRODGRP").Funcs.getNonEmptyGroups("PRODGRP#TABVISIBLE");Ext.each(j,function(t){if(RL.Global.getVendorsForProductGroup(m,t).length){var s="productgroup:"+t.data["PRODGRP#PGID"];var u=null;if(this.productgroup==t.data["PRODGRP#PGID"]){this.activeGroup=s;u=this.vendor}h.push({xtype:"RL.PriceSearch.ProductGroup",style:"padding : 10px",recordProdGroup:t,title:t.data["PRODGRP#PGDESC"],name:s,vendor:u,productCode:"---",compactSearch:RL.Defaults.COMPACT_PRICESEARCH,quote:new RL.Model.Quote(),n_dest:0,destCode:m.getCode(),sort:80+((t.data["PRODGRP#LINERANGE"]||0)/100),wizard:this,isStandAloneData:true,noSkipButtons:true,listeners:{scope:this,"after-service-add":this.onServiceItemAdd}})}},this);var n=m.get_products();Ext.each(n,function(u){if(u.data["SERVICE#CODE"]=="IN"||u.isGDSAir()){return}if(RL.Global.getVendorsForProduct(m,u).length){var s="producttype:"+u.get("SERVICE#CODE");var t=null;if(this.producttype==u.get("SERVICE#CODE")){this.activeGroup=s;t=this.vendor}h.push({xtype:"RL.PriceSearch.Service",style:"padding : 0 0 0 10px;",recordProduct:u,title:u.data["SERVICE#DESCRIP"],name:s,productCode:u.get("SERVICE#CODE"),vendor:t,compactSearch:true,quote:new RL.Model.Quote(),n_dest:0,destCode:m.getCode(),sort:80+((u.data["SERVICE#LINERANGE"]||0)/100),wizard:this,isStandAloneData:true,noSkipButtons:true})}},this)}r.sort(function(t,s){return(t.sort||0)-(s.sort||0)});h.sort(function(t,s){return(t.sort||0)-(s.sort||0)});if(this.showDestName){this.tabsTitle=m.data["RESORT#RESORT"]}var p=(Ext.isIE6||Ext.isIE7)?"min-height:600px; height:600px;":p="min-height:600px";var b=[{style:"padding:20px;"+p,autoHeight:true,border:false,items:r}];Ext.each(h,function(s){s.style="padding:5px 20px 20px 20px;"+p;b.push({autoHeight:true,items:[s]});if(s.name==this.activeGroup){this.activeGroup=b.length-1}},this);Ext.apply(this,{tabWidth:160,items:b})},setTabSpecial:function(c){var b="Pictures";if(c.productgroup){b="productgroup:"+c.productgroup}else{if(c.producttype){b="producttype:"+c.producttype}}if(b){Ext.each(this.items.items,function(e){if(e.mainItem&&e.mainItem.name==b){this.setActiveGroup(e);e.setActiveTab(e.mainItem);return false}},this)}},initComponent:function(){this.beforeInitComponent();RL.Destination.Content.GroupTab.superclass.initComponent.call(this);this.on("after-service-add",this.onServiceItemAdd,this);this.on("beforegroupchange",this.checkHotDeals,this)},switchHotDealsToAllInDestination:function(c){var e=this.slots.hotDealWrapper;e.removeAll();e.getTopToolbar().hide();var b=this.destRecord;e.add({xtype:"RL.Destination.Specials.DataView",slot:"allSpecials",header:false,autoHeight:this.autoHeight,sort:90,destRecord:b,specials:Ext.jx.getTable("SPECIAL").Funcs.getSpecialsFor(b)});if(c){e.doLayout()}},checkHotDeals:function(b,e,c){if(c.items&&c.items.itemAt(0)==this.slots.hotDealWrapper&&!this.slots.allSpecials){this.switchHotDealsToAllInDestination(false)}},onAnotherSpecialChosen:function(c,b){var e=this.slots.hotDealWrapper;e.removeAll();e.add({xtype:"RL.Special.Content",specialRecord:Ext.jx.getTable("SPECIAL").Funcs.getSpecialByCode(b.get("SPECIAL#CODE"))});e.doLayout(false,true)},onServiceItemAdd:function(h,k){var j=Ext.jx.getStore("GTAW").getAt(0);var c=RL.Global.getDefaultDates();var e=j.getDDate();var b=j.getRDate();if(!e||!b){e=c.startDate;b=c.endDate}var f=!RL.Global.displayStartStep()?-1:0;RL.Global.dispatch({screen:"scnWizardSteps",dest:h.destCode,startdate:e.format("m/d/Y"),enddate:b.format("m/d/Y"),step:f+h.productCode=="LO"?3:2},{addHistory:1})}});Ext.reg("RL.Destination.Content.GroupTab",RL.Destination.Content.GroupTab);Ext.ns("RL.Destination.Specials");RL.Destination.Specials.DataView=Ext.extend(Ext.Container,{slots:true,destRecord:null,specials:null,autoHeight:true,autoWidth:true,hideFrame:false,beforeInitComponent:function(){var b=this.specials=this.specials||Ext.jx.getTable("SPECIAL").Funcs.getSpecialsFor(this.destRecord);if(!this.hideFrame){Ext.apply(this,{title:l("Hot Deals"),name:"Specials"})}Ext.apply(this,{hideBorders:true,bodyCssClass:"rl-white-background",items:[this.hideFrame||!Ext.jx.getStoreValue("DEPT#SPCLMSGDST")?{}:{xtype:"component",autoEl:"div",cls:"specials-message",style:"padding:10px",html:Ext.jx.getStoreValue("DEPT#SPCLMSGDST")},{xtype:"panel",slot:"center",autoHeight:true,autoWidth:true,style:this.hideFrame?"":"padding : 5px",border:true,tbar:this.hideFrame?undefined:new Ext.Toolbar({slots:true,items:[l("Sort by:")+" ",{xtype:"RL.Control.SortButton",text:l("Preference"),sortData:{field:"SPECIAL#SORTCODE",direction:"ASC"},listeners:{scope:this,"sort-change":this.doSort}},{xtype:"tbspacer",width:10},{xtype:"RL.Control.SortButton",text:l("Name"),sortData:{field:"SPECIAL#DESC",direction:"ASC"},listeners:{scope:this,"sort-change":this.doSort}},{xtype:"tbspacer",width:10},{xtype:"RL.Control.SortButton",text:l("Price"),sortData:{field:"SPECIAL#FROMPRICE",direction:"ASC"},listeners:{scope:this,"sort-change":this.doSort}}]}),items:[{xtype:"RL.Special.DataView",slot:"dataview",specials:b}]}]})},initComponent:function(){this.beforeInitComponent();RL.Destination.Specials.DataView.superclass.initComponent.call(this);var c=this.slots;c.dataview.on("click",this.onSpecialChosen,this);var b=this.slots.center;b.on("afterlayout",this.doSort,this,{delay:500,single:true})},onSpecialChosen:function(k,f,h){var j=h.id.replace(/ext-comp-\w+-(\w+)/,"$1");var e=this.specials;var b=e.getAt(e.findExact("SPECIAL#CODE",j));var c=new RL.Special.Popup({specialRecord:b});c.show()},doSort:function(b){var e=[];var c=this.slots.center.getTopToolbar();if(c){c.items.each(function(f){if(f instanceof RL.Control.SortButton){if(f==b){e.unshift(f.sortData)}else{e.push(f.sortData)}}})}this.specials.sort(e)}});Ext.reg("RL.Destination.Specials.DataView",RL.Destination.Specials.DataView);Ext.ns("RL.Destination");RL.Destination.ProductGroup=Ext.extend(Ext.Panel,{slots:true,productRecord:null,productGroupRecord:null,vendor:null,destinationRecord:null,showPaging:false,store:null,autoHeight:true,autoWidth:true,beforeInitComponent:function(){var m=this.showPaging?10:999;var n=this.destinationRecord;var p=this.store=new ExtX.Data.Store.Paged({pageSize:m,reader:new Ext.data.DataReader({},Ext.jx.getStore("VENDOR").recordType)});var e=Ext.ux.MultiGroupingStore.prototype;for(var b in e){if(!p.hasOwnProperty(b)&&e.hasOwnProperty(b)){p[b]=e[b]}}var f=n.get("RESORT#SEARCHCODE");var s=new RegExp(f);Ext.jx.each(Ext.jx.vendors,function(u,t){if(this.isVendorMatch(u)&&(s.test(u.data["VENDOR#DEST"])||u.data["VENDOR#REGION"]==f)){p.add(u)}},this);p.refreshDataSet();p.totalLength=p.getCount();p.groupBy("VENDOR#VENDOR");var j,h;if(this.productGroupRecord){j="VENDOR#VENDOR"}else{if(this.productRecord){j=this.productRecord.get("SERVICE#CNSSORTVEN")||"VENDOR#PREFERRED";if(j=="random"){j="#RANDOM_VENDOR"}else{if(j=="tier_random"){h="VENDOR#PREFERRED";j="#RANDOM_VENDOR"}else{j="VENDOR#VENDOR"}}}}p.sort(j,"ASC");if(this.showPaging){p.setDataPage(0,m-1)}Ext.apply(this,{border:false,layout:"row-fit",items:[{xtype:"ExtX.List.GroupedView",slot:"view",groupConfigs:{"VENDOR#VENDOR":{headerClass:"x-grid-group-hd-vendor",headerTemplate:'{[function (){var recordVendor = values.typicalRecord;return recordVendor ? recordVendor.getShortDesc() : record.get("VENDOR#VENDOR");}()]}'}},hideHeaders:true,store:p,columns:[],plugins:[new RL.PriceResult.PricingRowActions({resultForm:this})]},{xtype:"container",slot:"pagingContainer",hidden:!this.showPaging||p.getTotalCount()<m*1.5,height:24,layout:"column",hideBorders:true,items:[{columnWidth:0.5,html:"&nbsp;"},{xtype:"ExtX.Toolbar.Paging",slot:"paging",width:Ext.isChrome?210:200,pageSize:10,store:p,paramNames:{start:"from"}},{columnWidth:0.5,html:"&nbsp;"}]}]});this.addEvents("child-needs-layout","child-needs-more-height");this.enableBubble("child-needs-layout","child-needs-more-height");if(this.vendor){var r=this.vendor.substr(0,3);var k=this.vendor.substr(3,3)||"~~NULL~~";var c="VENDOR#VENID="+r+"&VENDOR#MGTCOID="+k;var q=Ext.jx.vendors[c];if(!q){return}if(q.hasContentTabs()){this.showVendorContent(q,"Pictures")}}},initComponent:function(){this.beforeInitComponent();RL.Destination.ProductGroup.superclass.initComponent.call(this);var c=this.slots;var b=c.paging;b.on("show-page",this.onPageChanged,this);c.view.on("containerclick",this.onListViewClick,this)},onPageChanged:function(b,e,c){this.store.setDataPage(e,c)},onListViewClick:function(f,j){var h=j.getTarget(".rl-vendor-image");if(!h){return}var c=h.getAttribute("rl_vendor_id");var b=h.getAttribute("rl_vendor_mgtcoid");var m="VENDOR#VENID="+c+"&VENDOR#MGTCOID="+b;var k=Ext.jx.vendors[m];if(!k){return}if(k.hasContentTabs()){this.showVendorContent(k,"Pictures")}},isVendorMatch:function(f){var c=f.data["VENDOR#VENTYPE"];if(this.productRecord){return c==this.productRecord.get("SERVICE#CODE")}var e=this.productGroupRecord.get_products(true);var b=false;e.each(function(h){if(c==h.get("SERVICE#CODE")){b=true;return false}});return b},showVendorContent:function(e,b,f){Ext.getBody().mask();var c=new Ext.Window({header:false,width:Math.round(RL.Global.getWindowSize().width*0.8),height:Math.round(RL.Global.getWindowSize().height*0.8),modal:true,draggable:false,resizable:false,layout:"fit",bodyStyle:{"overflow-y":"auto"},items:[{xtype:"vendor_content",pricingRecord:null,vendorRecord:e,searchForm:null,active:b,autoHeight:false}],buttonAlign:"center",buttons:[{iconCls:"rl-icon-hide",scale:"large",text:l("Close"),handler:function(){c.close()}}]});c.on("destroy",function(){Ext.getBody().unmask()});c.show()}});Ext.reg("RL.Destination.ProductGroup",RL.Destination.ProductGroup);Ext.ns("RL.Destination.ProductGroup");RL.Destination.ProductGroup.Loader=Ext.extend(Ext.Container,{slots:true,productRecord:null,productGroupRecord:null,vendor:null,destinationRecord:null,blankHtml:null,beforeInitComponent:function(){Ext.apply(this,{layout:"card",activeItem:0,items:[{xtype:"container",slot:"mask",html:this.blankHtml}]})},initComponent:function(){this.beforeInitComponent();RL.Destination.ProductGroup.Loader.superclass.initComponent.call(this);this.on("afterlayout",this.onAfterLayout,this,{delay:1,single:true});if(!this.destinationRecord){this.destinationRecord=RL.Global.getDefaultDestRecord()}if(!this.destinationRecord){Ext.jx.log("destination not specified")}RL.Global.getVendors(this.destinationRecord,this.onVendorsLoaded,this)},onAfterLayout:function(){if(this.slots.mask&&!this.blankHtml){this.slots.mask.el.mask("Loading vendors list...")}},onVendorsLoaded:function(c){if(c){this.removeAll();this.add({xtype:"RL.Destination.ProductGroup",slot:"content",destinationRecord:this.destinationRecord,productRecord:this.productRecord,productGroupRecord:this.productGroupRecord,vendor:this.vendor});if(this.rendered){try{this.layout.setActiveItem(0)}catch(b){(function(){this.layout.setActiveItem(0);this.doLayout()}).defer(0,this)}this.doLayout()}}else{Ext.Msg.show({title:l("Error"),msg:l("There was an error during loading of vendors list. Please try again in a minute"),buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}}});Ext.reg("RL.Destination.ProductGroup.Loader",RL.Destination.ProductGroup.Loader);Ext.ns("RL.FieldTypes");RL.FieldTypes.Airport=Ext.extend(Ext.form.ComboBox,{displayField:"_S_AIRPORTS#SHORTNAME",valueField:"_S_AIRPORTS#CODE",loadingText:l("Searching..."),hideTrigger:true,typeAhead:false,tpl:'<tpl for="."><div class=search-item>{_S_AIRPORTS#CITY} :: {_S_AIRPORTS#SHORTNAME} ({_S_AIRPORTS#CODE})</div></tpl>',width:150,listWidth:300,minChars:2,itemSelector:"div.search-item",initComponent:function(){var b=Ext.jx.getTable("_S_AIRPORTS").getData("",{remote:true});this.store=b.getStore({remote:true,loadNow:false,remoteUrlAppend:"screen=js::ext_data_store::_S_AIRPORTS"},null,null,true);RL.FieldTypes.Airport.superclass.initComponent.call(this)},setValue:function(b){var c=this.store;if(!c){return Ext.jx.log("Airports store is empty (1)")}if(c&&c.find("_S_AIRPORTS#CODE",b)==-1){}if(!c){return Ext.jx.log("Airports store is empty (2)")}return RL.FieldTypes.Airport.superclass.setValue.call(this,b)}});Ext.reg("airport",RL.FieldTypes.Airport);Ext.ns("RL.FieldTypes");RL.FieldTypes.Currency=Ext.extend(Ext.form.ComboBox,{displayField:"CURRENCY#CTYCODE",valueField:"CURRENCY#CTYCODE",mode:"local",triggerAction:"all",typeAhead:true,forceSelection:true,selectOnFocus:true,emptyText:l("Currencies"),width:150,itemSelector:"div.search-item",onRender:function(){if(!this.tpl){this.tpl='<tpl for="."><div class=search-item>{CURRENCY#CTYCODE} - {CURRENCY#COUNTRY}</div></tpl>'}this.value=this.value||Ext.jx.getStoreValue("GTAW#CADCURR");this.store=Ext.jx.getStore("CURRENCY");if(this.store.getCount()<=1){this.hideItem()}RL.FieldTypes.Currency.superclass.onRender.apply(this,arguments)}});Ext.reg("currency",RL.FieldTypes.Currency);Ext.ns("RL.FieldTypes");RL.FieldTypes.CurrencyPopup=Ext.extend(Ext.Container,{currency:null,beforeInitComponent:function(){this.currency=this.currency||RL.Global.getCurrency();Ext.apply(this,{cls:(this.cls||"")+" rl-currency-change",html:this.getCurrencyIndicatorText(this.currency)});this.addEvents("currency-changed")},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.CurrencyPopup.superclass.initComponent.call(this)},afterRender:function(){RL.FieldTypes.CurrencyPopup.superclass.afterRender.apply(this,arguments);this.mon(this.el,"click",this.onChangeCurrencyClicked,this,{delegate:".rl-currency-change-link"})},getValue:function(){return this.currency.get("CURRENCY#CTYCODE")},getCurrencyIndicatorText:function(c){var b=Ext.jx.getStoreValue("DEPT#CONHIDECUR")==1||Ext.jx.getStore("CURRENCY").getCount()<2;return l("All prices are in ")+"<b>"+c.get("CURRENCY#CTYCODE")+(b?"":'</b> <span class="rl-currency-change-link">'+l("change")+"</span>")},setCurrency:function(b){RL.Global.setCurrency(b);this.currency=b;if(this.rendered){this.el.update(this.getCurrencyIndicatorText(b))}this.fireEvent("currency-changed",this,b)},onChangeCurrencyClicked:function(f,e){var c=[];Ext.jx.getStore("CURRENCY").each(function(h){c.push({checked:h==this.currency,boxLabel:h.get("CURRENCY#COUNTRY"),currency:h,name:"currency"})},this);var b=new Ext.Window({slots:true,modal:true,resizable:false,title:l("Select currency"),width:200,items:[{xtype:"fieldset",border:false,items:[{xtype:"radiogroup",slot:"group",hideLabel:true,vertical:true,columns:1,items:c}]}],buttonsAlign:"center",buttons:[{text:l("Ok"),iconCls:"rl-icon-ok",handler:function(){b.hide(e,b.close,b);var h=b.slots.group.getValue().currency;this.setCurrency(h)},scope:this},{text:l("Cancel"),iconCls:"rl-icon-cancel",handler:function(){b.hide(e,b.close,b)}}]});b.show(e)}});Ext.reg("RL.FieldTypes.CurrencyPopup",RL.FieldTypes.CurrencyPopup);Ext.ns("RL.FieldTypes");RL.FieldTypes.DateRangeBase=Ext.extend(Ext.form.DateField,{width:100,format:"j M Y",vtype:"daterange",allowBlank:false,showToday:false,renderTodayButton:false,noOfMonth:2});Ext.ns("RL.FieldTypes");RL.FieldTypes.DateRangeStart=Ext.extend(RL.FieldTypes.DateRangeBase,{name:"#DDATE",endDateField:"#RDATE",minDays:0,maxDays:20,defaultDays:5,defaultDaysOut:5,minDaysOut:5,initComponent:function(){this.configMenu={datePickerMsg:l("Select Start Date")};this.fieldLabel=l("Start Date");this.emptyText=l("Starts");if(this.isServiceItem&&Ext.jx.getStoreValue("DEPT#TQFIXDATE")){if(!this.minValue||!this.maxValue){var e=Ext.jx.getRecord({tableName:"DEPT"});var c=e.getQuotingRange_Start();var b=e.getQuotingRange_End();if(!this.minValue&&c){this.minValue=c.getStartDate()}if(!this.maxValue&&b){this.maxValue=b.getEndDate()}}}else{if(!this.minValue||!this.maxValue){var e=Ext.jx.getRecord({tableName:"DEPT"});var c=e.getQuotingRange_Start();if(!this.minValue&&c){this.minValue=c.getStartDate()}if(!this.maxValue&&c){this.maxValue=c.getEndDate()}}}if(!this.maxValue||!this.maxValue.subtractDt||this.maxValue.subtractDt(new Date())<0){this.minValue=this.maxValue=undefined}if(this.isServiceItem){}else{this.defaultDays=Ext.jx.getStoreValue("DEPT#TQDAYSDEF")?Number(Ext.jx.getStoreValue("DEPT#TQDAYSDEF")):this.defaultDays;this.minDays=Ext.jx.getStoreValue("DEPT#TQDAYSMIN")?Number(Ext.jx.getStoreValue("DEPT#TQDAYSMIN")):this.minDays;this.defaultDaysOut=Ext.jx.getStoreValue("DEPT#TQNODAYS")?Number(Ext.jx.getStoreValue("DEPT#TQNODAYS")):this.defaultDaysOut;this.defaultFixedDate=Ext.jx.getStoreValue("DEPT#TQFIXDATE")?Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQFIXDATE")):this.defaultFixedDate}this.maxDays=Ext.jx.getStoreValue("DEPT#TQDAYSMAX")?Number(Ext.jx.getStoreValue("DEPT#TQDAYSMAX")):this.maxDays;if(!this.value){if(this.defaultDaysOut){this.defaultDate=(new Date()).add("d",this.defaultDaysOut)}else{if(this.defaultFixedDate){this.defaultDate=Ext.jx.cleanDate(this.defaultFixedDate)}}if(this.minValue&&this.defaultDate){this.defaultDate=this.defaultDate.getMaxDate(this.minValue)}}RL.FieldTypes.DateRangeStart.superclass.initComponent.apply(this,arguments)}});Ext.reg("daterange_start",RL.FieldTypes.DateRangeStart);Ext.ns("RL.FieldTypes.DateRangeStart");RL.FieldTypes.DateRangeStart.ListView=Ext.extend(Ext.ListView,{range:null,endFieldSiblingSlot:null,name:"#DDATE",beforeInitComponent:function(){var c=this.range;var b=new Ext.data.ArrayStore({fields:["startdate"],idIndex:0,data:c.getAllDatesAsArrays()});Ext.apply(this,{emptyText:l("Sorry, no valid start dates"),deferEmptyText:false,singleSelect:true,columnSort:false,columns:[{header:l("Start Date"),align:"center",dataIndex:"startdate",tpl:'{startdate:date("D, j M Y")}'}],store:b})},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.DateRangeStart.ListView.superclass.initComponent.apply(this,arguments);this.on("selectionchange",this.onDateSelected,this);this.on("afterrender",this.onAfterRender,this,{single:true})},onAfterRender:function(){if(this.store.getCount()){this.select(0)}},getEndField:function(){if(this.endFieldSiblingSlot&&this.siblingSlots){return this.siblingSlots[this.endFieldSiblingSlot]}},onDateSelected:function(e,f){var c=this.getEndField();var b=this.getRecord(f[0]);if(c){c.adjustForStartDate(b.get("startdate"))}}});Ext.reg("RL.FieldTypes.DateRangeStart.ListView",RL.FieldTypes.DateRangeStart.ListView);Ext.ns("RL.FieldTypes.DateRangeStart.ListView");RL.FieldTypes.DateRangeStart.ListView.Compact=Ext.extend(Ext.form.ComboBox,{range:null,endFieldSiblingSlot:null,width:130,name:"#DDATE",beforeInitComponent:function(){var b=this.range;Ext.apply(this,{editable:false,emptyText:l("No valid dates"),store:new Ext.data.ArrayStore({fields:["date","text"],idIndex:0,data:b.map(function(c){return[c,c.format("D, j M Y")]})}),mode:"local",triggerAction:"all",lazyInit:false,displayField:"text",valueField:"date"})},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.DateRangeStart.ListView.Compact.superclass.initComponent.apply(this,arguments);this.on("select",this.onDateSelected,this);this.on("afterrender",this.onAfterRender,this,{single:true})},onAfterRender:function(){if(this.store.getCount()){var b=this.store.getAt(0);this.setValue(b.get("date"));this.fireEvent("select",this,b)}},getEndField:function(){if(this.endFieldSiblingSlot&&this.siblingSlots){return this.siblingSlots[this.endFieldSiblingSlot]}},onDateSelected:function(e,c){var b=this.getEndField();if(b){b.adjustForStartDate(c.get("date"))}}});Ext.reg("RL.FieldTypes.DateRangeStart.ListView.Compact",RL.FieldTypes.DateRangeStart.ListView.Compact);Ext.ns("RL.FieldTypes.DateRangeStart");RL.FieldTypes.DateRangeStart.DatePicker=Ext.extend(Ext.DatePicker,{range:null,getEndField:null,endFieldSiblingSlot:null,showToday:false,name:"#DDATE",initComponent:function(){this.addEvents("date-selected");RL.FieldTypes.DateRangeStart.DatePicker.superclass.initComponent.apply(this,arguments);var b=this.range;this.setMinDate(b.getStartDate());this.setMaxDate(b.getEndDate());this.setDisabledDates(b.getInvalidDates(this.format));var c=b.getStartDate();if(!(c===null)){this.setValue(c)}this.on("select",this.onValueChange,this);this.on("afterrender",this.onAfterRender,this,{single:true})},onRender:function(c,b){RL.FieldTypes.DateRangeStart.DatePicker.superclass.onRender.apply(this,arguments);var e=this.el.child("tr");e.remove();this.mun(this.eventEl,"mousewheel",this.handleMouseWheel,this)},setActiveDate:function(b){this.setValue(b);this.onValueChange(null,b)},onAfterRender:function(){var b=this.getEndField();if(b){b.adjustForStartDate(this.getValue())}},getEndField:function(){if(this.endFieldSiblingSlot&&this.siblingSlots){return this.siblingSlots[this.endFieldSiblingSlot]}},onValueChange:function(c,e){var b=this.getEndField();if(b){b.adjustForStartDate(e)}this.fireEvent("date-selected",this,e)}});Ext.reg("RL.FieldTypes.DateRangeStart.DatePicker",RL.FieldTypes.DateRangeStart.DatePicker);Ext.ns("RL.FieldTypes.DateRangeStart.DatePicker");RL.FieldTypes.DateRangeStart.DatePicker.WithCombo=Ext.extend(RL.FieldTypes.DateRangeStart.DatePicker,{combo:null,onRender:function(c,b){RL.FieldTypes.DateRangeStart.DatePicker.WithCombo.superclass.onRender.apply(this,arguments);this.addEvents("date-selected","change");var f=this.el.child("tr");var e=f.insertSibling({tag:"tr",children:[{tag:"td",colSpan:3,cls:"x-date-left"}]},"before");var h=this.combo=new RL.FieldTypes.DateRangeStart.Combo({range:this.range,height:27,style:"padding : 2px; padding-top : 3px"});h.on("date-selected",this.onDateSelectedFromCombo,this);h.render(e.child("td"))},onDateSelectedFromCombo:function(c,b){this.setActiveDate(b);this.fireEvent("date-selected",c,b,this);this.fireEvent("change",c,b,this)},destroy:function(){if(this.rendered){this.combo.destroy()}RL.FieldTypes.DateRangeStart.DatePicker.WithCombo.superclass.destroy.apply(this,arguments)},onValueChange:function(b,c){if(b){this.combo.setValue(c)}RL.FieldTypes.DateRangeStart.DatePicker.WithCombo.superclass.onValueChange.apply(this,arguments)}});Ext.reg("RL.FieldTypes.DateRangeStart.DatePicker.WithCombo",RL.FieldTypes.DateRangeStart.DatePicker.WithCombo);Ext.ns("RL.FieldTypes.DateRangeStart");RL.FieldTypes.DateRangeStart.Combo=Ext.extend(Ext.Container,{slots:true,range:null,width:170,endFieldSiblingSlot:null,name:"#DDATE",hasManuallyChanged:false,beforeInitComponent:function(){var e=this.range;var b=e.getMonths();var c=[];Ext.each(b,function(k){c.push([k-0,k.format("M Y")])});var j=c.length&&c[0][0]||undefined;var f=this.getDatesDataFor(j);var h=f.length&&f[0][0]||undefined;Ext.apply(this,{layout:"column",items:[{xtype:"combo",slot:"months",editable:false,disabled:!j,emptyText:l("No valid dates"),store:new Ext.data.ArrayStore({fields:["date","text"],idIndex:0,data:c}),mode:"local",triggerAction:"all",displayField:"text",valueField:"date",value:j,width:80},{xtype:"container",width:5,html:"&nbsp;"},{xtype:"combo",slot:"days",emptyText:l("No valid dates"),editable:false,disabled:!h,store:new Ext.data.ArrayStore({fields:["date","text"],idIndex:0,data:f}),mode:"local",triggerAction:"all",displayField:"text",valueField:"date",value:h,width:80}]});this.addEvents("date-selected")},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.DateRangeStart.Combo.superclass.initComponent.apply(this,arguments);var b=this.slots;b.months.on("select",this.onMonthChange_Manual,this);b.days.on("select",this.onDayChange_Manual,this);this.on("afterlayout",this.onAfterLayout,this,{single:true})},onAfterLayout:function(){if(this.value){this.setValue(Ext.jx.cleanDate(this.value))}else{var b=this.getEndField();if(b){b.adjustForStartDate(this.getValue())}}},setValue:function(c){var e=this.slots;e.months.setValue(c.clone().setDate(1)-0);if(this.rendered){this.updateDatesForMonth(c.clone().setDate(1)-0)}e.days.setValue(c.clearTime()-0);var b=this.getEndField();if(b){b.adjustForStartDate(this.getValue())}},getValue:function(){var b=this.slots.days.getValue();return b?new Date(b):null},setActiveDate:function(b){this.setValue(b);this.fireEvent("date-selected",this,b)},getDatesDataFor:function(e){if(!e){return[]}var c=this.range.getDatesForMonth(new Date(e));var b=[];Ext.each(c,function(f){b.push([f-0,f.format("d - D")])});return b},updateDatesForMonth:function(b){var e=this.slots.days;e.store.loadData(this.getDatesDataFor(b));if(e.store.getCount()>0){e.enable();var c=e.store.getAt(0);e.setValue(c.get("date"))}},onMonthChange:function(c,b){this.updateDatesForMonth(b.get("date"));this.onDayChange()},onDayChange:function(){var c=this.getValue();var b=this.getEndField();if(b){b.adjustForStartDate(c)}this.fireEvent("date-selected",this,c)},onMonthChange_Manual:function(c,b){this.onMonthChange(c,b);this.hasManuallyChanged=true},onDayChange_Manual:function(){this.onDayChange();this.hasManuallyChanged=true},getEndField:function(){if(this.endFieldSiblingSlot&&this.siblingSlots){return this.siblingSlots[this.endFieldSiblingSlot]}}});Ext.reg("RL.FieldTypes.DateRangeStart.Combo",RL.FieldTypes.DateRangeStart.Combo);Ext.ns("RL.FieldTypes.DateRangeStart.Combo");RL.FieldTypes.DateRangeStart.Combo.WithDatePicker=Ext.extend(RL.FieldTypes.DateRangeStart.Combo,{width:210,minDays:2,maxDays:20,beforeInitComponent:function(){RL.FieldTypes.DateRangeStart.Combo.WithDatePicker.superclass.beforeInitComponent.call(this);this.addEvents("date-selected","change");this.items.push({xtype:"container",width:5,html:"&nbsp;"},{xtype:"button",slot:"datePickerButton",width:20,iconCls:"rl-icon-date-magnify",menuAlign:"tr-br",menu:new Ext.menu.Menu({plain:true,slots:true,items:[{xtype:"RL.FieldTypes.DateRangeStart.DatePicker",slot:"datePicker",range:this.range,listeners:{scope:this,select:this.onDateFromDatePicker}}]})})},initComponent:function(){RL.FieldTypes.DateRangeStart.Combo.WithDatePicker.superclass.initComponent.apply(this,arguments)},onDateFromDatePicker:function(c,b){this.setValue(b);this.onDayChange();this.fireEvent("date-selected",c,b,this);this.fireEvent("change",c,b,this)},onDayChange:function(){this.getDatePicker().setValue(this.getValue());RL.FieldTypes.DateRangeStart.Combo.WithDatePicker.superclass.onDayChange.call(this)},getDatePicker:function(){return this.slots.datePickerButton.menu.slots.datePicker}});Ext.reg("RL.FieldTypes.DateRangeStart.Combo.WithDatePicker",RL.FieldTypes.DateRangeStart.Combo.WithDatePicker);Ext.ns("RL.FieldTypes");RL.FieldTypes.DateRangeEnd=Ext.extend(RL.FieldTypes.DateRangeBase,{name:"#RDATE",startDateField:"#RDATE",initComponent:function(){this.fieldLabel=l("End Date");this.emptyText=l("Ends");this.configMenu={datePickerMsg:l("Select End Date")};RL.FieldTypes.DateRangeEnd.superclass.initComponent.call(this)}});Ext.reg("daterange_end",RL.FieldTypes.DateRangeEnd);Ext.ns("RL.FieldTypes.DateRangeEnd");RL.FieldTypes.DateRangeEnd.ListView=Ext.extend(Ext.ListView,{name:"#RDATE",range:null,minNights:null,maxNights:null,selectFirst:false,beforeInitComponent:function(){var b=new Ext.data.ArrayStore({fields:["enddate"],idIndex:0,data:[]});Ext.apply(this,{emptyText:l("Please select a start date"),deferEmptyText:false,singleSelect:true,columnSort:false,columns:[{header:l("End Date"),align:"center",dataIndex:"enddate",tpl:'{enddate:date("j M Y")}'}],store:b})},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.DateRangeEnd.ListView.superclass.initComponent.apply(this,arguments);this.on("afterrender",this.onAfterRender,this,{single:true})},onAfterRender:function(){if(this.selectFirst){this.select(0)}this.selectFirst=false},filterRange:function(c){var b=this.range.clone();var f=this.minNights;var e=this.maxNights;if(f!=null&&e!=null){b.filterByMinMaxNights(c,f,e)}return b},adjustForStartDate:function(c){this.emptyText="Sorry, no valid end dates";var b=this.filterRange(c);if(b.isEmpty()){this.store.removeAll()}else{this.store.loadData(b.getAllDatesAsArrays());this.select(0);if(!this.rendered){this.selectFirst=true}}}});Ext.reg("RL.FieldTypes.DateRangeEnd.ListView",RL.FieldTypes.DateRangeEnd.ListView);Ext.ns("RL.FieldTypes.DateRangeEnd.ListView");RL.FieldTypes.DateRangeEnd.ListView.Compact=Ext.extend(Ext.form.ComboBox,{name:"#RDATE",range:null,minNights:null,maxNights:null,width:130,beforeInitComponent:function(){Ext.apply(this,{editable:false,emptyText:l("No valid dates"),store:new Ext.data.ArrayStore({fields:["date","text"],idIndex:0,data:[]}),mode:"local",triggerAction:"all",lazyInit:false,displayField:"text",valueField:"date"})},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.DateRangeEnd.ListView.Compact.superclass.initComponent.apply(this,arguments);this.on("select",this.onDateSelected,this)},onDateSelected:function(c,b){},filterRange:function(c){var b=this.range.clone();var f=this.minNights;var e=this.maxNights;if(f!=null&&e!=null){b.filterByMinMaxNights(c,f,e)}return b},adjustForStartDate:function(e){var c=this.filterRange(e);var b=this.store;if(c.isEmpty()){this.clearValue();b.removeAll()}else{b.loadData(c.map(function(h){return[h,h.format("D, j M Y")]}));var f=b.getAt(0);this.setValue(f.get("date"));this.fireEvent("select",this,f)}}});Ext.reg("RL.FieldTypes.DateRangeEnd.ListView.Compact",RL.FieldTypes.DateRangeEnd.ListView.Compact);Ext.ns("RL.FieldTypes.DateRangeEnd");RL.FieldTypes.DateRangeEnd.DatePicker=Ext.extend(Ext.DatePicker,{range:null,minNights:null,maxNights:null,showToday:false,name:"#RDATE",initComponent:function(){this.addEvents("date-selected");RL.FieldTypes.DateRangeEnd.DatePicker.superclass.initComponent.apply(this,arguments);var b=this.range;this.setMinDate(b.getStartDate());this.setMaxDate(b.getEndDate());this.setDisabledDates(b.getInvalidDates(this.format));this.on("select",this.onValueChange,this)},onRender:function(c,b){RL.FieldTypes.DateRangeEnd.DatePicker.superclass.onRender.apply(this,arguments);var e=this.el.child("tr");e.remove();this.mun(this.eventEl,"mousewheel",this.handleMouseWheel,this)},filterRange:function(c){var b=this.range.clone();var f=this.minNights;var e=this.maxNights;if(f!=null&&e!=null){b.filterByMinMaxNights(c,f,e)}return b},adjustForStartDate:function(e){var b=this.filterRange(e);if(b.isEmpty()){var c=new Date();this.setValue(c);this.setMinDate(c);this.setMaxDate(c)}else{var f=b.getStartDate();this.setValue(f);this.setMinDate(f);this.setMaxDate(b.getEndDate())}this.setDisabledDates(b.getInvalidDates(this.format))},onValueChange:function(b,c){this.fireEvent("date-selected",this,c)}});Ext.reg("RL.FieldTypes.DateRangeEnd.DatePicker",RL.FieldTypes.DateRangeEnd.DatePicker);Ext.ns("RL.FieldTypes.DateRangeEnd.DatePicker");RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo=Ext.extend(RL.FieldTypes.DateRangeEnd.DatePicker,{combo:null,initComponent:function(){RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo.superclass.initComponent.apply(this,arguments);this.addEvents("date-selected","change");this.combo=new RL.FieldTypes.DateRangeEnd.Combo({range:this.range,minNights:this.minNights,maxNights:this.maxNights,height:27,style:"padding : 2px; padding-top : 3px"});this.on("select",this.onValueChange,this)},onRender:function(c,b){RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo.superclass.onRender.apply(this,arguments);var f=this.el.child("tr");var e=f.insertSibling({tag:"tr",children:[{tag:"td",colSpan:3,cls:"x-date-left"}]},"before");var h=this.combo;h.on("date-selected",this.onDateFromComboSelected,this);h.render(e.child("td"))},onDateFromComboSelected:function(b,c){this.setValue(c);this.fireEvent("date-selected",b,c,this);this.fireEvent("change",b,c,this)},destroy:function(){if(this.rendered){this.combo.destroy()}RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo.superclass.destroy.apply(this,arguments)},adjustForStartDate:function(b){this.combo.adjustForStartDate(b);RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo.superclass.adjustForStartDate.call(this,b)},onValueChange:function(b,c){if(b){this.combo.setValue(c)}RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo.superclass.onValueChange.apply(this,arguments)}});Ext.reg("RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo",RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo);Ext.ns("RL.FieldTypes.DateRangeEnd");RL.FieldTypes.DateRangeEnd.Combo=Ext.extend(Ext.Container,{slots:true,range:null,minNights:null,maxNights:null,filteredRange:null,width:170,name:"#RDATE",hasManuallyChanged:false,beforeInitComponent:function(){Ext.apply(this,{layout:"column",items:[{xtype:"container",slot:"card",layout:"card",width:165,activeItem:0,items:[{xtype:"container",slot:"multipleDates",layout:"column",items:[{xtype:"combo",slot:"months",editable:false,disabled:true,emptyText:l("No valid dates"),store:new Ext.data.ArrayStore({fields:["date","text"],idIndex:0,data:[]}),mode:"local",triggerAction:"all",displayField:"text",valueField:"date",width:80},{xtype:"container",width:5,html:"&nbsp;"},{xtype:"combo",slot:"days",emptyText:l("No valid dates"),editable:false,disabled:true,store:new Ext.data.ArrayStore({fields:["date","text"],idIndex:0,data:[]}),mode:"local",triggerAction:"all",displayField:"text",valueField:"date",width:80}]},{xtype:"textfield",slot:"singleDate",width:165,style:"text-align:center",cls:"rl-textfield-readonly",readOnly:true}]}]});this.addEvents("date-selected")},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.DateRangeEnd.Combo.superclass.initComponent.apply(this,arguments);var b=this.slots;b.months.on("select",this.onMonthChange_Manual,this);b.days.on("select",this.onDayChange_Manual,this);b.singleDate.on("render",this.setupSingleDateField,this);this.on("afterlayout",this.onAfterLayout,this,{single:true})},onAfterLayout:function(){if(this.value){this.setValue(Ext.jx.cleanDate(this.value))}},setupSingleDateField:function(){Ext.QuickTips.register({target:this.slots.singleDate.el,title:l("Read-only"),text:l("This is a single valid ending date"),width:100,dissmissDelay:2000,trackMouse:true})},setValue:function(b){var c=this.slots;c.months.setValue(b.clone().setDate(1)-0);if(this.rendered){this.updateDatesForMonth(b.clone().setDate(1)-0)}c.days.setValue(b.clearTime()-0)},getValue:function(){var b=this.slots.days.getValue();return b?new Date(b):null},setActiveDate:function(b){this.setValue(b);this.onDayChange()},filterRange:function(c){var b=this.range.clone();var f=this.minNights;var e=this.maxNights;if(f!=null&&e!=null){b.filterByMinMaxNights(c,f,e)}return b},adjustForStartDate:function(m){var j=this.slots;var h=j.months;var n=j.days;var e=j.card;var f=this.filteredRange=this.filterRange(m);n.clearValue();n.store.removeAll();n.disable();if(f.isEmpty()){j.singleDate.setValue("No valid dates");h.clearValue();h.store.removeAll();h.disable();this.switchToSingleField()}else{var c=f.getMonths();var k=[];Ext.each(c,function(p){k.push([p-0,p.format("M Y")])});h.store.loadData(k);if(h.store.getCount()>0){var b=h.store.getAt(0);h.setValue(b.get("date"));this.onMonthChange(h,b)}if(f.hasExactlyOneDay()){j.singleDate.setValue(f.getStartDate().format("D - M-d-Y"));this.switchToSingleField()}else{h.enable();n.enable();this.switchToTwoFields()}}},switchToSingleField:function(){var e=this.slots;var c=e.card;var b=e.singleDate;if(c.rendered){c.getLayout().setActiveItem(b)}else{c.activeItem=b}},switchToTwoFields:function(){var e=this.slots;var b=e.card;var c=e.multipleDates;if(b.rendered){b.getLayout().setActiveItem(c)}else{b.activeItem=c}},onMonthChange:function(c,b){this.updateDatesForMonth(new Date(b.get("date")));this.onDayChange()},onDayChange:function(){this.fireEvent("date-selected",this,this.getValue())},onMonthChange_Manual:function(c,b){this.onMonthChange(c,b);this.hasManuallyChanged=true},onDayChange_Manual:function(){this.onDayChange();this.hasManuallyChanged=true},updateDatesForMonth:function(b){var j=this.slots.days;var c=this.filteredRange;var f=c.getDatesForMonth(new Date(b));var e=[];Ext.each(f,function(k){e.push([k-0,k.format("d - D")])});j.store.loadData(e);if(j.store.getCount()>0){if(!c.hasExactlyOneDay()){j.enable()}var h=j.store.getAt(0);j.setValue(h.get("date"))}}});Ext.reg("RL.FieldTypes.DateRangeEnd.Combo",RL.FieldTypes.DateRangeEnd.Combo);Ext.ns("RL.FieldTypes.DateRangeEnd.Combo");RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker=Ext.extend(RL.FieldTypes.DateRangeEnd.Combo,{width:210,beforeInitComponent:function(){RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker.superclass.beforeInitComponent.call(this);this.items.push({xtype:"container",width:5,html:"&nbsp;"},{xtype:"button",slot:"datePickerButton",width:20,iconCls:"rl-icon-date-magnify",menuAlign:"tr-br",menu:new Ext.menu.Menu({plain:true,slots:true,items:[{xtype:"RL.FieldTypes.DateRangeEnd.DatePicker",slot:"datePicker",range:this.range,minNights:this.minNights,maxNights:this.maxNights,listeners:{scope:this,select:this.onDateFromDatePicker}}]})});this.addEvents("date-selected","change")},onDateFromDatePicker:function(c,b){this.setActiveDate(b,true);this.fireEvent("date-selected",c,b,this);this.fireEvent("change",c,b,this)},setValue:function(b){this.getDatePicker().setValue(b);RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker.superclass.setValue.call(this,b)},adjustForStartDate:function(b){this.getDatePicker().adjustForStartDate(b);RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker.superclass.adjustForStartDate.call(this,b)},getDatePicker:function(){return this.slots.datePickerButton.menu.slots.datePicker}});Ext.reg("RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker",RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker);Ext.ns("RL.FieldTypes");RL.FieldTypes.DateRange=Ext.extend(Ext.Container,{constructor:function(b){Ext.applyIf(b,{startDateFieldName:"#DDATE",endDateFieldName:"#RDATE",layout:"form"});if(!b.startDateField){b.startDateField={}}Ext.applyIf(b.startDateField,{xtype:"daterange_start",name:b.startDateFieldName,endDateField:b.endDateFieldName,value:b.startDateValue});if(!b.endDateField){b.endDateField={}}Ext.applyIf(b.endDateField,{xtype:"daterange_end",name:b.endDateFieldName,startDateField:b.endDateFieldName,value:b.endDateValue});b.items=[b.startDateField];delete b.startDateField;if(b.spacerField){b.items.push(b.spacerField);delete b.spacerField}b.items.push(b.endDateField);delete b.endDateField;RL.FieldTypes.DateRange.superclass.constructor.call(this,b)}});Ext.reg("daterange",RL.FieldTypes.DateRange);Ext.ns("RL.FieldTypes");RL.FieldTypes.PerPersonSelector=Ext.extend(Ext.ux.form.SpinnerField,{minValue:0,maxValue:100,width:50,initComponent:function(){if(!this.fieldLabel){this.fieldLabel=l("No. People")}RL.FieldTypes.PerPersonSelector.superclass.initComponent.call(this)}});Ext.reg("perperson_selector",RL.FieldTypes.PerPersonSelector);Ext.ns("RL.FieldTypes");RL.FieldTypes.Vendor=Ext.extend(Ext.form.ComboBox,{listWidth:500,width:120,realValueField:"#LINK_TO_SERVICE",realDisplayField:"VENDOR#VENDOR",store:[["","..."]],mode:"local",triggerAction:"all",typeAhead:false,tpl:'<tpl for="."><table class="search-item"><tr><td>{["<img style=\'float:left; margin:3px\' src=\'"+Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"})+"/TN_"+values["VENDOR#IMAGE1"]+"\'><b>"+values["VENDOR#VENDOR"]+"</b>..."+values["VENDOR#SHORT"]]}</td></tr></table></tpl>',itemSelector:"table.search-item",initComponent:function(){this.fieldLabel=l("Vendor");this.loadingText=l("Searching...");this.emptyText=l("Vendors");RL.FieldTypes.Vendor.superclass.initComponent.call(this);this.on({beforerender:function(){this.loadParentFields();var c=Ext.jx,b=RL.Global.getVendorDlEventName(this.destCode,this.producttype),e=this.producttype+"-"+this.destCode;if(!RL.Global.downloadedVendorLists[b]){RL.Global.Events.on(b,this.vendorsDownloaded,this)}else{this.vendorsDownloaded(true)}},render:function(){Ext.jx.Misc.WebKitLateTriggerRender.defer(1,this)}})},loadParentFields:function(c){if(this.destCode&&this.producttype){return true}var e=this.findParentBy(function(f){return !!f.resortRecord});if(!e){return false}this.destCode=e.resortRecord.get("RESORT#SEARCHCODE");var b=this.findParentBy(function(f){return !!f.recordProduct});if(!b){return false}this.producttype=b.recordProduct.get("SERVICE#CODE");return true},vendorsDownloaded:function(f){this.loadParentFields();var e=Ext.jx,b=RL.Global.getVendorDlEventName(this.destCode,this.producttype),h=this.producttype+"-"+this.destCode;if(!e.vendors_type){this.hideItem();return}var c=e.vendors_type[h];if(!c||c.length<=1){this.hideItem()}else{this.store=new Ext.data.ArrayStore({fields:Ext.jx.getStore("VENDOR").fields.items});this.store.add(c);this.displayField=this.realDisplayField;this.valueField=this.realValueField}if(!f){RL.Global.Events.un(b,this.vendorsDownloaded)}}});Ext.reg("vendor_selector",RL.FieldTypes.Vendor);Ext.ns("RL.FieldTypes");RL.FieldTypes.PriceCategories=Ext.extend(Ext.Container,{slots:true,specialRecord:null,beforeInitComponent:function(){var f=[{xtype:"RL.FieldTypes.PriceCategories.Header"}];var c=RL.Global.getCurrency();var b=this.specialRecord;var h=new Date();for(var j=1;j<10;j++){var e=b.getBuildData(j,h,h,c);if(e){f.push({xtype:"RL.FieldTypes.PriceCategory",slot:"priceCode"+j,specialRecord:b,priceCode:j,currency:c})}}Ext.apply(this,{items:f})},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.PriceCategories.superclass.initComponent.apply(this,arguments)},hasSpecialAdded:function(){var b=false;Ext.jx.each(this.slots,function(c,e){if(c.hasSpecialAdded()){b=true;return false}});return b},getBuildData:function(){var b=[];Ext.jx.each(this.slots,function(e,f){var c=e.getBuildData();if(c){b.push(c)}});b.sort(function(e,c){return e["BUILD#CITY"]-c["BUILD#CITY"]});return b},updateFor:function(e,b,c){Ext.jx.each(this.slots,function(f,h){f.updateFor(e,b,c)})},markInvalid:function(){}});Ext.reg("RL.FieldTypes.PriceCategories",RL.FieldTypes.PriceCategories);Ext.ns("RL.FieldTypes.PriceCategories");RL.FieldTypes.PriceCategories.Compact=Ext.extend(Ext.form.ComboBox,{specialRecord:null,emptyText:l("No valid dates"),beforeInitComponent:function(){Ext.apply(this,{store:new Ext.data.ArrayStore({fields:["id","price","buildData"],idIndex:0}),displayField:"price",valueField:"id",mode:"local",triggerAction:"all",editable:false})},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.PriceCategories.superclass.initComponent.apply(this,arguments)},updateFor:function(h,b,c){var k=[];c=(c instanceof Ext.data.Record)?c:Ext.jx.getTable("CURRENCY").Funcs.getCurrencyByCode(c||"USD");for(var j=1;j<10;j++){var f=this.specialRecord.getBuildData(j,h,b,c);if(f){k.push(f)}}this.markInvalid();var e=this.store;if(k.length){this.enable();var m=[];Ext.each(k,function(n,p){m.push([p,c.asString(n["BUILD#PRICE"])+" "+n["SPECIAL#DESC"],n])});e.loadData(m);this.setValue(0)}},markInvalid:function(){this.clearValue();this.disable()}});Ext.reg("RL.FieldTypes.PriceCategories.Compact",RL.FieldTypes.PriceCategories.Compact);Ext.ns("RL.FieldTypes.PriceCategories");RL.FieldTypes.PriceCategories.Header=Ext.extend(Ext.Container,{beforeInitComponent:function(){Ext.apply(this,{layout:"column",cls:"rl-special-categories-header",style:"font-size:12px; font-weight:80;",items:[{xtype:"displayfield",width:50,value:"Qty"},{xtype:"container",width:10,html:"&nbsp;"},{xtype:"displayfield",width:195,value:"Description"},{xtype:"container",width:10,html:"&nbsp;"},{xtype:"displayfield",width:80,value:"Price"}]})},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.PriceCategories.Header.superclass.initComponent.apply(this,arguments)}});Ext.reg("RL.FieldTypes.PriceCategories.Header",RL.FieldTypes.PriceCategories.Header);Ext.ns("RL.FieldTypes");RL.FieldTypes.PriceCategory=Ext.extend(Ext.Container,{slots:true,specialRecord:null,priceCode:null,currency:null,startdate:null,enddate:null,quantity:null,beforeInitComponent:function(){var b=this.specialRecord.getBuildData(this.priceCode,new Date(),new Date(),this.currency);Ext.apply(this,{layout:"column",items:[{xtype:"combo",slot:"qtyCombo",editable:false,mode:"local",triggerAction:"all",width:50,listWidth:50,emptyText:"--",displayField:"text",valueField:"qty",store:new Ext.data.ArrayStore({fields:["qty","text"],idIndex:0,data:[[0,"--"],[1,"1"],[2,"2"],[3,"3"],[4,"4"],[5,"5"],[6,"6"],[7,"7"],[8,"8"],[9,"9"],[10,"10"]]}),listeners:{scope:this,select:this.onQtyChange}},{xtype:"container",width:10,html:"&nbsp;"},{xtype:"displayfield",slot:"description",width:195,style:"font-size:14px; font-weight:normal;",value:b["#UNIT_DESC"].replace(/(.{150}).*/,"$1...")},{xtype:"container",width:10,html:"&nbsp;"},{xtype:"displayfield",slot:"price",width:80}]});this.addEvents("quantity-update");this.enableBubble("quantity-update")},initComponent:function(){this.beforeInitComponent();RL.FieldTypes.PriceCategory.superclass.initComponent.apply(this,arguments)},onQtyChange:function(c,b){this.quantity=b.get("qty");this.fireEvent("quantity-update",this,this.quantity)},hasSpecialAdded:function(){return Boolean(this.quantity)},getBuildData:function(){if(this.hasSpecialAdded()){return this.specialRecord.getBuildData(this.priceCode,this.startdate,this.enddate,this.currency,this.quantity)}},updateFor:function(f,b,c){c=this.currency=(c instanceof Ext.data.Record)?c:Ext.jx.getTable("CURRENCY").Funcs.getCurrencyByCode(c||"USD");this.startdate=f;this.enddate=b;var e=this.specialRecord.getBuildData(this.priceCode,f,b,c);this.slots.price.setValue("<b>"+c.asString(e["BUILD#PRICE"])+"</b>")},markInvalid:function(){}});Ext.reg("RL.FieldTypes.PriceCategory",RL.FieldTypes.PriceCategory);Ext.ns("RL.form");RL.form.ChooseResortComboBox=Ext.extend(Ext.form.ComboBoxQuickChange,{name:"GTAW#RESORT",width:200,listWidth:600,displayField:"RESORT#RESORT",valueField:"RESORT#SEARCHCODE",onViewClick:function(c){var b=this.view.getSelectedIndexes()[0];var e=Ext.jx.Template.findSearchItem("resortDropdown",b);if(e){this.onSelect(e,b)}if(c!==false){this.el.focus()}},findRecord:function(f,e){var b;var c=Ext.jx.getStore("RESORT","ALL");if(c.getCount()>0){c.each(function(h){if(h.data[f]==e){b=h;return false}})}return b},typeAhead:true,mode:"local",triggerAction:"all",allowBlank:false,selectOnFocus:true,initComponent:function(){this.emptyText=l("Choose a destination");this.fieldLabel=l("Destination")},listeners:{render:function(){},beforerender:function(){var b=RL.Global.getDefaultDestCode();if(b){this.setValue(b);Ext.jx.setStoreValue("GTAW#RESORT",b);this.hideItem();return}this.store=Ext.jx.getStore("SUPERDES");this.store.sort("SUPERDES#IRETEMPS","ASC");this.tpl=new Ext.XTemplate(Ext.jx.getTable("SUPERDES").templates.dests);this.itemSelector="div.search-item"}}});Ext.reg("choose_resort_combo",RL.form.ChooseResortComboBox);Ext.ns("RL.form.ChooseResortComboBox");RL.form.ChooseResortComboBox.Detail=Ext.extend(Ext.Panel,{slots:true,constructor:function(b){b=b||{};Ext.apply(b,{autoEl:"div",layout:"columnfit",items:[{xtype:"container",autoEl:"div",slot:"grouped_to_master",width:30,cls:"rs-super-dest-to-master"},{xtype:"RL.form.ChooseResortComboBox.Detail.View",slot:"grouped_detail_view",columnWidth:1}]});this.addEvents("resort_chosen","back");RL.form.ChooseResortComboBox.Detail.superclass.constructor.call(this,b)},initComponent:function(){RL.form.ChooseResortComboBox.Detail.superclass.initComponent.call(this);this.slots.grouped_to_master.on("render",function(b){var c=b.el;c.on("click",function(){this.fireEvent("back",this)},this);c.on("mouseover",function(){c.addClass("rs-super-dest-hover")});c.on("mouseout",function(){c.removeClass("rs-super-dest-hover")})},this);this.slots.grouped_to_master.on("render",function(b){Ext.QuickTips.register({target:b.el,title:l("Back to groups"),text:l("Back to groups"),width:100,trackMouse:true})},this);this.slots.grouped_detail_view.on("resort_chosen",this.onDetailListClick,this)},setSuperDest:function(b){this.slots.grouped_detail_view.setSuperDest(b)},onDetailListClick:function(b,c){this.fireEvent("resort_chosen",this,c)}});Ext.reg("choose_resort_detail",RL.form.ChooseResortComboBox.Detail);Ext.ns("RL.form.ChooseResortComboBox.Detail");RL.form.ChooseResortComboBox.Detail.View=Ext.extend(Ext.DataView,{tpl:new Ext.XTemplate(['{[ Ext.jx.Template.clearSearchItems("subDestsDetail") ]}','<tpl for=".">','<div class="x-panel-header">','<span class="x-panel-header-text">{[xindex == 1 ? values._record.getSuperDestRecord().getName() : ""]}</span>',"</div>",'<div class="rs-sub-dest-wrp">',"{[",'Ext.jx.Template.setSearchItem("subDestsDetail",values._record)+','"<div class=\'search-item\' recordId=\'"+values._record.get("#LINK_TO_RESORT")+"\'>"+','values._record.template("shortcleandesc")+','"</div>"',"]}","</div>","</tpl>"]),itemSelector:"div.rs-sub-dest-wrp",singleSelect:true,overClass:"rs-super-dest-hover",style:{"overflow-y":"auto","overflow-x":"hidden"},beforeInitComponent:function(){Ext.apply(this,{store:new Ext.data.Store()});this.addEvents("resort_chosen")},initComponent:function(){this.beforeInitComponent();RL.form.ChooseResortComboBox.Detail.View.superclass.initComponent.call(this);this.on("click",this.onDetailListClick,this)},setSuperDest:function(c){var b=new Ext.data.Store();c.getDests().each(function(e){b.add(e.copy())});this.setStore(b);if(this.rendered){this.refresh()}},onDetailListClick:function(b,c,e){var f=Ext.jx.Template.findSearchItem("subDestsDetail",c);if(!f){return devThrow("Resort record not found")}this.fireEvent("resort_chosen",this,f)}});Ext.reg("RL.form.ChooseResortComboBox.Detail.View",RL.form.ChooseResortComboBox.Detail.View);Ext.ns("RL.form.ChooseResortComboBox.Detail");RL.form.ChooseResortComboBox.Detail.Sliding=Ext.extend(Ext.Panel,{slots:true,firstSetup:true,currentSuperDestination:null,constructor:function(b){b=b||{};Ext.apply(b,{border:false,layout:"columnfit",items:[{xtype:"container",slot:"grouped_to_master",width:30,cls:"rs-super-dest-to-master"},{xtype:"panel",slot:"slider",border:false,columnWidth:1,layout:"slide",activeItem:0,items:[{xtype:"RL.form.ChooseResortComboBox.Detail.View",slot:"firstView"}]}]});this.addEvents("resort_chosen","back");RL.form.ChooseResortComboBox.Detail.Sliding.superclass.constructor.call(this,b)},initComponent:function(){RL.form.ChooseResortComboBox.Detail.Sliding.superclass.initComponent.call(this);this.slots.grouped_to_master.on("render",function(b){var c=b.el;c.on("click",function(){this.fireEvent("back",this)},this);c.on("mouseover",function(){c.addClass("rs-super-dest-hover")});c.on("mouseout",function(){c.removeClass("rs-super-dest-hover")})},this);this.slots.grouped_to_master.on("render",function(b){Ext.QuickTips.register({target:b.el,title:l("Back to groups"),text:l("Back to groups"),width:100,trackMouse:true})},this);this.slots.firstView.on("resort_chosen",this.onDetailListClick,this)},setSuperDest:function(c){if(this.currentSuperDestination==c){return}this.currentSuperDestination=c;if(this.firstSetup){this.slots.firstView.setSuperDest(c);this.firstSetup=false;return}var e=new RL.form.ChooseResortComboBox.Detail.View();e.on("resort_chosen",this.onDetailListClick,this);var b=this.slots.slider;b.add(e);if(b.items.getCount()>2){b.remove(0);b.layout.activeItemNo--}b.doLayout(false,true);e.setSuperDest(c);b.layout.setActiveItem(e)},onDetailListClick:function(b,c){this.fireEvent("resort_chosen",this,c)}});Ext.reg("RL.form.ChooseResortComboBox.Detail.Sliding",RL.form.ChooseResortComboBox.Detail.Sliding);Ext.ns("RL.form.ChooseResortComboBox");RL.form.ChooseResortComboBox.SimpleView=Ext.extend(Ext.Container,{slots:true,autoHeight:true,autoWidth:true,constructor:function(b){b=b||{};Ext.apply(b,{title:l("List"),items:[{xtype:"dataview",slot:"list",store:Ext.jx.getStore("SUPERDES","ALL"),tpl:new Ext.XTemplate(Ext.jx.getTable("SUPERDES").templates.dests),itemSelector:"div.search-item",singleSelect:true,overClass:"rs-search-item-hover",style:{"padding-right":Ext.isIE?""+Ext.getScrollBarWidth()+"px":"0","overflow-y":"auto","overflow-x":"hidden"}}]});this.addEvents("resort_chosen");RL.form.ChooseResortComboBox.SimpleView.superclass.constructor.call(this,b)},initComponent:function(){RL.form.ChooseResortComboBox.SimpleView.superclass.initComponent.call(this);this.slots.list.on("click",this.onSimpleListViewClick,this)},onSimpleListViewClick:function(b,c,e){var f=Ext.jx.Template.findSearchItem("resortDropdown",c);if(!f){return devThrow("Resort record not found")}this.fireEvent("resort_chosen",this,f)}});Ext.reg("choose_resort_simple",RL.form.ChooseResortComboBox.SimpleView);Ext.ns("RL.form.ChooseResortComboBox");RL.form.ChooseResortComboBox.GroupedView=Ext.extend(Ext.Panel,{slots:true,detailsXtype:null,masterViewConfig:null,constructor:function(b){b=b||{};Ext.apply(b,{title:l("Regions"),layout:"slide",activeItem:0,items:[Ext.apply({xtype:"panel",border:false,slot:"grouped_master",autoWidth:true,layout:"fit",items:[{xtype:"dataview",slot:"dataview",store:Ext.jx.getStore("SUPERDES","ALL"),tpl:new Ext.XTemplate(['{[ Ext.jx.Template.clearSearchItems("superDestsMaster") ]}','<tpl for=".">','{[ values._record.getDests().items.length ? Ext.jx.Template.setSearchItem("superDestsMaster", values._record) : ""]}','{[ !values._record.getDests().items.length ? "" : ','"<div class=rs-super-dest-wrp>',"<div class='rs-super-dest-to-detail'>","</div>","<div class='rs-super-dest'>\"+",'values._record.getImageHtml(1,"TN_")+','values._record.getName("span")+','"</div>',"<div class='x-clear'></div>",'</div>"',"]}","</tpl>"]),itemSelector:"div.rs-super-dest-wrp",singleSelect:true,overClass:"rs-super-dest-hover",style:{"overflow-y":"auto","overflow-x":"hidden"}}]},b.masterViewConfig||{}),{xtype:b.detailsXtype||"choose_resort_detail",slot:"grouped_detail",listeners:{back:this.onGroupedBack,resort_chosen:this.onResortChosen,scope:this}}]});this.addEvents("resort_chosen");RL.form.ChooseResortComboBox.GroupedView.superclass.constructor.call(this,b)},initComponent:function(){RL.form.ChooseResortComboBox.GroupedView.superclass.initComponent.call(this);this.slots.dataview.store.sort("SUPERDES#IRETEMPS","ASC");this.slots.dataview.on("click",this.onMasterListClick,this)},onResortChosen:function(c,b){this.fireEvent("resort_chosen",this,b)},onGroupedBack:function(){if(this.rendered){this.layout.setActiveItem(this.slots.grouped_master)}},onMasterListClick:function(b,c,e){var f=Ext.jx.Template.findSearchItem("superDestsMaster",c);if(!f){return devThrow("Super destination record not found")}this.switchToSuperDest(f)},switchToSuperDest:function(c){var b=this.slots;b.grouped_detail.setSuperDest(c);this.layout.setActiveItem(b.grouped_detail)}});Ext.reg("choose_resort_groupedview",RL.form.ChooseResortComboBox.GroupedView);Ext.ns("RL.form.ChooseResortComboBox");RL.form.ChooseResortComboBox.MapView=Ext.extend(Ext.Panel,{slots:true,mapHtml:null,supDesRegexStr:"superdest[-=](\\w+)",desRegexStr:"-dest-(\\w+)-",superDestOnlyReport:false,mapBodyClass:null,constructor:function(b){b=b||{};Ext.apply(b,{title:l("Map View"),layout:"slide",activeItem:0,items:[{slot:"map",layout:"auto",bodyCssClass:b.mapBodyClass,border:false,style:{"text-align":"center","overflow-y":"auto","overflow-x":"hidden"},html:b.mapHtml},{xtype:"choose_resort_detail",slot:"mapview_detail",listeners:{back:this.onMapViewBack,resort_chosen:this.onResortChosen,scope:this}}]});this.addEvents("resort_chosen","super_dest_chosen");RL.form.ChooseResortComboBox.MapView.superclass.constructor.call(this,b)},initComponent:function(){RL.form.ChooseResortComboBox.MapView.superclass.initComponent.call(this);this.slots.map.on("afterlayout",this.setupMap,this,{single:true})},getScrollWidth:function(){var b=this.slots.map;return b.body.dom.scrollWidth},getScrollHeight:function(){var b=this.slots.map;return b.body.dom.scrollHeight},onResize:function(c,f){RL.form.ChooseResortComboBox.MapView.superclass.onResize.call(this,c,f);var b=this.slots.map;var e=b.el;if(e&&!this.privateResizing){this.privateResizing=true;(function(){var n=this.getScrollWidth(),j=this.ownerCt.getWidth(),m=300;var k=j-m,h=k>n?n:k;if(Math.abs(this.getWidth()-h)>7){b.body.setOverflow(h==n?"hidden":"auto");this.setWidth(h);this.ownerCt.doLayout()}(function(){this.privateResizing=false}).defer(100,this)}).defer(100,this)}},onResortChosen:function(c,b){this.fireEvent("resort_chosen",this,b)},onMapViewBack:function(){if(this.rendered){this.layout.setActiveItem(this.slots.map)}},setupMap:function(c){var f=c.el;c.body.setOverflow("auto");var k=f.child("img");var j=f.child("map");if(!k||!j){Ext.jx.debug("Problem setting up the map.");return}j.set({name:j.id});k.set({useMap:"#"+j.id});var e=this.slots;var h=Ext.jx.getStore("SUPERDES");var b=new RegExp(this.supDesRegexStr,"i");f.select("area",true).each(function(m){m.on("click",function(r){var q=b.exec(m.dom.href);if(q){r.preventDefault();var n=q[1];var p=h.query("SUPERDES#CODE",n).itemAt(0);this.fireEvent("super_dest_chosen",this,p);if(this.superDestOnlyReport){return}e.mapview_detail.setSuperDest(p);this.layout.setActiveItem(e.mapview_detail)}},this)},this)}});Ext.reg("choose_resort_mapview",RL.form.ChooseResortComboBox.MapView);Ext.ns("RL.form.ChooseResortComboBox");RL.form.ChooseResortComboBox.Intelligent=Ext.extend(Ext.form.ComboBox.Container,{displayField:"RESORT#RESORT",valueField:"RESORT#SEARCHCODE",width:150,listWidth:500,height:500,selectOnFocus:true,typeAhead:true,typeAheadDelay:350,mode:"local",tabsEnabled:["grouped"],mapHtml:null,supDesRegex:null,constructor:function(c){c=c||{};this.fieldLabel=l("Destination");this.emptyText=l("Choose a destination");Ext.apply(this,c);if(RL.Global.getSuperDests().length<2){this.tabsEnabled=["simple"]}if(Ext.jx.getStoreValue("DEPT#CONDESMAPH")){if(!Ext.jx.getStoreValue("DEPT#CONDESMAPR")){Ext.jx.setStoreValue("DEPT#CONDESMAPR","-superdest-(\\w\\w)-.htm")}this.tabsEnabled.push("map")}var e={};Ext.each(this.tabsEnabled,function(f){e[f]=true});var b=[];if(e.simple){b.push({xtype:"choose_resort_simple",listeners:{resort_chosen:this.onResortChosen,scope:this}})}if(e.grouped){b.push({xtype:"choose_resort_groupedview",height:275,slot:"grouped",listeners:{resort_chosen:this.onResortChosen,scope:this}})}if(e.map){b.push({xtype:"choose_resort_mapview",slot:"map",mapHtml:this.mapHtml||Ext.jx.getStoreValue("DEPT#CONDESMAPH"),supDesRegex:this.supDesRegexStr||Ext.jx.getStoreValue("DEPT#CONDESMAPR"),listeners:{resort_chosen:this.onResortChosen,resize:function(j,f,m){var k=Math.max(j.getScrollWidth(),this.listWidth);if(Math.abs(this.list.getWidth()-k)>7){this.list.setWidth(k+Ext.getScrollBarWidth());this.innerList.setWidth(k+Ext.getScrollBarWidth())}},scope:this}})}if(b.length>1){this.embedd=new Ext.ux.TabPanel.Slideable({slots:true,layoutOnTabChange:true,activeTab:0,items:b})}else{b[0].header=false;this.embedd=new Ext.Container({slots:true,layout:"fit",items:b})}RL.form.ChooseResortComboBox.Intelligent.superclass.constructor.call(this,c)},initComponent:function(){RL.form.ChooseResortComboBox.Intelligent.superclass.initComponent.call(this);var b=Ext.jx.getStore("RESORT","ALL");this.store=new Ext.data.Store();b.each(function(c){this.store.add(c.copy())},this);this.on("collapse",this.rollBackDetailView,this)},onResortChosen:function(c,b){this.store.clearFilter();this.onSelect(b)},rollBackDetailView:function(){var b=this.embedd.slots;if(b.grouped){b.grouped.onGroupedBack()}if(b.map){b.map.onMapViewBack()}},onTypeAhead:function(){if(this.store.getCount()>0){var f=this.getValue();var c=this.store.getAt(0);var e=c.data[this.displayField];var b=e.length;var h=this.getRawValue().length;if(h!=b){this.setValue(c.data[this.valueField]);this.fireEvent("change",this,c.data[this.valueField],f);this.selectText(h,e.length)}}}});Ext.reg("choose_resort_intell",RL.form.ChooseResortComboBox.Intelligent);Ext.ns("RL.form");RL.form.SimpleButton=Ext.extend(Ext.Button,{template:new Ext.Template('<em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em>')});Ext.reg("simple_button",RL.form.SimpleButton);Ext.ns("RL");(function(){var c=RL.Global=RL.Global||{},b=Ext.jx;Ext.apply(c,{downloadedVendorLists:{},downloadedPricingStores:{},Events:new Ext.util.Observable(),minWidth:700,minHeight:500,connectedDestProducts:{},connectedDestProdGroups:{},vendorsFetchedFor:{},user:null,viewport:null,getWindowSize:function(){var f=0,e=0;if(typeof(window.innerWidth)=="number"){f=window.innerWidth;e=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){f=document.documentElement.clientWidth;e=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){f=document.body.clientWidth;e=document.body.clientHeight}}}return{width:f,height:e}},currencyCode:null,currencyRecord:null,getCurrency:function(){var f=b.getStoreValue("GTAW#CADCURR");if(!f){b.setStoreValue("GTAW#CADCURR",(f=b.getStoreValue("DEPT#CURRENCY")||b.getStoreValue("CONFIG#CURRENCY")))}if(c.currencyCode!=f){c.currencyRecord=b.getStore("CURRENCY").data.map["CURRENCY#CTYCODE="+(c.currencyCode=f)];var e=c.currencyRecord.get("CURRENCY#HTMLFORMAT");b.math.htmlFormat=e||"$ 123,456,789.00"}return c.currencyRecord},setCurrency:function(e){c.currencyRecord=e;b.setStoreValue("GTAW#CADCURR",e.get("CURRENCY#CTYCODE"))},processDeptSettings:function(e){var h="";Ext.each(["CONFIG","DEPT","CURRENCY","SUPERDES","RESORT","SERVICE"],function(p){if(!Ext.jx.getStore(p).getCount()){h+=p+" file is bad. \n"}},this);if(h!=""){if(!c.retriedDeptFile&&!e){c.retriedDeptFile=true;Ext.jx.log("Needed to reload department file");var k=Ext.jx.getStoreValue("DEPT#DEPTNO")||Ext.jx.getQueryString()["pl"];var m=(new Date()).format("YmdHis");var n=Ext.jx.Server.getPrimary();var f=n+"?screen=dept_file&pl="+k+"&rand="+m;Ext.jx.External.includeJs(f,function(){c.processDeptSettings(true)});alert("Now reloading system file. Please wait a few more seconds.");return false}else{alert("Error loading web engine: \n"+h+"\n Delete consumer cache as the first step and then check data loading. \n");return false}}if(Ext.fly("perl_debugging")){Ext.fly("perl_debugging").remove(true)}if(!RL.Defaults){RL.Defaults={}}if(!RL.Defaults.USE_DATEFIELDPLUS){Ext.reg("datefieldplus",Ext.form.DateField)}Jemplate.init({PRE_PROCESS:["WRM.HTML"]});c.user=new RL.Model.User();var j=navigator.userAgent.toLowerCase();Ext.isIPhone=(j.indexOf("iphone")!=-1);Ext.isIPad=(j.indexOf("ipad")!=-1);Ext.isAndroid=(j.indexOf("android")!=-1);Ext.isMobile=Ext.isIPhone||Ext.isIPad||Ext.isAndroid;Ext.QuickTips.init();Ext.form.Field.prototype.msgTarget="side";if(Ext.get("SEO_RESLOGIC")){Ext.get("SEO_RESLOGIC").setStyle("display","none")}b.getStore("SPECIAL").recordType.prototype.fields.get("SPECIAL#FROMPRICE").sortType=function(p){return Number(p)||0};Ext.jx.setStoreValue("DEPT#FSZDTPCKR",1);c.getCurrency();c.viewport=new RL.Viewport();c.viewport.start()},dispatch:function(){c.viewport.dispatch.apply(c.viewport,arguments)},allowQuoteWizard:function(){if(Ext.jx.getStoreValue("DEPT#WEBQUOT")==1){return false}var f=Ext.jx.getRecord({tableName:"DEPT"});var e=f.getQuotingRange();if(e.isEmpty()){return false}return true},showUserAccount:function(e,h){if(!c.user.authenticated){var f=new RL.Login.Popup({isTravelAgent:h,returnTrips:true});f.show(e)}else{c.viewport.showUserAccount()}},showQuoteWizard:function(f,e){c.viewport.showQuoteWizard(f,e)},startQuoteOver:function(f){var e=Ext.jx.getStoreValue("GTAW#RESORT");b.getStore("BUILD").removeAll();b.getStore("GTAW").removeAll();RL.Global.dispatch({screen:"scnWizardSteps",dest:e},{addHistory:1})},startQuoteOverIf:function(e){if(!b.getStore("BUILD").getCount()){c.startQuoteOver();return}Ext.Msg.show({title:l("Warning"),msg:l("This action will cause you to start your quote over. Are you sure that you would like to continue?"),buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.WARNING,scope:c,fn:function(f){if(f=="yes"){c.startQuoteOver()}}})},showContentQuote:function(e,h,f){c.viewport.showContentQuote(e,h,f)},ensureGtawRecord:function(){var e=b.getStore("GTAW");if(!e.getAt(0)){var f=e.reader.recordType;e.add([new f({})])}gtawRecord=e.getAt(0)},defaultDestCode:null,prettyDate:function(e){if(Ext.isDate(e)){e=e.dateFormat("d-M-Y")}return e},getDefaultTripConfig:function(){var f={};var e=c.getDefaultDates();f.startdate=e.startDate;f.enddate=e.endDate;f.dest=c.getDefaultDestCode();f.triptype=c.getQuoteMode()=="both"?"multi":c.getQuoteMode();return f},getDefaultDates:function(){var e={};var h=Ext.jx.getRecord({tableName:"DEPT"});var f=h.getQuotingRange_Start();if(f){e.minValue=f.getStartDate()}if(f){e.maxValue=f.getEndDate()}e.days=Ext.jx.getStoreValue("DEPT#TQDAYSDEF")?Number(Ext.jx.getStoreValue("DEPT#TQDAYSDEF")):5;e.daysOut=Ext.jx.getStoreValue("DEPT#TQNODAYS")?Number(Ext.jx.getStoreValue("DEPT#TQNODAYS")):0;e.fixedDate=Ext.jx.getStoreValue("DEPT#TQFIXDATE")?Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQFIXDATE")):undefined;if(!e.maxValue||!e.maxValue.subtractDt||e.maxValue.subtractDt(new Date())<0){e.minValue=e.maxValue=undefined}if(e.fixedDate){e.startDate=Ext.jx.cleanDate(e.fixedDate)}else{e.startDate=(new Date()).add("d",e.daysOut);if(e.minValue&&e.startDate){e.startDate=e.startDate.getMaxDate(e.minValue)}}if(e.startDate){e.endDate=e.startDate.add("d",e.days)}return e},getWizard:function(f,e){if(!f.wizard){f.wizard=f.findParentBy(function(h){if(h instanceof RL.Quote.WizardBase){return true}})}if(!f.wizard&&!e){window.gtawNew.findBy(function(h){if(h instanceof RL.Quote.WizardBase&&!f.wizard){f.wizard=h}})}return f.wizard},getCurrentDestIndex:function(e){if(c.getTripType()!="multi"){return 0}var f=e.findParentBy(function(h){return typeof h.n_dest!="undefined"});return f?f.n_dest:0},getSegmentStartValues:function(e,f){return c.getSegmentStartValuesAll()[c.getCurrentDestIndex(e)]},getTripStartCt:function(){var e=window.gtawNew.slots.wizard.slots.start;return e?e.getTripStartContainer():undefined},updateAirportByDest:function(f){var m=b.getTable("RESORT").Funcs.getDestinationByCode(f);var k=c.getTripStartCt();if(m){k.setValues({"#TO_AIRPORT":m.getValue("RESORT#PREFDCITY")})}k.validate();var e=k.findBy(function(n){return n.name==="#FROM_AIRPORT"});if(e.length){var j=e[0];if(j.getValue()===""&&RL.NEARBY_AIRPORTS){var h=c.getMostNearbyAirport();if(h){if(j.store){j.setValue(h)}else{j.value=h}j.markInvalid("Your outgoing airport was automatically calculated based on your Internet address.")}}}},getTripStartValues:function(){var e=c.getSegmentStartValuesAll();return{adults:e[0].adults,children:e[0].children,usesAir:e[0].usesAir,fromAirport:e[0].fromAirport,toAirport:e[0].toAirport,dest:e[0].dest,startdate:e[0].startdate,enddate:e[e.length-1].enddate}},displayStartStep:function(){return !(Ext.jx.getStoreValue("#B_NO_TRIP_QUOTE_START_STEP")=="1"&&RL.Global.getDefaultDestCode())},getSegmentStartValuesAll:function(j){var h=[];var e={};if(!c.getTripStartCt()){e={startdate:b.cleanDate(e["GTAW#DDATE"]),enddate:b.cleanDate(e["GTAW#RDATE"])}}else{e=c.getTripStartCt().getValues()}if(c.getTripType()==="multi"){if(j&&!e["GTAW#ADULT"]){}else{e.dest_group.each(function(k){if(!k["GTAW#RESORT"]){return}if(j&&(!k["GTAW#DDATE"]||!k["GTAW#RDATE"])){return}h.push({adults:e["GTAW#ADULT"],children:e["GTAW#CHILD"],usesAir:e["#AIR_OPTION"],fromAirport:e["#FROM_AIRPORT"],toAirport:e["#TO_AIRPORT"],dest:k["GTAW#RESORT"],startdate:b.cleanDate(k["GTAW#DDATE"]),enddate:b.cleanDate(k["GTAW#RDATE"])})})}}else{var f=b.getStore("GTAW").getAt(0);e["GTAW#RESORT"]=f.data["GTAW#RESORT"]||e["GTAW#RESORT"];e["GTAW#DDATE"]=f.data["GTAW#DDATE"]||e["GTAW#DDATE"];e["GTAW#RDATE"]=f.data["GTAW#RDATE"]||e["GTAW#RDATE"];e["GTAW#ADULT"]=f.data["GTAW#ADULT"]||e["GTAW#ADULT"];e["GTAW#CHILD"]=f.data["GTAW#CHILD"]||e["GTAW#CHILD"];if(j&&(!e["GTAW#RESORT"]||!e["GTAW#DDATE"]||!e["GTAW#RDATE"]||!e["GTAW#ADULT"])){}else{h.push({adults:e["GTAW#ADULT"],children:e["GTAW#CHILD"],usesAir:e["#AIR_OPTION"],fromAirport:e["#FROM_AIRPORT"],toAirport:e["#TO_AIRPORT"],dest:e["GTAW#RESORT"],startdate:b.cleanDate(e["GTAW#DDATE"]),enddate:b.cleanDate(e["GTAW#RDATE"])})}}return h},getQuoteMode:function(){if(!c.defaultQuoteMode){if(c.getDefaultDestCode()){b.setStoreValue("DEPT#CONMULTDES",0)}var e=Number(b.getStoreValue("DEPT#CONMULTDES"));if(isNaN(e)){e=0}c.defaultQuoteMode={0:"single",2:"multi",1:"both"}[e]}return c.defaultQuoteMode},getTripType:function(){if(!c.triptype){var e=c.getQuoteMode();if(e!="both"){c.triptype=e}else{if(c.getDefaultDestCode()||!c.triptype){c.triptype="single"}}}return c.triptype},getDefaultDestRecord:function(){var f=c.getDefaultDestCode();var e;if(f){var h=Ext.jx.getStore("RESORT");e=h.getAt(h.find("RESORT#SEARCHCODE",f))}return e},getDefaultDestCode:function(){if(typeof c.defaultDest==="undefined"){c.defaultDest=Ext.isEmpty(b.getStoreValue("DEPT#CONDESTLCK"))?false:b.getStoreValue("DEPT#CONDESTLCK");if(!c.defaultDest){var e=c.getDestinationIfSingle();if(e){c.defaultDest=e.get("RESORT#SEARCHCODE")}}}return c.defaultDest},getDestinationIfSingle:function(){var e=b.getStore("RESORT");return e.getCount()==1&&e.getAt(0)},getVendorDlEventName:function(f,e){return"downloaded_vendor_list-"+f},getVendorsForProduct:function(e,h){var k=[];if(!e){e=RL.Global.getDefaultDestRecord()}if(!e){return[]}var j=e.get("RESORT#SEARCHCODE");var f=new RegExp(j);b.each(b.vendors,function(p,m){var n=p.data["VENDOR#VENTYPE"];if(n==h.get("SERVICE#CODE")&&(f.test(p.data["VENDOR#DEST"])||p.data["VENDOR#REGION"]==j)){k.push(p)}});return k},getVendorsForProductGroup:function(f,e){var k=[];if(!f){f=RL.Global.getDefaultDestRecord()}if(!f){return[]}var j=f.get("RESORT#SEARCHCODE");var h=new RegExp(j);b.each(b.vendors,function(r,n){var p=r.data["VENDOR#VENTYPE"];var q=e.get_products();var m=false;q.each(function(s){if(p==s.get("SERVICE#CODE")){m=true;return false}});if(m&&(h.test(r.data["VENDOR#DEST"])||r.data["VENDOR#REGION"]==j)){k.push(r)}});return k},getVendors:function(m,p,q){if(!m){m=RL.Global.getDefaultDestRecord()}if(!m){return}var j=m.get("RESORT#SEARCHCODE");var k=b;if(!k.vendors){k.vendors={}}if(!k.vendors_type){k.vendors_type={}}var h="vendors-fetched-"+j;c.Events.addEvents(h);c.Events.on(h,function(s,r){if(p){p.call(q||window,s,m)}},c,{single:true});var f=Ext.jx.getStoreValue("DEPT#DEPTNO")||Ext.jx.getQueryString()["pl"];var n="-pl-"+f+"-dest-"+j+"-screen-Dest_File-.js";if(Ext.jx.cdnPath){Ext.jx.External.includeJs(Ext.jx.cdnPath+n,function(){c.processVendors(m)})}var e=Ext.jx.Server.getPrimary();Ext.jx.External.includeJs(e+n,function(){c.processVendors(m)})},processVendors:function(q){var m=q.get("RESORT#SEARCHCODE");var n=b;for(var p in Ext.jx.tables.VENDOR.dataStorage){if(!p||p.substr(0,6)!="VENDOR"){continue}var f=Ext.jx.tables.VENDOR.dataStorage[p];var r=f["#LINK_TO_VENDOR"]||f["#LINK_TO_SERVICE"];var k=f["VENDOR#VENTYPE"]+"-"+m;var h=new (Ext.jx.getStore("VENDOR").recordType)(f);n.vendors[r]=h;if(!n.vendors_type[k]){n.vendors_type[k]=[]}n.vendors_type[k].push(h);delete Ext.jx.tables.VENDOR.dataStorage[p];if(!r){b.debug("Missing key locater for record")}}c.vendorsFetchedFor[m]=true;var j=c.getVendorDlEventName(m);c.Events.fireEvent(j);c.downloadedVendorLists[j]=true;var e="vendors-fetched-"+m;c.Events.fireEvent(e,true,q)},getMostNearbyAirport:function(){return(RL.NEARBY_AIRPORTS&&RL.NEARBY_AIRPORTS.length?RL.NEARBY_AIRPORTS[0].airport:undefined)},productSupports:function(e,f){var j;if(typeof e=="string"){var h=b.getStore("SERVICE");j=h.data.map["SERVICE#CODE="+e]}else{j=e;e=j.data["SERVICE#CODE"]}switch(f){case"golf":return(e==="GO"&&RL.Defaults.DEV_MODE&&b.getStoreValue("DEPT#CONGOLFPLN"))}return false},getSuperDests:function(){var e=[];b.getStore("SUPERDES").each(function(f){if(f.getDests().items.length){e.push(f)}});return e},showContent:function(m,k,n,f,j){var h;switch(k){case"vendor":if(typeof n=="string"){n=b.vendors[n]}h=Ext.apply({xtype:"vendor_content",vendorRecord:n,searchForm:m,active:f,autoHeight:false},j);break;case"dest":if(typeof n=="string"){n=b.getStore("RESORT").data.map["RESORT#SEARCHCODE="+n]}if(n){h={xtype:"dest_content",destRecord:n,active:f,autoHeight:false}}break}if(h){var e=new Ext.ux.PanelBlind({destroyOnDismiss:true,autoHeight:false,layout:"fit",height:400,frame:true});e.init(m);e.show({items:h})}},getUrchinCookie:function(e){var f=Ext.util.Cookies.get(e)||"";return f.replace(/ /g,"+").replace(/\r\n/g,"")},extractUrchinValue:function(j,f){var h=new RegExp(f+"=(.*?)[\\|;]");var e=h.exec(j);return e?e[1]:""},getAnalyticData:function(k){k=k||"GTAW";var h=c.getUrchinCookie("__utmz");var n=c.getUrchinCookie("__utma");var m=c.getUrchinCookie("__utmb");var j=c.getUrchinCookie("__utmc");var e="__utma="+n+";+__utmz="+h+";+__utmb="+m+";+__utmc="+j;var f={};f[k+"#URLSOURCE"]=window.location.href;f[k+"#IREADTRACK"]=RL.Variables.trk;f[k+"#UCAMPAIGN"]=c.extractUrchinValue(e,"utmccn");f[k+"#UCAMPID"]=c.extractUrchinValue(e,"utmcid");f[k+"#UCONTENT"]=c.extractUrchinValue(e,"utmcct");f[k+"#UCOOKIE"]=e;f[k+"#UMEDIUM"]=c.extractUrchinValue(e,"utmcmd");f[k+"#USOURCE"]=c.extractUrchinValue(e,"utmcsr");f[k+"#UTERM"]=c.extractUrchinValue(e,"utmctr");return f}})})();Ext.ns("RL.Layout");RL.Layout.Border=Ext.extend(Ext.Container,{extraHeightGatherMode:"max",destinationSelectorMode:"content",conFrame:null,currentLayout:"",autoHeight:true,autoWidth:true,beforeInitComponent:function(){var b=this.getFrameConfig();Ext.apply(this,{slots:true,layout:"table",layoutConfig:{columns:3,tableAttrs:{style:{width:"100%"}}},items:[b.CONTOPLEFT,b.CONTOP,b.CONTOPRIGHT,b.CONLEFT,{region:"center",cellCls:"concenter",xtype:"panel",vAlign:"top",autoHeight:true,autoWidth:true,frame:false,style:"margin-top:-3px",border:false,listeners:{resize:function(){var e=this.bwrap.child("."+this.baseCls+"-tbar");if(e){e.setWidth("auto")}}},tbar:new Ext.Toolbar({autoWidth:true,slots:true,items:[{xtype:"tbtext",slot:"screenTitle",cls:"screenTitle",text:"",dispatchTo:{screen:"scnDestHome"},handler:this.onButtonClick,scope:this},RL.Global.getDefaultDestCode()?"":{xtype:"choose_resort_intell",slot:"destCombo",hidden:true,emptyText:l("Choose Another Destination"),width:190,listeners:{scope:this,change:this.switchDestination}},{text:RL.Global.getDefaultDestCode()?l("More Info"):l("Destinations"),slot:"destsBtn",scale:"medium",dispatchTo:{screen:"scnDestHome"},handler:this.onButtonClick,scope:this},Number(Ext.jx.getStoreValue("DEPT#CONHIDESPE"))==1||!Ext.jx.getStore("SPECIAL").getCount()?"":{text:l("Specials"),scale:"medium",slot:"SpecialsBtn",dispatchTo:this.dispatchToSpecials,dispatchScope:this,handler:this.onButtonClick,scope:this},!RL.Global.allowQuoteWizard()?"":{text:l("Trip Quote"),scale:"medium",slot:"QuoteBtn",dispatchTo:this.onGetTripQuote,dispatchScope:this,handler:this.onButtonClick,scope:this},{text:l("Login"),scale:"medium",slot:"LoginBtn",dispatchTo:{screen:"scnlogon"},handler:this.onButtonClick,scope:this}]}),layout:"card",activeItem:0,slot:"content",slots:true},b.CONRIGHT,b.CONBOTTOMLEFT,b.CONBOTTOM,b.CONBOTTOMRIGHT]})},initComponent:function(){this.beforeInitComponent();RL.Layout.Border.superclass.initComponent.call(this);this.on("destination-banner-updated",this.onShowDestSelector,this);this.on("destination-banner-hidden",this.onHideDestSelector,this)},usesTplFrame:function(c){var b=false;Ext.each(["CONTOPLEFT","CONTOP","CONTOPRIGHT","CONLEFT","CONRIGHT","CONBOTTOMLEFT","CONBOTTOM","CONBOTTOMRIGHT"],function(f){var e="DEPT/"+c+f+".HTML";if(Jemplate.templateMap[e]){b=true}},this);return b},getFrameConfig:function(e){if(e){e+="-"}else{e=""}if(this.conFrame&&this.currentLayout==e){return this.conFrame}this.currentLayout=e;this.conFrame={CONTOPLEFT:{},CONTOP:{},CONTOPRIGHT:{},CONLEFT:{},CONRIGHT:{},CONBOTTOMLEFT:{},CONBOTTOM:{},CONBOTTOMRIGHT:{}};if(this.usesTplFrame(e)){Ext.each(["CONTOPLEFT","CONTOP","CONTOPRIGHT","CONLEFT","CONRIGHT","CONBOTTOMLEFT","CONBOTTOM","CONBOTTOMRIGHT"],function(h){var f="DEPT/"+e+h+".HTML";if(Jemplate.templateMap[f]){this.conFrame[h]={jemplate:f,hidden:false}}},this)}else{Ext.each(["CONTOPLEFT","CONTOP","CONTOPRIGHT","CONLEFT","CONRIGHT","CONBOTTOMLEFT","CONBOTTOM","CONBOTTOMRIGHT"],function(h){var f=Ext.jx.getStoreValue("DEPT#"+h);if(f){this.conFrame[h]={html:f,hidden:false}}},this)}var b=this.conFrame.CONTOPLEFT.html||this.conFrame.CONTOPRIGHT.html;this.conFrame.CONTOPLEFT.hidden=this.conFrame.CONTOPRIGHT.hidden=!b;var c=this.conFrame.CONBOTTOMLEFT.html||this.conFrame.CONBOTTOMRIGHT.html;this.conFrame.CONBOTTOMLEFT.hidden=this.conFrame.CONBOTTOMRIGHT.hidden=!c;Ext.applyIf(this.conFrame.CONTOPLEFT,{xtype:"RL.Screen.Template",jemplate:undefined,html:undefined,slot:"contopleft",cellCls:"contopleft",autoWidth:true});Ext.applyIf(this.conFrame.CONTOP,{xtype:"RL.Screen.Template",jemplate:undefined,html:undefined,hidden:true,slot:"contop",cellCls:"contop",colspan:b?1:3});Ext.applyIf(this.conFrame.CONTOPRIGHT,{xtype:"RL.Screen.Template",jemplate:undefined,html:undefined,slot:"contopright",cellCls:"contopright",autoWidth:true});Ext.applyIf(this.conFrame.CONLEFT,{xtype:"RL.Screen.Template",vAlign:"top",jemplate:undefined,html:undefined,hidden:true,cellCls:"conleft",slot:"conleft",autoWidth:true});Ext.applyIf(this.conFrame.CONRIGHT,{xtype:"RL.Screen.Template",vAlign:"top",jemplate:undefined,html:undefined,hidden:true,slot:"conright",cellCls:"conright",autoWidth:true});Ext.applyIf(this.conFrame.CONBOTTOMLEFT,{xtype:"RL.Screen.Template",jemplate:undefined,html:undefined,slot:"conbottomleft",cellCls:"conbottomleft",autoWidth:true});Ext.applyIf(this.conFrame.CONBOTTOM,{xtype:"RL.Screen.Template",jemplate:undefined,html:undefined,hidden:true,slot:"conbottom",cellCls:"conbottom",colspan:c?1:3});Ext.applyIf(this.conFrame.CONBOTTOMRIGHT,{xtype:"RL.Screen.Template",jemplate:undefined,html:undefined,slot:"conbottomright",cellCls:"conbottomright",autoWidth:true});return this.conFrame},onShowDestSelector:function(c,k,b){return;this.destinationSelectorMode=k;var f=this.slots.content.getTopToolbar();if(!f){return}var e=f.slots;var h=e.destCombo;if(h){h.hasFocus=false;h.clearValue();h.show()}var j=e.destTitle;if(j){j.setText(l("More Info")+": <b>"+b.data["RESORT#RESORT"]+"</b>");j.show()}if(f.rendered){f.doLayout()}},onHideDestSelector:function(){return;var c=this.slots.content.getTopToolbar();if(!c){return}var b=c.slots;if(!RL.Global.getDefaultDestCode()&&b.destTitle){b.destTitle.hide()}if(b.destCombo){b.destCombo.hide()}if(c.rendered){c.doLayout()}},dispatchToSpecials:function(){var b=Ext.jx.getStore("BUILD").getCount();if(!b){RL.Global.dispatch({screen:"scnsell_special"},{addHistory:1});return}Ext.Msg.show({title:l("Warning"),msg:l("This action will cause you to start your quote over. Are you sure that you would like to continue?"),buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.WARNING,scope:this,fn:function(c){if(c=="yes"){Ext.jx.getStore("BUILD").removeAll();Ext.jx.getStore("GTAW").removeAll();RL.Global.dispatch({screen:"scnsell_special"},{addHistory:1})}}})},switchDestination:function(h,j,c){if(!j){return}var f=this.slots.content.getTopToolbar();var e=f.slots;if(this.destinationSelectorMode=="content"){RL.Global.viewport.dispatch({screen:"scnDestHome",dest:j},{addHistory:1})}else{if(this.destinationSelectorMode=="starter"){var b=Ext.jx.getStore("BUILD").getCount();var k=function(){var m={};Ext.jx.each({"GTAW#DDATE":"startdate","GTAW#RDATE":"enddate","GTAW#ADULT":"adults","GTAW#CHILD":"children","GTAW#CADCURR":"currency"},function(p,n){m[p]=gtawRecord.get(n)});if(m.startdate){m.startdate=m.startdate.format("m/d/Y")}if(m.enddate){m.enddate=m.enddate.format("m/d/Y")}m.dest=j;if(RL.Global.displayStartStep()){m.step=m.startdate&&m.enddate?2:1}else{m.step=1}RL.Global.startQuoteOver(m)};if(!b){k.call(this);return}Ext.Msg.show({title:l("Warning"),msg:l("This action will cause you to start your quote over. Are you sure that you would like to change this field?"),buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.WARNING,scope:this,fn:function(m){if(m=="yes"){k.call(this)}else{h.setValue(c)}}})}}},onGetTripQuote:function(){RL.Global.startQuoteOverIf()},onButtonClick:function(b){var c=b.dispatchTo;if(typeof c=="function"){c.call(b.dispatchScope||this)}else{RL.Global.dispatch(b.dispatchTo,{addHistory:1})}}});Ext.reg("RL.Layout.Border",RL.Layout.Border);Ext.ns("RL.Login");RL.Login.Form=Ext.extend(Ext.Panel,{slots:true,returnTrips:true,plain:true,buttonAlign:"right",showCancelButton:true,loginButtonConfig:null,passwordReminderStyle:null,beforeInitComponent:function(){Ext.apply(this,{layout:"form",labelWidth:70,bodyStyle:"padding : 15px; overflow:visible",items:[{xtype:"textfield",slot:"username",allowBlank:false,width:140,fieldLabel:l("Email")},{xtype:"container",height:10,html:"&nbsp;"},{xtype:"textfield",slot:"password",allowBlank:false,width:140,inputType:"password",fieldLabel:l("Password")}],buttons:[Ext.applyIf(this.loginButtonConfig||{},{text:l("Login"),handler:this.onLoginClick,scope:this,scale:"medium",iconCls:"rl-icon-login"}),!this.showCancelButton?"":{text:l("Cancel"),handler:this.onCancelClick,scope:this,scale:"medium",iconCls:"rl-icon-cancel"},{text:l("Reset Password"),handler:this.onResetPasswordClick,scope:this,scale:"medium",iconCls:"rl-icon-cancel"}]})},initComponent:function(){this.beforeInitComponent();RL.Login.Form.superclass.initComponent.call(this);this.addEvents("logged-in","cancel");this.enableBubble("logged-in","cancel")},onRender:function(){RL.Login.Form.superclass.onRender.apply(this,arguments)},onLoginClick:function(){if(!this.validate()){return}Ext.jx.mask(Ext.getBody(),l("Authorizing, please wait..."),"rl-mask-medium");RL.Global.user.authenticate({username:this.slots.username.getValue(),password:this.slots.password.getValue(),returnTrips:this.returnTrips},this.authenticateCallback,this)},onResetPasswordClick:function(){if(!this.slots.username.validate()){return}Ext.jx.mask(Ext.getBody(),l("Resetting Password, please wait..."),"rl-mask-medium");RL.Global.user.resetPassword({username:this.slots.username.getValue()},this.ResetPasswordCallback,this)},ResetPasswordCallback:function(b,c){Ext.jx.unmask(Ext.getBody());if(c){alert(l("Your password has been reset and emailed to you."))}else{this.slots.username.markInvalid()}},authenticateCallback:function(b,c){Ext.jx.unmask(Ext.getBody());if(c){this.fireEvent("logged-in",this)}else{this.slots.username.markInvalid();this.slots.password.markInvalid()}},onCancelClick:function(){this.fireEvent("cancel",this)}});Ext.reg("RL.Login.Form",RL.Login.Form);Ext.ns("RL.Login");RL.Login.Popup=Ext.extend(RL.Cust.Identity,{slots:true,showCancelButton:false,onLoggedIn:function(){RL.Login.Popup.superclass.onLoggedIn.call(this);RL.Global.showUserAccount()},onCustomerInfoReady:function(){RL.Login.Popup.superclass.onCustomerInfoReady.call(this);var b=RL.Global.user;Ext.jx.mask(Ext.getBody(),l("Now creating user, please wait..."),"rl-mask-medium");b.newUser(this.getValues(),this.NewUserCallback,this)},NewUserCallback:function(b,c){Ext.jx.unmask(Ext.getBody());if(c){alert(l("Your account has been created and your password has been mailed to you."))}else{alert(l("There was an unknown problem. Please try again or call us."))}}});Ext.reg("RL.Login.Popup",RL.Login.Popup);Ext.ns("RL.Model");RL.Model.DateRange=Ext.extend(Object,{dates:null,constructor:function(b){Ext.apply(this,b);this.dates=this.dates||{}},clone:function(){return new this.constructor({dates:Ext.apply({},this.dates)})},addRange:function(j,e){var h=Ext.jx.cleanDate(j);var b=Ext.jx.cleanDate(e);var f=new Date();for(var c=h;c<=b;c=c.add(Date.DAY,1)){if(c>=f){this.dates[c.format("Y/m/d")]=c}}},removeRange:function(h,e){var f=Ext.isDate(h)?h:Date.parseDate(h,"m/d/Y");var b=Ext.isDate(e)?e:Date.parseDate(e,"m/d/Y");for(var c=f;c<=b;c=c.add(Date.DAY,1)){delete this.dates[c.format("Y/m/d")]}},getAllDatesAsString:function(){var b=[];Ext.jx.each(this.dates,function(e,c){b.push(c)});return b},getAllDatesSorted:function(){var b=[];Ext.jx.each(this.dates,function(e,c){b.push([e,c])});b.sort(function(e,c){return e[0]-c[0]});return b},map:function(e,c){var b=[];Ext.jx.each(this.getAllDatesSorted(),function(f){b.push(e.call(c||this,f[0],f[1]))});return b},getAllDatesAsArrays:function(){var b=this.getAllDatesAsString().sort();Ext.each(b,function(e,c){b[c]=[Date.parseDate(e,"Y/m/d")]});return b},getStartDate:function(){var b=this.getAllDatesAsString();var c=b.sort()[0];if(!c){return null}return Date.parseDate(c,"Y/m/d")},getEndDate:function(){var b=this.getAllDatesAsString();var c=b.sort()[b.length-1];if(!c){return null}return Date.parseDate(c,"Y/m/d")},getMonths:function(){var c={};var b=[];Date.defaults.d=1;Ext.jx.each(this.dates,function(f,e){var h=e.replace(/\/\d+$/,"");if(!c[h]){b.push(Date.parseDate(h,"Y/m"))}c[h]=true});return b.sort(function(f,e){return f-e})},getDatesForMonth:function(b){var c=b.format("Y/m");var e=[];Ext.jx.each(this.dates,function(h,f){if(f.replace(/\/\d+$/,"")==c){e.push(h)}});return e.sort(function(h,f){return h-f})},filterBy:function(b){var c=this.dates;Ext.jx.each(c,function(f,e){if(b(f)){delete c[e]}})},filterDaysOfWeek:function(c){if(!(c instanceof Array)){c=[c]}var e=this.dates;var b=c.join("");if(b){Ext.jx.each(e,function(j,h){var f=j.format("w");if(b.indexOf(f)!=-1){delete e[h]}})}},contains:function(b){var c=Ext.jx.cleanDate(b);return this.dates[c.format("Y/m/d")]!=null},getInvalidDates:function(f){var h=this.getStartDate();var c=this.getEndDate();var b=[];if(h&&c){for(var e=h;e<=c;e=e.add(Date.DAY,1)){if(!this.dates[e.format("Y/m/d")]){b.push("^"+e.format(f||"m/d/Y")+"$")}}}return b.length?b:null},filterByMinMaxNights:function(b,e,c){this.removeRange(this.getStartDate(),b.add(Date.DAY,-1));e=Number(e);c=Number(c);if(e){this.removeRange(b,b.add(Date.DAY,e-1))}if(c){this.removeRange(b.add(Date.DAY,c+1),this.getEndDate())}},isEmpty:function(){return Ext.jx.isEmpty(this.dates)},hasExactlyOneDay:function(){var b=0;for(var c in this.dates){if(this.dates.hasOwnProperty(c)){b++;if(b>1){return false}}}return b==1}});Ext.ns("RL.Model");RL.Model.User=Ext.extend(Ext.util.Observable,{prospwRecord:{data:{}},authenticated:false,constructor:function(b){Ext.apply(this,b);RL.Model.User.superclass.constructor.call(this,b);this.addEvents("login-success","login-failure","logout-success","resetpw-success")},newUser:function(values,callback,scope){var server=Ext.jx.Server.get();var url=server+"?screen=js::action::new_user&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO");if(Ext.jx.getQueryString()["debug_mode"]){url+="&debug_output_to_email=1"}new Ext.data.Connection().request({scope:this,method:"POST",timeout:60,url:url,params:{page_action:Ext.urlEncode(Ext.jx.Ajax.cleanFieldNamesForPost(values))},success:function(responseObject){Ext.jx.Server.release(server);var isError=false,tempVar,response;try{response=responseObject.responseObject||eval("tempVar="+responseObject.responseText)}catch(e){isError=true}if(isError){if(callback){callback.call(scope||window,this,false)}return}this.prospwRecord.data=values;if(callback){callback.call(scope||window,this,true)}},failure:function(){alert("login failure");Ext.jx.Server.release(server);if(callback){callback.call(scope||window,this,false)}},scope:this})},resetPassword:function(options,callback,scope){if(!options){options={}}if(!options.username){return devThrow("Can't reset password- username is missing")}var server=Ext.jx.Server.get();var url=server+"?screen=js::action::reset_password&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO");if(Ext.jx.getQueryString()["debug_mode"]){url+="&debug_output_to_email=1"}new Ext.data.Connection().request({scope:this,method:"POST",timeout:60,url:url,params:{page_action:Ext.urlEncode(Ext.jx.Ajax.cleanFieldNamesForPost({"PROSPW#EMAIL":options.username}))},success:function(responseObject){Ext.jx.Server.release(server);var isError=false,tempVar,response;try{response=responseObject.responseObject||eval("tempVar="+responseObject.responseText)}catch(e){isError=true}if(isError){if(callback){callback.call(scope||window,this,false)}return}if(callback){callback.call(scope||window,this,true)}},failure:function(){Ext.jx.Server.release(server);alert("reset password failure?");if(callback){callback.call(scope||window,this,false)}},scope:this})},authenticate:function(options,callback,scope){if(!options){options={}}if(!options.username||!(options.password||options.check2)){return devThrow("Can't authenticate user - some of credentials are missed")}var server=Ext.jx.Server.get();var url=server+"?screen=js::action::logon&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO");if(Ext.jx.getQueryString()["debug_mode"]){url+="&debug_output_to_email=1"}new Ext.data.Connection().request({scope:this,method:"POST",timeout:60,url:url,params:{consumer_email:options.username,consumer_password:options.password,check2:options.check2,return_trips:options.returnTrips?"1":"0"},success:function(responseObject){Ext.jx.Server.release(server);var isError=false,tempVar,response;try{response=responseObject.responseObject||eval("tempVar="+responseObject.responseText)}catch(e){isError=true}if(isError||response.ERROR||!response.PROSPW){this.fireEvent("login-failure",this);this.prospwRecord={data:{}};if(callback){callback.call(scope||window,this,false)}return}var prospwData;if(response.PROSPW.dataStorage.ALL){prospwData=response.PROSPW.dataStorage.ALL}else{Ext.jx.each(response.PROSPW.dataStorage,function(value){prospwData=value})}if(prospwData&&prospwData.rows&&prospwData.rows[0]){Ext.jx.getTable("PROSPW").setData(prospwData);this.prospwRecord=Ext.jx.getStore("PROSPW").getAt(0)}if(options.returnTrips){var gtawQuotesData={meta:null,results:0,rows:[]};if(response.GTAW&&response.GTAW.dataStorage){Ext.jx.each(response.GTAW.dataStorage,function(value){if(!gtawQuotesData.meta){gtawQuotesData.meta=value.meta}gtawQuotesData.results++;gtawQuotesData.rows.push(value.rows[0])});gtawQuotesData=this.prepareQuotesData(gtawQuotesData)}else{gtawQuotesData.meta={fields:{}}}Ext.jx.setTable("GTAWQUOTES",{fields:gtawQuotesData.meta.fields});Ext.jx.getTable("GTAWQUOTES").setData(gtawQuotesData);Ext.jx.getStore("GTAWQUOTES").sort("GTAWQUOTES#RESNUM","DESC")}this.authenticated=true;this.fireEvent("login-success",this);if(callback){callback.call(scope||window,this,true)}},failure:function(){alert("login failure");Ext.jx.Server.release(server);gtawRecord.data["#CHECK2"]="";if(callback){callback.call(scope||window,this,false)}},scope:this})},prepareQuotesData:function(b){if(!b.meta){b.meta={}}b.meta.tableName="GTAWQUOTES";b.meta.id="#LINK_TO_GTAWQUOTES";Ext.jx.each(b.meta.fields,function(c){c.name=c.name.replace(/GTAW/,"GTAWQUOTES")});Ext.jx.each(b.rows,function(f,e){var c={};Ext.jx.each(f,function(j,h){c[h.replace(/GTAW/,"GTAWQUOTES")]=j});b.rows[e]=c});return b},applyDataToGTAW:function(){var c=Ext.jx.getStore("GTAW").getAt(0).data;var b=this.prospwRecord.data;for(var e in b){c[e]=b[e]}},getQuotesStore:function(){return Ext.jx.getStore("GTAWQUOTES")},getFirstName:function(){return this.get("PROSPW#FIRST")},getLastName:function(){return this.get("PROSPW#LAST")},getFullName:function(){return this.getFirstName()+" "+this.getLastName()},getAuthToken:function(){return this.get("#CHECK2")},logout:function(){this.authenticated=false;Ext.jx.getStore("PROSPW").removeAll();Ext.jx.getStore("GTAWQUOTES").removeAll();this.fireEvent("logout-success",this)},get:function(){if(!this.authenticated){return devThrow("Can't 'get' - user isn't authenticated yet")}var b=this.prospwRecord;return b.get.apply(b,arguments)},set:function(){if(!this.authenticated){return devThrow("Can't 'set' - user isn't authenticated yet")}var b=this.prospwRecord;return b.set.apply(b,arguments)}});Ext.ns("RL.Model");RL.Model.Quote=Ext.extend(Ext.util.Observable,{user:null,loaded:false,finalizing:false,resno:null,authToken:null,isDirty:true,constructor:function(b){Ext.apply(this,b);RL.Model.Quote.superclass.constructor.call(this,b);RL.Global.ensureGtawRecord();RL.Global.getCurrency();this.addEvents("load-success","load-failure","change","before-finalize","after-finalize")},load:function(callback,scope){if(!this.resno||!this.authToken){return devThrow("Can't load quote - either res_num or check value is missed")}var actionParams=Ext.jx.Ajax.urlEncode({screen:"js::action::get_quote",pl:Ext.jx.getStoreValue("DEPT#DEPTNO"),resno:this.resno,check:this.authToken});if(Ext.jx.getQueryString()["debug_mode"]){actionParams+="&debug_output_to_email=1"}var server=Ext.jx.Server.get();Ext.Ajax.request({timeout:90,url:server+"?"+actionParams,method:"GET",success:function(responseObject){Ext.jx.Server.release(server);var isError=false,tempVar,response;try{response=responseObject.responseObject||eval("tempVar="+responseObject.responseText)}catch(e){isError=true}if(isError||!response.GTAW||!response.BUILD||!response.PROSPW){this.fireEvent("load-failure",this);if(callback){callback.call(scope||window,this,false)}return}Ext.jx.setTable("GTAW",response.GTAW);Ext.jx.setTable("BUILD",response.BUILD);RL.Global.ensureGtawRecord();RL.Global.getCurrency();var resortStore=Ext.jx.getStore("RESORT");var resortCodes={};var resortCount=1;resortCodes[gtawRecord.getResortRecord().get("RESORT#SEARCHCODE")]=gtawRecord.getResortRecord();Ext.jx.getStore("BUILD").each(function(buildRecord){var destSeg=buildRecord.get("BUILD#DESTSEG");var match=/(\d+):(.+)/.exec(destSeg);if(!match||resortCodes[match[2]]){return}resortCodes[match[2]]=resortStore.getAt(resortStore.find("RESORT#SEARCHCODE",match[2]));resortCount++},this);var me=this;var loaded=0;var success=true;var checkReady=function(){if(loaded==resortCount){if(success){me.loaded=true;me.isDirty=false;me.fireEvent("load-success",me);if(callback){callback.call(scope||window,me,true)}}else{me.fireEvent("load-failure",me);if(callback){callback.call(scope||window,me,false)}}}};Ext.jx.each(resortCodes,function(resortRecord,code){RL.Global.getVendors(resortRecord,function(loadedSuccessfully){success=success&&loadedSuccessfully;loaded++;checkReady()})})},failure:function(){Ext.jx.Server.release(server);this.fireEvent("load-failure",this);if(callback){callback.call(scope||window,this,false)}},scope:this})},getRecord:function(){return Ext.jx.getStore("GTAW").getAt(0)},getCount:function(){return Ext.jx.getStore("BUILD").getCount()},haveItems:function(){return Ext.jx.getStore("BUILD").getCount()>0},get:function(b){return this.getRecord().get(b)},set:function(b,c){return this.getRecord().set(b,c)},canBook:function(){return this.canEdit()&&!this.getQuoteProblems()},canEmail:function(){return !this.getQuoteProblems()},canAdd:function(){return this.canEdit()},canEdit:function(){return !this.isBooking()&&!this.isBookingRequest()},canFinalize:function(){return this.isDirty&&!this.getQuoteProblems()},isFinalized:function(){return this.get("GTAW#RESNUM")},isBooking:function(){return this.get("GTAW#TYPE")=="B"},isBookingRequest:function(){return this.get("GTAW#TYPE")=="S"},openQuote:function(){var c=Ext.jx.Server.get();var b=Ext.jx.Ajax.urlEncode({screen:"scnContentQuote",resno:this.resno,check:this.authToken});Ext.jx.redirect(c+"?"+b,l("Now redirecting you to your main quote page"))},book:function(b,e){if(!this.canBook()){return devThrow("Can't book quote")}var f=this;Ext.jx.mask(Ext.getBody(),l("Finalizing your quote..."),"rl-mask-medium",true,true);if(this.finalizing){this.on("after-finalize",function(j,k){Ext.jx.unmask(Ext.getBody());if(k){this.book(b,e)}else{b.call(e||window)}},this,{single:true});return}if(this.isDirty){this.finalize(function(){f.book()},b,e);return}var h=Ext.jx.Server.get();var c=Ext.jx.Ajax.urlEncode({screen:"scnBookSteps",resno:this.resno,check:this.authToken,noiqpcache:1});Ext.jx.redirect(h+"?"+c,l("Now redirecting you to complete the booking process"))},email:function(b,e){if(!this.canEmail()){return devThrow("Can't email quote")}var f=this;if(this.finalizing){this.on("after-finalize",function(j,k){if(k){this.email(b,e)}else{b.call(e||window)}},this,{single:true});return}if(this.isDirty){this.finalize(function(){f.email()},b,e);return}var h=Ext.jx.Server.get();var c=Ext.jx.Ajax.urlEncode({screen:"scnEmailSteps",resno:this.resno,check:this.authToken});Ext.jx.redirect(h+"?"+c)},editBuildRecord:function(c,b){if(!this.canEdit()){return devThrow("Can't edit quote")}Ext.apply(c.data,b);this.isDirty=true;this.updateTSICalcs()},removeBuildRecord:function(c){if(!this.canEdit()){return devThrow("Can't edit quote")}var e=Ext.jx.getStore("BUILD");var b=c instanceof Ext.data.Record?c:e.getById(c);e.remove(b);this.isDirty=true;this.updateTSICalcs()},getQuoteProblems:function(){var j=Ext.jx.getStore("BUILD");var h=false;j.each(function(k){if(k.get("BUILD#TYPE")=="S*"){h=true;return false}});if(h){return""}var e=j.getCount()>=Number(Ext.jx.getStoreValue("DEPT#NOREQTSI")||1);var f="";if(!e){f+="* "+l("You need to select at least ")+Number(Ext.jx.getStoreValue("DEPT#NOREQTSI")||1)+" "+l("item(s)")+" <br>"}if(RL.Global.triptype=="single"&&gtawRecord.data["GTAW#RESORT"]){var b=Ext.jx.getStore("RESORT").data.map["RESORT#SEARCHCODE="+gtawRecord.data["GTAW#RESORT"]];if(b){var c=b.checkAllRequiredProducts();if(c.desc.length){f+="* "+l("You are missing the following required item(s):")+" "+c.desc+" <br>"}}}return f},finalize:function(p,h,r){if(!this.canFinalize()){return devThrow("Can't finalize quote")}this.finalizing=true;this.fireEvent("before-finalize",this);RL.Global.user.applyDataToGTAW();var n={};Ext.apply(n,RL.Global.getAnalyticData("GTAW"));Ext.apply(n,RL.Global.getAnalyticData("PROSPW"));var c=Ext.jx.getStore("GTAW").getAt(0);for(var q in c.data){n[q]=c.data[q]}n["GTAW#DEPT"]=Ext.jx.getStoreValue("DEPT#DEPTNO");var k=Ext.jx.getStore("BUILD");var f=Ext.jx.Ajax.cleanFieldNamesForPost(n);var m=["#LINK_TO__VENDOR_PRICING","BUILD#DDATE","BUILD#RDATE","BUILD#UNITS","BUILD#CODE","BUILD#CITY","#NO_ADULTS","#NO_CHILDREN","BUILD#PNRCODE","BUILD#STARTTIME","BUILD#ENDTIME","BUILD#TYPE","BUILD#VENID","BUILD#MGTCOID"];var j=1;k.each(function(t){var v={};for(var s=0;s<m.length;s++){var u=m[s];v[u]=t.data[u]}Ext.jx.Ajax.cleanFieldNamesForPost(v,f,"BUILD-"+j);j++},this);var e=Ext.jx.Server.getPrimary();var b=e+"?screen=js::action::update_quote&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO");if(Ext.jx.getQueryString()["resno"]){b+="&resno="+Ext.jx.getQueryString()["resno"];b+="&check="+Ext.jx.getQueryString()["check"]}if(Ext.jx.getQueryString()["debug_mode"]){b+="&debug_output_to_email=1"}new Ext.data.Connection().request({scope:this,timeout:60,url:b,params:{page_action:Ext.urlEncode(f)},method:"POST",success:function(u){Ext.jx.Server.release(e);var t=u.responseObject||Ext.util.JSON.decode(u.responseText);if(!t||typeof t=="string"||!t.GTAW){if(typeof t=="string"){alert("The following server error just occurred. Please call us.\n\n"+t)}else{alert("A server error just happened. Please call us.")}debug();this.finalizing=false;this.fireEvent("after-finalize",this,false);if(h){h.call(r||window)}}else{this.finalizing=false;var z=t.GTAW.dataStorage.ALL.rows[0];var w=t.PROSPW?t.PROSPW.dataStorage.ALL.rows[0]:undefined;var x=t.BUILD?t.BUILD.dataStorage.ALL:undefined;if(z){for(var A in z){c.data[A]=z[A]}}if(w){var s=RL.Global.user;for(var A in w){if(Ext.isEmpty(s.prospwRecord.data[A])){s.prospwRecord.data[A]=w[A]}c.data[A]=w[A]}}var v=k.getCount();this.resno=this.get("GTAW#RESNUM");if(this.resno){this.authToken=this.get("#CHECK");this.isDirty=false;this.finalizing=false;this.fireEvent("after-finalize",this,true);if(p){p.call(r||window)}}else{debug();this.fireEvent("after-finalize",this,false);if(h){h.call(r||window)}}}},failure:function(){Ext.jx.Server.release(e);this.finalizing=false;this.fireEvent("after-finalize",this,false);if(h){h.call(r||window)}}})},updateTSICalcs:function(p){var h=Ext.jx.getStore("GTAW").getAt(0);var m=Ext.jx.getStore("BUILD");var n=0,r=Ext.jx.getStoreValue("CONFIG#AGTCOMM"),b=0,q=0;var c;var e;var j=0;m.each(function(z){var A=Number(z.get("BUILD#UNITS"));var v=z.getPrice();var t=Math.round(A*v);if(!j){j=A}var w=Ext.jx.cleanDate(z.get("BUILD#DDATE"));if(w){var x=Ext.jx.cleanDate(z.get("BUILD#RDATE"));var s=x?x.subtractDt(x):-1;if(s<0){x=w;z.set("BUILD#RDATE",x)}if(!c||w.subtractDt(c)<0){c=w}if(!e||x.subtractDt(e)>0){e=x}}if(c&&e){h.set("GTAW#DDATE",c);h.set("GTAW#RDATE",e)}if(z.get("BUILD#LINECOMM")){var u=r?z.get("BUILD#TAXAMT"):z.get("BUILD#TPRICE");b+=u*z.get("BUILD#COMM")}q+=z.get("BUILD#CGST")+z.get("BUILD#CPST");z.set("BUILD#TPRICE",t);n+=t});h.set("GTAW#GST",q);h.set("GTAW#COMMAMT",b);h.set("GTAW#TOTPRICE",n);if(n){}var k=Number(h.get("GTAW#ADULT"));var f=Number(h.get("GTAW#CHILD")||0);if(!k||isNaN(k)){k=0;if(h.get("GTAW#TOTPRICE")>0&&!f){k=j?j:Number(Ext.jx.getStoreValue("DEPT#TQNOADL"))}h.set("GTAW#ADULT",k)}if(!f||isNaN(f)){f=0;h.set("GTAW#CHILD",f)}h.set("GTAW#PAX",k+f);h.set("GTAW#PPPRICE",Math.round(h.get("GTAW#TOTPRICE")/(h.get("GTAW#ADULT")+h.get("GTAW#CHILD"))));this.fireEvent("change")},addServiceItem:function(s,r,c,h){if(!this.canEdit()){return devThrow("Can't edit quote")}var n=Ext.jx.getStore("BUILD");var e=Ext.apply({},s.data);var t=s.getService();var q=t.data;if(!r){r={}}if(r["BUILD#DDATE"]&&!r["BUILD#RDATE"]){if(isNaN(e["BUILD#NGTS"])){r["BUILD#RDATE"]=r["BUILD#DDATE"]}else{var u;if(e["BUILD#DDATE"]&&e["BUILD#RDATE"]){u=Ext.jx.cleanDate(e["BUILD#RDATE"]).subtractDt(Ext.jx.cleanDate(e["BUILD#DDATE"]))}else{u=Number(e["BUILD#NGTS"]);if(t.isSameDay()){u--}}r["BUILD#RDATE"]=Ext.jx.cleanDate(r["BUILD#DDATE"]).add("d",u)}}if(r){for(var p in r){var m=r[p];if(m){e[p]=m}}}var f=new n.reader.recordType(e);var k=f.data;var j=k["BUILD#UNITS"]=Number(k["BUILD#UNITS"])||1;k["BUILD#DDATE"]=Ext.jx.cleanDate(k["BUILD#DDATE"]);k["BUILD#RDATE"]=Ext.jx.cleanDate(k["BUILD#RDATE"]);k["BUILD#SERVICE"]=j+": "+k["VENDOR#VENDOR"]+" "+(k["#UNIT_DESC"]||"")+"  "+(k["BUILD#CITY"]||"");k["BUILD#TPRICE"]=k["BUILD#UNITS"]*k["BUILD#PRICE"];k["BUILD#DESTSEG"]=c+":"+h;Ext.jx.getStore("GTAW").getAt(0).checkDatesSearch(f.getService(),k["BUILD#DDATE"],k["BUILD#RDATE"]);n.add(f);if(k["MGTCO#CPRODS"]){var b=RL.Global.connectedDestProducts[h]=RL.Global.connectedDestProducts[h]||{};Ext.each(k["MGTCO#CPRODS"].split(","),function(v){b[v]=k["BUILD#MGTCOID"]})}if(k["MGTCO#CPRODGRPS"]){var b=RL.Global.connectedDestProdGroups[h]=RL.Global.connectedDestProdGroups[h]||{};Ext.each(k["MGTCO#CPRODGRPS"].split(","),function(v){b[v]=k["BUILD#MGTCOID"]})}this.isDirty=true;this.updateTSICalcs();return f},getResortRecord:function(c){var b=Ext.jx.getStore("RESORT");return b.getAt(b.find("RESORT#SEARCHCODE",c))},getDestinations:function(){var e=Ext.jx.getStore("RESORT");var b=gtawRecord.getResortRecord();var c={};var f=[];if(b){c[b.getCode()]=b;f.push(b)}Ext.jx.getStore("BUILD").each(function(n){var k=n.get("BUILD#DESTSEG");var j=/(\d+):(.+)/.exec(k);if(j){var m=j[2];if(c[m]){return}var h=c[m]=e.getAt(e.find("RESORT#SEARCHCODE",m));f.push(h)}});return f},getProductsFor:function(h,f,k){if(h instanceof Ext.data.Record){var e=h}else{var e=this.getResortRecord(h);if(!e){return devThrow("Can't find resort for destination code ["+h+"]")}}var b=[];var j=Ext.jx.getTable("PRODGRP").Funcs.getNonEmptyGroups();Ext.each(j,function(m){b.push({productGroup:m,ORDER:m.data["PRODGRP#LINERANGE"]})});var c=e.get_products(true);Ext.each(c,function(m){if(m.data["SERVICE#CODE"]=="IN"&&!f){return}if(m.isGDSAir()&&!k){return}b.push({product:m,ORDER:m.data["SERVICE#LINERANGE"]})},this);return b.sort(function(n,m){return n.ORDER-m.ORDER})}});Ext.ns("RL");RL.PriceResult=Ext.extend(Ext.Panel,{autoWidth:true,autoHeight:true,slots:true,searchForm:null,vendor:null,singleVendor:false,showPaging:false,beforeInitComponent:function(){var b=this.store=this.prepareStore(this.store);var c=this.searchForm;var e=c.recordProduct?c.recordProduct.data["SERVICE#CONHELP"]:c.recordProdGroup?c.recordProdGroup.data["PRODGRP#CONHELP"]:"";Ext.apply(this,{hideBorders:true,border:false,items:[{xtype:"container",html:'<div class="rl-searchresult-title" style="margin: 0 10px 10px 5px"><nobr>'+this.getTitle()+'</nobr></div><div class="rl-searchresult-help" style="margin: 0 10px 10px 5px">'+e+"</div>"},this.getToolbar(),this.getDataViewConfig(),{xtype:"container",slot:"pagingContainer",height:24,layout:"column",hideBorders:true,items:[{columnWidth:0.5,html:"&nbsp;"},{xtype:"ExtX.Toolbar.Paging",slot:"paging",width:Ext.isChrome?210:200,pageSize:999,store:b,paramNames:{start:"from"}},{columnWidth:0.5,html:"&nbsp;"}]}]})},initComponent:function(){this.beforeInitComponent();RL.PriceResult.superclass.initComponent.call(this);var h=this.slots;var j=h.toolbar;var c=j.slots.sortCombo;if(c){c.on("select",this.onSortChange,this);this.onSortChange(c,c.store.getById(this.prepareSortingOptions().initialSort))}else{var e=this.prepareSortingOptions();this.onSortChange(undefined,e.store.getById(e.initialSort))}var b=h.paging;if(b){b.on("show-page",this.onPageChanged,this)}var f=j.slots.filter;if(f){f.on("filter-change",this.onFilterChanged,this)}},prepareStore:function(b){b.pageSize=999;var c=Ext.ux.MultiGroupingStore.prototype;for(var e in c){if(!b.hasOwnProperty(e)&&c.hasOwnProperty(e)){b[e]=c[e]}}return b},getTitle:function(){return this.searchForm.recordProduct.get("SERVICE#DESCRIP")+" "+l("Search Results")},getDataViewConfig:function(){throw"Abstract method `getDataViewConfig` called"},getToolbar:function(){var f=this.prepareSortingOptions();var h=this.searchForm;var e=h.createSearchToolBarItems();e.push("->");var c={xtype:"combo",slot:"sortCombo",fieldLabel:l("Sort by"),width:115,listWidth:130,mode:"local",triggerAction:"all",editable:false,valueField:"id",displayField:"description",store:f.store,value:f.initialSort};var k={xtype:"RL.PriceResult.Filter",slot:"filter",comboConfig:{width:105,listWidth:195},toolbarCls:"x-frameless-toolbar",parentResults:this,initialFilter:{"VENDOR#VENDOR":this.findInitialVendor(this.vendor)},store:this.store};var b={xtype:"RL.FieldTypes.CurrencyPopup",cls:"rl-price-result-currency",listeners:{scope:this,"currency-changed":this.onCurrencyChange}};if(this.store&&this.store.getCount()<=15){c.hidden=true;e.push(c);k.hidden=true;e.push(k);e.push(b)}else{e.push({xtype:"container",items:[{xtype:"container",layout:"form",labelAlign:"top",items:[c]},k,b]})}var j=new Ext.Toolbar({slot:"toolbar",slots:true,toolbarCls:"x-frameless-toolbar",height:145,items:e});h.delegateSearchToolbarTo(j);return j},onCurrencyChange:function(c,b){this.slots.grid.refresh();this.searchForm.quote.fireEvent("change")},cloneStore:function(b){var c=new ExtX.Data.Store.Paged({reader:new Ext.data.DataReader({},b.recordType),groupField:b.groupField});b.each(function(e){c.add([e.copy()])});c.refreshDataSet();c.totalLength=c.getCount();return c},findInitialVendor:function(e){if(!e){return undefined}if(e instanceof Ext.data.Record){return e.data["VENDOR#VENDOR"]}e=e.replace(/ /g,"_");var c=/(...)(...)/.exec(e);if(!c){return undefined}var b=this.store.findBy(function(f){return f.get("VENDOR#VENID")==c[1]&&(f.get("VENDOR#MGTCOID")||"~~NULL~~")==c[2]});if(b==-1){return undefined}return this.store.getAt(b).get("VENDOR#VENDOR")},onFilterChanged:function(){var b=this.slots.paging;var c=this.slots.pagingContainer;if(this.showPaging&&this.store.getTotalCount()>b.pageSize*1.5){c.show()}else{c.hide()}this.doLayout()},prepareSortingOptions:function(){throw"Abstract method `prepareSortingOptions` called"},isMoreThanOneGroupOn:function(f){var b=this.store;var c={};var e=0;b.each(function(h){var j=String(h.get(f));if(!c.hasOwnProperty(j)){c[j]=true;e++;if(e>0){return false}}return undefined},this);return e>0},onPageChanged:function(b,e,c){this.store.setDataPage(e,c);this.doLayout()},onSortChange:function(e,h,j){if(!h){return}var k=this.slots;var n=this.store;var c=k.paging;var f=k.pagingContainer;var m=k.toolbar;var b=m.slots.filter;n.suspendEvents();n.setDataPage(0,n.getTotalCount()-1);n.clearGrouping();if(b){b.reset();Ext.each(h.get("groupBy"),function(p){n.groupBy(p);if(this.isMoreThanOneGroupOn(p)){this.addFilterForField(p)}},this)}n.sort(h.get("sortBy"),h.get("sortDir"));k.toolbar.doLayout();n.refreshDataSet();if(this.showPaging&&n.getTotalCount()>c.pageSize*1.5){n.setDataPage(0,c.pageSize-1);f.show()}else{f.hide()}n.resumeEvents();n.fireEvent("datachanged",n);c.onLoad(n,[],{})},addFilterForField:function(h){var e=this.slots;var f=e.toolbar;var c=f.slots.filter;var b=e.grid.getColumnForDataIndex(h);c.addFilter(h,this.getFilterForField(h,b))},getFilterForField:function(e,c){var b={};if(c){b.description=c.header}return b}});Ext.ns("RL.PriceResult");RL.PriceResult.PricingRowActions=Ext.extend(Ext.ux.RowActions,{resultForm:null,constructor:function(b){b=b||{};Ext.apply(b,{actions:[{iconCls:"add-to-cart",autoWidth:false,width:45,style:{width:"45px"},text:l("add"),tooltip:l("Add the item to your quote"),listeners:{action:function(e,j,c,m,n,f,h,k){e.resultForm.showAddServicePopup(e,j,c,m,n,f,h,k)}}},{iconCls:"more-info",cls:"prodtype_round_button",text:l("More Info"),autoWidth:false,noBlankImg:true,tooltip:l("Find out more information about this vendor"),listeners:{action:function(f,k,e,m,n,h,j){var c=e.getVendor();f.resultForm.showVendorContent(c,"More Info",e)}}},{iconCls:"more-info-pictures",cls:"prodtype_round_button",text:l("Pictures"),autoWidth:false,noBlankImg:true,tooltip:l("Find out more information about this vendor"),listeners:{action:function(f,k,e,m,n,h,j){var c=e.getVendor();f.resultForm.showVendorContent(c,"Pictures",e)}}},{iconCls:"more-info-calendar",cls:"prodtype_round_button",text:l("Avail"),autoWidth:false,noBlankImg:true,tooltip:l("Check inventory data available"),listeners:{action:function(f,k,e,m,n,h,j){var c=e.getVendor();f.resultForm.showVendorContent(c,"Calendar",e)}}},{text:l("Inventory"),iconCls:"more-info-inventory",cls:"prodtype_round_button",autoWidth:false,noBlankImg:true,tooltip:l("Check inventory data available"),listeners:{action:function(f,k,e,m,n,h,j){var c=e.getVendor();f.resultForm.showVendorContent(c,"Inventory",e)}}},{iconCls:"more-info-content",text:l("Content")},{iconCls:"more-info-map",cls:"prodtype_round_button",name:"more-info-map",text:l("Map"),autoWidth:false,noBlankImg:true,tooltip:l("Find out more information about this vendor"),listeners:{action:function(f,k,e,m,n,h,j){var c=e.getVendor();f.resultForm.showVendorContent(c,"Map",e)}}},{iconCls:"more-info-streetview",cls:"prodtype_round_button",name:"more-info-streetview",text:l("Street View"),autoWidth:false,noBlankImg:true,tooltip:l("Find out more information about this vendor"),listeners:{action:function(f,k,e,m,n,h,j){var c=e.getVendor();f.resultForm.showVendorContent(c,"StreetView",e)}}}]});Ext.ux.RowActions.call(this,b)}});Ext.ns("RL.PriceResult");RL.PriceResult.Air=Ext.extend(RL.PriceResult,{slots:true,prepareStore:function(b){b=RL.PriceResult.Air.superclass.prepareStore.call(this,b);b.each(function(c){c.set("#TRIP1_DURATION_PRETTY",this.calculateTripDuration(c,1));c.set("#TRIP2_DURATION_PRETTY",this.calculateTripDuration(c,2))},this);return b},calculateTripDuration:function(c,h){var f=Ext.jx.cleanDate(c.get("#TRIP"+h+"_START_DATE"));if(!f){return 1000000}var e=Date.defaults;Date.defaults={d:f.getDate(),m:f.getMonth(),y:f.getFullYear()};f=Date.parseDate(c.get("#TRIP"+h+"_START_TIME_PRETTY"),"g:i a");if(!f){Date.defaults=e;return 1000000}var b=Date.parseDate(c.get("#TRIP"+h+"_END_TIME_PRETTY"),"g:i a");Date.defaults=e;if(!b){return 1000000}if(b<f){b=b.add(Date.DAY,1)}return b-f},getDataViewConfig:function(){var c=this.searchForm.recordProduct;var b=new Ext.ux.RowActions({actions:[{iconCls:"add-to-cart-orange",autoWidth:false,width:45,style:{width:"45px"},tooltip:l("Add the item to your quote"),listeners:{action:this.addToCart,scope:this}}]});return{xtype:"ExtX.List.GroupedView",slot:"grid",hideHeaders:true,store:this.store,plugins:[b],style:{overflow:"auto"},itemSelector:".gdsAirRecord",tpl:new Ext.XTemplate(Ext.jx.getTable("_VENDOR_PRICING").templates.gdsair),rowsTemplate:new Ext.XTemplate('<tpl for="rows">','{[ values._record.template("gdsair_line") ]}</tpl>'),groupConfigs:{"#AIRLINE_NAME":{headerClass:"x-grid-group-hd-vendor",headerTemplate:'{[ values.typicalRecord.get("#AIRLINE_NAME") ]}'},"#TRIP1_NUM_STOPS":{headerClass:"x-grid-group-hd-vendor",headerTemplate:'{[ values.typicalRecord.get("#TRIP1_NUM_STOPS") + " stop(s)" ]}'}}}},getToolbar:function(){var b=RL.PriceResult.Air.superclass.getToolbar.call(this);b.height=135;return b},addToCart:function(f,j,m,e,n,c,k){var b=Ext.jx.getStore("GTAW").getAt(0);var h=RL.Global.getWizard(this.searchForm).addServiceItem(m);RL.Global.getWizard(this.searchForm).onNextStep()},prepareSortingOptions:function(){var e=this.searchForm.recordProduct;var c=1;var b=new Ext.data.ArrayStore({fields:["id","description","sortBy","sortDir","groupBy","paging"],idIndex:0,data:[[1,"Lowest price",["BUILD#PRICE"],"ASC",[],true],[2,"Shortest time",["#TRIP1_DURATION_PRETTY"],"ASC",[],true],[3,"Departure flight",["#TRIP1_START_FLIGHT_NUM","BUILD#PRICE"],"ASC",[],true],[4,"Return flight",["#TRIP2_START_FLIGHT_NUM","BUILD#PRICE"],"ASC",[],true],[5,"Airline",["BUILD#PRICE"],"ASC",["#AIRLINE_NAME"],true],[6,"Number of stops",["BUILD#PRICE"],"ASC",["#TRIP1_NUM_STOPS"],true]]});return{store:b,initialSort:c}}});Ext.ns("RL.PriceResult");RL.PriceResult.GolfPlanner=Ext.extend(Ext.Panel,{baseCls:"x-bubble",frame:true,layout:"border",hideBorders:true,constructor:function(b){b=b||{};Ext.apply(b,{items:[{region:"north",xtype:"results_top_toolbar",msg:l("Golf Planner")},{region:"center",golf_planner_parent:true,bodyStyle:{"overflow-y":"auto","overflow-x":"hidden"}},{region:"south",autoHeight:true,xtype:"toolbar",items:[{iconCls:"skip-btn",handler:this.onSkipClick,scope:this}]}]});RL.PriceResult.GolfPlanner.superclass.constructor.call(this,b)},onRender:function(){this.printGolfPlanner();RL.PriceResult.GolfPlanner.superclass.onRender.apply(this,arguments)},onSkipClick:function(){RL.Global.getWizard(this).onNextStep()},printGolfPlanner:function(){var j=this.findBy(function(n){return n.golf_planner_parent})[0];var c=this.searchForm.getSearchValues();var k=c["#DDATE"]?c["#DDATE"].dateFormat("m/d/y"):undefined;var f=c["#RDATE"]?c["#RDATE"].dateFormat("m/d/y"):undefined;if(this.ddate_printed!=k||this.rdate_printed!=f){this.ddate_printed=k;this.rdate_printed=f;j.removeRange();if(!k||!f){return}if(j.el){j.el.mask(l("Preparing your screen..."),"x-mask-loading")}var b=[];var m=c["#RDATE"].subtractDt(c["#DDATE"]);for(var e=0;e<=m;e++){var h=c["#DDATE"].add("d",e);b.push({xtype:"golf_day",dateDay:h,recordProduct:this.searchForm.recordProduct,searchForm:this.searchForm,style:{"margin-bottom":"3px"}})}j.add(b);if(j.el){j.el.unmask()}}}});Ext.reg("golfplanner",RL.PriceResult.GolfPlanner);RL.PriceResult.GolfPlanner_Day=Ext.extend(Ext.Panel,{autoHeight:true,constructor:function(k){k=k||{};var f="<b>"+k.dateDay.dateFormat("l, F j, Y")+"</b>";var j=k.recordProduct.getTimesCats();var h=[];var f="<b>"+k.dateDay.dateFormat("l, F j, Y")+"</b>";h.push({frame:true,html:f});for(var c in j){var b=j[c];var e=new Ext.data.ArrayStore({fields:Ext.jx.getStore("TIMES","ALL").fields.items});e.add(b);h.push({xtype:"golf_day_time",recordProduct:k.recordProduct,searchForm:k.searchForm,catName:c,timeStore:e})}k.items=h;RL.PriceResult.GolfPlanner_Day.superclass.constructor.call(this,k)}});Ext.reg("golf_day",RL.PriceResult.GolfPlanner_Day);RL.PriceResult.GolfPlanner_DayTime=Ext.extend(Ext.Panel,{layout:"column",autoHeight:true,onVendorSelect:function(b){var c=this.findBy(function(e){return e.moreInfoImg},this)[0];if(b.getValue()){c.addClass("more-info")}else{c.removeClass("more-info")}},onVendorMoreInfo:function(f){var c=this.findBy(function(j){return j.xtype==="vendor_selector"},this)[0];var b=c.getValue();if(!b){return}var e=Ext.jx.vendors[b];var h=this.findParentBy(function(j){return j.golf_planner_parent});RL.Global.showContent(h,"vendor",e,"Pictures",{vendorRecord:e,searchForm:this.searchForm})},constructor:function(b){b=b||{};var c=b.searchForm;this.recordProduct=c.recordProduct;Ext.apply(b,{items:[{frame:true,width:40,html:b.catName},{xtype:"container_spacer",width:10},{emptyText:l("Golfers"),width:70,xtype:"perperson_selector"},{xtype:"container_spacer",width:10},{xtype:"combo",width:100,mode:"local",emptyText:l("Tee Time"),typeAhead:true,triggerAction:"all",displayField:"TIMES#LABEL",valueField:"TIMES#LABEL",store:b.timeStore},{xtype:"container_spacer",width:10},{width:250,emptyText:l("Golf Course"),xtype:"vendor_selector",listeners:{valid:this.onVendorSelect,scope:this}},{xtype:"container_spacer",width:10},{xtype:"image",moreInfoImg:true,listeners:{click:this.onVendorMoreInfo,scope:this}}]});delete b.timeStore;RL.PriceResult.GolfPlanner_DayTime.superclass.constructor.call(this,b)}});Ext.reg("golf_day_time",RL.PriceResult.GolfPlanner_DayTime);Ext.ns("RL.PriceResult");RL.PriceResult.Service=Ext.extend(RL.PriceResult,{slots:true,lastVendorContent:null,lastAddServicePopup:null,prepareStore:function(b){b=RL.PriceResult.Service.superclass.prepareStore.call(this,b);b.recordType.prototype.fields.get("LOCATION#NAME").sortType=function(c){return c||"~~~~~~~~~"};return b},getDataViewConfig:function(){var c=this.singleVendor;var b=this.getRowActions();return{xtype:"ExtX.List.GroupedView",slot:"grid",hideHeaders:true,store:this.store,columns:this.getDataViewColumns(b),autoHeight:true,autoWidth:true,maxWidth:this.searchForm.getWidth()-40,plugins:[b],groupConfigs:{"VENDOR#VENDOR":{headerClass:"x-grid-group-hd-vendor",headerTemplate:'{[function (){var record=values.typicalRecord;var recordVendor=record.getVendor();return recordVendor ? recordVendor.getShortDesc() : record.get("VENDOR#VENDOR");}()]}'},"#RANDOM_VENDOR":{headerClass:"x-grid-group-hd-vendor",headerTemplate:'{[function (){var record=values.typicalRecord;var recordVendor=record.getVendor();return recordVendor ? recordVendor.getShortDesc() : record.get("VENDOR#VENDOR");}()]}'},"LOCATION#NAME":{headerClass:"x-grid-group-hd-headerless",headerTemplate:'{[function () {var location = values.typicalRecord.get("LOCATION#NAME") || "Other";return "<div class=\\"x-grid-group-title\\">" + location + "</div>";}()]}'}}}},getRowActions:function(){return new RL.PriceResult.PricingRowActions({resultForm:this,alternativeGetTarget:function(b,h,c,f){if(f.getTarget("dt")){return Ext.fly(c).child(".ux-row-action-item",true)}}})},getDataViewColumns:function(b){var e=this.searchForm.recordProduct;if(e.get("SERVICE#UNITLAB")){this.unitLabel=e.get("SERVICE#UNITLAB")}if(e.get("SERVICE#VENDORLAB")){this.vendorLabel=e.get("SERVICE#VENDORLAB")}var c=[Ext.applyIf({widthPx:65,header:l("Add Item")},b.get("add-to-cart")),{header:this.vendorLabel,widthPx:90,dataIndex:"VENDOR#VENDOR",hidden:true},{header:l("Location"),widthPx:70,dataIndex:"LOCATION#NAME",hidden:true},{header:l("Discount"),dataIndex:"#DISCOUNT",hidden:true},{header:this.unitLabel,autoWidth:true,dataIndex:"#UNIT_DESC",renderer:this.unitTypeRenderer,scope:this}];if(this.showPrices()){c.push({header:l("Price in ")+"<b>"+Ext.jx.getStoreValue("GTAW#CADCURR")+"</b>",widthPx:110,dataIndex:"BUILD#PRICE",align:"center",renderer:this.priceRenderer,scope:this})}return c},showPrices:function(){var e=this.searchForm.recordProduct;var b=e.get("SERVICE#CONPRICEOV");var c=Ext.jx.getStoreValue("DEPT#CONPRICES");return b==1||(b!=2&&(c==3||c==2))},initComponent:function(){this.unitLabel=l("Item");this.vendorLabel=l("Vendor");RL.PriceResult.Service.superclass.initComponent.call(this);this.on("deactivate",this.onDeActivate,this);var b=this.slots.grid;b.on("containerclick",this.onListViewClick,this)},onDeActivate:function(){if(this.lastVendorContent){this.lastVendorContent.close();delete this.lastVendorContent}if(this.lastAddServicePopup){this.lastAddServicePopup.hide()}},onListViewClick:function(f,j){var h=j.getTarget(".rl-vendor-image");if(!h){return}var c=h.getAttribute("rl_vendor_id");var b=h.getAttribute("rl_vendor_mgtcoid");var m="VENDOR#VENID="+c+"&VENDOR#MGTCOID="+b;var k=Ext.jx.vendors[m];if(!k){return}if(k.hasContentTabs()){this.showVendorContent(k,"Pictures")}},prepareSortingOptions:function(){var f=this.searchForm.recordProduct;var c,n=f.get("SERVICE#CNSSORT")||"vendor";if(n=="item"){c=2}if(n=="location"){c=4}var h,k,b=(!this.isMoreThanOneGroupOn("VENDOR#PREFERRED"));var j=f.get("SERVICE#CNSSORTVEN")||"VENDOR#PREFERRED";if(j=="VENDOR#PREFERRED"){if(b){j="name";if(!c){c=1}}else{k="VENDOR#VENDOR"}}if(j=="name"){j="VENDOR#VENDOR";if(!c){c=1}}if(j=="random"){j="#RANDOM_VENDOR"}if(j=="tier_random"){h="VENDOR#PREFERRED";j="#RANDOM_VENDOR"}if(j=="discount"){if(!c){c=7}h="#DISCOUNT";j="VENDOR#VENDOR"}if(!c){c=3}var e=f.get("SERVICE#CNSSORTUNT")||"#UNIT_DESC";if(e=="price"){e="BUILD#PRICE"}if(e=="code"){e="BUILD#CODE"}if(e=="discount"){e="#DISCOUNT"}var m=new Ext.data.ArrayStore({fields:["id","description","sortBy","sortDir","groupBy","paging"],idIndex:0,data:[[1,this.vendorLabel,["VENDOR#VENDOR",e],"ASC",["VENDOR#VENDOR"],true],[2,this.unitLabel,["#UNIT_DESC"],"ASC",["VENDOR#VENDOR"],true],[3,"Featured",[h,j,k,e],"ASC",["VENDOR#VENDOR"],true],[4,"Location",["LOCATION#NAME",h,j,k,e],"ASC",["LOCATION#NAME","VENDOR#VENDOR"],true],[5,"Price (high to low)",["BUILD#PRICE"],"DESC",["VENDOR#VENDOR"],true],[6,"Price (low to high)",["BUILD#PRICE"],"ASC",["VENDOR#VENDOR"],true],[7,"Discounts",["#DISCOUNT",h,j,k],"DESC",["VENDOR#VENDOR"],true]]});if(b){m.removeAt(m.indexOfId(3));if(c==3){c=1}}if(!this.isMoreThanOneGroupOn("VENDOR#VENDOR")){m.removeAt(m.indexOfId(1));m.removeAt(m.indexOfId(3));m.removeAt(m.indexOfId(4));if(c==1||c==3||c==4){c=2}}if(!this.isMoreThanOneGroupOn("LOCATION#NAME")){m.removeAt(m.indexOfId(4));if(c==4){c=3}}if(!this.isMoreThanOneGroupOn("#DISCOUNT")){m.removeAt(m.indexOfId(7))}if(!this.showPrices()){m.removeAt(m.indexOfId(5));m.removeAt(m.indexOfId(6))}if(!m.getAt(c)){c=1}return{store:m,initialSort:this.getConnectedMgtCo()?1:c}},getFilterForField:function(e,c){var b=RL.PriceResult.Service.superclass.getFilterForField.call(this,e,c);if(e=="BUILD#TYPE"){Ext.apply(b,{computeDisplayValue:function(f){return f.getService().get("SERVICE#DESCRIP")}})}if(e=="VENDOR#VENDOR"){e="#LINK_TO_VENDOR";Ext.apply(b,{computeDisplayValue:function(f){return f.data["VENDOR#VENDOR"]}})}return b},unitTypeRenderer:function(c,b){return b.data["#DISCOUNT"]==""?c:c+' <div class="unitTypeDiscount">'+b.data["#DISCOUNT"]+"</div>"},priceRenderer:function(f,c){var k=RL.Global.getCurrency();if(!this.priceRules){this.priceRules={"DEPT#CONPRICES":Number(Ext.jx.getStoreValue("DEPT#CONPRICES")),"DEPT#CONPRANGEL":Number(Ext.jx.getStoreValue("DEPT#CONPRANGEL")),"DEPT#CONPRANGEH":Number(Ext.jx.getStoreValue("DEPT#CONPRANGEH")),"DEPT#CONPRANGER":Number(Ext.jx.getStoreValue("DEPT#CONPRANGER"))};var j=this.searchForm.recordProduct?this.searchForm.recordProduct:c.getService();this.priceRules["#B_PRICENIGHTLY"]=j.data["#B_PRICENIGHTLY"]==1||j.isGDSLodging()}if(this.priceRules["#B_PRICENIGHTLY"]&&c.data["BUILD#NGTS"]&&c.data["BUILD#NGTS"]!=0){f=f/c.data["BUILD#NGTS"]}var h;if(this.priceRules["DEPT#CONPRANGER"]!=1){var m=this.priceRules["DEPT#CONPRANGER"]==2?-1:0;h=Math.pow(10,m)}if(this.priceRules["DEPT#CONPRICES"]==2){var b=(1-this.priceRules["DEPT#CONPRANGEL"])*f;if(h){b=Math.round(b*h)/h}b=Ext.jx.math.formatCurrency(b,k);var e=(1+this.priceRules["DEPT#CONPRANGEH"])*f;if(h){e=Math.round(e*h)/h}e=Ext.jx.math.formatCurrency(e,k);f=(b==e?b:String(b)+" to "+String(e))}else{if(this.priceRules["DEPT#CONPRICES"]==3){if(h){f=Math.round(f*h)/h}f=Ext.jx.math.formatCurrency(f,k)}}if(this.priceRules["#B_PRICENIGHTLY"]&&c.data["BUILD#NGTS"]&&c.data["BUILD#NGTS"]!=0){f=String(f)+" night"}return f},showVendorContent:function(e,b,f){Ext.getBody().mask();var c=this.lastVendorContent=new Ext.Window({header:false,width:Math.round(RL.Global.getWindowSize().width*0.8),height:Math.round(RL.Global.getWindowSize().height*0.8),modal:true,draggable:false,resizable:false,layout:"fit",bodyStyle:{"overflow-y":"auto"},items:[{xtype:"vendor_content",pricingRecord:f,vendorRecord:e,searchForm:this.searchForm,active:b,autoHeight:false}],buttonAlign:"center",buttons:[{iconCls:"rl-icon-hide",scale:"large",text:l("Close"),handler:function(){c.close()}}]});c.on("destroy",function(){Ext.getBody().unmask();delete this.lastVendorContent},this);c.show()},showAddServicePopup:function(j,b,k,h,p,e,n,f){if(this.lastAddServicePopup){this.lastAddServicePopup.hide(function(){this.showAddServicePopup(j,b,k,h,p,e,n,f)},this);return}var m=new RL.Build.Popup({pricingRecord:k,searchForm:this.searchForm});var c=new Ext.Window({tbar:new Ext.Toolbar({cls:"x-toolbar-plain",items:[{xtype:"tbtext",autoEl:"span",style:"text-align : justify; font-weight : bold; white-space : normal",height:44,text:"<div><b>"+k.get("VENDOR#VENDOR")+"</b></div><div>"+k.get("#UNIT_DESC")+"</div>"}]}),baseCls:"x-box",frame:true,border:false,closable:false,resizable:false,modal:true,width:510,autoHeight:true,layout:"fit",items:[m]});Ext.apply(m,{buildPopup:c,baseCls:"x-frameless"});c.show(f)},getConnectedMgtCo:function(){var c=RL.Global.getWizard(this.searchForm),e,b;if((e=RL.Global.connectedDestProducts[c.destCode])&&this.searchForm.recordProduct){b=e[this.searchForm.recordProduct.data["SERVICE#CODE"]]}if(!b&&(e=RL.Global.connectedDestProdGroups[c.destCode])&&this.searchForm.recordProdGroup){b=e[this.searchForm.recordProdGroup.data["PRODGRP#PGID"]]}return b}});Ext.ns("RL.PriceResult");RL.PriceResult.Filter=Ext.extend(Ext.Toolbar,{slots:true,store:null,initialFilter:null,filters:null,filtersByField:null,comboConfig:null,initComponent:function(){this.beforeInitComponent();RL.PriceResult.Filter.superclass.initComponent.call(this);this.afterInitComponent()},beforeInitComponent:function(){},afterInitComponent:function(){this.addEvents("filter-change");this.filters=[];this.filtersByField={};this.initItems()},reset:function(){this.removeAll();this.filters=[];this.filtersByField={};this.store.clearFilter()},matchFilter:function(b){var c=true;Ext.each(this.filters,function(e){if(e.value!=null&&b.get(e.field)!=e.value){c=false;return false}},this);return c},addFilter:function(k,e){e=e||{};var m=this.initialFilter;var h={field:k,value:m&&Ext.isDefined(m[k])?m[k]:undefined};Ext.apply(h,e);this.filters.push(h);this.filtersByField[k]=h;var j=new Ext.form.ComboBox(Ext.apply({mode:"local",triggerAction:"all",editable:false,store:new Ext.data.ArrayStore({fields:["id","value"],idIndex:0,data:this.getValuesFor(k)}),displayField:"value",valueField:"id",emptyText:e.description,value:h.value,preFocus:function(){}},this.comboConfig||{}));j.on("select",this.onValueSelected,this);j.filter=h;h.combo=j;var b=this.parentResults.getConnectedMgtCo&&this.parentResults.getConnectedMgtCo();if(b){var f=this.store.find("#LINK_TO_VENDOR",new RegExp("VENDOR#MGTCOID="+b+"$",""));if(f>-1){var c=this.store.getAt(f).get("VENDOR#VENDOR");this.updateFilters(j.filter,c);j.setValue(c)}}this.add({xtype:"container",layout:"form",labelAlign:"top",layoutConfig:{labelSeparator:""},items:[Ext.apply(j,{fieldLabel:this.items.getCount()?"&nbsp;":l("Filter by:")+" "})]});if(h.value){this.updateFilters(h,h.value)}},onValueSelected:function(e,b,c){this.updateFilters(e.filter,b.get("id"))},updateFilters:function(j,m){var n=this.store;var h=n.eventsSuspended;if(!h){n.suspendEvents()}j.value=m;if(m==null){var e=j.combo;e.hasFocus=false;e.clearValue()}var b=this.filters.indexOf(j);for(var f=b+1;f<this.filters.length;f++){var c=this.filters[f];c.value=undefined;c.combo.clearValue();c.combo.store.removeAll()}this.store.clearFilter();if(this.haveFilter()){this.store.filterBy(this.matchFilter,this)}for(var f=b+1;f<this.filters.length;f++){var c=this.filters[f];var e=c.combo;var k=e.store;k.loadData(this.getValuesFor(c.field));if(k.getCount()>2){e.show()}else{e.hide()}}if(!h){n.resumeEvents();n.publishUpdates()}this.fireEvent("filter-change",this,j.field,j.value)},haveFilter:function(){var b=false;this.filters.each(function(c){if(c.value!==undefined){b=true}});return b},getValuesFor:function(f){var e={};var b=[[null,"- All items -"]];var c=this.filtersByField[f];this.store.each(function(h){var k=String(h.get(f));if(e.hasOwnProperty(k)){return}e[k]=true;var j=c.computeDisplayValue?c.computeDisplayValue(h):k;b.push([k,j])});return b}});Ext.reg("RL.PriceResult.Filter",RL.PriceResult.Filter);Ext.ns("RL.PriceResult");RL.PriceResult.ProductGroup=Ext.extend(RL.PriceResult.Service,{productTypes:null,getDataViewColumns:function(b){var c=[Ext.applyIf({widthPx:65,header:l("Add Item")},b.get("add-to-cart")),{header:l("Product Type"),widthPx:50,dataIndex:"BUILD#TYPE",hidden:true},{header:l("Vendor"),widthPx:90,dataIndex:"VENDOR#VENDOR",hidden:true},{header:l("Service"),widthPx:70,dataIndex:"SERVICE#DESCRIP",renderer:this.serviceDescriptionRenderer},{header:"#DISCOUNT",dataIndex:"#DISCOUNT",hidden:true},{header:l("Type"),autoWidth:true,dataIndex:"#UNIT_DESC",renderer:this.unitTypeRenderer,scope:this}];if(this.showPrices()){c.push({header:l("Price in ")+"<b>"+Ext.jx.getStoreValue("GTAW#CADCURR")+"</b>",widthPx:110,dataIndex:"BUILD#PRICE",renderer:this.priceRenderer,scope:this})}return c},showPrices:function(){var b=this.searchForm.recordProdGroup.get("SERVICE#CONPRICEOV");var c=Ext.jx.getStoreValue("DEPT#CONPRICES");return b==1||(b!=2&&(c==3||c==2))},getDataViewConfig:function(){var b=RL.PriceResult.ProductGroup.superclass.getDataViewConfig.call(this);b.groupConfigs["BUILD#TYPE"]={headerClass:"x-grid-group-hd-headerless",headerTemplate:'{[function (){var record=values.typicalRecord;var recordProduct=record.getService();return "<div class=\\"x-grid-group-title\\">" + recordProduct.get("SERVICE#DESCRIP") + "</div>";}()]}'};return b},getTitle:function(){return this.searchForm.recordProdGroup.get("PRODGRP#PGDESC")+" "+l("Search Results")},prepareSortingOptions:function(){var e=0;var c=this.searchForm.recordProdGroup.get("PRODGRP#CNSSORTUNT")||"#UNIT_DESC";if(c=="price"){c="BUILD#PRICE"}if(c=="code"){c="BUILD#CODE"}if(c=="discount"){c="#DISCOUNT"}var b=new Ext.data.ArrayStore({fields:["id","description","sortBy","sortDir","groupBy","paging"],idIndex:0,data:[[0,l("Service"),["SERVICE#LINERANGE","VENDOR#PREFERRED","VENDOR#VENDOR",c],"ASC",["BUILD#TYPE","VENDOR#VENDOR"],true],[1,this.vendorLabel,["VENDOR#VENDOR",c],"ASC",["VENDOR#VENDOR"],true],[2,this.unitLabel,["#UNIT_DESC"],"ASC",["VENDOR#VENDOR"],true],[5,l("Price (high to low)"),["BUILD#PRICE"],"DESC",["VENDOR#VENDOR"],true],[6,l("Price (low to high)"),["BUILD#PRICE"],"ASC",["VENDOR#VENDOR"],true]]});if(!this.showPrices()){b.removeAt(b.indexOfId(5));b.removeAt(b.indexOfId(6))}return{store:b,initialSort:e}},onSortChange:function(h,c,f){var b=this.slots.grid;var e=b.getColumnForDataIndex("SERVICE#DESCRIP");e.hidden=c.id==0;b.reCalculateColumnsWidths();RL.PriceResult.ProductGroup.superclass.onSortChange.apply(this,arguments)},serviceDescriptionRenderer:function(c,b){return b.getService().get("SERVICE#DESCRIP")}});Ext.ns("RL");RL.PriceSearch=Ext.extend(Ext.Panel,{slots:true,waitLoop:200,allowPrefetch:true,lastSearchParams:null,useTripDates:false,isStandAlone:false,isStandAloneData:false,n_dest:null,destCode:null,productCode:null,vendor:null,singleVendor:false,recordProduct:null,quote:null,resultFormClass:null,wizard:null,noSkipButtons:false,autoHeight:true,autoWidth:true,beforeInitComponent:function(){var c=this.recordProduct;var b=c?c.data["SERVICE#CONBLANK"]:this.recordProdGroup.data["PRODGRP#CONBLANK"];Ext.apply(this,{items:[{region:"center",slot:"tabCenter",tbar:{toolbarCls:"x-frameless-toolbar",slots:true,items:this.createSlimSearchToolBarItems()},baseCls:"x-frameless",hideBorders:true,items:[{xtype:"container",slot:"content",items:[{xtype:"RL.Destination.ProductGroup.Loader",blankHtml:b,destinationRecord:Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(this.destCode),productRecord:this.recordProduct,productGroupRecord:this.recordProdGroup,vendor:this.vendor}]}]}]});this.addEvents("after-service-add");this.enableBubble("after-service-add")},initComponent:function(){this.beforeInitComponent();RL.PriceSearch.superclass.initComponent.call(this);if(!this.isStandAloneData){if(this.isStandAlone){this.on("afterlayout",this.onActivate,this,{single:true})}else{this.on("activate",this.onActivate,this,{single:true})}}this.on("deactivate",this.onDeActivate,this)},createSlimSearchToolBarItems:function(){if(!RL.Global.allowQuoteWizard()){return{hidden:true}}var c=this.recordProduct;var b=Ext.jx.getRecord({tableName:"DEPT"});var e=[];if(this.showStartDate()){e.push(this.getStartDateLabel());e.push({xtype:"RL.FieldTypes.DateRangeStart.Combo.WithDatePicker",slot:"startdate",range:b.getQuotingRange(),endFieldSiblingSlot:"enddate"});e.push({xtype:"tbspacer",width:5})}if(this.showEndDate()){e.push(this.getEndDateLabel());e.push({xtype:"RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker",slot:"enddate",minNights:0,maxNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMAX"))||20,range:b.getQuotingRange()});e.push({xtype:"tbspacer",width:5})}e=e.concat(this.getSearchButtons());return e},createSearchToolBarItems:function(){if(!RL.Global.allowQuoteWizard()){return{hidden:true}}var e=Ext.jx.getRecord({tableName:"DEPT"});var c=this.getSearchValues();var f=[];if(this.showStartDate()){f.push({xtype:"panel",border:false,title:this.getStartDateLabel(),headerCssClass:"rl-blue-on-white",width:210,items:[{xtype:"RL.FieldTypes.DateRangeStart.Combo.WithDatePicker",slot:"startdate",range:e.getQuotingRange(),endFieldSiblingSlot:"enddate",value:c["#DDATE"]}]})}if(this.showEndDate()){f.push({xtype:"panel",title:this.getEndDateLabel(),headerCssClass:"rl-blue-on-white",border:false,width:210,items:[{xtype:"RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker",slot:"enddate",test1:"test1",minNights:0,maxNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMAX"))||20,range:e.getQuotingRange(),value:c["#RDATE"]}]})}var b;if(this.showStartDate()){b+=220}if(this.showEndDate()){b+=220}return[{xtype:"panel",border:false,plain:true,style:"margin-left : 10px",items:[{xtype:"container",width:b,items:f},{xtype:"toolbar",toolbarCls:"x-frameless-toolbar",items:this.getSearchButtons()}]}]},showStartDate:function(){return this.recordProduct?this.recordProduct.showStartDateOnSearch():true},showEndDate:function(){return this.recordProduct?this.recordProduct.showEndDateOnSearch():true},showSearchButton:function(){return this.showStartDate()||this.showEndDate()},showSkipButton:function(){var b=this.recordProduct;return !this.showSearchButton()||(!this.noSkipButtons&&b&&b.allowSkip())},getStartDateLabel:function(){return this.recordProduct.get("SERVICE#DSTARTLAB")||l("Start Date")},getEndDateLabel:function(){return this.recordProduct.get("SERVICE#DENDLAB")||l("End Date")},getSearchButtons:function(){var b=[];if(this.showSearchButton()){b.push({xtype:"button",slot:"searchButton",text:l("search"),iconCls:"search-btn",scale:"medium",iconAlign:"left",handler:this.onSearch,scope:this})}if(this.showSkipButton()){b.push({xtype:"button",slot:"skipButton",style:"margin-left : 30px",text:l("next"),iconCls:"skip-btn",scale:"medium",iconAlign:"left",handler:this.onSkipClick,scope:this})}return b},delegateSearchToolbarTo:function(b){this.slots.tabCenter.getTopToolbar().hide();this.delegatedSearchToolbar=b;if(!b.slots){alert("bugger!")}},getBubbleTarget:function(){return this.wizard},onActivate:function(){this.updateFields();this.priceIt()},onDeActivate:function(){if(this.slots.priceResult){this.slots.priceResult.fireEvent("deactivate")}},getSearchValues:function(){var e;if(this.isStandAlone||this.isStandAloneData){e={dest:this.destCode}}else{e=this.useTripDates?RL.Global.getTripStartValues():RL.Global.getSegmentStartValues(this)}var c=this.getValues();var f=this.getSearchToolbar().slots.startdate;var b=this.getSearchToolbar().slots.enddate;if(f&&(f.hasManuallyChanged||!e.startdate)){c["#DDATE"]=f.getValue();if(b){c["#RDATE"]=b.getValue()}}if(!c["#DDATE"]&&e.startdate){var h=this.recordProduct?Number(this.recordProduct.get("SERVICE#DDATEPLUS")):(this.recordProdGroup?Number(this.recordProdGroup.get("PRODGRP#DDATEPLUS")):0);if(isNaN(h)){h=0}if(h<0){c["#DDATE"]=e.enddate.add("d",h+1)}else{c["#DDATE"]=e.startdate.add("d",h)}}if(!c["#RDATE"]&&e.enddate){var j=this.recordProduct?Number(this.recordProduct.get("SERVICE#RDATEMINUS")):(this.recordProdGroup?Number(this.recordProdGroup.get("PRODGRP#RDATEMINUS")):0);if(isNaN(j)){j=0}if(j<0){c["#RDATE"]=e.startdate.add("d",j+1)}else{c["#RDATE"]=e.enddate.add("d",-1*j)}}c["VENDOR#REGION"]=e.dest;if(this.recordProduct){c["VENDOR#VENTYPE"]=this.recordProduct.data["SERVICE#CODE"];if(this.recordProduct.isGDSAir()){if(!c["#FROM_AIRPORT"]&&e.fromAirport){c["#FROM_AIRPORT"]=e.fromAirport}if(!c["#TO_AIRPORT"]&&e.toAirport){c["#TO_AIRPORT"]=e.toAirport}if(!c["#NUM_SEATS"]&&(e.adults||e.children)){c["#NUM_SEATS"]=e.adults+e.children}}}else{if(this.recordProdGroup){c["#VENTYPES"]="";this.recordProdGroup.get_products().each(function(k){if(c["#VENTYPES"]!=""){c["#VENTYPES"]+=","}c["#VENTYPES"]+=k.data["SERVICE#CODE"]})}}return c},getSearchToolbar:function(){return this.delegatedSearchToolbar||this.slots.tabCenter.getTopToolbar()},updateFields:function(e){if(!e){e=this.getSearchValues()}this.setValuesIf(e);var j=this.getSearchToolbar();if(j){var f=j.slots.startdate;if(f&&!f.hasManuallyChanged&&e["#DDATE"]){f.setValue(e["#DDATE"])}var b=j.slots.enddate;if(b&&!b.hasManuallyChanged&&e["#RDATE"]){b.setValue(e["#RDATE"])}var k=j.slots.from_airport;if(k&&!k.hasManuallyChanged&&e["#FROM_AIRPORT"]){k.setValue(e["#FROM_AIRPORT"])}var h=j.slots.to_airport;if(h&&!h.hasManuallyChanged&&e["#TO_AIRPORT"]){h.setValue(e["#TO_AIRPORT"])}var c=j.slots.num_seats;if(c&&!c.hasManuallyChanged&&e["#NUM_SEATS"]){c.setValue(e["#NUM_SEATS"])}}},onChangeField:function(b){throw"Method being removed"},onSkipClick:function(){this.fireEvent("after-service-add",this)},onSearch:function(){this.priceIt()},getErrorIndicator:function(b){var e=[];if(this.showSkipButton()&&this.getSearchToolbar().slots.skipButton){this.getSearchToolbar().slots.skipButton.hide();e.push({text:"<b>"+l("skip")+"</b>",handler:function(){this.onSkipClick()},scope:this})}var c=new Ext.Panel({autoHeight:true,border:false,baseCls:"x-frameless",cls:"rl-priceresult-loading-indicator",html:b,buttons:e,buttonAlign:"center"});return c},showIndicator:function(b,c){b.slot="indicator";this.slots.tabCenter.insert(0,b);if(c){this.doLayout()}},hideIndicator:function(c){var b=this.slots.indicator;if(b){this.slots.tabCenter.remove(b)}if(c){this.doLayout()}},priceIt:function(b){this.hideIndicator();this.showIndicator({xtype:"RL.PriceSearch.LoadingIndicator",autoHeight:true,border:false,text:l("Please wait - loading search results..."),cls:"rl-priceresult-loading-indicator"},true);this.getSearchToolbar().hide();this.storePriceIt(b,function(e){if(this.isDestroyed){return}this.hideIndicator();this.getSearchToolbar().show();if(!e.getCount()){this.showIndicator(this.getErrorIndicator("Could not find any items that match your criteria."),true);return}var f=this.slots.content;var c=this.getSearchToolbar().getValues();f.removeRange();f.add(new this.resultFormClass({searchForm:this,slot:"priceResult",singleVendor:this.singleVendor,vendor:this.vendor,store:e}));this.updateFields.defer(100,this,[c]);this.doLayout()},function(c){if(this.isDestroyed){return}this.hideIndicator();this.getSearchToolbar().show();if(!c){c="There was an unknown server problem."}c+=" Please try again.";this.showIndicator(this.getErrorIndicator(c),true)})},storePriceIt:function(prefetchOnly,callback,errback,scope){if(prefetchOnly&&!this.allowPrefetch){return}var record=this.recordProdGroup||this.recordProduct;var gtawRecord=Ext.jx.getStore("GTAW").getAt(0);if(!Ext.jx.vendors){Ext.jx.vendors={}}var values=this.getSearchValues();if(this.recordProduct){if(this.recordProduct.get("#B_DONT_SHOW_DATES_ON_SEARCH")!=1&&!values["#DDATE"]){if(errback){errback.call(scope||this,"Missing Required Fields. ")}return}if(this.recordProduct.isGDSAir()&&(!values["#FROM_AIRPORT"]||!values["#TO_AIRPORT"]||!values["#NUM_SEATS"])){if(errback){errback.call(scope||this,"Missing Required Fields. ")}return}}else{if(this.recordProdGroup){if(this.recordProdGroup.get("#B_DONT_SHOW_DATES_ON_SEARCH")!=1&&!values["#DDATE"]){if(errback){errback.call(scope||this,"Missing Required Fields. ")}return}}else{if(!values["#DDATE"]){if(errback){errback.call(scope||this,"Missing Required Fields. ")}return}}}var ven=Ext.jx.getVar_QS_Frag("vendor","vendor_0");if(ven){var prod=Ext.jx.getVar_QS_Frag("producttype");if(this.recordProduct&&this.recordProduct.data["SERVICE#CODE"]==prod){var dest=Ext.jx.getVar_QS_Frag("dest");if(dest==values["VENDOR#REGION"]){var s_venid=ven.substr(0,3);var s_mgtcoid=ven.substr(3,3)||"~~NULL~~";values["VENDOR#VENID"]=s_venid;values["VENDOR#MGTCOID"]=s_mgtcoid}}}if(!prefetchOnly){gtawRecord.checkDatesSearch(record,values["#DDATE"],values["#RDATE"],values["VENDOR#REGION"])}var params=Ext.jx.Ajax.cleanFieldNamesForPost(values);var user=RL.Global.user;if(user.prospwRecord.data["PROSPW#EMAIL"]){params.consumer_email=user.prospwRecord.data["PROSPW#EMAIL"]}if(user.authenticated){params.check2=user.prospwRecord.data["#CHECK2"]}var actionParams="&"+Ext.jx.Ajax.urlEncode({screen:"js::ext_data_store::_VENDOR_PRICING",page_action:params,noiqpcache:1});if(this.lastSearchParams==actionParams){return}if(!prefetchOnly&&values["VENDOR#REGION"]){var producttype;if(this.recordProduct){producttype=this.recordProduct.data["SERVICE#CODE"]}else{if(this.recordProdGroup){var products=this.recordProdGroup.get_products();if(products.getCount()){producttype=products.get(0).data["SERVICE#CODE"]}}}if(producttype){var eventName=RL.Global.getVendorDlEventName(values["VENDOR#REGION"],producttype);if(!RL.Global.downloadedVendorLists[eventName]){RL.Global.Events.on(eventName,function(){this.storePriceIt(prefetchOnly,callback,errback,scope)},this,{defer:100,single:true});return}}}if(RL.Global.downloadedPricingStores[actionParams]){if(callback){callback.call(scope||this,RL.Global.downloadedPricingStores[actionParams])}return}var server=Ext.jx.Server.get();if(Ext.jx.getQueryString()["debug_mode"]){actionParams+="&debug_output_to_email=1"}new Ext.data.Connection().request({timeout:90,url:server+"?"+actionParams+"&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO"),method:"GET",success:function(responseObject){Ext.jx.Server.release(server);var isError=false,tempVar,response;try{response=responseObject.responseObject||eval("tempVar="+responseObject.responseText)}catch(e){isError=true}if(isError||!response){RL.Global.downloadedPricingStores[actionParams]=null;delete this.lastSearchParams;if(errback){errback.call(scope||this,"ERROR: Invalid data returned from Server. ")}}else{var dataRemote=Ext.jx.getTable("_VENDOR_PRICING").setData(actionParams,response);var store=dataRemote.getStore(undefined,undefined,ExtX.Data.Store.Paged);RL.Global.downloadedPricingStores[actionParams]=store;var priceField=store.fields.map["BUILD#PRICE"];if(priceField){priceField.sortType=Ext.data.SortTypes.asInt}if(callback){callback.call(scope||this,store)}}},failure:function(){Ext.jx.Server.release(server);RL.Global.downloadedPricingStores[actionParams]=null;delete this.lastSearchParams;if(errback){errback.call(scope||this,"ERROR: Servers Timed Out. ")}},scope:this})},canSuggestMoreItems:function(){return this.recordProduct.isPerPerson()&&!this.recordProduct.isGDSAir()&&this.recordProduct.get("SERVICE#CONAGEDEF")!=2},getServiceItemDescription:function(){return this.recordProduct.get("SERVICE#DESCRIP")}});Ext.ns("RL.PriceSearch");RL.PriceSearch.Air=Ext.extend(RL.PriceSearch,{allowPrefetch:false,beforeInitComponent:function(){this.resultFormClass=this.resultFormClass||RL.PriceResult.Air;RL.PriceSearch.Air.superclass.beforeInitComponent.call(this)},createSlimSearchToolBarItems:function(e,b,c){return this.createSearchToolBarItems.apply(this,arguments)},createSearchToolBarItems:function(f,b,c){var j=this.recordProduct;var h=Ext.jx.getRecord({tableName:"DEPT"});var e=f||b;if(!e){c=false}return[{xtype:"panel",border:false,plain:true,style:"margin-left : 10px",items:[{xtype:"container",layout:"column",items:[{xtype:"container",layout:"form",labelAlign:"top",width:110,items:[{xtype:"panel",height:50,border:false,title:j.get("SERVICE#AIRDEPLAB")||l("Leaving from"),headerCssClass:"rl-blue-on-white",items:[{xtype:"airport",allowBlank:false,name:"#FROM_AIRPORT",slot:"from_airport",emptyText:l("Outgoing airport"),width:100}]},{xtype:"panel",height:50,border:false,title:j.get("SERVICE#AIRRETLAB")||l("Going to"),headerCssClass:"rl-blue-on-white",items:[{xtype:"airport",allowBlank:false,name:"#TO_AIRPORT",slot:"to_airport",emptyText:l("Destination airport"),width:100}]}]},{xtype:"container",width:15,html:"&nbsp;"},{xtype:"container",width:210,items:[{xtype:"panel",height:50,border:false,title:this.getStartDateLabel(),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeStart.Combo.WithDatePicker",slot:"startdate",range:h.getQuotingRange(),endFieldSiblingSlot:"enddate"}]},{xtype:"panel",height:50,border:false,title:this.getEndDateLabel(),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker",slot:"enddate",minNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMIN"))||0,maxNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMAX"))||20,range:h.getQuotingRange()}]}]},{xtype:"panel",width:135,bodyStyle:"height : 50px",border:false,title:j.get("SERVICE#QTYLAB")||"No. Seats",headerCssClass:"rl-blue-on-white",layout:"form",items:[{xtype:"perperson_selector",name:"#NUM_SEATS",slot:"num_seats",hideLabel:true,width:55,allowBlank:false}]}]},{xtype:"toolbar",toolbarCls:"x-frameless-toolbar",items:this.getSearchButtons(e,c)}]}]}});Ext.ns("RL.PriceSearch");RL.PriceSearch.Service=Ext.extend(RL.PriceSearch,{recordProduct:null,beforeInitComponent:function(){this.resultFormClass=this.resultFormClass||RL.PriceResult.Service;RL.PriceSearch.Service.superclass.beforeInitComponent.call(this)},priceIt:function(e){if(RL.Global.productSupports(this.recordProduct,"golf")){var b=this.getSearchValues();if(!b["#DDATE"]||!b["#RDATE"]){return}if(!this.golfPlanner){this.golfPlanner=new RL.PriceResult.GolfPlanner({searchForm:this,ownerCt:this});var c=this.slots.tabCenter;c.add(this.golfPlanner);if(c.el){c.doLayout()}}else{this.golfPlanner.printGolfPlanner()}}else{RL.PriceSearch.Service.superclass.priceIt.call(this,e)}}});Ext.reg("RL.PriceSearch.Service",RL.PriceSearch.Service);Ext.ns("RL.PriceSearch");RL.PriceSearch.ProductGroup=Ext.extend(RL.PriceSearch,{recordProdGroup:null,beforeInitComponent:function(){this.resultFormClass=this.resultFormClass||RL.PriceResult.ProductGroup;RL.PriceSearch.ProductGroup.superclass.beforeInitComponent.call(this)},showEndDate:function(){return !this.recordProdGroup.autoCalcEndDate()},showSkipButton:function(){return !this.noSkipButtons},getStartDateLabel:function(){return l("Start Date")},getEndDateLabel:function(){return l("End Date")},canSuggestMoreItems:function(){return !this.recordProdGroup.get("PRODGRP#EXCLUSIVE")},getServiceItemDescription:function(){return this.recordProdGroup.get("PRODGRP#PGDESC")}});Ext.reg("RL.PriceSearch.ProductGroup",RL.PriceSearch.ProductGroup);Ext.ns("RL.PriceSearch");RL.PriceSearch.LoadingIndicator=Ext.extend(Ext.Container,{slots:true,text:null,stopHighlighting:false,beforeInitComponent:function(){Ext.apply(this,{html:this.text})},initComponent:function(){this.beforeInitComponent();RL.PriceSearch.LoadingIndicator.superclass.initComponent.call(this);this.on("afterlayout",this.highlightNote,this,{single:true})},highlightNote:function(){this.el.highlight("0000ff",{duration:3,endColor:"000000",attr:"color",callback:function(){if(this.stopHighlighting){this.stopHighlighting=false;return}this.highlightNote()},scope:this})},stop:function(){this.stopHighlighting=true},destroy:function(){this.stopHighlighting=true;RL.PriceSearch.LoadingIndicator.superclass.destroy.call(this)}});Ext.reg("RL.PriceSearch.LoadingIndicator",RL.PriceSearch.LoadingIndicator);Ext.ns("RL");RL.Quote=Ext.extend(Ext.Container,{slots:true,quoteMode:null,triptype:null,spinner:null,initialDestCode:null,initialStep:null,startdate:null,enddate:null,producttype:null,vendor:null,quote:null,autoHeight:true,autoWidth:true,constructor:function(e){this.quoteMode=e.quoteMode||RL.Global.getQuoteMode();this.triptype=e.triptype||RL.Global.getTripType();RL.Global.triptype=this.triptype;e=e||{};var b=(Ext.isIE6||Ext.isIE7)?{display:"none"}:undefined;var c=e.quote=e.quote||new RL.Model.Quote();Ext.apply(e,{layout:"table",layoutConfig:{columns:2,tableAttrs:{style:{width:"100%"}}},baseCls:"x-frameless",hideBorders:true,items:[RL.Defaults.NO_SUMMARIES?{region:"north",xtype:"RL.Quote.Summary.Long.Header.InsteadOfSummaries",colspan:2,autoHeight:true,autoWidth:true,quote:e.quote}:{xtype:"container",colspan:2,region:"north",slot:"northDestBanner",autoHeight:true,autoWidth:true,hidden:true},RL.Defaults.NO_SUMMARIES?{region:"west",hidden:true}:{vAlign:"top",cellWidth:230,cellCls:"x-panel-alt-color",region:"west",xtype:"rl-quote-summary",slot:"summary",triptype:this.triptype,quote:c,autoHeight:true,width:230},{xtype:"quote_wizard",vAlign:"top",region:"center",slot:"wizard",autoHeight:true,triptype:this.triptype,quoteMode:this.quoteMode,producttype:e.producttype,initialStep:e.initialStep,vendor:e.vendor,quote:c}]});RL.Quote.superclass.constructor.call(this,e)},initComponent:function(){RL.Quote.superclass.initComponent.apply(this,arguments);this.on("afterlayout",this.onAfterLayout,this,{single:true});this.on("triptype-changed",this.switchType,this);this.on("quote-changed",this.onQuoteChanged,this,{delay:100});this.on("quote-book",this.onBookQuote,this);this.on("quote-save",this.onSaveQuote,this);this.on("quote-finalize",this.onFinalizeQuote,this);this.on("quote-startover",this.onStartQuoteOver,this);this.on("wizard-leave",this.onWizardLeave,this);this.on("wizard-enter",this.onWizardEnter,this)},destroy:function(){RL.Quote.superclass.destroy.apply(this,arguments)},configure:function(b){Ext.apply(this,b);if(b.startdate){Ext.jx.setStoreValue("GTAW#DDATE",Ext.jx.cleanDate(b.startdate))}if(b.enddate){Ext.jx.setStoreValue("GTAW#RDATE",Ext.jx.cleanDate(b.enddate))}if(b.adults){Ext.jx.setStoreValue("GTAW#ADULT",b.adults)}if(b.children){Ext.jx.setStoreValue("GTAW#CHILD",b.children)}this.slots.wizard.configure(b)},onWizardLeave:function(b){this.slots.summary.collapseDestinationSegment(b.n_dest,b.destCode)},onWizardEnter:function(b){this.slots.summary.expandDestinationSegment(b.n_dest,b.destCode)},onBookQuote:function(){this.quote.on("before-finalize",function(){Ext.jx.mask(Ext.getBody(),l("Finalizing your quote..."),"rl-mask-medium",true)},this,{single:true});this.quote.finalize(function(){this.quote.book()},function(){Ext.jx.unmask(Ext.getBody());RL.Global.showQuoteWizard();Ext.MessageBox.show({icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK,title:l("Saving Error"),msg:l("There was an unknown error while booking your quote. Please try again.")})},this)},onSaveQuote:function(){if(RL.Global.user.authenticated||RL.Global.user.prospwRecord.data["PROSPW#EMAIL"]){this.finalizeQuoteReady("Please wait, now saving your Quote ...")}else{var b=new RL.Cust.Identity({cantSkip:true});b.on("customer-ready",this.finalizeQuoteReady.createDelegate(this,["Please wait, now saving your Quote ..."]),this);b.on("customer-logged-in",this.finalizeQuoteReady.createDelegate(this,["Please wait, now saving your Quote ..."]),this);b.show()}},onFinalizeQuote:function(){var b=this.quote.getQuoteProblems();if(b){Ext.MessageBox.show({icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK,title:l("Error"),msg:l("Can not finalize quote because of the following reason(s):")+" <br>"+b})}else{this.finalizeQuote()}},backToQuote:function(){RL.Global.showQuoteWizard()},onStartQuoteOver:function(){Ext.MessageBox.confirm(l("Confirm"),l("Are you sure that you want to start over again?"),function(b){if(b=="yes"){if(this.spinner){this.spinner.close()}RL.Global.startQuoteOver()}},this)},switchType:function(b){this.triptype=b;this.slots.summary.switchType(b)},onAfterLayout:function(){this.onQuoteChanged()},onQuoteChanged:function(){this.quote.updateTSICalcs()},finalizeQuote:function(){if(Ext.jx.getStoreValue("DEPT#CONANON")==1||RL.Global.user.authenticated||RL.Global.user.prospwRecord.data["PROSPW#EMAIL"]){this.finalizeQuoteReady()}else{var b=new RL.Cust.Identity();b.on("customer-ready",this.finalizeQuoteReady,this);b.on("customer-logged-in",this.finalizeQuoteReady,this);b.show()}},finalizeQuoteReady:function(b,c){this.quote.on("before-finalize",function(){Ext.jx.mask(Ext.getBody(),l("Finalizing your quote..."),"rl-mask-medium",true)},this,{single:true});this.quote.finalize(c||function(){this.quote.openQuote()},function(){Ext.jx.unmask(Ext.getBody());RL.Global.showQuoteWizard();Ext.MessageBox.show({icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK,title:l("Saving Error"),msg:l("There was an unknown error while finalizing your quote. Please try again.")})},this)}});Ext.reg("RL.Quote",RL.Quote);Ext.ns("RL.Quote");RL.Quote.Content=Ext.extend(Ext.Container,{slots:true,quote:null,finalizationNote:"Please wait now finalizing your quote...",beforeInitComponent:function(){Ext.apply(this,{layout:"fit",items:[{xtype:"RL.Quote.Summary.Long",finalizationNote:this.finalizationNote,quote:this.quote,triptype:RL.Global.getTripType()}]})},initComponent:function(){this.beforeInitComponent();RL.Quote.Content.superclass.initComponent.apply(this,arguments)}});Ext.reg("RL.Quote.Content",RL.Quote.Content);Ext.ns("RL.Quote.Finalize");RL.Quote.Finalize.Spinner=Ext.extend(Ext.Window,{initComponent:function(){Ext.apply(this,{width:700,height:450,closable:false,modal:true,html:['<table class="finalize_quote_container" width=100% height=100%><tr valign=center><td align=center>',"<div class=finalize_quote_img></div>","<div class=finalize_quote_content>Please wait while we are preparing your quote . . . </div>","</td></tr></table>"].join("")});RL.Quote.Finalize.Spinner.superclass.initComponent.call(this)}});Ext.reg("RL.Quote.Finalize.Spinner",RL.Quote.Finalize.Spinner);Ext.ns("RL.Quote");RL.Quote.Starter=Ext.extend(Ext.Panel,{slots:true,hideBorders:true,baseCls:"x-bubble",frame:true,bodyStyle:{"overflow-y":"auto","overflow-x":"hidden"},initialDestCode:null,showStartMessage:true,chooseResortListAlign:"tl-bl?",hideStartButton:false,beforeInitComponent:function(){Ext.apply(this,{items:[{layout:"column",items:[{xtype:"container",width:300,items:[{xtype:"fieldset",labelWidth:75,autoHeight:true,style:{border:0,padding:"10px"},hideBorders:true,items:(RL.Global.getDefaultDestCode()||this.initialDestCode?[]:[{xtype:"form",autoWidth:true,layout:"column",baseCls:"x-frameless",labelAlign:"top",fieldLabel:l("Destination"),items:[{xtype:"choose_resort_intell",listAlign:this.chooseResortListAlign,slot:"resortCombo",allowBlank:false,name:"GTAW#RESORT"}]}]).concat([Number(Ext.jx.getStoreValue("DEPT#CONUSEAIR"))==0?{hidden:true}:{xtype:"air_question"},Ext.jx.getStoreValue("DEPT#CONNODATES")==1?{hidden:true}:{xtype:"daterange",labelWidth:75,startDateFieldName:"GTAW#DDATE",startDateValue:Ext.jx.getStoreValue("DEPT#TQFIXDATE")?Ext.jx.getStoreValue("DEPT#TQFIXDATE"):"",endDateFieldName:"GTAW#RDATE",startDateField:{slot:"startdate"},endDateField:{slot:"enddate"}},{xtype:"perperson_selector",slot:"adults",name:"GTAW#ADULT",fieldLabel:Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?l("No. Passengers"):l("No. Adults"),allowBlank:false,value:Ext.jx.getStoreValue("DEPT#TQNOADL")},Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?{hidden:true}:{xtype:"perperson_selector",slot:"children",name:"GTAW#CHILD",fieldLabel:l("No. Children"),allowBlank:true},!RL.Defaults.DEV_MODE||Ext.jx.getStoreValue("DEPT#CONHIDECUR")==1?{hidden:true}:{xtype:"RL.FieldTypes.CurrencyPopup",slot:"currency",name:"GTAW#CADCURR",hideLabel:true,allowBlank:true}])},{xtype:"buttongroup",slot:"toolbar",columns:2,autoWidth:true,autoHeight:true,baseCls:"x-frameless",hidden:this.hideStartButton,items:[{xtype:"button",text:l("Next Step"),scale:"large",iconAlign:"left",iconCls:"new-quote-btn",handler:this.onNewQuote,scope:this,style:{margin:"0 0 0 90px"}}]}]},{xtype:"container",hidden:!this.showStartMessage,html:Ext.jx.getStoreValue("DEPT#CONSTART"),columnWidth:1}]}]});this.addEvents("quote-changed","destination-changed");this.enableBubble("quote-changed","destination-changed")},initComponent:function(){if(RL.Global.allowQuoteWizard()){this.beforeInitComponent()}else{this.hidden=true}RL.Quote.Wizard.Start.Single.superclass.initComponent.call(this)},getDestCode:function(){var b=(this.slots.resortCombo&&this.slots.resortCombo.getValue())||RL.Global.getDefaultDestCode();return b},onNewQuote:function(){if(!this.validate()){return}var c={};Ext.each(["startdate","enddate","adults","children","currency"],function(e){if(this.slots[e]){c[e]=this.slots[e].getValue()}},this);if(c.startdate&&c.enddate){c.startdate=c.startdate.format("m/d/Y");c.enddate=c.enddate.format("m/d/Y")}else{var b=RL.Global.getDefaultDates();c.startdate=b.startDate;c.enddate=b.endDate}c.screen="scnWizardSteps";c.step=RL.Global.displayStartStep()?2:1;c.dest=this.initialDestCode||this.getDestCode();c.triptype=RL.Global.getQuoteMode()=="both"?"multi":RL.Global.getQuoteMode();RL.Global.dispatch(c,{addHistory:1})}});Ext.reg("RL.Quote.Starter",RL.Quote.Starter);Ext.ns("RL.Quote");RL.Quote.Summary=Ext.extend(Ext.Container,{slots:true,triptype:null,quote:null,autoHeight:true,autoWidth:true,constructor:function(b){b=b||{};if(Ext.isIE6||Ext.isIE7){this.style="min-height:700px; height:700px;"}else{this.style="min-height:700px"}Ext.apply(b,{items:[{xtype:"component",cls:"rl-white-on-blue",autoEl:"div",html:l("Trip Options")},{xtype:"container",autoHeight:true,autoWidth:true,style:{padding:"20px 20px 50px 20px"},items:[{xtype:"button",slot:"bookButton",iconCls:"rl-icon-summaries-bookit",text:l("Book it!"),hidden:Ext.jx.getStoreValue("DEPT#WEBBKMO")==1,scale:"large",iconAlign:"left",width:190,handler:this.onBookQuote,scope:this},{xtype:"container",height:5},{xtype:"button",slot:"saveButton",iconCls:"rl-icon-summaries-save",text:l("Save"),scale:"large",iconAlign:"left",width:190,handler:this.onSaveQuote,scope:this},{xtype:"container",height:5},{xtype:"RL.Quote.Summary.Error",slot:"error",style:"padding-bottom : 5px",quote:b.quote},{xtype:"button",slot:"startOverButton",iconCls:"rl-icon-summaries-startover",text:l("Start Over"),scale:"small",iconAlign:"left",width:190,hidden:!b.quote.haveItems(),handler:this.onStartQuoteOver,scope:this}]},{xtype:"RL.Quote.Summary.Header",slot:"header",triptype:b.triptype,quote:b.quote},{xtype:"RL.Quote.Summary.Footer",slot:"footer",quote:b.quote,style:"padding-left : 7px"},{xtype:"container",slot:"detailsContainer",autoHeight:true,autoWidth:true,layout:"card",baseCls:"x-frameless",hideBorders:true,items:[{xtype:"RL.Quote.Summary.Destination",slot:"single",header:false,autoHeight:true,autoWidth:true,destCode:Ext.jx.getStore("GTAW").getAt(0).get("GTAW#RESORT"),destPosition:0,quote:b.quote},{xtype:"RL.Quote.Summary.Multiple",slot:"multi",autoHeight:true,autoWidth:true,quote:b.quote}]}]});this.addEvents("quote-book","quote-save","quote-finalize","quote-startover","child-needs-more-height");this.enableBubble("quote-book","quote-save","quote-finalize","quote-startover","child-needs-more-height");RL.Quote.Summary.superclass.constructor.call(this,b)},initComponent:function(){RL.Quote.Summary.superclass.initComponent.call(this);var b=this.slots;b.detailsContainer.activeItem=b[this.triptype];if(RL.Global.user){RL.Global.user.on("login-success",this.onUserLoggedIn,this)}this.quote.on("change",this.refresh,this);this.on("afterlayout",this.onAfterLayout,this)},destroy:function(){if(RL.Global.user){RL.Global.user.un("login-success",this.onUserLoggedIn,this)}this.quote.un("change",this.refresh,this);RL.Quote.Summary.superclass.destroy.call(this)},onUserLoggedIn:function(){this.refresh()},onBookQuote:function(){this.fireEvent("quote-book")},onSaveQuote:function(){this.fireEvent("quote-save")},onStartQuoteOver:function(){this.fireEvent("quote-startover")},switchType:function(b){this.triptype=b;this.slots.header.triptype=b;this.slots.detailsContainer.layout.setActiveItem(this.slots[b]);this.refresh()},onAfterLayout:function(){this.mon(this.el,"click",this.onBodyClick,this,{delay:100})},onBodyClick:function(c){var b=c.getTarget(".del_btn");if(b){this.quote.removeBuildRecord(b.getAttribute("recordId"))}var e=c.getTarget(".edit_btn");if(e){var j=Ext.jx.getStore("BUILD");var f=j.getById(e.getAttribute("recordId"));var h=new RL.Build.Edit({quote:this.quote,buildRecord:f});h.show(e)}},refresh:function(){var b=this.quote.getQuoteProblems();var c=this.slots;this.refreshButtonsStates(b);c.header.refresh(b);c.footer.refresh(b);if(c.error){c.error.refresh(b)}if(c.startOverButton){if(this.quote.haveItems()){c.startOverButton.show()}else{c.startOverButton.hide()}}var e=c.detailsContainer;if(e.rendered){var f=e.layout.activeItem;if(this.triptype=="single"){f.destCode=Ext.jx.getStore("GTAW").getAt(0).get("GTAW#RESORT")}f.refresh(b)}},refreshButtonsStates:function(b){var c=this.slots;if(b){c.bookButton.disable();c.saveButton.disable()}else{c.bookButton.enable();c.saveButton.enable()}},collapseDestinationSegment:function(b,c){if(this.triptype!="multi"){return devThrow("Can't collapse destination segment in single destination mode")}this.slots.multi.collapseDestinationSegment(b,c)},expandDestinationSegment:function(b,c){if(this.triptype!="multi"){return devThrow("Can't expand destination segment in single destination mode")}this.slots.multi.expandDestinationSegment(b,c)}});Ext.reg("rl-quote-summary",RL.Quote.Summary);Ext.ns("RL.Quote.Summary");RL.Quote.Summary.Header=Ext.extend(Ext.Container,{slots:true,quote:null,hidePriceReason:null,triptype:null,cls:"trip_details_main",autoHeight:true,autoWidth:true,onRender:function(){RL.Quote.Summary.Header.superclass.onRender.apply(this,arguments);this.refresh(this.hidePriceReason)},refresh:function(b){if(!this.rendered){return}this.el.update(this.getHTML(b))},getHTML:function(n){var c=Ext.jx.getStore("GTAW").getAt(0);var u=Ext.jx.getStore("BUILD");var s=c.getResortRecord();var e=Ext.jx.getStoreValue("DEPT#CONTRIPPRI")==0;var k=c.get("GTAW#PPPRICE")&&e&&!n;var m=c.get("GTAW#ADULT");var p=!m?"":m+(m==1?" "+l("adult"):" "+l("adults"));var t=c.get("GTAW#CHILD");if(t=="0"){t=""}var b=!t?"":" / "+t+(t==1?" "+l("child"):" "+l("children"));var h=c.get("GTAW#INFANT");if(h=="0"){h=""}var v=!h?"":" / "+h+(h==1?" "+l("infant"):" "+l("infants"));var r=RL.Global.prettyDate(c.get("GTAW#DDATE"));var j=RL.Global.prettyDate(c.get("GTAW#RDATE"));var f=['<div class="rl-white-on-blue">'+l("Trip Details")+"</div>"];f.push('<div class="sum">');if(c.get("GTAW#TOTPRICE")){if(!c.get("GTAW#PPPRICE")){c.set("GTAW#PPPRICE",Math.round(c.get("GTAW#TOTPRICE")/(c.get("GTAW#ADULT")+c.get("GTAW#CHILD"))))}if(this.triptype=="single"&&r){f.push(r," "+l("to")+" ",j,"<br>")}f.push(p,b,"</div>");if(k){var q=Ext.jx.getStoreValue("DEPT#SHOWPPP")==1;if(q){f.push('<div class="price">',Ext.jx.math.formatCurrency(c.get("GTAW#PPPRICE"))," "+l("per person"),'<div class="price_total">',Ext.jx.math.formatCurrency(c.get("GTAW#TOTPRICE"))," "+l("total"),"</div>","</div>")}else{f.push('<div class="price">','<div class="price_total">',Ext.jx.math.formatCurrency(c.get("GTAW#TOTPRICE"))," "+l("total"),"</div>","</div>")}}}if(c.get("GTAW#CUSTNUM")){f.push('<div class="cust">',c.get("PROSPW#FIRST")," ",c.get("PROSPW#LAST")," ",c.get("PROSPW#EMAIL"),"</div>")}if(!f.length){f.push("<br><br><i>"+l("As you add items to your trip quote they will appear here.")+"</i>")}return f.join("")}});Ext.reg("RL.Quote.Summary.Header",RL.Quote.Summary.Header);Ext.ns("RL.Quote.Summary");RL.Quote.Summary.Error=Ext.extend(Ext.Container,{slots:true,quote:null,constructor:function(b){b=b||{};Ext.apply(b,{cls:"trip_details_main"});RL.Quote.Summary.Error.superclass.constructor.call(this,b)},initComponent:function(){RL.Quote.Summary.Error.superclass.initComponent.call(this)},onRender:function(){RL.Quote.Summary.Error.superclass.onRender.apply(this,arguments);this.refresh(this.quote.getQuoteProblems())},refresh:function(){if(!this.rendered){return}this.el.update(this.getHTML())},getHTML:function(){var c=this.quote.getQuoteProblems();var b=[];if(c){b.push('<div class="rl-summaries-error">',c,"</div>")}return b.join("")}});Ext.reg("RL.Quote.Summary.Error",RL.Quote.Summary.Error);Ext.ns("RL.Quote.Summary");RL.Quote.Summary.Footer=Ext.extend(Ext.Container,{slots:true,autoHeight:true,autoWidth:true,hidePriceReason:null,quote:null,constructor:function(b){b=b||{};Ext.apply(b,{cls:"trip_details_main"});RL.Quote.Summary.Footer.superclass.constructor.call(this,b)},initComponent:function(){RL.Quote.Summary.Footer.superclass.initComponent.call(this)},onRender:function(){RL.Quote.Summary.Footer.superclass.onRender.apply(this,arguments);this.refresh(this.hidePriceReason)},refresh:function(b){if(!this.rendered){return}this.el.update(this.getHTML(b))},getHTML:function(h){var f=Ext.jx.getStore("GTAW").getAt(0);var c=Ext.jx.getStoreValue("DEPT#CONTRIPPRI")==0;var b=f.get("GTAW#PPPRICE")&&c&&!h;var e=[];if(b){e.push("<div><b><i>"+l("all prices are in")+" "+Ext.jx.getStoreValue("GTAW#CADCURR")+" "+l("and are approximated until final quote")+"</b></i></div>")}return e.join("")}});Ext.reg("RL.Quote.Summary.Footer",RL.Quote.Summary.Footer);Ext.ns("RL.Quote.Summary");RL.Quote.Summary.Destination=Ext.extend(Ext.Panel,{slots:true,destPosition:null,destCode:null,quote:null,autoHeight:true,autoWidth:true,lastHTML:null,expandDefaults:{duration:0.5},collapseDefaults:{duration:0.5},cls:"trip_details_review",autoHeight:true,autoWidth:true,baseCls:"x-frameless",constructor:function(b){b=b||{};Ext.apply(b,{});RL.Quote.Summary.Destination.superclass.constructor.call(this,b)},initComponent:function(){RL.Quote.Summary.Destination.superclass.initComponent.call(this)},onRender:function(){RL.Quote.Summary.Destination.superclass.onRender.apply(this,arguments);this.refresh()},refresh:function(){if(!this.rendered){return}var b=Ext.jx.getStore("RESORT").data.map["RESORT#SEARCHCODE="+this.destCode];if(b){this.setTitle(b.getName())}var c=this.lastHTML;this.lastHTML=this.getHTML();if(this.lastHTML!=c){this.body.update(this.lastHTML);this.body.highlight()}},getHTML:function(){var e=Ext.jx.getStore("GTAW").getAt(0);var f=Ext.jx.getStore("BUILD");var b=[];var c=this.destPosition+":"+this.destCode;f.each(function(q){var h=q.get("BUILD#DESTSEG");if(h&&h!=c){return}var k=RL.Global.prettyDate(q.get("BUILD#DDATE"));var j=RL.Global.prettyDate(q.get("BUILD#RDATE"));var n;if(q.get("BUILD#TYPE")=="S*"){n=q.get("SPECIAL#DESC")}else{var p=q.getService();if(!p){return}n=p.data["SERVICE#DESCRIP"];var m=p.isGDSAir()||p.get("SERVICE#CONPRICEOV")==1||(p.get("SERVICE#CONPRICEOV")!=2&&Ext.jx.getStoreValue("DEPT#CONPRICES")==3)}b.push('<div class="service-item">','<div class="selected">',n,"</div>");if(!p||p.showStartDateOnAdd()){b.push('<div class="service-items-date">',k);if(!p||p.showEndDateOnAdd()){b.push(" to ",j)}b.push("</div>")}b.push('<div class="service-items-ttl">',q.data["VENDOR#VENDOR"],"</div>",q.data["#UNIT_DESC"]?'<div class="service-items-desc">'+q.data["BUILD#UNITS"]+": "+q.data["#UNIT_DESC"]+"</div>":"");if(p&&p.isGDSAir()){if(!RL.Global.airDisplayTpl){RL.Global.airDisplayTpl=new Ext.XTemplate(Ext.jx.getTable("_VENDOR_PRICING").templates.gdsair_line_compressed)}b.push('<div class="service-items-desc">',RL.Global.airDisplayTpl.applyTemplate(q.data),"</div>")}if(m){b.push('<div class="service-items-price">','<div class="del_btn" recordId="',q.id,'"><span>',l("delete"),"</span></div>",'<div class="x-clear"></div>','<div class="item-price">',q.get("BUILD#UNITS")," @ ",q.getNicePrice()," = ",q.getNiceTotalPrice(),"</div>","</div>")}else{b.push('<div class="service-items-price">','<div class="del_btn" recordId="',q.id,'"><span>',l("delete"),"</span></div>","</div>")}b.push("</div>")},this);return b.join("")}});Ext.reg("RL.Quote.Summary.Destination",RL.Quote.Summary.Destination);Ext.ns("RL.Quote.Summary");RL.Quote.Summary.Multiple=Ext.extend(Ext.Container,{slots:true,quote:null,destinationXType:"RL.Quote.Summary.Destination",constructor:function(b){b=b||{};Ext.apply(b,{});RL.Quote.Summary.Multiple.superclass.constructor.call(this,b)},initComponent:function(){RL.Quote.Summary.Multiple.superclass.initComponent.apply(this,arguments);this.synchronize()},synchronize:function(){var c=Ext.jx.getStore("BUILD");var b={};c.each(function(h){var f=h.get("BUILD#DESTSEG");if(!f||b[f]){return}b[f]=true;var e=/(\d+):(.+)/.exec(f);if(!this.slots[f]){this.add({xtype:this.destinationXType,slot:f,destCode:e[2],destPosition:e[1],quote:this.quote,collapsible:true})}},this);Ext.jx.each(this.slots,function(e,f){if(!b[f]){this.remove(e)}},this)},refresh:function(){this.synchronize();Ext.jx.each(this.slots,function(b,c){b.refresh()},this);this.doLayout()},collapseDestinationSegment:function(b,f){var c=b+":"+f;var e=this.slots[c];if(e){e.collapse({callback:function(){this.ownerCt.doLayout()},scope:this})}},expandDestinationSegment:function(b,f){var c=b+":"+f;var e=this.slots[c];if(e){e.expand({callback:function(){this.ownerCt.doLayout()},scope:this})}}});Ext.reg("RL.Quote.Summary.Multiple",RL.Quote.Summary.Multiple);Ext.ns("RL.Quote.Summary");RL.Quote.Summary.LoginLine=Ext.extend(Ext.Container,{slots:true,constructor:function(b){b=b||{};Ext.apply(b,{cls:"rl-quote-summary-login"});RL.Quote.Summary.LoginLine.superclass.constructor.call(this,b)},initComponent:function(){RL.Quote.Summary.LoginLine.superclass.initComponent.call(this);this.addEvents("show-login","show-account")},onRender:function(){RL.Quote.Summary.LoginLine.superclass.onRender.apply(this,arguments);this.refresh();this.el.on("click",this.onClick,this)},onClick:function(f){var b=f.getTarget(".rl-quote-summary-login-link");if(b){f.preventDefault();if(this.fireEvent("show-login",this)!==false){var c=new RL.Login.Popup({returnTrips:true});c.show(b)}}var e=f.getTarget(".rl-quote-summary-account-link");if(e){f.preventDefault();if(this.fireEvent("show-account",this)!==false){RL.Global.showUserAccount(e)}}},refresh:function(){if(!this.rendered){return}this.el.update(this.getHTML())},getHTML:function(){var b=[];b.push('<a class="rl-quote-summary-account-link"> My Trips</a> ',!RL.Global.user.authenticated?'<a class="rl-quote-summary-login-link">Login |</a>':"",'<div class="x-clear"></div>');return b.join("")}});Ext.reg("RL.Quote.Summary.LoginLine",RL.Quote.Summary.LoginLine);Ext.ns("RL.Quote.Summary");RL.Quote.Summary.Long=Ext.extend(Ext.Container,{autoHeight:true,autoWidth:true,hideActionButtons:false,finalizationNote:"Please wait now finalizing your quote...",quote:null,actionToolbar:null,beforeInitComponent:function(){Ext.apply(this,{});this.finalizationNote=this.finalizationNote||"Please wait, now finalizing your Quote ..."},initComponent:function(){this.beforeInitComponent();RL.Quote.Summary.Long.superclass.initComponent.call(this);this.quote.on("change",this.refresh,this)},onRender:function(){RL.Quote.Summary.Long.superclass.onRender.apply(this,arguments);this.refresh();this.mon(this.el,"click",this.onBodyClick,this)},onBodyClick:function(c){var b=c.getTarget(".del_btn");if(b){this.quote.removeBuildRecord(b.getAttribute("recordId"))}var e=c.getTarget(".edit_btn");if(e){var j=Ext.jx.getStore("BUILD");var f=j.getById(e.getAttribute("recordId"));var h=new RL.Build.Edit({quote:this.quote,buildRecord:f});h.show(e)}},refresh:function(){this.el.update(Jemplate.process("GTAW/DETAIL.HTML",{o_table:Ext.jx.getStore("GTAW").getAt(0)}));var h=this.el.child(".tq_overview_body");var c=h.insertSibling({tag:"div"},"after");var e=this.quote;if(this.actionToolbar){this.actionToolbar.destroy()}this.actionToolbar=new Ext.Toolbar({xtype:"toolbar",slots:true,renderTo:c,hidden:e.finalizing||this.hideActionButtons,items:[{slot:"emailButton",text:l("Email"),iconCls:"startover-btn",iconAlign:"top",scale:"large",width:70,disabled:!e.canEmail(),handler:this.onEmailQuote,scope:this},{slot:"bookButton",hidden:Ext.jx.getStoreValue("DEPT#WEBBKMO")==1,text:l("Book"),iconCls:"rl-icon-quote-book-big",iconAlign:"top",scale:"large",width:70,disabled:!e.canBook(),handler:this.onBookQuote,scope:this},{slot:"addButton",text:l("Add item"),iconCls:"rl-icon-quote-add-big",iconAlign:"top",scale:"large",width:70,disabled:!e.canAdd(),menu:this.getAddMenuItems()},"->",{slot:"newQuoteButton",text:l("New Quote"),scale:"large",width:70,iconAlign:"top",iconCls:"rl-icon-back-to-quote",handler:this.onNewQuote,scope:this},{slot:"myTripsButton",text:l("My Trips"),scale:"large",width:70,iconAlign:"top",iconCls:"rl-icon-my-trips",handler:this.onMyTrips,scope:this}]});var b=e.getQuoteProblems();this.refreshButtonsStates(b);if(e.finalizing){var f=c.insertSibling({tag:"div",cls:"rl-quote-content-finalization-note",html:this.finalizationNote||"Please wait..."});this.highlightFinalizationNote(f)}},highlightFinalizationNote:function(b){b.highlight("0000ff",{duration:3,endColor:"000000",attr:"color",callback:function(){this.highlightFinalizationNote(b)},scope:this})},getAddMenuItems:function(){var e=this.quote;var b=e.getDestinations();if(!b.length){return[]}if(b.length==1){return this.getDestinationMenuItems(0,b[0],true,true)}var c=[];Ext.each(b,function(f,h){c.push({xtype:"menu",items:this.getDestinationMenuItems(h,f,true)})},this);return c},getDestinationMenuItems:function(e,h,f,j){var c=this.quote;var b=[];Ext.each(c.getProductsFor(h,f,j),function(k){if(k.productGroup){var n=k.productGroup;b.push({text:n.get("PRODGRP#PGDESC"),handler:this.showAddProductGroupPopup.createDelegate(this,[n,e,h]),scope:this})}else{if(k.product){var m=k.product;b.push({text:m.get("SERVICE#DESCRIP"),handler:this.showAddProductPopup.createDelegate(this,[m,e,h]),scope:this})}else{return devThrow("Unknown step type returned from 'getProductsFor'")}}},this);return b},showAddProductPopup:function(h,e,f){var c=h.isGDSAir()?RL.PriceSearch.Air:RL.PriceSearch.Service;var b=new Ext.Window({title:h.data["SERVICE#DESCRIP"],width:RL.Global.getWindowSize().width*0.8,height:RL.Global.getWindowSize().height*0.8,modal:true,layout:"fit",items:[new c({header:false,isStandAlone:true,compactSearch:true,recordProduct:h,quote:this.quote,n_dest:e,destCode:f.getCode()})]});b.on("after-service-add",b.close,b);b.show()},showAddProductGroupPopup:function(e,c,f){var b=new Ext.Window({title:e.data["PRODGRP#PGDESC"],width:Math.round(RL.Global.getWindowSize().width*0.8),height:Math.round(RL.Global.getWindowSize().height*0.8),modal:true,layout:"fit",items:[new RL.PriceSearch.ProductGroup({header:false,isStandAlone:true,compactSearch:true,recordProdGroup:e,quote:this.quote,n_dest:c,destCode:f.getCode()})]});b.on("after-service-add",b.close,b);b.show()},refreshButtonsStates:function(b){var h=this.actionToolbar.slots;var e=this.quote;var c=h.bookButton;var j=h.emailButton;var f=h.addButton;if(e.canAdd()){f.enable()}else{f.disable()}if(e.canBook()){c.enable()}else{c.disable()}if(e.canEmail()){j.enable()}else{j.disable()}},onNewQuote:function(){if(this.quote.isDirty){Ext.Msg.show({title:l("Warning"),msg:l("Starting new quote will clear all changes in existing quote. Are you sure you want to continue?"),buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.WARNING,fn:function(b){if(b=="yes"){RL.Global.startQuoteOver()}}})}else{RL.Global.startQuoteOver()}},onMyTrips:function(){RL.Global.showUserAccount()},onEmailQuote:function(){Ext.jx.mask(Ext.getBody(),l("Loading email screen, please wait..."),"rl-mask-medium");this.quote.email(function(){Ext.jx.unmask(Ext.getBody());Ext.MessageBox.show({icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK,title:l("Saving Error"),msg:l("There was an unknown error while emailing your quote. Please try again.")})})},onBookQuote:function(){Ext.jx.mask(Ext.getBody(),l("Loading booking screen, please wait..."),"rl-mask-medium");this.quote.book(function(){Ext.jx.unmask(Ext.getBody());Ext.MessageBox.show({icon:Ext.MessageBox.ERROR,buttons:Ext.Msg.OK,title:l("Saving Error"),msg:l("There was an unknown error while booking your quote. Please try again.")})})}});Ext.reg("RL.Quote.Summary.Long",RL.Quote.Summary.Long);Ext.ns("RL.Quote.Summary.Long.Header");RL.Quote.Summary.Long.Header.InsteadOfSummaries=Ext.extend(Ext.Container,{quote:null,beforeInitComponent:function(){Ext.apply(this,{slots:true,height:110,layout:"columnfit",hideBorders:true,items:[{xtype:"RL.Quote.Summary.Long.Header",slot:"header",quote:this.quote,listenQuoteChange:true,columnWidth:1},{slot:"controls",width:230,layout:"fit",unstyled:true,items:[{xtype:"RL.Quote.Summary.Long.Header.InsteadOfSummaries.LoginLine",quote:this.quote}],bbar:new Ext.Toolbar({cls:"x-toolbar-plain",items:["->",{slot:"finalizeButton",iconCls:"rl-icon-finalize",iconAlign:"top",text:l("finalize"),scale:"large",width:70,handler:this.onFinalizeQuote,scope:this},{slot:"startOverButton",iconCls:"rl-icon-back-to-quote",iconAlign:"top",text:l("start over"),scale:"large",width:70,handler:this.onStartQuoteOver,scope:this}]})}]})},initComponent:function(){this.beforeInitComponent();RL.Quote.Summary.Long.Header.InsteadOfSummaries.superclass.initComponent.call(this);this.addEvents("quote-finalize","quote-startover");this.enableBubble("quote-finalize","quote-startover");this.quote.on("change",this.onQuoteChange,this)},destroy:function(){this.quote.un("change",this.onQuoteChange,this);RL.Quote.Summary.Long.Header.InsteadOfSummaries.superclass.destroy.call(this)},onQuoteChange:function(){var b=this.slots.controls.getBottomToolbar();if(this.quote.getCount()>0){this.setHeight(110);b.show()}else{this.setHeight(55);b.hide()}},onFinalizeQuote:function(){this.fireEvent("quote-finalize")},onStartQuoteOver:function(){this.fireEvent("quote-startover")}});Ext.reg("RL.Quote.Summary.Long.Header.InsteadOfSummaries",RL.Quote.Summary.Long.Header.InsteadOfSummaries);Ext.ns("RL.Quote.Summary.Long.Header.InsteadOfSummaries");RL.Quote.Summary.Long.Header.InsteadOfSummaries.LoginLine=Ext.extend(RL.Quote.Summary.LoginLine,{slots:true,quote:null,initComponent:function(){RL.Quote.Summary.Long.Header.InsteadOfSummaries.LoginLine.superclass.initComponent.call(this);this.addEvents("show-service-items")},onClick:function(c){RL.Quote.Summary.Long.Header.InsteadOfSummaries.LoginLine.superclass.onClick.apply(this,arguments);var e=c.getTarget(".rl-quote-summary-view-items-link");if(e){c.preventDefault();if(this.fireEvent("show-service-items",this)!==false){var b=new Ext.Window({plain:true,width:Math.round(RL.Global.getWindowSize().width*0.8),height:Math.round(RL.Global.getWindowSize().height*0.8),modal:true,layout:"fit",items:[{xtype:"RL.Quote.Summary.Long",quote:this.quote,triptype:RL.Global.getTripType(),hideActionButtons:true,autoHeight:false}]});b.show()}}},getHTML:function(){var b=[RL.Quote.Summary.Long.Header.InsteadOfSummaries.LoginLine.superclass.getHTML.call(this)];b.unshift('<a class="rl-quote-summary-view-items-link">| View Service Items </a> ');return b.join("")}});Ext.reg("RL.Quote.Summary.Long.Header.InsteadOfSummaries.LoginLine",RL.Quote.Summary.Long.Header.InsteadOfSummaries.LoginLine);Ext.ns("RL");RL.Viewport=Ext.extend(Ext.Container,{forceOldLayout:false,isAddingHistory:false,autoHeight:true,autoWidth:true,renderedLayout:{},style:"margin-right:22px",cls:"viewport",beforeInitComponent:function(){document.body.scroll="";var b=this.irePage=Ext.get("IREPAGE");if(!b){Ext.DomHelper.append(document.body,{tag:"div",id:"IREPAGE"});b=Ext.get("IREPAGE")}else{b.setStyle("display","block")}this.renderTo=b;Ext.apply(this,{slots:true,layout:"card-dynamic",activeItem:0})},fireResize:function(){var b=Ext.getScrollBarWidth();var e=RL.Global.getWindowSize().width-(b*2);var f=RL.Global.minWidth+b;var c=Ext.isMobile||e<f?f:e;if(!this.rendered){if(this.irePage){this.irePage.setWidth(c+b)}this.setWidth(c+b);return}return;if(Math.abs(this.getWidth()-c)>7){Ext.jx.log("RL.Viewport.fireResize curWidth: "+e+" reqWidth:"+f+" useWidth:"+c+" getWidth:"+this.getWidth());Ext.getBody().setStyle({"overflow-x":c==e?"hidden":"auto"});if(this.irePage){this.irePage.setWidth(c+b)}this.setWidth(c+b);this.doLayout()}},initComponent:function(){this.beforeInitComponent();this.addEvents("before-dispatch","after-dispatch");RL.Viewport.superclass.initComponent.call(this);Ext.History.on("change",this.onHistoryChange,this);Ext.getBody().on("click",this.onInternalLinkClick,this,{delegate:".rl-link"});Ext.jx.mask(Ext.getBody(),l("Preparing your screen..."),"rl-mask-medium",true);if(!window.gtawNew){this.showQuoteWizard({},{backgroundLoad:true,addHistory:false})}},start:function(){var b=RL.Variables=RL.Variables||{};Ext.apply(b,Ext.jx.getUrlFrag(undefined,true));this.initVars=Ext.apply(b);if(Ext.jx.getQueryString().debug_mode){Ext.jx.allowDebug=true}if(!RL.tplOptions){RL.tplOptions={}}b.vendor=b.vendor||b.vendor_0||b.vendor_1;delete b.vendor_0;delete b.vendor_1;this.dispatch(b,{addHistory:false,initialLoad:true});Ext.jx.Map.Google.include.defer(100)},destroy:function(){Ext.getBody().un("click",this.onInternalLinkClick,this,{delegate:".rl-link"});RL.Viewport.superclass.destroy.apply(this,arguments)},onHistoryChange:function(b){if(!this.isAddingHistory){this.dispatch(b,b?{addHistory:true}:{})}},onInternalLinkClick:function(b,c){alert("onInternalLinkClick: not tested");return},prep_screen_processing:function(c){var b=/(.*)\((.*)\)/.exec(c.screen);if(b){c.screen=b[1];c.params=b[2].split(",")}if(!c.screen){if(c.tpl){c.screen="tpl"}else{if(c.vendor){c.screen="scnvendorhome"}else{if(c.special){c.vendor="";c.screen="scnsell_special"}else{if(c.dest){c.vendor="";c.screen="scndesthome"}else{if(c.superdest){c.dest="";c.vendor="";c.screen="scndesthome"}else{if(c.prodline||c.producttype||c.productgroup){c.superdest="";c.dest="";c.vendor="";c.screen="scndesthome"}else{if(c._defaulthome){c.screen=c._defaulthome}else{if(Jemplate.templateMap["DEPT/HOME.HTML"]){c.screen="tpl";c.tpl_table="DEPT";c.tpl="Home"}else{c.screen="scndesthome"}}}}}}}}}else{if(c.tpl&&/scnvendorhome|scnsell_special|scndesthome/i.test(c.screen)){c.tpl=""}}if(c.screen){c.screen=c.screen.toLowerCase()}},dispatch:function(f,e){e=e||{};f=f||this.initVars;if(typeof f=="string"){f=Ext.urlDecode(f)}if(f.l){this.trackAnalytics();e.addHistory=false}if(this.fireEvent("before-dispatch",this,f,e)===false){return}if(f.email&&(f.check2||f.password)&&!RL.Global.user.authenticated){if(e.initialLoad){Ext.jx.unmask(Ext.getBody())}Ext.jx.mask(Ext.getBody(),l("Authorizing, please wait..."),"rl-mask-medium");RL.Global.user.authenticate({username:f.email,password:f.password,check2:f.check2,returnTrips:true},this.authenticateCallbackOnDispatch.createDelegate(this,[f,e]),this);return}if(!e.initialLoad){Ext.jx.mask(Ext.getBody(),l("Preparing your screen..."),"rl-mask-medium",true)}this.prep_screen_processing(f);var c=f.screen;if(c=="scnwizardsteps"){this.updateConsumerLayout({s_screen_title:l("Trip Quote")});if(f.params&&f.params[0]){f.step=f.params[0]}this.showQuoteWizard(f,e)}else{if(c=="scntrips"||c=="scnlogon"||c=="scnlogon2"||c=="scncustomer"){if(RL.Global.user.authenticated){this.updateConsumerLayout();RL.Global.showUserAccount()}else{this.showUserLogin(undefined,undefined,false,f,e,true)}}else{if(c=="scnlogonta"){if(RL.Global.user.authenticated){this.updateConsumerLayout();RL.Global.showUserAccount()}else{this.showUserLogin(undefined,undefined,true,f,e,true)}}else{if(c=="scndesthome"||c=="scncontent_superdest_dests"){this.updateConsumerLayout({s_screen_title:l("Destinations")});this.showDestinationHome(f,e)}else{if(c=="scnsell_special"||c=="scnspecials_all"){if(f.special){this.showSpecial(f,e)}else{this.updateConsumerLayout({s_screen_title:l("Specials")});this.showSpecialsSelector(f,e)}}else{if(c=="scnvendorhome"){this.updateConsumerLayout();this.showVendorHome(f,e)}else{if(c=="scnvendorhome_popup"){this.showVendorHome(f,e)}else{if(c=="scncontentquote"||c=="scneditquote"){RL.tplOptions.s_screen_title=l("Trip Quote");var b=new RL.Model.Quote({user:RL.Global.user,resno:f.resno,authToken:f.check});Ext.jx.mask(Ext.getBody(),l("Loading your quote, please wait..."),"rl-mask-medium");b.load(function(j,k){Ext.jx.unmask(Ext.getBody());if(k){this.showContentQuote(j,f,e)}else{Ext.Msg.show({title:l("Error"),msg:l("There was an error while loading quote"),buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}},this)}else{if(c=="tpl"||f.tpl){if(!f.tpl&&f.params&&f.params[0]){var h=f.params[0].split("::");if(h.length==2){f.table_tpl=h[0];f.tpl=h[1]}}if(!f.table_tpl){f.table_tpl="DEPT"}f.table_tpl=f.table_tpl.toUpperCase();f.tpl=f.tpl.toUpperCase();if(f.table_tpl=="DEPT"){this.showTemplate(f,e,f.table_tpl,f.tpl)}else{if(f.table_tpl){this.showDestHome(f,e)}else{this.showQuoteWizard(f,e)}}}else{this.updateConsumerLayout({s_screen_title:l("New Trip Quote")});this.showQuoteWizard(f,e)}}}}}}}}}if(this.n_delay_unmask){delete this.n_delay_unmask;(function(){Ext.jx.unmask(Ext.getBody())}).defer(this.n_delay_unmask,this)}else{Ext.jx.unmask(Ext.getBody())}},authenticateCallbackOnDispatch:function(c,b){Ext.jx.unmask(Ext.getBody());if(!RL.Global.user.authenticated){c.check2=undefined}c.password=undefined;this.dispatch(c,b)},showDestinationHome:function(j,e){e=e||{};var c=j.dest?j.dest.toUpperCase():RL.Global.getDefaultDestCode();var h=this.getContentComponent(j,e);var f="RESORT-"+c;var b=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(c);if(!b){this.showDestinationSelector(j,e);if(e.addHistory){this.saveHistoryToken({screen:"scndesthome"})}return}Ext.jx.mask(Ext.getBody(),l("Loading destination information, please wait..."),"rl-mask-medium");RL.Global.getVendors(b,function(m){Ext.jx.unmask(Ext.getBody());if(m){var k;if(!h.slots[f]){h.add({xtype:"RL.Screen.DestinationHome",slot:f,producttype:j.producttype,productgroup:j.productgroup,showDestinationSelector:!RL.Global.getDestinationIfSingle(),destinationRecord:b});k=true}this.displayItem(h.slots[f]);if(!k){h.slots[f].slots.content.setTabSpecial({producttype:j.producttype,productgroup:j.productgroup})}if(e.addHistory){this.saveHistoryToken({screen:"scndesthome",producttype:j.producttype,productgroup:j.productgroup,dest:c})}}else{Ext.Msg.show({title:l("Error"),msg:l("There was an error while loading destination content. Please try again in few minutes"),buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}},this)},showTemplate:function(j,c,f,b,h){c=c||{};var e=this.getContentComponent(j,c);if(e.slots.jemplate){e.remove(e.slots.jemplate,true)}var k=new RL.Screen.Template({slot:"jemplate",jemplate:f+"/"+b+".HTML",data:h});k.processJemplate();this.updateConsumerLayout();e.add(k);this.displayItem(e.slots.jemplate);if(c.addHistory){this.saveHistoryToken({screen:"tpl",table_tpl:f,tpl:b})}},setScreenTitle:function(k,c){var h=this.slots.BorderLayout,m=h.slots;var f=m.content.topToolbar;if(!f||!f.ownerCt){return}var e=f.ownerCt.toolbars[0];var b=f.slots.screenTitle;if(b){if(k||RL.tplOptions.s_screen_title){b.setText(k||RL.tplOptions.s_screen_title);b.show()}else{b.hide()}}if(!c){this.showTopToolbar()}else{if(this.topToolbar_hidden&&k&&this.renderedLayout){var j=RL.tplOptions;RL.tplOptions=this.renderedLayout;RL.tplOptions.s_screen_title=k;RL.tplOptions=j}}},showTopToolbarButton:function(c,b){var j=0;var h=this.slots.BorderLayout,m=h.slots;var f=m.content.topToolbar;if(!f.ownerCt){return}var e=f.ownerCt.toolbars[0];if(typeof b=="undefined"){b=true}if(RL.tplOptions.b_hide_page_options==1){b=false}var k=f.slots[c];if(k){if(b){k.show();j++}else{k.hide()}}return j},showTopToolbar:function(){var e=this.slots.BorderLayout,h=e.slots;var c=h.content.topToolbar;if(!c||!c.ownerCt){return}var b=c.ownerCt.toolbars[0];if(RL.tplOptions.s_screen_title||RL.tplOptions.b_hide_page_options!=1){this.topToolbar_hidden=false;b.show();b.setHeight("auto");var f=0;f+=this.showTopToolbarButton("destCombo",RL.tplOptions.b_hide_dests_combo!=1);f+=this.showTopToolbarButton("destsBtn");f+=this.showTopToolbarButton("SpecialsBtn");this.showTopToolbarButton("QuoteBtn",f>0);this.showTopToolbarButton("LoginBtn")}else{this.topToolbar_hidden=true;b.hide();b.setHeight(0)}b.syncSize()},updateConsumerLayout:function(k){var b=this.slots.BorderLayout,h=b.slots;var e=this.getContentComponent(),c;if(!RL.tplOptions){RL.tplOptions={}}if(k&&k.s_screen_title){RL.tplOptions.s_screen_title=k.s_screen_title}if(RL.tplOptions.b_hide_layout!=this.renderedLayout.b_hide_layout){if(RL.tplOptions.b_hide_layout){h.conbottom.hide();h.contop.hide();h.conleft.hide();h.conright.hide()}else{h.conbottom.show();h.contop.show();h.conleft.show();h.conright.show()}}if(!RL.tplOptions.b_hide_layout&&(!this.renderedLayout.alreadyRendered||this.renderedLayout.s_layout!=RL.tplOptions.s_layout)){var f=b.getFrameConfig(RL.tplOptions.s_layout);h.contopleft.processJemplateRemote(f.CONTOPLEFT);h.conbottomleft.processJemplateRemote(f.CONBOTTOMLEFT);h.conleft.processJemplateRemote(f.CONLEFT);h.contopright.processJemplateRemote(f.CONTOPRIGHT);h.conbottomright.processJemplateRemote(f.CONBOTTOMRIGHT);h.conright.processJemplateRemote(f.CONRIGHT);h.contop.processJemplateRemote(f.CONTOP);h.conbottom.processJemplateRemote(f.CONBOTTOM);if(!RL.b_menu_fix_already_implemented){RL.b_menu_fix_already_implemented=1;var j=RL.tplOptions.s_layout;(function(){if(this.renderedLayout.s_layout==j){h.conleft.renderedJemplate="";h.conleft.processJemplateRemote(f.CONLEFT);h.conright.renderedJemplate="";h.conright.processJemplateRemote(f.CONRIGHT);h.contopleft.renderedJemplate="";h.contopleft.processJemplateRemote(f.CONTOPLEFT);h.contopright.renderedJemplate="";h.contopright.processJemplateRemote(f.CONTOPRIGHT);h.conbottomleft.renderedJemplate="";h.conbottomleft.processJemplateRemote(f.CONBOTTOMLEFT);h.conbottomright.renderedJemplate="";h.conbottomright.processJemplateRemote(f.CONBOTTOMRIGHT);h.contop.renderedJemplate="";h.contop.processJemplateRemote(f.CONTOP);h.conbottom.renderedJemplate="";h.conbottom.processJemplateRemote(f.CONBOTTOM)}else{}}).defer(2000,this)}}else{if(RL.tplOptions.alreadyRendered){RL.tplOptions.b_hide_page_options=this.renderedLayout.b_hide_page_options}}if(RL.tplOptions.s_css_url){Ext.each(RL.tplOptions.s_css_url.split(/[\,\;]/),function(m){if(m&&m!=""){Ext.jx.External.includeCss(m)}});delete RL.tplOptions.s_css_url}if(RL.tplOptions.s_js_url){Ext.each(RL.tplOptions.s_js_url.split(/[\,\;]/),function(m){if(m&&m!=""){Ext.jx.External.includeJs(m)}});delete RL.tplOptions.s_js_url}this.updateConsumerLayoutFinish()},updateConsumerLayoutFinish:function(){this.setScreenTitle();this.renderedLayout={};Ext.apply(this.renderedLayout,RL.tplOptions);RL.tplOptions={alreadyRendered:true}},showDestHome:function(j,e){e=e||{};var c=j.dest?j.dest.toUpperCase():RL.Global.getDefaultDestCode();var h=this.getContentComponent(j,e);var f="RESORT-"+c;var b=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(c);if(!b){this.showDestinationSelector(j,e);if(e.addHistory){this.saveHistoryToken({screen:"scndesthome"})}return}Ext.jx.mask(Ext.getBody(),"Loading destination information, please wait...","rl-mask-medium");RL.Global.getVendors(b,function(k){Ext.jx.unmask(Ext.getBody());if(k){if(!h.slots[f]){h.add({xtype:"RL.Screen.DestHome",slot:f,destRecord:b})}this.displayItem(h.slots[f]);if(e.addHistory){this.saveHistoryToken({screen:"tpl",tpl:"RESORT",dest:"HOME"})}}else{Ext.Msg.show({title:l("Error"),msg:l("There was an error while loading destination content. Please try again in few minutes"),buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}},this)},showVendorHome:function(k,f){f=f||{};var e=k.dest?k.dest.toUpperCase():RL.Global.getDefaultDestCode();var m=k.vendor;var j=this.getContentComponent(k,f);var c=Ext.jx.getStore("RESORT");var b=c.getAt(c.find("RESORT#SEARCHCODE",e));var h="RESORT-"+e;if(!b){return devThrow("Destination needs to be passed in for 'scnvendorhome' screen")}Ext.jx.mask(Ext.getBody(),l("Loading destination information, please wait..."),"rl-mask-medium");RL.Global.getVendors(b,function(q){Ext.jx.unmask(Ext.getBody());if(q){var n=k.isPopup;var p;if(!j.slots[h]){j.add({xtype:"RL.Screen.DestinationHome",slot:h,producttype:k.producttype,productgroup:k.productgroup,vendor:k.vendor,showDestinationSelector:!RL.Global.getDestinationIfSingle(),destinationRecord:b});p=true}this.displayItem(j.slots[h]);if(!p){j.slots[h].slots.content.setTabSpecial({producttype:k.producttype,productgroup:k.productgroup,vendor:k.vendor})}if(f.addHistory){this.saveHistoryToken({screen:n?"scnvendorhome_popup":"scnvendorhome",dest:e})}}else{Ext.Msg.show({title:l("Error"),msg:l("There was an error while loading destination content. Please try again in few minutes"),buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}},this)},showDestinationSelector:function(e,b){var c=this.getContentComponent();if(c.slots.destSelector){c.slots.destSelector.destroy()}c.add({xtype:"RL.Screen.DestinationSelector",superdest:e.superdest,slot:"destSelector"});this.displayItem(c.slots.destSelector)},showSpecialsSelector:function(e,b){var c=this.getContentComponent();if(!c.slots.specialsSelector){c.add({xtype:"RL.Screen.SpecialSelector.DataView",slot:"specialsSelector"})}if(b.addHistory){this.saveHistoryToken({screen:"scnsell_special"})}this.displayItem(c.slots.specialsSelector)},showSpecial:function(f,e){e=e||{};e.popupOnly=true;var h=f.special?f.special.toUpperCase():"";var b=Ext.jx.getTable("SPECIAL").Funcs.getSpecialByCode(h);if(!b){this.showSpecialsSelector();return}var c=new RL.Special.Popup({specialRecord:b});c.show()},showUserLogin:function(j,h,f,k,c,b){c=c||{};var e=new RL.Login.Popup({isTravelAgent:f,cantSkip:b,returnTrips:Ext.isDefined(h)?h:true});e.show.defer(100,e,[j]);if(c.addHistory){this.saveHistoryToken({screen:f?"scnlogonta":"scnlogon"})}},showUserAccount:function(e,b){b=b||{};var c=this.getContentComponent(e,b);if(!c.slots.account){c.add({xtype:"RL.Account",slot:"account"})}this.displayItem(c.slots.account);if(b.addHistory){this.saveHistoryToken({screen:"scntrips"})}},getContentComponent:function(c,b){b=b||{};if(!this.slots.BorderLayout){this.add({xtype:"RL.Layout.Border",slot:"BorderLayout"})}return this.slots.BorderLayout.slots.content},displayItem:function(c){var b=this.getContentComponent();if(b.rendered){b.layout.setActiveItem(c)}else{b.on("afterrender",function(){b.layout.setActiveItem(c)})}},showQuoteWizard:function(f,b){f=f||{};b=b||{};var e=this.getContentComponent(f,b);if(e.slots.quote){e.remove(e.slots.quote)}if(!RL.tplOptions){RL.tplOptions={}}RL.tplOptions.b_hide_dests_combo=1;window.gtawNew=e.add({xtype:"RL.Quote",slot:"quote",triptype:f.triptype,initialStep:f.step,producttype:f.producttype,productgroup:f.productgroup,vendor:f.vendor});if(f.startdate){f.startdate=Ext.jx.cleanDate(f.startdate)}if(f.enddate){f.enddate=Ext.jx.cleanDate(f.enddate)}window.gtawNew.configure({initialDestCode:f.dest,startdate:f.startdate,enddate:f.enddate,adults:f.adults,children:f.children});if(!b.backgroundLoad){if(!RL.Global.allowQuoteWizard()){this.updateConsumerLayout({title:l("Destinations")});this.showDestinationHome(f,b);return}this.displayItem(window.gtawNew);var c={screen:"scnwizardsteps"};if(f.startdate){c.startdate=f.startdate}if(f.enddate){c.enddate=f.enddate}if(f.dest){c.dest=f.dest}if(f.vendor){c.vendor=f.vendor}if(f.step){c.step=f.step}if(f.producttype){c.producttype=f.producttype}if(f.productgroup){c.productgroup=f.productgroup}if(f.adults){c.adults=f.adults}if(f.children){c.children=f.children}if(b.addHistory){this.saveHistoryToken(c)}}},showContentQuote:function(b,f,c){c=c||{};var e=this.getContentComponent(f,c);if(e.slots.contentQuote){e.remove(e.slots.contentQuote)}var h=e.add({xtype:"RL.Quote.Content",slot:"contentQuote",finalizationNote:c.finalizationNote,quote:b});this.displayItem(h);this.doLayout(false,true);if(c.addHistory&&b.isFinalized()){this.saveHistoryToken({screen:"scneditquote",resno:b.resno,check:b.authToken})}},startQuoteOver:function(c){if(this.slots.quote){this.remove(this.slots.quote)}var b=RL.Variables;b.dest=null;b.producttype=null;b.productgroup=null;c=c||{};if(!c.step){c.step=1}this.showQuoteWizard(c)},trackAnalytics:function(){var b;if((b=Ext.jx.getStoreValue("DEPT#WEBACTGOOG"))){if(!window._gat){Ext.jx.log("google analytics not properly loaded")}else{Ext.each(b.split(/[,;\s\"\']/),function(f){if(f){var e=_gat._getTracker(f);if(e){e._trackPageview(location.href);Ext.jx.log("tracked ("+location.href+") on google account: "+f)}else{Ext.jx.log("could not load google analytics account: "+f)}}})}}if((b=Ext.jx.getStoreValue("DEPT#WEBACTYAHO"))){if(!window.YWA){Ext.jx.log("yahoo analytics not properly loaded")}else{Ext.each(b.split(/[,;\s\"\']/),function(f){if(f){var e=YWA.getTracker(f);if(e){e.submit(location.href);Ext.jx.log("tracked ("+location.href+") on yahoo account: "+f)}else{Ext.jx.log("could not load yahoo analytics account: "+f)}}})}}},saveHistoryToken:function(e){e=Ext.apply({},e);var b=RL.Global.user;if(b.authenticated){e.email=b.prospwRecord.data["PROSPW#EMAIL"];e.check2=b.prospwRecord.data["#CHECK2"]}var f=[],c={};Ext.jx.each(e,function(j,h){f.push({name:h,value:j})});f=f.sort(function(j,h){return j.name<h.name?-1:j.name>h.name?1:0});Ext.jx.each(f,function(h){c[h.name]=h.value});this.isAddingHistory=true;Ext.History.add(Ext.urlEncode(c));this.trackAnalytics();(function(){this.isAddingHistory=false}).defer(500,this)}});Ext.reg("RL.Viewport",RL.Viewport);Ext.ns("RL.Quote");RL.Quote.WizardBase=Ext.extend(Ext.ux.TabPanelSkin,{keepFirstTab:false,enableTabScroll:true,plain:true,border:false,tabsBgCls:"quote_steps_bg",tabBtnCls:"quote_steps_btn",tabsTitleCls:"quote_steps_msg",n_dest:0,destCode:null,initialStep:null,producttype:null,initialDestCode:null,startdate:null,enddate:null,vendor:null,prefetchDelay:4000,autoHeight:true,quote:null,initialTabChange:true,isMulti:false,constructor:function(b){b=b||{};Ext.apply(b,{hideBorders:true,defaults:{border:false,hideMode:"offsets"}});this.addEvents("quote-changed","quote-finalize","wizard-leave","wizard-enter","destination-banner-updated","destination-banner-hidden");this.enableBubble("quote-changed","quote-finalize","wizard-leave","wizard-enter","destination-banner-updated","destination-banner-hidden");RL.Quote.WizardBase.superclass.constructor.call(this,b)},initComponent:function(){RL.Quote.WizardBase.superclass.initComponent.call(this);if(this.destCode){this.tabsTitle=this.getResortRecord(this.destCode).get("RESORT#RESORT")}this.on("beforetabchange",this.onBeforeTabChange,this);this.on("tabchange",this.onAfterTabChange,this);this.on("after-service-add",this.afterServiceAdd,this);this.on("destination-changed",this.onDestinationChange,this,{delay:100});this.fireEvent("destination-banner-hidden",this)},onRender:function(c,b){this.elements="body,header";if(!c.getWidth()){var f=Number(Ext.jx.getStoreValue("#N_MARGIN_LEFT_OF_QUOTE"));f=f>0?f:270;this.width=RL.Global.getWindowSize().width-f}RL.Quote.WizardBase.superclass.onRender.call(this,c,b);if(this.isMulti){var e=this.header.child(".x-tab-strip-wrap");e.insertFirst({tag:"div",cls:"rl-quotewizard-dest-banner",html:this.destCode?this.getResortRecord(this.destCode).get("RESORT#TOPBANNER"):undefined})}},afterServiceAdd:function(){this.onNextStep();return false},onDestinationChange:function(b){this.updateQuoteSteps(b)},onNextStep:function(c){if(c==null){c=this.items.indexOf(this.getActiveTab())}if(c+1>=this.items.getCount()){var b=RL.Global.getWizard(this,true);if(b){this.fireEvent("wizard-leave",this);b.onNextStep()}else{this.getActiveTab().fireEvent("deactivate");this.fireEvent("quote-finalize")}}else{this.activate(c+1)}},onBeforeTabChange:function(e,j,h){var c;if(!h){c=true}if(typeof c=="undefined"){if(this.items.indexOf(h)==0){var f=h.validate();if(f===false){Ext.Msg.show({title:l("Warning"),msg:l("Please fill all the required fields (marked with red) to continue"),buttons:Ext.Msg.OK,icon:Ext.MessageBox.WARNING})}c=f}}if(c===false){}else{if(Ext.isIE6||Ext.isIE7){Ext.jx.mask(Ext.getBody(),l("Preparing your screen..."),"rl-mask-medium",true);Ext.jx.unmask.defer(100,undefined,[Ext.getBody()])}}return c},onAfterTabChange:function(c,f){if(this.initialTabChange){this.initialTabChange=false;return}var e={screen:"scnWizardSteps"};if(this.items.indexOf(f)==0||f.productCode=="---"){e.step=this.items.indexOf(f)+1}else{e.producttype=f.productCode}if(RL.Global.getTripType()!="multi"){var b=RL.Global.getSegmentStartValuesAll()[0];if(b.startdate){e.startdate=Ext.jx.getDBDate(b.startdate)}if(b.enddate){e.enddate=Ext.jx.getDBDate(b.enddate)}if(b.dest){e.dest=b.dest}if(b.dest){e.adults=b.adults}if(b.dest){e.children=b.children}}RL.Global.viewport.saveHistoryToken(e)},getResortRecord:function(c){if(c){this.destCode=c}var b=Ext.jx.getStore("RESORT");this.resortRecord=this.destCode?b.getAt(b.find("RESORT#SEARCHCODE",this.destCode)):Ext.jx.getStore("GTAW").getAt(0).getResortRecord();return this.resortRecord},updateBanner:function(b){var e=this.getResortRecord();var f=e&&!b?e.get("RESORT#TOPBANNER"):"";if(this.siblingSlots&&this.siblingSlots.northDestBanner){this.siblingSlots.northDestBanner.removeAll();if(this.isMulti||b){this.siblingSlots.northDestBanner.hide()}else{this.siblingSlots.northDestBanner.add({xtype:"container",html:f});this.siblingSlots.northDestBanner.show()}if(this.rendered){this.siblingSlots.northDestBanner.ownerCt.doLayout()}}if(this.rendered){var c=this.header.child(".rl-quotewizard-dest-banner");if(c){c.update(f)}}if(!this.isMulti){this.fireEvent("destination-banner-updated",this,"starter",e)}},updateQuoteSteps:function(h){var f=this.getResortRecord(h);if(!f){return}if(Ext.jx.getStoreValue("DEPT#DESTBANNER")){this.updateBanner()}else{if(!this.isMulti){this.fireEvent("destination-banner-updated",this,"starter",f)}}this.keepFirstTab?this.removeRange(1):this.removeRange();var c=RL.Global.getSegmentStartValuesAll();var k=this.isMulti;var b=[];var j=Ext.jx.getTable("PRODGRP").Funcs.getNonEmptyGroups();Ext.each(j,function(m){var n=new RL.PriceSearch.ProductGroup({title:m.data["PRODGRP#PGDESC"],recordProdGroup:m,productCode:"---",compactSearch:RL.Defaults.COMPACT_PRICESEARCH,quote:this.quote,n_dest:this.n_dest,destCode:this.destCode,baseCls:"x-bubble",frame:true,wizard:this});b.push({form:n,ORDER:m.data["PRODGRP#LINERANGE"]})},this);var e=f.get_products(true);Ext.each(e,function(m){if(k&&Ext.jx.getStoreValue("DEPT#CONMULTINS")==1&&m.data["SERVICE#CODE"]=="IN"){return}if(m.isGDSAir()&&(k||!c[0].usesAir)){return}b.push({form:this.getProductTypeStep(m),ORDER:m.data["SERVICE#LINERANGE"]})},this);b=b.sort(function(n,m){return n.ORDER-m.ORDER});Ext.jx.each(b,function(n){var m=(this.items.items.length+1);n.form.title=(Ext.jx.getStoreValue("#B_YES_TRIP_QUOTE_NUMBERS")=="1"?m+".":"")+n.form.title;var p=this.add(n.form);n.ownerCt=this},this);RL.Global.getVendors(f)},getProductTypeStep:function(f,c){if(typeof f=="string"){var e=Ext.jx.getStore("SERVICE");f=e.data.map["SERVICE#CODE="+f]}if(!f){return}var b=f.isGDSAir()?RL.PriceSearch.Air:RL.PriceSearch.Service;return new b(Ext.apply({recordProduct:f,title:f.data["SERVICE#DESCRIP"],productCode:f.get("SERVICE#CODE"),compactSearch:RL.Defaults.COMPACT_PRICESEARCH,quote:this.quote,n_dest:this.n_dest,destCode:this.destCode,baseCls:"x-bubble",frame:true,wizard:this},c))},addServiceItem:function(c,b){return this.quote.addServiceItem(c,b,this.n_dest,this.destCode)}});Ext.ns("RL.Quote");RL.Quote.Wizard=Ext.extend(RL.Quote.WizardBase,{slots:true,keepFirstTab:true,activeTab:0,quoteMode:null,triptype:null,constructor:function(e){e=e||{};var b=e.producttype;var f=e.initialStep;if(f&&!b&&f!=1&&Number(Ext.jx.getStoreValue("DEPT#CONUSEAIR"))!=0){Ext.jx.setStoreValue("DEPT#CONUSEAIR",2)}var c=[];if(RL.Global.displayStartStep()){c.push({xtype:"quote_wizard_start",slot:"start",quoteMode:e.quoteMode,initialDestCode:e.initialDestCode,startdate:e.startdate,enddate:e.enddate})}Ext.apply(e,{items:c});RL.Quote.Wizard.superclass.constructor.call(this,e)},initComponent:function(){RL.Quote.Wizard.superclass.initComponent.apply(this,arguments);this.on("triptype-changed",this.switchType,this);this.on("quote-changed",this.onQuoteChanged,this);this.onQuoteChanged();this.on("destination-banner-updated",this.onBannerUpdated,this)},onBannerUpdated:function(){if(this.quoteMode!="single"){return false}},configure:function(e){Ext.apply(this,e);var b=this.producttype;var k=this.initialStep;var h=this.slots.start;if(!h){var j=RL.Global.getDefaultTripConfig();if(!e.initialDestCode){e.initialDestCode=j.dest}if(!e.startdate){e.startdate=j.startdate}if(!e.enddate){e.enddate=j.dest}}if(k||b||!h){if(h){h.configure(e)}this.destCode=e.initialDestCode;this.updateQuoteSteps();if(this.items.getCount()>1){if(b){this.items.each(function(c){if(!c.recordProduct){return}if(c.recordProduct.get("SERVICE#CODE")==b){this.activeTab=c;return false}},this)}else{if(!k){k=1}this.activeTab=this.items.itemAt((Number(k)-1).constrain(0,1000000))}if(this.activeTab){this.activeTab.vendor=this.vendor}else{Ext.jx.debug("RL.Quote.Wizard::configure this.activeTab is empty")}}}var f;if(this.slots.start&&(f=this.slots.start.slots.singleSelector)){if(e.startdate&&f.slots.startdate){f.slots.startdate.value=e.startdate}if(e.enddate&&f.slots.enddate){f.slots.enddate.value=e.enddate}}},onQuoteChanged:function(){if(this.triptype=="single"){this.destCode=Ext.jx.getStore("GTAW").getAt(0).get("GTAW#RESORT")}},onBeforeTabChange:function(c,h,f){var b=RL.Quote.Wizard.superclass.onBeforeTabChange.apply(this,arguments);if(b===false||this.triptype=="single"){return b}if(this.triptype=="multi"){var e=1;if(f instanceof RL.Quote.WizardBase){this.fireEvent.defer(100,this,["wizard-leave",f]);e=500}if(h instanceof RL.Quote.WizardBase){this.fireEvent.defer(e,this,["wizard-enter",h])}}},updateQuoteSteps:function(){if(RL.Global.getTripType()==="single"){RL.Quote.Wizard.superclass.updateQuoteSteps.call(this);return}this.removeRange(1);var c=RL.Global.getSegmentStartValuesAll();if(c.length&&c[0].usesAir){var h=this.getProductTypeStep("AB",{useTripDates:true});if(h){var b=(this.items.items.length+1);h.title=(Ext.jx.getStoreValue("#B_YES_TRIP_QUOTE_NUMBERS")=="1"?b+".":"")+h.title;this.add(h)}}for(var e=0;e<c.length;e++){var k=c[e];var f=new RL.Quote.WizardBase({n_dest:e,destCode:k.dest,quote:this.quote,isMulti:true});var j=f.getResortRecord();var b=(this.items.items.length+1);f.title=(Ext.jx.getStoreValue("#B_YES_TRIP_QUOTE_NUMBERS")=="1"?b+".":"")+j.get("RESORT#RESORT");f.title=(this.items.items.length+1)+"."+j.get("RESORT#RESORT");f.updateQuoteSteps();f.activeTab=0;this.add(f)}if(c.length&&Ext.jx.getStoreValue("DEPT#CONMULTINS")==1){var h=this.getProductTypeStep("IN",{useTripDates:true});if(h){var b=(this.items.items.length+1);h.title=(Ext.jx.getStoreValue("#B_YES_TRIP_QUOTE_NUMBERS")=="1"?b+".":"")+h.title;this.add(h)}}},switchType:function(b){this.triptype=b;if(RL.Global.getTripType()=="multi"){this.updateBanner(true)}this.updateQuoteSteps()}});Ext.reg("quote_wizard",RL.Quote.Wizard);Ext.ns("RL.Quote.Wizard");RL.Quote.Wizard.Start=Ext.extend(Ext.Container,{slots:true,baseCls:"x-bubble",frame:true,autoWidth:true,autoHeight:true,bodyStyle:{padding:"20px"},quoteMode:null,initialDestCode:null,startdate:null,enddate:null,ignoreTripTypeChange:false,constructor:function(c){c=c||{};var b={};b.single={layout:"row-fit",items:[{xtype:"container",autoHeight:true,layout:"column",items:[{xtype:"single_dest",slot:"singleSelector",initialDestCode:c.initialDestCode,startdate:c.startdate,enddate:c.enddate,autoHeight:true,width:435},{columnWidth:1,style:{padding:"10px",margin:"10px"},border:false,html:Ext.jx.getStoreValue("DEPT#CONSTART")}]},{xtype:"container",slot:"resortInfo",autoHeight:true}]};b.multi={layout:"fit",items:[{xtype:"multi_dest",slot:"multiSelector"}]};b.both={items:[{xtype:"radiogroup",slot:"tripTypeBtn",autoHeight:true,style:{margin:"20px"},hideLabel:true,columns:1,defaults:{name:"triptype"},items:[{boxLabel:l("Single Destination"),inputValue:"single",triptype:"single",checked:RL.Global.getTripType()=="single",listeners:{check:this.onCheckSwitchType,scope:this}},{boxLabel:l("Multiple Destinations"),inputValue:"multi",triptype:"multi",checked:RL.Global.getTripType()=="multi",listeners:{check:this.onCheckSwitchType,scope:this}}]},{xtype:"container",slot:"triptype",autoHeight:true,layout:"card",activeItem:RL.Global.getTripType()=="single"?0:1,items:[{xtype:"container",slot:"single",slots:true,autoHeight:true,items:[{xtype:"container",autoHeight:true,layout:"column",items:[{xtype:"single_dest",slot:"selector",width:430,destCode:c.destCode,startdate:c.startdate,enddate:c.enddate},{border:false,html:Ext.jx.getStoreValue("DEPT#CONSTART"),style:{padding:"10px",margin:"10px"},width:400}]},{xtype:"container",slot:"resortInfo",autoHeight:true}]},{xtype:"container",slot:"multi",slots:true,items:[{xtype:"multi_dest",slot:"selector",autoHeight:true},{border:false,html:Ext.jx.getStoreValue("DEPT#CONSTART"),style:{padding:"10px",margin:"10px"},columnWidth:1}],autoHeight:true}]}]};var e=c.quoteMode;b[e].title=(Ext.jx.getStoreValue("#B_YES_TRIP_QUOTE_NUMBERS")=="1"?"1.":"")+l("Start");Ext.apply(c,b[e]);this.addEvents("triptype-changed");this.enableBubble("triptype-changed");RL.Quote.Wizard.Start.superclass.constructor.call(this,c)},initComponent:function(){RL.Quote.Wizard.Start.superclass.initComponent.call(this);this.on("destination-changed",this.onDestinationChanged,this)},configure:function(b){this.getTripStartContainer().configure(b)},getTripStartContainer:function(){var b;if(this.quoteMode!="both"){b=this.slots[this.quoteMode+"Selector"]}else{b=this.slots.triptype.items.itemAt(RL.Global.getTripType()=="single"?0:1).slots.selector}return b},onDestinationChanged:function(b){this.updateInlineContent(b)},onCheckSwitchType:function(e,b){if(b&&!this.ignoreTripTypeChange){var c=Ext.jx.getStore("BUILD").getCount();var h=e.triptype;var f=function(j){if(j=="yes"){this.slots.triptype.getLayout().setActiveItem(this.slots[h]);RL.Global.triptype=h;if(c){RL.Global.startQuoteOver()}else{this.fireEvent("triptype-changed",h)}}else{this.ignoreTripTypeChange=true;this.slots.tripTypeBtn.setValue(h=="single"?"multi":"single")}};if(c){Ext.Msg.show({title:l("Warning"),msg:l("Switching between trip types will clear existing quote. Are you sure you want to continue?"),buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.WARNING,fn:f,scope:this})}else{f.call(this,"yes")}}this.ignoreTripTypeChange=false},validate:function(){if(this.slots.triptype){return this.slots.triptype.layout.activeItem.validate()}return RL.Quote.Wizard.Start.superclass.validate.call(this)},getResortInfo:function(){if(!this.slots.triptype){return this.slots.resortInfo}else{return this.slots.single.slots.resortInfo}},updateInlineContent:function(c){var b=Ext.jx.getStore("RESORT").data.map["RESORT#SEARCHCODE="+c];var e=this.getResortInfo();e.removeAll();if(b){var f={xtype:"dest_content",destRecord:b,noPanPanels:true,autoHeight:true,autoWidth:true};if(Ext.isIE6||Ext.isIE7){f.width=800}e.add(f)}if(e.el){e.doLayout()}}});Ext.reg("quote_wizard_start",RL.Quote.Wizard.Start);Ext.ns("RL.Quote.Wizard.Start");RL.Quote.Wizard.Start.Single=Ext.extend(Ext.Panel,{slots:true,border:false,layout:"row-fit",bodyStyle:{"overflow-y":"auto","overflow-x":"hidden","padding-left":"20px"},initialDestCode:null,startdate:null,enddate:null,constructor:function(b){var h={xtype:"container"};var f=RL.Global.getDefaultDestCode()||b.initialDestCode;if(f){Ext.jx.setStoreValue("GTAW#RESORT",f)}else{h={xtype:"form",style:"padding-bottom : 20px; ",autoWidth:true,layout:"column",baseCls:"x-frameless",labelAlign:"top",fieldLabel:l("Destination"),items:[{xtype:"choose_resort_intell",slot:"resortCombo",allowBlank:false,name:"GTAW#RESORT",listeners:{change:this.onChangeResortField,scope:this}},{xtype:"container_spacer",width:10},{xtype:"button",slot:"dest_moreinfo",text:l("more info"),iconCls:"moreinfo-btn",scale:"small",iconAlign:"left",moreInfoImg:true,handler:this.onDestMoreInfo,scope:this}]}}var e=Ext.jx.getRecord({tableName:"DEPT"});var c=Ext.jx.getStore("GTAW").getAt(0);Ext.apply(b,{items:[{xtype:"fieldset",autoHeight:true,autoWidth:true,labelWidth:75,style:{border:0,padding:"30px 0 0 0"},hideBorders:true,items:[].concat(h,Number(Ext.jx.getStoreValue("DEPT#CONUSEAIR"))==0?[]:{xtype:"air_question",slot:"airQuestion",fromField:{listeners:{change:this.onChangeField,scope:this}},toField:{listeners:{change:this.onChangeField,scope:this}}},Ext.jx.getStoreValue("DEPT#CONNODATES")==1?[]:Ext.jx.getStoreValue("DEPT#FSZDTPCKR")==1?{layout:"column",style:"padding-bottom : 30px",hideBorders:true,items:[{xtype:"panel",title:l("Start Date"),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeStart.DatePicker.WithCombo",slot:"startdate",name:"GTAW#DDATE",value:c.get("GTAW#DDATE"),range:e.getQuotingRange_Start(),endFieldSiblingSlot:"enddate",listeners:{"date-selected":this.onChangeField,scope:this}}]},{xtype:"container",width:20,html:"&nbsp;"},{xtype:"panel",title:l("End Date"),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo",slot:"enddate",value:c.get("GTAW#RDATE"),minNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMIN"))||0,maxNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMAX"))||20,range:e.getQuotingRange_End(),name:"GTAW#RDATE",listeners:{"date-selected":this.onChangeField,scope:this}}]}]}:{xtype:"daterange",labelWidth:75,startDateFieldName:"GTAW#DDATE",endDateFieldName:"GTAW#RDATE",startDateField:{slot:"startdate",listeners:{change:this.onChangeDateField,scope:this}},endDateField:{slot:"enddate",listeners:{change:this.onChangeDateField,scope:this}}},{xtype:"perperson_selector",name:"GTAW#ADULT",slot:"adults",fieldLabel:Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?l("No. Passengers"):l("No. Adults"),allowBlank:false,value:Ext.jx.getStoreValue("DEPT#TQNOADL"),listeners:{blur:this.onChangeField,spin:this.onChangeField,scope:this}},Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?[]:{xtype:"perperson_selector",name:"GTAW#CHILD",slot:"children",fieldLabel:l("No. Children"),allowBlank:true,listeners:{blur:this.onChangeField,spin:this.onChangeField,scope:this}},Ext.jx.getStoreValue("DEPT#CONHIDECUR")==1?[]:{xtype:"RL.FieldTypes.CurrencyPopup",name:"GTAW#CADCURR",style:"padding-top : 20px",listeners:{"currency-changed":this.onChangeCurrency,scope:this}})},{xtype:"buttongroup",slot:"toolbar",bodyStyle:"padding-bottom : 10px",columns:2,autoWidth:true,autoHeight:true,baseCls:"x-frameless",items:[{xtype:"button",text:l("Next Step"),iconCls:"new-quote-btn",scale:"large",iconAlign:"left",handler:this.onNewQuote,scope:this,style:{margin:"0 0 0 90px"}}]}]});this.addEvents("quote-changed","destination-changed","destination-banner-updated");this.enableBubble("quote-changed","destination-changed","destination-banner-updated");RL.Quote.Wizard.Start.Single.superclass.constructor.call(this,b);this.on("destination-changed",this.onDestinationChanged,this)},configure:function(b){var c=this.slots;if(b.startdate&&this.slots.startdate){c.startdate.setValue(Ext.jx.cleanDate(b.startdate))}if(b.enddate&&this.slots.enddate){c.enddate.setValue(Ext.jx.cleanDate(b.enddate))}if(b.adults&&c.adults){c.adults.setValue(b.adults)}if(b.children&&c.children){c.children.setValue(b.children)}if(c.resortCombo&&b.initialDestCode){c.resortCombo.setValue(b.initialDestCode);Ext.jx.setStoreValue("GTAW#RESORT",b.initialDestCode)}},onDestinationChanged:function(c){var b=this.slots.airQuestion;if(b){b.updateAirportByDest(c)}},onNewQuote:function(){var b=Ext.jx.getStore("GTAW").getAt(0);if(!b.data["GTAW#RESORT"]){Ext.Msg.alert("Note","Choose a destination and then click this button.")}else{RL.Global.getWizard(this).onNextStep()}},onDestMoreInfo:function(){var b=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(this.getDestCode());if(b){if(Ext.jx.getStoreValue("DEPT#DSTCNTINLN")){RL.Global.showContent(RL.Global.getWizard(this),"dest",b,"Pictures")}else{RL.Global.dispatch({screen:"scnDestHome",dest:b.getCode()},{addHistory:1})}}else{Ext.Msg.alert("Note","Choose a destination and then click this button for more information.")}},saveFieldUpdate:function(c){var b=Ext.jx.getStore("GTAW").getAt(0);b.set(c.name,c.getValue())},onChangeCurrency:function(c,b){RL.Global.setCurrency(b)},onChangeField:function(b){this.saveFieldUpdate(b);if(b.name==="GTAW#ADULT"||b.name==="GTAW#CHILD"){this.fireEvent("quote-changed")}},getQuoteVars:function(){var c={};Ext.each(["startdate","enddate","adults","children","currency"],function(e){if(this.slots[e]){c[e]=this.slots[e].getValue()}},this);if(c.startdate&&c.enddate){c.startdate=c.startdate.format("m/d/Y");c.enddate=c.enddate.format("m/d/Y")}else{var b=RL.Global.getDefaultDates();c.startdate=b.startDate;c.enddate=b.endDate}c.dest=this.getDestCode();return c},onChangeResortField:function(c,e,b){this.saveFieldUpdate(c);if(b&&Ext.jx.getStore("BUILD").getCount()){this.checkQuoteRestart({dest:e},function(){c.setValue(b)});return}this.fireEvent("quote-changed");this.fireEvent("destination-changed",c.value)},onChangeDateField:function(c,h,b){this.saveFieldUpdate(c);if(b&&Ext.jx.getStore("BUILD").getCount()){var e={};var f=c.name=="GTAW#DDATE"?"startdate":"enddate";e[f]=h.format("m/d/Y");this.checkQuoteRestart(e,function(){c.setValue(b)})}},checkQuoteRestart:function(e,b){var c=Ext.jx.getStore("BUILD").getCount();if(!c){RL.Global.startQuoteOver(Ext.apply(this.getQuoteVars(),e));return}Ext.Msg.show({title:l("Warning"),msg:l("This action will cause you to start your quote over. Are you sure that you would like to change this field?"),buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.WARNING,scope:this,fn:function(f){if(f=="yes"){RL.Global.startQuoteOver(Ext.apply(this.getQuoteVars(),e))}else{if(b){b.call(this)}}}})},getDestCode:function(){var b=(this.slots.resortCombo&&this.slots.resortCombo.getValue())||RL.Global.getDefaultDestCode();return b},afterRender:function(){RL.Quote.Wizard.Start.Single.superclass.afterRender.call(this);var b=this.getDestCode();if(b){this.fireEvent("destination-changed",b)}}});Ext.reg("single_dest",RL.Quote.Wizard.Start.Single);Ext.ns("RL.Quote.Wizard.Start");RL.Quote.Wizard.Start.Multi=Ext.extend(Ext.Panel,{slots:true,constructor:function(b){Ext.apply(b,{border:false,autoHeight:true,bodyStyle:{padding:"10px"},layout:"form",items:[{slot:"dest_group",xtype:"dest_group"},{xtype:"container",height:10},Number(Ext.jx.getStoreValue("DEPT#CONUSEAIR"))==0?{hidden:true}:{xtype:"air_question"},{xtype:"container",height:5},{xtype:"perperson_selector",slot:"adults",name:"GTAW#ADULT",fieldLabel:Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?l("No. Passengers"):l("No. Adults"),allowBlank:false,value:Ext.jx.getStoreValue("DEPT#TQNOADL"),listeners:{blur:this.onChangeField,spin:this.onChangeField,scope:this}},Ext.jx.getStoreValue("DEPT#CONNOCHILD")==1?{hidden:true}:{xtype:"perperson_selector",slot:"children",fieldLabel:l("No. Children"),name:"GTAW#CHILD",listeners:{blur:this.onChangeField,spin:this.onChangeField,scope:this}},Ext.jx.getStoreValue("DEPT#CONHIDECUR")==1?{hidden:true}:{xtype:"currency",fieldLabel:l("Currency"),name:"GTAW#CADCURR",allowBlank:true,listeners:{change:this.onChangeField,scope:this}},{xtype:"container",height:15},{xtype:"toolbar",slot:"toolbar",height:45,items:[{scale:"large",iconCls:"new-quote-btn",text:l("Next Step"),handler:this.onNewQuote,scope:this}]}]});this.addEvents("quote-changed");this.enableBubble("quote-changed");RL.Quote.Wizard.Start.Multi.superclass.constructor.call(this,b)},configure:function(b){if(b.adults&&this.slots.adults){this.slots.adults.setValue(b.adults)}if(b.children&&this.slots.children){this.slots.children.setValue(b.children)}this.slots.dest_group.configure(b)},onNewQuote:function(){RL.Global.getWizard(this).onNextStep()},onChangeField:function(c){var b=Ext.jx.getStore("GTAW").getAt(0);b.set(c.name,c.getValue());if(c.name==="GTAW#CADCURR"){RL.Global.getCurrency()}this.fireEvent("quote-changed")}});Ext.reg("multi_dest",RL.Quote.Wizard.Start.Multi);Ext.ns("RL.Quote.Wizard.Start");RL.Quote.Wizard.Start.AirQuestion=Ext.extend(Ext.Panel,{slots:true,border:false,autoHeight:true,width:300,layout:"form",bodyStyle:{padding:"10px"},constructor:function(b){if(!b.fromField){b.fromField={}}var c=(Ext.jx.getStoreValue("DEPT#CONUSEAIR")==1||Ext.jx.getStoreValue("DEPT#CONUSEAIR")==0);Ext.applyIf(b.fromField,{xtype:"airport",slot:"from_airport",allowBlank:c,name:"#FROM_AIRPORT",emptyText:l("Outgoing airport"),fieldLabel:l("Leaving from")});if(!b.toField){b.toField={}}Ext.applyIf(b.toField,{xtype:"airport",slot:"to_airport",allowBlank:c,name:"#TO_AIRPORT",emptyText:l("Destination airport"),fieldLabel:l("Going to")});Ext.apply(b,{items:[{xtype:"fieldset",slot:"fieldset",title:"<nobr>"+l("Would you like to see flights?")+"</nobr>",checkboxToggle:true,checkboxName:"#AIR_OPTION",onCheckClick:this.airTypeChanged.createDelegate(this),collapsed:c,animCollapse:false,items:[b.fromField,b.toField]}]});delete b.fromField;delete b.toField;RL.Quote.Wizard.Start.AirQuestion.superclass.constructor.call(this,b)},updateAirportByDest:function(f){var e=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(f);if(!e){return}var c=this.slots;var b=c.from_airport;c.to_airport.setValue(e.get("RESORT#PREFDCITY"));if(!b.getValue()){b.setValue(RL.Global.getMostNearbyAirport())}},airTypeChanged:function(){var b=this.slots;b.fieldset.toggleCollapse();if(b.fieldset.collapsed){b.from_airport.allowBlank=true;b.to_airport.allowBlank=true}else{b.from_airport.allowBlank=false;b.to_airport.allowBlank=false}(function(){RL.Global.getWizard(this).updateQuoteSteps()}).defer(100,this)}});Ext.reg("air_question",RL.Quote.Wizard.Start.AirQuestion);Ext.ns("RL.Quote.Wizard.Start.Multi");RL.Quote.Wizard.Start.Multi.DestRow=Ext.extend(Ext.Container,{slots:true,required:false,initComponent:function(){var c=Ext.jx.getRecord({tableName:"DEPT"});var b=Ext.jx.getStore("GTAW").getAt(0);Ext.apply(this,{defaults:{border:false},layout:"column",height:70,items:[{xtype:"panel",title:l("Destination"),headerCssClass:"rl-blue-on-white",layout:"column",items:[{xtype:"choose_resort_intell",slot:"combo",name:"GTAW#RESORT",allowBlank:!this.required,emptyText:l("Destination"),listeners:{change:this.onDestChange,scope:this}},{xtype:"container_spacer",width:5,html:"&nbsp;"},{xtype:"button",slot:"dest_moreinfo",disabled:true,iconCls:"moreinfo-btn",handler:this.onDestMoreInfo,moreInfoImg:true,scope:this}]},{xtype:"container_spacer",width:20,html:"&nbsp;"},Ext.jx.getStoreValue("DEPT#CONNODATES")==1?{}:{layout:"column",style:"padding-bottom : 10px",width:440,hideBorders:true,items:[{xtype:"panel",title:l("Start Date"),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeStart.Combo.WithDatePicker",slot:"startdate",name:"GTAW#DDATE",value:b.get("GTAW#DDATE"),range:c.getQuotingRange_Start(),endFieldSiblingSlot:"enddate",listeners:{scope:this}}]},{xtype:"container",width:10,html:"&nbsp;"},{xtype:"panel",title:l("End Date"),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeEnd.Combo.WithDatePicker",slot:"enddate",value:b.get("GTAW#RDATE"),minNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMIN"))||0,maxNights:Number(Ext.jx.getStoreValue("DEPT#TQDAYSMAX"))||20,range:c.getQuotingRange_End(),name:"GTAW#RDATE",listeners:{"date-selected":function(e){this.getDestGroup().onChange_childEndDate(this)},scope:this}}]}]},{xtype:"container_spacer",width:5,html:"&nbsp;"},{width:70,html:"<a class=rl-remove-dest-link href=#>"+l("Remove")+"</a>",style:{"line-height":"22px","padding-top":"27px"},cls:"x-form-item"}]});RL.Quote.Wizard.Start.Multi.DestRow.superclass.initComponent.call(this)},onClick:function(c){var b=c.getTarget(".rl-remove-dest-link");if(b){c.preventDefault();this.getDestGroup().removeDest(this)}},onRender:function(){RL.Quote.Wizard.Start.Multi.DestRow.superclass.onRender.apply(this,arguments);this.el.on("click",this.onClick,this)},configure:function(e){if(e.startdate&&this.slots.startdate){var c=Ext.jx.cleanDate(e.startdate);this.slots.startdate.setValue(c)}if(e.enddate&&this.slots.enddate){var b=Ext.jx.cleanDate(e.enddate);this.slots.enddate.setValue(b)}if(e.initialDestCode){this.slots.combo.setValue(e.initialDestCode)}},getDestGroup:function(){return this.findParentBy(function(b){return b.onChange_childDest})},onDestMoreInfo:function(b){if(b.dest){RL.Global.showContent(RL.Global.getWizard(this),"dest",b.dest,"Pictures")}else{Ext.Msg.alert("Note","Choose a destination and then click this button for more information.")}},onDestChange:function(b){var e=this.findBy(function(f){return f.moreInfoImg})[0];e.dest=b.value;var c=this.slots;c.startdate.enable();c.enddate.enable();c.dest_moreinfo.enable();this.getDestGroup().onChange_childDest(this)},validate:function(){if(!this.required){return true}return RL.Quote.Wizard.Start.Multi.DestRow.superclass.validate.call(this)}});Ext.reg("dest_row",RL.Quote.Wizard.Start.Multi.DestRow);Ext.ns("RL.Quote.Wizard.Start.Multi");RL.Quote.Wizard.Start.Multi.DestGroup=Ext.extend(Ext.Container,{slots:true,constructor:function(b){Ext.apply(b,{autoHeight:true,items:[{xtype:"dest_row",slot:"firstRow",required:true}]});RL.Quote.Wizard.Start.Multi.DestGroup.superclass.constructor.call(this,b)},configure:function(b){this.slots.firstRow.configure(b);if(b.initialDestCode){this.addDest()}},onChange_childDest:function(f){var e=this.findByType("dest_row");var j=this.items.indexOf(f);if(j==0){RL.Global.updateAirportByDest(f.getValues()["GTAW#RESORT"])}var b=e.length;if(j+1==b){if(j>0){var c=f.getValues();if(!c["GTAW#DDATE"]){var h=this.items.items[j-1];this.onChange_childEndDate(h,true)}}this.addDest()}RL.Global.getWizard(this).updateQuoteSteps()},onChange_childEndDate:function(f,h){var e=this.findByType("dest_row");var c=f.getValues();if(c["GTAW#RDATE"]){var j=this.items.indexOf(f);var b=e.length;if(h||j+2<b){this.items.items[j+1].setValues({"GTAW#DDATE":c["GTAW#RDATE"]})}}},addDest:function(){var b=new RL.Quote.Wizard.Start.Multi.DestRow({xtype:"dest_row",height:this.rendered?70:0});this.add(b);if(this.rendered){this.doLayout();b.el.setHeight(70,{})}},removeDest:function(e){var c=this.findByType("dest_row");var f=this.items.indexOf(e);var b=c.length;if(f>0&&b>2){RL.Global.updateAirportByDest(this.items.items[1].getValues()["GTAW#RESORT"])}if(f+1!=b){e.el.setHeight(0,{callback:function(){this.remove(e);if(f){var h=this.items.items[f-1];this.onChange_childEndDate(h)}RL.Global.getWizard(this).updateQuoteSteps()},scope:this})}else{if(b==1){Ext.Msg.alert(b("Note"),b("You must specify at least one destination."))}else{Ext.Msg.alert(b("Note"),b("There is no reason to delete this destination. The last row is ignored."))}}},getName:function(){return"dest_group"},getValue:function(){var b=[];this.items.items.each(function(e){b.push(e.getValues())});return b}});Ext.reg("dest_group",RL.Quote.Wizard.Start.Multi.DestGroup);Ext.ns("RL.Screen");RL.Screen.DestinationHome=Ext.extend(Ext.Panel,{slots:true,autoHeight:true,autoWidth:true,destinationRecord:null,specialRecord:null,producttype:null,productgroup:null,vendor:null,showDestinationSelector:true,beforeInitComponent:function(){var b=this.destinationRecord;var e=Ext.jx.getStoreValue("DEPT#DESTBANNER");var c=Ext.jx.getStoreValue("DEPT#DESTCONTTP")||"RL.Destination.Content.GroupTab";Ext.apply(this,{layout:"row-fit",bodyStyle:"background-color : #4E78B1",items:(e?[{xtype:"container",slot:"banner",html:b.get("RESORT#TOPBANNER"),autoHeight:true}]:[]).concat({xtype:c,slot:"content",destRecord:b,specialRecord:this.specialRecord,producttype:this.producttype,productgroup:this.productgroup,vendor:this.vendor,isFullScreen:true,noPanPanels:true,showDestName:!this.showDestinationSelector})});this.addEvents("destination-banner-updated");this.enableBubble("destination-banner-updated");RL.Global.viewport.setScreenTitle(b.get("RESORT#RESORT"),true)},initComponent:function(){this.beforeInitComponent();RL.Screen.DestinationHome.superclass.initComponent.call(this);var b=this.slots;this.on("afterlayout",this.ensureDestinationSelectorShown,this)},ensureDestinationSelectorShown:function(){if(this.showDestinationSelector){this.fireEvent("destination-banner-updated",this,"content",this.destinationRecord)}}});Ext.reg("RL.Screen.DestinationHome",RL.Screen.DestinationHome);Ext.ns("RL.Screen");RL.Screen.DestinationSelector=Ext.extend(Ext.Panel,{slots:true,tabsEnabled:null,mapHtml:null,supDesRegex:null,beforeInitComponent:function(){var c=this.tabsEnabled={simple:true,grouped:true,map:false};if(RL.Global.getSuperDests().length<2){delete c.grouped}if(Ext.jx.getStoreValue("DEPT#CONDESMAPH")){if(!Ext.jx.getStoreValue("DEPT#CONDESMAPR")){Ext.jx.setStoreValue("DEPT#CONDESMAPR","-superdest-(\\w\\w)-.htm")}c.map=true}var e=c.grouped?{xtype:"choose_resort_groupedview",slot:"grouped",height:500,detailsXtype:"RL.form.ChooseResortComboBox.Detail.Sliding",header:false,style:{margin:"5px"},masterViewConfig:{title:l("Regions")},listeners:{resort_chosen:this.onResortChosen,scope:this}}:{xtype:"choose_resort_simple",slot:"simple",header:false,listeners:{resort_chosen:this.onResortChosen,scope:this}};var b;if(c.map){b=new Ext.Container({layout:"columnfit",items:[{xtype:"choose_resort_mapview",slot:"map",title:l("Map View"),style:{margin:"5px"},bodyStyle:{"padding-top":"50px"},width:500,mapHtml:this.mapHtml||Ext.jx.getStoreValue("DEPT#CONDESMAPH"),supDesRegex:this.supDesRegexStr||Ext.jx.getStoreValue("DEPT#CONDESMAPR"),superDestOnlyReport:true,listeners:{super_dest_chosen:this.onMapSuperDestChosen,resort_chosen:this.onResortChosen,scope:this}},Ext.apply(e,{columnWidth:1})]})}else{b=e}Ext.apply(this,{header:false,border:false,layout:"fit",items:[b]})},initComponent:function(){this.beforeInitComponent();RL.Screen.DestinationSelector.superclass.initComponent.call(this);this.fireEvent("destination-banner-hidden",this);if(Ext.isIE6||Ext.isIE7){this.style="min-height:700px; height:700px;"}else{this.style="min-height:700px"}this.on("afterlayout",this.onAfterLayout,this,{single:true})},onAfterLayout:function(){if(this.superdest){var b=Ext.jx.getStore("SUPERDES"),c=b.query("SUPERDES#CODE",this.superdest).itemAt(0);this.superdest=undefined;this.onMapSuperDestChosen.defer(1000,this,[undefined,c])}},onMapSuperDestChosen:function(b,c){this.slots.grouped.switchToSuperDest(c)},onResortChosen:function(b,c){var e=c.get("RESORT#SEARCHCODE");RL.Global.viewport.dispatch({screen:"scnDestHome",dest:e},{addHistory:1})}});Ext.reg("RL.Screen.DestinationSelector",RL.Screen.DestinationSelector);Ext.ns("RL.Screen");RL.Screen.VendorHome=Ext.extend(Ext.Panel,{slots:true,vendorRecord:null,beforeInitComponent:function(){Ext.apply(this,{layout:"fit",items:[{xtype:"vendor_content",slot:"content",vendorRecord:this.vendorRecord}]})},initComponent:function(){this.beforeInitComponent();RL.Screen.VendorHome.superclass.initComponent.call(this);var b=this.slots}});Ext.reg("RL.Screen.VendorHome",RL.Screen.VendorHome);Ext.ns("RL.Screen");RL.Screen.Special=Ext.extend(Ext.Container,{slots:true,specialRecord:null,initComponent:function(){RL.Screen.Special.superclass.initComponent.call(this);var b=this.specialRecord;Ext.apply(this,{items:[{xtype:"RL.Special.Content",specialRecord:b}]})}});Ext.reg("RL.Screen.Special",RL.Screen.Special);Ext.ns("RL.Screen.SpecialSelector");RL.Screen.SpecialSelector.DataView=Ext.extend(Ext.Container,{slots:true,autoHeight:true,autoWidth:true,store:null,filterConditions:null,filterSpecialsStoreBy:null,beforeInitComponent:function(){var b=this.filterConditions={month:function(){return true},region:function(){return true},dest:function(){return true}};this.filterSpecialsStoreBy=function(j){return b.month(j)&&b.region(j)&&b.dest(j)};var e=Ext.jx.getStore("SPECIAL");var f=this.store=new Ext.ux.MultiGroupingStore({reader:new Ext.data.DataReader({},e.recordType)});e.each(function(k){var n=k.copy();var j=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(n.get("SPECIAL#RESORT"));if(j){var m=j.getSuperDestRecord();n.set("SUPERDES#NAME",m?m.get("SUPERDES#NAME"):"~~~~~~~~");n.set("SUPERDES#IRETEMPS",m?m.get("SUPERDES#IRETEMPS"):"~~~~~~~~")}f.add(n)});var c=Ext.jx.getStoreValue("DEPT#SPCLSORT")||"destination";var h=[];if(RL.Global.getDefaultDestCode()){if(c=="destination"){c="price"}}else{h.push(["region",l("Regions")]);h.push(["destination",l("Destinations")])}h.push(["price",l("Lowest Price")]);Ext.apply(this,{hideBorders:true,cls:"rl-white-background",items:[!Ext.jx.getStoreValue("DEPT#SPCLMSGDST")?{}:{xtype:"component",autoEl:"div",cls:"specials-message",style:"padding:10px",html:Ext.jx.getStoreValue("DEPT#SPCLMSGDST")},{xtype:"panel",slot:"center",autoHeight:true,autoWidth:true,border:true,title:l("Current Hot Deals"),style:"padding : 5px",tbar:new Ext.Toolbar({slots:true,items:[RL.Global.getDefaultDestCode()?"":[{xtype:"tbspacer",width:12},l("Sort by:")+" ",{xtype:"combo",slot:"sortCombo",editable:false,mode:"local",triggerAction:"all",width:130,emptyText:"",displayField:"text",valueField:"id",store:new Ext.data.ArrayStore({fields:["id","text"],idIndex:0,data:h}),value:c,listeners:{scope:this,select:this.onSortChange}},{xtype:"tbspacer",width:10},"->"],l("Filter by:")+" "]}),items:[{xtype:"RL.Special.DataView",slot:"dataview",cls:"rl-allspecials-dataview",transitionPlugin:ExtX.DataView.Transition.Grouped,pluginConfig:{groupConfig:{"SUPERDES#IRETEMPS":{titleCls:"rl-specials-groupseparator",getTitle:function(j){return j.get("SUPERDES#NAME")}},"SPECIAL#RESORT":{titleCls:"rl-specials-groupseparator",getTitle:function(j){var m=j.get("SUPERDES#NAME");var k=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(j.get("SPECIAL#RESORT"));if(k){return'<a class="rl-link" href="#screen=scnDestHome&dest='+k.getCode()+'">'+(m?m+" :: ":"")+k.get("RESORT#RESORT")+"</a>"}return"- "+l("No destination")+" -"}}}},showDestinationName:true,skipFirstLayout:true,duration:1000,interval:50,specials:f}]}]});this.addEvents("destination-banner-hidden");this.enableBubble("destination-banner-hidden")},initComponent:function(){this.beforeInitComponent();RL.Screen.SpecialSelector.DataView.superclass.initComponent.call(this);var c=this.slots.dataview;c.on("click",this.onSpecialChosen,this);var b=this.slots.center;c.on("afterlayout",this.setupDataView,this,{single:true,delay:10});this.on("afterlayout",this.hideDestinationBanner,this)},getSortToolbar:function(){return this.slots.center.getTopToolbar()},setupDataView:function(){if(RL.Global.getDefaultDestCode()){this.onSortChange(undefined,undefined,undefined,"price")}else{var b=this.slots.dataview;var c=this.getSortToolbar().slots.sortCombo;this.onSortChange(c,c.store.getById(c.getValue()))}},hideDestinationBanner:function(){this.fireEvent("destination-banner-hidden",this)},onSortChange:function(m,e,h,c){if(!c){c=e.get("id")}var f=this.store;f.suspendEvents();f.clearGrouping();f.clearFilter();this.filterConditions.month=function(){return true};this.filterConditions.region=function(){return true};this.filterConditions.dest=function(){return true};var b=this.slots.dataview;var j=this.getSortToolbar();var k=RL.Global.getDefaultDestCode();if(k){b.el.addClass("rl-specials-no-dest-name");b.el.addClass("rl-specials-no-region-name")}else{j.removeRange(6);b.el.removeClass("rl-specials-no-dest-name");b.el.addClass("rl-specials-no-region-name")}if(/region/i.test(c)){f.groupBy("SUPERDES#IRETEMPS");f.sort(["SUPERDES#IRETEMPS","SPECIAL#RESORT"],"ASC");if(!k){j.add(this.getRegionFilter(f));j.add({xtype:"tbspacer",width:10})}}else{if(/destination/i.test(c)){f.groupBy("SPECIAL#RESORT");f.sort(["SUPERDES#IRETEMPS","SPECIAL#RESORT"],"ASC");if(!k){b.el.addClass("rl-specials-no-dest-name");j.add(this.getDestinationFilter(f));j.add({xtype:"tbspacer",width:10})}}else{if(/price/i.test(c)){f.sort("SPECIAL#FROMPRICE","ASC");if(!k){b.el.removeClass("rl-specials-no-region-name")}}else{alert("Error: can not find the sort: "+c)}}}j.add(this.getMonthFilter(f));j.add({xtype:"tbspacer",width:15});j.doLayout();f.resumeEvents();f.fireEvent("datachanged",f)},onSpecialChosen:function(k,f,h){var j=h.id.replace(/ext-comp-\w+-(\w+)/,"$1");var e=this.store;var b=e.getAt(e.findExact("SPECIAL#CODE",j));var c=new RL.Special.Popup({specialRecord:b});c.show()},getRegionFilter:function(b){return{xtype:"combo",slot:"regionFilter",editable:false,mode:"local",triggerAction:"all",width:130,emptyText:l("Region"),displayField:"region",valueField:"id",store:new Ext.data.ArrayStore({fields:["id","region"],idIndex:0,data:this.getSpecialsRegions(b)}),listeners:{scope:this,select:this.onRegionFilter}}},getMonthFilter:function(b){return{xtype:"combo",slot:"monthFilter",editable:false,mode:"local",triggerAction:"all",width:100,emptyText:l("Month"),displayField:"date",valueField:"id",store:new Ext.data.ArrayStore({fields:["id","date"],idIndex:0,data:this.getValidMonths(b)}),listeners:{scope:this,select:this.onMonthFilter}}},getDestinationFilter:function(b){return{xtype:"combo",slot:"destinationFilter",editable:false,mode:"local",triggerAction:"all",width:210,emptyText:l("Destination"),displayField:"dest",valueField:"id",store:new Ext.data.ArrayStore({fields:["id","dest"],idIndex:0,data:this.getSpecialsDestinations(b)}),listeners:{scope:this,select:this.onDestinationFilter}}},onMonthFilter:function(e,b){var c=b.get("id");if(c!="--ALL--"){this.filterConditions.month=function(f){return f.getValidMonths()[c]}}else{this.filterConditions.month=function(f){return true};e.hasFocus=false;e.clearValue()}this.store.filterBy(this.filterSpecialsStoreBy)},onRegionFilter:function(e,c){var b=c.get("id");var f=c.get("region");this.resetMonthFilter();if(b!="--ALL--"){this.filterConditions.region=function(h){return h.get("SUPERDES#NAME")==f}}else{this.filterConditions.region=function(h){return true};e.hasFocus=false;e.clearValue()}this.store.filterBy(this.filterSpecialsStoreBy);this.reloadMonthFilter()},resetMonthFilter:function(){this.filterConditions.month=function(b){return true}},reloadMonthFilter:function(){var b=this.getSortToolbar().slots.monthFilter;b.clearValue();b.store.loadData(this.getValidMonths(this.store))},onDestinationFilter:function(e,b){var f=b.get("id");var c=b.get("dest");this.resetMonthFilter();if(f!="--ALL--"){this.filterConditions.dest=function(h){return h.get("SPECIAL#RESORT")==f}}else{this.filterConditions.dest=function(h){return true};e.hasFocus=false;e.clearValue()}this.store.filterBy(this.filterSpecialsStoreBy);this.reloadMonthFilter()},getSpecialsRegions:function(b){var e={};b.each(function(h){var f=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(h.get("SPECIAL#RESORT"));if(f){var j=f.getSuperDestRecord();if(j){e[j.get("SUPERDES#CODE")]=j.get("SUPERDES#NAME")}}});var c=[];Ext.jx.each(e,function(f,h){c.push([h,f])});c.unshift(["--ALL--"," - All -"]);return c},getSpecialsDestinations:function(c){var b={};c.each(function(h){var f=Ext.jx.getTable("RESORT").Funcs.getDestinationByCode(h.get("SPECIAL#RESORT"));if(f){var j=f.getSuperDestRecord();b[f.getCode()]=(j?j.get("SUPERDES#NAME")+" :: ":"")+f.get("RESORT#RESORT")}});var e=[];Ext.jx.each(b,function(f,h){e.push([h,f])});e.unshift(["--ALL--"," - "+l("All")+" -"]);return e},getValidMonths:function(c){var b={};c.each(function(j){j.getValidMonths(b)});var f=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMIN"));var h=Ext.jx.cleanDate(Ext.jx.getStoreValue("DEPT#TQDATEMAX"));if(!RL.Defaults.DEV_MODE&&f&&f<new Date()){f=new Date()}if(f){f=f.getFirstDateOfMonth()}if(h){h=h.getLastDateOfMonth()}var e=[];Ext.jx.each(b,function(k,j){if(!f||!h||(f<=j&&j<=h)){e.push([j,new Date(j-0).format("M - Y")])}});e.sort(function(k,j){return k[0]-j[0]});e.unshift(["--ALL--"," - "+l("All")+" -"]);return e}});Ext.reg("RL.Screen.SpecialSelector.DataView",RL.Screen.SpecialSelector.DataView);Ext.ns("RL.Screen");RL.Screen.Template=Ext.extend(Ext.Container,{jemplate:null,processedJemplate:null,renderedJemplate:null,data:null,border:false,border:false,autoHeight:true,autoWidth:true,cleanupTpl:function(){},onRender:function(){RL.Screen.Template.superclass.onRender.apply(this,arguments);this.renderJemplate()},getElBody:function(){return this.body||this.el},processJemplateRemote:function(b){if(b){Ext.apply(this,b)}if(this.hidden){this.getElBody().update("");delete this.processedJemplate;delete this.renderedJemplate;this.hide()}else{this.show();if(this.html){this.getElBody().update(this.html);delete this.processedJemplate;delete this.renderedJemplate}else{if(this.jemplate){this.renderJemplate(true)}}}},processJemplate:function(){if(this.processedJemplate==this.jemplate){return}this.processedJemplate=this.jemplate;if(!this.data){this.data={}}if(!this.data.o_table){this.data.o_table=Ext.jx.getRecord({tableName:"DEPT"})}if(RL.tplOptions&&RL.tplOptions.s_js_add){delete RL.tplOptions.s_js_add}this.jemplateRaw=Jemplate.process(this.jemplate,this.data);if(RL.tplOptions&&RL.tplOptions.s_css_add){this.jemplateRaw+="<style>"+RL.tplOptions.s_css_add+"</style>";delete RL.tplOptions.s_css_add}return},renderJemplate:function(skipPostProcessing){if(this.renderedJemplate==this.jemplate){return}this.renderedJemplate=this.jemplate;this.processJemplate();var updateJemplate=true;if(RL.tplOptions&&RL.tplOptions.b_requires_iframe&&!skipPostProcessing){var match=/(\w+)\/(\w+)\.HTML/i.exec(this.jemplate);if(match[1]&&match[2]){var server=Ext.jx.Server.getPrimary();var url=server+"?table_tpl="+match[1]+"&tpl="+match[2]+"&iframe_tpl=1&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO");this.iframe=this.add({xtype:"simple_iframe_panel",height:800,bodyStyle:{width:"97%"},src:url});this.doLayout();this.iframe.show();updateJemplate=false}delete RL.tplOptions.b_requires_iframe}if(updateJemplate){if(this.recycleBin){Ext.each(this.recycleBin,function(c){delete c})}this.recycleBin=[];this.getElBody().update(this.jemplateRaw);if(RL.tplOptions&&RL.tplOptions.s_js_add){var tempVar;try{eval("tempVar=function (){ "+RL.tplOptions.s_js_add+"}");tempVar()}catch(err){Ext.jx.log("RL.Screen.Template::processJemplate("+this.jemplate+"): Error on s_js_add: "+err.message)}delete RL.tplOptions.s_js_add}this.renderPopupMenus();this.getElBody().select(".rl-quote-bubble-placeholder").each(function(container){var params=Ext.decode(Ext.jx.String.reverseHTML(container.dom.textContent||container.dom.innerText));container.update("");Ext.ComponentMgr.create({xtype:"RL.Quote.Starter",baseCls:"x-panel",frame:false,border:false,style:"text-align : left",id:params.id,showStartMessage:false,hideStartButton:true,renderTo:container}).doLayout()},this);this.getElBody().select(".rl-tpl-showflash-placeholder").each(function(container){var config=Ext.decode(Ext.jx.String.reverseHTML(container.dom.textContent||container.dom.innerText));container.update("");Ext.apply(config,{xtype:"flash",baseCls:"x-panel",frame:false,border:false,renderTo:container});var comp=Ext.ComponentMgr.create(config)},this)}},renderPopupMenus:function(){this.getElBody().select("UL[extmenu]").each(function(f){if(!f.id){f.dom.id=f.id=Ext.id()}var e=Ext.get(f.id);if(!e){Ext.jx.log("could not get container id:"+f.id)}else{var j=f.getAttribute("linkid");var c=Ext.get(j);if(!c){Ext.jx.log("could not get menu link id:"+j)}else{var c=e.wrap(),h=c.dom.innerHTML;c.remove(true);Ext.getBody().select("#"+f.id).remove(true);Ext.getBody().insertHtml("beforeEnd",h);this.recycleBin.push(c);this.recycleBin.push(new Ext.ux.Menu(j,{ulId:f.id,direction:"vertical"}))}}},this)}});Ext.reg("RL.Screen.Template",RL.Screen.Template);Ext.ns("RL.Screen");RL.Screen.DestHome=Ext.extend(RL.Screen.Template,{slots:true,destRecord:null,jemplate:"RESORT/HOME",monitorResizeFunc:null,beforeInitComponent:function(){RL.Screen.DestHome.superclass.beforeInitComponent.call(this);this.data={o_table:this.destRecord};Ext.apply(this,{layout:"fit"})},afterRender:function(){RL.Screen.DestHome.superclass.afterRender.apply(this,arguments);var f=this.el.child(".rl-tpl-destination-content-tabpanel");var c=Ext.decode(Ext.jx.String.reverseHTML(f.dom.textContent||f.dom.innerText));f.update("");f.show();var b=this;var e=Ext.ComponentMgr.create(Ext.apply(c,{xtype:"RL.Destination.Content.Templated",width:f.getWidth(),destRecord:this.destRecord,getBubbleTarget:function(){return b},renderTo:f}));e.doLayout();this.monitorResizeFunc=function(){e.setWidth(f.getWidth());e.doLayout()};Ext.EventManager.onWindowResize(this.monitorResizeFunc,this)},destroy:function(){if(this.rendered){Ext.EventManager.removeResizeListener(this.monitorResizeFunc,this)}RL.Screen.DestHome.superclass.destroy.apply(this,arguments)}});Ext.reg("RL.Screen.DestHome",RL.Screen.DestHome);Ext.ns("RL.Special");RL.Special.TextLinks=Ext.extend(Ext.DataView,{destinationRecord:null,featuredOnly:false,beforeInitComponent:function(){Ext.apply(this,{itemSelector:"a.rl-special-link",overClass:"rl-special-link-hover",tpl:new Ext.XTemplate('<tpl for=".">','<div class="rl-special-link-wrapper"><a href="#special={SPECIAL#CODE}" class="rl-special-link">{SPECIAL#DESC}</a>',"</div>","</tpl>",'<div class="x-clear"></div>'),store:this.destinationRecord.getSpecials(this.featuredOnly)})},initComponent:function(){this.beforeInitComponent();RL.Special.TextLinks.superclass.initComponent.call(this);this.on("click",this.onNodeClick,this)},onNodeClick:function(e,f,j,h){h.stopEvent();var c=this.getRecord(j);var b=new RL.Special.Popup({specialRecord:c});b.show()}});Ext.reg("RL.Special.TextLinks",RL.Special.TextLinks);Ext.ns("RL.Special");RL.Special.Content=Ext.extend(Ext.Container,{slots:true,specialRecord:null,autoHeight:true,autoWidth:true,layout:"table",layoutConfig:{columns:3},defaults:{style:"margin:2px 10px 2px 10px",bodyStyle:"padding:2px 5px 2px 5px"},initComponent:function(){var c=this.specialRecord;var f=c.getResort();var b=c.getValidStartDateRange();var e=c.hasPriceCodes()&&!b.isEmpty();Ext.apply(this,{headerCssClass:"rl-white-on-blue",border:false,bodyStyle:"background-color:white",items:[!e?{hidden:true}:this.getConfigSpecialCategories(),{title:l("Details"),vAlign:"top",autoWidth:true,autoHeight:true,html:c.getFullDesc()},e?{hidden:true}:{xtype:"RL.Quote.Starter",vAlign:"top",title:f?l("Custom Trip Quote to ")+f.get("RESORT#RESORT"):"",baseCls:"x-panel",frame:false,width:300,initialDestCode:c.get("SPECIAL#RESORT"),showStartMessage:false},c.get_images().length<2?{colspan:3,hidden:true}:{xtype:"RL.Special.Carousel",colspan:3,title:l("Pictures"),height:245,specialRecord:c}]});this.addEvents("special-book");this.enableBubble("special-book");RL.Special.Content.superclass.initComponent.call(this);var h=this.slots;this.on("afterlayout",this.onAfterLayout,this);this.on("quantity-update",this.onQuantityUpdate,this)},getConfigSpecialCategories:function(){if(!RL.Global.allowQuoteWizard()){return{hidden:true}}var c=this.specialRecord;var e=c.getResort();var b=c.getValidStartDateRange();return{xtype:"panel",vAlign:"top",title:l("Dates & Prices"),width:385,items:[{xtype:"container",layout:"column",items:[{xtype:"panel",width:177,border:false,title:l("Starts"),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeStart.DatePicker.WithCombo",slot:"startdate",width:177,endFieldSiblingSlot:"enddate",range:c.getValidStartDateRange(),listeners:{scope:this,"date-selected":this.onStartDateSelected}}]},{xtype:"container",width:10,html:"&nbsp;"},{xtype:"panel",width:177,border:false,title:l("Ends"),headerCssClass:"rl-blue-on-white",items:[{xtype:"RL.FieldTypes.DateRangeEnd.DatePicker.WithCombo",slot:"enddate",width:177,range:c.getValidEndDateRange(),minNights:c.get("SPECIAL#MINNIGHTS"),maxNights:c.get("SPECIAL#MAXNIGHTS"),listeners:{scope:this,"date-selected":this.onEndDateSelected}}]}]},{xtype:"RL.FieldTypes.PriceCategories",slot:"categories",style:"padding-top : 10px",specialRecord:c},{xtype:"toolbar",style:"padding : 2px 0px 2px 0px",toolbarCls:"x-frameless",items:[{xtype:"button",slot:"bookButton",scale:"large",iconCls:"rl-icon-summaries-bookit",text:l("Book it!"),hidden:Ext.jx.getStoreValue("DEPT#WEBBKMO")==1,disabled:true,handler:this.onBookIt,scope:this},{xtype:"tbspacer",width:5},{xtype:"button",slot:"saveButton",hidden:!e,scale:"large",iconCls:"rl-icon-summaries-save-customize",text:l("Add + More"),disabled:true,handler:this.onSaveCustomize,scope:this}]},{xtype:"RL.FieldTypes.CurrencyPopup",slot:"currencyIndicator",currency:RL.Global.getCurrency(),listeners:{scope:this,"currency-changed":this.updateCurrency}}]}},onQuantityUpdate:function(){var f=this.slots;var e=f.categories;var c=f.bookButton;var b=f.saveButton;if(e.hasSpecialAdded()){c.enable();b.enable()}else{c.disable();b.disable()}},onAfterLayout:function(){if(this.slots.startdate){this.updateState(this.slots.startdate.getValue(),this.slots.enddate.getValue(),RL.Global.getCurrency())}},updateCurrency:function(c,b){var e=this.slots;this.updateState(e.startdate.getValue(),e.enddate.getValue(),b)},updateState:function(j,c,e){var k=this.slots;var h=k.bookButton;var b=k.saveButton;var f=k.categories;h.disable();b.disable();if(c){f.updateFor(j,c,e);if(f.hasSpecialAdded()){h.enable();b.enable()}}else{f.markInvalid()}},onStartDateSelected:function(c,e){var f=this.slots;var b=f.enddate.getValue();this.updateState(e,b,RL.Global.getCurrency())},onEndDateSelected:function(c,b){var f=this.slots;var e=f.startdate.getValue();this.updateState(e,b,RL.Global.getCurrency())},clearQuote:function(e,c){var b=Ext.jx.getStore("BUILD").getCount();if(!b){e.call(c||this);return}Ext.Msg.show({title:l("Warning"),msg:l("This action will cause your current quote be cleared. Are you sure that you would like to continue?"),buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.WARNING,scope:this,fn:function(f){if(f=="yes"){Ext.jx.getStore("BUILD").removeAll();Ext.jx.getStore("GTAW").removeAll();e.call(c||this)}}})},addSpecialToQuote:function(c){var f=Ext.jx.getStore("BUILD");var b=this.specialRecord.get("SPECIAL#RESORT");var e=0;Ext.each(this.slots.categories.getBuildData(),function(j){var k=new f.reader.recordType(j);var h=k.data;h["BUILD#UNITS"]=Number(h["BUILD#UNITS"])||1;e+=h["BUILD#UNITS"];h["BUILD#DESTSEG"]="0:"+b;f.add(k)});Ext.jx.setStoreValue("GTAW#RESORT",b);if(Ext.jx.getStoreValue("GTAW#ADULT")<e){Ext.jx.setStoreValue("GTAW#ADULT",e);Ext.jx.setStoreValue("GTAW#PAX",e)}return f},onSaveCustomize:function(){this.clearQuote(function(){var b=new RL.Model.Quote();var e=this.addSpecialToQuote(b);var c=e.getAt(0);RL.Global.showQuoteWizard({dest:this.specialRecord.getResort().getCode(),startdate:c.get("BUILD#DDATE"),enddate:c.get("BUILD#RDATE"),step:RL.Global.displayStartStep()?2:1});this.fireEvent("special-book",this)})},onBookIt:function(){this.clearQuote(function(){setTimeout(function(){Ext.jx.mask(Ext.getBody(),l("Finalizing your special..."),"rl-mask-medium",true,true)},100);var b=new RL.Model.Quote();var e=this.addSpecialToQuote(b);var c=e.getAt(0);window.gtawNew.finalizeQuoteReady(null,function(){b.book()});this.fireEvent("special-book",this)})}});Ext.reg("RL.Special.Content",RL.Special.Content);Ext.ns("RL.Special");RL.Special.Popup=Ext.extend(Ext.Window,{slots:true,header:false,modal:true,draggable:false,resizable:false,specialRecord:null,specialCode:null,beforeInitComponent:function(){if(this.specialCode){this.specialRecord=Ext.jx.getTable("SPECIAL").Funcs.getSpecialByCode(this.specialCode)}Ext.apply(this,{title:'<div class=screenTitle style="font-size:14px; font-weight:bold;">'+this.specialRecord.get("SPECIAL#DESC")+"</div>",width:Math.round(RL.Global.getWindowSize().width)-50,height:Math.round(RL.Global.getWindowSize().height),bodyStyle:{"overflow-y":"auto"},buttonAlign:"center",buttons:[{scale:"medium",text:l("Close"),handler:this.close,scope:this}]})},initComponent:function(){this.beforeInitComponent();RL.Special.Popup.superclass.initComponent.call(this);this.on("afterlayout",this.onAfterLayout,this,{single:true});this.on("special-book",this.close,this)},onAfterLayout:function(){this.body.mask(l("Please wait, loading..."));this.setupContent.defer(10,this)},setupContent:function(){this.add({xtype:"RL.Special.Content",specialRecord:this.specialRecord,header:false});var b=this.body;this.on("afterlayout",b.unmask,b,{single:true});this.doLayout()},show:function(){Ext.getBody().mask();RL.Special.Popup.superclass.show.apply(this,arguments)},close:function(){Ext.getBody().unmask();RL.Special.Popup.superclass.close.apply(this,arguments)}});Ext.reg("RL.Special.Popup",RL.Special.Popup);Ext.ns("RL.Special");RL.Special.DataView=Ext.extend(Ext.DataView,{slots:true,duration:550,specials:null,showDestinationName:false,transitionPlugin:Ext.ux.DataViewTransition,pluginConfig:null,skipFirstLayout:false,isFirstLayout:true,autoPageHeight:true,style:{"overflow-y":"auto"},beforeInitComponent:function(){var b=this.specials;var c=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"});if(this.autoPageHeight){this.height=Ext.max([Ext.min([RL.Global.getWindowSize().height-30,700]),400])}Ext.apply(this,{store:b,tpl:new Ext.XTemplate("<ul>",'<tpl for=".">','<li class="rl-specials-item">',this.showDestinationName?"{[ this.getDestinationName(values._record) ]}":"",'<img width="94" height="75" src="{[ this.getImagePath(values._record.getBrowseImage()) ]}" />',"<span>{SPECIAL#DESC}</span>","{[ this.getFromPrice(values._record) ]}","</li>","</tpl>","</ul>",{getImagePath:function(e){if(/no-photo/.test(e)){return"resources/images/no-photo.jpg"}return c+"BR_"+e},getFromPrice:function(e){var f=Number(e.get("SPECIAL#FROMPRICE"));if(f){return'<br><span class="rl-special-from-price">from '+RL.Global.getCurrency().asString(f)+"</span>"}return""},getDestinationName:function(f){var e=f.getResort();if(e){var h=e.getSuperDestRecord();return'<div class="rl-special-dest-name">'+(h?'<span class="rl-special-region-name">'+h.get("SUPERDES#NAME")+" :: </span>":"")+e.get("RESORT#RESORT")+"</div>"}return""}}),plugins:[new this.transitionPlugin(Ext.apply({duration:this.duration,idProperty:"SPECIAL#CODE"},this.pluginConfig||{}))],cls:"rl-specials-dataview "+(this.cls||""),itemSelector:"li.rl-specials-item",overClass:"rl-specials-item-over",singleSelect:true,multiSelect:true})},initComponent:function(){this.beforeInitComponent();RL.Special.DataView.superclass.initComponent.call(this);this.addEvents("afterlayout","afterlayout-buffered");this.on("afterlayout-buffered",this.onBufferedLayout,this,{buffer:25})},doLayout:function(){this.fireEvent("afterlayout-buffered")},onBufferedLayout:function(){var b=this;if(this.isFirstLayout){this.isFirstLayout=false;if(this.skipFirstLayout){b.fireEvent("afterlayout",b);return}}this.refreshTransitions(function(){b.fireEvent("afterlayout",b)})}});Ext.reg("RL.Special.DataView",RL.Special.DataView);Ext.ns("RL.Special");RL.Special.Carousel=Ext.extend(Ext.Panel,{layout:"carousel",height:200,layoutConfig:{pagedScroll:true,loopCount:1,scrollButtonPosition:"split",marginScrollButtons:1},specialRecord:null,constructor:function(e){var c=e.specialRecord;e.items=[];var f=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"});var b=c.get_images();Ext.each(b,function(h){e.items.push({style:{margin:"1px 1px 1px 1px"},html:{tag:"img",width:250,height:200,src:f+"/fs_"+h,style:{width:250,height:200}}})});RL.Special.Carousel.superclass.constructor.call(this,e)}});Ext.reg("RL.Special.Carousel",RL.Special.Carousel);Ext.ns("RL.Vendor");RL.Vendor.Carousel=Ext.extend(Ext.Panel,{layout:"carousel",baseCls:"x-frameless",autoWidth:true,height:200,layoutConfig:{pagedScroll:true,loopCount:1,scrollButtonPosition:"split",marginScrollButtons:1},vendorRecord:null,constructor:function(c){var b=c.vendorRecord;c.items=[];var h=Ext.jx.getStoreValue({tableName:"CONFIG",fieldName:"CONFIG#IMAGEPATH"});for(var e=1;e<=10;e++){var f=b.data["VENDOR#IMAGE"+e];if(!f){continue}c.items.push({style:{margin:"1px 1px 1px 1px"},html:{tag:"img",width:250,height:200,src:h+"/fs_"+f,style:{width:250,height:200}}})}RL.Vendor.Carousel.superclass.constructor.call(this,c)}});Ext.reg("vendor_carousel",RL.Vendor.Carousel);Ext.ns("RL.Vendor");RL.Vendor.Calendar=Ext.extend(Ext.Panel,{baseCls:"x-frameless",invTab:"avail",frame:false,autoWidth:true,hideBorders:true,layout:"row-fit",pricingRecord:null,vendorRecord:null,searchForm:null,constructor:function(b){Ext.apply(b,{items:[{baseCls:"x-frameless",hideBorders:true,frame:false,calendar_parent:true,height:"100%",autoWidth:true,layout:"row-fit"}]});RL.Vendor.Calendar.superclass.constructor.call(this,b)},initComponent:function(){if(this.pricingRecord){this.firstDt=this.pricingRecord.get("BUILD#DDATE");this.lastDt=this.pricingRecord.get("BUILD#RDATE");this.ventype=this.pricingRecord.get("BUILD#TYPE")||this.pricingRecord.get("VENDOR#VENTYPE");this.venid=this.pricingRecord.get("BUILD#VENID")||this.pricingRecord.get("VENDOR#VENID");this.mgtcoid=this.pricingRecord.get("BUILD#MGTCOID")||this.pricingRecord.get("VENDOR#MGTCOID")}else{if(this.vendorRecord){this.ventype=this.vendorRecord.get("VENDOR#VENTYPE");this.venid=this.vendorRecord.get("VENDOR#VENID");this.mgtcoid=this.vendorRecord.get("VENDOR#MGTCOID")}}if(!this.venid){alert("did not specify particular vendor on vendor calendar")}if(!this.firstDt&&this.searchForm){var b=this.searchForm.getSearchValues();this.firstDt=b["#DDATE"];this.lastDt=b["#RDATE"]}if(!this.firstDt){alert("did not specify particular dates on vendor calendar")}this.createToolbar();RL.Vendor.Calendar.superclass.initComponent.call(this)},updateToolbarDts:function(){this.topToolbar.el.child(".x-vendor-calendar-toolbar-dates").update("<b>"+this.firstDt.format("d M y")+"</b> to <b>"+this.lastDt.format("d M y")+"</b>")},createToolbar:function(){this.setDates(this.firstDt,this.lastDt,true);var f='<div class="x-vendor-calendar-toolbar-dates"></div>';var e=this.getInvTabs(),c=[];for(var h in e){var b=e[h];c.push({invTab:h,pressed:(this.invTab===h),handler:this.onToggleClick,allowDepress:false,text:b.desc,enableToggle:true,scope:this}," ")}this.tbar=new Ext.Toolbar({toolbarCls:"x-panel-bc",style:{padding:"5px 0 5px 0"},items:[{xtype:"container_spacer",width:20},c,{xtype:"container_spacer",width:20},{scale:"medium",iconCls:"go-left-btn",handler:this.onClickPrevDate,scope:this},f,{scale:"medium",iconCls:"go-right-btn",handler:this.onClickNextDate,scope:this}]});this.tbar.on("afterlayout",this.afterToolbarLayout,this)},afterToolbarLayout:function(b){this.updateToolbarDts()},onToggleClick:function(b){if(b.invTab===this.invTab){return}this.invTab=b.invTab;var c=this.topToolbar.findBy(function(){return this.enableToggle});Ext.each(c,function(e){if(b.id!=e.id){e.toggle(!b.pressed)}});this.onStoreReady.defer(100,this,[])},onClickPrevDate:function(c){var e=this.firstDt.add(Date.DAY,-1);var b=Date.parseDate(e.format("m")+"/01/"+e.format("Y"),"m/d/Y");if(e.subtractDt(b)<14){dt=this.firstDt.add(Date.DAY,-1);b=Date.parseDate(dt.format("m")+"/01/"+dt.format("Y"),"m/d/Y")}this.getStoreRaw(b,e)},onClickNextDate:function(c){var b=this.lastDt.add(Date.DAY,1);var e=Date.parseDate(b.format("m")+"/"+b.getDaysInMonth()+"/"+b.format("Y"),"m/d/Y");if(e.subtractDt(b)<14){var f=e.add(Date.DAY,1);e=Date.parseDate(f.format("m")+"/"+f.getDaysInMonth()+"/"+f.format("Y"),"m/d/Y")}this.getStoreRaw(b,e)},onRender:function(c,b){RL.Vendor.Calendar.superclass.onRender.apply(this,arguments);this.getStoreRaw.defer(100,this,[])},setDates:function(b,c,e){this.firstDt=Ext.jx.cleanDate(b);this.lastDt=Ext.jx.cleanDate(c);if(e){if(this.lastDt.subtractDt(this.firstDt)<14){this.firstDt=this.firstDt.add(Date.DAY,-7);this.lastDt=this.lastDt.add(Date.DAY,7)}}if(this.el){this.updateToolbarDts()}},checkLoading:function(e){var c;if(typeof e!="undefined"){c=this.loading;this.loading=e}var b=this.findBy(function(f){return f.calendar_parent})[0];if(b.el){b.el.unmask()}if(this.loading){if(b.el){b.el.mask("Now populating the calendar...","x-mask-loading")}this.checkLoading.defer(300,this,[])}},getStoreRaw:function(firstDt,lastDt,venid,mgtcoid,ventype){if(firstDt){this.setDates(firstDt,lastDt)}if(venid){this.venid=venid;this.mgtcoid=mgtcoid;this.ventype=ventype}this.checkLoading(true);var server=Ext.jx.Server.get(),conn=new Ext.data.Connection();var params=Ext.jx.Ajax.cleanFieldNamesForPost({"VENDOR.VENID":this.venid,"VENDOR.MGTCOID":this.mgtcoid||"~~NULL~~","VENDOR.VENTYPE":this.ventype,".DDATE":this.firstDt,".RDATE":this.lastDt});var actionParams="&"+Ext.jx.Ajax.urlEncode({screen:"js::ext_data_store::_VENDOR_INVENTORY",page_action:params});if(Ext.jx.getQueryString()["debug_mode"]){actionParams+="&debug_output_to_email=1"}conn.request({timeout:90,url:server+"?"+actionParams+"&pl="+Ext.jx.getStoreValue("DEPT#DEPTNO"),method:"GET",success:function(responseObject){Ext.jx.Server.release(server);this.checkLoading(false);var isError=false,tempVar,response;try{response=responseObject.responseObject||eval("tempVar="+responseObject.responseText)}catch(e){isError=true}if(isError||!response){calendar_parent.add({html:l("There was a problem loading the data")});if(calendar_parent.el){calendar_parent.doLayout();calendar_parent.el.unmask()}}else{var dataRemote=Ext.jx.getTable("_VENDOR_PRICING").setData(actionParams,response);this.storeRaw=dataRemote.getStore();this.onStoreReady()}},failure:function(){Ext.jx.Server.release(server);this.checkLoading(false);calendar_parent.add({html:l("There was a problem loading the data")});if(calendar_parent.el){calendar_parent.doLayout();calendar_parent.el.unmask()}},scope:this})},onStoreReady:function(){var j=["_VENDOR_INVENTORY#UNITSAY","_VENDOR_INVENTORY#PRICECODE","#LINK_TO_SERVICE","_VENDOR_INVENTORY#PRICECODE","_VENDOR_INVENTORY#MGTCOID","_VENDOR_INVENTORY#VENID"];var h=["_VENDOR_INVENTORY#INV_DATE","_VENDOR_INVENTORY#AUDIT","_VENDOR_INVENTORY#AUDITDATE","_VENDOR_INVENTORY#AVAIL","_VENDOR_INVENTORY#RELDATE","_VENDOR_INVENTORY#STATUS","_VENDOR_INVENTORY#TOTINV","_VENDOR_INVENTORY#USED","_VENDOR_INVENTORY#BLACKOUT","_VENDOR_INVENTORY#UNITSAY","_VENDOR_INVENTORY#SELL_PRICE","_VENDOR_INVENTORY#MINNGTS"];var c=[],n=[],b={};Ext.each(j,function(p){c.push(Ext.apply({},this.storeRaw.fields.map[p]))},this);var k=this.lastDt.subtractDt(this.firstDt);for(var e=0;e<=k;e++){var f=this.firstDt.add("d",e);var m="#"+f.format("Y-m-d");c.push({name:m})}this.storeRaw.each(function(s){var q=Ext.jx.cleanDate(s.data["_VENDOR_INVENTORY#INV_DATE"]);var t=s.data["_VENDOR_INVENTORY#VENID"]+"&"+s.data["_VENDOR_INVENTORY#MGTCOID"]+"&"+s.data["_VENDOR_INVENTORY#PRICECODE"];var r=b[t];if(!r){n.push(r=b[t]={rowkey:t});Ext.each(j,function(u){r[u]=s.data[u]})}var p={};Ext.each(h,function(u){p[u]=s.data[u]});r["#"+q.format("Y-m-d")]=p});this.store=new Ext.data.JsonStore({fields:c,data:n});this.updateGrid();return},getGridCols:function(f){if(f){this.invTab=f}var c=[{header:l("Unit Type"),width:120,sortable:true,dataIndex:"_VENDOR_INVENTORY#UNITSAY",renderer:function(k,s,n,t,m,q){return'<div class="unit_type_col">'+k+"</div>"}}];var j=this.lastDt.subtractDt(this.firstDt);for(var b=0;b<=j;b++){var h=this.firstDt.add("d",b);var e="#"+h.format("Y-m-d");c.push(Ext.apply({header:h.format("M j"),resizable:false,sortable:false,menuDisabled:true,dataIndex:e},this.getInvTabs()[this.invTab]))}return c},getInvTabs:function(){if(this.invTabs){return this.invTabs}return this.invTabs={avail:{desc:"Availability Calendar",width:38,renderer:function(b,e,f,j,c,h){if(b["_VENDOR_INVENTORY#BLACKOUT"]=="1"||b["_VENDOR_INVENTORY#AVAIL"]=="0"){e.css="inv_calendar_blackout_date";return"n/a"}e.css="inv_calendar_available_date";return b["_VENDOR_INVENTORY#AVAIL"]}},minNights:{desc:"Min Nights Calendar",width:38,renderer:function(b,h,e,j,c,f){return b["_VENDOR_INVENTORY#MINNGTS"]}}}},updateGrid:function(){var b=this.findBy(function(e){return e.calendar_parent})[0];b.removeRange();var c=new Ext.grid.GridPanel({store:this.store,columns:this.getGridCols(),cls:"inven_cal_grid",selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),stripeRows:true,autoWidth:true,frame:true,height:"100%"});b.add(c);if(b.el){b.doLayout()}}});Ext.reg("vendor_calendar",RL.Vendor.Calendar);Ext.ns("RL.Vendor");RL.Vendor.Map=Ext.extend(Ext.ux.GMapPanel,{vendorRecord:null,constructor:function(c){var b=c.vendorRecord;Ext.apply(c,{title:l("Map"),border:true,zoomLevel:16,gmapType:"terrain",border:true,mapConfOpts:["enableScrollWheelZoom","enableDoubleClickZoom","enableDragging"],mapControls:["GSmallMapControl","GMapTypeControl"],minGeoAccuracy:1,setCenter:{geoCodeAddr:b.getAddress(),marker:{title:b.get("VENDOR#VENDOR")},listeners:{click:function(f){Ext.Msg.alert(b.get("VENDOR#VENDOR"),b.getMapDesc())}}}});RL.Vendor.Map.superclass.constructor.call(this,c)}});Ext.reg("vendor_map",RL.Vendor.Map);Ext.ns("RL.Vendor");RL.Vendor.StreetView=Ext.extend(Ext.Panel,{vendorRecord:null,isShown:false,initComponent:function(){Ext.apply(this,{slots:true,title:l("StreetView"),layout:"fit",items:[{xtype:"container",slot:"mask",listeners:{afterlayout:function(b){b.el.mask(l("Loading street view, please wait.."))}}}]});RL.Vendor.StreetView.superclass.initComponent.call(this);this.on("activate",this.onActivate,this)},afterShow:function(b){this.isShown=true;if(b){this.createPanorama()}},onActivate:function(){if(!this.isShown){return}this.createPanorama()},beforeDismiss:function(){var b=this.slots.panorama;if(b){b.cleanup()}},createPanorama:function(){if(this.slots.panorama){return}this.remove(this.slots.mask);this.add({xtype:"RL.Vendor.StreetView.Content",slot:"panorama",header:false,vendorAddress:this.vendorRecord.getAddress()});var b=this.slots.panorama;this.doLayout();b.fireEvent("activate")}});Ext.reg("RL.Vendor.StreetView",RL.Vendor.StreetView);Ext.ns("RL.Vendor.StreetView");RL.Vendor.StreetView.Content=Ext.extend(Ext.ux.GMapPanel,{vendorAddress:null,geocoder:null,notAvailable:false,initComponent:function(){Ext.apply(this,{title:l("StreetView"),gmapType:"panorama",border:false,zoomLevel:0});RL.Vendor.StreetView.Content.superclass.initComponent.call(this);this.on("activate",this.onActivate,this)},cleanup:function(){var b=this.getMap();if(!b){return}b.remove()},onBeforeDestroy:function(){this.cleanup()},onActivate:function(){if(this.notAvailable){this.onMapError()}},afterRender:function(){RL.Vendor.StreetView.Content.superclass.afterRender.apply(this,arguments);GEvent.bind(this.getMap(),"error",this,this.onMapError);this.body.mask(l("Loading street view, please wait.."));if(!this.geocoder){this.geocoder=new GClientGeocoder()}this.geocoder.getLatLng(this.vendorAddress,this.centerStreetView.createDelegate(this))},centerStreetView:function(b){this.body.unmask();if(b){this.getMap().setLocationAndPOV(b,{yaw:this.yaw,pitch:this.pitch,zoom:this.zoomLevel})}else{this.onMapError()}},onMapError:function(b){this.notAvailable=true;this.body.mask(l("Sorry, streetview is not available for this address:")+" "+this.vendorAddress)}});Ext.reg("RL.Vendor.StreetView.Content",RL.Vendor.StreetView.Content);Ext.ns("RL.Vendor");RL.Vendor.Content=Ext.extend(Ext.ux.TabPanelSkin,{slots:true,tabsBgCls:"prodtype_ldg_header",tabBtnCls:"prodtype_round_button",tabsTitleCls:"quote_steps_msg",active:null,enableTabScroll:true,plain:true,border:false,activeTab:0,vendorRecord:null,pricingRecord:null,searchForm:null,constructor:function(c){var b=c.vendorRecord;var f=c.searchForm;var j=c.pricingRecord;if(!c.items){c.items=[]}if(!b.hasPictures){Ext.jx.debug("problem with hasPictures")}else{if(b.hasPictures()){c.items.push({title:l("Pictures"),name:"Pictures",layout:"row-fit",baseCls:"prodtype_ldg_desc",sort:-5,items:[{baseCls:"x-frameless",html:b.getDesc(),autoWidth:true,autoHeight:true},{xtype:"vendor_carousel",vendorRecord:b,height:"100%"}]})}if(b.hasMap()){c.items.push({xtype:"vendor_map",title:l("Map"),name:"Map",sort:-4,vendorRecord:b})}if(b.hasStreetView()){c.items.push({xtype:"RL.Vendor.StreetView",slot:"panorama",title:l("Street View"),name:"StreetView",sort:-4.5,vendorRecord:b})}if(f&&j&&b.usesInventory()){c.items.push({xtype:"vendor_calendar",title:l("Avail"),name:"Calendar",gridHeight:this.height-112,sort:-3,vendorRecord:b,pricingRecord:j,searchForm:f})}var h=Ext.jx.getStoreValue("CONFIG#CONVENCON");if(h==1&&b.data["VENDOR#SHORT"]){c.items.push({title:l("About"),name:"About",sort:-2,html:b.data["VENDOR#SHORT"],bodyStyle:"overflow-y : auto"})}var k=h==2?(b.data["VENDOR#SHORT"]||"")+(b.data["VENDOR#LONG"]||""):b.data["VENDOR#LONG"];if(k){c.items.push({title:l("More Info"),name:"More Info",sort:-1,html:k,bodyStyle:"overflow-y : auto"})}for(var e=1;e<=7;e++){if(!b.data["VENDOR#CAT"+e+"NAME"]||!b.data["VENDOR#CAT"+e+"INFO"]){continue}c.items.push({title:b.data["VENDOR#CAT"+e+"NAME"],name:"VENDOR#CAT"+e+"NAME",sort:b.data["VENDOR#CAT"+e+"ORDER"],hideBorders:true,bodyStyle:"overflow-y : auto",items:[{xtype:!c.noPanPanels?"panpanel":"panel",html:b.data["VENDOR#CAT"+e+"INFO"]}]})}}c.items.sort(function(n,m){return(n.sort||0)-(m.sort||0)});Ext.each(c.items,function(n,m){if(c.active==n.name){c.activeTab=m}});this.tabsTitle=b.data["VENDOR#VENDOR"];RL.Vendor.Content.superclass.constructor.call(this,c)},initComponent:function(){RL.Vendor.Content.superclass.initComponent.call(this);this.on("afterlayout",this.onAfterLayout,this,{defer:2000,single:true});this.on("tabchange",this.onAfterTabChange,this)},afterShow:function(){var b=this.slots.panorama;if(b){b.afterShow(this.layout.activeItem==b)}},beforeDismiss:function(){var b=this.slots.panorama;if(b){b.beforeDismiss()}},onAfterLayout:function(){var b=this.layout;if(!b.deferredRender){return}b.deferredRender=false;this.doLayout()},onAfterTabChange:function(b,c){if(c.title=="Map"){}}});Ext.reg("vendor_content",RL.Vendor.Content);Ext.ns("RL.Vendor");RL.Vendor.Inventory=Ext.extend(Ext.Panel,{pricingRecord:null,vendorRecord:null,searchForm:null,constructor:function(c){var b=c.vendorRecord;Ext.apply(c,{title:l("Inventory")});RL.Vendor.Inventory.superclass.constructor.call(this,c)}});Ext.reg("RL.Vendor.Inventory",RL.Vendor.Inventory);
