<script language="javascript">
<?php
  include( create_textArea_control( $modo_RAD ) );
?>
/**
 *  textArea_mouseClick()
 */
function textArea_mouseClick( objID )
{
  if( objID.indexOf('textArea') != -1 )
  {
  
  }// End if( objID.indexOf('textArea') != -1 )
}// End function textArea_mouseClick( objID )

/**
 *   textArea_mouseDown()
 */
  function textArea_mouseDown( objID )
  {
    if( objID.indexOf('textArea') != -1 )
    {

    }// End if( objID.indexOf('textArea') != -1 )
  }// End function textArea_mouseDown( objID )

/**
 *  textArea_mouseUp()
 */
  function textArea_mouseUp( objID )
  {
    if( objID.indexOf('textArea') != -1 )
    {

    }// End if( objID.indexOf('textArea') != -1 )
  }// End function textArea_mouseUp( objID )

/**
 *  textArea_mouseOver()
 */
  function textArea_mouseOver( objID )
  {
    if( objID.indexOf('textArea') != -1 )
    {
      //textArea
    }
  }// End function textArea_mouseOver( objID )

/**
 *  textArea_mouseOut()
 */
  function textArea_mouseOut( objID )
  {
    if( objID.indexOf('textArea') != -1 )
    {
      
    }
  }// End function textArea_mouseOut( objID )

/**
 *  textArea_mouseMove()
 */
  function textArea_mouseMove( objID )
  {
    if( objID.indexOf('textArea') != -1 )
    {

    }
  }// End function textArea_mouseMove( objID )


//  ------------------------------------------------------------  //
//  Lista de Métodos do Componente                                //
//  Conjunto de funções para manipular as propriedades do Objeto  //
//  ------------------------------------------------------------  //

	/*
 	* retorna o numero do textArea
 	*/
	function get_textArea( objID )
	{
  	ix = objID.indexOf('_');
  	if ( ix == -1 )
  	{
    	ix = objID.length;
  	}//End if ( ix == -1 )

  	if ( objID.substr( ix -2, 1 ) == 'a' )
  	{
    	nx = 1;
  	}else
  	{
    	nx = 2;
  	}// End   if ( ix == -1 )
  	alert( objID.substr( ix -nx, nx ) );

    return objID.substr( ix -nx, nx );
  
	}// End function get_textArea( objID )


	function setTexto_textArea( obj, txt )
	{
  	if( obj.indexOf( 'textArea' ) != -1 )
  	{
   		nrArea = get_textArea( obj );

    	cmd = obj + '_Texto.innerHTML = "' + txt +'"';
    	eval( cmd );

//    textArea_selected = nrArea;
	  }// end if( obj.indexOf( 'textArea' ) != -1 )
	}// End function setTexto_textArea( obj, txt )

	function getTexto_textArea( obj )
	{
  	ret = "";
  	if( obj.indexOf( 'textArea' ) != -1 )
  	{
	//    cmd = "ret = " + obj + "_Texto.innerHTML";
  	}// End if( obj.indexOf( 'textArea' ) != -1 )

	  return ret;
	}// End function getTexto_textArea( obj )



//  Conjunto de funções para manipular as propriedades do Objeto  //
//  ------------------------------------------------------------  //

	function setTextArea_reset( objID )
	{
  	if( objID.indexOf( 'textArea' ) != -1 )
	  {
  		nObj = objID + '_Texto';
  	  nObj = findDOM( nObj, 0 );
	//    alert( nObj );
			nObj.innerHTML = '';

  	}// End if( objID.indexOf( 'textArea' ) != -1 )
	}// End function setTextArea_reset( objID )

	function setTextArea_value( objID, txt )
	{
 		var objTexto = null;
  
  	if( objID.indexOf( 'textArea' ) != -1 )
  	{
   		nObj = objID + '_Texto';
    	objTexto = findDOM( nObj, 0 );
    	old = objTexto.innerHTML;

	    if( old != txt )
  	  {
    	  if( txt == '') txt = ' ';
      	objTexto.focus();
      	objTexto.innerHTML = txt;
      	objTexto.blur();

	    }// End if( old != txt )

	  }// End if( objID.indexOf( 'textArea' ) != -1 )

	}// End function setTextArea_value( objID, txt )


	/**
 	*  getTextArea_value()
 	*/
	function getTextArea_value( objID )
	{
		var objTexto = null;
	
	  if( objID.indexOf( 'textArea' ) != -1 )
  	{
    	nObj = objID + '_Texto';
    	objTexto = findDOM( nObj, 0 );
     
 	    alert('nObjt: '+ objTexto.innerHTML );

	    return objTexto.innerHTML;
	  }// End if( objID.indexOf( 'textArea' ) != -1 )

	}// End function getTextArea_value( objID )



  /**
   *  Metodo getTextArea_caption
   *  retorna o valor atual do Caption
   */
  function getTextArea_caption( nObj )
	{
 	  if( nObj.indexOf('_') == -1 )
  	{
    	objID = nObj + '_Caption';
  	}else
  	{
    	objID = nObj;
  	}// End if( nObj.indexOf('_') == -1 )
  	objDOM = findDOM( objID, 0 );

	  // retirar a hotkey
  	nCaption = objDOM.innerHTML;

	  hotkey_ = objDOM.getAttribute('accesskey');
  	if( hotkey_ !== '' && hotkey_ !== null )
  	{
    	ix = nCaption.toLowerCase().indexOf( hotkey_ );
    	if( ix != -1)
    	{
      	if(nCaption.substr(0, 1) == '<')
      	{
					if( get_textArea( nObj ) <= 9 )
					{
        		nCaption = nCaption.substr(23, 1) + nCaption.slice(31);
        		alert( nCaption + " <=<=");
        	}else
        	{
						x = get_textArea( nObj );
						y = x.length;
        	  nCaption = nCaption.substr(23 + ( y - 1 ), 1) + nCaption.slice(31 + ( y - 1 ) );
        		alert( nCaption + " >>>>");

        	}// End if( get_textArea( nObj ) <= 9 )
      	}else
      	{
          if( get_textArea( nObj ) <= 9 )
					{
	        	ini = nCaption.indexOf('<');
	        	//fim = nCaption.indexOf('>');
  	      	nCaption = nCaption.substr(0, ini) + nCaption.substr(ini + 24, 1) + nCaption.slice(ini + 32);
 	        	alert( nCaption + ' Entrou no else');

					}else
					{

						ini = nCaption.indexOf('<');
		        	//fim = nCaption.indexOf('>');
  	      	nCaption = nCaption.substr(0, ini) + nCaption.substr(ini + 24, 1) + nCaption.slice(ini + 32);
 	 	        alert( nCaption + ' Entrou no else');

					}// End if( get_checkBox( nObj ) <= 9 )
  	    }// End if(nCaption.substr(0, 1) == '<')
    	}else
    	{
      	alert( nCaption );
    	}// End if( ix != -1)
  	}// End if( hotkey_ !== '' && hotkey_ !== null )

		return '';
	}// End function getCheckBox_caption( nObj )


	

  /**
   *  Metodo setTextArea_caption
   *  configura um valor para o Caption
   */
  function setTextArea_caption( nObj, nCaption )
  {

		if( nObj.indexOf('_') == -1 )
    {
      objID = nObj + '_Caption';
    }else
    {
      objID = nObj;
    }// End if( nObj.indexOf('_') == -1 )

    objDOM = findDOM( objID, 0 );

    /**
     *  atualiza a Hotkey
     */
    hot_key_ = objDOM.getAttribute('accesskey');

    if( hot_key_ !== '' && hot_key_ !== null )
    {
      /* verifica se hotkey existe no novo caption */
      ix = nCaption.toLowerCase().indexOf( hot_key_ );
      if( ix != -1 )
      {
        nomeObj = nObj.slice(0, nObj.indexOf('_') );
        if( ix == 0 )
        {
          nCaption = '<span id="'+nomeObj+'_key">'+ nCaption.slice(0, 1)+ '</span>' + nCaption.slice(1);
        }else
        {
          nCaption = nCaption.slice(0, ix) + '<span id="'+nomeObj+'_key">'+ nCaption.substr( ix, 1 )+ '</span>' + nCaption.slice(ix + 1);
        }// End if( ix == 0 )
      }// End if( ix != -1 )
    }// End if( hotkey !== '' && hotkey !== null )

//    alert( objDOM.value );
    objDOM.innerHTML = nCaption;
  }// End function setTextArea_caption( nObj, nCaption )


  /**
   * Metodo setTextArea_enabled
   * configura o valor de habilitação do textArea
   */
  function setTextArea_enabled( nObj, status )
  {
    if( nObj.indexOf('_') == -1 )
    {
      objID = nObj + '_Texto';
      objIDCap = nObj + '_Caption';
    }else
    {
      objID = nObj;
      objIDCap = nObj;
    }// End if( nObj.indexOf('_') == -1 )

    objDOM = findDOM( objID, 0 );
    objDOMCap = findDOM( objIDCap, 0 );

    
    objDOM.disabled = !(status);
    objDOMCap.disabled = !(status);
    
	}// End function setTextArea_enabled( nObj, status )


  /**
   * Metodo setTextArea_visible
   * configura o valor de visibilidade do textArea
   */
  function setTextArea_visible( nObj, status )
  {
    if( nObj.indexOf('_') == -1 )
    {
      objID = nObj + '_Texto';
      objIDCap = nObj + '_Caption';
    }else
    {
      objID = nObj;
      objIDCap = nObj;
    }// End if( nObj.indexOf('_') == -1 )
    objDOM = findDOM( objID, 1 );
    objDOMCap = findDOM( objIDCap, 1 );
    if( status == 'true' )
    {
      objDOM.visibility = "inherit";
      objDOMCap.visibility = "inherit";
    }else
    {
      objDOM.visibility = status;
      objDOMCap.visibility = status;
    }// End if( status == 'visible' )


  }// End function setTextArea_visible( nObj, status )


 /**
   * Metodo getTextArea_index
   * retorna o indice
   */
  function getTextArea_index( objID )
  {
    ix = objID.indexOf('_');
    if( ix != -1 )
    {
      idx = objID.slice( 8, ix );
    }else
    {
      idx = objID.slice( 8 );
    }// End if( ix != -1 )
    return (parseInt(idx) - 1);
  }// End function getTextArea_index( objID )

</script>
