/* Bonboa $Id: bonboa-all.js 442 2009-06-22 18:18:56Z joris $ */
Ext.ux.ComboBox=function(C){if(Ext.isArray(C.store)){if(Ext.isArray(C.store[0])){C.store=new Ext.data.SimpleStore({fields:["value","text"],data:C.store});C.valueField="value";C.displayField="text"}else{var B=[];for(var D=0,A=C.store.length;D<A;D++){B[D]=[C.store[D]]}C.store=new Ext.data.SimpleStore({fields:["text"],data:B});C.valueField="text";C.displayField="text"}C.mode="local"}Ext.ux.ComboBox.superclass.constructor.call(this,C)};Ext.extend(Ext.ux.ComboBox,Ext.form.ComboBox,{});Ext.reg("localcombo",Ext.ux.ComboBox);Ext.ns("Ext.ux.form");Ext.ux.form.XCheckbox=Ext.extend(Ext.form.Checkbox,{submitOffValue:"false",submitOnValue:"true",onRender:function(A){this.inputValue=this.submitOnValue;Ext.ux.form.XCheckbox.superclass.onRender.apply(this,arguments);this.hiddenField=this.wrap.insertFirst({tag:"input",type:"hidden"});this.updateHidden()},setValue:function(A){Ext.ux.form.XCheckbox.superclass.setValue.apply(this,arguments);this.updateHidden()},updateHidden:function(){if(this.hiddenField){this.hiddenField.dom.value=this.checked?this.submitOnValue:this.submitOffValue;this.hiddenField.dom.name=this.checked?"":this.el.dom.name}}});Ext.reg("xcheckbox",Ext.ux.form.XCheckbox);Ext.ns("Ext.ux.form");Ext.ux.form.DateTime=Ext.extend(Ext.form.Field,{defaultAutoCreate:{tag:"input",type:"hidden"},timeWidth:100,dtSeparator:" ",hiddenFormat:"Y-m-d H:i:s",otherToNow:true,timePosition:"right",dateFormat:"m/d/y",timeFormat:"g:i A",initComponent:function(){Ext.ux.form.DateTime.superclass.initComponent.call(this);var B=Ext.apply({},{id:this.id+"-date",format:this.dateFormat||Ext.form.DateField.prototype.format,altFormats:this.altDateFormats||Ext.form.DateField.prototype.altFormats,width:this.timeWidth,selectOnFocus:this.selectOnFocus,listeners:{blur:{scope:this,fn:this.onBlur},focus:{scope:this,fn:this.onFocus}}},this.dateConfig);this.df=new Ext.form.DateField(B);delete (this.dateFormat);var A=Ext.apply({},{id:this.id+"-time",format:this.timeFormat||Ext.form.TimeField.prototype.format,width:this.timeWidth,selectOnFocus:this.selectOnFocus,listeners:{blur:{scope:this,fn:this.onBlur},focus:{scope:this,fn:this.onFocus}}},this.timeConfig);this.tf=new Ext.form.TimeField(A);delete (this.timeFormat);this.relayEvents(this.df,["focus","specialkey","invalid","valid"]);this.relayEvents(this.tf,["focus","specialkey","invalid","valid"])},onRender:function(C,A){if(this.isRendered){return }Ext.ux.form.DateTime.superclass.onRender.call(this,C,A);var B;if("below"===this.timePosition||"bellow"===this.timePosition){B=Ext.DomHelper.append(C,{tag:"table",style:"border-collapse:collapse",children:[{tag:"tr",children:[{tag:"td",style:"padding-bottom:1px",cls:"ux-datetime-date"}]},{tag:"tr",children:[{tag:"td",cls:"ux-datetime-time"}]}]},true)}else{B=Ext.DomHelper.append(C,{tag:"table",style:"border-collapse:collapse",children:[{tag:"tr",children:[{tag:"td",style:"padding-right:4px",cls:"ux-datetime-date"},{tag:"td",cls:"ux-datetime-time"}]}]},true)}this.tableEl=B;this.wrap=B.wrap();this.wrap.on("mousedown",this.onMouseDown,this,{delay:10});this.df.render(B.child("td.ux-datetime-date"));this.tf.render(B.child("td.ux-datetime-time"));if(Ext.isIE&&Ext.isStrict){B.select("input").applyStyles({top:0})}this.on("specialkey",this.onSpecialKey,this);this.df.el.swallowEvent(["keydown","keypress"]);this.tf.el.swallowEvent(["keydown","keypress"]);if("side"===this.msgTarget){var D=this.el.findParent(".x-form-element",10,true);this.errorIcon=D.createChild({cls:"x-form-invalid-icon"});this.df.errorIcon=this.errorIcon;this.tf.errorIcon=this.errorIcon}this.el.dom.name=this.hiddenName||this.name||this.id;this.df.el.dom.removeAttribute("name");this.tf.el.dom.removeAttribute("name");this.isRendered=true;this.updateHidden()},adjustSize:Ext.BoxComponent.prototype.adjustSize,alignErrorIcon:function(){this.errorIcon.alignTo(this.tableEl,"tl-tr",[2,0])},initDateValue:function(){this.dateValue=this.otherToNow?new Date():new Date(1970,0,1,0,0,0)},clearInvalid:function(){this.df.clearInvalid();this.tf.clearInvalid()},disable:function(){if(this.isRendered){this.df.disabled=this.disabled;this.df.onDisable();this.tf.onDisable()}this.disabled=true;this.df.disabled=true;this.tf.disabled=true;this.fireEvent("disable",this);return this},enable:function(){if(this.rendered){this.df.onEnable();this.tf.onEnable()}this.disabled=false;this.df.disabled=false;this.tf.disabled=false;this.fireEvent("enable",this);return this},focus:function(){this.df.focus()},getPositionEl:function(){return this.wrap},getResizeEl:function(){return this.wrap},getValue:function(){return this.dateValue?new Date(this.dateValue):""},isValid:function(){return this.df.isValid()&&this.tf.isValid()},isVisible:function(){return this.df.rendered&&this.df.getActionEl().isVisible()},onBlur:function(A){if(this.wrapClick){A.focus();this.wrapClick=false}if(A===this.df){this.updateDate()}else{this.updateTime()}this.updateHidden();(function(){if(!this.df.hasFocus&&!this.tf.hasFocus){var B=this.getValue();if(String(B)!==String(this.startValue)){this.fireEvent("change",this,B,this.startValue)}this.hasFocus=false;this.fireEvent("blur",this)}}).defer(100,this)},onFocus:function(){if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},onMouseDown:function(A){if(!this.disabled){this.wrapClick="td"===A.target.nodeName.toLowerCase()}},onSpecialKey:function(B,C){var A=C.getKey();if(A===C.TAB){if(B===this.df&&!C.shiftKey){C.stopEvent();this.tf.focus()}if(B===this.tf&&C.shiftKey){C.stopEvent();this.df.focus()}}if(A===C.ENTER){this.updateValue()}},setDate:function(A){this.df.setValue(A)},setTime:function(A){this.tf.setValue(A)},setSize:function(A,B){if(!A){return }if("below"===this.timePosition){this.df.setSize(A,B);this.tf.setSize(A,B);if(Ext.isIE){this.df.el.up("td").setWidth(A);this.tf.el.up("td").setWidth(A)}}else{this.df.setSize(A-this.timeWidth-4,B);this.tf.setSize(this.timeWidth,B);if(Ext.isIE){this.df.el.up("td").setWidth(A-this.timeWidth-4);this.tf.el.up("td").setWidth(this.timeWidth)}}},setValue:function(D){if(!D&&true===this.emptyToNow){this.setValue(new Date());return }else{if(!D){this.setDate("");this.setTime("");this.updateValue();return }}if("number"===typeof D){D=new Date(D)}D=D?D:new Date(1970,0,1,0,0,0);var A,B;if(D instanceof Date){this.setDate(D);this.setTime(D);this.dateValue=new Date(D)}else{A=D.split(this.dtSeparator);this.setDate(A[0]);var C=this.df.getValue();if(A[1]){this.setTime(A[1])}}this.updateValue()},setVisible:function(A){if(A){this.df.show();this.tf.show()}else{this.df.hide();this.tf.hide()}return this},show:function(){return this.setVisible(true)},hide:function(){return this.setVisible(false)},updateDate:function(){var A=this.df.getValue();if(A){if(!(this.dateValue instanceof Date)){this.initDateValue();if(!this.tf.getValue()){this.setTime(this.dateValue)}}this.dateValue.setMonth(0);this.dateValue.setFullYear(A.getFullYear());this.dateValue.setMonth(A.getMonth());this.dateValue.setDate(A.getDate())}else{this.dateValue="";this.setTime("")}},updateTime:function(){var A=this.tf.getValue();if(A&&!(A instanceof Date)){A=Date.parseDate(A,this.tf.format)}if(A&&!this.df.getValue()){this.initDateValue();this.setDate(this.dateValue)}if(this.dateValue instanceof Date){if(A){this.dateValue.setHours(A.getHours());this.dateValue.setMinutes(A.getMinutes());this.dateValue.setSeconds(A.getSeconds())}else{this.dateValue.setHours(0);this.dateValue.setMinutes(0);this.dateValue.setSeconds(0)}}},updateHidden:function(){if(this.isRendered){var A=this.dateValue instanceof Date?this.dateValue.format(this.hiddenFormat):"";this.el.dom.value=A}},updateValue:function(){this.updateDate();this.updateTime();this.updateHidden();return },validate:function(){return this.df.validate()&&this.tf.validate()},renderer:function(C){var B=C.editor.dateFormat||Ext.ux.form.DateTime.prototype.dateFormat;B+=" "+(C.editor.timeFormat||Ext.ux.form.DateTime.prototype.timeFormat);var A=function(E){var D=Ext.util.Format.date(E,B);return D};return A}});Ext.reg("xdatetime",Ext.ux.form.DateTime);Ext.ns("Ext.ux.form");Ext.ux.form.XDateField=Ext.extend(Ext.form.DateField,{submitFormat:"Y-m-d",onRender:function(){Ext.ux.form.XDateField.superclass.onRender.apply(this,arguments);var A=this.name||this.el.dom.name;this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:A,value:this.formatHiddenDate(this.parseDate(this.value))});this.hiddenName=A;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)},onDisable:function(){Ext.ux.form.XDateField.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.dom.setAttribute("disabled","disabled")}},onEnable:function(){Ext.ux.form.XDateField.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.dom.removeAttribute("disabled")}},formatHiddenDate:function(A){return Ext.isDate(A)?Ext.util.Format.date(A,this.submitFormat):A},updateHidden:function(){this.hiddenField.dom.value=this.formatHiddenDate(this.getValue())}});Ext.reg("xdatefield",Ext.ux.form.XDateField);Ext.ns("Ext.ux.form");Ext.ux.form.XTimeField=Ext.extend(Ext.form.TimeField,{submitFormat:"H:i:s",onRender:function(){this.altFormats+="|"+this.submitFormat;Ext.ux.form.XTimeField.superclass.onRender.apply(this,arguments);this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.name});this.hiddenName=this.name;this.el.dom.name=null;this.el.on({keyup:{scope:this,fn:this.updateHidden},blur:{scope:this,fn:this.updateHidden}});this.setValue=this.setValue.createSequence(this.updateHidden)},updateHidden:function(){var A=this.getValue();A=Ext.isDate(A)?A:Date.parseDate(A,this.format);this.hiddenField.dom.value=Ext.util.Format.date(A,this.submitFormat)}});Ext.reg("xtimefield",Ext.ux.form.XTimeField);Ext.namespace("Ext.ux");Ext.ux.RadioGroup=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:"radio",autocomplete:"off"},getId:function(){if(this.radios&&this.radios instanceof Array){if(this.radios.length){var A=this.radios[0];this.value=A.value;this.boxLabel=A.boxLabel;this.checked=A.checked||false;this.readOnly=A.readOnly||false;this.disabled=A.disabled||false;this.tabIndex=A.tabIndex;this.cls=A.cls;this.listeners=A.listeners;this.style=A.style;this.bodyStyle=A.bodyStyle;this.hideParent=A.hideParent;this.hidden=A.hidden}}Ext.ux.RadioGroup.superclass.getId.call(this)},initComponent:function(){Ext.ux.RadioGroup.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.ux.RadioGroup.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.ux.RadioGroup.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this)},getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(C,A){Ext.ux.RadioGroup.superclass.onRender.call(this,C,A);this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(!this.isInGroup){this.wrap.applyStyles({"padding-top":"2px"})}if(this.checked){this.setChecked(true)}else{this.checked=this.el.dom.checked}if(this.radios&&this.radios instanceof Array){this.els=new Array();this.els[0]=this.el;for(var B=1;B<this.radios.length;B++){var D=this.radios[B];this.els[B]=new Ext.ux.RadioGroup({renderTo:this.wrap,hideLabel:true,boxLabel:D.boxLabel,checked:D.checked||false,value:D.value,name:this.name||this.id,readOnly:D.readOnly||false,disabled:D.disabled||false,tabIndex:D.tabIndex,cls:D.cls,listeners:D.listeners,style:D.style,bodyStyle:D.bodyStyle,hideParent:D.hideParent,hidden:D.hidden,isInGroup:true});if(this.horizontal){this.els[B].el.up("div.x-form-check-wrap").applyStyles({display:"inline","padding-left":"5px"})}}if(this.hidden){this.hide()}}},initValue:function(){if(this.value!==undefined){this.el.dom.value=this.value}else{if(this.el.dom.value.length>0){this.value=this.el.dom.value}}},onDestroy:function(){if(this.radios&&this.radios instanceof Array){var B=this.radios.length;if(this.els){for(var A=1;A<B;A++){this.els[A].destroy()}}}if(this.wrap){this.wrap.remove()}Ext.ux.RadioGroup.superclass.onDestroy.call(this)},setChecked:function(A){if(this.el&&this.el.dom){var B=false;if(A!=this.checked){B=true}this.checked=A;this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked;if(B){this.fireEvent("check",this,this.checked)}}},getValue:function(){if(!this.rendered){return this.value}var A=this.el.up("form");if(!A){A=Ext.getBody()}var B=A.child("input[name="+escape(this.el.dom.name)+"]:checked",true);return(B)?B.value:this.value},onClick:function(){if(this.el.dom.checked!=this.checked){var B=this.el.up("form");if(!B){B=Ext.getBody()}var A=B.select("input[name="+escape(this.el.dom.name)+"]");A.each(function(C){if(C.dom.id==this.id){this.setChecked(true)}else{var D=Ext.getCmp(C.dom.id);D.setChecked.apply(D,[false])}},this)}},setValue:function(A){if(!this.rendered){this.value=A;return }var C=this.el.up("form");if(!C){C=Ext.getBody()}var B=C.child("input[name="+escape(this.el.dom.name)+"][value="+A+"]",true);if(B){B.checked=true}},clear:function(){if(!this.rendered){return }var A=this.el.up("form");if(!A){A=Ext.getBody()}var B=A.child("input[name="+escape(this.el.dom.name)+"]:checked",true);if(B){B.checked=false}},disable:function(){if(!this.rendered){return }var B=this.el.up("form");if(!B){B=Ext.getBody()}var A=B.select("input[name="+escape(this.el.dom.name)+"]");A.each(function(C){if(C.dom.id==this.id){Ext.ux.RadioGroup.superclass.disable.call(this)}else{var D=Ext.getCmp(C.dom.id);Ext.ux.RadioGroup.superclass.disable.call(D)}},this)},enable:function(){if(!this.rendered){return }var B=this.el.up("form");if(!B){B=Ext.getBody()}var A=B.select("input[name="+escape(this.el.dom.name)+"]");A.each(function(C){if(C.dom.id==this.id){Ext.ux.RadioGroup.superclass.enable.call(this)}else{var D=Ext.getCmp(C.dom.id);Ext.ux.RadioGroup.superclass.enable.call(D)}},this)},hide:function(){if(!this.rendered){return }this.wrap.hide();this.wrap.parent().parent().hide()},show:function(){if(!this.rendered){return }this.wrap.show();this.wrap.parent().parent().show()}});Ext.reg("ux-radiogroup",Ext.ux.RadioGroup);Ext.namespace("Ext.ux.form");Ext.ux.form.ImageField=Ext.extend(Ext.BoxComponent,{inputType:"image",value:"",name:"",invalidClass:"x-form-imagefield-invalid",invalidText:"This field is required",validationEvent:"change",validationDelay:250,defaultAutoCreate:{tag:"div"},fieldClass:"x-form-imagefield",msgTarget:"qtip",msgFx:"normal",disabled:false,optional:false,hideTrigger:false,triggerClass:"",defaultImage:Ext.BLANK_IMAGE_URL,browserWidth:300,browserHeight:300,browserTitle:"Select an image",alwaysLoadStore:false,windowConfig:{},view:{},valueField:"url",isStoreLoaded:false,isFormField:true,selections:[],selectedRecords:[],initComponent:function(){Ext.ux.form.ImageField.superclass.initComponent.call(this);this.addEvents("change","invalid","valid","expand","collapse");if(!this.view||!this.view.store){this.view=new Ext.DataView({store:new Ext.data.JsonStore({url:"/bonboa/listimages.php",root:"images",fields:["name","url",{name:"size",type:"float"},{name:"height",type:"float"},{name:"width",type:"float"},{name:"thumbheight",type:"float"},{name:"thumbwidth",type:"float"},{name:"thumbleft",type:"float"},{name:"thumbtop",type:"float"},{name:"lastmod",type:"date",dateFormat:"timestamp"}]}),tpl:new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="{name}">','<div class="thumb"><img src="{url}" ext:qtip="{title}" style="top:{thumbtop}px; left:{thumbleft}px; width:{thumbwidth}px; height:{thumbheight}px;"></div>',"<span>{label}</span>","</div>","</tpl>"),autoHeight:true,autoWidth:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",emptyText:"No images to display",loadingText:"Loading...",singleSelect:true})}if(this.view.store.autoLoad){this.isStoreLoaded=true}},getName:function(){return this.rendered&&this.hiddenField.dom.name?this.hiddenField.dom.name:""},getSelectedRecords:function(){this.selections=this.view.getSelectedIndexes();this.selectedRecords=this.view.getSelectedRecords();return this.selectedRecords},onRender:function(C,A){Ext.ux.form.ImageField.superclass.onRender.call(this,C,A);if(!this.el){var B=this.getAutoCreate();this.el=C.createChild(B,A)}this.imageEl=this.el.insertFirst({tag:"img",src:this.defaultImage});this.hiddenField=this.imageEl.insertSibling({tag:"input",type:"hidden",name:this.name,id:this.id+"-hidden"},"before");this.el.addClass([this.fieldClass,this.cls]);this.imageEl.addClass(this.fieldClass+"-image");this.initValue();this.wrap=this.imageEl.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger"});if(this.hideTrigger){this.trigger.setDisplayed(false)}this.initTrigger()},initTrigger:function(){this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove()}this.wrap.remove();Ext.ux.form.ImageField.superclass.onDestroy.call(this)},onDisable:function(){this.wrap.addClass("x-item-disabled");this.hiddenField.dom.disabled=true},onEnable:function(){this.wrap.removeClass("x-item-disabled");this.hiddenField.dom.disabled=false},onShow:function(){this.wrap.dom.style.display="";this.wrap.dom.style.visibility="visible"},onHide:function(){this.wrap.dom.style.display="none"},onSelect:function(){var B="";var A=(this.getSelectedRecords().length>0)?this.selectedRecords[0].get(this.valueField):"";if(A!==this.value){this.setValue(A)}this.window.hide();this.fireEvent("collapse",this,this.view)},onTriggerClick:function(A){if(this.disabled){return }if(!this.isStoreLoaded){this.view.store.load();this.isStoreLoaded=true}else{if(this.alwaysLoadStore===true){this.view.store.reload()}}this.windowConfig=Ext.apply(this.windowConfig,{title:this.browserTitle,width:this.browserWidth,height:this.browserHeight,draggable:false,resizable:false,closable:false,autoScroll:true,layout:"fit",bbar:[{text:"Cancel",handler:function(){this.view.clearSelections();this.window.hide();this.fireEvent("collapse",this,this.view)},scope:this},"->",{text:"Select",handler:this.onSelect,scope:this}],items:this.view},{shadow:false,frame:true});if(!this.window){this.window=new Ext.Window(this.windowConfig);this.window.setPagePosition(this.trigger.getRight(),this.trigger.getTop());this.view.on("dblclick",this.onSelect,this)}this.window.show();this.fireEvent("expand",this,this.view)},initValue:function(){if(this.value!==undefined){this.hiddenField.dom.value=(this.value===null||this.value===undefined?"":this.value)}else{this.hiddenField.dom.value=""}},isDirty:function(){if(this.disabled){return false}return String(this.getValue())!==String(this.originalValue)},afterRender:function(){Ext.ux.form.ImageField.superclass.afterRender.call(this);this.initEvents()},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay})}this.originalValue=this.getValue()},isValid:function(A){if(this.disabled){return true}var C=this.preventMark;this.preventMark=A===true;var B=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=C;return B},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(A){return A},validateValue:function(A){if(this.hiddenField.dom.value===""){this.markInvalid();return false}else{return true}},markInvalid:function(C){if(!this.rendered||this.preventMark){return }this.el.addClass(this.invalidClass);C=C||this.invalidText;switch(this.msgTarget){case"qtip":this.el.dom.qtip=C;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}break;case"title":this.el.dom.title=C;break;case"under":if(!this.errorEl){var B=this.getErrorCt();this.errorEl=B.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(B.getWidth(true)-20)}this.errorEl.update(C);Ext.ux.form.ImageField.msgFx[this.msgFx].show(this.errorEl,this);break;case"side":if(!this.errorIcon){var B=this.getErrorCt();this.errorIcon=B.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=C;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this);break;default:var A=Ext.getDom(this.msgTarget);A.innerHTML=C;A.style.display=this.msgDisplay;break}this.fireEvent("invalid",this,C)},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},clearInvalid:function(){if(!this.rendered||this.preventMark){return }this.el.removeClass(this.invalidClass);switch(this.msgTarget){case"qtip":this.el.dom.qtip="";break;case"title":this.el.dom.title="";break;case"under":if(this.errorEl){Ext.ux.form.ImageField.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 A=Ext.getDom(this.msgTarget);A.innerHTML="";A.style.display="none";break}this.fireEvent("valid",this)},getRawValue:function(){var A=this.rendered?this.hiddenField.getValue():Ext.value(this.value,"");return A},getValue:function(){if(!this.rendered){return this.value}var A=this.hiddenField.getValue();if(A===undefined){A=""}return A},setRawValue:function(A){return this.hiddenField.dom.value=(A===null||A===undefined?"":A)},setValue:function(A){var B=this.value;this.value=A;if(this.rendered){this.hiddenField.dom.value=(A===null||A===undefined?"":A);this.imageEl.dom.src=(A===null||A===undefined?"":A);this.fireEvent("change",this,B,A);this.validate()}}});Ext.ux.form.ImageField.msgFx={normal:{show:function(A,B){A.setDisplayed("block")},hide:function(A,B){A.setDisplayed(false).update("")}},slide:{show:function(A,B){A.slideIn("t",{stopFx:true})},hide:function(A,B){A.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(A,B){A.fixDisplay();A.alignTo(B.el,"tl-tr");A.slideIn("l",{stopFx:true})},hide:function(A,B){A.slideOut("l",{stopFx:true,useDisplay:true})}},formatData:function(A){A.label=(A.name.length>15)?A.name.substr(0,12)+"...":A.name;A.title="Name: "+A.name+"<br>Dimensions: "+A.width+" x "+A.height+"<br>Size: "+((A.size<1024)?A.size+" bytes":(Math.round(((A.size*10)/1024))/10)+" KB");if(A.width>A.height){if(A.width<80){A.thumbwidth=A.width;A.thumbheight=A.height}else{A.thumbwidth=80;A.thumbheight=80/A.width*A.height}}else{if(A.height<80){A.thumbwidth=A.width;A.thumbheight=A.height}else{A.thumbwidth=80/A.height*A.width;A.thumbheight=80}}A.thumbleft=(Math.round((80-A.thumbwidth)/2))+"px";A.thumbtop=(Math.round((80-A.thumbheight)/2))+"px";A.thumbwidth=Math.round(A.thumbwidth)+"px";A.thumbheight=Math.round(A.thumbheight)+"px";lookup[A.name]=A;return A}};Ext.reg("imagefield",Ext.ux.form.ImageField);Ext.form.FileUploadField=Ext.extend(Ext.form.TextField,{buttonTooltip:"",buttonText:"Browse...",buttonOnly:false,buttonOffset:3,readOnly:true,autoSize:Ext.emptyFn,initComponent:function(){Ext.form.FileUploadField.superclass.initComponent.call(this);this.addEvents("fileselected")},onRender:function(C,A){Ext.form.FileUploadField.superclass.onRender.call(this,C,A);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-file-wrap"});this.el.addClass("x-form-file-text");this.el.dom.removeAttribute("name");this.fileInput=this.wrap.createChild({id:this.getFileInputId(),name:this.name||this.getId(),cls:"x-form-file",tag:"input",type:"file",size:20});var B=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText});if(this.buttonTooltip){Ext.apply(B,{tooltip:this.buttonTooltip})}this.button=new Ext.Button(Ext.apply(B,{renderTo:this.wrap,cls:"x-form-file-btn"+(B.iconCls?" x-btn-icon":"")}));if(this.buttonOnly){this.el.hide();this.wrap.setWidth(this.button.getEl().getWidth())}this.fileInput.on("change",function(){var D=this.fileInput.dom.value;this.setValue(D);this.fireEvent("fileselected",this,D)},this)},getFileInputId:function(){return this.id+"-file"},onResize:function(A,B){Ext.form.FileUploadField.superclass.onResize.call(this,A,B);this.wrap.setWidth(A);if(!this.buttonOnly){var A=this.wrap.getWidth()-this.button.getEl().getWidth()-this.buttonOffset;this.el.setWidth(A)}},preFocus:Ext.emptyFn,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}});Ext.reg("fileuploadfield",Ext.form.FileUploadField);var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(A){return binl2hex(core_md5(str2binl(A),A.length*chrsz))}function b64_md5(A){return binl2b64(core_md5(str2binl(A),A.length*chrsz))}function str_md5(A){return binl2str(core_md5(str2binl(A),A.length*chrsz))}function hex_hmac_md5(A,B){return binl2hex(core_hmac_md5(A,B))}function b64_hmac_md5(A,B){return binl2b64(core_hmac_md5(A,B))}function str_hmac_md5(A,B){return binl2str(core_hmac_md5(A,B))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(K,F){K[F>>5]|=128<<((F)%32);K[(((F+64)>>>9)<<4)+14]=F;var J=1732584193;var I=-271733879;var H=-1732584194;var G=271733878;for(var C=0;C<K.length;C+=16){var E=J;var D=I;var B=H;var A=G;J=md5_ff(J,I,H,G,K[C+0],7,-680876936);G=md5_ff(G,J,I,H,K[C+1],12,-389564586);H=md5_ff(H,G,J,I,K[C+2],17,606105819);I=md5_ff(I,H,G,J,K[C+3],22,-1044525330);J=md5_ff(J,I,H,G,K[C+4],7,-176418897);G=md5_ff(G,J,I,H,K[C+5],12,1200080426);H=md5_ff(H,G,J,I,K[C+6],17,-1473231341);I=md5_ff(I,H,G,J,K[C+7],22,-45705983);J=md5_ff(J,I,H,G,K[C+8],7,1770035416);G=md5_ff(G,J,I,H,K[C+9],12,-1958414417);H=md5_ff(H,G,J,I,K[C+10],17,-42063);I=md5_ff(I,H,G,J,K[C+11],22,-1990404162);J=md5_ff(J,I,H,G,K[C+12],7,1804603682);G=md5_ff(G,J,I,H,K[C+13],12,-40341101);H=md5_ff(H,G,J,I,K[C+14],17,-1502002290);I=md5_ff(I,H,G,J,K[C+15],22,1236535329);J=md5_gg(J,I,H,G,K[C+1],5,-165796510);G=md5_gg(G,J,I,H,K[C+6],9,-1069501632);H=md5_gg(H,G,J,I,K[C+11],14,643717713);I=md5_gg(I,H,G,J,K[C+0],20,-373897302);J=md5_gg(J,I,H,G,K[C+5],5,-701558691);G=md5_gg(G,J,I,H,K[C+10],9,38016083);H=md5_gg(H,G,J,I,K[C+15],14,-660478335);I=md5_gg(I,H,G,J,K[C+4],20,-405537848);J=md5_gg(J,I,H,G,K[C+9],5,568446438);G=md5_gg(G,J,I,H,K[C+14],9,-1019803690);H=md5_gg(H,G,J,I,K[C+3],14,-187363961);I=md5_gg(I,H,G,J,K[C+8],20,1163531501);J=md5_gg(J,I,H,G,K[C+13],5,-1444681467);G=md5_gg(G,J,I,H,K[C+2],9,-51403784);H=md5_gg(H,G,J,I,K[C+7],14,1735328473);I=md5_gg(I,H,G,J,K[C+12],20,-1926607734);J=md5_hh(J,I,H,G,K[C+5],4,-378558);G=md5_hh(G,J,I,H,K[C+8],11,-2022574463);H=md5_hh(H,G,J,I,K[C+11],16,1839030562);I=md5_hh(I,H,G,J,K[C+14],23,-35309556);J=md5_hh(J,I,H,G,K[C+1],4,-1530992060);G=md5_hh(G,J,I,H,K[C+4],11,1272893353);H=md5_hh(H,G,J,I,K[C+7],16,-155497632);I=md5_hh(I,H,G,J,K[C+10],23,-1094730640);J=md5_hh(J,I,H,G,K[C+13],4,681279174);G=md5_hh(G,J,I,H,K[C+0],11,-358537222);H=md5_hh(H,G,J,I,K[C+3],16,-722521979);I=md5_hh(I,H,G,J,K[C+6],23,76029189);J=md5_hh(J,I,H,G,K[C+9],4,-640364487);G=md5_hh(G,J,I,H,K[C+12],11,-421815835);H=md5_hh(H,G,J,I,K[C+15],16,530742520);I=md5_hh(I,H,G,J,K[C+2],23,-995338651);J=md5_ii(J,I,H,G,K[C+0],6,-198630844);G=md5_ii(G,J,I,H,K[C+7],10,1126891415);H=md5_ii(H,G,J,I,K[C+14],15,-1416354905);I=md5_ii(I,H,G,J,K[C+5],21,-57434055);J=md5_ii(J,I,H,G,K[C+12],6,1700485571);G=md5_ii(G,J,I,H,K[C+3],10,-1894986606);H=md5_ii(H,G,J,I,K[C+10],15,-1051523);I=md5_ii(I,H,G,J,K[C+1],21,-2054922799);J=md5_ii(J,I,H,G,K[C+8],6,1873313359);G=md5_ii(G,J,I,H,K[C+15],10,-30611744);H=md5_ii(H,G,J,I,K[C+6],15,-1560198380);I=md5_ii(I,H,G,J,K[C+13],21,1309151649);J=md5_ii(J,I,H,G,K[C+4],6,-145523070);G=md5_ii(G,J,I,H,K[C+11],10,-1120210379);H=md5_ii(H,G,J,I,K[C+2],15,718787259);I=md5_ii(I,H,G,J,K[C+9],21,-343485551);J=safe_add(J,E);I=safe_add(I,D);H=safe_add(H,B);G=safe_add(G,A)}return Array(J,I,H,G)}function md5_cmn(F,C,B,A,E,D){return safe_add(bit_rol(safe_add(safe_add(C,F),safe_add(A,D)),E),B)}function md5_ff(C,B,G,F,A,E,D){return md5_cmn((B&G)|((~B)&F),C,B,A,E,D)}function md5_gg(C,B,G,F,A,E,D){return md5_cmn((B&F)|(G&(~F)),C,B,A,E,D)}function md5_hh(C,B,G,F,A,E,D){return md5_cmn(B^G^F,C,B,A,E,D)}function md5_ii(C,B,G,F,A,E,D){return md5_cmn(G^(B|(~F)),C,B,A,E,D)}function core_hmac_md5(C,F){var E=str2binl(C);if(E.length>16){E=core_md5(E,C.length*chrsz)}var A=Array(16),D=Array(16);for(var B=0;B<16;B++){A[B]=E[B]^909522486;D[B]=E[B]^1549556828}var G=core_md5(A.concat(str2binl(F)),512+F.length*chrsz);return core_md5(D.concat(G),512+128)}function safe_add(A,D){var C=(A&65535)+(D&65535);var B=(A>>16)+(D>>16)+(C>>16);return(B<<16)|(C&65535)}function bit_rol(A,B){return(A<<B)|(A>>>(32-B))}function str2binl(D){var C=Array();var A=(1<<chrsz)-1;for(var B=0;B<D.length*chrsz;B+=chrsz){C[B>>5]|=(D.charCodeAt(B/chrsz)&A)<<(B%32)}return C}function binl2str(C){var D="";var A=(1<<chrsz)-1;for(var B=0;B<C.length*32;B+=chrsz){D+=String.fromCharCode((C[B>>5]>>>(B%32))&A)}return D}function binl2hex(C){var B=hexcase?"0123456789ABCDEF":"0123456789abcdef";var D="";for(var A=0;A<C.length*4;A++){D+=B.charAt((C[A>>2]>>((A%4)*8+4))&15)+B.charAt((C[A>>2]>>((A%4)*8))&15)}return D}function binl2b64(D){var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var F="";for(var B=0;B<D.length*4;B+=3){var E=(((D[B>>2]>>8*(B%4))&255)<<16)|(((D[B+1>>2]>>8*((B+1)%4))&255)<<8)|((D[B+2>>2]>>8*((B+2)%4))&255);for(var A=0;A<4;A++){if(B*8+A*6>D.length*32){F+=b64pad}else{F+=C.charAt((E>>6*(3-A))&63)}}}return F};Ext.namespace("Ext.ux");Ext.ux.PasswordField=function(A){if(!A){A={}}Ext.ux.PasswordField.superclass.constructor.call(this,A);this.showCapsWarning=A.showCapsWarning||false;this.showStrengthMeter=A.showStrengthMeter||true;this.pwStrengthTest=A.pwStrengthTest||this.calcStrength;this.pwStrengthMeterCls=A.pwStrengthMeterCls||"x-form-password-strengthMeter";this.pwStrengthMeterFocusCls=A.pwStrengthMeterFocusCls||"x-form-password-strengthMeter-focus";this.pwStrengthScoreBarCls=A.pwStrengthScoreBarCls||"x-form-password-scoreBar"};Ext.extend(Ext.ux.PasswordField,Ext.form.TextField,{inputType:"password",onRender:function(B,A){Ext.ux.PasswordField.superclass.onRender.call(this,B,A);if(this.showCapsWarning){var C=Ext.id();this.alertBox=Ext.DomHelper.append(document.body,{tag:"div",style:"width: 10em",children:[{tag:"div",style:"text-align: center; color: red;",html:"Caps Lock is on.",id:C}]},true);Ext.fly(C).boxWrap();this.alertBox.hide()}if(this.showStrengthMeter){this.objMeter=B.createChild({tag:"div","class":this.pwStrengthMeterCls});this.objMeter.setWidth(B.first("INPUT").getWidth(false));this.scoreBar=this.objMeter.createChild({tag:"div","class":this.pwStrengthScoreBarCls});if(Ext.isIE&&!Ext.isIE7){this.objMeter.setStyle("margin-left","3px")}}},afterRender:function(){Ext.ux.PasswordField.superclass.afterRender.call(this);this.objMeter.setWidth(this.el.getWidth(false))},initEvents:function(){Ext.ux.PasswordField.superclass.initEvents.call(this);this.el.on("keypress",this.handleKeypress,this);this.el.on("blur",this.handleBlur,this);this.el.on("focus",this.handleFocus,this);this.el.on("keyup",this.handleKeyUp,this)},handleFocus:function(A){if(!Ext.isOpera){this.objMeter.addClass(this.pwStrengthMeterFocusCls)}},handleBlur:function(A){if(!Ext.isOpera){this.objMeter.removeClass(this.pwStrengthMeterFocusCls)}if(this.showCapsWarning){this.hideCapsMessage()}},handleKeypress:function(B){var A=B.getCharCode();if(A==B.ESC){this.setRawValue("")}if(this.showCapsWarning){if((B.shiftKey&&A>=97&&A<=122)||(!B.shiftKey&&A>=65&&A<=90)){this.showCapsMessage(B.target)}else{this.hideCapsMessage()}}},handleKeyUp:function(A){if(this.showStrengthMeter){this.updateMeter(A)}},showCapsMessage:function(B){var A=this.showStrengthMeter?"tl-tr":"l-r";this.alertBox.alignTo(B,A,[5,0]);this.alertBox.show()},hideCapsMessage:function(){this.alertBox.hide()},updateMeter:function(D){var F=0;var C=D.target.value;var B=this.objMeter.getWidth()-2;var A=this.pwStrengthTest(C);if(A>100){A=100}var E=(B/100)*A;this.scoreBar.setWidth(E,true)},calcStrength:function(B){var A=0;if(B.length==0){return(A)}A+=B.length;if(B.length>0&&B.length<=4){A+=B.length}else{if(B.length>=5&&B.length<=7){A+=6}else{if(B.length>=8&&B.length<=15){A+=12}else{if(B.length>=16){A+=18}}}}if(B.match(/[a-z]/)){A+=1}if(B.match(/[A-Z]/)){A+=5}if(B.match(/\d/)){A+=5}if(B.match(/.*\d.*\d.*\d/)){A+=5}if(B.match(/[!,@,#,$,%,^,&,*,?,_,~]/)){A+=5}if(B.match(/.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~]/)){A+=5}if(B.match(/(?=.*[a-z])(?=.*[A-Z])/)){A+=2}if(B.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/)){A+=2}if(B.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!,@,#,$,%,^,&,*,?,_,~])/)){A+=2}return Math.round(A*2)}});if(!Ext.isArray){Ext.isArray=function(A){return A&&"function"===typeof A.pop}}Ext.ux.MetaForm=Ext.extend(Ext.FormPanel,{autoInit:true,border:false,frame:true,loadingText:"Loading...",savingText:"Saving...",buttonMinWidth:90,columnCount:1,labelAlign:"right",initComponent:function(){Ext.apply(this,{items:this.items||{}});if("function"===typeof this.getButton){this.buttons=this.getButtons()}Ext.ux.MetaForm.superclass.initComponent.apply(this,arguments);this.addEvents("cancel","ok");this.form.addEvents("bonboa_insert","bonboa_update","bonboa_delete");this.form.on({beforeaction:{scope:this,fn:this.beforeAction},actioncomplete:{scope:this,fn:function(A,B){if("load"===B.type&&B.result.metaData){this.onMetaChange(this,B.result.metaData)}else{if("submit"===B.type){this.updateBoundData()}}}}});this.form.trackResetOnLoad=true},beforeAction:function(A,B){B.success=function(D){var C=this.processResponse(D);if(C===true||!C.success){this.failureType=Ext.form.Action.LOAD_FAILURE;if(C.errors){this.form.markInvalid(C.errors);this.failureType=Ext.form.Action.SERVER_INVALID}this.form.afterAction(this,false);return }this.form.afterAction(this,true);this.form.clearInvalid();if(C.data){this.form.setValues(C.data)}else{this.form.setValues([])}}},bind:function(A){this.data=A;this.form.setValues(this.data)},getButtons:function(){var A=[];if(Ext.isArray(this.createButtons)){Ext.each(this.createButtons,function(B){var C;switch(B){case"meta":C=this.getButton(B,{handler:this.load.createDelegate(this,[{params:{meta:true}}])});break;case"load":C=this.getButton(B,{scope:this,handler:this.load});break;case"defaults":C=this.getButton(B,{scope:this,handler:this.setDefaultValues});break;case"reset":C=this.getButton(B,{scope:this,handler:this.reset});break;case"save":case"submit":C=this.getButton(B,{handler:this.submit.createDelegate(this,[{params:{cmd:"setPref"}}])});break;case"ok":C=this.getButton(B,{scope:this,handler:this.onOk});break;case"cancel":C=this.getButton(B,{scope:this,handler:this.onCancel});break}if(C){Ext.apply(C,{minWidth:this.buttonMinWidth});A.push(C)}},this)}return A},getOptions:function(B){var A={url:this.url,method:this.method||"post"};Ext.apply(A,B);A.params=Ext.apply(this.baseParams||{},B.params);return A},getValues:function(){var A={};this.form.items.each(function(B){A[B.name]=B.getValue()});return A},load:function(B){var A=this.getOptions(B);if(this.loadingText){A.waitMsg=this.loadingText}this.form.load(A)},onCancel:function(){this.fireEvent("cancel",this)},onMetaChange:function(D,E){this.removeAll();var C,B,A,G={};this.add(new Ext.Panel({layout:"column",anchor:"100%",border:false,defaults:(function(){this.columnCount=E.formConfig?E.formConfig.columnCount||this.columnCount:this.columnCount;return Ext.apply({},E.formConfig||{},{columnWidth:1/this.columnCount,autoHeight:true,border:false,hideLabel:true,layout:"form"})}).createDelegate(this)(),items:(function(){var H=[];for(var I=0;I<this.columnCount;I++){H.push({defaults:this.defaults,listeners:{add:{scope:this,fn:this.onAdd}}})}return H}).createDelegate(this)()}));C=this.items.get(0).items;B=0;A=1;if(Ext.isArray(this.ignoreFields)){Ext.each(this.ignoreFields,function(H){G[H]=true})}Ext.each(E.columns||E.fields,function(I){if(true===G[I.name]){return }var H=Ext.apply({},I.editor,{name:I.name||I.dataIndex,fieldLabel:I.fieldLabel||I.header,defaultValue:I.defaultValue,xtype:I.editor&&I.editor.xtype?I.editor.xtype:"textfield"});if(H.editor&&H.editor.regex){H.editor.regex=new RegExp(I.editor.regex)}if(H.xtype==="checkbox"){Ext.apply(H,{boxLabel:" ",checked:I.defaultValue})}if(H.xtype==="bonboa_document"||H.xtype==="bonboa_file"||H.xtype==="bonboa_image"||H.xtype==="bonboa_media"){Ext.apply(H,{width:"430px"})}if(H.append){Ext.each(H.append,function(J){if(J.xtype=="button"&&J.action){J.handler=function(){bonboa_button_handler(J.action,H.id,J.confirm)}}else{if(J.xtype==="bonboa_combo_link"){if(J.store&&J.store.data&&J.store.fields){Ext.apply(J,{store:new Ext.data.SimpleStore(J.store),listeners:{select:function(M,K,L){M.clearValue();if(K.data.table&&K.data.id){bonboa_edit(K.data.label,"bonboa/meta/fetch/"+K.data.table+"/"+K.data.id+"/dutch/edit","bonboa/meta/store/"+K.data.table+"/"+K.data.id+"/","edit",false)}}}})}}}})}if(H.xtype==="bonboa_html"){if(E.formConfig&&E.formConfig.customStyles){plugins=[new Ext.ux.HTMLEditorImage(),new Ext.ux.HTMLEditorStyles(E.formConfig.customStyles)]}else{plugins=[new Ext.ux.HTMLEditorImage()]}Ext.apply(H,{plugins:plugins,styles:["/bonboa/lib/ext.ux/htmleditorimage/htmleditor.css"],toolbarItemExcludes:["fonts","allfontsizes","allcolors"]})}else{if(H.xtype==="bonboa_combo_link"){if(H.store&&H.store.data&&H.store.fields){Ext.apply(H,{store:new Ext.data.SimpleStore(H.store)})}}}if(H.xtype==="bonboa_tabpanel"){Ext.each(H.items,function(J){Ext.each(J.items,function(K){if(K.xtype==="bonboa_html"){if(Ext.isGecko){if(E.formConfig&&E.formConfig.customStyles){plugins=[new Ext.ux.HTMLEditorImage(),new Ext.ux.HTMLEditorStyles(E.formConfig.customStyles)]}else{plugins=[new Ext.ux.HTMLEditorImage()]}}else{plugins=null}Ext.apply(K,{plugins:plugins,styles:["bonboa/lib/ext.ux/htmleditorimage/htmleditor.css"],toolbarItemExcludes:["fonts","allfontsizes","allcolors"]})}else{if(K.xtype==="bonboa_combo_link"){if(K.store&&K.store.data&&K.store.fields){Ext.apply(K,{store:new Ext.data.SimpleStore(K.store)})}}else{if(K.xtype==="bonboa_gmappanel"){Ext.apply(K,{addControl:[new GSmallMapControl(),new GMapTypeControl(),new GOverviewMapControl(),new GScaleControl()]})}}}})})}if(E.formConfig.msgTarget){H.msgTarget=E.formConfig.msgTarget}H.tabIndex=A++;C.get(B++).add(H);B=B===this.columnCount?0:B},this);this.doLayout();var F=Ext.getCmp("bonboa_metaform_window");if(F!=null){F.center()}},onOk:function(){this.updateBoundData();this.fireEvent("ok",this)},onRender:function(){Ext.ux.MetaForm.superclass.onRender.apply(this,arguments);this.form.waitMsgTarget=this.el;if(true===this.autoInit){this.load({params:{meta:true}})}else{if("object"===typeof this.autoInit){this.load(this.autoInit)}}},removeAll:function(){var A=this.body.up("div.x-panel-bwrap").prev();if(A){A.applyStyles({border:"none"})}this.items.each(this.remove,this);this.form.items.clear()},reset:function(){this.form.reset()},setDefaultValues:function(){this.form.items.each(function(A){A.setValue(A.defaultValue)})},submit:function(B){var A=this.getOptions(B);if(this.savingText){A.waitMsg=this.savingText}this.form.submit(A)},updateBoundData:function(){if(this.data){Ext.apply(this.data,this.getValues())}}});Ext.reg("metaform",Ext.ux.MetaForm);Ext.namespace("Ext.ux");Ext.ux.FormWindow=function(A){Ext.apply(this,A);Ext.ux.FormWindow.superclass.constructor.call(this)};Ext.extend(Ext.ux.FormWindow,Ext.Window,{monitorValid:false,monitorPoll:200,initComponent:function(){Ext.ux.FormWindow.superclass.initComponent.call(this);this.addEvents("clientvalidation")},initEvents:function(){Ext.ux.FormWindow.superclass.initEvents.call(this);if(this.monitorValid){this.startMonitoring()}},startMonitoring:function(){if(!this.bound){this.bound=true;Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){this.bound=false},bindHandler:function(){if(!this.bound){return false}var F=true;this.cascade(function(H){if(H.form){if(!H.form.isValid()){F=false;return false}}});if(this.buttons){for(var E=0,A=this.buttons.length;E<A;E++){var D=this.buttons[E];if(D.formBind===true&&D.disabled===F){D.setDisabled(!F)}}}if(this.items){if(this.items.buttons){for(var E=0,A=this.items.buttons.length;E<A;E++){var D=this.items.buttons[E];if(D.formBind===true&&D.disabled===F){D.setDisabled(!F)}}}for(var C=0,B=this.items.length;C<B;C++){var G=this.items[C];if(G.buttons){for(var E=0,A=G.buttons.length;E<A;E++){var D=G.buttons[E];if(D.formBind===true&&D.disabled===F){D.setDisabled(!F)}}}}}this.fireEvent("clientvalidation",this,F)}});var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();var ZeroClipboard={version:"1.0.4",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(A){if(typeof (A)=="string"){A=document.getElementById(A)}if(!A.addClass){A.hide=function(){this.style.display="none"};A.show=function(){this.style.display=""};A.addClass=function(B){this.removeClass(B);this.className+=" "+B};A.removeClass=function(B){this.className=this.className.replace(new RegExp("\\s*"+B+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")};A.hasClass=function(B){return !!this.className.match(new RegExp("\\s*"+B+"\\s*"))}}return A},setMoviePath:function(A){this.moviePath=A},dispatch:function(D,B,C){var A=this.clients[D];if(A){A.receiveEvent(B,C)}},register:function(B,A){this.clients[B]=A},getDOMObjectPosition:function(B){var A={left:0,top:0,width:B.width?B.width:B.offsetWidth,height:B.height?B.height:B.offsetHeight};while(B){A.left+=B.offsetLeft;A.top+=B.offsetTop;B=B.offsetParent}return A},Client:function(A){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(A){this.glue(A)}}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(D){this.domElement=ZeroClipboard.$(D);var E=99;if(this.domElement.style.zIndex){E=parseInt(this.domElement.style.zIndex)+1}var C=ZeroClipboard.getDOMObjectPosition(this.domElement);this.div=document.createElement("div");var B=this.div.style;B.position="absolute";B.left=""+C.left+"px";B.top=""+C.top+"px";B.width=""+C.width+"px";B.height=""+C.height+"px";B.zIndex=E;var A=document.getElementsByTagName("body")[0];A.appendChild(this.div);this.div.innerHTML=this.getHTML(C.width,C.height)},getHTML:function(D,A){var C="";var B="id="+this.id+"&width="+D+"&height="+A;if(navigator.userAgent.match(/MSIE/)){var E=location.href.match(/^https/i)?"https://":"http://";C+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+E+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+D+'" height="'+A+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+B+'"/><param name="wmode" value="transparent"/></object>'}else{C+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+D+'" height="'+A+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+B+'" wmode="transparent" />'}return C},hide:function(){if(this.div){this.div.style.left="-2000px"}},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var A=document.getElementsByTagName("body")[0];try{A.removeChild(this.div)}catch(B){}this.domElement=null;this.div=null}},reposition:function(C){if(C){this.domElement=ZeroClipboard.$(C);if(!this.domElement){this.hide()}}if(this.domElement&&this.div){var B=ZeroClipboard.getDOMObjectPosition(this.domElement);var A=this.div.style;A.left=""+B.left+"px";A.top=""+B.top+"px"}},setText:function(A){this.clipText=A;if(this.ready){this.movie.setText(A)}},addEventListener:function(A,B){A=A.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[A]){this.handlers[A]=[]}this.handlers[A].push(B)},setHandCursor:function(A){this.handCursorEnabled=A;if(this.ready){this.movie.setHandCursor(A)}},setCSSEffects:function(A){this.cssEffects=!!A},receiveEvent:function(D,E){D=D.toString().toLowerCase().replace(/^on/,"");switch(D){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var C=this;setTimeout(function(){C.receiveEvent("load",null)},1);return }if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var C=this;setTimeout(function(){C.receiveEvent("load",null)},100);this.ready=true;return }this.ready=true;this.movie.setText(this.clipText);this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":if(this.domElement&&this.cssEffects){this.domElement.addClass("hover");if(this.recoverActive){this.domElement.addClass("active")}}break;case"mouseout":if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass("active")){this.domElement.removeClass("active");this.recoverActive=true}this.domElement.removeClass("hover")}break;case"mousedown":if(this.domElement&&this.cssEffects){this.domElement.addClass("active")}break;case"mouseup":if(this.domElement&&this.cssEffects){this.domElement.removeClass("active");this.recoverActive=false}break}if(this.handlers[D]){for(var B=0,A=this.handlers[D].length;B<A;B++){var F=this.handlers[D][B];if(typeof (F)=="function"){F(this,E)}else{if((typeof (F)=="object")&&(F.length==2)){F[0][F[1]](this,E)}else{if(typeof (F)=="string"){window[F](this,E)}}}}}}};Ext.namespace("Ext.ux");Ext.ux.GMapPanel=Ext.extend(Ext.Panel,{initComponent:function(){var A={plain:true,zoomLevel:3,yaw:180,pitch:0,zoom:0,gmapType:"map",border:false};Ext.applyIf(this,A);Ext.ux.GMapPanel.superclass.initComponent.call(this)},afterRender:function(){var B=this.ownerCt.getSize();Ext.applyIf(this,B);Ext.ux.GMapPanel.superclass.afterRender.call(this);if(this.gmapType==="map"||this.gmapType==="satellite"||this.gmapType==="hybrid"){this.gmap=new GMap2(this.body.dom);jjr=this;if(typeof this.zoom_field==="string"){GEvent.addListener(this.gmap,"zoomend",function(){var E=jjr.gmap.getZoom();document.getElementById("bonboa_field_"+jjr.zoom_field).value=E.toString()})}if(typeof this.maptype_field==="string"){GEvent.addListener(this.gmap,"maptypechanged",function(){var E=jjr.gmap.getCurrentMapType();document.getElementById("bonboa_field_"+jjr.maptype_field).value=E.getName()})}}if(this.gmapType==="panorama"){this.gmap=new GStreetviewPanorama(this.body.dom)}if(typeof this.addControl==="object"&&(this.gmapType==="map"||this.gmapType==="satellite"||this.gmapType==="hybrid")){if(this.addControl.length){for(var C=0;C<this.addControl.length;C++){this.gmap.addControl(this.addControl[C])}}else{this.gmap.addControl(this.addControl)}}if(typeof this.setCenter==="object"){if(typeof this.setCenter.geoCodeAddr==="string"){this.geoCodeLookup(this.setCenter.geoCodeAddr)}else{if(this.gmapType==="map"||this.gmapType==="satellite"||this.gmapType==="hybrid"){var A=new GLatLng(this.setCenter.lat,this.setCenter["long"]);if(typeof this.zoomLevel==="string"){this.zoomLevel=parseInt(this.zoomLevel)}this.gmap.setCenter(A,this.zoomLevel)}if(typeof this.setCenter.marker==="object"&&typeof A==="object"){this.addMarker(A,this.setCenter.marker,this.setCenter.marker.clear)}}if(this.gmapType==="panorama"){this.gmap.setLocationAndPOV(new GLatLng(this.setCenter.lat,this.setCenter["long"]),{yaw:this.yaw,pitch:this.pitch,zoom:this.zoom})}}if(this.gmapType=="map"||this.gmapType=="satellite"||this.gmapType=="hybrid"){if(this.gmapType=="map"){this.gmap.setMapType(G_NORMAL_MAP)}if(this.gmapType=="satellite"){this.gmap.setMapType(G_SATELLITE_MAP)}if(this.gmapType=="hybrid"){this.gmap.setMapType(G_HYBRID_MAP)}}var D=new Ext.util.DelayedTask();D.delay(300,function(){this.addMarkers(this.markers)},this)},onResize:function(A,B){if(typeof this.gmap=="object"){this.gmap.checkResize()}Ext.ux.GMapPanel.superclass.onResize.call(this,A,B)},setSize:function(C,A,B){if(typeof this.gmap=="object"){this.gmap.checkResize()}Ext.ux.GMapPanel.superclass.setSize.call(this,C,A,B)},getMap:function(){return this.gmap},addMarkers:function(C){if(Ext.isArray(C)){for(var B=0;B<C.length;B++){var A=new GLatLng(C[B].lat,C[B]["long"]);this.addMarker(A,C[B].marker,false,C[B].setCenter)}}},addMarker:function(C,D,B,A){Ext.applyIf(D,G_DEFAULT_ICON);if(B===true){this.gmap.clearOverlays()}if(A===true){if(typeof this.zoomLevel==="string"){this.zoomLevel=parseInt(this.zoomLevel)}this.gmap.setCenter(C,this.zoomLevel)}if(typeof this.latitude_field==="string"&&typeof this.longitude_field==="string"){D.draggable=true}var E=new GMarker(C,D);if(typeof this.latitude_field==="string"&&typeof this.longitude_field==="string"){E.draggable=true;jjr=this;GEvent.addListener(E,"dragend",function(){var F=E.getPoint();document.getElementById("bonboa_field_"+jjr.latitude_field).value=F.lat().toString();document.getElementById("bonboa_field_"+jjr.longitude_field).value=F.lng().toString()})}this.gmap.addOverlay(E)},geoCodeLookup:function(A){this.geocoder=new GClientGeocoder();this.geocoder.getLocations(A,this.addAddressToMap.createDelegate(this))},addAddressToMap:function(A){if(!A||A.Status.code!=200){Ext.MessageBox.alert("Error","Code "+A.Status.code+" Error Returned")}else{place=A.Placemark[0];addressinfo=place.AddressDetails;accuracy=addressinfo.Accuracy;if(accuracy===0){Ext.MessageBox.alert("Unable to Locate Address","Unable to Locate the Address you provided")}else{if(accuracy<7){Ext.MessageBox.alert("Address Accuracy","The address provided has a low accuracy.<br><br>Level "+accuracy+" Accuracy (8 = Exact Match, 1 = Vague Match)")}else{point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);if(typeof this.setCenter.marker==="object"&&typeof point==="object"){this.addMarker(point,this.setCenter.marker,this.setCenter.marker.clear,true)}}}}}});Ext.reg("gmappanel",Ext.ux.GMapPanel);Ext.ux.SlideZone=function(B,A){if(B){Ext.apply(this,A);this.init(B,A||{})}else{return false}};Ext.extend(Ext.ux.SlideZone,Ext.BoxComponent,{size:100,sliderSnap:[0],type:"horizontal",sliderWidth:20,sliderHeight:20,cls:null,minValue:0,maxValue:100,allowSliderCrossing:true,value:null,init:function(E,B){this.size=this.size instanceof Array?this.size:[this.size];this.minValue=this.minValue instanceof Array?this.minValue:[this.minValue];this.maxValue=this.maxValue instanceof Array?this.maxValue:[this.maxValue];this.sliderSnap=this.sliderSnap instanceof Array?this.sliderSnap:[this.sliderSnap];this.el=Ext.DomHelper.append(Ext.get(E),{tag:"div",id:Ext.id(),style:"position: relative; "},true);this.el.addClass("x-slide-zone-"+this.type);this.el.addClass(this.cls);switch(this.type){case"horizontal":this.sliderSize=[this.sliderWidth];this.el.applyStyles({width:this.size[0]+"px"});this.el.lowLimit=[this.el.getX()];this.el.highLimit=[this.el.getRight()];break;case"vertical":this.sliderSize=[this.sliderHeight];this.el.applyStyles({height:this.size[0]+"px"});this.el.lowLimit=[this.el.getY()];this.el.highLimit=[this.el.getBottom()];break;case"area":this.sliderSize=[this.sliderWidth,this.sliderHeight];this.el.applyStyles({width:this.size[0]+"px"});this.el.applyStyles({height:this.size[1]+"px"});this.el.lowLimit=this.el.getXY();this.el.highLimit=[this.el.getRight(),this.el.getBottom()];break}var A=this.sliderSize.length;for(var C=0;C<A;C++){this.sliderSize[C]=this.sliderSize[C]%2?this.sliderSize[C]+1:this.sliderSize[C]}var D=this.sliders;this.sliders=new Ext.util.MixedCollection();if(D){this.add.apply(this,D)}},add:function(){var B=arguments,A=B.length;for(var C=0;C<A;C++){var E=B[C];if(E instanceof Ext.ux.Slider){this.initSlider(E);this.sliders.add(E)}else{if(typeof E=="object"){var D=new Ext.ux.ThumbSlider(E);this.initSlider(D);this.sliders.add(D)}}}this.updateValues();this.updateConstraints()},enableCrossing:function(){this.allowSliderCrossing=true;this.updateConstraints()},disableCrossing:function(){this.allowSliderCrossing=false;this.updateConstraints()},getSlider:function(A){switch(typeof A){case"number":return this.sliders.items[A];break;case"string":var B=this.sliders.length;for(var C=0;C<B;C++){if(this.sliders.items[C].name==A){return this.sliders.items[C]}}break}},updateConstraints:function(){if(!this.allowSliderCrossing&&this.sliders.length>1&&this.type!="area"){sortFN=function(I,H){var K=I.value instanceof Array?I.value[0]:I.value;var J=H.value instanceof Array?H.value[0]:H.value;return K>J?1:(K<J?-1:0)};this.sliders.sort("asc",sortFN);var B=this.sliders.length;for(var C=0;C<B;C++){var F=0,G=0;var A=this.sliders.get(C-1);var E=this.sliders.get(C);var D=this.sliders.get(C+1);if(A&&D){if(A instanceof Ext.ux.ThumbSlider){var F=E.getTL()[0]-A.getTL()[0]-this.sliderSnap[0]}if(A instanceof Ext.ux.RangeSlider){var F=E.getTL()[0]-A.getBR()[0]-this.sliderSnap[0]}if(D instanceof Ext.ux.ThumbSlider){var G=D.getTL()[0]-E.getTL()[0]-this.sliderSnap[0]}if(D instanceof Ext.ux.RangeSlider){var G=D.getTL()[0]-E.getBR()[0]-this.sliderSnap[0]}}else{if(A){if(A instanceof Ext.ux.ThumbSlider){var G=this.el.highLimit[0]-E.getTL()[0]-(0.5*this.sliderSize[0]);var F=E.getTL()[0]-A.getTL()[0]-this.sliderSnap[0]}if(A instanceof Ext.ux.RangeSlider){var G=this.el.highLimit[0]-E.getBR()[0];var F=E.getTL()[0]-A.getBR()[0]-this.sliderSnap[0]}}else{if(D){if(D instanceof Ext.ux.ThumbSlider){var F=E.getTL()[0]-this.el.lowLimit[0]+(0.5*this.sliderSize[0]);var G=D.getTL()[0]-E.getTL()[0]-this.sliderSnap[0]}if(D instanceof Ext.ux.RangeSlider){var F=E.getTL()[0]-this.el.lowLimit[0];var G=D.getTL()[0]-E.getBR()[0]-this.sliderSnap[0]}}}}if(E instanceof Ext.ux.RangeSlider){E.resizable.leftTravel=[F];E.resizable.rightTravel=[G]}E.setConstraint([F],[G],this.sliderSnap)}}else{var B=this.sliders.length;for(var C=0;C<B;C++){var E=this.sliders.get(C);if(E instanceof Ext.ux.ThumbSlider){E.setConstraint([E.getTL()[0]-this.el.lowLimit[0]+(1/2*this.sliderSize[0]),E.getTL()[1]-this.el.lowLimit[1]+(1/2*this.sliderSize[1])],[this.el.highLimit[0]-(E.getTL()[0]+this.sliderSize[0])+(1/2*this.sliderSize[0]),this.el.highLimit[1]-(E.getTL()[1]+this.sliderSize[1])+(1/2*this.sliderSize[1])],this.sliderSnap)}if(E instanceof Ext.ux.RangeSlider){E.setConstraint([E.getTL()[0]-this.el.lowLimit[0],E.getTL()[1]-this.el.lowLimit[1]],[this.el.highLimit[0]-E.getBR()[0],this.el.highLimit[1]-E.getBR()[1]],this.sliderSnap)}}}},updateValues:function(){var A=this;var B={};this.sliders.each(function(C){if(this.type=="area"){if(C instanceof Ext.ux.ThumbSlider){C.value=[(C.getTL()[0]+1/2*A.sliderSize[0]-A.el.lowLimit[0])/(A.size[0])*(A.maxValue[0]-A.minValue[0])+A.minValue[0],(C.getTL()[1]+1/2*A.sliderSize[1]-A.el.lowLimit[1])/(A.size[1])*(A.maxValue[1]-A.minValue[1])+A.minValue[1]];C.percent=[parseFloat((C.getTL()[0]+1/2*A.sliderSize[0]-A.el.lowLimit[0])/(A.size[0])*100),parseFloat((C.getTL()[1]+1/2*A.sliderSize[1]-A.el.lowLimit[1])/(A.size[1])*100)]}if(C instanceof Ext.ux.RangeSlider){C.value=[[(C.getTL()[0]-A.el.lowLimit[0])/(A.size[0])*(A.maxValue[0]-A.minValue[0])+A.minValue[0],(C.getBR()[0]-A.el.lowLimit[0])/(A.size[0])*(A.maxValue[0]-A.minValue[0])+A.minValue[0]],[(C.getTL()[1]-A.el.lowLimit[1])/(A.size[1])*(A.maxValue[1]-A.minValue[1])+A.minValue[1],(C.getBR()[1]-A.el.lowLimit[1])/(A.size[1])*(A.maxValue[1]-A.minValue[1])+A.minValue[1]]];C.percent=[[parseFloat((C.getTL()[0]-A.el.lowLimit[0])/(A.size[0])*100).toFixed(2),parseFloat((C.getBR()[0]-A.el.lowLimit[0])/(A.size[0])*100).toFixed(2)],[parseFloat((C.getTL()[1]-A.el.lowLimit[1])/(A.size[1])*100).toFixed(2),parseFloat((C.getBR()[1]-A.el.lowLimit[1])/(A.size[1])*100).toFixed(2)]]}}else{if(C instanceof Ext.ux.ThumbSlider){C.value=(C.getTL()[0]+1/2*A.sliderSize[0]-A.el.lowLimit[0])/(A.size[0])*(A.maxValue[0]-A.minValue[0])+A.minValue[0];C.percent=parseFloat((C.getTL()[0]+1/2*A.sliderSize[0]-A.el.lowLimit[0])/(A.size[0])*100)}if(C instanceof Ext.ux.RangeSlider){C.value=[(C.getTL()[0]-A.el.lowLimit[0])/(A.size[0])*(A.maxValue[0]-A.minValue[0])+A.minValue[0],(C.getBR()[0]-A.el.lowLimit[0])/(A.size[0])*(A.maxValue[0]-A.minValue[0])+A.minValue[0]];C.percent=[parseFloat((C.getTL()[0]-A.el.lowLimit[0])/(A.size[0])*100),parseFloat((C.getBR()[0]-A.el.lowLimit[0])/(A.size[0])*100)]}}B[this.name]=this.value});this.value=B},initSliderPosition:function(E){var A=[0,0];E.repositionDelta=[0,0];var B=this.type=="area"?2:1;for(var D=0;D<B;D++){if(E.value instanceof Array){if(E instanceof Ext.ux.ThumbSlider){E.value[D]=Number(E.value[D]).constrain(this.minValue[D],this.maxValue[D]);A[D]=parseInt((E.value[D]-this.minValue[D])/(this.maxValue[D]-this.minValue[D])*this.size[D]+this.el.lowLimit[D])}if(E instanceof Ext.ux.RangeSlider){switch(this.type){case"horizontal":case"vertical":E.value[D]=Number(E.value[D]).constrain(this.minValue[D],this.maxValue[D]);A[D]=parseInt((E.value[D]-this.minValue[D])/(this.maxValue[D]-this.minValue[D])*this.size[D]+this.el.lowLimit[D]);break;case"area":E.value[D][0]=Number(E.value[D][0]).constrain(this.minValue[D],this.maxValue[D]);E.value[D][1]=Number(E.value[D][1]).constrain(this.minValue[D],this.maxValue[D]);A[D]=parseInt((E.value[D][0]-this.minValue[D])/(this.maxValue[D]-this.minValue[D])*this.size[D]+this.el.lowLimit[D]);break}}}else{E.value=Number(E.value).constrain(this.minValue[D],this.maxValue[D]);A[D]=parseInt((E.value-this.minValue[D])/(this.maxValue[D]-this.minValue[D])*this.size[D]+this.el.lowLimit[D])}if(this.sliderSnap[D]>1){var C=[0,0];C[D]=(A[D]-this.el.lowLimit[D])%this.sliderSnap[D];if(C[D]){if(C[D]<1/2*this.sliderSnap[D]){E.repositionDelta[D]=-C[D]}else{E.repositionDelta[D]=this.sliderSnap[D]-C[D]}}}}if(E instanceof Ext.ux.ThumbSlider){E.setPosition([A[0]+E.repositionDelta[0]-(0.5*this.sliderSize[0]),A[1]+E.repositionDelta[1]-(0.5*this.sliderSize[1])])}if(E instanceof Ext.ux.RangeSlider){E.setPosition([A[0]+E.repositionDelta[0],A[1]+E.repositionDelta[1]])}},initSlider:function(A){A.init(this);this.initSliderPosition(A)}});Ext.ux.Slider=function(A){Ext.apply(this,A);this.addEvents({dragstart:true,dragend:true,drag:true,mouseover:true,mouseout:true})};Ext.extend(Ext.ux.Slider,Ext.BoxComponent,{value:0,ddEl:null,name:null,cls:null,init:function(){},getTL:function(){switch(this.type){case"horizontal":return[this.el.getX()];break;case"vertical":return[this.el.getY()];break;case"area":return this.el.getXY();break}},getBR:function(){switch(this.type){case"horizontal":return[this.el.getRight()];break;case"vertical":return[this.el.getBottom()];break;case"area":return[this.el.getRight(),this.el.getBottom()];break}},setPosition:function(A){var B=A.length;for(i=0;i<B;i++){A[i]=parseInt(A[i])}switch(this.type){case"horizontal":this.el.setX(A[0]);break;case"vertical":this.el.setY(A[0]);break;case"area":this.el.setX(A[0]);this.el.setY(A[1]);break}},setConstraint:function(B,D,A){var C=B.length;for(i=0;i<C;i++){B[i]=parseInt(B[i]=B[i]<0?0:B[i]);D[i]=parseInt(D[i]=D[i]<0?0:D[i])}switch(this.type){case"horizontal":this.ddEl.setXConstraint(B[0],D[0],A[0]);this.ddEl.setYConstraint(0,0);break;case"vertical":this.ddEl.clearConstraints();this.ddEl.setXConstraint(0,0);this.ddEl.setYConstraint(B[0],D[0],A[0]);break;case"area":this.ddEl.setXConstraint(B[0],D[0],A[0]);this.ddEl.setYConstraint(B[1],D[1],A[1]);break}this.ddEl.resetConstraints(true)}});Ext.ux.ThumbSlider=function(A){Ext.ux.ThumbSlider.superclass.constructor.call(this,A)};Ext.ux.RangeSlider=function(A){Ext.ux.RangeSlider.superclass.constructor.call(this,A)};Ext.extend(Ext.ux.ThumbSlider,Ext.ux.Slider,{init:function(C){this.type=C.type;this.pointer=this.type=="horizontal"?"w-resize":this.type=="vertical"?"n-resize":"move";this.el=Ext.DomHelper.append(C.el,{tag:"div",id:Ext.id(),style:"position:absolute;overflow: hidden;"},true);this.el.addClass("x-thumb-slider-"+this.type);this.el.addClass(C.cls);this.ddEl=new Ext.dd.DD(this.el);var A=this;var B=C;this.el.on("mouseover",function(){A.fireEvent("mouseover",A);A.el.setStyle("cursor",A.pointer)});this.el.on("mouseout",function(){A.fireEvent("mouseout",A);A.el.setStyle("cursor","default")});this.ddEl.onMouseDown=function(D,E){A.fireEvent("dragstart",A)};this.ddEl.onMouseUp=function(D,E){B.updateConstraints();B.updateValues();A.fireEvent("dragend",A)};this.ddEl.onDrag=function(D){B.updateValues();A.fireEvent("drag",A)};Ext.ux.ThumbSlider.superclass.init.call(C)}});Ext.extend(Ext.ux.RangeSlider,Ext.ux.Slider,{init:function(G){this.type=G.type;var E=Ext.DomHelper.append(G.el,{tag:"div",id:Ext.id(),style:"position:absolute;overflow: hidden;"},true);switch(this.type){case"horizontal":var B=Math.abs(this.value[0]-this.value[1])/(G.maxValue-G.minValue)*G.size;var D=G.sliderHeight;var C="e,w";this.pointer="pointer";break;case"vertical":var B=G.sliderWidth;var D=Math.abs(this.value[0]-this.value[1])/(G.maxValue-G.minValue)*G.size;var C="n,s";this.pointer="pointer";break;case"area":var B=Math.abs(this.value[0][0]-this.value[0][1])/(G.maxValue[0]-G.minValue[0])*G.size[0];var D=Math.abs(this.value[1][0]-this.value[1][1])/(G.maxValue[1]-G.minValue[1])*G.size[1];var C="all";this.pointer="move";break}this.resizable=new Ext.Resizable(E,{wrap:false,pinned:true,width:B,height:D,minWidth:20,widthIncrement:G.sliderSnap[0],heightIncrement:G.sliderSnap[1],minHeight:20,dynamic:true,handles:C,draggable:true,transparent:false,constrainTo:G.el,leftTravel:null,rightTravel:null});var A=this;var F=G;this.el=this.resizable.el;this.el.addClass("x-range-slider-"+this.type);this.el.addClass(this.cls);this.ddEl=this.resizable.dd;this.resizable.on("beforeresize",function(){A.fireEvent("dragstart",A)});this.resizable.onMouseMove=function(I){var H=this.constrainTo.getRegion(),J=I.getXY();if(!G.allowSliderCrossing){if(G.type=="vertical"){H={left:H.left,right:H.right,top:this.startBox.y-this.leftTravel[0],bottom:this.startBox.y+this.startBox.height+this.rightTravel[0]}}if(G.type=="horizontal"){H={left:this.startBox.x-this.leftTravel[0],right:this.startBox.x+this.startBox.width+this.rightTravel[0],top:H.top,bottom:H.bottom}}}I.xy=[J[0]-H.left<0?H.left-this.startBox.x+this.startPoint[0]:J[0]-H.right>0?H.right-this.startBox.right+this.startPoint[0]:J[0],J[1]-H.top<0?H.top-this.startBox.y+this.startPoint[1]:J[1]-H.bottom>0?H.bottom-this.startBox.bottom+this.startPoint[1]:J[1]];Ext.Resizable.prototype.onMouseMove.call(this,I);F.updateValues();A.fireEvent("drag",A)};this.resizable.on("resize",function(I,H){F.updateConstraints();F.updateValues();A.fireEvent("dragend",A)});this.el.on("mouseover",function(){A.fireEvent("mouseover",A);A.el.setStyle("cursor",A.pointer)});this.el.on("mouseout",function(){A.fireEvent("mouseout",A);A.el.setStyle("cursor","default")});this.ddEl.onMouseDown=function(H,I){A.fireEvent("dragstart",A)};this.ddEl.onMouseUp=function(H,I){F.updateConstraints();F.updateValues();A.fireEvent("dragend",A)};this.ddEl.onDrag=function(H){F.updateValues();A.fireEvent("drag",A)};Ext.ux.ThumbSlider.superclass.init.call(G)}});if(!this.JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();Ext.namespace("Ext.ux");Ext.ux.IconCombo=function(A){Ext.ux.IconCombo.superclass.constructor.call(this,A);this.tpl=A.tpl||'<tpl for="."><div class="x-combo-list-item x-icon-combo-item {'+this.iconClsField+'}">{'+this.displayField+"}</div></tpl>";this.on({render:{scope:this,fn:function(){var B=this.el.up("div.x-form-field-wrap");this.wrap.applyStyles({position:"relative"});this.el.addClass("x-icon-combo-input");this.flag=Ext.DomHelper.append(B,{tag:"div",style:"position:absolute"})}}})};Ext.extend(Ext.ux.IconCombo,Ext.form.ComboBox,{setIconCls:function(){var A=this.store.query(this.valueField,this.getValue()).itemAt(0);if(A){this.flag.className="x-icon-combo-icon "+A.get(this.iconClsField)}},setValue:function(A){Ext.ux.IconCombo.superclass.setValue.call(this,A);this.setIconCls()}});Ext.ux.Portal=Ext.extend(Ext.Panel,{layout:"column",autoScroll:true,cls:"x-portal",defaultType:"portalcolumn",initComponent:function(){Ext.ux.Portal.superclass.initComponent.call(this);this.addEvents({validatedrop:true,beforedragover:true,dragover:true,beforedrop:true,drop:true})},initEvents:function(){Ext.ux.Portal.superclass.initEvents.call(this);this.dd=new Ext.ux.Portal.DropZone(this,this.dropConfig)},beforeDestroy:function(){if(this.dd){this.dd.unreg()}Ext.ux.Portal.superclass.beforeDestroy.call(this)}});Ext.reg("portal",Ext.ux.Portal);Ext.ux.Portal.DropZone=function(A,B){this.portal=A;Ext.dd.ScrollManager.register(A.body);Ext.ux.Portal.DropZone.superclass.constructor.call(this,A.bwrap.dom,B);A.body.ddScrollConfig=this.ddScrollConfig};Ext.extend(Ext.ux.Portal.DropZone,Ext.dd.DropTarget,{ddScrollConfig:{vthresh:50,hthresh:-1,animate:true,increment:200},createEvent:function(A,D,C,B,F,E){return{portal:this.portal,panel:C.panel,columnIndex:B,column:F,position:E,data:C,source:A,rawEvent:D,status:this.dropAllowed}},notifyOver:function(Q,O,R){var D=O.getXY(),A=this.portal,J=Q.proxy;if(!this.grid){this.grid=this.getGrid()}var B=A.body.dom.clientWidth;if(!this.lastCW){this.lastCW=B}else{if(this.lastCW!=B){this.lastCW=B;A.doLayout();this.grid=this.getGrid()}}var C=0,H=this.grid.columnX,I=false;for(var M=H.length;C<M;C++){if(D[0]<(H[C].x+H[C].w)){I=true;break}}if(!I){C--}var L,G=false,F=0,P=A.items.itemAt(C),K=P.items.items;for(var M=K.length;F<M;F++){L=K[F];var N=L.el.getHeight();if(N!==0&&(L.el.getY()+(N/2))>D[1]){G=true;break}}var E=this.createEvent(Q,O,R,C,P,G&&L?F:P.items.getCount());if(A.fireEvent("validatedrop",E)!==false&&A.fireEvent("beforedragover",E)!==false){J.getProxy().setWidth("auto");if(L){J.moveProxy(L.el.dom.parentNode,G?L.el.dom:null)}else{J.moveProxy(P.el.dom,null)}this.lastPos={c:P,col:C,p:G&&L?F:false};this.scrollPos=A.body.getScroll();A.fireEvent("dragover",E);return E.status}else{return E.status}},notifyOut:function(){delete this.grid},notifyDrop:function(H,D,C){delete this.grid;if(!this.lastPos){return }var F=this.lastPos.c,B=this.lastPos.col,G=this.lastPos.p;var A=this.createEvent(H,D,C,B,F,G!==false?G:F.items.getCount());if(this.portal.fireEvent("validatedrop",A)!==false&&this.portal.fireEvent("beforedrop",A)!==false){H.proxy.getProxy().remove();H.panel.el.dom.parentNode.removeChild(H.panel.el.dom);if(G!==false){F.insert(G,H.panel)}else{F.add(H.panel)}F.doLayout();this.portal.fireEvent("drop",A);var I=this.scrollPos.top;if(I){var E=this.portal.body.dom;setTimeout(function(){E.scrollTop=I},10)}}delete this.lastPos},getGrid:function(){var A=this.portal.bwrap.getBox();A.columnX=[];this.portal.items.each(function(B){A.columnX.push({x:B.el.getX(),w:B.el.getWidth()})});return A},unreg:function(){Ext.ux.Portal.DropZone.superclass.unreg.call(this)}});Ext.ux.PortalColumn=Ext.extend(Ext.Container,{layout:"anchor",autoEl:"div",defaultType:"portlet",cls:"x-portal-column"});Ext.reg("portalcolumn",Ext.ux.PortalColumn);Ext.ux.Portlet=Ext.extend(Ext.Panel,{anchor:"100%",frame:true,collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("portlet",Ext.ux.Portlet);Ext.ux.GDataTableAdapter=function(A){var B={auto:"string",string:"string","int":"number","float":"number","boolean":"boolean",date:"date"};return{adapt:function(D){var M=Ext.StoreMgr.lookup(D.store||D.ds);var H=new google.visualization.DataTable();var L=D.columns;for(var I=0;I<L.length;I++){var K=L[I];var C=K.dataIndex||K;var J=M.fields.get(C);H.addColumn(B[J.type],K.label||K,C)}var F=M.getRange();H.addRows(F.length);for(var I=0;I<F.length;I++){for(var G=0;G<L.length;G++){var E=M.fields.itemAt(G);H.setValue(I,G,F[I].get(E.name))}}return H}}}();Ext.ux.GVisualizationPanel=Ext.extend(Ext.Panel,{visualizationAPI:"visualization",visualizationAPIVer:"1",visualizationPkgs:{piechart:"PieChart",intensitymap:"IntensityMap",orgchart:"OrgChart",linechart:"LineChart",gauge:"Gauge",scatterchart:"ScatterChart",annotatedtimeline:"AnnotatedTimeLine"},visualizationPkg:"",html:"Loading...",store:null,redraw:function(){this.datatable=Ext.ux.GDataTableAdapter.adapt({store:this.store,columns:this.columns});this.visualization.draw(this.datatable,Ext.apply({},this.visualizationCfg))},initComponent:function(){if(typeof this.visualizationPkg==="object"){Ext.apply(this.visualizationPkgs,this.visualizationPkg);for(var A in this.visualizationPkg){this.visualizationPkg=A;break}}google.load(this.visualizationAPI,this.visualizationAPIVer,{packages:[this.visualizationPkg],callback:this.onLoadCallback.createDelegate(this)});this.store=Ext.StoreMgr.lookup(this.store);this.store.on({load:this.redraw,datachanged:this.redraw,add:this.redraw,remove:this.redraw,update:this.redraw,clear:this.redraw,scope:this});Ext.ux.GVisualizationPanel.superclass.initComponent.call(this)},onLoadCallback:function(){var B={store:this.store,columns:this.columns};this.datatable=Ext.ux.GDataTableAdapter.adapt(B);var A=this.visualizationPkgs[this.visualizationPkg];if(this.body){this.body.update("");this.visualization=new google.visualization[A](this.body.dom);var C=function(){this.fireEvent("select",this,this.visualization)};google.visualization.events.addListener(this.visualization,"select",C.createDelegate(this));this.visualization.draw(this.datatable,Ext.apply({},this.visualizationCfg))}}});Ext.reg("gvisualization",Ext.ux.GVisualizationPanel);Ext.ns("Ext.ux.layout");Ext.ux.layout.CenterLayout=Ext.extend(Ext.layout.FitLayout,{setItemSize:function(B,A){this.container.addClass("ux-layout-center");B.addClass("ux-layout-center-item");if(B&&A.height>0){if(B.width){A.width=B.width}B.setSize(A)}}});Ext.Container.LAYOUTS["ux.center"]=Ext.ux.layout.CenterLayout;Ext.ux.BonboaTree=Ext.extend(Ext.tree.TreePanel,{initComponent:function(){Ext.ux.BonboaTree.superclass.initComponent.apply(this,arguments)}});Ext.reg("bonboa_tree",Ext.ux.BonboaTree);Ext.ux.BonboaCombo=Ext.extend(Ext.ux.ComboBox,{triggerAction:"all",typeAhead:true,forceSelection:true});Ext.reg("bonboa_combo",Ext.ux.BonboaCombo);Ext.ux.BonboaComboLink=Ext.extend(Ext.ux.BonboaCombo,{valueField:"id",displayField:"label",mode:"local",tpl:'<tpl for="."><div ext:qtitle="{label}" ext:qtip="{image}{body}" class="x-combo-list-item"><tpl if="id&gt;0"><span style="float:right"><button type="button" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'bonboa_combo_link_button_edit_{table}_{id}_img\',\'\',\'bonboa/images/application_form_edit.png\',1)" style="margin: 0;padding:0;border:none;background:none;cursor:pointer;" onclick="return bonboa_edit(\'{title}: {label}\',\'bonboa/meta/fetch/{table}/{id}/{language}/edit\',\'bonboa/meta/store/{table}/{id}/\',\'edit\',null,false,\'{title}\')"><img id="bonboa_combo_link_button_edit_{table}_{id}_img" src="bonboa/images/application_form_edit-dim.png" width="16" height="16" alt="Edit this {title}" title="Edit this {title}" /></button></span></tpl>{label}&nbsp;</div></tpl>'});Ext.reg("bonboa_combo_link",Ext.ux.BonboaComboLink);Ext.ux.BonboaGMapPanel=Ext.extend(Ext.ux.GMapPanel,{region:"center",gmapType:"map"});Ext.reg("bonboa_gmappanel",Ext.ux.BonboaGMapPanel);Ext.ux.BonboaRadio=Ext.extend(Ext.ux.RadioGroup,{horizontal:true});Ext.reg("bonboa_radio",Ext.ux.BonboaRadio);Ext.ux.BonboaDate=Ext.extend(Ext.ux.form.XDateField,{format:"d-m-Y"});Ext.reg("bonboa_date",Ext.ux.BonboaDate);Ext.ux.BonboaTime=Ext.extend(Ext.ux.form.XTimeField,{format:"H:i:s"});Ext.reg("bonboa_time",Ext.ux.BonboaTime);Ext.ux.BonboaDateTime=Ext.extend(Ext.ux.form.DateTime,{dateFormat:"d-m-Y",timeFormat:"H:i:s",altDateFormats:"Y-m-d"});Ext.reg("bonboa_datetime",Ext.ux.BonboaDateTime);Ext.ux.BonboaString=Ext.extend(Ext.form.TextField,{grow:true,growMin:150});Ext.reg("bonboa_string",Ext.ux.BonboaString);Ext.ux.BonboaText=Ext.extend(Ext.form.TextArea,{width:"100%"});Ext.reg("bonboa_text",Ext.ux.BonboaText);Ext.ux.BonboaHtml=Ext.extend(Ext.ux.HTMLEditor,{});Ext.reg("bonboa_html",Ext.ux.BonboaHtml);Ext.ux.BonboaPassword=Ext.extend(Ext.ux.PasswordField,{showCapsWarning:false,showStrengthMeter:true});Ext.reg("bonboa_password",Ext.ux.BonboaPassword);Ext.ux.BonboaInt=Ext.extend(Ext.form.NumberField,{allowDecimals:false});Ext.reg("bonboa_int",Ext.ux.BonboaInt);Ext.ux.BonboaFile=Ext.extend(Ext.form.FileUploadField,{buttonCfg:{text:"",iconCls:"upload-icon"}});Ext.reg("bonboa_file",Ext.ux.BonboaFile);Ext.ux.BonboaImage=Ext.extend(Ext.form.FileUploadField,{buttonCfg:{text:"",iconCls:"upload-icon"}});Ext.reg("bonboa_image",Ext.ux.BonboaImage);Ext.ux.BonboaMedia=Ext.extend(Ext.form.FileUploadField,{buttonCfg:{text:"",iconCls:"upload-icon"}});Ext.reg("bonboa_media",Ext.ux.BonboaMedia);Ext.ux.BonboaTabPanel=Ext.extend(Ext.TabPanel,{plain:true,activeTab:0,enableTabScroll:true,height:235,defaults:{bodyStyle:"padding:10px;background-color:#F8F8F8"}});Ext.reg("bonboa_tabpanel",Ext.ux.BonboaTabPanel);Ext.ux.BonboaDocument=Ext.extend(Ext.form.FileUploadField,{buttonCfg:{text:"",iconCls:"upload-icon"}});Ext.reg("bonboa_document",Ext.ux.BonboaDocument);Ext.ux.CenterWindowPlugin=function(){this.init=function(A){Ext.EventManager.onWindowResize(function(){A.center()})}};Ext.form.Field.prototype.msgTarget="side";function bonboa_action_buttons(H,G,F,E,D,C,B){var A=null;if(F=="new"){A=[{text:"Insert",tooltip:"Insert this "+D+" as a new entry.",formBind:true,id:"insert_btn",handler:function(){var I;if(B){I=Ext.getCmp(C).items.get(0)}else{I=Ext.getCmp(C)}if(I){var J=I.getForm();if(J){if(J.isValid()){passwords=I.findByType("bonboa_password");if(passwords.length>0){Ext.each(passwords,function(K){if(K.getValue()&&K.getValue().length<32){K.setValue(hex_md5(K.getValue()))}})}J.submit({method:"POST",url:G+"insert",waitTitle:"Connecting",waitMsg:"Sending data...",success:function(K,L){if(L.result&&L.result.message){Ext.MessageBox.show({title:((L.result&&L.result.title)?L.result.title:"Success"),msg:L.result.message,buttons:Ext.MessageBox.OK,fn:function(){if(E){window.location.reload()}else{K.fireEvent("bonboa_insert",L.result.table,L.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}})}else{if(E){window.location.reload()}else{K.fireEvent("bonboa_insert",L.result.table,L.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}},failure:function(K,L){if(L.result&&(L.result.message||!L.result.errors)){Ext.MessageBox.alert((L.result&&L.result.title)?L.result.title:"Failed",(L.result&&L.result.message)?L.result.message:"Failed")}}})}}}}}]}else{if(F=="edit"){A=[{text:"Update",tooltip:"Update this "+D+" entry.",formBind:true,id:"update_btn",handler:function(){var I;if(B){I=Ext.getCmp(C).items.get(0)}else{I=Ext.getCmp(C)}if(I){var J=I.getForm();if(J){if(J.isValid()){passwords=I.findByType("bonboa_password");if(passwords.length>0){Ext.each(passwords,function(K){if(K.getValue()&&K.getValue().length<32){K.setValue(hex_md5(K.getValue()))}})}J.submit({method:"POST",url:G+"update",waitTitle:"Connecting",waitMsg:"Sending data...",success:function(K,L){if(L.result&&L.result.message){Ext.MessageBox.show({title:(L.result&&L.result.title)?L.result.title:"Success",msg:L.result.message,buttons:Ext.MessageBox.OK,fn:function(){if(E){window.location.reload()}else{K.fireEvent("bonboa_update",L.result.table,L.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}})}else{if(E){window.location.reload()}else{K.fireEvent("bonboa_update",L.result.table,L.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}},failure:function(K,L){if(L.result&&(L.result.message||!L.result.errors)){Ext.MessageBox.alert((L.result&&L.result.title)?L.result.title:"Failed",(L.result&&L.result.message)?L.result.message:"Failed")}}})}}}}},{text:"Duplicate",tooltip:"Insert this "+D+" as new entry. This original "+D+" entry remains untouched.",formBind:true,id:"duplicate_btn",handler:function(){var I;if(B){I=Ext.getCmp(C).items.get(0)}else{I=Ext.getCmp(C)}if(I){var J=I.getForm();if(J){if(J.isValid()){passwords=I.findByType("bonboa_password");if(passwords.length>0){Ext.each(passwords,function(K){if(K.getValue()&&K.getValue().length<32){K.setValue(hex_md5(K.getValue()))}})}J.submit({method:"POST",url:G+"duplicate",waitTitle:"Connecting",waitMsg:"Sending data...",success:function(K,L){if(L.result&&L.result.message){Ext.MessageBox.show({title:(L.result&&L.result.title)?L.result.title:"Success",msg:L.result.message,buttons:Ext.MessageBox.OK,fn:function(){if(E){window.location.reload()}else{K.fireEvent("bonboa_insert",L.result.table,L.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}})}else{if(E){window.location.reload()}else{K.fireEvent("bonboa_insert",L.result.table,L.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}},failure:function(K,L){if(L.result&&(L.result.message||!L.result.errors)){Ext.MessageBox.alert((L.result&&L.result.title)?L.result.title:"Failed",(L.result&&L.result.message)?L.result.message:"Failed")}}})}}}}},{text:"Delete",tooltip:"Remove this "+D+" entry.",formBind:false,id:"delete_btn",handler:function(){Ext.MessageBox.confirm("Confirm","Are you sure you want to delete this "+H+"?",function(J){if(J=="yes"){var I;if(B){I=Ext.getCmp(C).items.get(0)}else{I=Ext.getCmp(C)}if(I){var K=I.getForm();if(K){K.submit({method:"POST",url:G+"delete",waitTitle:"Connecting",waitMsg:"Deleting...",success:function(L,M){if(M.result&&M.result.message){Ext.MessageBox.show({title:(M.result&&M.result.title)?M.result.title:"Success",msg:M.result.message,buttons:Ext.MessageBox.OK,fn:function(){if(E){window.location.reload()}else{L.fireEvent("bonboa_delete",M.result.table,M.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}})}else{if(E){window.location.reload()}else{L.fireEvent("bonboa_delete",M.result.table,M.result.id);if(B){if(I=Ext.getCmp(C)){I.close()}}bonboa_browser_reset();bonboa_editing=false}}},failure:function(L,M){if(M.result&&(M.result.message||!M.result.errors)){Ext.MessageBox.alert((M.result&&M.result.title)?M.result.title:"Failed",(M.result&&M.result.message)?M.result.message:"Failed")}}})}}}})}}]}}if(A&&B){A.push({text:"Cancel",tooltip:"Leave this window, no action applied, no harm done....",formBind:false,id:"cancel_btn",handler:function(){if(B){var I=Ext.getCmp(C);if(I){I.close()}}bonboa_editing=false}})}return A}var bonboa_editing=false;function bonboa_edit(J,G,F,D,C,A,B){C=(typeof C=="undefined"?{}:C);A=(typeof A=="undefined"?true:A);B=(typeof B=="undefined"?J.toLowerCase():B.toLowerCase());try{Ext.getCmp("bonboa_metaform_window").close()}catch(H){}while(Ext.getCmp("bonboa_metaform_window")){}bonboa_editing=true;if(D=="delete"){Ext.MessageBox.confirm("Delete "+J,"Are you sure you want to delete this "+B+"?",function(K){if(K=="yes"){var L=new Ext.data.Connection();L.request({url:F+"delete",method:"POST",params:{},success:function(N){var M=Ext.decode(N.responseText);if(M){if(M.message){Ext.MessageBox.show({title:((M.title)?M.title:(M.success?"Success":"Failure")),msg:M.message,buttons:Ext.MessageBox.OK,fn:function(){if(M.success&&A){window.location.reload()}}})}else{if(M.success){if(A){window.location.reload()}}else{Ext.Msg.alert("Status","Unable to delete this "+J+".")}}}},failure:function(M){Ext.Msg.alert("Status","Unable to delete this "+J+".")}})}bonboa_editing=false});return false}var I=bonboa_action_buttons(J,F,D,A,B,"bonboa_metaform_window",true);var E=new Ext.ux.FormWindow({modal:true,monitorValid:false,monitorPoll:200,maximizable:true,plugins:[new Ext.ux.CenterWindowPlugin()],id:"bonboa_metaform_window",width:680,plain:true,autoHeight:true,title:J,items:{xtype:"metaform",fileUpload:true,url:G,baseParams:C,buttons:I}});E.show();return false}function bonboa_alert(B){var A="";for(x in B){A+=x+": "+B[x]+"\n"}alert(A)}function bonboa_login(C,A){var B=new Ext.FormPanel({labelWidth:70,url:C,frame:true,defaultType:"textfield",monitorValid:true,labelAlign:"right",items:[{fieldLabel:"Username",name:"username",id:"bonboa_login_field_username",allowBlank:false},{fieldLabel:"Password",name:"password",inputType:"password",id:"bonboa_login_field_password",allowBlank:false}],buttons:[{text:"Login",formBind:true,handler:function(){if(pwf=Ext.getCmp("bonboa_login_field_password")){pwf.setValue(hex_md5(pwf.getValue()))}B.getForm().submit({method:"POST",waitTitle:"Connecting",waitMsg:"Sending data...",success:function(){window.location.replace(A)},failure:function(E,F){if(F.failureType=="server"){obj=Ext.util.JSON.decode(F.response.responseText);Ext.Msg.alert("Login Failed!",obj.errors.reason)}else{Ext.Msg.alert("Warning!","Authentication server is unreachable : "+F.response.responseText)}B.getForm().reset()}})}}],keys:[{key:[Ext.EventObject.ENTER],fn:function(){var E=null;if(E=Ext.getCmp("bonboa_login_field_password")){E.setValue(hex_md5(E.getValue()))}B.getForm().submit({method:"POST",waitTitle:"Connecting",waitMsg:"Sending data...",success:function(){window.location.replace(A)},failure:function(F,G){if(G.failureType=="server"){obj=Ext.util.JSON.decode(G.response.responseText);Ext.Msg.alert("Login Failed!",obj.errors.reason)}else{Ext.Msg.alert("Warning!","Authentication server is unreachable : "+G.response.responseText)}B.getForm().reset()}})}}]});var D=new Ext.Window({layout:"fit",width:250,height:130,title:"Please Login",closable:false,resizable:false,plain:true,border:false,items:[B]});D.show();Ext.getCmp("bonboa_login_field_username").focus("",10)}var bonboa_browser_object_ds=null;var bonboa_browser_objects_combo=null;var bonboa_browser_subject_ds=null;var bonboa_browser_subjects_combo=null;var bonboa_search_combo=null;var bonboa_search_ds=null;function bonboa_browser_reset(){if(bonboa_browser_subject_ds){bonboa_browser_subject_ds.load()}if(bonboa_browser_subjects_combo){bonboa_browser_subjects_combo.emptyText="Select a subject...";bonboa_browser_subjects_combo.clearValue()}if(bonboa_browser_object_ds){bonboa_browser_object_ds.proxy.url="bonboa/meta/objects";bonboa_browser_object_ds.load()}if(bonboa_browser_objects_combo){bonboa_browser_objects_combo.emptyText="First select an subject...";bonboa_browser_objects_combo.clearValue();bonboa_browser_objects_combo.setDisabled(true)}}function bonboa_browser_init(A){A=(typeof A=="undefined"?false:A);if(bonboa_edit_div=Ext.DomQuery.select("span[class=bonboa_edit]")){for(i=0;i<bonboa_edit_div.length;i++){bonboa_edit_div[i].style.display="inline"}}if(bonboa_browser_div=document.getElementById("bonboa_browser")){bonboa_browser_div.style.display="block";bonboa_browser_subject_ds=new Ext.data.Store({proxy:new Ext.data.ScriptTagProxy({url:"bonboa/meta/subjects"}),reader:new Ext.data.JsonReader({root:"rows",id:"table"},[{name:"table"},{name:"language"},{name:"title"},{name:"plural"},{name:"text"},{name:"count"},{name:"group"},{name:"updated"}])});bonboa_browser_subjects_combo=new Ext.form.ComboBox({store:bonboa_browser_subject_ds,displayField:"plural",tpl:new Ext.XTemplate('<tpl for="."><div class="search-item">','<span><button type="button" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'bonboa_browser_button_new_{table}_img\',\'\',\'bonboa/images/application_form_add.png\',1)" style="margin:0;padding:0;border:none;background:none;cursor:pointer;" onclick="return bonboa_edit(\'New {title}\',\'bonboa/meta/fetch/{table}/_/{language}/new\',\'bonboa/meta/store/{table}/_/\',\'new\',null,false,\'{table}\')"><img id="bonboa_browser_button_new_{table}_img" src="bonboa/images/application_form_add-dim.png" width="16" height="16" alt="New {title}" title="New {title}" /></button></span><span style="width:90px">{updated}<br />{group}<br />{count}</span><h3>{plural}</h3>',"{text}&nbsp;","</div></tpl>"),itemSelector:"div.search-item",typeAhead:true,listWidth:400,maxHeight:600,listAlign:"tr-br",forceSelection:true,minChars:0,emptyText:"Select a subject...",selectOnFocus:true,applyTo:"bonboa_browser_subjects",editable:A,listeners:{select:function(D,B,C){bonboa_browser_object_ds.proxy.url="bonboa/meta/objects/"+B.data.table;bonboa_browser_object_ds.load();bonboa_browser_objects_combo.emptyText="Select"+(B.data.title==B.data.plural?"":(" a"+((B.data.title[0]=="A"||B.data.title[0]=="O"||B.data.title[0]=="E"||B.data.title[0]=="I"||B.data.title[0]=="U")?"n":"")))+" "+B.data.title+"...";bonboa_browser_objects_combo.clearValue();bonboa_browser_objects_combo.setDisabled(false)}}});bonboa_browser_object_ds=new Ext.data.Store({proxy:new Ext.data.ScriptTagProxy({url:"bonboa/meta/objects"}),reader:new Ext.data.JsonReader({root:"rows",totalProperty:"totalCount",id:"post_id"},[{name:"table"},{name:"title"},{name:"language"},{name:"search"},{name:"id"},{name:"label"},{name:"modified_at"},{name:"modified_by"},{name:"text"},{name:"link"},{name:"image"}])});bonboa_browser_objects_combo=new Ext.form.ComboBox({store:bonboa_browser_object_ds,displayField:"search",typeAhead:false,loadingText:"Searching...",emptyText:"First select an subject...",listWidth:570,maxHeight:600,pageSize:12,disabled:true,minChars:0,tpl:new Ext.XTemplate('<tpl for="."><div class="search-item">','<span><button type="button" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'bonboa_browser_button_edit_{table}_{id}_img\',\'\',\'bonboa/images/application_form_edit.png\',1)" style="margin: 0;padding:0;border:none;background:none;cursor:pointer;" onclick="return bonboa_edit(\'{title}: {label}\',\'bonboa/meta/fetch/{table}/{id}/{language}/edit\',\'bonboa/meta/store/{table}/{id}/\',\'edit\',null,false,\'{table}\')"><img id="bonboa_browser_button_edit_{table}_{id}_img" src="bonboa/images/application_form_edit-dim.png" width="16" height="16" alt="Edit this {title}" title="Edit this {title}" /></button><br /><button type="button" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'bonboa_browser_button_delete_{table}_{id}_img\',\'\',\'bonboa/images/application_form_delete.png\',1)" style="margin:0;padding:0;border:none;background:none;cursor:pointer;" onclick="return bonboa_edit(\'{title}: {label}\',\'bonboa/meta/fetch/{table}/{id}/{language}/delete\',\'bonboa/meta/store/{table}/{id}/\',\'delete\',null,false,\'{title}\')"><img id="bonboa_browser_button_delete_{table}_{id}_img" src="bonboa/images/application_form_delete-dim.png" width="16" height="16" alt="Delete this {title}" title="Delete this {title}" /></button></span><span style="width:100px"><tpl if="modified_at">{modified_at}<br /></tpl><tpl if="modified_by">{modified_by}</tpl></span><span>{image}</span><h3>{label}</h3>',"{text}&nbsp;","</div></tpl>"),applyTo:"bonboa_browser_objects",itemSelector:"div.search-item",listAlign:"tr-br",listeners:{select:function(D,B,C){this.reset();if(B.data.link&&!Ext.getCmp("bonboa_metaform_window")&&!bonboa_editing){window.location.replace(B.data.link)}else{bonboa_edit(B.data.title+": "+B.data.label,"bonboa/meta/fetch/"+B.data.table+"/"+B.data.id+"/"+B.data.language+"/edit","bonboa/meta/store/"+B.data.table+"/"+B.data.id+"/","edit",null,false,B.data.table)}}}})}}function bonboa_search_init(A,B){A=((typeof A=="undefined"||!A)?"Search phrase":A);B=(typeof B=="undefined"?false:B);if(bonboa_search_input=document.getElementById("bonboa_searcher")){bonboa_search_input.style.display="block";bonboa_search_ds=new Ext.data.Store({proxy:new Ext.data.ScriptTagProxy({url:"bonboa/meta/search"}),reader:new Ext.data.JsonReader({root:"rows",totalProperty:"totalCount",id:"dummy"},[{name:"table"},{name:"language"},{name:"key"},{name:"label"},{name:"body"},{name:"link"},{name:"match"},{name:"image"}])});bonboa_search_combo=new Ext.form.ComboBox({store:bonboa_search_ds,displayField:"label",tpl:new Ext.XTemplate('<tpl for="."><div class="search-item">',"<span>{image}</span><span><!--{match}--></span><h3>{label}</h3>","{body}&nbsp;","</div></tpl>"),itemSelector:"div.search-item",typeAhead:false,listWidth:370,maxHeight:600,pageSize:6,listAlign:"tr-br",forceSelection:true,minChars:2,emptyText:A+"...",selectOnFocus:true,applyTo:"bonboa_search",editable:true,listeners:{select:function(E,C,D){if(C.data.link){window.location.replace(C.data.link)}else{if(B){bonboa_edit(C.data.table+": "+C.data.label,"bonboa/meta/fetch/"+C.data.table+"/"+C.data.key+"/"+C.data.language+"/edit","bonboa/meta/store/"+C.data.table+"/"+C.data.key+"/","edit",null,false,C.data.table)}}bonboa_search_combo.emptyText="";bonboa_search_combo.clearValue()}}})}}function MM_swapImgRestore(){var C,A,B=document.MM_sr;for(C=0;B&&C<B.length&&(A=B[C])&&A.oSrc;C++){A.src=A.oSrc}}function MM_preloadImages(){var D=document;if(D.images){if(!D.MM_p){D.MM_p=new Array()}var C,B=D.MM_p.length,A=MM_preloadImages.arguments;for(C=0;C<A.length;C++){if(A[C].indexOf("#")!=0){D.MM_p[B]=new Image;D.MM_p[B++].src=A[C]}}}}function MM_findObj(E,D){var C,B,A;if(!D){D=document}if((C=E.indexOf("?"))>0&&parent.frames.length){D=parent.frames[E.substring(C+1)].document;E=E.substring(0,C)}if(!(A=D[E])&&D.all){A=D.all[E]}for(B=0;!A&&B<D.forms.length;B++){A=D.forms[B][E]}for(B=0;!A&&D.layers&&B<D.layers.length;B++){A=MM_findObj(E,D.layers[B].document)}if(!A&&D.getElementById){A=D.getElementById(E)}return A}function MM_swapImage(){var D,C=0,A,B=MM_swapImage.arguments;document.MM_sr=new Array;for(D=0;D<(B.length-2);D+=3){if((A=MM_findObj(B[D]))!=null){document.MM_sr[C++]=A;if(!A.oSrc){A.oSrc=A.src}A.src=B[D+2]}}}Ext.override(Ext.form.Field,{getForm:function(){var A;this.ownerCt.bubble(function(B){if(B.form){A=B.form;return false}},this);return A},onRender:function(D,C){Ext.form.Field.superclass.onRender.call(this,D,C);if(!this.el){var E=this.getAutoCreate();if(!E.name){E.name=this.name||this.id}if(this.inputType){E.type=this.inputType}this.el=D.createChild(E,C)}var G=this.el.dom.type;if(G){if(G=="password"){G="text"}this.el.addClass("x-form-"+G)}if(this.readOnly){this.el.dom.readOnly=true}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls]);this.initValue();var J=this.append||[];if(J.length>0){var A=this.getForm();this.wrap=this.el.wrap({tag:"div"});this.el.wrap({tag:"div",cls:"x-form-append"});for(var B=0,F=J.length;B<F;B++){delete J[B].append;var I=this.wrap.createChild({tag:"div",cls:"x-form-append",style:"position: relative"});var H=new Ext.ComponentMgr.create(J[B],"button");H.render(I);if(A&&H.isFormField){A.items.add(H)}}}if(typeof this.helpText=="string"){this.wrap=this.wrap||this.el.wrap();this.wrap.createChild({tag:"div",cls:"x-form-helptext",html:this.helpText})}}});function bonboa_button_handler_action(B,A){if(B.substring(0,5)=="link:"){link=B.substring(5);window.open(link,"_blank")}else{if(B.substring(0,9)=="download:"){link=B.substring(9);window.open(link,"_self")}else{if(B.substring(0,5)=="data:"){field=B.substring(5);if(field_cmp=Ext.getCmp("bonboa_field_"+field)){field_cmp.el.dom.removeAttribute("name");combo=new Ext.form.ComboBox({renderTo:field_cmp.wrap});list=field_cmp.wrap.createChild({id:"bonboa_field_"+field+"-list",name:field,cls:"x-form",tag:"input",type:"text",size:20})}if(field_file_cmp=Ext.getCmp("bonboa_field_"+field+"-file")){field_file_cmp.el.dom.removeAttribute("name")}}else{if(B.substring(0,6)=="image:"){img=B.substring(6);width=512;height=512;if((x=img.indexOf("x"))>0&&(c=img.indexOf(":"))>0){width=img.substring(0,x);height=img.substring(x+1,c);img=img.substring(c+1)}if(img.length&&width>0&&height>0){options="width="+width+",height="+height+",toolbar=no,resizable=yes,scrollbars=no,status=no,location=no,menubar=no,directories=no";myRef=window.open(img,null,options)}}else{Ext.Ajax.request({url:B,success:function(C){if(B.substring(0,18)=="bonboa/meta/clear/"){if(text_field=Ext.getCmp(A)){if((p=text_field.emptyText.indexOf("("))>0){text_field.emptyText=text_field.emptyText.substring(0,p)}text_field.setValue("")}}else{Ext.getCmp(A).setValue(C.responseText)}},failure:function(){alert("Something went wrong...")}})}}}}}function bonboa_button_handler(C,A,B){if(B){Ext.MessageBox.confirm("Bonboa",B,function(D){if(D=="yes"){bonboa_button_handler_action(C,A)}})}else{bonboa_button_handler_action(C,A)}}function bonboa_get_cookie(A){var F=document.cookie.split(";");var B="";var D="";var E="";var C=false;for(i=0;i<F.length;i++){B=F[i].split("=");D=B[0].replace(/^\s+|\s+$/g,"");if(D==A){C=true;if(B.length>1){E=unescape(B[1].replace(/^\s+|\s+$/g,""))}return E;break}B=null;D=""}if(!C){return null}}function bonboa_set_cookie(C,E,A,H,D,G){var B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24}var F=new Date(B.getTime()+(A));document.cookie=C+"="+escape(E)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"")}function bonboa_delete_cookie(A,C,B){if(bonboa_get_cookie(A)){document.cookie=A+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}Ext.status=function(){var B;function A(C,D){return['<div class="msg">','<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>','<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>',C,"</h3>",D,"</div></div></div>",'<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',"</div>"].join("")}return{msg:function(F,E){if(!B){B=Ext.DomHelper.insertFirst(document.body,{id:"msg-div"},true)}B.alignTo(document,"t-t");var D=String.format.apply(String,Array.prototype.slice.call(arguments,1));var C=Ext.DomHelper.append(B,{html:A(F,D)},true);C.slideIn("t").pause(1).ghost("t",{remove:true})}}}();function bonboa_log(A){window.console.log(JSON.stringify(A,null,4))};