Ext.ns("TI.Common");TI.Common.Hash=Ext.extend(Object,{keys:function(){var a=[];for(var b in this){if(this.hasOwnProperty(b)){a.push(b)}}return a},values:function(){var a=[];for(var b in this){if(this.hasOwnProperty(b)){a.push(this[b])}}return a},length:function(){var a=0;for(var b in this){if(this.hasOwnProperty(b)){a++}}return a}});TI.Common.getBrowserVersion=function(){var c=navigator.userAgent;if(/Firefox[\/\s](\S*)/.test(c)){return"Firefox "+RegExp.$1}else{if(/MSIE ([^;]*);/.test(c)){var b=RegExp.$1;if(/Trident\/([45]\.0)/.test(c)){var a=RegExp.$1;if(a=="5.0"&&b!="9.0"){return"Internet Explorer 9.0 "+$T(8474)}if(a=="4.0"&&b!="8.0"){return"Internet Explorer 8.0 "+$T(8474)}}return"Internet Explorer "+b}else{if(Ext.isIE){return"Internet Explorer"}else{if(/Opera[\/\s](\S*)/.test(c)){return"Opera "+RegExp.$1}else{if(Ext.isOpera){return"Opera"}else{if(/Chrome\/(\S*)/.test(c)){return"Chrome "+RegExp.$1}else{if(Ext.isChrome){return"Chrome"}else{if(Ext.isSafari){if(Ext.isSafari2){return"Safari 2.X"}else{if(/Version\/(\S*)/.test(c)){return"Safari "+RegExp.$1}else{return"Safari"}}}else{var d=c.split(" ");if(d.length>0){return d[0]}else{return"?"}}}}}}}}}};TI.Common.configurePageUnload=function(){window.onbeforeunload=function(c){var c=c||window.event;var b="";var a=$T(7501);if(Ext.isChrome){b=String.format(a,$T(7502),$T(7503))}else{b=String.format(a,$T(7504),$T(7505))}if(c){c.returnValue=b}return b}};TI.Common.navigate=function(a,b){var c=window.onbeforeunload;try{window.onbeforeunload=Ext.emptyFn;window.location=a}finally{if(b===true){(function(){window.onbeforeunload=c}).defer(50)}}};TI.Common.currency=function(b){if(!Ext.isEmpty(b)){var a=b<0;var e=gSystemCulture.currencyPositivePattern;if(a){b=-b;e=gSystemCulture.currencyNegativePattern}b=String(b.toFixed(gSystemCulture.currencyDecimalDigits));var f=b.split("."),d=f[0],c=f[1];if(gSystemCulture.currencyGroupSize>0){r=new RegExp(String.format("(\\d+)(\\d{{0}})",gSystemCulture.currencyGroupSize));while(r.test(d)){d=d.replace(r,"$1"+gSystemCulture.currencyGroupSeparator+"$2")}}b=d;if(c){b=b+gSystemCulture.currencyDecimalSeparator+c}return String.format(e,b)}else{return b}};Ext.ns("TI.Common");$M=function(a,d){if(!Ext.isNumber(a)){throw"Invalid UIFieldId: "+a}else{var c="$"+a;if(a<0){c="$_"+Math.abs(a)}var b=TI.UIMetadata[c];if(Ext.isEmpty(b)){throw"UIMetadata not defined: "+a}if(!Ext.isEmpty(d)){return b[d]}else{return b}}};$T=$M.createDelegate(null,["txt"],true);$T2=function(a){return a};Ext.override(Ext.Panel,{initComponent:Ext.Panel.prototype.initComponent.createSequence(function(){if(this.metadataId){this.title=$T(this.metadataId)}})});Ext.override(Ext.Button,{initComponent:Ext.Button.prototype.initComponent.createSequence(function(){if(this.metadataId){var a=$M(this.metadataId);this.text=a.txt;this.tooltip=a.tt}}),setMetadataId:function(b){this.metadataId=b;var a=$M(this.metadataId);this.setText(a.txt);this.setTooltip(a.tt)}});Ext.override(Ext.form.Label,{initComponent:Ext.form.Label.prototype.initComponent.createSequence(function(){if(this.metadataId){this.text=$T(this.metadataId)}})});Ext.override(Ext.form.Field,{initComponent:Ext.form.Field.prototype.initComponent.createSequence(function(){if(this.metadataId){this.fieldLabel=Ext.util.Format.htmlEncode($T(this.metadataId))}})});Ext.override(Ext.form.TextField,{initComponent:Ext.form.TextField.prototype.initComponent.createSequence(function(){if(this.metadataId){var a=$M(this.metadataId);this.allowBlank=a.req!==true;if(a.len>0){this.maxLength=a.len}}})});Ext.override(Ext.form.ComboBox,{initComponent:Ext.form.ComboBox.prototype.initComponent.createSequence(function(){if(this.metadataId){var a=$M(this.metadataId);if(this.requiredMode=="select"){this.vtype=a.req===true?"select":"";this.allowBlank=true}else{this.allowBlank=a.req!==true}if(this.forceSelection===true){this.maxLength=Number.MAX_VALUE}else{if(a.len>0){this.maxLength=a.len}}}})});Ext.override(Ext.form.NumberField,{initComponent:Ext.form.NumberField.prototype.initComponent.createSequence(function(){if(this.metadataId){var a=$M(this.metadataId);this.allowBlank=a.req!==true;if(a.min){this.minValue=a.min}if(a.max){this.maxValue=a.max}}})});Ext.override(Ext.form.Checkbox,{initComponent:Ext.form.Checkbox.prototype.initComponent.createSequence(function(){if(this.metadataId){this.boxLabel=$T(this.metadataId);this.fieldLabel=""}})});Ext.override(Ext.menu.Item,{initComponent:Ext.menu.Item.prototype.initComponent.createSequence(function(){if(this.metadataId){this.text=$T(this.metadataId)}})});Ext.apply(Ext.form.VTypes,{select:function(a,b){if(b instanceof Ext.form.ComboBox){return !Ext.isEmpty(a)||b.getStore().find(b.displayField,/\S/)==-1}else{return false}},selectText:$T(7500)});Ext.override(Ext.layout.FormLayout,{getTemplateArgs:function(a){return{id:a.id,label:TI.Common.formatLabel(a.fieldLabel,a.allowBlank),labelStyle:a.labelStyle||this.labelStyle||"",elementStyle:this.elementStyle||"",labelSeparator:"",itemCls:(a.itemCls||this.container.itemCls||"")+(a.hideLabel?" x-hide-label":""),clearCls:a.clearCls||"x-form-clear-left"}}});TI.Common.formatLabel=function(b,a){return String.format($T(5168),b)+(a===false?"*":"")};TI.Common.getText=function(a){return Ext.isNumber(a)?$T(a):a};Ext.UpdateManager.defaults.indicatorText='<div class="loading-indicator">'+$T(7620)+"</div>";if(Ext.LoadMask){Ext.LoadMask.prototype.msg=$T(7621)}Date.monthNames=[$T(7622),$T(7623),$T(7624),$T(7625),$T(7626),$T(7627),$T(7628),$T(7629),$T(7630),$T(7631),$T(7632),$T(7633)];Date.shortMonthNames=[$T(7634),$T(7635),$T(7636),$T(7637),$T(7638),$T(7639),$T(7640),$T(7641),$T(7642),$T(7643),$T(7644),$T(7645)];Date.getShortMonthName=function(a){return Date.shortMonthNames[a]};Date.monthNumbers={};Date.monthNumbers[$T(7634)]=0;Date.monthNumbers[$T(7635)]=1;Date.monthNumbers[$T(7636)]=2;Date.monthNumbers[$T(7637)]=3;Date.monthNumbers[$T(7638)]=4;Date.monthNumbers[$T(7639)]=5;Date.monthNumbers[$T(7640)]=6;Date.monthNumbers[$T(7641)]=7;Date.monthNumbers[$T(7642)]=8;Date.monthNumbers[$T(7643)]=9;Date.monthNumbers[$T(7644)]=10;Date.monthNumbers[$T(7645)]=11;Date.getMonthNumber=function(a){return Date.monthNumbers[a.substring(0,1).toUpperCase()+a.substring(1,3).toLowerCase()]};Date.dayNames=[$T(7646),$T(7647),$T(7648),$T(7649),$T(7650),$T(7651),$T(7652)];Date.getShortDayName=function(a){return Date.dayNames[a].substring(0,3)};if(Ext.MessageBox){Ext.MessageBox.buttonText={ok:$T(7653),cancel:$T(7654),yes:$T(7655),no:$T(7656)}}if(Ext.util.Format){Ext.util.Format.date=function(a,b){if(!a){return""}if(!(a instanceof Date)){a=new Date(Date.parse(a))}return a.dateFormat(b||(window.gUserCulture?window.gUserCulture.shortDateFormat:"d/m/Y"))}}if(Ext.DatePicker){Ext.apply(Ext.DatePicker.prototype,{todayText:$T(7657),minText:$T(7658),maxText:$T(7659),disabledDaysText:"",disabledDatesText:"",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:$T(7660),prevText:$T(7661),monthYearText:$T(7662),todayTip:$T(7663),format:window.gUserCulture?window.gUserCulture.shortDateFormat:"d/m/Y",okText:$T(7664),cancelText:$T(7665),startDay:0})}if(Ext.PagingToolbar){Ext.apply(Ext.PagingToolbar.prototype,{beforePageText:$T(7666),afterPageText:$T(7667),firstText:$T(7668),prevText:$T(7669),nextText:$T(7670),lastText:$T(7671),refreshText:$T(7672),displayMsg:$T(7673),emptyMsg:$T(7674)})}if(Ext.form.BasicForm){Ext.form.BasicForm.prototype.waitTitle=$T(7675)}if(Ext.form.Field){Ext.form.Field.prototype.invalidText=$T(7676)}if(Ext.form.TextField){Ext.apply(Ext.form.TextField.prototype,{minLengthText:$T(7677),maxLengthText:$T(7678),blankText:$T(7679),regexText:"",emptyText:null})}if(Ext.form.NumberField){Ext.apply(Ext.form.NumberField.prototype,{decimalSeparator:window.gUserCulture?window.gUserCulture.decimalSeparator:".",decimalPrecision:2,minText:$T(7680),maxText:$T(7681),nanText:$T(7682)})}if(Ext.form.DateField){Ext.apply(Ext.form.DateField.prototype,{disabledDaysText:$T(7683),disabledDatesText:$T(7684),minText:$T(7685),maxText:$T(7686),invalidText:$T(7687),format:window.gUserCulture?window.gUserCulture.shortDateFormat:"d/m/Y",altFormats:"m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d"})}if(Ext.form.ComboBox){Ext.apply(Ext.form.ComboBox.prototype,{loadingText:$T(7688),valueNotFoundText:undefined})}if(Ext.form.VTypes){Ext.apply(Ext.form.VTypes,{emailText:$T(7689),urlText:$T(7690),alphaText:$T(7691),alphanumText:$T(7692)})}if(Ext.grid.GridView){Ext.apply(Ext.grid.GridView.prototype,{sortAscText:$T(7693),sortDescText:$T(7694),columnsText:$T(7695)})}if(Ext.grid.GroupingView){Ext.apply(Ext.grid.GroupingView.prototype,{emptyGroupText:$T(7696),groupByText:$T(7697),showGroupsText:$T(7698)})}if(Ext.grid.BooleanColumn){Ext.apply(Ext.grid.BooleanColumn.prototype,{trueText:$T(7699),falseText:$T(7700),undefinedText:"&#160;"})}if(Ext.grid.NumberColumn){Ext.apply(Ext.grid.NumberColumn.prototype,{format:"0,000.00"})}if(Ext.grid.DateColumn){Ext.apply(Ext.grid.DateColumn.prototype,{format:window.gUserCulture?window.gUserCulture.shortDateFormat:"d/m/Y"})}if(Ext.layout.BorderLayout&&Ext.layout.BorderLayout.SplitRegion){Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype,{splitTip:$T(7701),collapsibleSplitTip:$T(7702)})}if(Ext.form.TimeField){Ext.apply(Ext.form.TimeField.prototype,{minText:$T(7703),maxText:$T(7704),invalidText:$T(7705),format:window.gUserCulture?window.gUserCulture.shortTimeFormat:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H"})}if(Ext.form.CheckboxGroup){Ext.apply(Ext.form.CheckboxGroup.prototype,{blankText:$T(7706)})}if(Ext.form.RadioGroup){Ext.apply(Ext.form.RadioGroup.prototype,{blankText:$T(7707)})}if(Ext.ux.grid&&Ext.ux.grid.GridFilters){Ext.apply(Ext.ux.grid.GridFilters.prototype,{menuFilterText:$T(7708)})}Ext.ns("TI.Common");var WebSessionExpiredErrorId="Web.Lifecycle.001";var TrackItSessionExpiredErrorId="Web.Lifecycle.002";var LogOutPath=gTrackItWebRoot+"Account/LogOut";TI.Common.showErrorDialog=function(a,b){b=b||{};var c=TI.Common.DecodeAjaxResponse(a);if(c&&c.errorInfo){if(c.errorInfo.ErrorId==WebSessionExpiredErrorId){Ext.Msg.alert($T(7496),$T(7497),TI.Common.navigate.createDelegate(null,[LogOutPath]))}else{if(c.errorInfo.ErrorId==TrackItSessionExpiredErrorId){Ext.Msg.alert($T(7498),$T(7499),TI.Common.navigate.createDelegate(null,[LogOutPath]))}else{TI.Common.ServerErrorDialog.show(c.errorInfo,b)}}}else{TI.Common.AjaxResponseErrorDialog.show(a,b)}};var commonErrorDialogOptions={autoCreate:true,bodyStyle:"padding:10px 10px 10px 10px;",minimizable:false,stateful:false,modal:true,plain:true,footer:true,closable:true,closeAction:"hide"};function ensureDialogIsHiddenBeforeShow(a){if(a&&a.isVisible()){a.hide()}}function repositionAndShowErrorDialog(c,b,a){if(!c.isVisible()){if(!c.manager){c.manager=Ext.WindowMgr}c.setSize(b,a).center();c.show()}}TI.Common.ServerErrorDialog=function(){var f,c,a,b;TI.Common.getSupportWebSiteUrl=function(){TI.Common.ajax({url:"Application/GetSupportWebSiteURL.json",params:{errorInfoGuid:f.errorInfo.ErrorInfoGuid}},this,function(h,i,g){window.open(i.supportWebSiteURL,"SupportSiteErrorWin")})};var e=function(){TI.Common.ajax({url:"Application/RemoveErrorInfo",params:{errorInfoGuid:f.errorInfo.ErrorInfoGuid}})};var d=function(g){TI.Common.ErrorDetailsDialog.show(f.errorInfo.Report)};return{getDialog:function(i){if(!f){var h=540,g=260;if(i.Simple===true){b=new Ext.Template('<div class="error-dlg-icon error-dialog-img"></div>','<div class="error-dlg-content">','<div class="error-dlg-simple-summary" id="error-dlg-summary">{Summary}</div>','<div class="error-dlg-simple-error-id" id="error-dlg-error-id">Error Code: {ErrorId}</div>',"</div>","</div>");h=460;g=160}else{b=new Ext.Template('<div class="error-dlg-icon error-dialog-img"></div>','<div class="error-dlg-content">','<div class="error-dlg-summary" id="error-dlg-summary">{Summary}</div>',String.format('<div class="error-dlg-addl-info" id="error-dlg-addl-info">{0}</div>',$T(7488)),'<div class="error-dlg-error-id" id="error-dlg-error-id">{ErrorId}</div>','<div class="error-dlg-description" id="error-dlg-description">'," &nbsp;-- ","{InnerMostExceptionMessage}</div>",'<div class="error-dlg-support-web-url">',String.format('  <a id="error-dlg-support-web-link" href="#" onclick="TI.Common.getSupportWebSiteUrl(); return false;" >{0}</a>',$T(7489)),"</div>","</div>")}f=new Ext.Window(Ext.apply({id:"ErrorDialog",autoScroll:true,errorInfo:null,title:$T(7490),defaultWidth:h,defaultHeight:g,width:h,height:g,minWidth:h,minHeight:g,buttonAlign:"left",buttons:[{id:"error-dlg-view-details-btn",metadataId:7491,handler:d,hidden:i.Simple},"->",{id:"error-dlg-ok-btn",metadataId:7492,handler:function(){f.hide()}}],listeners:{hide:function(){if(i.Simple!==true){e()}if(Ext.isFunction(c.callback)){c.callback.call(c.scope||window)}}}},commonErrorDialogOptions));f.render(document.body);a=f.body.createChild({html:'<div class="error-dlg-icon error-dialog-img"></div><div class="error-dlg-content">&nbsp;</div>'})}f.errorInfo=i;b.overwrite(a,i);return f},show:function(i,g){ensureDialogIsHiddenBeforeShow(f);c=g||{};var h=this.getDialog(i);repositionAndShowErrorDialog(h,h.defaultWidth,h.defaultHeight)}}}();TI.Common.ErrorDetailsDialog=function(){var b,a;return{getDialog:function(c){if(!b){var e=800,d=350;a=new Ext.form.TextArea({id:"errorDetailsTextArea",autoCreate:true,readOnly:true,style:"background-color: transparent; background-image: none;"});b=new Ext.Window(Ext.apply({id:"ErrorDetailsDialog",title:$T(7493),layout:"fit",maximizable:true,width:e,height:d,minWidth:e,minHeight:d,defaultWidth:e,defaultHeight:d,items:[a],buttons:[{id:"error-details-ok-btn",metadataId:7492,handler:function(){b.hide()}}]},commonErrorDialogOptions));b.render(document.body)}a.setValue(c);return b},show:function(c){ensureDialogIsHiddenBeforeShow(b);var e=this.getDialog(c);repositionAndShowErrorDialog(e,e.defaultWidth,e.defaultHeight)}}}();TI.Common.AjaxResponseErrorDialog=function(){var h,e,b,a,d,c;var f=function(){TI.Common.AjaxResponseErrorDetailsDialog.show(h.responseText)};var g=function(i){var j="";if(i.isTimeout===true){j=String.format($T(7494),i.statusText)}else{j=String.format($T(7934),i.status,i.statusText)}return j};return{getDialog:function(i){if(!h){var m=420,l=260;c=new Ext.Button({id:"ajax-error-dlg-view-details-btn",metadataId:7491,handler:f});h=new Ext.Window(Ext.apply({id:"AjaxResponseErrorDialog",responseText:null,title:$T(7495),width:m,height:l,minWidth:m,minHeight:l,defaultWidth:m,defaultHeight:l,buttonAlign:"left",buttons:[c,"->",{id:"ajax-error-dlg-ok-btn",metadataId:7492,handler:function(){h.hide()}}],listeners:{hide:function(){if(Ext.isFunction(e.callback)){e.callback.call(e.scope||window)}}}},commonErrorDialogOptions));h.render(document.body);b=h.body.createChild({html:'<div class="error-dlg-icon error-dialog-img"></div><div class="error-dlg-content"><div id="ajaxResponseErrorMessage" class="error-dlg-message">&nbsp;</div></div>'});a=Ext.get(b.dom.firstChild);var k=b.dom.childNodes[1];d=Ext.get(k.firstChild)}if(i.responseText){c.show();h.responseText=i.responseText}else{c.hide();h.responseText=""}var j=g(i);d.update(j||"&#160;");return h},show:function(i,j){ensureDialogIsHiddenBeforeShow(h);e=j||{};var k=this.getDialog(i);repositionAndShowErrorDialog(k,k.defaultWidth,"auto")}}}();TI.Common.AjaxResponseErrorDetailsDialog=function(){var b,a;return{getDialog:function(c){if(!b){var e=800,d=350;b=new Ext.Window(Ext.apply({id:"AjaxResponseErrorDetailsDialog",title:$T(7493),width:e,height:d,minWidth:e,minHeight:d,defaultWidth:e,defaultHeight:d,layout:"fit",autoScroll:true,maximizable:true,buttons:[{id:"ajax-details-ok-btn",metadataId:7492,handler:function(){b.hide()}}]},commonErrorDialogOptions));b.render(document.body);bodyEl=b.body.createChild({html:'<div id="AjaxResponseText"></div>'});a=Ext.get(bodyEl.dom.firstChild)}a.update(c||"&#160;");return b},show:function(c){ensureDialogIsHiddenBeforeShow(b);var e=this.getDialog(c);repositionAndShowErrorDialog(e,e.defaultWidth,e.defaultHeight)}}}();Ext.ns("TI.Common");TI.Common.ajax=function(c,e,a,b){function d(i,k,h){var j=false;if(Ext.isFunction(b)){j=b.call(this,i,k,h)}if(j!==true){TI.Common.showErrorDialog(h,c.errorDialogOptions||{})}else{var k=TI.Common.DecodeAjaxResponse(h);if(k&&k.errorInfo&&k.errorInfo.Simple!==true){TI.Common.ajax({url:"Application/RemoveErrorInfo",params:{errorInfoGuid:k.errorInfo.ErrorInfoGuid}})}}}var g=(Ext.isString(c.url)&&(c.url.indexOf(gTrackItWebRoot)===0));if(!g){c.url=gTrackItWebRoot+c.url}var f=Ext.apply({scope:e,callback:function(i,k,h){var j=TI.Common.DecodeAjaxResponse(h);if(k!==true){d.call(e,i,j,h)}else{if(j&&(j.success===true)){if(Ext.isFunction(a)){a.call(e,i,j.data,h)}}else{d.call(e,i,j,h)}}}},c);Ext.Ajax.request(f)};TI.Common.DecodeAjaxResponse=function(a){var c=null;try{c=Ext.util.JSON.decode(a.responseText)}catch(b){}return c};Ext.ns("SelfService");SelfService.AutoCreateDialog=Ext.extend(Ext.Window,{constructor:function(b){b=b||"";var a=Ext.apply({},{id:"auto-create-dialog",layout:"form",draggable:false,closable:false,width:450,autoHeight:true,modal:true,bodyStyle:"padding: 10px 10px 0",title:$T(8017),focus:function(){this.fullName.focus()}});this.label1=new Ext.form.Label({id:a.id+"-label-1",metadataId:8019,cls:"auto-create"});this.label2=new Ext.form.Label({id:a.id+"-label-2",metadataId:8020});this.userId=new Ext.form.TextField({id:a.id+"-user-id",metadataId:8022,cls:"read-only",readOnly:true,value:b});this.fullName=new Ext.form.TextField({id:a.id+"-full-name",metadataId:8024,name:"fullName",allowBlank:false,stateful:false,listeners:{specialkey:function(d,c){if(c.getKey()==c.ENTER){var f=d.ownerCt.ownerCt;f.okButton.handler.call(f.okButton.scope,f.okButton,Ext.EventObject)}},scope:this}});this.newPassword=new Ext.form.TextField({id:a.id+"-new-password",metadataId:8026,name:"newPassword",inputType:"password",stateful:false,listeners:{specialkey:function(d,c){if(c.getKey()==c.ENTER){var f=d.ownerCt.ownerCt;f.okButton.handler.call(f.okButton.scope,f.okButton,Ext.EventObject)}},scope:this}});this.confirmNewPassword=new Ext.form.TextField({id:a.id+"-confirm-new-password",metadataId:8028,name:"confirmNewPassword",inputType:"password",stateful:false,listeners:{specialkey:function(d,c){if(c.getKey()==c.ENTER){var f=d.ownerCt.ownerCt;f.okButton.handler.call(f.okButton.scope,f.okButton,Ext.EventObject)}},scope:this}});this.okButton=new Ext.Button({id:a.id+"-ok-button",metadataId:8029,minWidth:75,formBind:true,handler:function(d){var c=d.ownerCt.ownerCt.ownerCt;c.setDisabled(true);TI.Common.ajax({url:gTrackItWebRoot+"Account/AutoCreate",method:"POST",params:{newLoginId:b,fullName:c.fullName.getValue(),newPassword:c.newPassword.getValue(),confirmNewPassword:c.confirmNewPassword.getValue()}},this,function(e,f){if(f.errorMessage){c.setDisabled(false);Ext.Msg.show({title:$T(8030),msg:f.errorMessage,buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR,fn:function(g){if(f.loginIdAlreadyExists){c.close()}}})}else{window.location=gTrackItWebRoot+"Application/Main"}},function(g,e,f){c.setDisabled(false);return false})}});this.cancelButton=new Ext.Button({id:a.id+"-cancel-btn",metadataId:8032,minWidth:75,handler:function(c){c.ownerCt.ownerCt.ownerCt.close()}});Ext.apply(a,{items:[{xtype:"form",id:a.id+"-form-panel",unstyled:true,labelAlign:"top",border:false,autoHeight:true,monitorValid:true,defaults:{anchor:"-10"},items:[this.label1,{xtype:"spacer",height:15},this.label2,{xtype:"spacer",height:15},this.userId,this.fullName,this.newPassword,this.confirmNewPassword],buttons:[this.okButton,this.cancelButton]}]});SelfService.AutoCreateDialog.superclass.constructor.call(this,a)}});function submitLogInForm(){var b=Ext.getCmp("login-panel");var d=b.getForm();if(d.isValid()){Ext.getCmp("login-error").setText("");Ext.getCmp("login-progress").setText($T(2050));Ext.getCmp("login-button").setDisabled(true);var c=d.getValues().username;var a=new Date();a.setFullYear(a.getFullYear()+10);Ext.util.Cookies.set("SSUserName",c,a);d.submit({url:gTrackItWebRoot+"Account/LogIn",method:"post",timeout:300000,params:{rememberMe:true,isTrusted:false},success:function(f,g){var h=g.result.data;if(h&&h.errorMessage){Ext.getCmp("login-progress").setText("");Ext.getCmp("login-button").setDisabled(false);Ext.getCmp("login-user").focus();Ext.getCmp("login-user").selectText();if(allowAutoCreate&&h.userNotFound===true){var i=new SelfService.AutoCreateDialog(Ext.getCmp("login-user").getValue());i.show()}else{Ext.getCmp("login-error").setText(h.errorMessage)}}else{var e=gTrackItWebRoot+"Application/Main";if(!Ext.isEmpty(startPath)){e+="?startPath="+startPath}window.location=e}},failure:function(e,f){Ext.getCmp("login-progress").setText("");Ext.getCmp("login-button").setDisabled(false);Ext.Msg.alert($T(8089),String.format($T(8090),f.response.status,f.response.statusText))}})}}Ext.onReady(function(){Ext.QuickTips.init();var c=Ext.util.Cookies.get("SSUserName");var b=new Ext.Panel({id:"login-inset",layout:"absolute",bodyCssClass:"login-inset-body",border:false,height:380,width:480,renderTo:"login-form",items:[{xtype:"form",frame:false,id:"login-panel",monitorValid:true,stateful:false,unstyled:true,x:40,y:27,items:[{id:"company-small-logo",width:134,height:25,border:false},{xtype:"spacer",height:32},{id:"login-header",xtype:"label",metadataId:8091,stateful:false},{xtype:"spacer",height:25},{id:"login-user",xtype:"textfield",name:"username",metadataId:623,width:221,msgTarget:"side",value:Ext.isEmpty(c)?undefined:c,stateful:false},{id:"login-password",xtype:"textfield",name:"password",metadataId:624,width:221,inputType:"password",stateful:false},{id:"login-button",xtype:"button",metadataId:625,width:92,handler:submitLogInForm,stateful:false},{id:"login-windows-auth-link",xtype:"label",width:325,cls:"x-form-item",html:String.format('<div style="width:100%; text-align:right"><a href="{0}">{1}</a></div>',windowsAuthPath,$T(8379)),stateful:false},{xtype:"spacer",height:17},{id:"login-progress",xtype:"label",stateful:false},{id:"login-error",xtype:"label",width:365,cls:"x-form-item",text:errorMessage,stateful:false}]}]});if(Ext.isEmpty(c)){Ext.getCmp("login-user").focus()}else{Ext.getCmp("login-password").focus()}var d=new Ext.KeyMap("login-panel",{key:Ext.EventObject.ENTER,fn:submitLogInForm});var a=new Ext.Viewport({listeners:{resize:function(){b.getEl().center(Ext.getBody())}}})});
