dojo.provide("parus.balanceConsolidatedReportDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.require("parus.customEdit");dojo.declare("parus.balanceConsolidatedReportDialog",[parus.Dialog],{_agentCodeLoaded:false,_agentNameLoaded:false,agentsChanged:function(a){if(a){if(a.disabled){return}}if((this.agentCodeEdit.value=="")&&(this.agentNameEdit.value=="")){this.agentCodeEdit.attr("disabled",false);this.agentNameEdit.attr("disabled",false)}else{if((this.agentCodeEdit.value!="")&&(a.dojoAttachPoint=="agentCodeEdit")){if(this._agentCodeLoaded){this._agentCodeLoaded=false}else{this.agentNameEdit.attr("disabled",true);this.agentNameEdit.attr("value",null)}}else{if((this.agentNameEdit.value!="")&&(a.dojoAttachPoint=="agentNameEdit")){if(this._agentNameLoaded){this._agentNameLoaded=false}else{this.agentCodeEdit.attr("disabled",true);this.agentCodeEdit.attr("value",null)}}}}setTimeout(dojo.hitch(this,function(){var b=parus.parus8.rowNodes(parus.database.execute("getAgentInfo",{AGENT_CODE:this.agentCodeEdit.disabled?"":this.agentCodeEdit.value,AGENT_NAME:this.agentNameEdit.disabled?"":this.agentNameEdit.value}))[0];if(this.agentCodeEdit.disabled){this.agentCodeEdit.attr("value",parus.parus8.nodeField(b,"RAGNABBR"))}if(this.agentNameEdit.disabled){this.agentNameEdit.attr("value",parus.parus8.nodeField(b,"RAGNNAME"))}if(this.agentHeadEdit.disabled){this.agentHeadEdit.attr("value",parus.parus8.nodeField(b,"RHEAD"))}if((this.agentCodeEdit.value=="")&&(this.agentNameEdit.value=="")){this.agentCodeEdit.attr("disabled",false);this.agentNameEdit.attr("disabled",false)}}),100)}});