<?xml version="1.0" encoding="utf-8"?>
<Button xmlns="commonLibrary.sharedComponent.*" xmlns:mx="http://www.adobe.com/2006/mxml" 
	label="{ScreenItemName.BTN_ZOOM_NAME}"
	click="onClick(event)"
	>
	<mx:Script>
		<![CDATA[
			import mx.controls.TextInput;
			import mx.containers.Box;
			import cls.com.ils.common.component.IlsDataGrid;
			import cls.com.ils.common.component.IlsHBox;
			import cls.com.ils.biz.model.enum.ScreenItemName;
			import cls.com.ils.biz.component.TsAbstructPanel;

			private var _relatedObject:Object	            

			override protected function focusInHandler(event:FocusEvent):void{
				_relatedObject = event.relatedObject.parent;
				super.focusInHandler(event);
			}
			
			public function set relatedObject(value:Object):void{
				_relatedObject = value;
			}
			
			public function get relatedObject():Object{
				return _relatedObject;			
			}

			private function onClick(e:MouseEvent):void{

		        var parent:DisplayObject;
				
	            if (_relatedObject is TsTextInput)
	            {
	                _relatedObject.setFocus();

			        parent = _relatedObject.document;
	
			        for(var i:int = 0; i < 7; i++) {
			            if (parent is TsAbstructPanel)
			            {
			            	if(_relatedObject.zoomObj){
				            	//子画面起動
								TsAbstructPanel(parent).dispChildWindowDparam(_relatedObject.zoomObj,_relatedObject.translationLookUp,_relatedObject.translationTarget);
				                //呼び出し元
				                _relatedObject.zoomObj(TsAbstructPanel(parent).childWin).ownerData = _relatedObject.translationTarget;
		            		}else{
				            	//子画面起動
								TsAbstructPanel(parent).dispChildWindowDparam(ZoomPanel,_relatedObject.translationLookUp);
				                //呼び出し元
				                ZoomPanel(TsAbstructPanel(parent).childWin).ownerData = _relatedObject.document;			            		
			            	}
			                return;
			            }else{
				            parent = parent.parent;	            
			            }
			        }			            								

	            }else if(_relatedObject is TextInputEditor){
	            	
	                _relatedObject.owner.setFocus();

			        parent = _relatedObject.owner.parentDocument;

		            if (parent is TsAbstructPanel)
		            {
		            	//子画面起動
						TsAbstructPanel(parent).dispChildWindowDparam(_relatedObject.zoomObj,_relatedObject.translationLookUp,_relatedObject.translationTarget);
		                //呼び出し元
		                _relatedObject.zoomObj(TsAbstructPanel(parent).childWin).ownerData = _relatedObject.translationTarget;		           
		                return;
		            }

	            }

			}
			
		]]>
	</mx:Script>	
</Button>
