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


  }// End if( objID.indexOf('radioButton') != -1 )
}// End function radioButton_mouseClick( objID )

/**
 *  radioButton_mouseDown()
 */
  function radioButton_mouseDown( objID )
  {
    if( objID.indexOf('radioButton') != -1 )
    {

    }
  }// End function radioButton_mouseDown( objID )

/**
 *  radioButton_mouseUp()
 */
  function radioButton_mouseUp( objID )
  {
    if( objID.indexOf('radioButton') != -1 )
    {

    }
  }// End function radioButton_mouseUp( objID )

/**
 *  radioButton_mouseOver()
 */
  function radioButton_mouseOver( objID )
  {
    if( objID.indexOf('radioButton') != -1 )
    {

    }// End if( objID.indexOf('radioButton') != -1 )
  }// End function radioButton_mouseOver( objID )

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

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

 /**
  *  radioButton_mouseMove()
  */
  function radioButton_mouseMove( objID )
  {
    if( objID.indexOf('radioButton') != -1 )
    {

    }
  }// End function radioButton_mouseMove( objID )


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

  /**
 	 * retorna o numero do radioButton
 	 */
	function get_RadioButton( objID )
	{
    ix = objID.indexOf('_');

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

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

	}// End function get_radioButton( objID )



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


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

			alert( objDOM.checked );

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


  /**
   *  Metodo setRadioButton_checked
   *  configura o valor atual do radioButton

	function setRadioButton_checked( objID, status )
	{

  	if( objID.indexOf( 'radioButton' ) != -1 )
  	{
		   if( objID.indexOf('_') == -1 )
  		{
    		nObj = objID;
  		}else
  		{
    		nObj = objID;
  		}// End if( objID.indexOf('_') == -1 )
  		objDOM = findDOM( nObj, 0 );

  		objDOM.checked = status;

			alert( objDOM.checked );

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

	}// End function setRadioButton_checked( objID, status )
*/

  /**
   *  Metodo getRadioButton_caption
   *  retorna o valor atual do Caption
   */
  function getRadioButton_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_RadioButton( nObj ) <= 9 )
					{
        		nCaption = nCaption.substr(26, 1) + nCaption.slice(34);
        		alert( nCaption + " <=<=");
        	}else
        	{
						x = get_RadioButton( nObj );
						y = x.length;
        	  nCaption = nCaption.substr(26 + ( y - 1 ), 1) + nCaption.slice(34 + ( y - 1 ) );
        		alert( nCaption + " >>>>");

        	}// End if( get_RadioButton( nObj ) <= 9 )
      	}else
      	{
          if( get_RadioButton( nObj ) <= 9 )
					{
	        	ini = nCaption.indexOf('<');
	        	//fim = nCaption.indexOf('>');
  	      	nCaption = nCaption.substr(0, ini) + nCaption.substr(ini + 27, 1) + nCaption.slice(ini + 35);
 	        	alert( nCaption + ' Entrou no else');
 	        
					}else
					{
					
						ini = nCaption.indexOf('<');
		        	//fim = nCaption.indexOf('>');
  	      	nCaption = nCaption.substr(0, ini) + nCaption.substr(ini + 27, 1) + nCaption.slice(ini + 35);
 	 	        alert( nCaption + ' Entrou no else');
 	        
					}// End if( get_RadioButton( nObj ) <= 9 )
  	    }// End if(nCaption.substr(0, 1) == '<')
    	}else
    	{
      	alert( nCaption );
    	}// End if( ix != -1)
  	}// End if( hotkey_ !== '' && hotkey_ !== null )

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


  /**
   *  Metodo setRadioButton_caption
   *  configura um valor para o Caption
   */
  function setRadioButton_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 setRadioButton_caption( nObj, nCaption )


  /**
   * Metodo setRadioButton_enabled
   * configura o valor de habilitação do radioButton
   */
  function setRadioButton_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 setRadioButton_enabled( nObj, status )


  /**
   * Metodo setRadioButton_visible
   * configura o valor de visibilidade do radioButton
   */
  function setRadioButton_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 )

  }// End function setRadioButton_visible( nObj, status )

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


</script>
