/**
 * TextArea校验组件
 * js组件：TextAreaObj.js
 * 应用例子：TextArea.html
 * 属性：isNull：是否为空。 当为NO时不可以为空，需要非空校验；当为YES时可以为空，不需要非空校验。
 *       fixLength: 输入固定长度。
 * 说明：1、支持输入固定长度，如果超出固定长度，则禁止输入。
 *       2、支持粘贴，拷贝。     
 * 
 * @author   lixiangyu@neusoft.com,2003.04
 * 修改履历: micy@neusoft.com	2003.07.21
 *				 hugh@neusoft.com
 */

 function TextAreaObj(editerObj){
	
	//定义输入对象
	this.edtObj = editerObj;
    	
	
	//公共方法
	this.getParentObj = TAO_getParentObj;
	this.getBaseObj = TAO_getBaseObj;
	
	this.onvalidate = TAO_onvalidate;
	
	this.onReady = TAO_onContentReady;
	this.doKeypress = TAO_doKeypress;
 	this.eventBand = TAO_eventBand;
	
	
	//私有方法
	
	//私有对象
    var ParObj=null;
    var BasObj=null;
	}

 	function TAO_getParentObj(){
    	if(this.ParObj==null){
    		this.ParObj = new BaseObj(this.edtObj);
    		}
    		return this.ParObj;	
   	}
   function TAO_getBaseObj(){
   	if(this.BasObj==null){
   		this.BasObj = new BaseObj(this.edtObj);
   		}
   	return this.BasObj;
   	}

       function TAO_onvalidate() {
	    //调用Base.htc中的公用函数检查isNullable属性
	 	//if(!this.getBaseObj().checkEmpty())	return false;
      // return true;
           return this.getBaseObj().commonCheck();  
       }
       

     // Keep user from entering more than maxLength characters
     function TAO_doKeypress(){     
     	var maxLength = this.edtObj.getAttribute("maxLength");
        
     	if(maxLength == null) return true;
     	if(!isNaN(parseInt(maxLength,10))){
     		maxLength = parseInt(maxLength,10);
      	if(this.edtObj.value.length>=maxLength)
        {
            //alert(this.edtObj.value);
            window.event.keyCode = 0 ;
         	this.edtObj.value=this.edtObj.value.substr(0,maxLength);
	     }
     }
   }
     
     
     function TAO_onContentReady(){
     	 //调用ParentObj 的初始化方法   	 
    	 this.getParentObj().onReady();
     	}
     function TAO_eventBand(){
     	  this.getBaseObj().eventBand("onkeypress","doKeypress()");     	
     	}
