/* * * GrapeCity InputMan Library 1.0.0 * http://grapecity.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * **/ var GCIM;(function(n){var t=function(){function n(n){this.City=n.City,this.CityKana=n.CityKana,this.Town=n.Town,this.TownKana=n.TownKana,this.Area=n.Area,this.AreaKana=n.AreaKana,this.Prefecture=n.Prefecture,this.PrefectureKana=n.PrefectureKana,this.ZipCode=n.ZipCode,this.JISCode=n.JISCode,this._isCompanyAddressInfo=!1,(n.IsCompanyKanaEmpty===!1||n._isCompanyAddressInfo===!0)&&(this.CompanyName=n.CompanyName,this.CompanyKana=n.CompanyKana,this._branchName=n.BranchName,this._zipCodeType=n.ZipCodeType==0?"Office":"PostOfficeBox",this._isCompanyAddressInfo=!0)}return n.prototype.GetCity=function(){return this.City},n.prototype.GetCityKana=function(){return this.CityKana},n.prototype.GetTown=function(){return this.Town},n.prototype.GetTownKana=function(){return this.TownKana},n.prototype.GetArea=function(){return this.Area},n.prototype.GetAreaKana=function(){return this.AreaKana},n.prototype.GetPrefecture=function(){return this.Prefecture},n.prototype.GetPrefectureKana=function(){return this.PrefectureKana},n.prototype.GetZipCode=function(){return this.ZipCode},n.prototype.GetJISCode=function(){return this.JISCode},n.prototype.GetIsCompanyAddressInfo=function(){return this._isCompanyAddressInfo},n.prototype.GetCompanyName=function(){return this.CompanyName?this.CompanyName:null},n.prototype.GetCompanyKana=function(){return this.CompanyKana?this.CompanyKana:null},n.prototype.GetBranchName=function(){return this._branchName?this._branchName:null},n.prototype.GetZipCodeType=function(){return this._zipCodeType?this._zipCodeType:null},n}();n.AddressInfo=t})(GCIM||(GCIM={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var t=function(t){function i(n,i,r){t.call(this,n,i,r)}return __extends(i,t),i.prototype._getComponentType=function(){return n.IMControlType.Postal},i.prototype._beginInit=function(){t.prototype._beginInit.call(this),this._addresses=null,this._addressKey="",this._ignoreCached=!1,this._cachedAddress=null,this._cachedAddressKey=""},i.prototype._endInit=function(){n.Utility.__isPostCallBack=!1,t.prototype._endInit.call(this)},i.prototype.GetAddresses=function(){return this.CloneAddress(this._addresses)},i.prototype.CloneAddress=function(t){var r=[],i;if(t!==null)for(i=0;i0&&(u=t[0].Prefecture+t[0].City+t[0].Town+t[0].Area,f=t[0].PrefectureKana+t[0].CityKana+t[0].TownKana+t[0].AreaKana,(this._queryMode=="CompanyZipCode"||this._queryMode=="Both")&&(t[0].CompanyName&&(u+=t[0].CompanyName),t[0].CompanyKana&&(f+=t[0].CompanyKana)));if(i==!0){r={},r.Cancel=!1,r.OutputAddress=u,r.OutputAddressKana=f,n.Utility.FireEvent(this,this._specialClientEvents.AddressOutputting,r,"AddressOutputting");if(r.Cancel)return;u=r.OutputAddress,f=r.OutputAddressKana}this._addressOutput&&this._updateResult(this._addressOutput,u),this._addressKanaOutput&&this._updateResult(this._addressKanaOutput,f)},i._onReceiveServerData=function(t,i){n.Utility.__isPostCallBack=!1;var u=i,r=n.Utility.FindIMControl(u);r._receiveServerData(t,null)},i.prototype._receiveServerData=function(t,i,r){var u=t.split("$"),e=n.Utility.Trim(this.GetValue()),f;if(u.length==2){this._addresses=null,u[1]!=""&&alert(u[1]);return}r&&(u[2]=this.Value);if(u.length<3)u.length==1&&(this._addresses=null);else{try{eval("var address = "+this._htmlDecode(u[1])+";this._cachedAddress = address;")}catch(o){}this._cachedAddressKey=u[2],f=this._filterAddress(e),this._addresses=f,this._ignoreCached==!0&&(this._cachedAddress=null,this._cachedAddressKey="")}this._addressKey=e,this._processAddress(this._addresses,!0)},i.prototype._updateResult=function(t,i){var u,r;if(t!=null&&t.length>0){u=n.Utility.FindIMControl(t);if(u!=null)try{u.SetText(i)}catch(f){}else r=document.getElementById(t),r!=null&&(r.value=i)}},i.prototype._errorCallBack=function(){n.Utility.__isPostCallBack=!1},i.prototype._initWithServerData=function(i){var r=this;t.prototype._initWithServerData.call(this,i),i.Addresses!==undefined&&(this._addresses=i.Addresses),i.AddressOutput!==undefined&&(this._addressOutput=i.AddressOutput),i.AddressKanaOutput!==undefined&&(this._addressKanaOutput=i.AddressKanaOutput),i.QueryMode!==undefined&&(this._queryMode=i.QueryMode),i.SplitAreaDetails!==undefined&&(this._splitAreaDetails=i.SplitAreaDetails),i.GenerateCompanyAddressKana!==undefined&&(this._generateCompanyAddressKana=i.GenerateCompanyAddressKana),i.ZipCodeCharType!==undefined&&(this._zipCodeCharType=i.ZipCodeCharType),i.ClientEvents!==undefined&&(this._specialClientEvents.AddressOutputting=i.ClientEvents.AddressOutputting),i.Value!==undefined&&(this._addressKey=i.Value,this.SetValue(i.Value)),i.Result!==undefined&&n.Utility.AddDocumentLoadTask(function(){r._receiveServerData(i.Result,null,!0)},10)},i}(n.GcMask);n.GcPostal=t})(GCIM||(GCIM={})) if(typeof(Sys)!='undefined' && typeof(Sys.Application) != 'undefined'){Sys.Application.notifyScriptLoaded();};