<script language="javascript">

<?php 
  include( create_tabControl_control( $modo_RAD ) );
?> 

/**
 *  tabControl_mouseClick()
 */  
function tabControl_mouseClick( objID )
{
  if( objID.indexOf('tabControl') != -1 &&
        objID.indexOf('ABA') != -1  )
  {
    nrAba = retNrAba( objID );
    ix    = objID.indexOf('_');;
    idxTab = parseInt(objID.substr(ix-1, 1))-1;
//alert(idxTab);
//alert(objID+' aba: '+nrAba);
//alert(tabControl_selected[idxTab]);
//alert(objID+' tab: '+idxTab);

    if ( nrAba != tabControl_selected[idxTab] )
    {
      for(i=1; i <= tabControl_nrTabs[idxTab]; i ++)
      {
        idx = idxTab +1;
        var nTab = "tabControl" + idx + "_TAB" + i;
        var nAba = "tabControl" + idx + "_ABA" + i; 
          
        var tabSTYLE = findDOM( nTab, 1 );
        var abaSTYLE = findDOM( nAba, 1 );
          
        abaSTYLE.borderTop = "1px solid #FFFFFF";

        tabSTYLE.zIndex = 10;
        abaSTYLE.zIndex = 10;
        abaSTYLE.top    = '9px';
          
        if( i == nrAba )
        {
          tabSTYLE.zIndex = 100;
          abaSTYLE.zIndex = 110;
          abaSTYLE.top = '7px';
          tabControl_selected[idxTab] = i;
        }// end if()
      }// End for()
    }// End if()
    
  }// end if() 
}// end function
  
/**
 *  tabControl_mouseOver()  -----------------------------------------------  //
 */  
function tabControl_mouseOver( objID )
{
    if( objID.indexOf('tabControl') != -1 &&
        objID.indexOf('ABA') != -1
       )
    {
//alert(objID);
      var objDOM   = findDOM( objID, 0 );
      var objSTYLE = findDOM( objID, 1 );
      objDOM.style.color = "#000096" ;
      objSTYLE.cursor = "default";
    }
}// End function

/**
 *  tabControl_mouseOut()  ------------------------------------------------  //
 */  
function tabControl_mouseOut( objID )
{
//alert(objID);
  if( objID.indexOf('tabControl') != -1 &&
        objID.indexOf('ABA') != -1
       )
  {
    var objDOM = findDOM( objID, 0 );
    objDOM.style.color = "#000000" ;
  }
}// end function
  
  
/**
 *  funções auxiliares
 *  ------------------------------------------------------------------------  //
 */
function retNrAba( objID )
{
  var nr = null;
  ix = objID.length;
  ix1 = objID.indexOf( '_' );
  ix2 = objID.indexOf( '_', ix1 + 1 );

  if( ix2 == -1 )
  {
    nr = objID.slice( ix1 + 4 );
  }else
  {
    nr = objID.slice( ix1 + 4, ix2 );
  }
  return nr;
}// End


function getTabControl_nrAba( objID )
{
  var nr = null;
  ix = objID.length;
  ix1 = objID.indexOf( '_' );
  ix2 = objID.indexOf( '_', ix1 + 1 );

  if( ix2 == -1 )
  {
    nr = objID.slice( ix1 + 4 );
  }else
  {
    nr = objID.slice( ix1 + 4, ix2 );
  }
  return nr;
}// End

</script>
            
