<script language="javascript">
<?php
  include( create_checkBox_control( $modo_RAD ) );
?>
/**
 *  checkBox_mouseClick()
 */
function checkBox_mouseClick( objID )
{
  //alert(objID);
  if( objID.indexOf('checkBox') != -1 )
  {
    

  }// End if( objID.indexOf('checkBox') != -1 )
}// End function checkBox_mouseClick( objID )

/**
 *  checkBox_mouseDown()
 */
  function checkBox_mouseDown( objID )
  {
    if( objID.indexOf('checkBox') != -1 )
    {

    }
  }// End function checkBox_mouseDown( objID )

/**
 *  checkBox_mouseUp()
 */
  function checkBox_mouseUp( objID )
  {
    if( objID.indexOf('checkBox') != -1 )
    {

    }
  }// End function checkBox_mouseUp( objID )

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

/**
 *  checkBox_mouseOut()
 */
  function checkBox_mouseOut( objID )
  {
    if( objID.indexOf('checkBox') != -1 )
    {
      if( objID.indexOf('label') != -1 )
      {
        labelDOM = findDOM(objID,1);
        labelDOM.backgroundColor="#FAFAFF";

      }// End if( objID.indexOf('label') != -1 )
    }// End if( objID.indexOf('checkBox') != -1 )
  }// End function checkBox_mouseOut( objID )

 /**
  *  checkBox_mouseMove()
  */
  function checkBox_mouseMove( objID )
  {
    if( objID.indexOf('checkBox') != -1 )
    {

    }
  }// End function checkBox_mouseMove( objID )


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

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

	  if ( objID.substr( ix -2, 1 ) == 'x' )
 	  {
 	    nx = 1;
  	}else
  	{
   	 	nx = 2;
  	}// Endif
  	alert( objID.substr( ix - nx, nx ) );
  	//alert( 'ccheckBox: '+ ret );

	  return objID.substr( ix -nx, nx );

	}// End function get_checkBox( objID )



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


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

	  	nValue = objDOM.getAttribute('checked');
//			alert( nValue );

 	  }// End if( objID.indexOf( 'checkBox' ) != -1 )
		return( objDOM.checked );
	}// End function getCheckBox_checked( objID )


  /**
   *  Metodo getCheckBox_checked
   *  configura o valor atual do checkBox
   */
	function setCheckBox_checked( objID, status )
	{

  	if( objID.indexOf( 'checkBox' ) != -1 )
  	{
		   if( objID.indexOf('_') == -1 )
  		{
    		nObj = objID + '_Check';
  		}else
  		{
    		nObj = objID;
  		}// End if( objID.indexOf('_') == -1 )
  		objDOM = findDOM( nObj, 0 );
  		
  		objDOM.checked = status;

			alert( objDOM.checked );

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

	}// End function setCheckBox_checked( objID, status )


  /**
   *  Metodo getCheckBox_caption
   *  retorna o valor atual do Caption
   */
  function getCheckBox_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_checkBox( nObj ) <= 9 )
					{
        		nCaption = nCaption.substr(23, 1) + nCaption.slice(31);
        		alert( nCaption );
        	}else
        	{
						x = get_checkBox( nObj );
						y = x.length;
        	  nCaption = nCaption.substr(23 + ( y - 1 ), 1) + nCaption.slice(31 + ( y - 1 ) );
        		alert( nCaption );

        	}// End if( get_checkBox( nObj ) <= 9 )
      	}else
      	{
          if( get_checkBox( 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 setCheckBox_caption
   *  configura um valor para o Caption
   */
  function setCheckBox_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 setCheckBox_caption( nObj, nCaption )


  /**
   * Metodo setCheckBox_enabled
   * configura o valor de habilitação do checkBox
   */
  function setCheckBox_enabled( nObj, status )
  {
    if( nObj.indexOf('_') == -1 )
    {
      objID = nObj + '_Check';
      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 setCheckBox_enabled( nObj, status )


  /**
   * Metodo setCheckBox_visible
   * configura o valor de visibilidade do checkBox
   */
  function setCheckBox_visible( nObj, status )
  {
    if( nObj.indexOf('_') == -1 )
    {
      objID = nObj;
    }else
    {
      objID = nObj;
    }// End if( nObj.indexOf('_') == -1 )
    objDOM = findDOM( objID, 1 );
    if( status )
    {
      objDOM.visibility = "inherit";
    }else
    {
      objDOM.visibility = "hidden";
    }// End if( status == 'visible' )

  }// End function setCheckBox_visible( nObj, status )

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

</script>
