firefish.Web.WebControls.ffDatePicker=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffDatePicker,[n])};firefish.Web.WebControls.ffDatePicker.prototype={initialise:function(){ffControlSystem.callBase(this,firefish.Web.WebControls.ffDatePicker,"initialise");this.textBox=this.Element.find('[id$="txtDate"]');var n=ffControlSystem.getFunctionDelegate(this,this.onBlur);ffControlSystem.attachEvent(this.textBox,"blur",n)},onBlur:function(){this.textBox&&this.textBox.val()=="__/__/____"&&this.textBox.val("")}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffDatePicker,firefish.Web.WebControls.WebControl);
firefish.Web.WebControls.ffDropDownList=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffDropDownList,[n])};firefish.Web.WebControls.ffDropDownList.showLoading=function(n,t){n.prop("disabled",!0);n.find("option").remove().end().append('<option value="'+t+'">loading...<\/option>').val(t)};firefish.Web.WebControls.ffDropDownList.populateDropDownWithOptions=function(n,t,i,r,u,f,e,o){if(n){i||(i="");u||(u="");firefish.Web.WebControls.ffDropDownList.showLoading(n,r);var s="{'parentListName':'"+t+"', 'parentListSelectedItem':'"+i+"', 'parentListArgs':'"+u+"'}",h=ffControlSystem.getFunctionDelegate(this,function(t){firefish.Web.WebControls.ffDropDownList._onSuccess(t,n,r,f,e)}),c=ffControlSystem.getFunctionDelegate(this,function(t){firefish.Web.WebControls.ffDropDownList._onError(t,n,f,r,o)});ffControlSystem.callWebService("/ffControlUtilities.ashx/datalist",s,h,c)}};firefish.Web.WebControls.ffDropDownList._onSuccess=function(n,t,i,r,u){var f=null;try{f=ffParseJson(n)}catch(e){}f==null&&(f=n);firefish.Web.WebControls.ffDropDownList._convertJsonToOptions(f,t,i,r);u&&u.apply(this,[f,t])};firefish.Web.WebControls.ffDropDownList._onError=function(n,t,i,r,u){t.find("option").remove().end().append('<option value="'+i+'">Error populating dropdown<\/option>').val(i).attr("title","There was an error populating this dropdown. Please try again.");u&&u.apply(this,[n,t])};firefish.Web.WebControls.ffDropDownList._convertJsonToOptions=function(n,t,i,r){var o="",s=!1,e,u,f;for(r&&(o+='<option value="'+i+'">'+r+"<\/option>"),u=0;u<n.length;u++)o+=n[u].DisplayName?'<option value="'+n[u].ID+'">'+n[u].DisplayName+"<\/option>":'<option value="'+n[u].ID+'">'+n[u].Text+"<\/option>",s=!0;if(t.find("option").remove().end().append(o).prop("disabled",!1).val(i),s){if(t.prop("disabled",!1),t.length&&(e=t[0].Validators,e&&e.length))for(u=0;u<e.length;++u)f=e[u],f&&f.ddDisabled&&(f.ddDisabled=!1,f.enabled=!0)}else if(t.prop("disabled",!0),t.length&&(e=t[0].Validators,e&&e.length))for(u=0;u<e.length;++u)f=e[u],f&&(f.isvalid=!0,f.ddDisabled=!0,f.enabled=!1,ValidatorUpdateDisplay(f))};firefish.Web.WebControls.ffDropDownList.prototype={initialise:function(){var t,n,i,r;ffControlSystem.callBase(this,firefish.Web.WebControls.ffDropDownList,"initialise");this.childDropdown=ff$("#"+ff$.escape(this.childDropdownID));this.changeHndlr=ffControlSystem.getFunctionDelegate(this,this._onChange);this.docEle=ff$(document);this.emptyValue="-1";this.isGuid&&(this.emptyValue="00000000-0000-0000-0000-000000000000");t=this.emptyValue;this.asyncArgs||(this.asyncArgs="");n=this.Element.val();i=[];n!=t&&this.childDropdown&&this.childDropdown.length&&(this.childDropdown.find("option").map(function(n,r){var u=ff$(r).val();u!=t&&i.push({ID:ff$(r).val(),DisplayName:ff$(r).text()})}),r=n,this.parentListName&&(r=this.parentListName+"_"+n),this.docEle.data("'ddl"+r+"'",i));ffControlSystem.attachEvent(this.Element,"change",this.changeHndlr)},dispose:function(){ffControlSystem.detachEvent(this.Element,"change",this.changeHndlr)},_onChange:function(){var n,t,i,r,u;if(this.useAsync)if(n=this.Element.val(),n==this.emptyValue)this.childDropdown.find("option").remove().end().append('<option value="'+this.emptyValue+'">'+this.childBlankItemText+"<\/option>").val(this.emptyValue);else{if(t=n,this.parentListName&&(t=this.parentListName+"_"+n),this.docEle.data("'ddl"+t+"'")){i=null;this.childHasBlankItem&&(i=this.childBlankItemText);firefish.Web.WebControls.ffDropDownList._convertJsonToOptions(this.docEle.data("'ddl"+t+"'"),this.childDropdown,this.emptyValue,i);return}r=ffControlSystem.getFunctionDelegate(this,this.onSuccess);u=ffControlSystem.getFunctionDelegate(this,this.onError);firefish.Web.WebControls.ffDropDownList.populateDropDownWithOptions(this.childDropdown,this.parentListName,n,this.emptyValue,this.asyncArgs,this.childBlankItemText,r,u)}else firefish.Web.WebControls.ffDropDownList.showLoading(this.childDropdown,this.dropDown)},onSuccess:function(n){var t=this.Element.val();this.parentListName&&(t=this.parentListName+"_"+t);this.docEle.data("'ddl"+t+"'",n)},onError:function(){}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffDropDownList,firefish.Web.WebControls.WebControl);
firefish.Web.WebControls.ffCompanySelect=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffCompanySelect,[n])};firefish.Web.WebControls.ffCompanySelect.prototype={initialise:function(){ffControlSystem.callBase(this,firefish.Web.WebControls.ffCompanySelect,"initialise");this.clearFieldsHandler=ffControlSystem.getFunctionDelegate(this,this._clearFields);this.cancelButton=this.Element.find("[id$=AutoSuggestSelect1_btnCancel]");ffControlSystem.attachEvent(this.cancelButton,"click",this.clearFieldsHandler)},dispose:function(){ffControlSystem.detachEvent(this.cancelButton,"click",this.clearFieldsHandler)},EnableForEdit:function(){var n=ffControlSystem.getControl(this.Element.find("[id$=Autosuggest1]").attr("id"));n.EnableForEdit()},_clearFields:function(){this.Element.find("input[type=text]").val("");this.Element.find("select").val("-1")}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffCompanySelect,firefish.Web.WebControls.WebControl);firefish.Web.WebControls.ffCompanySelect.CreateValidate=function(n,t){t.IsValid=ff$(n).closest(".pnlNewItem").is(":hidden")};
ffTimeDelay=function(){this.onTimeout=null;this.timer=null;this.interval=250};ffTimeDelay.prototype={execute:function(n){this.clearTimeout();var t=this,i=function(){t.timeoutHandler(n)};this.timer=window.setTimeout(i,this.interval)},timeoutHandler:function(n){this.clearTimeout();this.onTimeout&&this.onTimeout.call(n)},clearTimeout:function(){this.timer&&(window.clearTimeout(this.timer),this.timer=null)}};ffBounds=function(n,t,i,r,u){this.width=i;this.height=r;this.left=n;this.right=n+i;this.top=t;this.bottom=t+r;this.centerX=this.Width/2;this.centerY=this.Height/2;this.hasAbsoluteParent=u?u:!1};ffGetBounds=function(n){var i;if(!n)return null;var t=n,u=0,f=0,e=n.offsetWidth,o=n.offsetHeight,r=!1;if(typeof t.parentNode!="undefined")while(t){if(i=t.currentStyle||t.style,!r&&i&&(i.position=="absolute"||i.position=="fixed")){r=!0;break}else u+=t.offsetLeft,f+=t.offsetTop;try{t=t.offsetParent}catch(s){t=null}}return new ffBounds(u,f,e,o,r)};ffGetClientBounds=function(){var n,t;return typeof innerWidth!="undefined"?(n=window.innerWidth,t=window.innerHeight):typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0?(n=document.documentElement.clientWidth,t=document.documentElement.clientHeight):(n=document.getElementsByTagName("body")[0].clientWidth,t=document.getElementsByTagName("body")[0].clientHeight),new ffBounds(0,0,n,t)};ffGetScrollBounds=function(){var n,t;return window.pageXOffset?(n=window.pageXOffset?window.pageXOffset:0,t=window.pageYOffset?window.pageYOffset:0):document.documentElement?(n=document.documentElement.scrollLeft?document.documentElement.scrollLeft:0,t=document.documentElement.scrollTop?document.documentElement.scrollTop:0):(n=document.body.scrollLeft?document.body.scrollLeft:0,t=document.body.scrollTop?document.body.scrollTop:0),new ffBounds(n,t,0,0)};ffBindScrollCompensate=function(n,t,i){n.length&&t&&(ff$(window).bind("resize",function(){t.call(i);ffOffsetScrollBar(n)}),ff$(window).bind("scroll",function(){t.call(i);ffOffsetScrollBar(n)}))};ffUnbindScrollCompensate=function(n,t,i){n.length&&t&&(ff$(window).unbind("resize",function(){t.call(i);ffOffsetScrollBar(n)}),ff$(window).unbind("scroll",function(){t.call(i);ffOffsetScrollBar(n)}))};ffOffsetScrollBar=function(n){if(n.length){var r=ff$(document),u=r.scrollTop(),f=r.scrollLeft(),t=n.css("top"),i=n.css("left");t&&(t=parseInt(t));(!t||isNaN(t))&&(t=0);i&&(i=parseInt(i));(!i||isNaN(i))&&(i=0);n.css("top",t-u).css("left",i-f)}};typeof Sys!="undefined"&&Sys.Application.notifyScriptLoaded();
firefish.Web.WebControls.ffAdvertBackButton=function(n){this.sessionStorageReferrerKey="ffAdvertBackButtonReferrer";this.sessionStorageAdvertKey="ffAdvertBackButtonAdvert";ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffAdvertBackButton,[n])};firefish.Web.WebControls.ffAdvertBackButton.prototype={initialise:function(){ffControlSystem.callBase(this,firefish.Web.WebControls.ffAdvertBackButton,"initialise");var n=ffControlSystem.getFunctionDelegate(this,this.buttonClicked);ffControlSystem.attachEvent(this.Element,"click",n);this.saveCurrentReferrerToSession()},saveCurrentReferrerToSession:function(){if(this.saveCurrentReferrerIfAbsent&&this.advertIDBeingSave&&document.referrer&&sessionStorage){var n=sessionStorage.getItem(this.sessionStorageReferrerKey),t=sessionStorage.getItem(this.sessionStorageAdvertKey);n&&t===String(this.advertIDBeingSave)||(sessionStorage.setItem(this.sessionStorageReferrerKey,document.referrer),sessionStorage.setItem(this.sessionStorageAdvertKey,String(this.advertIDBeingSave)))}},buttonClicked:function(){if(this.alwaysRedirectToBackupURL&&this.backupRedirectURL)window.location.href=this.backupRedirectURL;else{let n=sessionStorage.getItem(this.sessionStorageReferrerKey);n?(sessionStorage.removeItem(this.sessionStorageReferrerKey),sessionStorage.removeItem(this.sessionStorageAdvertKey),!this.onlyUseSavedURLIfContainsPage||n.toLowerCase().includes("?")||n.toLowerCase().includes("page=")||(n=this.backupRedirectURL)):n=this.backupRedirectURL;window.location.href=n?n:"/"}}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffAdvertBackButton,firefish.Web.WebControls.WebControl);
firefish.Web.WebControls.ffModalPanel=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffModalPanel,[n])};firefish.Web.WebControls.ffModalPanel.prototype={initialise:function(){ffControlSystem.callBase(this,firefish.Web.WebControls.ffModalPanel,"initialise");this.scrolled=!1;this.baseElement=this.Element;this.background=ff$("#"+this.baseElement.attr("id")+"MdlBckgrnd");this.background.length==0&&(this.windowResizeHandler=ffControlSystem.getFunctionDelegate(this,this.onResize),ffControlSystem.attachEvent(ff$(window),"resize",this.windowResizeHandler),this.windowScrollHandler=ffControlSystem.getFunctionDelegate(this,this.onScroll),ffControlSystem.attachEvent(ff$(window),"scroll",this.windowScrollHandler),this.panelBodyScrollFunction&&(this.panelBodyScrollHdlr=this.getPanelScrollHdlr(),ffControlSystem.attachEvent(ff$(".modalPanel .mdl-body"),"scroll",this.panelBodyScrollHdlr)));this.mdlHideHdlr=ffControlSystem.getFunctionDelegate(this,function(){this.showModalPanel(!1)});this.escHdlr=ffControlSystem.getFunctionDelegate(this,this._escClose);this.allowEscClose&&(ff$.browser.msie&&parseInt(ff$.browser.version)<9&&ffControlSystem.attachEvent(ff$(document.body),"keyup",this.escHdlr),ffControlSystem.attachEvent(ff$(window),"keyup",this.escHdlr));this.domChangedHandler=ffControlSystem.getFunctionDelegate(this,this.doLayout);ffControlSystem.events.domChanged.subscribe(this.domChangedHandler);this.Element.children.length?(this.CloseBtn=this.Element.children().first().find("span.mdl-hdr-btn"),""!=this.titleText&&this.Element.children().first().find("span.mdl-hdr-txt").text(this.titleText)):this.CloseBtn=this.Element.find("span.mdl-hdr-btn");this.CloseBtn.length>0&&ffControlSystem.attachEvent(this.CloseBtn,"click",this.mdlHideHdlr);this.initialiseControls();this.hfShowPanel=this.getChildElement("hfShowPanel");this.hfArgs=this.getChildElement("hfArgs");this.doLayout()},dispose:function(){this.background.remove();ffControlSystem.detachEvent(ff$(window),"scroll",this.windowScrollHandler);ffControlSystem.detachEvent(ff$(window),"resize",this.windowResizeHandler);this.domChangedHandler&&ffControlSystem.events.domChanged.unsubscribe(this.domChangedHandler);this.background=this.windowResizeHandler=this.windowScrollHandler=null;ff$(document.body).css({"margin-right":0,overflow:"visible"})},initialiseControls:function(){var n;this.background.length==0&&(this.background=ff$("<div class='modalBackground' id='"+this.baseElement.attr("id")+"MdlBckgrnd' />").hide().insertAfter(this.Element.parent()));this.modalLevel>1&&(this.background.css("zIndex",parseInt(this.background.css("zIndex")*this.modalLevel)),n=this.baseElement.parent(),n.css("zIndex",parseInt(n.css("zIndex")*this.modalLevel)));this.customZIndex&&this.customZIndex>0&&(this.background.css("zIndex",this.customZIndex-1),n=this.baseElement.parent(),n.css("zIndex",this.customZIndex));this.baseElement.parent().hide()},_escClose:function(n){this.showPanel&&n.which==27&&this.showModalPanel(!1)},onResize:function(){this.doLayout()},onScroll:function(){this.scrolled||(this.scrolled=!0,this.doLayout(),setTimeout(function(){this.scrolled=!1},500))},getPanelScrollHdlr:function(){if(this.panelBodyScrollFunction)return eval("ffControlSystem.getFunctionDelegate(this, "+this.panelBodyScrollFunction+");")},recalculateSize:function(){this.baseElement.parent().height(this.baseElement.parent().find("> *").outerHeight());this.doLayout()},_setBasePosition:function(n,t,i,r){var o,c,f,a,e;if(r<4)if(o=n.outerWidth(),o==0)c=this,window.setTimeout(function(){c._setBasePosition(n,t,i,++r)},200);else{var u=n.find(".mdl-body:first"),v=n.find(".mdl-hdr:first").outerHeight(),l=Math.max(this.Element.height());this.UseOversizeAutoScrolling&&(f=t-v-40,u.css("max-height",f),t<l||this.isPinned&&.84*t<l?(this.isPinned&&(f-=.16*t),f<60&&(f=60),u.get(0).scrollHeight<=t?u.height("").css("overflow","auto").css("overflowX",""):u.height(f).css("overflow","auto").css("overflowX","hidden")):(u.height("").css({overflow:"auto","overflow-x":"hidden"}),a=!!navigator.userAgent.match(/Trident/g)||!!navigator.userAgent.match(/MSIE/g),a&&u.css("padding-right","25px")),i<o&&!this.isPinned?(n.css("right","0px"),u.css("overflowX","auto")):n.css("right",""));ff$.browser.msie&&parseInt(ff$.browser.version)<=7&&(e=n.find("div.mdl-hdr"),e.length>0&&!e.data("widthset")&&e.width(e.parent().width()-6).data("widthset",!0));var y=n.outerHeight(),o=n.outerWidth(),s=(i-o)/2,h=(t-y)/2;h<0&&(h=0);s<0&&(s=0);n.css("left",s);n.css("top",h)}},_getChildrenHeight:function(n){var t=0;return ff$(n).children().each(function(){t+=ff$(this).outerHeight()}),t},doLayout:function(){if(this.showPanel){var t=ff$(window).height(),n=ff$(window).width();this.baseElement.parent().css("top","-1000px");this.baseElement.parent().css("left","-1000px");this.baseElement.parent().css("right","");this.baseElement.parent().show();this._setBasePosition(this.baseElement.parent(),t,n,0);this.hfShowPanel&&this.hfShowPanel.val(!0);window.innerWidth-n&&ff$(document.body).css({"margin-right":window.innerWidth-n});ff$(document.body).css({"margin-right":0,overflow:"hidden"});this.background.show()}else this.baseElement.parent().hide(),this.background||(this.background=ff$("#"+this.baseElement.attr("id")+"MdlBckgrnd")),this.background.hide()},showModalPanel:function(n){this.showPanel=n;this.hfShowPanel&&this.hfShowPanel.val(n);ff$(document.body).css({"margin-right":0,overflow:"visible"});this.doLayout();n||this.Element.trigger("modalClosed");!n&&this.postbackOnClose&&__doPostBack()},setArgs:function(n){this.hfArgs&&this.hfArgs.val(n)}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffModalPanel,firefish.Web.WebControls.WebControl);firefish.Web.WebControls.ffModalPanel.show=function(n,t){var i=ffControlSystem.getControl(n);i&&(i.showModalPanel(!0),t&&i.setArgs(t))};firefish.Web.WebControls.ffModalPanel.hide=function(n){var t=ffControlSystem.getControl(n);t&&t.showModalPanel(!1)};
firefish.Web.WebControls.ffDocumentDownload=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffDocumentDownload,[n])};firefish.Web.WebControls.ffDocumentDownload.prototype={initialise:function(){ffControlSystem.callBase(this,firefish.Web.WebControls.ffDocumentDownload,"initialise");var n=ffControlSystem.getFunctionDelegate(this,this.onDeleteDocument);this.lnkBtnDeleteImg=this.getChildElement("lnkBtnDeleteImg");this.lnkBtnDocumentImg=this.getChildElement("lnkBtnDocumentImg");ffControlSystem.attachEvent(this.lnkBtnDeleteImg,"click",n)},onDeleteDocument:function(n){var t=confirm("Are you sure you want to remove this file?");if(!t){n.preventDefault();return}this.ClientSideOnly&&(this.Element.hide(),n.preventDefault())}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffDocumentDownload,firefish.Web.WebControls.WebControl);
firefish.Web.WebControls.ffTextBox=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffTextBox,[n])};firefish.Web.WebControls.ffTextBox.prototype={initialise:function(){var i,r,u,n,t;ffControlSystem.callBase(this,firefish.Web.WebControls.ffTextBox,"initialise");this.txtTextBox=this.Element;this.txtTextBox&&(this.txtTextBox.prop("placeholder")&&(i=new Date,ffControlSystem.attachEvent(this.txtTextBox,"focus",function(){var n=new Date,t;n.getTime()-i.getTime()>500&&(i=n,t=this,setTimeout(function(){t.focus()},10))})),r=ffControlSystem.getFunctionDelegate(this,this.onKeyUp),ffControlSystem.attachEvent(this.txtTextBox,"keyup",r),u=ffControlSystem.getFunctionDelegate(this,this.onKeyPress),ffControlSystem.attachEvent(this.txtTextBox,"keypress",u));n=null;n=this.isRequired?ff$(this.txtTextBox).siblings(".characterCountRequired"):ff$(this.txtTextBox).siblings(".characterCount");n&&(n.length==0&&this.txtTextBox?(t=this.txtTextBox.parent(),t&&t.length&&this.showCharacterCount&&(this.lblMaxLength=document.createElement("div"),this.lblMaxLength.className=this.isRequired?"characterCountRequired":"characterCount",t.append(this.lblMaxLength))):this.showCharacterCount||n.hide());this.displayRemainingCharacters();this.enforceInputCapitalisation()},onKeyPress:function(){this.displayRemainingCharacters();this.enforceInputCapitalisation()},onKeyUp:function(){this.displayRemainingCharacters();this.enforceInputCapitalisation()},getChildElement:function(n){var i=null,t=this.get_element(),r;return t&&(r=t.id+"_"+n,i=$get(r,t)),i},displayRemainingCharacters:function(){if(this.lblMaxLength&&this.showCharacterCount&&this.txtTextBox){var n=this.maxLength-this.txtTextBox.val().length;n<0&&(n=0);this.lblMaxLength.innerHTML=n==0?"No characters remaining.":n==1?n+" character remaining.":n+" characters remaining."}},enforceInputCapitalisation:function(){if(this.enforceCapitalisation&&this.txtTextBox){var n=this.txtTextBox.val();n=n.toUpperCase();this.txtTextBox.val(n)}}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffTextBox,firefish.Web.WebControls.WebControl);
firefish.Web.WebControls.ffDecimalFigure=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffDecimalFigure,[n]);this.showCurrency=!1;this.precision=2;this.currencySymbol="";this.decimalSeparator=".";this.thousandSeparator=","};firefish.Web.WebControls.ffDecimalFigure.prototype={initialise:function(){var n,t;ffControlSystem.callBase(this,firefish.Web.WebControls.ffDecimalFigure,"initialise");n=ffControlSystem.getFunctionDelegate(this,this.onFocus);ffControlSystem.attachEvent(this.Element,"focus",n);t=ffControlSystem.getFunctionDelegate(this,this.onBlur);ffControlSystem.attachEvent(this.Element,"blur",t);this.txtTextBox=this.domElement;this.setTextBoxValue(this.showCurrency,!1)},onFocus:function(){this.setTextBoxValue(this.showCurrency,!0)},onBlur:function(){this.setTextBoxValue(this.showCurrency,!1)},setTextBoxValue:function(n,t){var f=this.txtTextBox.value,e=this.txtTextBox.defaultValue,r=!0,u=0,i;f&&(r=this.formatNumber(!t));n&&r&&(i=this.currencySymbol+" ",this.txtTextBox.value=i+this.txtTextBox.value,u=i.length);t&&this.selectText(u,this.txtTextBox.value.length)},selectText:function(n,t){if(this.txtTextBox)if(this.txtTextBox.createTextRange){var i=this.txtTextBox.createTextRange();i.moveStart("character",n);i.moveEnd("character",t);i.select()}else this.txtTextBox.selectionStart?(this.txtTextBox.focus(),this.txtTextBox.setSelectionRange(n,t)):this.txtTextBox.focus()},formatNumber:function(n){var u,t,h,f,i,l,e,a,o,r,c,s,v;if(!this.txtTextBox)return!1;u=!1;t=this.txtTextBox.value;const y=firefish.Web.WebControls.ffDecimalFigure.EnsureRegExpFormattedSeparator(this.thousandSeparator);t=t.replace(new RegExp(y,"g"),"");const p=firefish.Web.WebControls.ffDecimalFigure.EnsureRegExpFormattedSeparator(this.decimalSeparator);if(t=t.replace(new RegExp(p,"g"),"."),h=!1,f=0,t.length>f&&t[f]=="-"&&(h=!0,f++),t=t.substring(f),t=t.replace(this.currencySymbol+" ",""),t=t.replace(this.currencySymbol,""),t=t.replace("k","000"),t=t.replace("K","000"),t=t.trim(),h&&(t="-"+t),i=parseFloat(t),l=new RegExp("^([-]|[+]|[.]|["+this.thousandSeparator+"]|[0-9])*$"),isNaN(i)||!t.match(l))this.txtTextBox.value=t,t==""&&(u=!0);else if(i==0)this.txtTextBox.value="0",u=!0;else{for(this.valueUnits>1&&i<this.valueUnits&&(i=i*this.valueUnits,t=i+""),e=t.split("."),isNaN(i)||(a=i.toFixed(this.precision)+"",e=a.split(".")),o=e[0],r="",e.length>1&&(r=e[1],r=this.showCurrency?r.replace(/^0+$/,""):r.replace(/0+$/,""),r.length&&(r=this.decimalSeparator+r)),c=/(\d+)(\d{3})/;c.test(o);)o=o.replace(c,"$1"+this.thousandSeparator+"$2");this.txtTextBox.value=o+r;u=!0}if(n&&this.Element[0]!=undefined&&this.Element[0].Validators)for(s=0;s<this.Element[0].Validators.length;s++)v=this.Element[0].Validators[s],ValidatorValidate(v);return u},getValueAsFloat:function(){var n="0",i,t;this.setTextBoxValue(this.showCurrency,!1);const r=firefish.Web.WebControls.ffDecimalFigure.EnsureRegExpFormattedSeparator(this.thousandSeparator),u=this.decimalSeparator;return this.txtTextBox&&(i=new RegExp(r,"g"),n=this.txtTextBox.value.replace(i,""),n=n.replace(u,"."),n=n.replace(this.currencySymbol+" ",""),n=n.replace(this.currencySymbol,""),n=n.replace(/ /g,"")),t=parseFloat(n).toFixed(this.precision),isNaN(t)&&(t=0),t},setValue:function(n,t){if(this.txtTextBox){if(t){let t="";n&&(t=n.toString(),t=t.replace(".",this.decimalSeparator));this.txtTextBox.value=t}else this.txtTextBox.value=n;this.setTextBoxValue(this.showCurrency,!1)}},getValueText:function(){var n="";return this.txtTextBox&&(n=this.txtTextBox.value),n},getCurrencySymbol:function(){return this.currencySymbol},getThousandSeparator:function(){return this.thousandSeparator},getDecimalSeparator:function(){return this.decimalSeparator}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffDecimalFigure,firefish.Web.WebControls.WebControl);firefish.Web.WebControls.ffDecimalFigure.ValidateRequiredField=function(n,t){var f,r,i,u,o,s,e;(t.IsValid=!0,n&&n.id)&&(f=n.id.replace("_cvRequired",""),f)&&(r=ffControlSystem.getControl(f),r&&r.getValueText)&&(i=r.getValueText(),u=r.getThousandSeparator(),u=firefish.Web.WebControls.ffDecimalFigure.EnsureRegExpFormattedSeparator(u),o=new RegExp(u,"g"),i=i.replace(o,""),s=r.getDecimalSeparator(),i=i.replace(s,"."),e=r.getCurrencySymbol(),i=i.replace(e+" ",""),i=i.replace(e,""),i=i.replace(/ /g,""),i==""&&(t.IsValid=!1),r.isZeroEmptyText&&parseFloat(i)===0&&(t.IsValid=!1))};firefish.Web.WebControls.ffDecimalFigure.GetValueAsFloat=function(n,t){var i=t;return n&&(n.length&&(n=ffControlSystem.getControl(n.attr("id"))),n&&n.getValueAsFloat&&(i=parseFloat(n.getValueAsFloat()))),i};firefish.Web.WebControls.ffDecimalFigure.TrySetValue=function(n,t){if(n&&!Number.isNaN(t)&&(n.length&&(n=ffControlSystem.getControl(n.attr("id"))),n&&n.setValue))n.setValue(t,!0)};firefish.Web.WebControls.ffDecimalFigure.EnsureRegExpFormattedSeparator=function(n){var t=n;return t==="."&&(t="\\."),t};
firefish.Web.WebControls.ffAutoSuggestControl=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffAutoSuggestControl,[n]);this.hfSelectedKey=null;this.rfvText=null;this.timeDelay=null;this.txtSuggest=null;this.pnlDropDown=null;this.pnlSuggest=null;this.selectedItem=null;this.isLoading=!1;this.isBlurActive=!0;this.isInitialised=!1;this.emptyResults=!1;this.preventFurtherSearchWhenEmptyResult=!0;this.onItemSelected=null;this.onNewSearch=null;this.onControlBlur=null;this.onCancelled=null;this.PostBackReference=null;this.currentSelectedKey=null;this.webServiceName="";this.ContextParameter=""};firefish.Web.WebControls.ffAutoSuggestControl.prototype={initialise:function(){ffControlSystem.callBase(this,firefish.Web.WebControls.ffAutoSuggestControl,"initialise");this.timeDelay=new ffTimeDelay;this.timeDelay.interval=350;this.timeDelay.onTimeout=this.doWebRequest;this.requestTimeoutDelay=new ffTimeDelay;this.requestTimeoutDelay.interval=12e4;this.requestTimeoutDelay.onTimeout=this._requestTimeout;this.errorHndlr=ffControlSystem.getFunctionDelegate(this,this._onError);this.successHndlr=ffControlSystem.getFunctionDelegate(this,this._onSuccess);this.hfSelectedKey=this.getChildElement("hfSelectedKey");this.hfSelectedKey.val()!=""?this.setSelectedItem():this.clearSelectedItem();this.txtSuggest=this.getChildElement("txtSuggest");this.txtSuggest.length&&(this.keyupHandler=ffControlSystem.getFunctionDelegate(this,this.onKeyUp),this.txtSuggest.bind("keyup",this.keyupHandler),this.blurHandler=ffControlSystem.getFunctionDelegate(this,this.onBlur),this.txtSuggest.bind("blur",this.blurHandler),this.keydownHandler=ffControlSystem.getFunctionDelegate(this,this.onKeyDown),this.txtSuggest.bind("keydown",this.keydownHandler));this.rfvText=this.getChildElement("rfvText");this.pnlDropDown=this.getChildElement("pnlDropDown");this.pnlSuggest=this.getChildElement("pnlSuggest");this.mouseoutHandler=ffControlSystem.getFunctionDelegate(this,this.onItemMouseOut);this.mouseinHandler=ffControlSystem.getFunctionDelegate(this,this.onItemMouseOver);this.pnlDropDown.delegate("div.autoSuggestItem > a","mouseover",this.mouseinHandler).delegate("div.autoSuggestItem > a","mouseout",this.mouseoutHandler);this.pnlDropDown.length&&(this.hidePanel(),this.pnlDropDown.css("zIndex",1e4),this.pnlDropDown.bind("blur",this.blurHandler),this.panelClickHandler=ffControlSystem.getFunctionDelegate(this,this.onPanelClick),this.pnlDropDown.bind("mousedown",this.panelClickHandler),this.panelMouseOverHandler=ffControlSystem.getFunctionDelegate(this,this.onPanelMouseOver),this.pnlDropDown.bind("mouseover",this.panelMouseOverHandler),this.panelMouseOutHandler=ffControlSystem.getFunctionDelegate(this,this.onPanelMouseOut),this.pnlDropDown.bind("mouseout",this.panelMouseOutHandler),ffBindScrollCompensate(this.pnlDropDown,this.updatePanel,this));this.isInitialised=!0},dispose:function(){ffControlSystem.detachEvent(this.txtSuggest,"keyup",this.keyupHandler);ffControlSystem.detachEvent(this.txtSuggest,"blur",this.blurHandler);ffControlSystem.detachEvent(this.txtSuggest,"keydown",this.keyupHandler);this.pnlDropDown.find("div.autoSuggestItem > a").undelegate();ffControlSystem.detachEvent(this.pnlDropDown,"click",this.panelClickHandler);ffControlSystem.detachEvent(this.pnlDropDown,"mouseover",this.panelMouseOverHandler);ffControlSystem.detachEvent(this.pnlDropDown,"mouseout",this.panelMouseOutHandler);ffControlSystem.detachEvent(this.pnlDropDown,"blur",this.blurHandler)},doWebRequest:function(){var n;this.requestTimeoutDelay.clearTimeout();n=this.ContextParameter&&this.ContextParameter!=""?ffParseJson("{"+this.ContextParameter+"}"):ffParseJson("{}");n.text=this.txtSuggest.val();parameters=JSON.stringify(n);(n.text.length>=this.searchStringLength||this.searchStringLength==null&&n.text.length>=0)&&(this._doCallBack(parameters),this.requestTimeoutDelay.execute(this))},_requestTimeout:function(){this.pnlDropDown.html("<div>Loading timed out. Please try again.<\/div>")},_doCallBack:function(n){ffControlSystem.callWebService("/ffControlUtilities.ashx/"+this.webServiceName,n,this.successHndlr,this.errorHndlr)},_onSuccess:function(n){if(!this.abort){var t=ffParseJson(n);if(null==t&&(t=n),this.requestTimeoutDelay.clearTimeout(),this.isLoading=!1,t&&t.html&&t.html!=""){this.emptyResults=!1;try{this.pnlDropDown.html(t.html);this.showPanel();this.pnlNewItem.hide()}catch(i){this.clearSelectedItem();this.hidePanel()}"hasResults"in t&&!t.hasResults&&(this.emptyResults=!0,this.txtSuggest&&(this.previousEmptyText=this.txtSuggest.val()),this.onResultEmpty())}else this.emptyResults=!0,this.txtSuggest&&(this.previousEmptyText=this.txtSuggest.val()),this.clearSelectedItem(),this.hidePanel(),this.onResultEmpty()}},_onError:function(){this.isLoading=!1},loading:function(){this.isLoading==!1&&(this.isLoading=!0,this.pnlDropDown.show(),this.updatePanel(),ffOffsetScrollBar(this.pnlDropDown),this.clearSelectedItem(),this.onNewSearch&&this.onNewSearch.call(this),this.pnlDropDown.html("<div class='loadingSuggest'>Loading...<\/div>"))},updatePanel:function(){var t=this.txtSuggest,n=t.offset();n.top+=t.outerHeight();this.pnlDropDown.css("top",n.top).css("left",n.left);this.UseAbsoluteDropdown&&this.pnlSuggest.css("position","relative")},showPanel:function(){this.pnlDropDown.show()},hideNewItemPanel:function(){this.pnlNewItem.hide()},hidePanel:function(){this.hideNewItemPanel();this.pnlDropDown.hide()},clearSelectedItem:function(){this.hfSelectedKey.val("");this.selectedItem=null},doBlur:function(){this.clearSelectedItem();this.hidePanel();this.onControlBlur&&this.onControlBlur.call(this)},setSelectedItem:function(n){var t,i;typeof n=="number"?(t=this.pnlDropDown,n<0?n=0:n>=t.children().length&&(n=t.children().length-1),t.find(".hover").removeClass("hover"),i=t.find("A").eq(n).addClass("hover"),this.setSelectedElement(i)):(this.selectedItem=firefish.Web.WebControls.ffAutoSuggestItem.parseItem(this.hfSelectedKey.val()),this.selectedItem&&(this.currentSelectedKey=this.selectedItem.key))},setSelectedElement:function(n){var t=n.attr("itemKey"),i=n.attr("itemText"),r=n.attr("itemExtra"),u=n.attr("itemExtraWebService"),f=n.attr("itemImageUrl"),e=n.attr("itemImageAlt"),o=new firefish.Web.WebControls.ffAutoSuggestItem(t,i,r,u,f,e);this.setSelectedffAutoSuggestItem(o)},setSelectedffAutoSuggestItem:function(n){this.selectedItem=n;this.hfSelectedKey.val(n.getFormattedString());this.IsSimpleAutoSuggest&&this.txtSuggest.length&&this.txtSuggest.val(n.text);this.currentSelectedKey=n.key},setNextItemSelected:function(){this.setSelectedItem(this.getSelectedIndex()+1)},setPreviousItemSelected:function(){this.setSelectedItem(this.getSelectedIndex()-1)},getSelectedIndex:function(n){if(typeof n!="object"){var n=this.pnlDropDown.find(".hover");if(n.length==0)return-1}return n.parent().prevAll().length},clearTextBox:function(){this.txtSuggest.length&&this.txtSuggest.val("")},getTextBoxVal:function(){if(this.txtSuggest.length)return this.txtSuggest.val()},confirmSelectedElement:function(){var n,t;this.selectedItem&&this.currentSelectedKey&&(this.hidePanel(),n=this.pnlSuggest.find("[id$=cvText]").get(0),n&&ValidatorValidate(n),this.onItemSelected&&this.onItemSelected.call(this),this.PostBackReference&&this.currentSelectedKey&&(t=this.PostBackReference.replace("{0}",this.currentSelectedKey),eval(t)))},onKeyDown:function(n){if(this.ignoreEnterUp=!1,n.keyCode==Sys.UI.Key.enter&&!this.emptyResults){var t=this.getSelectedIndex();return t>=0?(this.ignoreEnterUp=!0,this.setSelectedItem(t),this.confirmSelectedElement()):(this.emptyResults=!0,this.clearSelectedItem(),this.hidePanel(),this.onResultEmpty()),n.cancelBubble=!0,n.stopPropagation&&(n.stopPropagation(),n.preventDefault&&n.preventDefault()),!1}return!0},onKeyUp:function(n){var t=this.txtSuggest.val(),i=t=="",u,r,f;if(this.searchStringLength>0&&t.length<this.searchStringLength&&(i=!0),n.keyCode>=16&&n.keyCode<=18||n.keyCode==Sys.UI.Key.end||n.keyCode==Sys.UI.Key.home||n.keyCode==Sys.UI.Key.right||n.keyCode==Sys.UI.Key.left)return!0;if(n.keyCode==Sys.UI.Key.enter)return u=this.getSelectedIndex(),this.ignoreEnterUp?(this.ignoreEnterUp=!1,!1):!0;if(this.emptyResults&&this.preventFurtherSearchWhenEmptyResult&&!i&&n.keyCode!=Sys.UI.Key.backspace&&n.keyCode!=Sys.UI.Key.del&&!this.IsSimpleAutoSuggest&&(!this.previousEmptyText||t&&t.indexOf&&t.indexOf(this.previousEmptyText)==0))return this.previousEmptyText=this.txtSuggest.val(),!1;this.previousEmptyText="";n.keyCode==Sys.UI.Key.esc?(this.emptyResults=!0,this.clearSelectedItem(),this.hidePanel(),this.onCancelled&&this.onCancelled.call(this)):n.keyCode!=Sys.UI.Key.down||this.emptyResults?n.keyCode!=Sys.UI.Key.up||this.emptyResults?n.keyCode!=Sys.UI.Key.tab||this.emptyResults?(f=n.srcElement?n.srcElement:n.target,i?(this.emptyResults=!1,this.clearSelectedItem(),this.hidePanel()):(this.hidePanel(),this.loading(),this.timeDelay.execute(this))):(r=this.getSelectedIndex(),r>=0&&(this.setSelectedItem(r),this.IsSimpleAutoSuggest&&(this.emptyResults=!0)),n.preventDefault=!1):this.setPreviousItemSelected():this.setNextItemSelected()},onPanelClick:function(n){var t,i;n.which==1&&(t=n.srcElement?n.srcElement:n.target,t=ff$(t).closest("a"),t&&t.length&&(i=t.attr("itemKey"),i&&(this.setSelectedElement(t),this.confirmSelectedElement())))},onItemMouseOver:function(n){var t=ff$(n.currentTarget),i=this.getSelectedIndex(t);return this.setSelectedItem(i),!1},onItemMouseOut:function(){return!1},onPanelMouseOver:function(){this.isBlurActive=!1},onPanelMouseOut:function(){this.isBlurActive=!0},onBlur:function(){if(!ff$(document.activeElement).is(this.pnlDropDown)&&this.isBlurActive==!0&&this.pnlDropDown.is(":visible"))this.doBlur();else return!1},onResultEmpty:function(){}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffAutoSuggestControl,firefish.Web.WebControls.WebControl);firefish.Web.WebControls.ffAutoSuggestItem=function(n,t,i,r,u,f){this.key=n;this.text=t;this.extra=i;this.extraWebService=r;this.imageUrl=u;this.imageAlt=f};firefish.Web.WebControls.ffAutoSuggestItem.parseItem=function(n){var i,t=n.split("|:");return t.length==6&&(i=new firefish.Web.WebControls.ffAutoSuggestItem(t[0],t[1],t[2],t[3],t[4],t[5])),i};firefish.Web.WebControls.ffAutoSuggestItem.prototype={getFormattedString:function(){return(this.key||"")+"|:"+(this.text||"")+"|:"+(this.extra||"")+"|:"+(this.extraWebService||"")+"|:"+(this.imageUrl||"")+"|:"+(this.imageAlt||"")}};firefish.Web.WebControls.ffAutoSuggestControl.reqValidator=function(n,t){t.IsValid=!ff$(n).closest(".pnlSuggest").find(".prAutoSuggestDropDownPanel").is(":visible")};
firefish.Web.WebControls.ffEMailTextBox=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffEMailTextBox,[n])};firefish.Web.WebControls.ffEMailTextBox.prototype={initialise:function(){if(ffControlSystem.callBase(this,firefish.Web.WebControls.ffEMailTextBox,"initialise"),this.fiTick=ff$("[id$='fiTickWrapper']"),this.fiError=ff$("[id$='fiErrorWrapper']"),this.saveButtonID!=null&&(this.btnSave=ff$("[id='"+this.saveButtonID+"']"),this.btnSave.prop("disabled",!0)),this.txtEmailTextBox=this.Element,this.txtEmailTextBox){var n=ffControlSystem.getFunctionDelegate(this,this.onBlur);ffControlSystem.attachEvent(this.txtEmailTextBox,"blur",n)}},dispose:function(){},onBlur:function(){this.validateEmail()},_onSuccess:function(n){(n&&(n=ffParseJson(n)),n)&&(n.userExists?this.txtEmailTextBox.attr("isinvalid",!0):this.txtEmailTextBox.attr("isinvalid",!1),firefish.Utilities.Validation.Revalidate(this.Element),firefish.Utilities.Validation.IsControlValid(this.Element)?this.showTick():this.showError())},_onFail:function(){this.handleSaveButton(!1)},showError:function(){this.fiTick.removeClass("show");this.fiTick.addClass("hide");this.fiError.removeClass("hide");this.fiError.addClass("show");this.handleSaveButton(!1)},showTick:function(){this.fiTick.removeClass("hide");this.fiTick.addClass("show");this.fiError.removeClass("show");this.fiError.addClass("hide");this.handleSaveButton(!0)},validateEmail:function(){var i=ffControlSystem.getFunctionDelegate(this,this._onSuccess),r=ffControlSystem.getFunctionDelegate(this,this._onFail),n={UserName:this.Element.val()},t;this.verifyAccount&&(!this.initialEmailAddress||this.initialEmailAddress!=n.UserName)?ffControlSystem.callWebService("/_firefish/Handlers/accountverification.ashx",JSON.stringify(n),i,r):(this.fiTick.removeClass("show"),this.fiTick.addClass("hide"),this.fiError.removeClass("show"),this.fiError.addClass("hide"),firefish.Utilities.Validation.Revalidate(this.Element),t=firefish.Utilities.Validation.IsControlValid(this.Element),this.handleSaveButton(t))},handleSaveButton:function(n){this.btnSave!=null&&this.btnSave.prop("disabled",!n)}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffEMailTextBox,firefish.Web.WebControls.ffTextBox);firefish.Web.WebControls.ffEMailTextBox.Validate=function(n,t){var u=ff$(n),i=ffControlSystem.getControl(u.prop("controltovalidate")),r;i&&i.Element&&(r=!0,i.Element.attr("isinvalid")=="true"&&(r=!1),t.IsValid=r)};
firefish.Web.WebControls.ffAutoSuggestSelectControl=function(n){ffControlSystem.baseConstructor(this,firefish.Web.WebControls.ffAutoSuggestSelectControl,[n]);this.allowNewItems=!0;this.enabled=!0;var t=this;this.onItemSelected=function(){t.itemSelected()};this.onNewSearch=function(){t.newSearch()};this.onControlBlur=function(){t.autoSuggestBlur()};this.onCancelled=function(){t.onCancelClicked()};this.cancelNewButtonClientID=null;this.saveNewButtonClientID=null;this.useFontImageForEditButton=!0;this.editButtonCssClass="ffs-sprite EditPencilSmallImg"};firefish.Web.WebControls.ffAutoSuggestSelectControl.prototype={initialise:function(){this.pnlSuggest=this.getChildElement("pnlSuggest");this.pnlSelectedItem=this.getChildElement("pnlSelectedItem");this.pnlNewItem=this.getChildElement("pnlNewItem");ffControlSystem.callBase(this,firefish.Web.WebControls.ffAutoSuggestSelectControl,"initialise");this.enableValidators(this.pnlNewItem,!1);this.useFontImageForEditButton&&(this.editButtonCssClass="ffFontImage small ffBlue");this.itemSelected();this.cancelNewButtonClientID&&(this.cancelButton=ff$("#"+this.cancelNewButtonClientID),this.cancelClickHandler=ffControlSystem.getFunctionDelegate(this,this.onCancelClicked),this.cancelButton.bind("click",this.cancelClickHandler));this.saveNewButtonClientID&&(this.saveButton=ff$("#"+this.saveNewButtonClientID),this.saveClickHandler=ffControlSystem.getFunctionDelegate(this,this.onSaveClicked),this.saveButton.bind("click",this.saveClickHandler))},dispose:function(){ffControlSystem.detachEvent(this.txtSuggest,"blur",this.blurHandler);ffControlSystem.detachEvent(this.txtSuggest,"keydown",this.keyupHandler);this.cancelNewButtonClientID&&ffControlSystem.detachEvent(this.cancelButton,"click",this.cancelClickHandler);this.saveNewButtonClientID&&ffControlSystem.detachEvent(this.saveButton,"click",this.saveClickHandler)},itemSelected:function(){var u=this.selectedItem,t,i,r,e,n,f;if(u!=null){if(this.pnlSuggest.hide(),this.pnlSelectedItem.show(),this.pnlNewItem.hide(),this.enableValidators(this.pnlNewItem,!1),this.rfvText.attr("enabled",!1),t=ff$(document.createElement("div")),t.addClass("sgst-links-edit"),i=u.text,this.renderHtmlEntityCharactersInTitle?(i=i.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/g,""),r=ff$(document.createElement("strong")).html(i)):r=ff$(document.createElement("strong")).text(i),this.selectedItemLinkRef&&this.selectedItemLinkEnabled&&(e=ff$(document.createElement("a")).attr("href",this.selectedItemLinkRef).addClass("itemLink").append(r),r=e),n=null,this.enabled&&(this.useFontImageForEditButton?(n=ff$(document.createElement("a")).attr("href","javascript:void(0);").addClass("noUnderline").append(ff$(document.createElement("span")).addClass(this.editButtonCssClass).text(this.editButtonHtml)).append(this.editButtonText),n.bind("click",ffControlSystem.getFunctionDelegate(this,this.changeSelection))):(n=ff$(document.createElement("a")).attr("href","javascript:void(0);").addClass("noUnderline").append(ff$(document.createElement("span")).addClass(this.editButtonCssClass)).append(ff$(document.createElement("span")).css("font-size","80%").text(this.editText)),n.bind("click",ffControlSystem.getFunctionDelegate(this,this.changeSelection)))),t.append(r),this.openNewTabLink){const n=ff$(document.createElement("i")).addClass("ffOpenInNewTab__icon far ffLink ffLink--noPadding ffHelper--margin-right-5 ffLink--withIcon ffLink--externalLink"),i=ff$(document.createElement("a")).attr("title","Open in new tab").attr("target","_blank").attr("href",this.openNewTabLink).addClass("ffCompanySelect__opentInNewTab").append(n);t.append(i)}this.enabled&&n&&t.append(n);f=ff$(document.createElement("div")).text(u.extra);f.addClass("itemLink-extra-details");this.pnlSelectedItem.empty();this.pnlSelectedItem.append(t);this.pnlSelectedItem.append(f);this.enableValidators(this.pnlSuggest,!1)}},newSearch:function(){this.pnlSuggest.show();this.pnlSelectedItem.hide();this.pnlNewItem.hide();this.enableValidators(this.pnlNewItem,!1);this.rfvText.attr("enabled",!0)},oldSearch:function(){this.pnlSuggest.hide();this.pnlSelectedItem.show();this.pnlNewItem.show();this.enableValidators(this.pnlNewItem,!0);this.rfvText.attr("enabled",!1)},autoSuggestBlur:function(){},isNewCompanyPanelShown:function(){return this.pnlNewItem.is(":visible")},showNewItemPanel:function(){this.txtSuggest.val()!=""&&(this.pnlSuggest.show(),this.pnlSelectedItem.hide(),this.pnlNewItem.show(),this.enableValidators(this.pnlNewItem,!0))},hideNewItemPanel:function(){this.pnlSuggest.show();this.pnlSelectedItem.hide();this.pnlNewItem.hide();this.enableValidators(this.pnlNewItem,!1);this.enableValidators(this.pnlSuggest,!0)},enableValidators:function(n,t){firefish.Utilities.Validation.EnableValidators(n,t)},EnableForEdit:function(){this.enableValidators(this.pnlSuggest,this.pnlSuggest.is(":visible"))},changeSelection:function(){this.clearSelectedItem();this.newSearch();this.txtSuggest.val("");this.txtSuggest.focus();this.enableValidators(this.pnlSuggest,!0)},onCancelClicked:function(){this.clearSelectedItem();this.oldSearch();this.hideNewItemPanel();this.emptyResults=!1;this.txtSuggest.val("")},onSaveClicked:function(){},onResultEmpty:function(){this.allowNewItems&&this.showNewItemPanel()},hidePanel:function(){this.pnlDropDown.hide();this.hideNewItemPanel()}};ffControlSystem.deriveClass(firefish.Web.WebControls.ffAutoSuggestSelectControl,firefish.Web.WebControls.ffAutoSuggestControl);
jQuery.noConflict(!0);
